text
stringlengths
2
1.05M
import { isFunction, isString } from './type'; export const encodeHtml = (function() { const encodeRegExp = [new RegExp('&', 'g'), new RegExp('"', 'g'), new RegExp('\'', 'g'), new RegExp('<', 'g'), new RegExp('>', 'g')]; return function(str) { return String(str) .replace(encodeRegExp[0], '&amp;') .replace(encodeRegExp[1], '&quot;') .replace(encodeRegExp[2], '&#39;') .replace(encodeRegExp[3], '&lt;') .replace(encodeRegExp[4], '&gt;'); }; })(); const splitQuad = function(raw) { switch(typeof raw) { case 'string': return raw.split(/\s+/, 4); case 'object': return [ raw.x || raw.h || raw.left, raw.y || raw.v || raw.top, raw.x || raw.h || raw.right, raw.y || raw.v || raw.bottom]; case 'number': return [raw]; default: return raw; } }; export const quadToObject = function(raw) { const quad = splitQuad(raw); let left = parseInt(quad && quad[0], 10); let top = parseInt(quad && quad[1], 10); let right = parseInt(quad && quad[2], 10); let bottom = parseInt(quad && quad[3], 10); if(!isFinite(left)) { left = 0; } if(!isFinite(top)) { top = left; } if(!isFinite(right)) { right = left; } if(!isFinite(bottom)) { bottom = top; } return { top: top, right: right, bottom: bottom, left: left }; }; export function format(template, ...values) { if(isFunction(template)) { return template(...values); } values.forEach((value, index) => { if(isString(value)) { value = value.replace(/\$/g, '$$$$'); } const placeholderReg = new RegExp('\\{' + index + '\\}', 'gm'); template = template.replace(placeholderReg, value); }); return template; } export const replaceAll = (function() { const quote = function(str) { return (str + '').replace(/([+*?.[^\]$(){}><|=!:])/g, '\\$1'); // lgtm[incomplete-sanitization] }; return function(text, searchToken, replacementToken) { return text.replace(new RegExp('(' + quote(searchToken) + ')', 'gi'), replacementToken); }; })(); export const isEmpty = (function() { const SPACE_REGEXP = /\s/g; return function(text) { return !text || !text.replace(SPACE_REGEXP, ''); }; })();
const MachineOptions = require('./machine'); const inquirer = require('inquirer'); const options = require('../../data'); class User extends MachineOptions{ constructor({opt, name, selected}){ super({opt}); this._name = name; this._selected = selected; this._sort = this.sort() } set name(string){ this._name = string } get name(){ return this._name } set selected(string){ this._selected = string } get selected(){ return this._selected } logic(){ if (this._selected === this._sort) { return `${this._name}, O resultado é -> você empatou!!!` } else if ((this._selected === 'Pedra' && this._sort === 'Tesoura') || (this._selected === 'Tesoura' && this._sort === 'Papel') || (this._selected === 'Papel' && this._sort === 'Pedra')) { return `${this._name}, A máquina escolheu ${this._sort}. Você escolheu: ${this._selected} - O resultado é -> Você ganhou!!` } else { return `${this._name}, A máquina escolheu ${this._sort}. Você escolheu: ${this._selected} - O resultado é -> Você perdeu!!` } } game(){ return inquirer .prompt([ { name: 'name', message: 'Qual o seu nome? ', default: 'Jogador' }, { type: 'list', name: 'jokenpo', message: 'Selecione uma destas opções ', choices: options } ]).then((answers) => { this._name = answers.name this._selected = answers.jokenpo console.info(`${this.logic()}`) }) } } module.exports = User
const { getAdaptiveCardFromTemplate } = require('./getAdaptiveCardFromTemplate'); const { formatReleaseMessage, formatErrorMessage, formatCommentMessage, formatErrorStateMessage, } = require('./formatBugsnagMessage'); const { findItemInAdaptiveCard } = require('./adaptiveCardHelper'); const { THUMB_ICON_URL } = require('./constants'); const releaseTemplate = require('../adaptiveCards/release.json'); const commentTemplate = require('../adaptiveCards/comment.json'); const errorTemplate = require('../adaptiveCards/error.json'); const errorStateTemplate = require('../adaptiveCards/errorState.json'); function formatReleaseMessageIntoCard(releaseMessage) { return getAdaptiveCardFromTemplate(releaseTemplate, { summary: releaseMessage.summary, subject: releaseMessage.subject, version: releaseMessage.version, by: releaseMessage.by || 'none', stage: releaseMessage.stage, commit: releaseMessage.commit || 'none', url: releaseMessage.url, }); } function splitStackTrace(originalStackTrace) { let stackTrace = ''; let moreStackTrace = ''; if (originalStackTrace.length > 5) { stackTrace = originalStackTrace.slice(0, 5).join('\n'); moreStackTrace = originalStackTrace.slice(5).join('\n'); } else { stackTrace = originalStackTrace.join('\n'); } return { stackTrace, moreStackTrace }; } function capitalizeFirstLetter(string) { if (string.length === 0) { return string; } return string.charAt(0).toUpperCase() + string.slice(1); } function formatErrorMessageIntoCard(errorMessage, webhookId, messageType, botId) { let thumbUrl = THUMB_ICON_URL.error; if (errorMessage.triggerType === 'errorEventFrequency' || errorMessage.triggerType === 'powerTen') { thumbUrl = THUMB_ICON_URL.repeated; } if (errorMessage.triggerType === 'reopened') { thumbUrl = THUMB_ICON_URL.reopened; } if (errorMessage.triggerType === 'firstException') { thumbUrl = THUMB_ICON_URL.new; } const { stackTrace, moreStackTrace } = splitStackTrace(errorMessage.stackTrace); const statusIconUrl = THUMB_ICON_URL[`status_${errorMessage.status}`] || THUMB_ICON_URL['status_open']; const severityIconUrl = THUMB_ICON_URL[`severity_${errorMessage.severity}`] || THUMB_ICON_URL['severity_info']; const card = getAdaptiveCardFromTemplate(errorTemplate, { subject: errorMessage.subject, summary: errorMessage.summary, errorIcon: thumbUrl, message: errorMessage.message, stackTrace, moreStackTrace, severity: capitalizeFirstLetter(errorMessage.severity), status: capitalizeFirstLetter(errorMessage.status), statusIcon: statusIconUrl, severityIcon: severityIconUrl, url: errorMessage.url, errorId: errorMessage.errorId, projectId: errorMessage.projectId, webhookId, messageType, botId, }); if (moreStackTrace.length > 0) { const viewMore = findItemInAdaptiveCard(card, 'shoreMoreButtons'); delete viewMore.isVisible; // set view more button visible } return card; } function formatErrorStateMessageIntoCard(errorMessage, webhookId, messageType, botId) { const { stackTrace, moreStackTrace } = splitStackTrace(errorMessage.stackTrace); const iconUrl = THUMB_ICON_URL[`collaborator_${errorMessage.stateChange}`] || THUMB_ICON_URL['collaborator']; const statusIconUrl = THUMB_ICON_URL[`status_${errorMessage.status}`] || THUMB_ICON_URL['status_open']; const severityIconUrl = THUMB_ICON_URL[`severity_${errorMessage.severity}`] || THUMB_ICON_URL['severity_info']; const card = getAdaptiveCardFromTemplate(errorStateTemplate, { subject: errorMessage.subject, summary: errorMessage.summary, stateIcon: iconUrl, stackTrace, moreStackTrace, releaseStage: capitalizeFirstLetter(errorMessage.releaseStage), project: errorMessage.project, severity: capitalizeFirstLetter(errorMessage.severity), status: capitalizeFirstLetter(errorMessage.status), statusIcon: statusIconUrl, severityIcon: severityIconUrl, errorId: errorMessage.errorId, projectId: errorMessage.projectId, webhookId, messageType, botId, }); if (moreStackTrace.length > 0) { const viewMore = findItemInAdaptiveCard(card, 'shoreMoreButtons'); delete viewMore.isVisible; // set view more button visible } if (errorMessage.status === 'open') { const actions = findItemInAdaptiveCard(card, 'actions'); delete actions.isVisible; } else { const actions = findItemInAdaptiveCard(card, 'openActions'); delete actions.isVisible; } return card; } function formatCommentMessageIntoCard(commentMessage, webhookId, messageType, botId) { const { stackTrace, moreStackTrace } = splitStackTrace(commentMessage.stackTrace); const statusIconUrl = THUMB_ICON_URL[`status_${commentMessage.status}`] || THUMB_ICON_URL['status_open']; const severityIconUrl = THUMB_ICON_URL[`severity_${commentMessage.severity}`] || THUMB_ICON_URL['severity_info']; return getAdaptiveCardFromTemplate(commentTemplate, { subject: commentMessage.subject, summary: commentMessage.summary, comment: commentMessage.comment, stackTrace, moreStackTrace, releaseStage: capitalizeFirstLetter(commentMessage.releaseStage), project: commentMessage.project, severity: capitalizeFirstLetter(commentMessage.severity), status: capitalizeFirstLetter(commentMessage.status), statusIcon: statusIconUrl, severityIcon: severityIconUrl, errorId: commentMessage.errorId, projectId: commentMessage.projectId, webhookId, messageType, botId, }); } function formatBugsnagMessageIntoCard({ bugsnagMessage, webhookId = null, messageType = 'Notification', botId = null, }) { let formattedMessage; if (bugsnagMessage.release) { formattedMessage = formatReleaseMessage(bugsnagMessage); return formatReleaseMessageIntoCard(formattedMessage); } if (bugsnagMessage.comment) { formattedMessage = formatCommentMessage(bugsnagMessage); return formatCommentMessageIntoCard(formattedMessage, webhookId, messageType, botId); } if (bugsnagMessage.error) { if (bugsnagMessage.trigger.type === 'errorStateManualChange') { formattedMessage = formatErrorStateMessage(bugsnagMessage); return formatErrorStateMessageIntoCard(formattedMessage, webhookId, messageType, botId); } else { formattedMessage = formatErrorMessage(bugsnagMessage); return formatErrorMessageIntoCard(formattedMessage, webhookId, messageType, botId); } } return null; } exports.formatBugsnagMessageIntoCard = formatBugsnagMessageIntoCard;
/** * 压缩图片 * @param {*} file * @param {*} success * @param {*} error */ const compressImage = (file, success, error) => { // 图片小于1M不压缩 if (file.size < Math.pow(1024, 2)) { return success(file); } const name = file.name; //文件名 const reader = new FileReader(); reader.readAsDataURL(file); reader.onload = (e) => { const src = e.target.result; const img = new Image(); img.src = src; img.onload = (e) => { const w = img.width; const h = img.height; const quality = 0.8; // 默认图片质量为0.92 //生成canvas const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); // 创建属性节点 const anw = document.createAttribute("width"); anw.nodeValue = w; const anh = document.createAttribute("height"); anh.nodeValue = h; canvas.setAttributeNode(anw); canvas.setAttributeNode(anh); //铺底色 PNG转JPEG时透明区域会变黑色 ctx.fillStyle = "#fff"; ctx.fillRect(0, 0, w, h); ctx.drawImage(img, 0, 0, w, h); // quality值越小,所绘制出的图像越模糊 const base64 = canvas.toDataURL('image/jpeg', quality); //图片格式jpeg或webp可以选0-1质量区间 // 返回base64转blob的值 console.log(`原图${(src.length/1024).toFixed(2)}kb`, `新图${(base64.length/1024).toFixed(2)}kb`); //去掉url的头,并转换为byte const bytes = window.atob(base64.split(',')[1]); //处理异常,将ascii码小于0的转换为大于0 const ab = new ArrayBuffer(bytes.length); const ia = new Uint8Array(ab); for (let i = 0; i < bytes.length; i++) { ia[i] = bytes.charCodeAt(i); } file = new Blob( [ab] , {type : 'image/jpeg'}); file.name = name; success(file); } img.onerror = (e) => { error(e); } } reader.onerror = (e) => { error(e); } } // 示例 compressImage(files[0], (file)=>{ console.log(file); const formData = new FormData(); formData.append('file', file, file.name || '上传图片.jpeg'); }, $.noop);
import {otherRouter, appRouter} from '@/router/router'; import Util from '@/libs/util'; import Cookies from 'js-cookie'; import Vue from 'vue'; const app = { state: { cachePage: [], lang: '', isFullScreen: false, openedSubmenuArr: [], // 要展开的菜单数组 menuTheme: 'dark', // 主题 themeColor: '', pageOpenedList: [{ title: '首页', path: '', name: 'home_index' }], currentPageName: '', currentPath: [ { title: '首页', path: '', name: 'home_index' } ], // 面包屑数组 menuList: [], routers: [ otherRouter, ...appRouter ], tagsList: [...otherRouter.children], messageCount: 0, dontCache: ['text-editor', 'artical-publish'], // 在这里定义你不想要缓存的页面的name属性值(参见路由配置router.js), token: ''// 用户token }, mutations: { setTagsList (state, list) { state.tagsList.push(...list); }, updateMenulist (state) { let accessCode = parseInt(Cookies.get('access')); let menuList = []; appRouter.forEach((item, index) => { if (item.access !== undefined) { if (Util.showThisRoute(item.access, accessCode)) { if (item.children.length === 1) { menuList.push(item); } else { let len = menuList.push(item); let childrenArr = []; childrenArr = item.children.filter(child => { if (child.access !== undefined) { if (child.access === accessCode) { return child; } } else { return child; } }); menuList[len - 1].children = childrenArr; } } } else { if (item.children.length === 1) { menuList.push(item); } else { let len = menuList.push(item); let childrenArr = []; childrenArr = item.children.filter(child => { if (child.access !== undefined) { if (Util.showThisRoute(child.access, accessCode)) { return child; } } else { return child; } }); if (childrenArr === undefined || childrenArr.length === 0) { menuList.splice(len - 1, 1); } else { let handledItem = JSON.parse(JSON.stringify(menuList[len - 1])); handledItem.children = childrenArr; menuList.splice(len - 1, 1, handledItem); } } } }); state.menuList = menuList; }, changeMenuTheme (state, theme) { state.menuTheme = theme; }, changeMainTheme (state, mainTheme) { state.themeColor = mainTheme; }, addOpenSubmenu (state, name) { let hasThisName = false; let isEmpty = false; if (name.length === 0) { isEmpty = true; } if (state.openedSubmenuArr.indexOf(name) > -1) { hasThisName = true; } if (!hasThisName && !isEmpty) { state.openedSubmenuArr.push(name); } }, closePage (state, name) { state.cachePage.forEach((item, index) => { if (item === name) { state.cachePage.splice(index, 1); } }); }, initCachepage (state) { if (localStorage.cachePage) { state.cachePage = JSON.parse(localStorage.cachePage); } }, removeTag (state, name) { state.pageOpenedList.map((item, index) => { if (item.name === name) { state.pageOpenedList.splice(index, 1); } }); }, pageOpenedList (state, get) { let openedPage = state.pageOpenedList[get.index]; if (get.argu) { openedPage.argu = get.argu; } if (get.query) { openedPage.query = get.query; } state.pageOpenedList.splice(get.index, 1, openedPage); localStorage.pageOpenedList = JSON.stringify(state.pageOpenedList); }, clearAllTags (state) { state.pageOpenedList.splice(1); state.cachePage.length = 0; localStorage.pageOpenedList = JSON.stringify(state.pageOpenedList); }, clearOtherTags (state, vm) { let currentName = vm.$route.name; let currentIndex = 0; state.pageOpenedList.forEach((item, index) => { if (item.name === currentName) { currentIndex = index; } }); if (currentIndex === 0) { state.pageOpenedList.splice(1); } else { state.pageOpenedList.splice(currentIndex + 1); state.pageOpenedList.splice(1, currentIndex - 1); } let newCachepage = state.cachePage.filter(item => { return item === currentName; }); state.cachePage = newCachepage; localStorage.pageOpenedList = JSON.stringify(state.pageOpenedList); }, setOpenedList (state) { state.pageOpenedList = localStorage.pageOpenedList ? JSON.parse(localStorage.pageOpenedList) : [otherRouter.children[0]]; }, setCurrentPath (state, pathArr) { state.currentPath = pathArr; }, setCurrentPageName (state, name) { state.currentPageName = name; }, setAvator (state, path) { localStorage.avatorImgPath = path; }, switchLang (state, lang) { state.lang = lang; Vue.config.lang = lang; }, clearOpenedSubmenu (state) { state.openedSubmenuArr.length = 0; }, setMessageCount (state, count) { state.messageCount = count; }, increateTag (state, tagObj) { if (!Util.oneOf(tagObj.name, state.dontCache)) { state.cachePage.push(tagObj.name); localStorage.cachePage = JSON.stringify(state.cachePage); } state.pageOpenedList.push(tagObj); localStorage.pageOpenedList = JSON.stringify(state.pageOpenedList); }, setToken (state, token) { state.token = token; } } }; export default app;
/* * wysiwyg web editor * * suneditor.js * Copyright 2017 JiHong Lee. * MIT license. */ 'use strict'; (function (global, factory) { if (typeof module === 'object' && typeof module.exports === 'object') { module.exports = global.document ? factory(global, true) : function (w) { if (!w.document) { throw new Error('SUNEDITOR_LANG a window with a document'); } return factory(w); }; } else { factory(global); } }(typeof window !== 'undefined' ? window : this, function (window, noGlobal) { const lang = { toolbar: { default: 'По умолчанию', save: 'Сохранить', font: 'Гарнитура', formats: 'Стиль абзаца', fontSize: 'Кегль', bold: 'Полужирный', underline: 'Подчёркнутый', italic: 'Курсив', strike: 'Зачеркнутый', subscript: 'Нижний индекс', superscript: 'Верхний индекс', removeFormat: 'Очистить форматирование', fontColor: 'Цвет текста', hiliteColor: 'Цвет фона', indent: 'Увеличить отступ', outdent: 'Уменьшить отступ', align: 'Выравнивание', alignLeft: 'Слева', alignRight: 'Справа', alignCenter: 'По центру', alignJustify: 'По ширине', list: 'Списки', orderList: 'Нумерованный', unorderList: 'Маркированный', horizontalRule: 'Горизонтальная линия', hr_solid: 'Сплошная', hr_dotted: 'Пунктир', hr_dashed: 'Штриховая', table: 'Таблица', link: 'Ссылка', math: 'математический', image: 'Изображение', video: 'Видео', fullScreen: 'Полный экран', showBlocks: 'Блочный вид', codeView: 'Редактировать HTML', undo: 'Отменить', redo: 'Вернуть', preview: 'Предварительный просмотр', print: 'Печать', tag_p: 'Текст', tag_div: 'Базовый', tag_h: 'Заголовок', tag_blockquote: 'Цитата', tag_pre: 'Код', template: 'Шаблон', lineHeight: 'Высота линии', paragraphStyle: 'Стиль абзаца', textStyle: 'Стиль текста' }, dialogBox: { linkBox: { title: 'Вставить ссылку', url: 'Ссылка', text: 'Текст', newWindowCheck: 'Открывать в новом окне' }, mathBox: { title: 'математический', inputLabel: 'Математическая запись', fontSizeLabel: 'Кегль', previewLabel: 'Предварительный просмотр' }, imageBox: { title: 'Вставить изображение', file: 'Выберите файл', url: 'Адрес изображения', altText: 'Текстовое описание изображения' }, videoBox: { title: 'Вставить видео', url: 'Ссылка на видео' }, caption: 'Добавить подпись', close: 'Закрыть', submitButton: 'Подтвердить', revertButton: 'Сбросить', proportion: 'Сохранить пропорции', basic: 'Без обтекания', left: 'Слева', right: 'Справа', center: 'По центру', width: 'Ширина', height: 'Высота', size: 'Размер', ratio: 'Соотношение' }, controller: { edit: 'Изменить', unlink: 'Убрать ссылку', remove: 'Удалить', insertRowAbove: 'Вставить строку выше', insertRowBelow: 'Вставить строку ниже', deleteRow: 'Удалить строку', insertColumnBefore: 'Вставить столбец слева', insertColumnAfter: 'Вставить столбец справа', deleteColumn: 'Удалить столбец', resize100: 'Размер 100%', resize75: 'Размер 75%', resize50: 'Размер 50%', resize25: 'Размер 25%', autoSize: 'Авто размер', mirrorHorizontal: 'Отразить по горизонтали', mirrorVertical: 'Отразить по вертикали', rotateLeft: 'Повернуть против часовой стрелки', rotateRight: 'Повернуть по часовой стрелке', maxSize: 'Ширина по размеру страницы', minSize: 'Ширина по содержимому', tableHeader: 'Строка заголовков', mergeCells: 'Объединить ячейки', splitCells: 'Разделить ячейку', HorizontalSplit: 'Разделить горизонтально', VerticalSplit: 'Разделить вертикально' }, menu: { spaced: 'интервал', bordered: 'Граничная Линия', neon: 'неон', translucent: 'полупрозрачный', shadow: 'Тень' } }; if (typeof noGlobal === typeof undefined) { if (!window.SUNEDITOR_LANG) { window.SUNEDITOR_LANG = {}; } window.SUNEDITOR_LANG.ru = lang; } return lang; }));
export const petitionsClerkRescansAddedBatch = test => { return it('Petitions clerk rescans a pre-existing batch', async () => { const selectedDocumentType = test.getState( 'currentViewMetadata.documentSelectedForScan', ); await test.runSequence('openConfirmRescanBatchModalSequence', { batchIndexToRescan: 0, }); expect(test.getState('modal.showModal')).toEqual('ConfirmRescanBatchModal'); expect(test.getState('scanner.batchIndexToRescan')).toEqual(0); await test.runSequence('rescanBatchSequence'); expect(test.getState('modal')).toEqual({}); expect( test.getState(`scanner.batches.${selectedDocumentType}`).length, ).toBeGreaterThan(0); }); };
'use strict'; console.log('Loading function'); let doc = require('dynamodb-doc'); let dynamo = new doc.DynamoDB(); const tableName = process.env.TABLE_NAME; const createResponse = (statusCode, body) => { return { "statusCode": statusCode, "body": body || "" } }; exports.get = (event, context, callback) => { var params = { "TableName": tableName, "Key": { id: event.pathParameters.resourceId } }; dynamo.getItem(params, (err, data) => { var response; if (err) response = createResponse(500, err); else response = createResponse(200, data.Item ? data.Item.doc : null); callback(null, response); }); }; exports.put = (event, context, callback) => { var item = { "id": event.pathParameters.resourceId, "doc": event.body }; var params = { "TableName": tableName, "Item": item }; dynamo.putItem(params, (err, data) => { var response; if (err) response = createResponse(500, err); else response = createResponse(200, null); callback(null, response); }); }; exports.delete = (event, context, callback) => { var params = { "TableName": tableName, "Key": { "id": event.pathParameters.resourceId } }; dynamo.deleteItem(params, (err, data) => { var response; if (err) response = createResponse(500, err); else response = createResponse(200, null); callback(null, response); }); };
// @flow import fs from 'fs-extra'; import mkdirp from 'mkdirp'; import os from 'os'; import path from 'path'; import promisify from 'util.promisify'; const mkdirpAsync = promisify(mkdirp); /* A Cacher is used to wrap a fallible or expensive function and to memoize its results on disk in case it either fails or we don't need fresh results very often. It stores objects in JSON, and parses JSON from disk when returning an object. It's constructed with a "refresher" callback which will be called for the results, a filename to use for the cache, and an optional TTL and boostrap file. The TTL (in milliseconds) can be used to speed up slow calls from the cache (for example checking npm published versions can be very slow). The bootstrap file can be used to "seed" the cache with a particular value stored in a file. If there is a problem calling the refresher function or in performing the cache's disk I/O, errors will be stored in variables on the class. The only times Cacher will throw an exception are if it's not possible to create the cache directory (usually weird home directory permissions), or if getAsync() is called but no value can be provided. The latter will only occur if the refresher fails, no cache is available on disk (i.e. this is the first call or it has been recently cleared), and bootstrapping was not available (either a bootstrap file wasn't provided or reading/writing failed). See src/__tests__/tools/FsCache-test.js for usage examples. */ class Cacher<T> { refresher: () => Promise<T>; filename: string; bootstrapFile: ?string; ttlMilliseconds: number; readError: ?any; writeError: ?any; constructor( refresher: () => Promise<T>, filename: string, ttlMilliseconds: ?number, bootstrapFile: ?string ) { this.refresher = refresher; this.filename = path.join(getCacheDir(), filename); this.ttlMilliseconds = ttlMilliseconds || 0; this.bootstrapFile = bootstrapFile; } async getAsync(): Promise<T> { await mkdirpAsync(getCacheDir()); let mtime: Date; try { const stats = await fs.stat(this.filename); mtime = stats.mtime; } catch (e) { if (this.bootstrapFile) { try { const bootstrapContents = (await fs.readFile(this.bootstrapFile)).toString(); await fs.writeFile(this.filename, bootstrapContents, 'utf8'); } catch (e) { // intentional no-op } } mtime = new Date(1989, 10, 19); } let fromCache: ?T; let failedRefresh = null; // if mtime + ttl >= now, attempt to fetch the value, otherwise read from disk if (new Date() - mtime > this.ttlMilliseconds) { try { fromCache = await this.refresher(); try { await fs.writeFile(this.filename, JSON.stringify(fromCache), 'utf8'); } catch (e) { this.writeError = e; // do nothing, if the refresh succeeded it'll be returned, if the persist failed we don't care } } catch (e) { failedRefresh = e; } } if (!fromCache) { try { fromCache = JSON.parse(await fs.readFile(this.filename)); } catch (e) { this.readError = e; // if this fails then we've exhausted our options and it should remain null } } if (fromCache) { return fromCache; } else { if (failedRefresh) { throw new Error(`Unable to perform cache refresh for ${this.filename}: ${failedRefresh}`); } else { throw new Error(`Unable to read ${this.filename}. ${this.readError || ''}`); } } } async clearAsync(): Promise<void> { try { await fs.unlink(this.filename); } catch (e) { this.writeError = e; } } } function getCacheDir(): string { const homeDir = os.homedir(); if (process.env.XDG_CACHE_HOME) { return process.env.XDG_CACHE_HOME; } else if (process.platform === 'win32') { return path.join(homeDir, 'AppData', 'Local', 'Expo'); } else if (process.platform === 'darwin') { // too many mac users have broken permissions on their ~/.cache directory return path.join(homeDir, '.expo', 'cache'); } else { return path.join(homeDir, '.cache', 'expo'); } } export { Cacher, getCacheDir };
"use strict"; exports.__esModule = true; exports.pathRadialDiagonal = pathRadialDiagonal; exports.default = LinkRadialDiagonal; var _react = _interopRequireDefault(require("react")); var _classnames = _interopRequireDefault(require("classnames")); var _d3Shape = require("d3-shape"); var _accessors = require("../../../util/accessors"); var _excluded = ["className", "children", "data", "innerRef", "path", "angle", "radius", "source", "target"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function pathRadialDiagonal(_ref) { var source = _ref.source, target = _ref.target, angle = _ref.angle, radius = _ref.radius; return function (data) { var link = (0, _d3Shape.linkRadial)(); link.angle(angle); link.radius(radius); link.source(source); link.target(target); return link(data); }; } function LinkRadialDiagonal(_ref2) { var className = _ref2.className, children = _ref2.children, data = _ref2.data, innerRef = _ref2.innerRef, path = _ref2.path, _ref2$angle = _ref2.angle, angle = _ref2$angle === void 0 ? _accessors.getX : _ref2$angle, _ref2$radius = _ref2.radius, radius = _ref2$radius === void 0 ? _accessors.getY : _ref2$radius, _ref2$source = _ref2.source, source = _ref2$source === void 0 ? _accessors.getSource : _ref2$source, _ref2$target = _ref2.target, target = _ref2$target === void 0 ? _accessors.getTarget : _ref2$target, restProps = _objectWithoutPropertiesLoose(_ref2, _excluded); var pathGen = path || pathRadialDiagonal({ source: source, target: target, angle: angle, radius: radius }); if (children) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children({ path: pathGen })); return /*#__PURE__*/_react.default.createElement("path", _extends({ ref: innerRef, className: (0, _classnames.default)('visx-link visx-link-radial-diagonal', className), d: pathGen(data) || '' }, restProps)); }
import React from 'react' import { configure, mount } from 'enzyme' import Adapter from '@wojtekmaj/enzyme-adapter-react-17' import renderer from 'react-test-renderer'; import CToastHeader from '../CToastHeader' configure({ adapter: new Adapter() }) describe('CToastHeader', () => { it('renders basic wrapper correctly', () => { const component = renderer.create(<CToastHeader/>); let tree = component.toJSON(); expect(tree).toMatchSnapshot() }) it('renders customized wrapper correctly', () => { const componentCustomized = renderer.create( <CToastHeader className='class-name' closeButton > CToastHeader </CToastHeader> ); let tree = componentCustomized.toJSON(); expect(tree).toMatchSnapshot() }) })
import React from "react" export default ({ pageContext: { dog } }) => ( <section> {dog.name} - {dog.breed} </section> )
import { Button } from '@material-ui/core' import React from 'react' export const WithdrawQuestion = (props) => { const { row, handleWithdraw } = props const handleClick = () => { handleWithdraw(row) } return ( <Button onClick={handleClick} size={'small'} variant={'contained'} color={'primary'}> Withdraw </Button> ) }
import { duration, displayDuration } from '../localizationService'; import { assert } from 'lightning/utilsPrivate'; const MINUTE_MILLISECONDS = 1000 * 60; export function relativeFormat() { return { format: (value) => { const now = Date.now(); const timestamp = Number(value); assert( isFinite(timestamp), `RelativeFormat: The value attribute accepts either a Date object or a timestamp, but we are getting the ${typeof value} value "${value}" instead.` ); const getDiffInMinutes = (timestamp - now) / MINUTE_MILLISECONDS; const durationData = duration(getDiffInMinutes, 'minutes'); return displayDuration(durationData, true); }, }; }
var express = require('express'), app = express(); var bodyParser = require('body-parser'); var nodemailer = require('nodemailer'); var transporter = nodemailer.createTransport({ service: 'gmail', auth: { user: 'stephengoveia@spacetimeathleta.co', pass: 'pass4sA100M*' } }); // Create application/x-www-form-urlencoded parser var urlencodedParser = bodyParser.urlencoded({ extended: false }) //Set/Get Port and IP of host server var port = process.env.PORT || process.env.OPENSHIFT_NODEJS_PORT || 3000, ip = process.env.IP || process.env.OPENSHIFT_NODEJS_IP || '0.0.0.0' // Routing app.use(express.static('./')); // Loading socket.io //var io = require('socket.io').listen(app.listen(3000)); // When a client connects, we note it in the console // io.sockets.on('connection', function (socket) { // console.log('A client is connected!'); // }); //Sending Message from Contact Form app.post('/process_post', urlencodedParser, function(req, res) { // Prepare output in JSON format response = { name: req.body.name, email: req.body.email, message: req.body.message, }; const mailOptions = { from: 'stephengoveia@spacetimeathleta.co', // sender address to: 'stephengoveia@spacetimeathleta.co', // list of receivers subject: 'Message from: ' + 'Name:'+response.name+ ' Email:' + response.email, // Subject line html: '<p>' + response.message + '</p>' // plain text body }; transporter.sendMail(mailOptions, function(err, info) { if (err) console.log(err) else console.log(info); }); const mailOptions2 = { from: 'contact@spacetimeathleta.co', // sender address to: response.email, // list of receivers subject: 'Thanks for the Message!!', // Subject line html: '<p>Hello '+response.name+'!<br>Thank you so much for reaching out! Your note is very important to us, we will get back with you very soon! </p><p>Best Regards,<br>Steve Goveia - Founder/CEO<br> <a href="spacetimeathleta.co">spacetimeAthleta</a></p>' // plain text body }; transporter.sendMail(mailOptions2, function(err, info) { if (err) console.log(err) else console.log(info); }); res.redirect('./'); //console.log(response); //res.end(JSON.stringify(response)); }) // Launch Server app.listen(port, ip );//'10.0.0.235' console.log('Server running on http://%s:%s', ip, port);
var check = document.querySelector("#shippingInfo"); // 체크박스의 id는 shippingInfo check.addEventListener("click", function() { // check 요소에 click 이벤트가 발생했을 때 실행할 함수 var nameInfo = document.querySelector("#billingName").value; // 주문 정보 - 이름 var telInfo = document.querySelector("#billingTel").value; // 주문 정보 - 전화번호 var addrInfo = document.querySelector("#billingAddr").value; // 주문 정보 - 주소 if(check.checked == true) { // 체크되었다면 document.querySelector("#shippingName").value = nameInfo; // 주문 정보(이름)를 배송 정보(이름)에 복사 document.querySelector("#shippingTel").value = telInfo; // 주문 정보(전화번호)를 배송 정보(전화번호)에 복사 document.querySelector("#shippingAddr").value = addrInfo; // 주문 정보(주소)를 배송 정보(주소)에 복사 } else { // 체크되어 있지 않다면 배송 정보 필드를 지움. document.querySelector("#shippingName").value = ""; document.querySelector("#shippingTel").value = ""; document.querySelector("#shippingAddr").value = ""; } });
import { h } from 'vue' export default { name: "StoreRemove", vendor: "Mdi", type: "", tags: ["store","remove"], render() { return h( "svg", {"xmlns":"http://www.w3.org/2000/svg","width":"24","height":"24","viewBox":"0 0 24 24","class":"v-icon","fill":"currentColor","data-name":"mdi-store-remove","innerHTML":"<path d='M4 4H20V6H4V4M15.46 16.88L16.88 15.46L19 17.59L21.12 15.47L22.54 16.88L20.41 19L22.54 21.12L21.12 22.54L19 20.41L16.88 22.54L15.46 21.12L17.59 19L15.47 16.88M4 7H20L21 12V13.34C20.33 13.09 19.62 12.96 18.91 12.96C17.71 12.96 16.54 13.33 15.54 14H14V15.53C13.3 16.53 12.92 17.73 12.92 18.95L13 20H4V14H3V12L4 7M6 14V18H12V14H6Z' />"}, ) } }
import React, { useEffect, useState } from "react" import Recipe from "./Recipe" import "./App.css" const App = () => { const APP_ID = "2dc16ac9" const APP_KEY = "9d9f50cc366668293ff143814da5b3ca" const exampleReq = `https://api.edamam.com/api/recipes/v2?type=public&beta=false&q=chicken&app_id=${APP_ID}&app_key=${APP_KEY}` const [recipes, setRecipes] = useState([]) const [search, setSearch] = useState("") const [query, setQuery] = useState("chicken") useEffect(() => { getRecipes() }, [query]) const getRecipes = async () => { const response = await fetch( `https://api.edamam.com/api/recipes/v2?type=public&beta=false&q=${query}&app_id=${APP_ID}&app_key=${APP_KEY}` ) const data = await response.json() setRecipes(data.hits) } const updateSearch = (e) => { setSearch(e.target.value) } const getSearch = (e) => { e.preventDefault() setQuery(search) setSearch("") } return ( <div className="App"> <form onSubmit={getSearch} className="search-form"> <input className="search-bar" type="text" value={search} onChange={updateSearch} /> <button className="search-button" type="submit"> Search </button> </form> <div className="recipes"> {recipes.map((recipe) => ( <Recipe key={recipe.recipe.label} title={recipe.recipe.label} calories={recipe.recipe.calories} image={recipe.recipe.image} ingredients={recipe.recipe.ingredients} /> ))} </div> </div> ) } export default App
/* Copyright (c) 2019, Piet Hein Schouten. All rights reserved. * Licensed under the terms of the MIT license. */ /* * Adapted from: * https://github.com/zenorocha/clipboard.js/blob/master/src/clipboard-action.js */ function TextClipboard(container) { this.container = document.body; this.fakeElem = null; this.isRTL = document.documentElement.getAttribute('dir') == 'rtl'; this.selectText = function(element) { var selectedText; if (element.nodeName === 'SELECT') { element.focus(); selectedText = element.value; } else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { var isReadOnly = element.hasAttribute('readonly'); if (!isReadOnly) { element.setAttribute('readonly', ''); } element.select(); element.setSelectionRange(0, element.value.length); if (!isReadOnly) { element.removeAttribute('readonly'); } selectedText = element.value; } else { if (element.hasAttribute('contenteditable')) { element.focus(); } var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(element); selection.removeAllRanges(); selection.addRange(range); selectedText = selection.toString(); } return selectedText; } this.copy = function(text) { this.fakeElem = document.createElement('textarea'); // Prevent zooming on iOS this.fakeElem.style.fontSize = '12pt'; // Reset box model this.fakeElem.style.border = '0'; this.fakeElem.style.padding = '0'; this.fakeElem.style.margin = '0'; // Move element out of screen horizontally this.fakeElem.style.position = 'absolute'; this.fakeElem.style[ this.isRTL ? 'right' : 'left' ] = '-9999px'; // Move element to the same position vertically let yPosition = window.pageYOffset || document.documentElement.scrollTop; this.fakeElem.style.top = `${yPosition}px`; this.fakeElem.setAttribute('readonly', ''); this.fakeElem.value = text; this.container.appendChild(this.fakeElem); this.fakeElem.focus(); this.selectText(this.fakeElem); //this.fakeElem.select(); document.execCommand("copy"); this.container.removeChild(this.fakeElem); }; }
import React from "react" import { Link } from "gatsby" import Layout from "../components/layout" import Image from "../components/image" import SEO from "../components/seo" import { graphql } from "gatsby" const IndexPage = () => ( <Layout> <SEO title="Home" /> <section className="hero is-light is-bol is-fullheight" > <div className="hero-boy" id="tv"> <div className="padding-top-4em character-select" > <div className="section"> <div className="container has-text-centered"> <p className="giant-text retro-font retro-text-shadow has-text-centered">Select your character</p> </div> </div> <div className="section character-select"> <div className="container character-select"> <div className="tile is-ancestor character-select"> <div className="tile is-parent mx-6"> <Link to="projects" className="tile is-child diagonal-box turtle-color-r"> <div className="turtle-text has-text-centered"> <p className="giext retro-font has-text-centered">Project</p> </div> <div className="turtle"> <img src="assets/projects.png"></img> </div> </Link> </div> <div className="tile is-parent mx-6"> <Link to="about" className="tile is-child diagonal-box turtle-color-y"> <div className="turtle-text has-text-centered"> <p className="giext retro-font has-text-centered">About zack</p> </div> <div className="turtle"> <img src="assets/about.png"></img> </div> </Link> </div> <div className="tile is-parent mx-6"> <Link to="gallery" className="tile is-child diagonal-box turtle-color-b"> <div className="turtle-text has-text-centered"> <p className="giext retro-font has-text-centered">Gallery</p> </div> <div className="turtle"> <img src="assets/artgallery.png"></img> </div> </Link> </div> </div> </div> </div> </div> </div> </section> </Layout> ) export default IndexPage export const ProjectsQuery = graphql` query { allFile(filter: {}) { edges { node { childImageSharp { fluid(traceSVG: { blackOnWhite: true }) { src } } } } } } `
import React, { useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useRouter } from 'next/router'; import Link from 'next/link'; import { withAuthUser, AuthAction } from 'next-firebase-auth'; import styles from './login.module.scss'; import { toggleNavigation } from '../features/Navigation/reducer'; import { Media } from '../media'; import { registerByEmail, clearError } from '../features/UserProfile/reducer'; import Button from '../components/Button'; const MyLoader = () => <div>Loading...</div>; const RegistrationCard = () => { const router = useRouter(); const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [confirmedPassword, setConfirmedPassword] = useState(''); const userProfile = useSelector((state) => state.userProfile); const [error, setError] = useState(userProfile.error?.message); const dispatch = useDispatch(); useEffect(() => { if (userProfile.email) { router.push('/profile'); } }) useEffect(() => { if (error) { setError(null); dispatch(clearError()); } dispatch(toggleNavigation(false)); return () => dispatch(toggleNavigation(true)); }, []); const onSubmit = (e) => { e.preventDefault(); if (email && password) { if (password === confirmedPassword) { dispatch(registerByEmail({ name, email, password })); } else { setError('Passwords do not match.'); } } }; return ( <div className={styles.card}> <h1 className="roboto">Register</h1> {error ? ( <div className={styles.error}> {error} </div> ) : null} <form className="open-sans" onSubmit={onSubmit}> <div> <label htmlFor="registration-name-input">Name</label> <input id="registration-name-input" type="text" value={name} onChange={(e) => setName(e.target.value)} required /> </div> <div> <label htmlFor="registration-email-input">Email</label> <input id="registration-email-input" type="email" value={email} onChange={(e) => setEmail(e.target.value)} required /> </div> <div> <label htmlFor="registration-password-input">Password</label> <input id="registration-password-input" type="password" value={password} onChange={(e) => setPassword(e.target.value)} required /> </div> <div> <label htmlFor="confirmed-password">Confirm Password</label> <input id="confirmed-password" type="password" value={confirmedPassword} onChange={(e) => setConfirmedPassword(e.target.value)} required /> </div> <Button type="submit"> Register </Button> </form> <div> Already have an account? &nbsp; <Link href="/login"> <a>Log in.</a> </Link> </div> </div> ); }; const RegistrationPage = () => ( <> <Media at="sm" className={styles.mobileCard}> <RegistrationCard /> </Media> <Media between={['md', 'lg']} className={styles.tabletCard}> <RegistrationCard /> </Media> <Media greaterThanOrEqual="lg" className={styles.desktopCard}> <RegistrationCard /> </Media> </> ); export default withAuthUser({ whenUnauthedBeforeInit: AuthAction.SHOW_LOADER, whenUnauthedAfterInit: AuthAction.RENDER, LoaderComponent: MyLoader, })(RegistrationPage);
const express = require('express') const modelController = require('./controllers/model.controller') const authController = require('../auth/controllers/auth.controller') const router = express.Router() const jsonParse = require('body-parser').json() router.route('/') .get(authController.isAuthenticated, modelController.getAllModels) .post(authController.isAuthenticated, jsonParse, modelController.addModel) router.route('/all') .get(authController.isAuthenticated, modelController.getAllModels) .post(authController.isAuthenticated, jsonParse, modelController.addModel) router.route('/:productType') .get(authController.isAuthenticated, modelController.getModelsByCategory) router.route('/all/meta') .get(authController.isAuthenticated, modelController.getModelMeta) router.route('/all/:shortId') .get(authController.isAuthenticated, modelController.getModelByShortId) .put(authController.isAuthenticated, jsonParse, modelController.updateModel) .delete(authController.isAuthenticated, modelController.removeModel) module.exports = router
module.exports = { iconButton: theme => ({ iconButton: { '&:hover': { backgroundColor: 'transparent', color: theme.palette.primary.main, }, }, }), };
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "Zdat azal", "\u1e0ceffir aza" ], "DAY": [ "Asamas", "Aynas", "Asinas", "Akras", "Akwas", "Asimwas", "Asi\u1e0dyas" ], "MONTH": [ "Yennayer", "Yebrayer", "Mars", "Ibrir", "Mayyu", "Yunyu", "Yulyuz", "\u0194uct", "Cutanbir", "K\u1e6duber", "Nwanbir", "Dujanbir" ], "SHORTDAY": [ "Asa", "Ayn", "Asn", "Akr", "Akw", "Asm", "As\u1e0d" ], "SHORTMONTH": [ "Yen", "Yeb", "Mar", "Ibr", "May", "Yun", "Yul", "\u0194uc", "Cut", "K\u1e6du", "Nwa", "Duj" ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "dd/MM/y h:mm a", "shortDate": "dd/MM/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "\u20ac", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a0\u00a4", "posPre": "", "posSuf": "\u00a0\u00a4" } ] }, "id": "tzm-latn", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
// 更新歌单描述 module.exports = (query, request) => { const data = { id: query.id, desc: query.desc, } return request( 'POST', `https://interface3.music.163.com/eapi/playlist/desc/update`, data, { crypto: 'eapi', cookie: query.cookie, proxy: query.proxy, url: '/api/playlist/desc/update', realIP: query.realIP, }, ) }
exports.action = { name: 'addSource', description: 'addSource', blockedConnectionTypes: [], outputExample: {}, matchExtensionMimeType: false, version: 1.0, toDocument: true, inputs: { type: { required: true, validator: function(param, connection, actionTemplate) { switch (param) { case 'video': return true; case 'photo': return true; case 'music': return true; default: return false; } } }, name: { required: true }, server: { required: true, validator: function(param, connection, actionTemplate) { switch (param) { case 'samba': return true; case 'local': return true; default: return false; } } }, ip: { required: false, default: '127.0.0.1' }, username: { required: false, default: '' }, password: { required: false, default: '' }, share: { required: false, default: '' }, domain: { required: false, default: '' }, path: { required: true } }, run: function(api, connection, next) { if (connection.params.server == 'samba') { api.db.sources.forge({ type : connection.params.type, name: connection.params.name, server: connection.params.server, ip: connection.params.ip, username: connection.params.username, password: connection.params.password, share: connection.params.share, domain: connection.params.domain, path: connection.params.path }).save().then(function() { console.log('saved'); }); } connection.response.redirectURL = '/'; connection.rawConnection.responseHeaders.push(['Location', connection.response.redirectURL]); connection.rawConnection.responseHttpCode = 301; next(connection, true); } };
import Vue from 'vue' import VueRouter from 'vue-router' import Home from './views/Home.vue' import ArticlePage from './views/ArticlePage.vue' Vue.use(VueRouter) const router = new VueRouter({ routes: [ { path: '/', component: Home }, { path: '/article/:id', component: ArticlePage } ] }) export default router
const assert = require('assert'); const app = require('../../src/app'); describe('\'trader-profile\' service', () => { it('registered the service', () => { const service = app.service('trader-profile'); assert.ok(service, 'Registered the service'); }); });
/* global document */ import { Frenchify, rules, languageRules } from 'frenchify-rules'; import showdown from 'showdown'; import Vue from '../node_modules/vue/dist/vue'; import txt from '../i18n/en.json'; const el = '#app'; const showDownConverter = new showdown.Converter(); const options = languageRules .map(language => ({ value: language.id, text: txt.languages[language.id], })) .concat([{ value: 'nolang', text: txt.nolang, }]); const data = { txt, input: '', output: '', helpers: false, markdown: false, options, language: 'nolang', }; const convert = (languageId, markdown, helpers, text) => { const rulesToApply = []; if (languageId !== 'nolang') { rulesToApply .push(languageRules .find(language => language.id === languageId).rules); } if (helpers) { rulesToApply.push(rules); } const frenchify = new Frenchify(rulesToApply); text = frenchify.applyRules(text); if (markdown) { text = showDownConverter.makeHtml(text); } return text; }; const created = () => { document.title = txt.title; }; const methods = { convert() { this.output = convert(this.language, this.markdown, this.helpers, this.input); }, }; // eslint-disable-next-line no-new new Vue({ el, data, created, methods, });
/* * Either obsolete or a refactor... not sure * */ js.extend('lsn.ext.dde', function (js) { /** Class definition */ var proto = {}; // class prototype this.Masks = function (dde) { this.dde = dde; this.marker = null; this.interval = 100; // ms this.iid = null; // interval id this.masks = []; this.ui = this._createUI(); }; this.Masks.prototype = proto; /** Public methods */ proto.select = function (marker) { this.marker = marker; this._startPolling(); }; proto.deselect = function () { _stopPolling(); this.marker = null; }; proto.highlight = function () { }; /** Private methods */ proto._createUI = function () { return this.dde.js.dom.createElement('div', { id:'dde-mask-layer', style:{'position':'absolute', 'z-index': 9999, 'top':0, 'left':0} }, this._createMasks()) }; proto._createMasks = function () { this.masks = []; for (var i = 1; i < 10; i++) { var mask = this.dde.js.dom.createElement('div', { 'id': 'dde-mask-' + i, 'class': 'dde-mask' }); this.dde.js.dom.setOpacity(mask, .50); this.dde.js.dom.addEventListener(mask, 'click', this.dde.deselect, this); this.masks.push(mask); } return this.masks; }; proto._startPolling = function () { this.iid = this.dde.js.dom.setInterval(this._resize, this.interval, this); }; proto._stopPolling = function () { if (this.iid) this.dde.js.dom.clearInterval(this.iid); this.iid = null; }; proto._resize = function () { }; });
/** * @license * Copyright The Closure Library Authors. * SPDX-License-Identifier: Apache-2.0 */ /** * @fileoverview Default factory for <code>WebChannelTransport</code> to * avoid exposing concrete classes to clients. */ goog.provide('goog.net.createWebChannelTransport'); goog.require('goog.labs.net.webChannel.WebChannelBaseTransport'); goog.requireType('goog.net.WebChannelTransport'); /** * Create a new WebChannelTransport instance using the default implementation. * Throws an error message if no default transport available in the current * environment. * * @return {!goog.net.WebChannelTransport} the newly created transport instance. */ goog.net.createWebChannelTransport = function() { 'use strict'; return new goog.labs.net.webChannel.WebChannelBaseTransport(); };
import * as Gbi from "../../../../../include/gbi" import { snow_09008800, snow_09005000, snow_09008000, } from "../../../../../textures/snow" import { ccm_seg7_texture_07004300 } from "../../../../ccm/texture.inc" const ccm_seg7_lights_0701CED8 = Gbi.gdSPDefLights1( 0x15, 0x15, 0x15, 0x55, 0x55, 0x55, 0x28, 0x28, 0x28 ) const ccm_seg7_lights_0701CEF0 = Gbi.gdSPDefLights1( 0x26, 0x26, 0x26, 0x99, 0x99, 0x99, 0x28, 0x28, 0x28 ) const ccm_seg7_lights_0701CF08 = Gbi.gdSPDefLights1( 0x33, 0x33, 0x33, 0xcc, 0xcc, 0xcc, 0x28, 0x28, 0x28 ) const ccm_seg7_lights_0701CF20 = Gbi.gdSPDefLights1( 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0x28, 0x28, 0x28 ) const ccm_seg7_vertex_0701CF38 = [ { pos: [ -5477, -3839, -7679 ], flag: 0, tc: [ -3096, -18938 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5477, -4812, -6450 ], flag: 0, tc: [ 9166, -9230 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5477, -3839, -6450 ], flag: 0, tc: [ 9166, -18940 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6245, -5836, -6450 ], flag: 0, tc: [ 480, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6245, -5375, -6501 ], flag: 0, tc: [ 990, -3608 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6245, -5375, -6450 ], flag: 0, tc: [ 480, -3608 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6245, -5836, -6501 ], flag: 0, tc: [ 990, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6757, -5375, -6450 ], flag: 0, tc: [ 480, -3608 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6757, -5375, -6501 ], flag: 0, tc: [ 0, -3608 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6757, -5836, -6501 ], flag: 0, tc: [ 0, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6757, -5836, -6450 ], flag: 0, tc: [ 480, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6245, -5375, -6450 ], flag: 0, tc: [ 1500, 4566 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6245, -5375, -6501 ], flag: 0, tc: [ 1500, 4566 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6757, -5375, -6501 ], flag: 0, tc: [ 6610, 4566 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6757, -5375, -6450 ], flag: 0, tc: [ 6610, 4566 ], color: [ 0, 127, 0, 255 ] }, ] const ccm_seg7_vertex_0701D028 = [ { pos: [ -5477, -3839, -7679 ], flag: 0, tc: [ 12232, -10768 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6706, -3839, -7679 ], flag: 0, tc: [ 0, -10768 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6706, -4812, -7679 ], flag: 0, tc: [ 0, -1054 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5477, -3839, -7679 ], flag: 0, tc: [ -3096, -18938 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5477, -4812, -7679 ], flag: 0, tc: [ -3096, -9230 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5477, -4812, -6450 ], flag: 0, tc: [ 9166, -9230 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5477, -3839, -6450 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6706, -3839, -6450 ], flag: 0, tc: [ 6100, 990 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6706, -3839, -7679 ], flag: 0, tc: [ 6100, -7186 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5477, -3839, -7679 ], flag: 0, tc: [ 0, -7186 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6706, -3839, -6450 ], flag: 0, tc: [ -4630, -10766 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6706, -5221, -7679 ], flag: 0, tc: [ 7632, 3032 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6706, -3839, -7679 ], flag: 0, tc: [ 7632, -10768 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6706, -5221, -6450 ], flag: 0, tc: [ -4628, 3032 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5477, -4812, -7679 ], flag: 0, tc: [ 12232, -1054 ], color: [ 0, 0, 127, 255 ] }, ] const ccm_seg7_vertex_0701D118 = [ { pos: [ -7576, -5426, -6450 ], flag: 0, tc: [ 14786, 5076 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6706, -5836, -6450 ], flag: 0, tc: [ 6100, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7576, -5836, -6450 ], flag: 0, tc: [ 14786, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6706, -5221, -6450 ], flag: 0, tc: [ 6100, 3032 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6245, -5375, -6450 ], flag: 0, tc: [ 1500, 4566 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6706, -5375, -6450 ], flag: 0, tc: [ 6100, 4566 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6706, -3839, -6450 ], flag: 0, tc: [ 6100, -10768 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6524, -4210, -6450 ], flag: 0, tc: [ 4284, -7058 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6424, -4237, -6450 ], flag: 0, tc: [ 3290, -6790 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6597, -4137, -6450 ], flag: 0, tc: [ 5012, -7784 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5682, -5836, -6450 ], flag: 0, tc: [ -4118, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6245, -5836, -6450 ], flag: 0, tc: [ 1500, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6325, -3865, -6450 ], flag: 0, tc: [ 2296, -10500 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6424, -3839, -6450 ], flag: 0, tc: [ 3290, -10768 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5477, -3839, -6450 ], flag: 0, tc: [ -6162, -10768 ], color: [ 0, 0, 129, 255 ] }, ] const ccm_seg7_vertex_0701D208 = [ { pos: [ -6706, -3839, -6450 ], flag: 0, tc: [ 6100, -10768 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6597, -3938, -6450 ], flag: 0, tc: [ 5012, -9772 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6624, -4038, -6450 ], flag: 0, tc: [ 5278, -8778 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6597, -4137, -6450 ], flag: 0, tc: [ 5012, -7784 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6524, -3865, -6450 ], flag: 0, tc: [ 4284, -10500 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6424, -3839, -6450 ], flag: 0, tc: [ 3290, -10768 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6424, -4237, -6450 ], flag: 0, tc: [ 3290, -6790 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6325, -4210, -6450 ], flag: 0, tc: [ 2296, -7058 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5682, -4812, -6450 ], flag: 0, tc: [ -4118, -1054 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5682, -5836, -6450 ], flag: 0, tc: [ -4118, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6252, -4137, -6450 ], flag: 0, tc: [ 1568, -7784 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5477, -4812, -6450 ], flag: 0, tc: [ -6162, -1054 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6225, -4038, -6450 ], flag: 0, tc: [ 1302, -8778 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5477, -3839, -6450 ], flag: 0, tc: [ -6162, -10768 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6252, -3938, -6450 ], flag: 0, tc: [ 1568, -9772 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6325, -3865, -6450 ], flag: 0, tc: [ 2296, -10500 ], color: [ 0, 0, 129, 255 ] }, ] const ccm_seg7_vertex_0701D308 = [ { pos: [ -7576, -5836, -6911 ], flag: 0, tc: [ -1564, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5703, -6819 ], flag: 0, tc: [ -2482, -338 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5703, -6716 ], flag: 0, tc: [ -3504, -338 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5580, -6911 ], flag: 0, tc: [ -1562, -1566 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5600, -6819 ], flag: 0, tc: [ -2482, -1360 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5836, -6450 ], flag: 0, tc: [ -6162, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5426, -6450 ], flag: 0, tc: [ -6162, -3098 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5580, -7065 ], flag: 0, tc: [ 0, -1566 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5682, -4812, -7372 ], flag: 0, tc: [ 10188, -1054 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6706, -5836, -7372 ], flag: 0, tc: [ 0, 9164 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5682, -5836, -7372 ], flag: 0, tc: [ 10188, 9164 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5600, -6716 ], flag: 0, tc: [ -3504, -1360 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5682, -4812, -7372 ], flag: 0, tc: [ 0, -9230 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5682, -5836, -7372 ], flag: 0, tc: [ 0, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5682, -5836, -6450 ], flag: 0, tc: [ 9166, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5682, -4812, -6450 ], flag: 0, tc: [ 9166, -9230 ], color: [ 129, 0, 0, 255 ] }, ] const ccm_seg7_vertex_0701D408 = [ { pos: [ -5682, -4812, -7372 ], flag: 0, tc: [ 10188, -1054 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6706, -4812, -7372 ], flag: 0, tc: [ 0, -1054 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6706, -5836, -7372 ], flag: 0, tc: [ 0, 9164 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7679, -5580, -6911 ], flag: 0, tc: [ -262, 918 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -7576, -5580, -7065 ], flag: 0, tc: [ 1268, 236 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -7576, -5580, -6911 ], flag: 0, tc: [ -262, 236 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6706, -5221, -7372 ], flag: 0, tc: [ 0, 3032 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5426, -7372 ], flag: 0, tc: [ -8716, 5076 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5836, -7372 ], flag: 0, tc: [ -8716, 9164 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5426, -6450 ], flag: 0, tc: [ -6162, -3098 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5580, -7065 ], flag: 0, tc: [ 0, -1566 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5426, -7372 ], flag: 0, tc: [ 3034, -3098 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5836, -7065 ], flag: 0, tc: [ 0, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5836, -7372 ], flag: 0, tc: [ 3034, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7679, -5580, -7065 ], flag: 0, tc: [ 1268, 918 ], color: [ 0, 129, 0, 255 ] }, ] const ccm_seg7_vertex_0701D4F8 = [ { pos: [ -6706, -5836, -6501 ], flag: 0, tc: [ 990, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6706, -5426, -6143 ], flag: 0, tc: [ -2586, -3098 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6706, -5836, -6143 ], flag: 0, tc: [ -2586, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -7576, -5836, -7065 ], flag: 0, tc: [ 990, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7679, -5580, -7065 ], flag: 0, tc: [ 0, -1564 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7679, -5836, -7065 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5580, -7065 ], flag: 0, tc: [ 990, -1564 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7679, -5836, -6911 ], flag: 0, tc: [ 990, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7679, -5580, -6911 ], flag: 0, tc: [ 990, -1564 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7576, -5580, -6911 ], flag: 0, tc: [ 0, -1564 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7576, -5836, -6911 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6296, -5426, -6143 ], flag: 0, tc: [ -3096, 990 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6706, -5426, -6501 ], flag: 0, tc: [ 990, -1054 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6296, -5426, -6501 ], flag: 0, tc: [ -3096, -1054 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6706, -5426, -6143 ], flag: 0, tc: [ 990, 990 ], color: [ 0, 129, 0, 255 ] }, ] const ccm_seg7_vertex_0701D5E8 = [ { pos: [ -5119, 7680, -6757 ], flag: 0, tc: [ 0, -9230 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 7322, -6553 ], flag: 0, tc: [ 2012, -5654 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 7322, -5733 ], flag: 0, tc: [ 10188, -5654 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6706, -5836, -6501 ], flag: 0, tc: [ 990, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6706, -5426, -6501 ], flag: 0, tc: [ 990, -3098 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6706, -5426, -6143 ], flag: 0, tc: [ -2586, -3098 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6296, -5836, -6143 ], flag: 0, tc: [ 3544, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6296, -5426, -6501 ], flag: 0, tc: [ 0, -3098 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6296, -5836, -6501 ], flag: 0, tc: [ 0, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -6296, -5426, -6143 ], flag: 0, tc: [ 3546, -3098 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 6656, -6553 ], flag: 0, tc: [ 2012, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 6656, -6757 ], flag: 0, tc: [ 0, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 7680, -5529 ], flag: 0, tc: [ 12232, -9230 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5938, 8038, -6041 ], flag: 0, tc: [ 0, -2588 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5938, 7680, -6041 ], flag: 0, tc: [ 0, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5938, 7680, -6245 ], flag: 0, tc: [ 2012, 990 ], color: [ 127, 0, 0, 255 ] }, ] const ccm_seg7_vertex_0701D6E8 = [ { pos: [ -5119, 7680, -5529 ], flag: 0, tc: [ 12232, -9230 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 7322, -5733 ], flag: 0, tc: [ 10188, -5654 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 6656, -5733 ], flag: 0, tc: [ 10188, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5119, 6656, -5529 ], flag: 0, tc: [ 12232, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5938, 7680, -6245 ], flag: 0, tc: [ -4118, -1668 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6348, 7680, -6757 ], flag: 0, tc: [ 990, 1056 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5119, 7680, -6757 ], flag: 0, tc: [ 990, -7118 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5938, 7680, -6041 ], flag: 0, tc: [ -6162, -1668 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5733, 7680, -6245 ], flag: 0, tc: [ -4118, -3030 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5119, 7680, -5529 ], flag: 0, tc: [ -11272, -7118 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5733, 7680, -6041 ], flag: 0, tc: [ -6162, -3030 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -6348, 7680, -5529 ], flag: 0, tc: [ -11272, 1056 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5938, 8038, -6041 ], flag: 0, tc: [ 2012, -2586 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5733, 7680, -6041 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5938, 7680, -6041 ], flag: 0, tc: [ 2012, 990 ], color: [ 0, 0, 129, 255 ] }, ] const ccm_seg7_vertex_0701D7D8 = [ { pos: [ -5938, 8038, -6041 ], flag: 0, tc: [ 0, -2588 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5938, 7680, -6245 ], flag: 0, tc: [ 2012, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5938, 8038, -6245 ], flag: 0, tc: [ 2012, -2586 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -5733, 8038, -6245 ], flag: 0, tc: [ 0, -2586 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5733, 7680, -6245 ], flag: 0, tc: [ 0, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5733, 7680, -6041 ], flag: 0, tc: [ 2012, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5733, 8038, -6041 ], flag: 0, tc: [ 2012, -2588 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5938, 7680, -6245 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5733, 7680, -6245 ], flag: 0, tc: [ 2012, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5733, 8038, -6245 ], flag: 0, tc: [ 2012, -2586 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5938, 8038, -6245 ], flag: 0, tc: [ 0, -2586 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5938, 8038, -6041 ], flag: 0, tc: [ 2012, -2586 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5733, 8038, -6041 ], flag: 0, tc: [ 0, -2586 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5733, 7680, -6041 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 129, 255 ] }, ] const ccm_seg7_vertex_0701D8B8 = [ { pos: [ -4709, 7322, -5733 ], flag: 0, tc: [ 0, -5652 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -4709, 6656, -5733 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5119, 6656, -5733 ], flag: 0, tc: [ 4056, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6348, 7680, -5529 ], flag: 0, tc: [ 0, -9230 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6348, 6656, -5529 ], flag: 0, tc: [ 0, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6348, 7680, -6757 ], flag: 0, tc: [ 12232, -9230 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6348, 6656, -6757 ], flag: 0, tc: [ 12232, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -6348, 6656, -6757 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5119, 6656, -6757 ], flag: 0, tc: [ 12232, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5119, 7680, -6757 ], flag: 0, tc: [ 12232, -9230 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6348, 7680, -6757 ], flag: 0, tc: [ 0, -9230 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6348, 7680, -5529 ], flag: 0, tc: [ 12232, -9230 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5119, 6656, -5529 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6348, 6656, -5529 ], flag: 0, tc: [ 12232, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5119, 7680, -5529 ], flag: 0, tc: [ 0, -9230 ], color: [ 0, 0, 129, 255 ] }, ] const ccm_seg7_vertex_0701D9A8 = [ { pos: [ -4709, 7322, -5733 ], flag: 0, tc: [ -7184, -1736 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5119, 7322, -5733 ], flag: 0, tc: [ -7184, 990 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -5119, 7322, -6553 ], flag: 0, tc: [ 990, 990 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -4709, 7322, -5733 ], flag: 0, tc: [ 0, -5652 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5119, 6656, -5733 ], flag: 0, tc: [ 4056, 990 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5119, 7322, -5733 ], flag: 0, tc: [ 4056, -5652 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -5119, 7322, -6553 ], flag: 0, tc: [ 0, -5654 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5119, 6656, -6553 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -4709, 7322, -6553 ], flag: 0, tc: [ 4056, -5654 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -4709, 6656, -6553 ], flag: 0, tc: [ 4056, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -4709, 7322, -6553 ], flag: 0, tc: [ 990, -1736 ], color: [ 0, 129, 0, 255 ] }, ] const ccm_seg7_vertex_0701DA58 = [ { pos: [ -6706, -5426, -6501 ], flag: 0, tc: [ 6100, 5076 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6706, -5836, -6501 ], flag: 0, tc: [ 6100, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6757, -5836, -6501 ], flag: 0, tc: [ 6610, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6296, -5426, -6501 ], flag: 0, tc: [ 2012, 5076 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6757, -5375, -6501 ], flag: 0, tc: [ 6610, 4566 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6245, -5375, -6501 ], flag: 0, tc: [ 1500, 4566 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6245, -5836, -6501 ], flag: 0, tc: [ 1500, 9164 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -6296, -5836, -6501 ], flag: 0, tc: [ 2012, 9164 ], color: [ 0, 0, 129, 255 ] }, ] const ccm_seg7_vertex_0701DAD8 = [ { pos: [ -7679, -5703, -6716 ], flag: 0, tc: [ 0, 308 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5703, -6716 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5703, -6819 ], flag: 0, tc: [ 990, 990 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5703, -6716 ], flag: 0, tc: [ 0, -338 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7679, -5703, -6716 ], flag: 0, tc: [ 990, -338 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7679, -5600, -6716 ], flag: 0, tc: [ 990, -1360 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7576, -5600, -6716 ], flag: 0, tc: [ 0, -1360 ], color: [ 0, 0, 129, 255 ] }, { pos: [ -7679, -5703, -6819 ], flag: 0, tc: [ 0, -338 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5703, -6819 ], flag: 0, tc: [ 990, -338 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7679, -5600, -6819 ], flag: 0, tc: [ 0, -1360 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5600, -6819 ], flag: 0, tc: [ 990, -1360 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7576, -5600, -6819 ], flag: 0, tc: [ -1182, 236 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -7576, -5600, -6716 ], flag: 0, tc: [ -2204, 236 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -7679, -5600, -6716 ], flag: 0, tc: [ -2204, 918 ], color: [ 0, 129, 0, 255 ] }, { pos: [ -7679, -5600, -6819 ], flag: 0, tc: [ -1182, 918 ], color: [ 0, 129, 0, 255 ] }, ] const ccm_seg7_vertex_0701DBC8 = [ { pos: [ -7167, -5836, -6143 ], flag: 0, tc: [ -8720, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6706, -5836, -6143 ], flag: 0, tc: [ -4118, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6706, -5426, -6143 ], flag: 0, tc: [ -4118, -3098 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7679, -5703, -6716 ], flag: 0, tc: [ 0, 308 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5703, -6819 ], flag: 0, tc: [ 990, 990 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7679, -5703, -6819 ], flag: 0, tc: [ 990, 308 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6296, -5836, -6143 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5784, -5836, -6143 ], flag: 0, tc: [ 5078, 990 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -6296, -5426, -6143 ], flag: 0, tc: [ 0, -3098 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -5784, -4197, -6143 ], flag: 0, tc: [ 5078, -15362 ], color: [ 0, 0, 127, 255 ] }, { pos: [ -7167, -4197, -6143 ], flag: 0, tc: [ -8720, -15362 ], color: [ 0, 0, 127, 255 ] }, ] const ccm_seg7_vertex_0701DC78 = [ { pos: [ -7576, -5426, -6450 ], flag: 0, tc: [ 5078, 5076 ], color: [ 29, 133, 0, 255 ] }, { pos: [ -6706, -5221, -7372 ], flag: 0, tc: [ -3844, -4120 ], color: [ 29, 133, 0, 255 ] }, { pos: [ -6706, -5221, -6450 ], flag: 0, tc: [ -3844, 5076 ], color: [ 29, 133, 0, 255 ] }, { pos: [ -7576, -5426, -7372 ], flag: 0, tc: [ 5078, -4120 ], color: [ 29, 133, 0, 255 ] }, { pos: [ -6348, 6656, -5529 ], flag: 0, tc: [ 6100, 990 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5119, 6656, -5529 ], flag: 0, tc: [ 6100, -5142 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5119, 6656, -6757 ], flag: 0, tc: [ 0, -5142 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6348, 6656, -6757 ], flag: 0, tc: [ 0, 990 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5119, 6656, -6553 ], flag: 0, tc: [ 990, -5142 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5119, 6656, -5733 ], flag: 0, tc: [ 5078, -5142 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -4709, 6656, -5733 ], flag: 0, tc: [ 5078, -7186 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -4709, 6656, -6553 ], flag: 0, tc: [ 990, -7186 ], color: [ 0, 127, 0, 255 ] }, ] const ccm_seg7_vertex_0701DD38 = [ { pos: [ -5477, -4812, -7679 ], flag: 0, tc: [ -2074, 3542 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6706, -4812, -7679 ], flag: 0, tc: [ 4056, 3542 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6706, -4812, -7372 ], flag: 0, tc: [ 4056, 2010 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5692, -5651, -6891 ], flag: 0, tc: [ 0, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5692, -5744, -6891 ], flag: 0, tc: [ 990, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5692, -5651, -6829 ], flag: 0, tc: [ 0, -84 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5692, -5744, -6829 ], flag: 0, tc: [ 990, -84 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5692, -5580, -6860 ], flag: 0, tc: [ 0, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5692, -5651, -6921 ], flag: 0, tc: [ 1764, 990 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5692, -5651, -6798 ], flag: 0, tc: [ 250, -760 ], color: [ 129, 0, 0, 255 ] }, { pos: [ -5682, -4812, -6450 ], flag: 0, tc: [ -1052, -2586 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5477, -4812, -6450 ], flag: 0, tc: [ -2074, -2586 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5682, -4812, -7372 ], flag: 0, tc: [ -1052, 2010 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5836, -6911 ], flag: 0, tc: [ 5844, -5398 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7679, -5836, -7065 ], flag: 0, tc: [ 6610, -5908 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7679, -5836, -6911 ], flag: 0, tc: [ 5844, -5908 ], color: [ 0, 127, 0, 255 ] }, ] const ccm_seg7_vertex_0701DE38 = [ { pos: [ -7576, -5836, -6911 ], flag: 0, tc: [ 5844, -5398 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5836, -7065 ], flag: 0, tc: [ 6610, -5398 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7679, -5836, -7065 ], flag: 0, tc: [ 6610, -5908 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5836, -6450 ], flag: 0, tc: [ 990, -4376 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5682, -5836, -7372 ], flag: 0, tc: [ 5588, 5076 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7576, -5836, -7372 ], flag: 0, tc: [ 5588, -4376 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -5682, -5836, -6450 ], flag: 0, tc: [ 990, 5076 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6296, -5836, -6450 ], flag: 0, tc: [ 990, 2010 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6706, -5836, -6450 ], flag: 0, tc: [ 990, 0 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6706, -5836, -6143 ], flag: 0, tc: [ -542, 0 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -6296, -5836, -6143 ], flag: 0, tc: [ -542, 2010 ], color: [ 0, 127, 0, 255 ] }, ] const ccm_seg7_vertex_0701DEE8 = [ { pos: [ -8703, -5068, -7628 ], flag: 0, tc: [ 990, 0 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -8703, -5836, -6194 ], flag: 0, tc: [ 0, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -8703, -5836, -7628 ], flag: 0, tc: [ 990, 990 ], color: [ 127, 0, 0, 255 ] }, { pos: [ -8703, -5068, -6194 ], flag: 0, tc: [ 0, 0 ], color: [ 127, 0, 0, 255 ] }, ] const ccm_seg7_vertex_0701DF28 = [ { pos: [ -8703, -5836, -7628 ], flag: 0, tc: [ 1050, 990 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7679, -5836, -6194 ], flag: 0, tc: [ -1052, 990 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -7679, -5836, -7628 ], flag: 0, tc: [ 554, 1882 ], color: [ 0, 127, 0, 255 ] }, { pos: [ -8703, -5836, -6194 ], flag: 0, tc: [ -556, 96 ], color: [ 0, 127, 0, 255 ] }, ] export const ccm_seg7_dl_0701DF68 = [ Gbi.gsDPSetTextureImage(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 1, snow_09005000), Gbi.gsDPLoadBlock(Gbi.G_TX_LOADTILE, 0, 0, 32 * 32 - 1), Gbi.gsSPLight(ccm_seg7_lights_0701CED8.l[0], 1), Gbi.gsSPLight(ccm_seg7_lights_0701CED8.a, 2), Gbi.gsSPVertex(ccm_seg7_vertex_0701CF38, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), ...Gbi.gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), Gbi.gsSP1Triangle(11, 13, 14, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D028, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), ...Gbi.gsSP2Triangles(10, 11, 12, 0x0, 10, 13, 11, 0x0), Gbi.gsSP1Triangle( 0, 2, 14, 0x0), Gbi.gsSPLight(ccm_seg7_lights_0701CEF0.l[0], 1), Gbi.gsSPLight(ccm_seg7_lights_0701CEF0.a, 2), Gbi.gsSPVertex(ccm_seg7_vertex_0701D118, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), ...Gbi.gsSP2Triangles( 4, 5, 6, 0x0, 4, 7, 8, 0x0), ...Gbi.gsSP2Triangles( 4, 9, 7, 0x0, 4, 6, 9, 0x0), ...Gbi.gsSP2Triangles( 8, 10, 4, 0x0, 10, 11, 4, 0x0), Gbi.gsSP1Triangle(12, 13, 14, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D208, 16, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), ...Gbi.gsSP2Triangles( 4, 1, 0, 0x0, 0, 5, 4, 0x0), ...Gbi.gsSP2Triangles( 6, 7, 8, 0x0, 6, 8, 9, 0x0), ...Gbi.gsSP2Triangles( 7, 10, 8, 0x0, 11, 8, 10, 0x0), ...Gbi.gsSP2Triangles(10, 12, 11, 0x0, 11, 12, 13, 0x0), ...Gbi.gsSP2Triangles(13, 12, 14, 0x0, 13, 14, 15, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D308, 16, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 1, 3, 4, 0x0), ...Gbi.gsSP2Triangles( 1, 0, 3, 0x0, 0, 2, 5, 0x0), ...Gbi.gsSP2Triangles( 6, 3, 7, 0x0, 6, 4, 3, 0x0), ...Gbi.gsSP2Triangles( 8, 9, 10, 0x0, 6, 11, 4, 0x0), ...Gbi.gsSP2Triangles( 5, 2, 11, 0x0, 5, 11, 6, 0x0), ...Gbi.gsSP2Triangles(12, 13, 14, 0x0, 12, 14, 15, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D408, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 2, 6, 7, 0x0, 2, 7, 8, 0x0), ...Gbi.gsSP2Triangles( 9, 10, 11, 0x0, 11, 10, 12, 0x0), ...Gbi.gsSP2Triangles(11, 12, 13, 0x0, 3, 14, 4, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D4F8, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), ...Gbi.gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), Gbi.gsSP1Triangle(11, 14, 12, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D5E8, 16, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 6, 7, 8, 0x0, 6, 9, 7, 0x0), ...Gbi.gsSP2Triangles(10, 1, 0, 0x0, 10, 0, 11, 0x0), ...Gbi.gsSP2Triangles( 0, 2, 12, 0x0, 13, 14, 15, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D6E8, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), ...Gbi.gsSP2Triangles( 4, 5, 6, 0x0, 5, 4, 7, 0x0), ...Gbi.gsSP2Triangles( 4, 6, 8, 0x0, 9, 8, 6, 0x0), ...Gbi.gsSP2Triangles( 9, 10, 8, 0x0, 5, 7, 11, 0x0), ...Gbi.gsSP2Triangles(11, 7, 10, 0x0, 11, 10, 9, 0x0), Gbi.gsSP1Triangle(12, 13, 14, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D7D8, 14, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), ...Gbi.gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D8B8, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 4, 6, 5, 0x0, 7, 8, 9, 0x0), ...Gbi.gsSP2Triangles( 7, 9, 10, 0x0, 11, 12, 13, 0x0), Gbi.gsSP1Triangle(11, 14, 12, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701D9A8, 11, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 6, 7, 8, 0x0, 7, 9, 8, 0x0), Gbi.gsSP1Triangle(10, 0, 2, 0x0), Gbi.gsSPLight(ccm_seg7_lights_0701CF08.l[0], 1), Gbi.gsSPLight(ccm_seg7_lights_0701CF08.a, 2), Gbi.gsSPVertex(ccm_seg7_vertex_0701DA58, 8, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 0, 4, 0x0), ...Gbi.gsSP2Triangles( 0, 2, 4, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 6, 7, 3, 0x0, 6, 3, 5, 0x0), Gbi.gsSPLight(ccm_seg7_lights_0701CF20.l[0], 1), Gbi.gsSPLight(ccm_seg7_lights_0701CF20.a, 2), Gbi.gsSPVertex(ccm_seg7_vertex_0701DAD8, 15, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 3, 5, 6, 0x0, 7, 8, 9, 0x0), ...Gbi.gsSP2Triangles( 8, 10, 9, 0x0, 11, 12, 13, 0x0), Gbi.gsSP1Triangle(14, 11, 13, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701DBC8, 11, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 6, 7, 8, 0x0, 7, 9, 8, 0x0), ...Gbi.gsSP2Triangles( 2, 9, 10, 0x0, 2, 8, 9, 0x0), Gbi.gsSP1Triangle( 0, 2, 10, 0x0), Gbi.gsSPEndDisplayList(), ] export const ccm_seg7_dl_0701E3F8 = [ Gbi.gsDPSetTextureImage(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 1, snow_09008000), Gbi.gsDPLoadBlock(Gbi.G_TX_LOADTILE, 0, 0, 32 * 32 - 1), Gbi.gsSPLight(ccm_seg7_lights_0701CEF0.l[0], 1), Gbi.gsSPLight(ccm_seg7_lights_0701CEF0.a, 2), Gbi.gsSPVertex(ccm_seg7_vertex_0701DC78, 12, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), ...Gbi.gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), ...Gbi.gsSP2Triangles( 8, 9, 10, 0x0, 8, 10, 11, 0x0), Gbi.gsSPLight(ccm_seg7_lights_0701CF20.l[0], 1), Gbi.gsSPLight(ccm_seg7_lights_0701CF20.a, 2), Gbi.gsSPVertex(ccm_seg7_vertex_0701DD38, 16, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 4, 6, 5, 0x0, 7, 8, 9, 0x0), ...Gbi.gsSP2Triangles( 0, 10, 11, 0x0, 0, 12, 10, 0x0), ...Gbi.gsSP2Triangles( 0, 2, 12, 0x0, 13, 14, 15, 0x0), Gbi.gsSPVertex(ccm_seg7_vertex_0701DE38, 11, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 3, 4, 5, 0x0), ...Gbi.gsSP2Triangles( 3, 6, 4, 0x0, 7, 8, 9, 0x0), Gbi.gsSP1Triangle( 7, 9, 10, 0x0), Gbi.gsSPEndDisplayList(), ] export const ccm_seg7_dl_0701E4E8 = [ Gbi.gsDPSetTextureImage(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 1, ccm_seg7_texture_07004300), Gbi.gsDPLoadBlock(Gbi.G_TX_LOADTILE, 0, 0, 32 * 32 - 1), Gbi.gsSPVertex(ccm_seg7_vertex_0701DEE8, 4, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), Gbi.gsSPEndDisplayList(), ] export const ccm_seg7_dl_0701E520 = [ Gbi.gsDPSetTextureImage(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 1, snow_09008800), Gbi.gsDPLoadBlock(Gbi.G_TX_LOADTILE, 0, 0, 32 * 32 - 1), Gbi.gsSPVertex(ccm_seg7_vertex_0701DF28, 4, 0), ...Gbi.gsSP2Triangles( 0, 1, 2, 0x0, 0, 3, 1, 0x0), Gbi.gsSPEndDisplayList(), ] export const ccm_seg7_dl_0701E558 = [ Gbi.gsDPSetCombineMode(Gbi.G_CC_MODULATERGB), Gbi.gsSPClearGeometryMode(Gbi.G_SHADING_SMOOTH), Gbi.gsDPSetTile(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 0, 0, Gbi.G_TX_LOADTILE, 0, Gbi.G_TX_WRAP | Gbi.G_TX_NOMIRROR, Gbi.G_TX_NOMASK, Gbi.G_TX_NOLOD, Gbi.G_TX_WRAP | Gbi.G_TX_NOMIRROR, Gbi.G_TX_NOMASK, Gbi.G_TX_NOLOD), Gbi.gsSPTexture(0xFFFF, 0xFFFF, 0, Gbi.G_TX_RENDERTILE, Gbi.G_ON), Gbi.gsDPSetTile(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 8, 0, Gbi.G_TX_RENDERTILE, 0, Gbi.G_TX_WRAP | Gbi.G_TX_NOMIRROR, 5, Gbi.G_TX_NOLOD, Gbi.G_TX_WRAP | Gbi.G_TX_NOMIRROR, 5, Gbi.G_TX_NOLOD), Gbi.gsDPSetTileSize(0, 0, 0, (32 - 1) << Gbi.G_TEXTURE_IMAGE_FRAC, (32 - 1) << Gbi.G_TEXTURE_IMAGE_FRAC), Gbi.gsSPDisplayList(ccm_seg7_dl_0701DF68), Gbi.gsSPDisplayList(ccm_seg7_dl_0701E3F8), Gbi.gsDPSetTile(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 8, 0, Gbi.G_TX_RENDERTILE, 0, Gbi.G_TX_CLAMP, 5, Gbi.G_TX_NOLOD, Gbi.G_TX_WRAP | Gbi.G_TX_NOMIRROR, 5, Gbi.G_TX_NOLOD), Gbi.gsDPSetTileSize(0, 0, 0, (32 - 1) << Gbi.G_TEXTURE_IMAGE_FRAC, (32 - 1) << Gbi.G_TEXTURE_IMAGE_FRAC), Gbi.gsSPDisplayList(ccm_seg7_dl_0701E4E8), Gbi.gsDPSetTile(Gbi.G_IM_FMT_RGBA, Gbi.G_IM_SIZ_16b, 8, 0, Gbi.G_TX_RENDERTILE, 0, Gbi.G_TX_WRAP | Gbi.G_TX_NOMIRROR, 5, Gbi.G_TX_NOLOD, Gbi.G_TX_WRAP | Gbi.G_TX_NOMIRROR, 5, Gbi.G_TX_NOLOD), Gbi.gsDPSetTileSize(0, 0, 0, (32 - 1) << Gbi.G_TEXTURE_IMAGE_FRAC, (32 - 1) << Gbi.G_TEXTURE_IMAGE_FRAC), Gbi.gsSPDisplayList(ccm_seg7_dl_0701E520), Gbi.gsSPTexture(0xFFFF, 0xFFFF, 0, Gbi.G_TX_RENDERTILE, Gbi.G_OFF), Gbi.gsDPSetCombineMode(Gbi.G_CC_SHADE), Gbi.gsSPSetGeometryMode(Gbi.G_SHADING_SMOOTH), Gbi.gsSPEndDisplayList(), ]
import React from 'react' import Feedback from 'marketplace/components/Feedback/Feedback' import DocumentTitle from 'react-document-title' import AUpageAlert from '@gov.au/page-alerts/lib/js/react.js' import AUheading from '@gov.au/headings/lib/js/react.js' import { rootPath } from 'marketplace/routes' const BriefATMResponseSubmitted = props => ( <div className="row"> <DocumentTitle title="Brief Response Submitted - Digital Marketplace"> <div className="col-sm-push-2 col-sm-8 col-xs-12"> <article role="main"> {!props.app.feedbackSuccess && ( <AUpageAlert as="success"> <AUheading level="4" size="md"> {props.briefResponsePreviousStatus === 'draft' && ( <span>Your response has been successfully submitted.</span> )} {props.briefResponsePreviousStatus === 'submitted' && <span>You have updated your response.</span>} </AUheading> <p> The buyer receives all submitted responses after the opportunity closes. You can{' '} <a href={`${rootPath}/brief/${props.briefId}/atm/respond/${props.briefResponseId}`}> update your response </a>{' '} any time before the closing date. </p> <p> <a href={`${rootPath}/brief/${props.briefId}/atm/respond/${props.briefResponseId}`} className="au-btn"> Edit your response </a> </p> </AUpageAlert> )} <br /> <Feedback app={props.app} handleSubmit={props.handleSubmit} difficultyQuestion="How easy or difficult was it for you to respond to this opportunity?" commentQuestion="How would you improve responding to an opportunity?" objectAction="responded_to" /> </article> </div> </DocumentTitle> </div> ) export default BriefATMResponseSubmitted
import './index.css'; import Uploader from './uploader'; const LOADER_TIMEOUT = 500; const Icon = '<svg width="12" height="14" xmlns="http://www.w3.org/2000/svg"><path d="M4.109 2.08H2.942a.862.862 0 0 0-.862.862v8.116c0 .476.386.862.862.862h5.529a.862.862 0 0 0 .862-.862V7.695H4.11V2.08zm1.905.497v3.29h3.312l-3.312-3.29zM2.942 0h2.74c.326.02.566.076.719.165.153.09.484.413.992.973l3.21 3.346c.347.413.557.683.631.811.111.193.179.446.179.579v5.184A2.942 2.942 0 0 1 8.471 14H2.942A2.942 2.942 0 0 1 0 11.058V2.942A2.942 2.942 0 0 1 2.942 0z" fill-rule="nonzero"/></svg>'; const FileIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="40"><g fill="#A8ACB8" fill-rule="evenodd"><path fill-rule="nonzero" d="M17 0l15 14V3v34a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3h20-6zm0 2H3a1 1 0 0 0-1 1v34a1 1 0 0 0 1 1h26a1 1 0 0 0 1-1V14H17V2zm2 10h7.926L19 4.602V12z"/><path d="M7 22h18v2H7zm0 4h18v2H7zm0 4h18v2H7z"/></g></svg>'; const CustomFileIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="40"><path d="M17 0l15 14V3v34a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V3a3 3 0 0 1 3-3h20-6zm0 2H3a1 1 0 0 0-1 1v34a1 1 0 0 0 1 1h26a1 1 0 0 0 1-1V14H17V2zm2 10h7.926L19 4.602V12z"/></svg>'; const DownloadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="17pt" height="17pt" viewBox="0 0 17 17"><path d="M9.457 8.945V2.848A.959.959 0 0 0 8.5 1.89a.959.959 0 0 0-.957.957v6.097L4.488 5.891a.952.952 0 0 0-1.351 0 .952.952 0 0 0 0 1.351l4.687 4.688a.955.955 0 0 0 1.352 0l4.687-4.688a.952.952 0 0 0 0-1.351.952.952 0 0 0-1.351 0zM3.59 14.937h9.82a.953.953 0 0 0 .953-.957.952.952 0 0 0-.953-.953H3.59a.952.952 0 0 0-.953.953c0 .532.425.957.953.957zm0 0" fill-rule="evenodd"/></svg>'; /** * @typedef {object} AttachesToolData * @description Attaches Tool's output data format * @property {AttachesFileData} file - object containing information about the file * @property {string} title - file's title */ /** * @typedef {object} AttachesFileData * @description Attaches Tool's file format * @property {string} [url] - file's upload url * @property {string} [size] - file's size * @property {string} [extension] - file's extension * @property {string} [name] - file's name */ /** * @typedef {object} FileData * @description Attaches Tool's response from backend * @property {string} url - file's url * @property {string} name - file's name with extension * @property {string} extension - file's extension */ /** * @typedef {object} UploadResponseFormat * @description This format expected from backend on file upload * @property {number} success - 1 for successful uploading, 0 for failure * @property {FileData} file - backend response with uploaded file data. */ /** * @typedef {object} AttachesToolConfig * @description Config supported by Tool * @property {string} endpoint - file upload url * @property {string} field - field name for uploaded file * @property {string} types - available mime-types * @property {string} placeholder * @property {string} errorMessage */ /** * @class AttachesTool * @classdesc AttachesTool for Editor.js 2.0 * * @property {API} api - Editor.js API * @property {AttachesToolData} data * @property {AttachesToolConfig} config */ export default class AttachesTool { static get isReadOnlySupported() { return true; } /** * @param {AttachesToolData} data * @param {Object} config * @param {API} api * @param {boolean} readOnly - read-only mode flag */ constructor({ data, config, api, readOnly }) { this.api = api; this.readOnly = readOnly; this.nodes = { wrapper: null, button: null, title: null, }; this._data = { file: {}, title: '', }; this.config = { endpoint: config.endpoint || '', field: config.field || 'file', types: config.types || '*', buttonText: config.buttonText || 'Select file to upload', errorMessage: config.errorMessage || 'File upload failed', }; this.data = data; /** * Module for files uploading */ this.uploader = new Uploader({ config: this.config, onUpload: (response) => this.onUpload(response), onError: (error) => this.uploadingFailed(error), }); this.enableFileUpload = this.enableFileUpload.bind(this); } /** * Get Tool toolbox settings * icon - Tool icon's SVG * title - title to show in toolbox */ static get toolbox() { return { icon: Icon, title: 'Attaches', }; } /** * Tool's CSS classes */ get CSS() { return { baseClass: this.api.styles.block, apiButton: this.api.styles.button, loader: this.api.styles.loader, /** * Tool's classes */ wrapper: 'cdx-attaches', wrapperWithFile: 'cdx-attaches--with-file', wrapperLoading: 'cdx-attaches--loading', button: 'cdx-attaches__button', title: 'cdx-attaches__title', size: 'cdx-attaches__size', downloadButton: 'cdx-attaches__download-button', fileInfo: 'cdx-attaches__file-info', fileIcon: 'cdx-attaches__file-icon', }; } /** * Possible files' extension colors */ get EXTENSIONS() { return { doc: '#3e74da', docx: '#3e74da', odt: '#3e74da', pdf: '#d47373', rtf: '#656ecd', tex: '#5a5a5b', txt: '#5a5a5b', pptx: '#e07066', ppt: '#e07066', mp3: '#eab456', mp4: '#f676a6', xls: '#3f9e64', html: '#2988f0', htm: '#2988f0', png: '#f676a6', jpg: '#f67676', jpeg: '#f67676', gif: '#f6af76', zip: '#4f566f', rar: '#4f566f', exe: '#e26f6f', svg: '#bf5252', key: '#e07066', sketch: '#df821c', ai: '#df821c', psd: '#388ae5', dmg: '#e26f6f', json: '#2988f0', csv: '#3f9e64', }; } /** * Return Block data * @param {HTMLElement} toolsContent * @return {AttachesToolData} */ save(toolsContent) { /** * If file was uploaded */ if (this.pluginHasData()) { const title = toolsContent.querySelector(`.${this.CSS.title}`).innerHTML; Object.assign(this.data, { title }); } return this.data; } /** * Renders Block content * @return {HTMLDivElement} */ render() { const holder = this.make('div', this.CSS.baseClass); this.nodes.wrapper = this.make('div', this.CSS.wrapper); if (this.pluginHasData()) { this.showFileData(); } else { this.prepareUploadButton(); } holder.appendChild(this.nodes.wrapper); return holder; } /** * Prepares button for file uploading */ prepareUploadButton() { this.nodes.button = this.make('div', [this.CSS.apiButton, this.CSS.button]); this.nodes.button.innerHTML = `${Icon} ${this.config.buttonText}`; this.nodes.button.addEventListener('click', this.enableFileUpload); this.nodes.wrapper.appendChild(this.nodes.button); } /** * Fires after clicks on the Toolbox AttachesTool Icon * Initiates click on the Select File button * @public */ appendCallback() { this.nodes.button.click(); } /** * Checks if any of Tool's fields have data * @return {boolean} */ pluginHasData() { return ( this.data.title !== '' || Object.values(this.data.file).some((item) => item !== undefined) ); } /** * Allow to upload files on button click */ enableFileUpload() { this.uploader.uploadSelectedFile({ onPreview: () => { this.nodes.wrapper.classList.add(this.CSS.wrapperLoading, this.CSS.loader); }, }); } /** * File uploading callback * @param {UploadResponseFormat} response */ onUpload(response) { const body = response.body; if (body.result.code === 'RS0000') { const { download: url, originalname: name, size } = body.data; this.data = { file: { url, extension: name.split('.').pop(), name, size, }, title: name, }; this.nodes.button.remove(); this.showFileData(); this.moveCaretToEnd(this.nodes.title); this.nodes.title.focus(); this.removeLoader(); } else { this.uploadingFailed(this.config.errorMessage); } } /** * Handles uploaded file's extension and appends corresponding icon */ appendFileIcon() { const extension = this.data.file.extension || ''; const extensionColor = this.EXTENSIONS[extension]; const fileIcon = this.make('div', this.CSS.fileIcon, { innerHTML: extensionColor ? CustomFileIcon : FileIcon, }); if (extensionColor) { fileIcon.style.color = extensionColor; fileIcon.setAttribute('data-extension', extension); } this.nodes.wrapper.appendChild(fileIcon); } /** * Removes tool's loader */ removeLoader() { setTimeout( () => this.nodes.wrapper.classList.remove(this.CSS.wrapperLoading, this.CSS.loader), LOADER_TIMEOUT, ); } /** * If upload is successful, show info about the file */ showFileData() { this.nodes.wrapper.classList.add(this.CSS.wrapperWithFile); const { file: { size, url }, title, } = this.data; this.appendFileIcon(); const fileInfo = this.make('div', this.CSS.fileInfo); if (title) { this.nodes.title = this.make('div', this.CSS.title, { contentEditable: !this.readOnly, }); this.nodes.title.textContent = title; fileInfo.appendChild(this.nodes.title); } if (size) { let sizePrefix; let formattedSize; const fileSize = this.make('div', this.CSS.size); if (Math.log10(+size) >= 6) { sizePrefix = 'MiB'; formattedSize = size / Math.pow(2, 20); } else { sizePrefix = 'KiB'; formattedSize = size / Math.pow(2, 10); } fileSize.textContent = formattedSize.toFixed(1); fileSize.setAttribute('data-size', sizePrefix); fileInfo.appendChild(fileSize); } this.nodes.wrapper.appendChild(fileInfo); const downloadIcon = this.make('a', this.CSS.downloadButton, { innerHTML: DownloadIcon, href: url, target: '_blank', rel: 'nofollow noindex noreferrer', }); this.nodes.wrapper.appendChild(downloadIcon); } /** * If file uploading failed, remove loader and show notification * @param {string} errorMessage - error message */ uploadingFailed(errorMessage) { this.api.notifier.show({ message: errorMessage, style: 'error', }); this.removeLoader(); } /** * Return Attaches Tool's data * @return {AttachesToolData} */ get data() { return this._data; } /** * Stores all Tool's data * @param {AttachesToolData} data */ set data({ file, title }) { this._data = Object.assign( {}, { file: { url: (file && file.url) || this._data.file.url, name: (file && file.name) || this._data.file.name, extension: (file && file.extension) || this._data.file.extension, size: (file && file.size) || this._data.file.size, }, title: title || this._data.title, }, ); } /** * Moves caret to the end of contentEditable element * @param {HTMLElement} element - contentEditable element */ moveCaretToEnd(element) { const range = document.createRange(); const selection = window.getSelection(); range.selectNodeContents(element); range.collapse(false); selection.removeAllRanges(); selection.addRange(range); } /** * Helper method for elements creation * @param tagName * @param classNames * @param attributes * @return {HTMLElement} */ make(tagName, classNames = null, attributes = {}) { const el = document.createElement(tagName); if (Array.isArray(classNames)) { el.classList.add(...classNames); } else if (classNames) { el.classList.add(classNames); } for (const attrName in attributes) { el[attrName] = attributes[attrName]; } return el; } }
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "../src/assets/js/pages/custom/login/login-general.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "../src/assets/js/pages/custom/login/login-general.js": /*!************************************************************!*\ !*** ../src/assets/js/pages/custom/login/login-general.js ***! \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\r\n\r\n// Class Definition\r\nvar KTLoginGeneral = function() {\r\n\r\n var login = $('#kt_login');\r\n\r\n var showErrorMsg = function(form, type, msg) {\r\n var alert = $('<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">\\\r\n\t\t\t<div class=\"alert-text\">'+msg+'</div>\\\r\n\t\t\t<div class=\"alert-close\">\\\r\n <i class=\"flaticon2-cross kt-icon-sm\" data-dismiss=\"alert\"></i>\\\r\n </div>\\\r\n\t\t</div>');\r\n\r\n form.find('.alert').remove();\r\n alert.prependTo(form);\r\n //alert.animateClass('fadeIn animated');\r\n KTUtil.animateClass(alert[0], 'fadeIn animated');\r\n alert.find('span').html(msg);\r\n }\r\n\r\n // Private Functions\r\n var displaySignUpForm = function() {\r\n login.removeClass('kt-login--forgot');\r\n login.removeClass('kt-login--signin');\r\n\r\n login.addClass('kt-login--signup');\r\n KTUtil.animateClass(login.find('.kt-login__signup')[0], 'flipInX animated');\r\n }\r\n\r\n var displaySignInForm = function() {\r\n login.removeClass('kt-login--forgot');\r\n login.removeClass('kt-login--signup');\r\n\r\n login.addClass('kt-login--signin');\r\n KTUtil.animateClass(login.find('.kt-login__signin')[0], 'flipInX animated');\r\n //login.find('.kt-login__signin').animateClass('flipInX animated');\r\n }\r\n\r\n var displayForgotForm = function() {\r\n login.removeClass('kt-login--signin');\r\n login.removeClass('kt-login--signup');\r\n\r\n login.addClass('kt-login--forgot');\r\n //login.find('.kt-login--forgot').animateClass('flipInX animated');\r\n KTUtil.animateClass(login.find('.kt-login__forgot')[0], 'flipInX animated');\r\n\r\n }\r\n\r\n var handleFormSwitch = function() {\r\n $('#kt_login_forgot').click(function(e) {\r\n e.preventDefault();\r\n displayForgotForm();\r\n });\r\n\r\n $('#kt_login_forgot_cancel').click(function(e) {\r\n e.preventDefault();\r\n displaySignInForm();\r\n });\r\n\r\n $('#kt_login_signup').click(function(e) {\r\n e.preventDefault();\r\n displaySignUpForm();\r\n });\r\n\r\n $('#kt_login_signup_cancel').click(function(e) {\r\n e.preventDefault();\r\n displaySignInForm();\r\n });\r\n }\r\n\r\n var handleSignInFormSubmit = function() {\r\n $('#kt_login_signin_submit').click(function(e) {\r\n e.preventDefault();\r\n var btn = $(this);\r\n var form = $(this).closest('form');\r\n\r\n form.validate({\r\n rules: {\r\n email: {\r\n required: true,\r\n email: true\r\n },\r\n password: {\r\n required: true\r\n }\r\n }\r\n });\r\n\r\n if (!form.valid()) {\r\n return;\r\n }\r\n\r\n btn.addClass('kt-spinner kt-spinner--right kt-spinner--sm kt-spinner--light').attr('disabled', true);\r\n\r\n var login_url=$('#login_url').val(); var login_redirect_url=$('#login_redirect_url').val(); var email=$('#email').val(); var password=$('#password').val(); form.ajaxSubmit({\r\n url: login_url,\r\n method :'POST',\r\n data : { username : email, password : password }, \r\n success: function(response) {\r\n if (!$.trim(response)){ \t// similate 2s delay\r\n \tsetTimeout(function() {\r\n\t btn.removeClass('kt-spinner kt-spinner--right kt-spinner--sm kt-spinner--light').attr('disabled', false);\r\n\t showErrorMsg(form, 'danger', 'Incorrect username or password. Please try again.');\r\n }, 1000);\r\n }else{ \t// similate 1s delay\r\n \tsetTimeout(function() {\r\n\t btn.removeClass('kt-spinner kt-spinner--right kt-spinner--sm kt-spinner--light').attr('disabled', false);\r\n\t showErrorMsg(form, 'success', 'Thank you!.');\r\n }, 1000);\r\n window.setTimeout(function() { window.location.href = login_redirect_url;}, 2000); } }\r\n });\r\n });\r\n }\r\n\r\n var handleSignUpFormSubmit = function() {\r\n $('#kt_login_signup_submit').click(function(e) {\r\n e.preventDefault();\r\n\r\n var btn = $(this);\r\n var form = $(this).closest('form');\r\n\r\n form.validate({\r\n rules: {\r\n fullname: {\r\n required: true\r\n },\r\n email: {\r\n required: true,\r\n email: true\r\n },\r\n password: {\r\n required: true\r\n },\r\n rpassword: {\r\n required: true\r\n },\r\n agree: {\r\n required: true\r\n }\r\n }\r\n });\r\n\r\n if (!form.valid()) {\r\n return;\r\n }\r\n\r\n btn.addClass('kt-spinner kt-spinner--right kt-spinner--sm kt-spinner--light').attr('disabled', true);\r\n\r\n form.ajaxSubmit({\r\n url: '',\r\n success: function(response, status, xhr, $form) {\r\n \t// similate 2s delay\r\n \tsetTimeout(function() {\r\n\t btn.removeClass('kt-spinner kt-spinner--right kt-spinner--sm kt-spinner--light').attr('disabled', false);\r\n\t form.clearForm();\r\n\t form.validate().resetForm();\r\n\r\n\t // display signup form\r\n\t displaySignInForm();\r\n\t var signInForm = login.find('.kt-login__signin form');\r\n\t signInForm.clearForm();\r\n\t signInForm.validate().resetForm();\r\n\r\n\t showErrorMsg(signInForm, 'success', 'Thank you. To complete your registration please check your email.');\r\n\t }, 2000);\r\n }\r\n });\r\n });\r\n }\r\n\r\n var handleForgotFormSubmit = function() {\r\n $('#kt_login_forgot_submit').click(function(e) {\r\n e.preventDefault();\r\n\r\n var btn = $(this);\r\n var form = $(this).closest('form');\r\n\r\n form.validate({\r\n rules: {\r\n email: {\r\n required: true,\r\n email: true\r\n }\r\n }\r\n });\r\n\r\n if (!form.valid()) {\r\n return;\r\n }\r\n\r\n btn.addClass('kt-spinner kt-spinner--right kt-spinner--sm kt-spinner--light').attr('disabled', true);\r\n\r\n form.ajaxSubmit({\r\n url: '',\r\n success: function(response, status, xhr, $form) {\r\n \t// similate 2s delay\r\n \tsetTimeout(function() {\r\n \t\tbtn.removeClass('kt-spinner kt-spinner--right kt-spinner--sm kt-spinner--light').attr('disabled', false); // remove\r\n\t form.clearForm(); // clear form\r\n\t form.validate().resetForm(); // reset validation states\r\n\r\n\t // display signup form\r\n\t displaySignInForm();\r\n\t var signInForm = login.find('.kt-login__signin form');\r\n\t signInForm.clearForm();\r\n\t signInForm.validate().resetForm();\r\n\r\n\t showErrorMsg(signInForm, 'success', 'Cool! Password recovery instruction has been sent to your email.');\r\n \t}, 2000);\r\n }\r\n });\r\n });\r\n }\r\n\r\n // Public Functions\r\n return {\r\n // public functions\r\n init: function() {\r\n handleFormSwitch();\r\n handleSignInFormSubmit();\r\n handleSignUpFormSubmit();\r\n handleForgotFormSubmit();\r\n }\r\n };\r\n}();\r\n\r\n// Class Initialization\r\njQuery(document).ready(function() {\r\n KTLoginGeneral.init();\r\n});\r\n\n\n//# sourceURL=webpack:///../src/assets/js/pages/custom/login/login-general.js?"); /***/ }) /******/ });
window.addEventListener('load', () => { document.querySelectorAll(".preloader").forEach(e => e.parentNode?.removeChild(e) ) document.querySelectorAll(".reveal").forEach(e=>{ e.style.opacity = "1" } ) })
HabitDetail { _id: String; habitName: String; description: String; icon: String; color: String; timeInDate: all | morning | afternoon | night; duplicateType: daily | weekly | monthly weekdays: [mon, tue, wed, thus, fri, sat, sun]; timePerWeek: Number; dateExpired: Date; isEndDate: Boolean; endDate: Date; hasTarget: Boolean; amount: Number; unit: String; isActive: Boolean; UserId: String; }
const mongoose = require('mongoose'); const AutoIncrement = require('mongoose-sequence')(mongoose); const mongoose_delete = require('mongoose-delete'); const STATE_TAKEN = 'TAKEN'; const STATE_PREPARATION = 'PREPARATION'; const STATE_DISPATCHED = 'DISPATCHED'; const STATE_DELIVERED = 'DELIVERED'; const STATE_CANCELLED = 'CANCELLED'; Schema = mongoose.Schema; const orderSchema = new Schema({ store_id: {type: Number}, user_id: { type: Number }, price : { type: Number }, discount : { type: Number }, description: { type: String}, items: [ { id : { type: String }, garnish: { type: String }, quantity: { type: Number }, comments: { type: String } } ], register_timestamp : { type: Date, default: Date.now }, states: [ { state: { type: String, enum: [STATE_TAKEN, STATE_PREPARATION, STATE_DISPATCHED, STATE_DELIVERED, STATE_CANCELLED], default: STATE_TAKEN }, timestamp: {type: Date, default: Date.now} }], state:{ state: { type: String, enum: [STATE_TAKEN, STATE_PREPARATION, STATE_DISPATCHED, STATE_DELIVERED, STATE_CANCELLED] }, timestamp: {type: Date, default: Date.now} }, address: { name : {type : String}, lat : {type : Number}, lon : {type : Number} } }); orderSchema.plugin(AutoIncrement, {inc_field: 'order_id'}); orderSchema.plugin(mongoose_delete,{ deletedAt : true, overrideMethods: true }); const Order = mongoose.model('Order',orderSchema); exports.Order = Order; exports.states = [STATE_TAKEN, STATE_PREPARATION, STATE_DISPATCHED, STATE_DELIVERED, STATE_CANCELLED]; exports.saveOrder = function(data) { if (!data.state) { data.state = { state: STATE_TAKEN, timestamp: Date.now() }; } if (!data.states){ data.states = [data.state]; } const order = new Order(data); return order.save(); }; exports.updateOrder = function(order_id,data) { return Order.findOneAndUpdate({order_id : order_id},data,{new: true}); }; exports.updateOrderState = function(order_id,state){ const _state = { state: state || STATE_TAKEN, timestamp: Date.now() }; return Order.findOneAndUpdate({order_id : order_id},{ $push: { states: _state }, state: _state },{new: true}); }; exports.getOrderById = function(order_id) { return Order.findOne({order_id: order_id}); }; exports.getOrderByStore = function(store_id) { return Order.find({store_id: store_id}) .sort({register_timestamp: 'desc'}); }; exports.getOrderByUser = function(user_id,data) { const dataFind = {user_id: user_id}; if (data.state){ dataFind['state.state'] = {$in : data.state}; } return Order.find(dataFind) .sort({register_timestamp: 'desc'}); }; exports.getOrders = function(data) { return Order.find(data) .sort({register_timestamp: 'desc'}) }; exports.delete = function(order_id) { return new Promise(function(resolve, reject) { Order.delete({order_id:order_id},function (err,result) { if (!err){ resolve(true); console.log("Borrado logico de pedido con id:" + dish_id); } else { console.log(err); reject("Error al eliminar el pedido."); } }) }); }; exports.forceDelete = function (order_id) { return Order.findOneAndRemove({ order_id: order_id}); };
import React from 'react'; import {connect} from 'react-redux'; import Backlog from '../components/Backlog'; import UserMenu from '../components/UserMenu'; import ActionLog from '../components/ActionLog'; import Users from '../components/Users'; import Estimation from '../components/Estimation'; /** * The board is the main working area as soon as a room was joined. * It contains * - the backlog * - a list of users, * - estimations * - the current story * - cards */ const Board = ({roomId, isAStorySelected}) => ( <div className="board" id={roomId}> <Users /> <UserMenu /> <ActionLog /> <Backlog /> {isAStorySelected && <Estimation />} </div> ); Board.propTypes = { roomId: React.PropTypes.string, isAStorySelected: React.PropTypes.bool }; export default connect( state => ({ roomId: state.get('roomId'), isAStorySelected: !!state.getIn(['stories', state.get('selectedStory')]) }) )(Board);
/** * See detailed Core Image filter list at: https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIPhotoEffectInstant */ const validCIFilterNames = [ /** Applies a preconfigured set of effects that imitate vintage photography film with distorted colors. */ 'CIPhotoEffectInstant', /** Applies a preconfigured set of effects that imitate vintage photography film with emphasized warm colors. */ 'CIPhotoEffectTransfer', /** Applies a preconfigured set of effects that imitate black-and-white photography film without significantly altering contrast. */ 'CIPhotoEffectTonal', /** Applies a preconfigured set of effects that imitate vintage photography film with emphasized cool colors. */ 'CIPhotoEffectProcess', /** Applies a preconfigured set of effects that imitate black-and-white photography film with exaggerated contrast. */ 'CIPhotoEffectNoir', /** Applies a preconfigured set of effects that imitate black-and-white photography film with low contrast. */ 'CIPhotoEffectMono', /** Applies a preconfigured set of effects that imitate vintage photography film with exaggerated color. */ 'CIPhotoEffectChrome', /** Applies a preconfigured set of effects that imitate vintage photography film with diminished color. */ 'CIPhotoEffectFade', /** Maps the colors of an image to various shades of brown. */ 'CISepiaTone', /** Inverts the colors in an image. */ 'CIColorInvert', /** Simulates a comic book drawing by outlining edges and applying a color halftone effect. */ 'CIComicEffect', ]; export { validCIFilterNames };
const Discord = require('discord.js'); exports.run = (client, message, args) => { let mesaj = args.slice(0).join(' '); if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("Bunu yapabilmek için yeterli yetkin yok") if (mesaj.length < 1) return message.reply('Yazmam için herhangi bir şey yazmalısın.'); message.delete(); message.channel.send(mesaj); }; exports.conf = { enabled: true, guildOnly: false, aliases: [], permLevel: 0 }; exports.help = { name: 'yaz', description: '', usage: 'yaz [yazdırmak istediğiniz şey]' }; //Lord Creative
const ListViewLinksModel = require("../../links-view-model"); const link = require("../../link"); const navigationLinks = [ new link("BasicWebView", "ns-ui-widgets-category/web-view/basics/basics-page"), new link("WebView source", "ns-ui-widgets-category/web-view/source-load/source-load-page"), new link("Gestures", "ns-ui-widgets-category/web-view/gestures/gestures-page") ]; function onNavigatingTo(args) { const page = args.object; page.bindingContext = new ListViewLinksModel({ links: navigationLinks, actionBarTitle: args.context.title }); } exports.onNavigatingTo = onNavigatingTo;
import React from "react" import { Link, graphql } from "gatsby" import Layout from "../../components/layout" import SEO from "../../components/seo" import styled from "styled-components" const SponsorGrid = styled.div` display: flex; width: 100%; justify-content: space-around; flex-wrap: wrap; ` const Level = styled.div` width: 30%; @media (max-width: 700px) { width: 100%; } padding: 10px 10px 50px 10px; border-radius: 5px; border: 1px solid #eee; position: relative; h1 { font-size: 20px; margin-top: 0; text-align: center; } p { } a { position: absolute; bottom: 0; left: 0; right: 0; margin: 10px; padding: 10px; text-align: center; background: #000; color: #fff; font-weight: 800; border-radius: 5px; &:hover { background: #eee; color: #000; } } ` class Sponsor extends React.Component { render() { const { data } = this.props const title = data.site.siteMetadata.title return ( <Layout location={this.props.location} title={title}> <SEO title="Sponsor a Newsletter" /> <h1>Sponsor {title}</h1> <p> {title} is read by hundreds of designers and foreign policy professionals around the world. Support us and get your message out by sponsoring a weekly feature, booking a classified ad, or featuring a job posting. </p> <SponsorGrid> <Level> <h1>Sponsor an Issue</h1> <p> Issue sponsors are posted at the top, right below are introduction. They get a highlighted treatment, more text per newsletter, and an image. You make the magic happen! </p> <Link to={`/sponsor/issue`}>Sponsor an Issue</Link> </Level> <Level> <h1>Share a Job Post</h1> <p> We share relevant job posts with our community because we want great people filling them. Featured job posts are highlighted and contain more information. </p> <Link to={`/sponsor/job`}>Post a Job</Link> </Level> <Level> <h1>Post an Ad</h1> <p> Ads are small posts at the bottom of the newsletter. We feature a maximum of 4 of these small ads per newsletter. </p> <Link to={`/sponsor/ad`}>Post Ad</Link> </Level> </SponsorGrid> <h2>Terms and Conditions</h2> <p> Basically, we reserve the right to reject ads on content grounds. You'll be refunded minus any processing fees if that's the case. Unless the content is clearly hateful or discriminatory, we'll reach out first to discuss. </p> </Layout> ) } } export default Sponsor export const pageQuery = graphql` query { site { siteMetadata { title subtitle } } } `
import React from "react" import Modal from "react-modal" import Helmet from "react-helmet" import MdClose from "react-icons/lib/md/close" import { navigate, PageRenderer } from "gatsby" import presets, { colors } from "../utils/presets" import Banner from "../components/banner" import Navigation from "../components/navigation" import MobileNavigation from "../components/navigation-mobile" import PageWithSidebar from "../components/page-with-sidebar" import mousetrap from "mousetrap" // Import Futura PT typeface import "../fonts/Webfonts/futurapt_book_macroman/stylesheet.css" import "../fonts/Webfonts/futurapt_bookitalic_macroman/stylesheet.css" import "../fonts/Webfonts/futurapt_demi_macroman/stylesheet.css" import "../fonts/Webfonts/futurapt_demiitalic_macroman/stylesheet.css" // Other fonts import "typeface-spectral" import "typeface-space-mono" let windowWidth class DefaultLayout extends React.Component { constructor() { super() this.handleCloseModal = this.handleCloseModal.bind(this) } handleCloseModal() { navigate(this.props.modalBackgroundPath) } componentDidMount() { Modal.setAppElement(`#___gatsby`) if (this.props.isModal && window.innerWidth > 750) { mousetrap.bind(`left`, this.props.modalPrevious) mousetrap.bind(`right`, this.props.modalNext) mousetrap.bind(`spacebar`, this.props.modalNext) document.querySelector(`html`).style.overflowY = `hidden` } } componentWillUnmount() { if (this.props.isModal && window.innerWidth > 750) { mousetrap.unbind(`left`) mousetrap.unbind(`right`) mousetrap.unbind(`spacebar`) document.querySelector(`html`).style.overflowY = `auto` } } render() { const isHomepage = this.props.location.pathname === `/` // SEE: template-docs-markdown for why this.props.isSidebarDisabled is here const isSidebarDisabled = this.props.isSidebarDisabled || !this.props.itemList let isModal = false if (!windowWidth && typeof window !== `undefined`) { windowWidth = window.innerWidth } if (this.props.isModal && windowWidth > 750) { isModal = true } if (isModal && window.innerWidth > 750) { return ( <React.Fragment> <PageRenderer location={{ pathname: this.props.modalBackgroundPath }} /> <Modal isOpen={true} style={{ content: { top: `inherit`, left: `inherit`, right: `inherit`, bottom: `inherit`, margin: `0 auto`, width: `750px`, background: `none`, border: `none`, padding: `40px 0`, overflow: `visible`, }, overlay: { position: `absolute`, top: 0, left: 0, right: 0, bottom: `unset`, minHeight: `100%`, minWidth: `100%`, zIndex: 10, overflowY: `auto`, backgroundColor: `rgba(255, 255, 255, 0.95)`, }, }} onRequestClose={() => navigate(this.props.modalBackgroundPath)} contentLabel="Site Details Modal" > <div css={{ backgroundColor: `#ffffff`, borderRadius: presets.radius, boxShadow: `0 0 90px -24px ${colors.gatsby}`, position: `relative`, }} > <button onClick={this.handleCloseModal} css={{ background: colors.ui.bright, border: 0, borderBottomLeftRadius: presets.radius, borderTopRightRadius: presets.radius, color: colors.gatsby, cursor: `pointer`, position: `absolute`, left: `auto`, right: 0, height: 40, width: 40, "&:hover": { background: colors.gatsby, color: `#fff`, }, }} > <MdClose /> </button> {this.props.children} {this.props.modalPreviousLink} {this.props.modalNextLink} </div> </Modal> </React.Fragment> ) } return ( <div className={isHomepage ? `is-homepage` : ``}> <Helmet defaultTitle={`GatsbyJS`} titleTemplate={`%s | GatsbyJS`}> <meta name="twitter:site" content="@gatsbyjs" /> <meta name="og:type" content="website" /> <meta name="og:site_name" content="GatsbyJS" /> <link rel="canonical" href={`https://gatsbyjs.org${this.props.location.pathname}`} /> <html lang="en" /> </Helmet> <Banner background={isHomepage ? `#402060` : false}> These are the docs for v2. {` `} <a href="https://v1.gatsbyjs.org/" css={{ color: `#fff`, }} > View the v1 docs <span css={{ display: `none`, [presets.Mobile]: { display: `inline`, }, }} > {` `} instead </span> </a> . </Banner> <Navigation pathname={this.props.location.pathname} /> <div className={`main-body`} css={{ paddingTop: presets.bannerHeight, [presets.Tablet]: { margin: `0 auto`, paddingTop: isHomepage ? presets.bannerHeight : `calc(${presets.bannerHeight} + ${presets.headerHeight})`, }, }} > <PageWithSidebar disable={isSidebarDisabled} itemList={this.props.itemList} location={this.props.location} enableScrollSync={this.props.enableScrollSync} renderContent={() => this.props.children} /> </div> <MobileNavigation /> </div> ) } } export default DefaultLayout
import { combineReducers } from 'redux'; import filter from 'reducers/new_ruleset/filter/index'; import rules from 'reducers/new_ruleset/rules'; const newRulesetReducer = combineReducers({ rules, filter }); export default newRulesetReducer;
function addWidgetsfrmLocalStore() { var hbxLocalStore = new kony.ui.Box({ "id": "hbxLocalStore", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var vbox192926642422365 = new kony.ui.Box({ "id": "vbox192926642422365", "isVisible": true, "orientation": constants.BOX_LAYOUT_VERTICAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var hbox1930040990143056 = new kony.ui.Box({ "id": "hbox1930040990143056", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL, "skin": "hBoxRoundBorder" }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var vbox1930040990143057 = new kony.ui.Box({ "id": "vbox1930040990143057", "isVisible": true, "orientation": constants.BOX_LAYOUT_VERTICAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var frmLocalLblSetItem = new kony.ui.Label({ "id": "frmLocalLblSetItem", "isVisible": true, "skin": "lblNormalSimilar", "text": "Please enter Key,Values" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var hbox1930040990143059 = new kony.ui.Box({ "id": "hbox1930040990143059", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var frmLocalTxtSet1 = new kony.ui.TextBox2({ "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE, "focusSkin": "textBoxFocus", "id": "frmLocalTxtSet1", "isVisible": true, "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT, "placeholder": "Key", "secureTextEntry": false, "skin": "textBoxNormal", "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY }, { "containerHeightMode": constants.TEXTBOX_FONT_METRICS_DRIVEN_HEIGHT, "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE, "containerWeight": 47, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "autoCorrect": false, "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE, "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_NO_PASTE_BOARD, "showClearButton": true, "showCloseButton": true, "showProgressIndicator": true, "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT }); var frmLocalTxtSet2 = new kony.ui.TextBox2({ "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE, "focusSkin": "textBoxFocus", "id": "frmLocalTxtSet2", "isVisible": true, "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT, "placeholder": "Value", "secureTextEntry": false, "skin": "textBoxNormal", "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY }, { "containerHeightMode": constants.TEXTBOX_FONT_METRICS_DRIVEN_HEIGHT, "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE, "containerWeight": 53, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "autoCorrect": false, "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE, "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_NO_PASTE_BOARD, "showClearButton": true, "showCloseButton": true, "showProgressIndicator": true, "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT }); hbox1930040990143059.add(frmLocalTxtSet1, frmLocalTxtSet2); var hbox1930040990143060 = new kony.ui.Box({ "id": "hbox1930040990143060", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var button1930040990143063 = new kony.ui.Button({ "focusSkin": "btnFocus", "id": "button1930040990143063", "isVisible": true, "onClick": p2kwiet12889314954201_button1930040990143063_onClick_seq0, "skin": "btnNormal", "text": "SetItem" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_CENTER, "displayText": true, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "glowEffect": false, "showProgressIndicator": true }); hbox1930040990143060.add(button1930040990143063); vbox1930040990143057.add(frmLocalLblSetItem, hbox1930040990143059, hbox1930040990143060); hbox1930040990143056.add(vbox1930040990143057); var hbox1930040990143149 = new kony.ui.Box({ "id": "hbox1930040990143149", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL, "skin": "hBoxRoundBorder" }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var vbox1930040990143151 = new kony.ui.Box({ "id": "vbox1930040990143151", "isVisible": true, "orientation": constants.BOX_LAYOUT_VERTICAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var label1930040990143153 = new kony.ui.Label({ "id": "label1930040990143153", "isVisible": true, "skin": "lblNormalSimilar", "text": "Please enter the key to read the value" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var hbox1930040990143155 = new kony.ui.Box({ "id": "hbox1930040990143155", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var frmLocalTxtGet1 = new kony.ui.TextBox2({ "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE, "focusSkin": "textBoxFocus", "id": "frmLocalTxtGet1", "isVisible": true, "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT, "placeholder": "Key", "secureTextEntry": false, "skin": "textBoxNormal", "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY }, { "containerHeightMode": constants.TEXTBOX_FONT_METRICS_DRIVEN_HEIGHT, "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE, "containerWeight": 47, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "autoCorrect": false, "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE, "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_NO_PASTE_BOARD, "showClearButton": true, "showCloseButton": true, "showProgressIndicator": true, "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT }); var frmLocalLblGet1 = new kony.ui.Label({ "id": "frmLocalLblGet1", "isVisible": true, "skin": "lblNormalSimilar" }, { "containerWeight": 53, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); hbox1930040990143155.add(frmLocalTxtGet1, frmLocalLblGet1); var hbox1930040990143159 = new kony.ui.Box({ "id": "hbox1930040990143159", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var button1930040990143161 = new kony.ui.Button({ "focusSkin": "btnFocus", "id": "button1930040990143161", "isVisible": true, "onClick": p2kwiet12889314954201_button1930040990143161_onClick_seq0, "skin": "btnNormal", "text": "GetItem" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_CENTER, "displayText": true, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "glowEffect": false, "showProgressIndicator": true }); hbox1930040990143159.add(button1930040990143161); vbox1930040990143151.add(label1930040990143153, hbox1930040990143155, hbox1930040990143159); hbox1930040990143149.add(vbox1930040990143151); var hbox1930040990143407 = new kony.ui.Box({ "id": "hbox1930040990143407", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL, "skin": "hBoxRoundBorder" }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var vbox1930040990143409 = new kony.ui.Box({ "id": "vbox1930040990143409", "isVisible": true, "orientation": constants.BOX_LAYOUT_VERTICAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var label1930040990143411 = new kony.ui.Label({ "id": "label1930040990143411", "isVisible": true, "skin": "lblNormalSimilar", "text": "Please enter the index to read the key" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var hbox1930040990143413 = new kony.ui.Box({ "id": "hbox1930040990143413", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var frmLocalTxtGetKey1 = new kony.ui.TextBox2({ "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE, "focusSkin": "textBoxFocus", "id": "frmLocalTxtGetKey1", "isVisible": true, "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT, "placeholder": "Index", "secureTextEntry": false, "skin": "textBoxNormal", "textInputMode": constants.TEXTBOX_INPUT_MODE_NUMERIC }, { "containerHeightMode": constants.TEXTBOX_FONT_METRICS_DRIVEN_HEIGHT, "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE, "containerWeight": 47, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "autoCorrect": false, "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE, "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_NO_PASTE_BOARD, "showClearButton": true, "showCloseButton": true, "showProgressIndicator": true, "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT }); var frmLocalLblGetKey1 = new kony.ui.Label({ "id": "frmLocalLblGetKey1", "isVisible": true, "skin": "lblNormalSimilar" }, { "containerWeight": 53, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); hbox1930040990143413.add(frmLocalTxtGetKey1, frmLocalLblGetKey1); var hbox1930040990143418 = new kony.ui.Box({ "id": "hbox1930040990143418", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var button1930040990143420 = new kony.ui.Button({ "focusSkin": "btnFocus", "id": "button1930040990143420", "isVisible": true, "onClick": p2kwiet12889314954201_button1930040990143420_onClick_seq0, "skin": "btnNormal", "text": "Read key" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_CENTER, "displayText": true, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "glowEffect": false, "showProgressIndicator": true }); hbox1930040990143418.add(button1930040990143420); vbox1930040990143409.add(label1930040990143411, hbox1930040990143413, hbox1930040990143418); hbox1930040990143407.add(vbox1930040990143409); var hbox1930040990143557 = new kony.ui.Box({ "id": "hbox1930040990143557", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL, "skin": "hBoxRoundBorder" }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var vbox1930040990143559 = new kony.ui.Box({ "id": "vbox1930040990143559", "isVisible": true, "orientation": constants.BOX_LAYOUT_VERTICAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var label1930040990143561 = new kony.ui.Label({ "id": "label1930040990143561", "isVisible": true, "skin": "lblNormalSimilar", "text": "Please enter the key to delete the item" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var hbox1930040990143563 = new kony.ui.Box({ "id": "hbox1930040990143563", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var frmLocalTxtIndex = new kony.ui.TextBox2({ "autoCapitalize": constants.TEXTBOX_AUTO_CAPITALIZE_NONE, "focusSkin": "textBoxFocus", "id": "frmLocalTxtIndex", "isVisible": true, "keyBoardStyle": constants.TEXTBOX_KEY_BOARD_STYLE_DEFAULT, "placeholder": "Key", "secureTextEntry": false, "skin": "textBoxNormal", "textInputMode": constants.TEXTBOX_INPUT_MODE_ANY }, { "containerHeightMode": constants.TEXTBOX_FONT_METRICS_DRIVEN_HEIGHT, "containerHeightReference": constants.CONTAINER_HEIGHT_BY_FORM_REFERENCE, "containerWeight": 47, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "autoCorrect": false, "keyboardActionLabel": constants.TEXTBOX_KEYBOARD_LABEL_DONE, "pasteboardType": constants.TEXTBOX_PASTE_BOARD_TYPE_NO_PASTE_BOARD, "showClearButton": true, "showCloseButton": true, "showProgressIndicator": true, "viewType": constants.TEXTBOX_VIEW_TYPE_DEFAULT }); var frmLocalLblIndex = new kony.ui.Label({ "id": "frmLocalLblIndex", "isVisible": true, "skin": "lblNormalSimilar" }, { "containerWeight": 53, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); hbox1930040990143563.add(frmLocalTxtIndex, frmLocalLblIndex); var hbox1930040990143568 = new kony.ui.Box({ "id": "hbox1930040990143568", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var button1930040990143570 = new kony.ui.Button({ "focusSkin": "btnFocus", "id": "button1930040990143570", "isVisible": true, "onClick": p2kwiet12889314954201_button1930040990143570_onClick_seq0, "skin": "btnNormal", "text": "RemoveItem" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_CENTER, "displayText": true, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "glowEffect": false, "showProgressIndicator": true }); hbox1930040990143568.add(button1930040990143570); vbox1930040990143559.add(label1930040990143561, hbox1930040990143563, hbox1930040990143568); hbox1930040990143557.add(vbox1930040990143559); var hbox1930040990144442 = new kony.ui.Box({ "id": "hbox1930040990144442", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL, "skin": "hBoxRoundBorder" }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [2, 2, 2, 2], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var vbox1930040990144444 = new kony.ui.Box({ "id": "vbox1930040990144444", "isVisible": true, "orientation": constants.BOX_LAYOUT_VERTICAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var label1930040990144446 = new kony.ui.Label({ "id": "label1930040990144446", "isVisible": true, "skin": "lblNormalSimilar", "text": "Delete all items in the local store" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var lblLocalClear = new kony.ui.Label({ "id": "lblLocalClear", "isVisible": true, "skin": "lblNormalSimilar" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_MIDDLE_LEFT, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "textCopyable": false, "wrapping": constants.WIDGET_TEXT_WORD_WRAP }); var hbox1930040990144453 = new kony.ui.Box({ "id": "hbox1930040990144453", "isVisible": true, "orientation": constants.BOX_LAYOUT_HORIZONTAL, "position": constants.BOX_POSITION_AS_NORMAL }, { "containerWeight": 100, "layoutAlignment": constants.BOX_LAYOUT_ALIGN_FROM_LEFT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [1, 1, 1, 1], "paddingInPixel": false, "percent": true, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_TOP_LEFT }, {}); var button1930040990144455 = new kony.ui.Button({ "focusSkin": "btnFocus", "id": "button1930040990144455", "isVisible": true, "onClick": p2kwiet12889314954201_button1930040990144455_onClick_seq0, "skin": "btnNormal", "text": "Clear" }, { "containerWeight": 100, "contentAlignment": constants.CONTENT_ALIGN_CENTER, "displayText": true, "hExpand": true, "margin": [0, 0, 0, 0], "marginInPixel": false, "padding": [0, 1, 0, 1], "paddingInPixel": false, "vExpand": false, "widgetAlignment": constants.WIDGET_ALIGN_CENTER }, { "glowEffect": false, "showProgressIndicator": true }); hbox1930040990144453.add(button1930040990144455); vbox1930040990144444.add(label1930040990144446, lblLocalClear, hbox1930040990144453); hbox1930040990144442.add(vbox1930040990144444); vbox192926642422365.add(hbox1930040990143056, hbox1930040990143149, hbox1930040990143407, hbox1930040990143557, hbox1930040990144442); hbxLocalStore.add(vbox192926642422365); frmLocalStore.add(hbxLocalStore); }; function frmLocalStoreGlobals() { frmLocalStore = new kony.ui.Form2({ "addWidgets": addWidgetsfrmLocalStore, "bounces": true, "enabledForIdleTimeout": false, "id": "frmLocalStore", "needAppMenu": true, "skin": "frm" }, { "displayOrientation": constants.FORM_DISPLAY_ORIENTATION_PORTRAIT, "layoutType": constants.CONTAINER_LAYOUT_BOX, "padding": [0, 0, 0, 0], "paddingInPixel": false }, { "bounces": true, "configureExtendBottom": false, "configureExtendTop": false, "configureStatusBarStyle": false, "footerOverlap": false, "formTransparencyDuringPostShow": 100, "headerOverlap": false, "inputAccessoryViewType": constants.FORM_INPUTACCESSORYVIEW_DEFAULT, "inTransitionConfig": { "transitionDirection": "none", "transitionEffect": "none" }, "needsIndicatorDuringPostShow": true, "outTransitionConfig": { "transitionDirection": "none", "transitionEffect": "none" }, "retainScrollPosition": false, "statusBarStyle": constants.STATUS_BAR_STYLE_DEFAULT, "titleBar": true }); frmLocalStore.info = { "kuid": "p2kwiet12889314954201" }; };
// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var common = require('../common'); var https = require('https'), fs = require('fs'), assert = require('assert'); if (['linux', 'win32'].indexOf(process.platform) == -1) { console.log('Skipping platform-specific test.'); process.exit(); } var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') }; var server = https.createServer(options, function (req, res) { console.log("Connect from: " + req.connection.remoteAddress); assert.equal('127.0.0.2', req.connection.remoteAddress); req.on('end', function() { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('You are from: ' + req.connection.remoteAddress); }); req.resume(); }); server.listen(common.PORT, "127.0.0.1", function() { var options = { host: 'localhost', port: common.PORT, path: '/', method: 'GET', localAddress: '127.0.0.2', rejectUnauthorized: false }; var req = https.request(options, function(res) { res.on('end', function() { server.close(); process.exit(); }); res.resume(); }); req.end(); });
import { lowerCase } from '@antv/util'; export { Facet } from './facet'; /** * 所有的 Facet 类 */ var Facets = {}; /** * 根据 type 获取 facet 类 * @param type 分面类型 */ export var getFacet = function (type) { return Facets[lowerCase(type)]; }; /** * 注册一个 Facet 类 * @param type 分面类型 * @param ctor 分面类 */ export var registerFacet = function (type, ctor) { Facets[lowerCase(type)] = ctor; }; //# sourceMappingURL=index.js.map
import React, { Component } from 'react' import PayrollContract from '../build/contracts/Payroll.json' import getWeb3 from './utils/getWeb3' import { Layout, Menu, Spin, Alert } from 'antd'; import Employer from './components/Employer'; import Employee from './components/Employee'; import 'antd/dist/antd.css'; import './App.css'; const { Header, Content, Footer } = Layout; class App extends Component { constructor(props) { super(props) this.state = { storageValue: 0, web3: null, mode: 'employer' } } componentWillMount() { // Get network provider and web3 instance. // See utils/getWeb3 for more info. getWeb3 .then(results => { this.setState({ web3: results.web3 }) // Instantiate contract once web3 provided. this.instantiateContract() }) .catch(() => { console.log('Error finding web3.') }) } instantiateContract() { /* * SMART CONTRACT EXAMPLE * * Normally these functions would be called in the context of a * state management library, but for convenience I've placed them here. */ const contract = require('truffle-contract') const Payroll = contract(PayrollContract) Payroll.setProvider(this.state.web3.currentProvider) // Declaring this for later so we can chain functions on Payroll. var PayrollInstance // Get accounts. this.state.web3.eth.getAccounts((error, accounts) => { this.setState({ account: accounts[0], }); Payroll.deployed().then((instance) => { PayrollInstance = instance this.setState({ payroll: instance }); }) }) } onSelectTab = ({key}) => { this.setState({ mode: key }); } renderContent = () => { const { account, payroll, web3, mode } = this.state; if (!payroll) { return <Spin tip="Loading..." />; } switch(mode) { case 'employer': return <Employer account={account} payroll={payroll} web3={web3} /> case 'employee': return <Employee account={account} payroll={payroll} web3={web3} /> default: return <Alert message="请选一个模式" type="info" showIcon /> } } render() { return ( <Layout> <Header className="header"> <div className="logo">员工薪酬系统</div> <Menu theme="dark" mode="horizontal" defaultSelectedKeys={['employer']} style={{ lineHeight: '64px' }} onSelect={this.onSelectTab} > <Menu.Item key="employer">雇主</Menu.Item> <Menu.Item key="employee">雇员</Menu.Item> </Menu> </Header> <Content style={{ padding: '0 50px' }}> <Layout style={{ padding: '24px 0', background: '#fff', minHeight: '600px' }}> {this.renderContent()} </Layout> </Content> <Footer style={{ textAlign: 'center' }}> Payroll </Footer> </Layout> ); } } export default App
/******************ShearPhoto1.4 免费,开源,兼容目前所有浏览器,纯原生JS和PHP编写 2015年8月7日 明哥先生*******/ ShearPhoto.MINGGE(function() { var publicRelat= document.getElementById("relat"); //"relat"对像 var publicRelatImg=publicRelat.getElementsByTagName("img"); //"relat"下的两张图片对像 var Shear = new ShearPhoto; Shear.config({ /*---------------用户设置部份开始-----------------------------------------------------------------------*/ //██████████重要设置████████████████ //relativeUrl:PLUGIN_URL + "/ShearPhoto", //index.html位置不变的话,你为空就可以,否则会抱出图片无法读取的情况(后面不要有斜杠) relativeUrl:UPYUN_URL, //index.html位置不变的话,你为空就可以,否则会抱出图片无法读取的情况(后面不要有斜杠) //█████████重要设置█████████████████ /* relativeUrl有必要详细讲一下,这是1.4新加入的API 相对路径设置(后面不要有斜杠)! 当index.html位置变动时,要填入此值,否则会抱出图片无法读取的情况,如果index.html位置不变,你为空就可以。专门为TP和YII等框架而加入的 ---------------------------------------------------------------------------------------------------------------------- relativeUrl 相对路径是相对什么而言呢? index.html 所在的目录位置 与 shearphoto/file 之间的相对目录 这样讲好像你们不太明白? ----------------------------------------------------------------------------- 示例1:假如:index.htm 位于 http://xxx.com/abc/index.html shearphoto/file 则位于 http://xxx.com/abc/shearphoto/file 那么relativeUrl就要写成 relativeUrl:"shearphoto" ----------------------------------------------------------------------------- 示例2:假如:index.htm 位于 http://xxx.com/abc/shearphot/def/index.html shearphoto/file 则位于 http://xxx.com/abc/shearphoto/file 那么relativeUrl就要写成 relativeUrl:"../" ----------------------------------------------------------------------------- index.html位置变动后,记得还要手动把 选择图片,相册,拍照的后端处理地址也改一下相对路径哦,要不然报错又问为什么了,因为relativeUrl不作用于你的后端处理地址 relativeUrl的设置比较重要, 表达能力有限,如果不懂,请到官网论坛 QQ群向作者资询 */ //url:PLUGIN_URL + "/ShearPhoto/php/shearphoto.php",//后端处理地址,保证正确哦,这是常识,连这个地址都能写错,你就是菜B url:BASE_URL + "/index.php/Web/Setting/ModifyAvator", scopeWidth:500, //可拖动范围宽 也就是"main"对象的初始大小 scopeHeight:500, //可拖动范围高 也就是"main"对象的初始大小 relat:publicRelat, //请查看 id:"relat"对象 proportional:[0, <!--截框的宽高比例(宽除以高的比例值,这个设置其实就是0.75,不设比例请设为0,注意更改比例后,后端也要进行相应设置,否则系统会给你抱出错误--> 100, //启动后的截框初始宽度 133.33333 //比例设置后,这个高度无效,由宽和比例来决定 ], Min:50, //截框拉伸或拖拽不能少于多少PX Max:500, //一开始启动时,图片的宽和高,有时候图片会很大的,必须要设置一下 Border:1, //截框的边框大小 BorderStyle:"solid", //截框的边框类型,其实是引入CSS的border属性,和入CSS的border属性是一样的 BorderColor:"#04B7FB", //截框的边框色彩 /*---------------用户设置部份结束-----------------------------------------------------------------------*/ scope:document.getElementById("main"),//main范围对象 ImgDom:publicRelatImg[0], //截图图片对象(小) ImgMain:publicRelatImg[1], //截图图片对象(大) black:document.getElementById("black"),//黑色遮层对象 form:document.getElementById("smallbox"),//截框对象 ZoomDist:document.getElementById("ZoomDist"),//放大工具条,可从HTML查看此对象,不作详细解释了 ZoomBar:document.getElementById("ZoomBar"), //放大工具条,可从HTML查看此对象 to:{ BottomRight:document.getElementById("BottomRight"),//拉伸点中右 TopRight:document.getElementById("TopRight"),//拉伸点上右,下面如此类推,一共8点进行拉伸,下面不再作解释 Bottomleft:document.getElementById("Bottomleft"), Topleft:document.getElementById("Topleft"), Topmiddle:document.getElementById("Topmiddle"), leftmiddle:document.getElementById("leftmiddle"), Rightmiddle:document.getElementById("Rightmiddle"), Bottommiddle:document.getElementById("Bottommiddle") }, SelectBox:document.getElementById("SelectBox"), //选择图片方式的对象 Shearbar:document.getElementById("Shearbar"), //截图工具条对象 UpFun:function() { //鼠标健松开时执行函数 Shear.MoveDiv.DivWHFun(); //把截框现时的宽高告诉JS } }); var photoalbum = document.getElementById("photoalbum");//相册对象 /*选择图片上传*/ var up = new ShearPhoto.frameUpImg({ UpType:new Array("jpg", "jpeg", "png", "gif"),//图片类限制,上传的一定是图片,你就不要更改了 FilesSize:2, url:BASE_URL + "/index.php/Web/Setting/uploadAvator",//后端处理地址,保证正确哦,这是常识,连这个地址都能写错,你就是菜B //url:PLUGIN_URL + "/ShearPhoto/php/upload.php",//后端处理地址,保证正确哦,这是常识,连这个地址都能写错,你就是菜B erro:function(msg) { Shear.pointhandle(3e3, 10, msg, 0, "#f82373", "#fff"); }, preced:function() { try{ photoalbum.style.display = "none"; //什么情况下都关了相册 camClose.onclick(); //什么情况下都关了视频 }catch (e){console.log("在加载图片时,发现相册或拍照的对象检测不到,错误代码:"+e);} Shear.pointhandle(0, 10, "正在为你加载图片,请你稍等哦......", 2, "#307ff6", "#fff"); } }); up.run(function(data) {//upload.php成功返回数据后 data = data.replace(/<[^>]+>/g,""); data = ShearPhoto.JsonString.StringToJson(data); if (data === false) { Shear.SendUserMsg("错误:请保证后端环境运行正常", 5e3, 0, "#f4102b", "#fff", true,true); return; } if (data["erro"]) { Shear.SendUserMsg("错误:" + data["erro"], 5e3, 0, "#f4102b", "#fff", true,true); return; } Shear.run(data["success"]); }); /*选择图片上传*/ /*相册*/ try{ var DE = document.documentElement; var PhotoLoading = document.getElementById("PhotoLoading"); var photoalbumLi = photoalbum.getElementsByTagName("li"); var photoalbumLifun = function() { Shear.run(this.getElementsByTagName("img")[0].getAttribute("serveUrl")); photoalbum.style.display = "none"; }; for (var i = 0; i < photoalbumLi.length; i++) photoalbumLi[i].onclick = photoalbumLifun;//为相册的每张照加入一个点击事件 PhotoLoading.onclick = function() { //从相册选取事件 photoalbum.style.display = "block"; }; document.getElementById("close").onclick = function() { //关闭相册事件 photoalbum.style.display = "none"; }; }catch (e){console.log("相册对象检测有误,默认你抱弃这个功能,错误代码:"+e );} /*相册*/ /*截图,左旋,右旋,重新选择*/ Shear.addEvent(document.getElementById("saveShear"), "click", function() { //按下截图事件,提交到后端的shearphoto.php接收 Shear.SendPHP({shearphoto:"我要传参数到服端",mingge:"我要传第二个参数到服务器"});//我们示例截图并且传参数,后端文件shearphoto.php用 示例:$_POST["shearphoto"] 接收参数,不需要传参数请清空Shear.SendPHP里面的参数示例 Shear.SendPHP(); }); Shear.addEvent(document.getElementById("LeftRotate"), "click", function() {//向左旋转事件 Shear.Rotate("left"); }); Shear.addEvent(document.getElementById("RightRotate"), "click", function() { //向右旋转事件 Shear.Rotate("right"); }); Shear.addEvent(document.getElementById("againIMG"), "click", function() { //重新选择事件 Shear.again(); Shear.pointhandle(3e3, 10, "已取消!重新选择", 2, "#fbeb61", "#3a414c"); }); /*截图,左旋,右旋,重新选择*/ /*拍照*/ try{ webcam.init_config={ width : 500, //摄像头像素宽度,也就是说后端生成图片的大小 height : 500, //摄像头像素高度,也就是说后端生成图片的大小 server_width : 450, //网页中flash的显示宽度 server_height : 450, //网页中flash的显示高度 uploadfield : "UpFile", //上传的FORMDATA名称, 不理解你就不要改,否则报错又问为什么了 postargs:{mingge:"shearphoto我爱你",shearphoto:"shearphoto好"}//示例传入POST参数到后端。后端示例$_POST['XXXX'] 接收!如果! 不需要传参数,请把postargs删除,需填参数请保证参数格式 }, webcam.set_api_url("php/upload.php"); //拍照连接后端的URL文件,后端处理地址,保证正确哦,这是常识,连这个地址都能写错,你就是菜B webcam.set_quality(95);//拍照的图片质量 webcam.set_shutter_sound(true);//拍照声音 var CamFlash = document.getElementById("CamFlash"); var timing = document.getElementById("timing"); var CamOk = document.getElementById("CamOk"); var CamBox = document.getElementById("CamBox"); var camerasImage = document.getElementById("camerasImage"); var camClose = document.getElementById("camClose"); var setCam = document.getElementById("setCam"); webcam.noCamcall=function(msg){ Shear.SendUserMsg(msg, 5e3, 0, "#f4102b", "#fff", true,true); camClose.onclick(); } setCam.onclick =function() {webcam.configure();}//点击拍照设置按钮事件 camClose.onclick = function() { //拍照点关闭后 webcam.Homing(timing); CamFlash.innerHTML = ""; CamBox.style.display = "none"; camerasImage.onclick=camerasImageOnclick; }; var camerasImageOnclick = function() { //按下弹出拍照框事件 CamBox.style.display = "block"; CamFlash.innerHTML = webcam.get_html(); webcam.newsnap(timing, CamFlash, CamOk); camerasImage.onclick=null; }; camerasImage.onclick=camerasImageOnclick; webcam.set_hook("onComplete", function(data) {//拍照服务器返回数据事件 //alert(data);你可以调试一个这个返回包 camClose.onclick(); data = ShearPhoto.JsonString.StringToJson(data); if (data === false) { Shear.SendUserMsg("错误:请保证后端环境运行正常", 5e3, 0, "#f4102b", "#fff", true,true); return; } if (data["erro"]) { Shear.SendUserMsg("错误:" + data["erro"], 5e3, 0, "#f4102b", "#fff", true,true); return; } Shear.run(data["success"]); }); }catch (e){console.log("拍照对象检测不到,默认你抱弃这个功能,错误代码:"+e);} });
import React, { Component } from 'react'; import { Form } from 'semantic-ui-react'; function InputTextField({ name, placeholder, required, _handleChange, }) { return ( <div style={{ marginTop: '10px' }}> <Form.Input type="text" name={name} label={name} required={required} autoComplete="off" placeholder={placeholder} onChange={_handleChange} /> </div> ); } export default InputTextField;
module.exports = createServer // requires var Sequelize = require('sequelize') var express = require('express') var bodyParser = require('body-parser') var https = require('https') var fs = require('fs') var wc = require('../') var createApp = require('./create-app') /** * server function * @param {Object} config [description] */ function createServer(argv) { // vars var sequelize var config = wc.getConfig() var defaultCurrency = 'https://w3id.org/cc#bit' var defaultDatabase = 'webcredits' var defaultWallet = 'https://localhost/wallet/test#this' config.currency = argv.currency || config.currency || defaultCurrency config.database = argv.database || config.database || defaultDatabase config.wallet = argv.wallet || config.wallet || defaultWallet config.key = argv.key || null config.cert = argv.cert || null var port = argv.port // run main sequelize = wc.setupDB(config) var app = express() wcApp = createApp(null, sequelize, config) app.use('/', wcApp) var defaultPort = 11077 port = port || defaultPort console.log(config) var key try { key = fs.readFileSync(config.key) } catch (e) { throw new Error('Can\'t find SSL key in ' + config.key) } var cert try { cert = fs.readFileSync(config.cert) } catch (e) { throw new Error('Can\'t find SSL cert in ' + config.cert) } var credentials = { key: key, cert: cert, requestCert: true } server = https.createServer(credentials, app) return server }
const router = require('express').Router() const bcrypt = require('bcrypt') const jwt = require('jsonwebtoken') const config = require('config') //import Photo Model const User = require('../models/User') //Post user/register //@access public //@desc register new user router.post('/register', (req, res) => { const { name, email, password } = req.body if (!name || !email || !password) { return res.status(400).json({msg : "All fields required"}) } //check user already exists via email User.findOne({email}) //if exists respond 400 w/msg .then(user => { if (user) res.status(400).json({msg : "User already exists with that email"}) }) //create user from schema const newUser = User({ name, email, password }) //gen salt bcrypt.genSalt(10, (err, salt) => { //apply hash to password with salt bcrypt.hash(newUser.password, salt, (err, hash) => { if (err) throw err; //set new user password to hash + add to db newUser.password = hash; newUser.save() .then(user => { //sign a token using user unique id/secret/expiration time as payload jwt.sign( {id : user.id}, config.get('jwtSecret'), {expiresIn : 25000}, (err, token) => { if (err) throw err; //include token in response along with user json (- password) res.json({ token, user : { id : user.id, name : user.name, email : user.email } }) }) }) }) }) }) //Post user/authenticate //@access public //@desc authenticate user router.post('/authenticate', (req, res) => { const { email, password } = req.body if (!email || !password) { return res.status(400).json({msg : "All fields required"}) } //check user already exists via email User.findOne({email}) //if exists respond 400 w/msg .then(user => { if (!user) res.status(400).json({msg : "Invalid email/password"}) //Validate Password bcrypt.compare(password, user.password) .then(isMatch => { if(!isMatch) return res.status(400).json({msg : 'Invalid email/password'}) jwt.sign( {id : user.id}, config.get('jwtSecret'), {expiresIn : 25000}, (err, token) => { if (err) throw err; //include token in response along with user json (- password) res.json({ token, user : { id : user.id, name : user.name, email : user.email } }) }) }) }) } ) module.exports = router
const path = require("path"); const VueLoaderPlugin = require("vue-loader/lib/plugin"); //vue載入器插件 const MiniCssExtractPlugin = require("mini-css-extract-plugin"); //css抽取 const HtmlWebpackPlugin = require("html-webpack-plugin"); //提取跟注入 const OptimizeCssAssetsWebpackPlugin = require("optimize-css-assets-webpack-plugin"); //壓縮css const { CleanWebpackPlugin } = require("clean-webpack-plugin"); //清除檔案資料 module.exports = { resolve: { //擴展路徑別名 alias: { "@css": path.resolve(__dirname, "./src/css/"), "@js": path.resolve(__dirname, "./src/js/"), "@vue": path.resolve(__dirname, "./src/vue/"), "@src": path.resolve(__dirname, "./src/"), vue: "vue/dist/vue.esm.js", }, }, //context: path.resolve(__dirname, "./src"), entry: { main: "./src/index.js", }, output: { path: path.resolve(__dirname, "./dist/"), //filename: "index.bundle.js", //publicPath: "/dist/", filename: "js/[name].[hash].js", }, devServer: { contentBase: path.join(__dirname, "/"), compress: true, port: 9000, inline: true, }, module: { rules: [ //vue元件載入器 { test: /\.vue$/, loader: "vue-loader", }, //scss模板載入器 /*{ test: /\.scss$/, loader: "style!css!sass?sourceMap", },*/ { test: /\.pug$/, loader: "pug-plain-loader", }, //pug模板載入器 /*{ test: /\.pug$/, oneOf: [ { resourceQuery: /^\?vue/, use: ["pug-plain-loader"], }, { use: ["raw-loader", "pug-plain-loader"], }, ], },*/ //vue樣式載入器 css載入器 /*{ test: /\.css$/, use: ["vue-style-loader", "css-loader"], },*/ //css提取 { test: /\.css$/i, use: [ { loader: MiniCssExtractPlugin.loader, options: { publicPath: "../", }, }, "css-loader", ], }, //js轉舊 { test: /\.m?js$/, exclude: /(node_modules|bower_components)/, use: { loader: "babel-loader", options: { presets: ["@babel/preset-env"], }, }, }, //圖檔載入器 { test: /\.(png|jpg|jpe?g|gif|svg)$/i, use: [ { loader: "file-loader", options: { name: "img/[name].[hash].[ext]", /*publicPath: "../",*/ //outputPath: "/", }, }, ], }, //字型載入器 { test: /\.(woff|woff2|eot|ttf|otf)$/, use: [ { loader: "file-loader", options: { name: "fonts/[name].[hash].[ext]", /*publicPath: "../",*/ //outputPath: "./", }, }, ], }, ], }, optimization: { //切割檔案 splitChunks: { cacheGroups: { commons: { test: /[\\/]node_modules[\\/]/, name: "vendors", chunks: "all", }, }, }, }, plugins: [ new CleanWebpackPlugin({ //cleanOnceBeforeBuildPatterns: ["./js/*", "./css/*", "./fonts/*", "./index,html"], cleanOnceBeforeBuildPatterns: ["./*"], }), new VueLoaderPlugin(), new MiniCssExtractPlugin({ filename: "css/[name].[hash].css", }), new HtmlWebpackPlugin({ template: "./src/index.html", filename: "index.html", }), new OptimizeCssAssetsWebpackPlugin(), ], };
'use strict' // Local dependencies const paths = require('./../paths.js') const flatPaths = require('./../utils/flattened-paths.js')(paths) module.exports = function (req, res, next) { req.actionName = flatPaths[`${req.route.path}_${req.method.toLowerCase()}`] next() }
import styled from '@emotion/styled' export const MarkdownContent = styled.div` h1, h2 { color: var(--primaryColor); } p, h2, h3, h4 { margin-bottom: 1rem; } a { color: var(--primaryColor); text-decoration: underline; } ` export const MarkdownTitle = styled.h1` color: var(--primaryColor); margin: 0.5rem 0; `
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. const exec = require('child_process').exec; const webpack = require('webpack'); const path = require('path'); const tsTransformer = require('@formatjs/ts-transformer'); const PLUGIN_ID = require('../plugin.json').id; const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env let mode = 'production'; let devtool; const plugins = []; if (NPM_TARGET === 'debug' || NPM_TARGET === 'debug:watch') { mode = 'development'; devtool = 'source-map'; plugins.push( new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development'), }), ); } if (NPM_TARGET === 'build:watch' || NPM_TARGET === 'debug:watch' || NPM_TARGET === 'live-watch') { plugins.push({ apply: (compiler) => { compiler.hooks.watchRun.tap('WatchStartPlugin', () => { // eslint-disable-next-line no-console console.log('Change detected. Rebuilding webapp.'); }); compiler.hooks.afterEmit.tap('AfterEmitPlugin', () => { let command = 'cd .. && make deploy-from-watch'; if (NPM_TARGET === 'live-watch') { command = 'cd .. && make deploy-to-mattermost-directory'; } exec(command, (err, stdout, stderr) => { if (stdout) { process.stdout.write(stdout); } if (stderr) { process.stderr.write(stderr); } }); }); }, }); } module.exports = { entry: [ './src/index.tsx', ], resolve: { modules: [ 'src', 'node_modules', path.resolve(__dirname), ], alias: { moment: path.resolve(__dirname, '../../webapp/node_modules/moment/'), }, extensions: ['*', '.js', '.jsx', '.ts', '.tsx'], }, module: { rules: [ { test: /\.tsx?$/, use: { loader: 'ts-loader', options: { getCustomTransformers: { before: [ tsTransformer.transform({ overrideIdFn: '[sha512:contenthash:base64:6]', ast: true, }), ], }, }, }, exclude: [/node_modules/], }, { test: /\.html$/, type: 'asset/resource', }, { test: /\.s[ac]ss$/i, use: [ 'style-loader', 'css-loader', 'sass-loader', path.resolve(__dirname, 'loaders/globalScssClassLoader'), ], }, { test: /\.css$/i, use: [ 'style-loader', 'css-loader', ], }, { test: /\.(tsx?|js|jsx|mjs|html)$/, use: [ ], exclude: [/node_modules/], }, { test: /\.(png|eot|tiff|svg|woff2|woff|ttf|jpg)$/, use: [ { loader: 'file-loader', options: { name: '[name].[ext]', outputPath: 'static', publicPath: '/plugins/focalboard/static/', }, }, { loader: 'image-webpack-loader', options: {}, }, ], }, ], }, externals: { react: 'React', redux: 'Redux', 'react-redux': 'ReactRedux', 'mm-react-router-dom': 'ReactRouterDom', 'prop-types': 'PropTypes', 'react-bootstrap': 'ReactBootstrap', }, output: { devtoolNamespace: PLUGIN_ID, path: path.join(__dirname, '/dist'), publicPath: '/', filename: 'main.js', }, devtool, mode, plugins, }; const env = {}; env.RUDDER_KEY = JSON.stringify(process.env.RUDDER_KEY || ''); //eslint-disable-line no-process-env env.RUDDER_DATAPLANE_URL = JSON.stringify(process.env.RUDDER_DATAPLANE_URL || ''); //eslint-disable-line no-process-env module.exports.plugins.push(new webpack.DefinePlugin({ 'process.env': env, }));
define({root:{pieLabelDNS:"DNS",pieLabelSSL:"SSL/TLS",pieLabelConnect:"Connect",pieLabelBlocked:"Blocked",pieLabelSend:"Send",pieLabelWait:"Wait",pieLabelReceive:"Receive",pieLabelHTMLText:"HTML/Text",pieLabelJavaScript:"JavaScript",pieLabelCSS:"CSS",pieLabelImage:"Image",pieLabelFlash:"Flash",pieLabelOthers:"Others",pieLabelHeadersSent:"Headers Sent",pieLabelBodiesSent:"Bodies Sent",pieLabelHeadersReceived:"Headers Received",pieLabelBodiesReceived:"Bodies Received",pieLabelDownloaded:"Downloaded",pieLabelPartial:"Partial",pieLabelFromCache:"From Cache"}})
const stripAnsi = require('strip-ansi'); const formatWebpackMessages = require('./formatWebpackMessages'); let wsProtocol = 'ws'; if (window.location.protocol === 'https:') { wsProtocol = 'wss'; } const wsUrl = `${wsProtocol}://${window.location.hostname}:${window.location.port}/sockjs-node/websocket`; // Connect to WebpackDevServer via a socket. console.log('The development server at', wsUrl); const connection = new WebSocket(wsUrl); // Unlike WebpackDevServer client, we won't try to reconnect // to avoid spamming the console. Disconnect usually happens // when developer stops the server. connection.onclose = function() { console.info('The development server has disconnected.\nRefresh the page if necessary.'); }; connection.onopen = function() { console.info('The development server has connected!'); }; connection.onerror = function() { console.info('The development server connect faild!'); }; // Remember some state related to hot module replacement. let isFirstCompilation = true; let mostRecentCompilationHash = null; let hasCompileErrors = false; function clearOutdatedErrors() { // Clean up outdated compile errors, if any. if (hasCompileErrors && typeof console.clear === 'function') { console.clear(); } } // Successful compilation. function handleSuccess() { clearOutdatedErrors(); const isHotUpdate = !isFirstCompilation; isFirstCompilation = false; hasCompileErrors = false; // Attempt to apply hot updates or reload. if (isHotUpdate) { tryApplyUpdates(function onHotUpdateSuccess() { // Only destroy it when we're sure it's a hot update. // Otherwise it would flicker right before the reload. }); } } // Compilation with warnings (e.g. ESLint). function handleWarnings(warnings) { clearOutdatedErrors(); const isHotUpdate = !isFirstCompilation; isFirstCompilation = false; hasCompileErrors = false; function printWarnings() { // Print warnings to the console. const formatted = formatWebpackMessages({ warnings, errors: [], }); for (let i = 0; i < formatted.warnings.length; i++) { console.warn(stripAnsi(formatted.warnings[i])); } } // Attempt to apply hot updates or reload. if (isHotUpdate) { tryApplyUpdates(function onSuccessfulHotUpdate() { // Only print warnings if we aren't refreshing the page. // Otherwise they'll disappear right away anyway. printWarnings(); // Only destroy it when we're sure it's a hot update. // Otherwise it would flicker right before the reload. }); } else { // Print initial warnings immediately. printWarnings(); } } // Compilation with errors (e.g. syntax error or missing modules). function handleErrors(errors) { clearOutdatedErrors(); isFirstCompilation = false; hasCompileErrors = true; // "Massage" webpack messages. const formatted = formatWebpackMessages({ errors, warnings: [], }); // Also log them to the console. for (let i = 0; i < formatted.errors.length; i++) { console.error(stripAnsi(formatted.errors[i])); } // Do not attempt to reload now. // We will reload on next success instead. } // There is a newer version of the code available. function handleAvailableHash(hash) { // Update last known compilation hash. mostRecentCompilationHash = hash; } // Handle messages from the server. connection.onmessage = function(e) { const message = JSON.parse(e.data); switch (message.type) { case 'hash': handleAvailableHash(message.data); break; case 'still-ok': case 'ok': handleSuccess(); break; case 'content-changed': // Triggered when a file from `contentBase` changed. window.location.reload(); break; case 'warnings': handleWarnings(message.data); break; case 'errors': handleErrors(message.data); break; default: // Do nothing. } }; // Is there a newer version of this code available? function isUpdateAvailable() { /* globals __webpack_hash__ */ // __webpack_hash__ is the hash of the current compilation. // It's a global variable injected by Webpack. return mostRecentCompilationHash !== __webpack_hash__; // eslint-disable-line } // Webpack disallows updates in other states. function canApplyUpdates() { return module.hot.status() === 'idle'; } // Attempt to update code on the fly, fall back to a hard reload. function tryApplyUpdates(onHotUpdateSuccess) { if (!module.hot) { // HotModuleReplacementPlugin is not in Webpack configuration. window.location.reload(); return; } if (!isUpdateAvailable() || !canApplyUpdates()) { return; } function handleApplyUpdates(err, updatedModules) { console.log('handleApplyUpdates', err, updatedModules); if (err || !updatedModules) { window.location.reload(); return; } if (typeof onHotUpdateSuccess === 'function') { // Maybe we want to do something. onHotUpdateSuccess(); } if (isUpdateAvailable()) { // While we were updating, there was a new update! Do it again. tryApplyUpdates(); } } // https://webpack.github.io/docs/hot-module-replacement.html#check const result = module.hot.check(/* autoApply */ true, handleApplyUpdates); // // Webpack 2 returns a Promise instead of invoking a callback if (result && result.then) { result.then( function(updatedModules) { handleApplyUpdates(null, updatedModules); }, function(err) { handleApplyUpdates(err, null); } ); } }
angular.module('my-components').component('mySelect', { templateUrl: 'src/components/my-select/my-select.component.html', bindings: { error: '=', form: '<', label: '@', name: '@', model: '=', data: '<', required: '<', // multiple: '<' }, controller: function( $element, $attrs ) { return new class { constructor() { } } } });
var path = require('path'); var url = require('url'); var closure = require('openlayers/node_modules/closure-util'); var nomnom = require('nomnom'); var gaze = require('gaze'); var exec = require('child_process').exec; var log = closure.log; var options = nomnom.options({ port: { abbr: 'p', 'default': 3000, help: 'Port for incoming connections', metavar: 'PORT' }, loglevel: { abbr: 'l', choices: ['silly', 'verbose', 'info', 'warn', 'error'], 'default': 'info', help: 'Log level', metavar: 'LEVEL' } }).parse(); /** @type {string} */ log.level = options.loglevel; function compileCss() { log.info('ngeo', 'Compiling CSS'); exec('make compile-css', function(error, stdout, stderr) { if (error !== null) { console.log(error); } if (stdout) { console.error(stdout); } }); } compileCss(); log.info('ngeo', 'Parsing dependencies ...'); var manager = new closure.Manager({ closure: true, // use the bundled Closure Library lib: [ 'src/**/*.js', 'contribs/**/src/**/*.js', 'externs/*.js', 'node_modules/openlayers/src/**/*.js', 'node_modules/openlayers/build/ol.ext/*.js' ], main: ['examples/*.js', 'contribs/**/examples/*.js', 'contribs/**/apps/**/*.js'] }); manager.on('error', function(e) { log.error('ngeo', e.message); }); manager.on('ready', function() { var server = new closure.Server({ manager: manager }); server.listen(options.port, function() { log.info('ngeo', 'Listening on http://localhost:' + options.port + '/ (Ctrl+C to stop)'); }); server.on('error', function(err) { log.error('ngeo', 'Server failed to start: ' + err.message); process.exit(1); }); gaze('**/*.less', function(err, watcher) { this.on('all', function(event, filepath) { console.log(filepath + ' was ' + event); compileCss(); }); }); });
/** * 小肥牛扫码点餐项目API子系统 */ const PORT = 8090; const express = require('express'); //启动主服务器 var app = express(); app.listen(PORT,()=>{ console.log('Server Listening '+PORT+' ...'); })
import Users from 'meteor/vulcan:users'; Users.addField([ { fieldName: 'address', fieldSchema: { type: Object, optional: true, canRead: ['guests'], relation: 'hasOne', searchable: true }, }, ]);
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See http://js.arcgis.com/3.34/esri/copyright.txt for details. //>>built define("esri/layers/rasterLib/tile/nls/RasterWorker_pt",{"dojo/cldr/nls/number":{scientificFormat:"#E0","currencySpacing-afterCurrency-currencyMatch":"[:^S:]",infinity:"\u221e",superscriptingExponent:"\u00d7",list:";",percentSign:"%",minusSign:"-","currencySpacing-beforeCurrency-surroundingMatch":"[:digit:]","decimalFormat-short":"000\u00a0tri","currencySpacing-afterCurrency-insertBetween":"\u00a0",nan:"NaN",plusSign:"+","currencySpacing-afterCurrency-surroundingMatch":"[:digit:]","currencySpacing-beforeCurrency-currencyMatch":"[:^S:]", currencyFormat:"\u00a4#,##0.00;(\u00a4#,##0.00)",perMille:"\u2030",group:".",percentFormat:"#,##0%","decimalFormat-long":"000 trilh\u00f5es",decimalFormat:"#,##0.###",decimal:",","currencySpacing-beforeCurrency-insertBetween":"\u00a0",exponential:"E",_localized:{}},"dojo/cldr/nls/gregorian":{"dateFormatItem-Ehm":"E, h:mm a","days-standAlone-short":"dom seg ter qua qui sex s\u00e1b".split(" "),"months-format-narrow":"JFMAMJJASOND".split(""),"field-second-relative+0":"agora","quarters-standAlone-narrow":["1", "2","3","4"],"field-weekday":"Dia da semana","dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"E, dd/MM/y","field-wed-relative+0":"esta quarta-feira","field-wed-relative+1":"pr\u00f3xima quarta-feira","dateFormatItem-GyMMMEd":"E, d 'de' MMM 'de' y G","dateFormatItem-MMMEd":"E, d 'de' MMM",eraNarrow:["a.C.","d.C."],"field-tue-relative+-1":"ter\u00e7a-feira passada","days-format-short":"dom seg ter qua qui sex s\u00e1b".split(" "),"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"d 'de' MMMM 'de' y", "field-fri-relative+-1":"sexta-feira passada","field-wed-relative+-1":"quarta-feira passada","months-format-wide":"janeiro fevereiro mar\u00e7o abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),"dateTimeFormat-medium":"{1} {0}","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, d 'de' MMMM 'de' y","field-thu-relative+-1":"quinta-feira passada","dateFormatItem-Md":"d/M","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dayPeriods-format-wide-noon":"meio-dia", "dateFormatItem-yMd":"dd/MM/y","field-era":"Era","dateFormatItem-yM":"MM/y","months-standAlone-wide":"janeiro fevereiro mar\u00e7o abril maio junho julho agosto setembro outubro novembro dezembro".split(" "),"timeFormat-short":"HH:mm","quarters-format-wide":["1\u00ba trimestre","2\u00ba trimestre","3\u00ba trimestre","4\u00ba trimestre"],"dateFormatItem-yQQQQ":"y QQQQ","timeFormat-long":"HH:mm:ss z","field-year":"Ano","dateFormatItem-yMMM":"MMM 'de' y","dateTimeFormats-appendItem-Era":"{1} {0}","field-hour":"Hora", "months-format-abbr":"jan fev mar abr mai jun jul ago set out nov dez".split(" "),"field-sat-relative+0":"este s\u00e1bado","field-sat-relative+1":"pr\u00f3ximo s\u00e1bado","timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"hoje","field-thu-relative+0":"esta quinta-feira","field-day-relative+1":"amanh\u00e3","field-thu-relative+1":"pr\u00f3xima quinta-feira","dateFormatItem-GyMMMd":"d 'de' MMM 'de' y G","dateFormatItem-H":"HH","months-standAlone-abbr":"jan fev mar abr mai jun jul ago set out nov dez".split(" "), "quarters-format-abbr":["T1","T2","T3","T4"],"quarters-standAlone-wide":["1\u00ba trimestre","2\u00ba trimestre","3\u00ba trimestre","4\u00ba trimestre"],"dateFormatItem-Gy":"y G","dateFormatItem-M":"L","days-standAlone-wide":"domingo segunda-feira ter\u00e7a-feira quarta-feira quinta-feira sexta-feira s\u00e1bado".split(" "),"dayPeriods-format-abbr-noon":"noon","timeFormat-medium":"HH:mm:ss","field-sun-relative+0":"este domingo","dateFormatItem-Hm":"HH:mm","field-sun-relative+1":"pr\u00f3ximo domingo", "quarters-standAlone-abbr":["T1","T2","T3","T4"],eraAbbr:["a.C.","d.C."],"field-minute":"Minuto","field-dayperiod":"AM/PM","days-standAlone-abbr":"dom seg ter qua qui sex s\u00e1b".split(" "),"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"ontem","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"a","dateFormatItem-h":"h a","dateFormatItem-MMMd":"d 'de' MMM","dateFormatItem-MEd":"E, dd/MM","dateTimeFormat-full":"{1} {0}", "field-fri-relative+0":"esta sexta-feira","field-fri-relative+1":"pr\u00f3xima sexta-feira","field-day":"Dia","days-format-wide":"domingo segunda-feira ter\u00e7a-feira quarta-feira quinta-feira sexta-feira s\u00e1bado".split(" "),"field-zone":"Fuso hor\u00e1rio","months-standAlone-narrow":"JFMAMJJASOND".split(""),"dateFormatItem-y":"y","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","field-year-relative+-1":"ano passado","field-month-relative+-1":"m\u00eas passado","dateTimeFormats-appendItem-Year":"{1} {0}", "dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":"dom seg ter qua qui sex s\u00e1b".split(" "),eraNames:["Antes de Cristo","Ano do Senhor"],"dateFormatItem-yMMMd":"d 'de' MMM 'de' y","days-format-narrow":"DSTQQSS".split(""),"field-month":"M\u00eas","days-standAlone-narrow":"DSTQQSS".split(""),"dateFormatItem-MMM":"LLL","field-tue-relative+0":"esta ter\u00e7a-feira","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})", "field-tue-relative+1":"pr\u00f3xima ter\u00e7a-feira","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormatItem-EHm":"E, HH:mm","field-mon-relative+0":"esta segunda-feira","field-mon-relative+1":"pr\u00f3xima segunda-feira","dateFormat-short":"dd/MM/yy","dateFormatItem-EHms":"E, HH:mm:ss","dateFormatItem-Ehms":"E, h:mm:ss a","dayPeriods-format-narrow-noon":"n","field-second":"Segundo","field-sat-relative+-1":"s\u00e1bado passado", "dateFormatItem-yMMMEd":"E, d 'de' MMM 'de' y","field-sun-relative+-1":"domingo passado","field-month-relative+0":"este m\u00eas","field-month-relative+1":"pr\u00f3ximo m\u00eas","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormatItem-Ed":"E, d","field-week":"Semana","dateFormat-medium":"d 'de' MMM 'de' y","field-week-relative+-1":"semana passada","field-year-relative+0":"este ano","field-year-relative+1":"pr\u00f3ximo ano","dayPeriods-format-narrow-pm":"p","dateTimeFormat-short":"{1} {0}", "dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-GyMMM":"MMM 'de' y G","field-mon-relative+-1":"segunda-feira passada","field-week-relative+0":"esta semana","field-week-relative+1":"pr\u00f3xima semana","dateFormatItem-yMM":"MM/y","dayPeriods-format-wide-morning":"manh\u00e3","dateFormatItem-MMdd":"dd/MM","field-day-relative+2":"depois de amanh\u00e3","dateFormatItem-HHmmss":"HH:mm:ss","dayPeriods-format-wide-night":"noite","field-day-relative+-2":"anteontem","dateFormatItem-HHmm":"HH:mm", "dayPeriods-format-wide-afternoon":"tarde",_localized:{}}});
import React, { useEffect, useState } from "react"; import { api } from "../../api"; import ProductCard from "../ProductCard"; import Slider from "../Slider"; import "./index.css"; const Home = () => { const [products, setProducts] = useState(); useEffect(() => { api.getProducts().then((res) => { setProducts(res); }); }, []); return ( <div classname="bg-grey"> <Slider /> <section className="bg-gray-50 py-8"> <div className="container mx-auto flex items-center flex-wrap pt-4 pb-12"> {products && products.map((product) => ( <ProductCard data={product} /> ))} <div className=" block w-full text-center font-bold text-xl bg-gray-50 text-gray-700 rounded-md p-2" > Show all results </div> </div> </section> </div> ); }; export default Home;
/* Courtesy http://html5tutorial.com/how-to-draw-n-grade-bezier-curve-with-canvas-api/ * due to substantial use of original code: */ /* * The MIT License (MIT) * * Copyright (c) 2012 Scriptoid * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is furnished to * do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * @author Alex Gheorghiu <alex at scriptoid dot com> */ import * as Utils from "./utils.js" /** Computes Bernstain * @param {Integer} i - the i-th index * @param {Integer} n - the total number of points * @param {Number} t - the value of parameter t , between 0 and 1 **/ function B(i, n, t) { return Utils.factorial(n) / (Utils.factorial(i) * Utils.factorial(n - i)) * Math.pow(t, i) * Math.pow(1 - t, n - i); } /** Computes a point's coordinates for a value of t * @param {Number} t - a value between o and 1 * @param {Array} points - an {Array} of [x,y] coodinates. The initial points **/ function P(t, points) { let r = { x: 0, y: 0, }; let n = points.length - 1; for (let i = 0; i <= n; i++) { r.x += points[i].x * B(i, n, t); r.y += points[i].y * B(i, n, t); } return r; } /* Draws a N grade bezier curve from current point on the context */ export function nGrade(points, res) { if (res === undefined) { res = 1; } // let step = res / tLength; /* compute the support points */ let temp = []; for (let t = 0; t <= 1; t += res) { temp.push(P(t, points)); } return temp; } export function cubic(x1, y1, x2, y2) { return this.nGrade([{ x: 0, y: 0, }, { x: x1, y: y1, },{ x: x2, y: y2, },{ x: 1, y: 1, }], 0.025); }
import React from 'react'; import ReactDOM from 'react-dom'; import ClientSideLatency from './ClientSideLatency'; import renderer from 'react-test-renderer'; Date.now = jest.fn(() => 1487076708000) it('renders without crashing', () => { const div = document.createElement('div'); ReactDOM.render(<ClientSideLatency />, div); ReactDOM.unmountComponentAtNode(div); }); describe("test against valid snapshot", ()=> { it("redner as expected", ()=> { const tree = renderer.create(<ClientSideLatency url="http://api.otcgo.cn:10332" />).toJSON(); expect(tree).toMatchSnapshot(); }); });
switch (prompt("What is the weather like?")) { case "rainy": console.log("Remember to bring an umbrella."); break; case "sunny": console.log("Dress lightly."); case "cloudy": console.log("Go outside"); break; default: console.log("Unknown weather type"); break; }
var async = require('async'), fs = require('graceful-fs'), _ = require('lodash'); git = require('./git'); module.exports = function(args, callback){ var config = hexo.config.backup, log = hexo.log, extend = hexo.extend, backupers = extend.deployer.list(); if (!config){ var help = ''; help += 'You should configure backupment settings in _config.yml first!\n\n'; help += 'Available Types:\n'; help += ' ' + Object.keys(backupers).join(', ') + '\n\n'; help += 'For more help, you can check the online docs: ' + 'http://hexo.io/'.underline; console.log(help); return callback(); } if (!Array.isArray(config)) config = [config]; var onBackupStarted = function() { /** * Fired before backupment. * * @event backupBefore * @for Hexo */ hexo.emit('backupBefore'); }; var onBackupFinished = function(err) { /** * Fired after backupment. * * @event backupAfter * @param {Error} err * @for Hexo */ hexo.emit('backupAfter', err); callback(err); }; onBackupStarted(); async.eachSeries(config, function(item, next){ var type = item.type; if (!backupers.hasOwnProperty(type)){ log.e('backuper not found: ' + type); return next(); } else { log.i('Start backup: ' + type); } git(_.extend({}, item, args), function(err){ if (err) return next(err); log.i('Backup done: ' + type); next(); }); }, onBackupFinished); };
const passport = require('passport'); const qs = require('../lib/query-string'); passport.use('github', require('../lib/passport').github); module.exports = (req, res) => { req.query = qs(req); res.redirect = url => { res.writeHead(302, { location: url }); res.end(); }; passport.authenticate('github', (err, user) => { if (err) { console.log(err); return res.redirect('/token-failure'); } if (!user) { return res.redirect('/token-failure'); } res.setHeader('Set-Cookie', 'token=' + user + '; Path=/'); res.redirect('/token'); })(req, res); };
import Ember from 'ember'; import {request as ajax} from 'ic-ajax'; import ValidationEngine from 'ghost/mixins/validation-engine'; export default Ember.Controller.extend(ValidationEngine, { size: 90, blogTitle: null, name: null, email: '', validEmail: '', password: null, image: null, blogCreated: false, ghostPaths: Ember.inject.service('ghost-paths'), notifications: Ember.inject.service(), application: Ember.inject.controller(), config: Ember.inject.service(), // ValidationEngine settings validationType: 'setup', /** * Uploads the given data image, then sends the changed user image property to the server * @param {Object} user User object, returned from the 'setup' api call * @return {Ember.RSVP.Promise} A promise that takes care of both calls */ sendImage: function (user) { var self = this, image = this.get('image'); return new Ember.RSVP.Promise(function (resolve, reject) { image.formData = {}; image.submit() .success(function (response) { user.image = response; ajax({ url: self.get('ghostPaths.url').api('users', user.id.toString()), type: 'PUT', data: { users: [user] } }).then(resolve).catch(reject); }) .error(reject); }); }, actions: { setup: function () { var self = this, data = self.getProperties('blogTitle', 'name', 'email', 'password', 'image'), notifications = this.get('notifications'), config = this.get('config'), method = this.get('blogCreated') ? 'PUT' : 'POST'; this.validate().then(function () { self.set('showError', false); ajax({ url: self.get('ghostPaths.url').api('authentication', 'setup'), type: method, data: { setup: [{ name: data.name, email: data.email, password: data.password, blogTitle: data.blogTitle }] } }).then(function (result) { config.set('blogTitle', data.blogTitle); // Don't call the success handler, otherwise we will be redirected to admin self.get('application').set('skipAuthSuccessHandler', true); self.get('session').authenticate('simple-auth-authenticator:oauth2-password-grant', { identification: self.get('email'), password: self.get('password') }).then(function () { self.set('password', ''); self.set('blogCreated', true); if (data.image) { self.sendImage(result.users[0]) .then(function () { self.transitionToRoute('setup.three'); }).catch(function (resp) { notifications.showAPIError(resp); }); } else { self.transitionToRoute('setup.three'); } }); }).catch(function (resp) { notifications.showAPIError(resp); }); }).catch(function () { self.set('showError', true); }); }, setImage: function (image) { this.set('image', image); }, handleEmail: function () { var self = this; this.validate({property: 'email'}).then(function () { self.set('validEmail', self.get('email')); }); } } });
const toUri = require('multiaddr-to-uri') const { ok, toIterable } = require('../../lib/fetch') module.exports = (fetch, config) => { return (cid, options) => (async function * () { options = options || {} const url = `${toUri(config.apiAddr)}/api/client/cat?arg=${encodeURIComponent(cid)}` const res = await ok(fetch(url, { signal: options.signal })) for await (const chunk of toIterable(res.body)) { yield chunk } })() }
import { __decorate } from "tslib"; import { Injectable } from '@angular/core'; import { ProductReviewsAdapter } from './product-reviews.adapter'; import * as i0 from "@angular/core"; import * as i1 from "./product-reviews.adapter"; let ProductReviewsConnector = class ProductReviewsConnector { constructor(adapter) { this.adapter = adapter; } get(productCode, maxCount) { return this.adapter.load(productCode, maxCount); } add(productCode, review) { return this.adapter.post(productCode, review); } }; ProductReviewsConnector.ctorParameters = () => [ { type: ProductReviewsAdapter } ]; ProductReviewsConnector.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductReviewsConnector_Factory() { return new ProductReviewsConnector(i0.ɵɵinject(i1.ProductReviewsAdapter)); }, token: ProductReviewsConnector, providedIn: "root" }); ProductReviewsConnector = __decorate([ Injectable({ providedIn: 'root', }) ], ProductReviewsConnector); export { ProductReviewsConnector }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZHVjdC1yZXZpZXdzLmNvbm5lY3Rvci5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzcGFydGFjdXMvY29yZS8iLCJzb3VyY2VzIjpbInNyYy9wcm9kdWN0L2Nvbm5lY3RvcnMvcmV2aWV3cy9wcm9kdWN0LXJldmlld3MuY29ubmVjdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLDJCQUEyQixDQUFDOzs7QUFNbEUsSUFBYSx1QkFBdUIsR0FBcEMsTUFBYSx1QkFBdUI7SUFDbEMsWUFBc0IsT0FBOEI7UUFBOUIsWUFBTyxHQUFQLE9BQU8sQ0FBdUI7SUFBRyxDQUFDO0lBRXhELEdBQUcsQ0FBQyxXQUFtQixFQUFFLFFBQWlCO1FBQ3hDLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLFFBQVEsQ0FBQyxDQUFDO0lBQ2xELENBQUM7SUFFRCxHQUFHLENBQUMsV0FBbUIsRUFBRSxNQUFXO1FBQ2xDLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLE1BQU0sQ0FBQyxDQUFDO0lBQ2hELENBQUM7Q0FDRixDQUFBOztZQVRnQyxxQkFBcUI7OztBQUR6Qyx1QkFBdUI7SUFIbkMsVUFBVSxDQUFDO1FBQ1YsVUFBVSxFQUFFLE1BQU07S0FDbkIsQ0FBQztHQUNXLHVCQUF1QixDQVVuQztTQVZZLHVCQUF1QiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IE9ic2VydmFibGUgfSBmcm9tICdyeGpzJztcbmltcG9ydCB7IFByb2R1Y3RSZXZpZXdzQWRhcHRlciB9IGZyb20gJy4vcHJvZHVjdC1yZXZpZXdzLmFkYXB0ZXInO1xuaW1wb3J0IHsgUmV2aWV3IH0gZnJvbSAnLi4vLi4vLi4vbW9kZWwvcHJvZHVjdC5tb2RlbCc7XG5cbkBJbmplY3RhYmxlKHtcbiAgcHJvdmlkZWRJbjogJ3Jvb3QnLFxufSlcbmV4cG9ydCBjbGFzcyBQcm9kdWN0UmV2aWV3c0Nvbm5lY3RvciB7XG4gIGNvbnN0cnVjdG9yKHByb3RlY3RlZCBhZGFwdGVyOiBQcm9kdWN0UmV2aWV3c0FkYXB0ZXIpIHt9XG5cbiAgZ2V0KHByb2R1Y3RDb2RlOiBzdHJpbmcsIG1heENvdW50PzogbnVtYmVyKTogT2JzZXJ2YWJsZTxSZXZpZXdbXT4ge1xuICAgIHJldHVybiB0aGlzLmFkYXB0ZXIubG9hZChwcm9kdWN0Q29kZSwgbWF4Q291bnQpO1xuICB9XG5cbiAgYWRkKHByb2R1Y3RDb2RlOiBzdHJpbmcsIHJldmlldzogYW55KTogT2JzZXJ2YWJsZTxSZXZpZXc+IHtcbiAgICByZXR1cm4gdGhpcy5hZGFwdGVyLnBvc3QocHJvZHVjdENvZGUsIHJldmlldyk7XG4gIH1cbn1cbiJdfQ==
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon([/*#__PURE__*/_jsx("path", { d: "M4 20h16v-8H4v8zm6-7.27L16 16l-6 3.26v-6.53z", opacity: ".3" }, "0"), /*#__PURE__*/_jsx("path", { d: "M4 6h16v2H4zm2-4h12v2H6zm14 8H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm0 10H4v-8h16v8zm-10-7.27v6.53L16 16z" }, "1")], 'SubscriptionsTwoTone');
// QRCODE reader Copyright 2011 Lazar Laszlo // http://www.webqr.com var gCtx = null; var gCanvas = null; var c=0; var stype=0; var gUM=false; var webkit=false; var moz=false; var v=null; var webcamStream = null; var nave =null; var active = true; var imghtml='<div id="qrfile"><canvas id="out-canvas" width="320" height="240"></canvas>'+ '<div id="imghelp">drag and drop a QRCode here'+ '<br>or select a file'+ '<input type="file" onchange="handleFiles(this.files)"/>'+ '</div>'+ '</div>'; var vidhtml = '<video id="v" autoplay></video>'; function dragenter(e) { e.stopPropagation(); e.preventDefault(); } function dragover(e) { e.stopPropagation(); e.preventDefault(); } function drop(e) { e.stopPropagation(); e.preventDefault(); var dt = e.dataTransfer; var files = dt.files; if(files.length>0) { handleFiles(files); } else if(dt.getData('URL')) { qrcode.decode(dt.getData('URL')); } } function handleFiles(f) { var o=[]; for(var i =0;i<f.length;i++) { var reader = new FileReader(); reader.onload = (function(theFile) { return function(e) { gCtx.clearRect(0, 0, gCanvas.width, gCanvas.height); qrcode.decode(e.target.result); }; })(f[i]); reader.readAsDataURL(f[i]); } } function initCanvas(w,h) { gCanvas = document.getElementById("qr-canvas"); gCanvas.style.width = w + "px"; gCanvas.style.height = h + "px"; gCanvas.width = w; gCanvas.height = h; gCtx = gCanvas.getContext("2d"); gCtx.clearRect(0, 0, w, h); } function captureToCanvas() { if(stype!=1) return; if(gUM) { try{ gCtx.drawImage(v,0,0); try{ qrcode.decode(); } catch(e){ console.log(e); if(active){ setTimeout(captureToCanvas, 500); } }; } catch(e){ console.log(e); if(active){ setTimeout(captureToCanvas, 500); } }; } } function htmlEntities(str) { return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); } function read(a) { var html="<br>"; if(a.indexOf("http://") === 0 || a.indexOf("https://") === 0) html+="- scanning -"; html+="<b>"+htmlEntities(a)+"</b><br><br>"; //combinaciones = a.split("-"); document.getElementById("result").innerHTML=html; cargar(a); } function isCanvasSupported(){ var elem = document.createElement('canvas'); return !!(elem.getContext && elem.getContext('2d')); } function success(stream) { v.src = window.URL.createObjectURL(stream); webcamStream = stream; gUM=true; if(active){ setTimeout(captureToCanvas, 500); } } function error(error) { gUM=false; return; } function load() { if(isCanvasSupported() && window.File && window.FileReader) { initCanvas(800, 600); qrcode.callback = read; document.getElementById("mainbody").style.display="inline"; active = true; setwebcam(); } else { document.getElementById("mainbody").style.display="inline"; document.getElementById("mainbody").innerHTML='<p id="mp1">QR code scanner for HTML5 capable browsers</p><br>'+ '<br><p id="mp2">sorry your browser is not supported</p><br><br>'+ '<p id="mp1">try <a href="http://www.mozilla.com/firefox"><img src="firefox.png"/></a> or <a href="http://chrome.google.com"><img src="chrome_logo.gif"/></a> or <a href="http://www.opera.com"><img src="Opera-logo.png"/></a></p>'; } } function setwebcam() { document.getElementById("result").innerHTML="- scanning -"; if(stype==1) { if(active){ setTimeout(captureToCanvas, 500); } return; } var n=navigator; nave = navigator; document.getElementById("outdiv").innerHTML = vidhtml; v=document.getElementById("v"); if(n.getUserMedia) n.getUserMedia({video: true, audio: false}, success, error); else if(n.mediaDevices.getUserMedia) n.mediaDevices.getUserMedia({video: { facingMode: "environment"} , audio: false}) .then(success) .catch(error); else if(n.webkitGetUserMedia) { webkit=true; n.webkitGetUserMedia({video:true, audio: false}, success, error); } else if(n.mozGetUserMedia) { moz=true; n.mozGetUserMedia({video: true, audio: false}, success, error); } stype=1; if(active){ setTimeout(captureToCanvas, 500); } } function apagarCam(){ var n = nave; stype=0; webkit=false; moz=false; active = false; var n = navigator; v.pause(); v.src = ""; webcamStream.getTracks()[0].stop(); document.getElementById("mainbody").style.display="none"; } function setimg() { document.getElementById("result").innerHTML=""; if(stype==2) return; document.getElementById("outdiv").innerHTML = imghtml; var qrfile = document.getElementById("qrfile"); qrfile.addEventListener("dragenter", dragenter, false); qrfile.addEventListener("dragover", dragover, false); qrfile.addEventListener("drop", drop, false); stype=2; }
export const defaultStoreFinderConfig = { googleMaps: { apiUrl: 'https://maps.googleapis.com/maps/api/js', apiKey: '', scale: 5, selectedMarkerScale: 17, radius: 50000, }, }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdC1zdG9yZS1maW5kZXItY29uZmlnLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHNwYXJ0YWN1cy9jb3JlLyIsInNvdXJjZXMiOlsic3JjL3N0b3JlLWZpbmRlci9jb25maWcvZGVmYXVsdC1zdG9yZS1maW5kZXItY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE1BQU0sQ0FBQyxNQUFNLHdCQUF3QixHQUFzQjtJQUN6RCxVQUFVLEVBQUU7UUFDVixNQUFNLEVBQUUseUNBQXlDO1FBQ2pELE1BQU0sRUFBRSxFQUFFO1FBQ1YsS0FBSyxFQUFFLENBQUM7UUFDUixtQkFBbUIsRUFBRSxFQUFFO1FBQ3ZCLE1BQU0sRUFBRSxLQUFLO0tBQ2Q7Q0FDRixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgU3RvcmVGaW5kZXJDb25maWcgfSBmcm9tICcuL3N0b3JlLWZpbmRlci1jb25maWcnO1xyXG5cclxuZXhwb3J0IGNvbnN0IGRlZmF1bHRTdG9yZUZpbmRlckNvbmZpZzogU3RvcmVGaW5kZXJDb25maWcgPSB7XHJcbiAgZ29vZ2xlTWFwczoge1xyXG4gICAgYXBpVXJsOiAnaHR0cHM6Ly9tYXBzLmdvb2dsZWFwaXMuY29tL21hcHMvYXBpL2pzJyxcclxuICAgIGFwaUtleTogJycsXHJcbiAgICBzY2FsZTogNSxcclxuICAgIHNlbGVjdGVkTWFya2VyU2NhbGU6IDE3LFxyXG4gICAgcmFkaXVzOiA1MDAwMCxcclxuICB9LFxyXG59O1xyXG4iXX0=
import React from "react"; const Recipe = props => ( <div className="col-md-4" style={{ marginBottom: "2rem" }}> <div className="recipes__box"> <img src={props.image} alt={props.title} className="recipe__box-img" /> <div className="recipe__text"> <h5 className="recipes__title"> {props.title.length < 26 ? props.title : `${props.title.substring(0, 25)}...`} </h5> <p className="recipes__subtitle"> Publisher: <span>{props.publisher}</span> </p> </div> <button onClick={props.click} className="recipe_buttons"> View Recipe </button> </div> </div> ); export default Recipe;
import math from 'mathjs'; export default class CostFunction { calculate(X, y, theta) { let m = y.dimensions().rows; let h = X.multiply(theta); let diff = h.subtract(y); let sqrErrors = diff.elementMultiply(diff); return 1 / (2 * m) * sqrErrors.sum(); } }
/** * * grunt lint Lint all source javascript * grunt clean Clean dist folder * grunt build Build dist javascript * grunt test Test dist javascript * grunt default Lint, Build then Test * */ module.exports = function(grunt) { grunt.initConfig({ jshint: { options: { asi: true, curly: false, eqeqeq: true, esnext: true, expr: true, forin: true, freeze: false, immed: true, indent: 2, iterator: true, noarg: true, node: true, noempty: true, nonstandard: true, trailing: true, undef: true, unused: 'vars', }, all: ['src/**/*.js'] }, clean: { build: ['dist/*'] }, bundle: { build: { files: [{ src: 'src/Immutable.js', dest: 'dist/immutable' }] } }, copy: { build: { files: [{ src: 'type-definitions/Immutable.d.ts', dest: 'dist/immutable.d.ts' }] } }, jest: { options: { testPathPattern: /.*/ } } }); var fs = require('fs'); var esperanto = require('esperanto'); var declassify = require('./resources/declassify'); var stripCopyright = require('./resources/stripCopyright'); var uglify = require('uglify-js'); grunt.registerMultiTask('bundle', function () { var done = this.async(); this.files.map(function (file) { esperanto.bundle({ entry: file.src[0], transform: function(source) { return declassify(stripCopyright(source)); } }).then(function (bundle) { var copyright = fs.readFileSync('resources/COPYRIGHT'); var bundled = bundle.toUmd({ banner: copyright, name: 'Immutable' }).code; var es6 = require('es6-transpiler'); var transformResult = require("es6-transpiler").run({ src: bundled, disallowUnknownReferences: false, environments: ["node", "browser"], globals: { define: false, }, }); if (transformResult.errors && transformResult.errors.length > 0) { throw new Error(transformResult.errors[0]); } var transformed = transformResult.src; fs.writeFileSync(file.dest + '.js', transformed); var minifyResult = uglify.minify(transformed, { fromString: true, mangle: { toplevel: true }, compress: { comparisons: true, pure_getters: true, unsafe: true }, output: { max_line_len: 2048, }, reserved: ['module', 'define', 'Immutable'] }); var minified = minifyResult.code; fs.writeFileSync(file.dest + '.min.js', copyright + minified); }).then(function(){ done(); }, function(error) { grunt.log.error(error.stack); done(false); }); }); }); var Promise = require("bluebird"); var exec = require('child_process').exec; function execp(cmd) { var resolve, reject; var promise = new Promise(function(_resolve, _reject) { resolve = _resolve; reject = _reject; }); try { exec(cmd, function (error, out) { if (error) { reject(error); } else { resolve(out); } }); } catch (error) { reject(error); } return promise; } grunt.registerTask('stats', function () { Promise.all([ execp('cat dist/immutable.js | wc -c'), execp('git show master:dist/immutable.js | wc -c'), execp('cat dist/immutable.min.js | wc -c'), execp('git show master:dist/immutable.min.js | wc -c'), execp('cat dist/immutable.min.js | gzip -c | wc -c'), execp('git show master:dist/immutable.min.js | gzip -c | wc -c'), ]).then(function (results) { return results.map(function (result) { return parseInt(result); }); }).then(function (results) { var rawNew = results[0]; var rawOld = results[1]; var minNew = results[2]; var minOld = results[3]; var zipNew = results[4]; var zipOld = results[5]; function space(n, s) { return Array(Math.max(0, 10 + n - (s||'').length)).join(' ') + (s||''); } function bytes(b) { return b.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' bytes'; } function diff(n, o) { var d = n - o; return d === 0 ? '' : d < 0 ? (' ' + bytes(d)).green : (' +' + bytes(d)).red; } function pct(s, b) { var p = Math.floor(10000 * (1 - (s / b))) / 100; return (' ' + p + '%').grey; } console.log(' Raw: ' + space(14, bytes(rawNew).cyan) + ' ' + space(15, diff(rawNew, rawOld)) ); console.log(' Min: ' + space(14, bytes(minNew).cyan) + pct(minNew, rawNew) + space(15, diff(minNew, minOld)) ); console.log(' Zip: ' + space(14, bytes(zipNew).cyan) + pct(zipNew, rawNew) + space(15, diff(zipNew, zipOld)) ); }).then(this.async()).catch(function (error) { setTimeout(function () { throw error; }, 0); }); }); grunt.registerTask('init_ts_compiler', function () { // LOL. This is because requiring ts-compiler for the first time actually // calls fs.writeFileSync(), which when called from within a parallel // test-runner, freaks out the file system and fails. This is pretty // poor-form from TypeScript. The solution is to first require ts-compiler // from this main process, before our test runner can access it, so // fs.writeFileSync() has an opportunity to succeed. var ts = require('ts-compiler'); }); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-jest'); grunt.loadNpmTasks('grunt-release'); grunt.registerTask('lint', 'Lint all source javascript', ['jshint']); grunt.registerTask('build', 'Build distributed javascript', ['clean', 'bundle', 'copy']); grunt.registerTask('test', 'Test built javascript', ['init_ts_compiler', 'jest']); grunt.registerTask('default', 'Lint, build and test.', ['lint', 'build', 'stats', 'test']); }
sap.ui.define([ "sap/ui/demo/cardExplorer/controller/BaseController", 'sap/ui/model/json/JSONModel', "../model/IntegrateNavigationModel", "sap/ui/Device" ], function ( BaseController, JSONModel, IntegrateNavigationModel, Device ) { "use strict"; return BaseController.extend("sap.ui.demo.cardExplorer.controller.Integrate", { /** * Called when the controller is instantiated. */ onInit: function () { var oRouter = this.getRouter(); oRouter.getRoute("integrate").attachMatched(this._onRouteMatched, this); this.oJsonDefModel = new JSONModel(); this.setModel(this.oJsonDefModel); }, _onRouteMatched: function (oEvent) { var oArgs = oEvent.getParameter("arguments"), sSampleKey = oArgs["key"], sTopicURL = sap.ui.require.toUrl("sap/ui/demo/cardExplorer/topics/integrate/" + sSampleKey + '.html'), oCurrentEntry; var aNavEntries = IntegrateNavigationModel.getProperty('/navigation'); oCurrentEntry = aNavEntries.find(function (oElement) { return oElement.key === sSampleKey; }); var oJsonObj = { pageTitle: oCurrentEntry ? oCurrentEntry.title : "Section", topicURL: sTopicURL, bIsPhone: Device.system.phone }; this.oJsonDefModel.setData(oJsonObj); this.onFrameSourceChange(); } }); });
'use strict'; /** * Module dependencies. */ let express = require('express') let compress = require('compression') let methodOverride = require('method-override') let config = require('./config') let router = express.Router() // was missing () let prom = require('prom-client'); module.exports = function () { // Initialize express app let app = express(); // Setting application local variables app.locals.title = config.app.title; app.locals.description = config.app.description; app.locals.keywords = config.app.keywords; // prometheus prom.collectDefaultMetrics(); // Passing the request url to environment locals app.use(function (req, res, next) { res.locals.url = req.protocol + '://' + req.headers.host + req.url; next(); }); // Should be placed before express.static app.use(compress({ filter: function (req, res) { return (/json|text|javascript|css/).test(res.getHeader('Content-Type')); }, level: 9 })); // Showing stack errors app.set('showStackError', true); // Environment dependent middleware app.locals.cache = 'memory'; // Request body parsing middleware should be above methodOverride app.use(express.json()) app.use(methodOverride()) // Routes definition app.get('/metrics', async (req, res) => { try { res.set('Content-Type', prom.register.contentType); res.end(await prom.register.metrics()); } catch (ex) { res.status(500).end(ex); } }); router.use('/api/v1', require('../app/routes/message.server.routes')) router.use('/api/v1', require('../app/routes/health.server.routes')) app.use(router) // Assume 'not found' in the error msgs is a 404. app.use(function (err, req, res, next) { // If the error object doesn't exists if (!err) return next(); // Log it console.error(err.stack); // Error page res.status(404).json({ message: 'Endpoint not found.' }); }); // Assume 501 since no middleware responded app.use(function (req, res) { res.status(501).send({ message: 'The requested endpoint does not exists or is not implemented.' }); }); // Return Express server instance return app; };
const redis = require('./redis_client'); const keyGenerator = require('./redis_key_generator'); // Minimum amount of capacity that a site should have to be // considered as having 'excess capacity'. const capacityThreshold = 0.2; /** * Takes a flat key/value pairs object representing a Redis hash, and * returns a new object whose structure matches that of the site domain * object. Also converts fields whose values are numbers back to * numbers as Redis stores all hash key values as strings. * * @param {Object} siteHash - object containing hash values from Redis * @returns {Object} - object containing the values from Redis remapped * to the shape of a site domain object. * @private */ const remap = (siteHash) => { const remappedSiteHash = { ...siteHash }; remappedSiteHash.id = parseInt(siteHash.id, 10); remappedSiteHash.panels = parseInt(siteHash.panels, 10); remappedSiteHash.capacity = parseFloat(siteHash.capacity, 10); // coordinate is optional. if (siteHash.hasOwnProperty('lat') && siteHash.hasOwnProperty('lng')) { remappedSiteHash.coordinate = { lat: parseFloat(siteHash.lat), lng: parseFloat(siteHash.lng), }; // Remove original fields from resulting object. delete remappedSiteHash.lat; delete remappedSiteHash.lng; } return remappedSiteHash; }; /** * Takes a site domain object and flattens its structure out into * a set of key/value pairs suitable for storage in a Redis hash. * * @param {Object} site - a site domain object. * @returns {Object} - a flattened version of 'site', with no nested * inner objects, suitable for storage in a Redis hash. * @private */ const flatten = (site) => { const flattenedSite = { ...site }; if (flattenedSite.hasOwnProperty('coordinate')) { flattenedSite.lat = flattenedSite.coordinate.lat; flattenedSite.lng = flattenedSite.coordinate.lng; delete flattenedSite.coordinate; } return flattenedSite; }; /** * Insert a new site. * * @param {Object} site - a site object. * @returns {Promise} - a Promise, resolving to the string value * for the key of the site Redis. */ const insert = async (site) => { const client = redis.getClient(); const siteHashKey = keyGenerator.getSiteHashKey(site.id); await client.hmsetAsync(siteHashKey, flatten(site)); // Co-ordinates are required when using this version of the DAO. if (!site.hasOwnProperty('coordinate')) { throw new Error('Coordinate required for site geo insert!'); } await client.geoaddAsync( keyGenerator.getSiteGeoKey(), site.coordinate.lng, site.coordinate.lat, site.id, ); return siteHashKey; }; /** * Get the site object for a given site ID. * * @param {number} id - a site ID. * @returns {Promise} - a Promise, resolving to a site object. */ const findById = async (id) => { const client = redis.getClient(); const siteKey = keyGenerator.getSiteHashKey(id); const siteHash = await client.hgetallAsync(siteKey); return (siteHash === null ? siteHash : remap(siteHash)); }; /** * Get an array of all site objects. * * @returns {Promise} - a Promise, resolving to an array of site objects. */ const findAll = async () => { const client = redis.getClient(); const siteIds = await client.zrangeAsync(keyGenerator.getSiteGeoKey(), 0, -1); const sites = []; for (const siteId of siteIds) { const siteKey = keyGenerator.getSiteHashKey(siteId); /* eslint-disable no-await-in-loop */ const siteHash = await client.hgetallAsync(siteKey); /* eslint-enable */ if (siteHash) { // Call remap to remap the flat key/value representation // from the Redis hash into the site domain object format. sites.push(remap(siteHash)); } } return sites; }; /** * Get an array of sites within a radius of a given coordinate. * * @param {number} lat - Latitude of the coordinate to search from. * @param {number} lng - Longitude of the coordinate to search from. * @param {number} radius - Radius in which to search. * @param {'KM' | 'MI'} radiusUnit - The unit that the value of radius is in. * @returns {Promise} - a Promise, resolving to an array of site objects. */ const findByGeo = async (lat, lng, radius, radiusUnit) => { const client = redis.getClient(); const siteIds = await client.georadiusAsync( keyGenerator.getSiteGeoKey(), lng, lat, radius, radiusUnit.toLowerCase(), ); const sites = []; for (const siteId of siteIds) { /* eslint-disable no-await-in-loop */ const siteKey = keyGenerator.getSiteHashKey(siteId); const siteHash = await client.hgetallAsync(siteKey); /* eslint-enable */ if (siteHash) { sites.push(remap(siteHash)); } } return sites; }; /** * Get an array of sites where capacity exceeds consumption within * a radius of a given coordinate. * * @param {number} lat - Latitude of the coordinate to search from. * @param {number} lng - Longitude of the coordinate to search from. * @param {number} radius - Radius in which to search. * @param {'KM' | 'MI'} radiusUnit - The unit that the value of radius is in. * @returns {Promise} - a Promise, resolving to an array of site objects. */ const findByGeoWithExcessCapacity = async (lat, lng, radius, radiusUnit) => { /* eslint-disable no-unreachable */ // Challenge #5, remove the next line... return []; const client = redis.getClient(); // Create a pipeline to send multiple commands in one round trip. const setOperationsPipeline = client.batch(); // Get sites within the radius and store them in a temporary sorted set. const sitesInRadiusSortedSetKey = keyGenerator.getTemporaryKey(); setOperationsPipeline.georadiusAsync( keyGenerator.getSiteGeoKey(), lng, lat, radius, radiusUnit.toLowerCase(), 'STORE', sitesInRadiusSortedSetKey, ); // Create a key for a temporary sorted set containing sites that fell // within the radius and their current capacities. const sitesInRadiusCapacitySortedSetKey = keyGenerator.getTemporaryKey(); // START Challenge #5 // END Challenge #5 // Expire the temporary sorted sets after 30 seconds, so that we // don't leave old keys on the server that we no longer need. setOperationsPipeline.expire(sitesInRadiusSortedSetKey, 30); setOperationsPipeline.expire(sitesInRadiusCapacitySortedSetKey, 30); // Execute the set operations commands, we do not need to // use the responses. await setOperationsPipeline.execAsync(); // Get sites IDs with enough capacity from the temporary // sorted set and store them in siteIds. const siteIds = await client.zrangebyscoreAsync( sitesInRadiusCapacitySortedSetKey, capacityThreshold, '+inf', ); // Populate array with site details, use pipeline for efficiency. const siteHashPipeline = client.batch(); for (const siteId of siteIds) { const siteKey = keyGenerator.getSiteHashKey(siteId); siteHashPipeline.hgetall(siteKey); } const siteHashes = await siteHashPipeline.execAsync(); const sitesWithCapacity = []; for (const siteHash of siteHashes) { // Ensure a result was found before processing it. if (siteHash) { // Call remap to remap the flat key/value representation // from the Redis hash into the site domain object format, // and convert any fields that a numerical from the Redis // string representations. sitesWithCapacity.push(remap(siteHash)); } } return sitesWithCapacity; /* eslint-enable */ }; module.exports = { insert, findById, findAll, findByGeo, findByGeoWithExcessCapacity, };
/** * Temporary solution for german string formatting. * Should be replaced by proper localization. * @param {*} value */ export default function(value) { const result = value .toFixed(2) .replace('.', ',') // replace decimal point separator .replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1 '); // apply grouping of three digits with whitespace return result; }
var nodemon = require('gulp-nodemon') module.exports = function () { return nodemon({ script: './main.js' }) }
// Copyright (C) 2013 Google Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var history = history || {}; (function() { history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES = { showAllRuns: false, testType: 'browser_tests', useTestData: false, } history.validateParameter = function(state, key, value, validateFn) { if (validateFn()) { state[key] = value; return true; } else { console.log(key + ' value is not valid: ' + value); return false; } } history.isTreeMap = function() { return string.endsWith(window.location.pathname, 'treemap.html'); } // TODO(jparent): Make private once callers move here. history.queryHashAsMap = function() { var hash = window.location.hash; var paramsList = hash ? hash.substring(1).split('&') : []; var paramsMap = {}; var invalidKeys = []; for (var i = 0; i < paramsList.length; i++) { var thisParam = paramsList[i].split('='); if (thisParam.length != 2) { console.log('Invalid query parameter: ' + paramsList[i]); continue; } paramsMap[thisParam[0]] = decodeURIComponent(thisParam[1]); } return paramsMap; } history._diffStates = function(oldState, newState) { // If there is no old state, everything in the current state is new. if (!oldState) return newState; var changedParams = {}; for (curKey in newState) { var oldVal = oldState[curKey]; var newVal = newState[curKey]; // Add new keys or changed values. if (!oldVal || oldVal != newVal) changedParams[curKey] = newVal; } return changedParams; } history._fillMissingValues = function(to, from) { for (var state in from) { if (!(state in to)) to[state] = from[state]; } } history.History = function(configuration) { this.crossDashboardState = {}; this.dashboardSpecificState = {}; if (configuration) { this._defaultDashboardSpecificStateValues = configuration.defaultStateValues; this._handleValidHashParameter = configuration.handleValidHashParameter; this._handleQueryParameterChange = configuration.handleQueryParameterChange || function(historyInstance, params) { return true; }; this._dashboardSpecificInvalidatingParameters = configuration.invalidatingHashParameters; this._generatePage = configuration.generatePage; } } history.reloadRequiringParameters = ['showAllRuns', 'testType']; history.History.prototype = { initialize: function() { window.onhashchange = this._handleLocationChange.bind(this); this._handleLocationChange(); }, isLayoutTestResults: function() { // TODO(crbug/706192): remove webkit_tests once this step name no longer exists return this.crossDashboardState.testType == 'webkit_tests' || this.crossDashboardState.testType == 'webkit_layout_tests'; }, isGPUTestResults: function() { return this.crossDashboardState.testType == 'gpu_tests'; }, parseCrossDashboardParameters: function() { this.crossDashboardState = {}; var parameters = history.queryHashAsMap(); for (parameterName in history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES) this.parseParameter(parameters, parameterName); history._fillMissingValues(this.crossDashboardState, history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES); }, _parseDashboardSpecificParameters: function() { this.dashboardSpecificState = {}; var parameters = history.queryHashAsMap(); for (parameterName in this._defaultDashboardSpecificStateValues) this.parseParameter(parameters, parameterName); }, // TODO(jparent): Make private once callers move here. parseParameters: function() { var oldCrossDashboardState = this.crossDashboardState; var oldDashboardSpecificState = this.dashboardSpecificState; this.parseCrossDashboardParameters(); // Some parameters require loading different JSON files when the value changes. Do a reload. if (Object.keys(oldCrossDashboardState).length) { for (var key in this.crossDashboardState) { if (oldCrossDashboardState[key] != this.crossDashboardState[key] && history.reloadRequiringParameters.indexOf(key) != -1) { window.location.reload(); return false; } } } this._parseDashboardSpecificParameters(); var dashboardSpecificDiffState = history._diffStates(oldDashboardSpecificState, this.dashboardSpecificState); history._fillMissingValues(this.dashboardSpecificState, this._defaultDashboardSpecificStateValues); // FIXME: dashboard_base shouldn't know anything about specific dashboard specific keys. if (dashboardSpecificDiffState.builder) delete this.dashboardSpecificState.tests; if (this.dashboardSpecificState.tests) delete this.dashboardSpecificState.builder; var shouldGeneratePage = true; if (Object.keys(dashboardSpecificDiffState).length) shouldGeneratePage = this._handleQueryParameterChange(this, dashboardSpecificDiffState); return shouldGeneratePage; }, // TODO(jparent): Make private once callers move here. parseParameter: function(parameters, key) { if (!(key in parameters)) return; var value = parameters[key]; if (!this._handleValidHashParameterWrapper(key, value)) console.log("Invalid query parameter: " + key + '=' + value); }, // Takes a key and a value and sets the this.dashboardSpecificState[key] = value iff key is // a valid hash parameter and the value is a valid value for that key. Handles // cross-dashboard parameters then falls back to calling // handleValidHashParameter for dashboard-specific parameters. // // @return {boolean} Whether the key what inserted into the this.dashboardSpecificState. _handleValidHashParameterWrapper: function(key, value) { switch(key) { case 'testType': history.validateParameter(this.crossDashboardState, key, value, function() { return builders.testTypes.indexOf(value) != -1; }); return true; case 'useTestData': case 'showAllRuns': this.crossDashboardState[key] = value == 'true'; return true; default: return this._handleValidHashParameter(this, key, value); } }, queryParameterValue: function(parameter) { return this.dashboardSpecificState[parameter] || this.crossDashboardState[parameter]; }, // Sets the page state. Takes varargs of key, value pairs. setQueryParameter: function(var_args) { var queryParamsAsState = {}; for (var i = 0; i < arguments.length; i += 2) { var key = arguments[i]; queryParamsAsState[key] = arguments[i + 1]; } this.invalidateQueryParameters(queryParamsAsState); var newState = this._combinedDashboardState(); for (var key in queryParamsAsState) { newState[key] = queryParamsAsState[key]; } // Note: We use window.location.hash rather that window.location.replace // because of bugs in Chrome where extra entries were getting created // when back button was pressed and full page navigation was occuring. // FIXME: file those bugs. window.location.hash = this._permaLinkURLHash(newState); }, toggleQueryParameter: function(param) { this.setQueryParameter(param, !this.queryParameterValue(param)); }, invalidateQueryParameters: function(queryParamsAsState) { for (var key in queryParamsAsState) { if (this._dashboardSpecificInvalidatingParameters && key in this._dashboardSpecificInvalidatingParameters) delete this.dashboardSpecificState[this._dashboardSpecificInvalidatingParameters[key]]; } }, _joinParameters: function(stateObject) { var state = []; for (var key in stateObject) { var value = stateObject[key]; if (value != this._defaultValue(key)) state.push(key + '=' + encodeURIComponent(value)); } return state.join('&'); }, _permaLinkURLHash: function(opt_state) { var state = opt_state || this._combinedDashboardState(); return '#' + this._joinParameters(state); }, _combinedDashboardState: function() { var combinedState = Object.create(this.dashboardSpecificState); for (var key in this.crossDashboardState) combinedState[key] = this.crossDashboardState[key]; return combinedState; }, _defaultValue: function(key) { if (key in this._defaultDashboardSpecificStateValues) return this._defaultDashboardSpecificStateValues[key]; return history.DEFAULT_CROSS_DASHBOARD_STATE_VALUES[key]; }, _handleLocationChange: function() { if (this.parseParameters()) this._generatePage(this); } } })();
// // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Module dependencies. var azureCommon = require('./../../../common/common.core'); var Constants = azureCommon.Constants; var TableConstants = Constants.TableConstants; var HeaderConstants = Constants.HeaderConstants; var odataHandler = require('../internal/odatahandler'); exports = module.exports; exports.serialize = function (entity) { return odataHandler.serializeJson(entity); }; exports.parseQuery = function (response, autoResolveProperties, propertyResolver, entityResolver) { var result = {}; if (response.body) { result = odataHandler.parseJsonEntities(response.body, autoResolveProperties, propertyResolver, entityResolver); } return result; }; exports.parseEntity = function (response, autoResolveProperties, propertyResolver, entityResolver) { var result = {}; if (response.body) { result = odataHandler.parseJsonSingleEntity(response.body, autoResolveProperties, propertyResolver, entityResolver); } if (response.headers && response.headers[HeaderConstants.ETAG.toLowerCase()]) { if (!result[TableConstants.ODATA_METADATA_MARKER]) { result[TableConstants.ODATA_METADATA_MARKER] = {}; } result[TableConstants.ODATA_METADATA_MARKER].etag = response.headers[HeaderConstants.ETAG.toLowerCase()]; } return result; }; exports.getEtag = function (entity) { var etag; if (entity && entity[TableConstants.ODATA_METADATA_MARKER]) { etag = entity[TableConstants.ODATA_METADATA_MARKER].etag; } return etag; };
function Tiles() { this.tiles = $(".section-3 .tile-container"); this.onHover(); } Tiles.prototype = { constructor: Tiles, replaceText: function(text) { const textContainer = $(".section-3 .tile-change"); textContainer.text(text); }, onHover: function() { const tiles = this.tiles; const replaceText = this.replaceText; tiles.hover(function(){ if ($(this).attr("id") == "tile-1") { replaceText("pineapples"); } if ($(this).attr("id") == "tile-2") { replaceText("coffee beans"); } if ($(this).attr("id") == "tile-3") { replaceText("pandas"); } if ($(this).attr("id") == "tile-4") { replaceText("dolphins"); } }) } } function init() { new Tiles(); } document.addEventListener("DOMContentLoaded", function() { init(); }, false);
const express = require('express'); const cors = require('cors'); const userRoutes = require('./routes/userRoutes'); const strainRoutes = require('./routes/strainRoutes'); const server = express(); server.use(express.json()); server.use(cors()); server.use('/api/users', userRoutes); server.use('/api/strains', strainRoutes); module.exports = server;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // WARNING: This file was auto-generated, any change will be overridden in next release. Please use configs/es6.conf.js then run "npm run convert". // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// import { ArrowHelper } from '../helpers/ArrowHelper.js' import { Curve } from '../curves/Curve.js' import { Geometry } from '../core/Geometry.js' import { Object3D } from '../core/Object3D.js' import { ParametricGeometry } from './ParametricGeometry.js' import { Vector3 } from '../math/Vector3.js' /** * @author zz85 * * Experimenting of primitive geometry creation using Surface Parametric equations * */ var ParametricGeometries = { klein: function ( v, u, target ) { u *= Math.PI; v *= 2 * Math.PI; u = u * 2; var x, y, z; if ( u < Math.PI ) { x = 3 * Math.cos( u ) * ( 1 + Math.sin( u ) ) + ( 2 * ( 1 - Math.cos( u ) / 2 ) ) * Math.cos( u ) * Math.cos( v ); z = - 8 * Math.sin( u ) - 2 * ( 1 - Math.cos( u ) / 2 ) * Math.sin( u ) * Math.cos( v ); } else { x = 3 * Math.cos( u ) * ( 1 + Math.sin( u ) ) + ( 2 * ( 1 - Math.cos( u ) / 2 ) ) * Math.cos( v + Math.PI ); z = - 8 * Math.sin( u ); } y = - 2 * ( 1 - Math.cos( u ) / 2 ) * Math.sin( v ); target.set( x, y, z ); }, plane: function ( width, height ) { return function ( u, v, target ) { var x = u * width; var y = 0; var z = v * height; target.set( x, y, z ); }; }, mobius: function ( u, t, target ) { // flat mobius strip // http://www.wolframalpha.com/input/?i=M%C3%B6bius+strip+parametric+equations&lk=1&a=ClashPrefs_*Surface.MoebiusStrip.SurfaceProperty.ParametricEquations- u = u - 0.5; var v = 2 * Math.PI * t; var x, y, z; var a = 2; x = Math.cos( v ) * ( a + u * Math.cos( v / 2 ) ); y = Math.sin( v ) * ( a + u * Math.cos( v / 2 ) ); z = u * Math.sin( v / 2 ); target.set( x, y, z ); }, mobius3d: function ( u, t, target ) { // volumetric mobius strip u *= Math.PI; t *= 2 * Math.PI; u = u * 2; var phi = u / 2; var major = 2.25, a = 0.125, b = 0.65; var x, y, z; x = a * Math.cos( t ) * Math.cos( phi ) - b * Math.sin( t ) * Math.sin( phi ); z = a * Math.cos( t ) * Math.sin( phi ) + b * Math.sin( t ) * Math.cos( phi ); y = ( major + x ) * Math.sin( u ); x = ( major + x ) * Math.cos( u ); target.set( x, y, z ); } }; /********************************************* * * Parametric Replacement for TubeGeometry * *********************************************/ ParametricGeometries.TubeGeometry = function ( path, segments, radius, segmentsRadius, closed, debug ) { this.path = path; this.segments = segments || 64; this.radius = radius || 1; this.segmentsRadius = segmentsRadius || 8; this.closed = closed || false; if ( debug ) this.debug = new Object3D(); var scope = this, numpoints = this.segments + 1; var frames = path.computeFrenetFrames( segments, closed ), tangents = frames.tangents, normals = frames.normals, binormals = frames.binormals; // proxy internals this.tangents = tangents; this.normals = normals; this.binormals = binormals; var ParametricTube = function ( u, v, target ) { v *= 2 * Math.PI; var i = u * ( numpoints - 1 ); i = Math.floor( i ); var pos = path.getPointAt( u ); var tangent = tangents[ i ]; var normal = normals[ i ]; var binormal = binormals[ i ]; if ( scope.debug ) { scope.debug.add( new ArrowHelper( tangent, pos, radius, 0x0000ff ) ); scope.debug.add( new ArrowHelper( normal, pos, radius, 0xff0000 ) ); scope.debug.add( new ArrowHelper( binormal, pos, radius, 0x00ff00 ) ); } var cx = - scope.radius * Math.cos( v ); // TODO: Hack: Negating it so it faces outside. var cy = scope.radius * Math.sin( v ); pos.x += cx * normal.x + cy * binormal.x; pos.y += cx * normal.y + cy * binormal.y; pos.z += cx * normal.z + cy * binormal.z; target.copy( pos ); }; ParametricGeometry.call( this, ParametricTube, segments, segmentsRadius ); }; ParametricGeometries.TubeGeometry.prototype = Object.create( Geometry.prototype ); ParametricGeometries.TubeGeometry.prototype.constructor = ParametricGeometries.TubeGeometry; /********************************************* * * Parametric Replacement for TorusKnotGeometry * *********************************************/ ParametricGeometries.TorusKnotGeometry = function ( radius, tube, segmentsT, segmentsR, p, q ) { this.radius = radius || 200; this.tube = tube || 40; this.segmentsT = segmentsT || 64; this.segmentsR = segmentsR || 8; this.p = p || 2; this.q = q || 3; function TorusKnotCurve() { Curve.call( this ); } TorusKnotCurve.prototype = Object.create( Curve.prototype ); TorusKnotCurve.prototype.constructor = TorusKnotCurve; TorusKnotCurve.prototype.getPoint = function ( t, optionalTarget ) { var point = optionalTarget || new Vector3(); t *= Math.PI * 2; var r = 0.5; var x = ( 1 + r * Math.cos( q * t ) ) * Math.cos( p * t ); var y = ( 1 + r * Math.cos( q * t ) ) * Math.sin( p * t ); var z = r * Math.sin( q * t ); return point.set( x, y, z ).multiplyScalar( radius ); }; var segments = segmentsT; var radiusSegments = segmentsR; var extrudePath = new TorusKnotCurve(); ParametricGeometries.TubeGeometry.call( this, extrudePath, segments, tube, radiusSegments, true, false ); }; ParametricGeometries.TorusKnotGeometry.prototype = Object.create( Geometry.prototype ); ParametricGeometries.TorusKnotGeometry.prototype.constructor = ParametricGeometries.TorusKnotGeometry; /********************************************* * * Parametric Replacement for SphereGeometry * *********************************************/ ParametricGeometries.SphereGeometry = function ( size, u, v ) { function sphere( u, v, target ) { u *= Math.PI; v *= 2 * Math.PI; var x = size * Math.sin( u ) * Math.cos( v ); var y = size * Math.sin( u ) * Math.sin( v ); var z = size * Math.cos( u ); target.set( x, y, z ); } ParametricGeometry.call( this, sphere, u, v ); }; ParametricGeometries.SphereGeometry.prototype = Object.create( Geometry.prototype ); ParametricGeometries.SphereGeometry.prototype.constructor = ParametricGeometries.SphereGeometry; /********************************************* * * Parametric Replacement for PlaneGeometry * *********************************************/ ParametricGeometries.PlaneGeometry = function ( width, depth, segmentsWidth, segmentsDepth ) { function plane( u, v, target ) { var x = u * width; var y = 0; var z = v * depth; target.set( x, y, z ); } ParametricGeometry.call( this, plane, segmentsWidth, segmentsDepth ); }; ParametricGeometries.PlaneGeometry.prototype = Object.create( Geometry.prototype ); ParametricGeometries.PlaneGeometry.prototype.constructor = ParametricGeometries.PlaneGeometry; export { ParametricGeometries }
/** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * QUnit Config Object */ var myConfig = ({ title: 'File Mapper API', // Sets the title of the test page. requireExpects: false, hidepassed: false, }); /** * Registers QUnit helpers globally * Imports the following functions: * ok, equal, notEqual, deepEqual, notDeepEqual, strictEqual, * notStrictEqual, throws, module, test, asyncTest, expect */ QUnit.helpers(this); /** * HTML Test Report Generation Handler * @param {object} e The event parameter for a simple get trigger. */ function doGet(e) { // Ensures that QUnit-specific HTTP parameters are handled when you interact with the QUnit GUI QUnit.urlParams(e.parameter); QUnit.config(myConfig); QUnit.load(tests_all_APIs); return QUnit.getHtml(); }; /** * Generates test results upon execution of a menu add-on */ function displayTestResults() { // Setup the tests QUnit.urlParams({}); QUnit.config(myConfig); QUnit.load(run_all_tests); // Run the tests var html = QUnit.getHtml().setWidth(1000).setHeight(600); SpreadsheetApp.getUi().showModalDialog(html, 'File Mapper Unit Tests'); } /** * Created a test folder named Root with different files and folders in My Drive for testing all the APIs * Root * _________________________________|_____________________________________ * | | | | * Folder1 Folder2 Folder3 Folder4 * ____|___ | | _____|________ * | | | |-File31.docx | | * Folder11 |-File11.xls | |-File32.xls File41.xls Folder41 * |-File12.docx | |-File33.docx | * ________________|__________________ Folder411 * | | | | * Folder21 Folder22 Folder23 File4111.xls * | _____|____ | * File211.docx | | Folder231 * Folder221 |-File221.xls * |-File222.xls */ function run_all_tests() { TestUtil.clearAllMappingsInConfig(); tests_all_APIs_for_windows(); tests_all_APIs_for_unix(); } /** * Function containing all the Windows File System tests */ function tests_all_APIs_for_windows() { TestUtil.setWindowsTestingEnvironment(); add_mapping_api_windows_tests(); get_pattern_matches_api_windows_tests(); get_drive_id_api_windows_tests(); has_file_api_windows_tests(); create_file_api_windows_tests(); delete_file_api_windows_tests(); move_file_api_windows_tests(); copy_file_api_windows_tests(); } /** * Function containing all the Unix File System tests */ function tests_all_APIs_for_unix() { TestUtil.setUnixTestingEnvironment(); add_mapping_api_unix_tests(); get_pattern_matches_api_unix_tests(); get_drive_id_api_unix_tests(); has_file_api_unix_tests(); create_file_api_unix_tests(); delete_file_api_unix_tests(); move_file_api_unix_tests(); copy_file_api_unix_tests(); }
/** * @provides javelin-behavior-remarkup-preview * @requires javelin-behavior * javelin-dom * javelin-util * phabricator-shaped-request */ JX.behavior('remarkup-preview', function(config) { var preview = JX.$(config.previewID); var control = JX.$(config.controlID); var callback = function(r) { JX.DOM.setContent(preview, JX.$H(r)); }; var getdata = function() { return { text : control.value }; }; var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); var trigger = JX.bind(request, request.trigger); JX.DOM.listen(control, 'keydown', null, trigger); request.start(); trigger(); });
/** * Copyright IBM Corp. 2016, 2018 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import PropTypes from 'prop-types'; import React, { useEffect, useRef, useState } from 'react'; import cx from 'classnames'; import { Close, ErrorFilled, CheckmarkFilled, WarningFilled, WarningAltFilled, InformationFilled, InformationSquareFilled, } from '@carbon/icons-react'; import Button from '../Button'; import { usePrefix } from '../../internal/usePrefix'; export function NotificationActionButton({ children, className: customClassName, onClick, ...rest }) { const prefix = usePrefix(); const className = cx( customClassName, `${prefix}--inline-notification__action-button` ); return ( <Button className={className} kind="ghost" onClick={onClick} size="small" {...rest}> {children} </Button> ); } NotificationActionButton.propTypes = { /** * Specify the content of the notification action button. */ children: PropTypes.node, /** * Specify an optional className to be applied to the notification action button */ className: PropTypes.string, /** * Optionally specify a click handler for the notification action button. */ onClick: PropTypes.func, }; export function NotificationButton({ ariaLabel, className, iconDescription, type, renderIcon: IconTag, name, notificationType, ...rest }) { const prefix = usePrefix(); const buttonClassName = cx(className, { [`${prefix}--${notificationType}-notification__close-button`]: notificationType, }); const iconClassName = cx({ [`${prefix}--${notificationType}-notification__close-icon`]: notificationType, }); return ( <button {...rest} // eslint-disable-next-line react/button-has-type type={type} aria-label={iconDescription} title={iconDescription} className={buttonClassName}> {IconTag && ( <IconTag aria-label={ariaLabel} className={iconClassName} name={name} /> )} </button> ); } NotificationButton.propTypes = { /** * Specify a label to be read by screen readers on the notification button */ ariaLabel: PropTypes.string, /** * Specify an optional className to be applied to the notification button */ className: PropTypes.string, /** * Provide a description for "close" icon that can be read by screen readers */ iconDescription: PropTypes.string, /** * Specify an optional icon for the Button through a string, * if something but regular "close" icon is desirable */ name: PropTypes.string, /** * Specify the notification type */ notificationType: PropTypes.oneOf(['toast', 'inline']), /** * Optional prop to allow overriding the icon rendering. * Can be a React component class */ renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), /** * Optional prop to specify the type of the Button */ type: PropTypes.string, }; NotificationButton.defaultProps = { ariaLabel: 'close notification', // TODO: deprecate this prop notificationType: 'toast', type: 'button', iconDescription: 'close icon', renderIcon: Close, }; export function NotificationTextDetails({ title, subtitle, caption, notificationType, children, ...rest }) { const prefix = usePrefix(); if (notificationType === 'toast') { return ( <div {...rest} className={`${prefix}--toast-notification__details`}> <h3 className={`${prefix}--toast-notification__title`}>{title}</h3> <div className={`${prefix}--toast-notification__subtitle`}> {subtitle} </div> {caption && ( <div className={`${prefix}--toast-notification__caption`}> {caption} </div> )} {children} </div> ); } if (notificationType === 'inline') { return ( <div {...rest} className={`${prefix}--inline-notification__text-wrapper`}> <p className={`${prefix}--inline-notification__title`}>{title}</p> <div className={`${prefix}--inline-notification__subtitle`}> {subtitle} </div> {children} </div> ); } } NotificationTextDetails.propTypes = { /** * Specify the caption */ caption: PropTypes.node, /** * Pass in the children that will be rendered in NotificationTextDetails */ children: PropTypes.node, /** * Specify the notification type */ notificationType: PropTypes.oneOf(['toast', 'inline']), /** * Specify the sub-title */ subtitle: PropTypes.node, /** * Specify the title */ title: PropTypes.string, }; NotificationTextDetails.defaultProps = { title: 'title', notificationType: 'toast', }; const iconTypes = { error: ErrorFilled, success: CheckmarkFilled, warning: WarningFilled, ['warning-alt']: WarningAltFilled, info: InformationFilled, ['info-square']: InformationSquareFilled, }; function NotificationIcon({ iconDescription, kind, notificationType }) { const prefix = usePrefix(); const IconForKind = iconTypes[kind]; if (!IconForKind) { return null; } return ( <IconForKind className={`${prefix}--${notificationType}-notification__icon`}> <title>{iconDescription}</title> </IconForKind> ); } NotificationIcon.propTypes = { iconDescription: PropTypes.string.isRequired, kind: PropTypes.oneOf([ 'error', 'success', 'warning', 'warning-alt', 'info', 'info-square', ]).isRequired, notificationType: PropTypes.oneOf(['inline', 'toast']).isRequired, }; export function ToastNotification({ role, notificationType, onClose, onCloseButtonClick, iconDescription, statusIconDescription, className, caption, subtitle, title, kind, lowContrast, hideCloseButton, children, timeout, ...rest }) { const prefix = usePrefix(); const [isOpen, setIsOpen] = useState(true); const containerClassName = cx(className, { [`${prefix}--toast-notification`]: true, [`${prefix}--toast-notification--low-contrast`]: lowContrast, [`${prefix}--toast-notification--${kind}`]: kind, }); const handleClose = (evt) => { if (!onClose || onClose(evt) !== false) { setIsOpen(false); } }; function handleCloseButtonClick(event) { onCloseButtonClick(event); handleClose(event); } const savedOnClose = useRef(onClose); useEffect(() => { savedOnClose.current = onClose; }); useEffect(() => { if (!timeout) { return; } const timeoutId = window.setTimeout((event) => { setIsOpen(false); if (savedOnClose.current) { savedOnClose.current(event); } }, timeout); return () => { window.clearTimeout(timeoutId); }; }, [timeout]); if (!isOpen) { return null; } return ( <div {...rest} role={role} kind={kind} className={containerClassName}> <NotificationIcon notificationType={notificationType} kind={kind} iconDescription={statusIconDescription || `${kind} icon`} /> <NotificationTextDetails title={title} subtitle={subtitle} caption={caption} notificationType={notificationType}> {children} </NotificationTextDetails> {!hideCloseButton && ( <NotificationButton iconDescription={iconDescription} notificationType={notificationType} onClick={handleCloseButtonClick} /> )} </div> ); } ToastNotification.propTypes = { /** * Specify the caption */ caption: PropTypes.node, /** * Pass in the children that will be rendered within the ToastNotification */ children: PropTypes.node, /** * Specify an optional className to be applied to the notification box */ className: PropTypes.string, /** * Specify the close button should be disabled, or not */ hideCloseButton: PropTypes.bool, /** * Provide a description for "close" icon that can be read by screen readers */ iconDescription: PropTypes.string, /** * Specify what state the notification represents */ kind: PropTypes.oneOf([ 'error', 'info', 'info-square', 'success', 'warning', 'warning-alt', ]).isRequired, /** * Specify whether you are using the low contrast variant of the ToastNotification. */ lowContrast: PropTypes.bool, /** * By default, this value is "toast". You can also provide an alternate type * if it makes sense for the underlying `<NotificationTextDetails>` and `<NotificationButton>` */ notificationType: PropTypes.string, /** * Provide a function that is called when menu is closed */ onClose: PropTypes.func, /** * Provide a function that is called when the close button is clicked */ onCloseButtonClick: PropTypes.func, /** * By default, this value is "alert". You can also provide an alternate * role if it makes sense from the accessibility-side */ role: PropTypes.string.isRequired, /** * Provide a description for "status" icon that can be read by screen readers */ statusIconDescription: PropTypes.string, /** * Specify the sub-title */ subtitle: PropTypes.node, /** * Specify an optional duration the notification should be closed in */ timeout: PropTypes.number, /** * Specify the title */ title: PropTypes.string.isRequired, }; ToastNotification.defaultProps = { kind: 'error', title: 'provide a title', role: 'alert', notificationType: 'toast', iconDescription: 'closes notification', onCloseButtonClick: () => {}, hideCloseButton: false, timeout: 0, }; export function InlineNotification({ actions, role, notificationType, onClose, onCloseButtonClick, iconDescription, statusIconDescription, className, subtitle, title, kind, lowContrast, hideCloseButton, children, ...rest }) { const prefix = usePrefix(); const [isOpen, setIsOpen] = useState(true); const containerClassName = cx(className, { [`${prefix}--inline-notification`]: true, [`${prefix}--inline-notification--low-contrast`]: lowContrast, [`${prefix}--inline-notification--${kind}`]: kind, [`${prefix}--inline-notification--hide-close-button`]: hideCloseButton, }); const handleClose = (evt) => { if (!onClose || onClose(evt) !== false) { setIsOpen(false); } }; function handleCloseButtonClick(event) { onCloseButtonClick(event); handleClose(event); } if (!isOpen) { return null; } return ( <div {...rest} role={role} kind={kind} className={containerClassName}> <div className={`${prefix}--inline-notification__details`}> <NotificationIcon notificationType={notificationType} kind={kind} iconDescription={statusIconDescription || `${kind} icon`} /> <NotificationTextDetails title={title} subtitle={subtitle} notificationType={notificationType}> {children} </NotificationTextDetails> </div> {actions} {!hideCloseButton && ( <NotificationButton iconDescription={iconDescription} notificationType={notificationType} onClick={handleCloseButtonClick} /> )} </div> ); } InlineNotification.propTypes = { /** * Pass in the action nodes that will be rendered within the InlineNotification */ actions: PropTypes.node, /** * Pass in the children that will be rendered within the InlineNotification */ children: PropTypes.node, /** * Specify an optional className to be applied to the notification box */ className: PropTypes.string, /** * Specify the close button should be disabled, or not */ hideCloseButton: PropTypes.bool, /** * Provide a description for "close" icon that can be read by screen readers */ iconDescription: PropTypes.string, /** * Specify what state the notification represents */ kind: PropTypes.oneOf([ 'error', 'info', 'info-square', 'success', 'warning', 'warning-alt', ]).isRequired, /** * Specify whether you are using the low contrast variant of the InlineNotification. */ lowContrast: PropTypes.bool, /** * By default, this value is "inline". You can also provide an alternate type * if it makes sense for the underlying `<NotificationTextDetails>` and `<NotificationButton>` */ notificationType: PropTypes.string, /** * Provide a function that is called when menu is closed */ onClose: PropTypes.func, /** * Provide a function that is called when the close button is clicked */ onCloseButtonClick: PropTypes.func, /** * By default, this value is "alert". You can also provide an alternate * role if it makes sense from the accessibility-side */ role: PropTypes.string.isRequired, /** * Provide a description for "status" icon that can be read by screen readers */ statusIconDescription: PropTypes.string, /** * Specify the sub-title */ subtitle: PropTypes.node, /** * Specify the title */ title: PropTypes.string.isRequired, }; InlineNotification.defaultProps = { role: 'alert', notificationType: 'inline', iconDescription: 'closes notification', onCloseButtonClick: () => {}, hideCloseButton: false, };
// ==UserScript== // @author dylanarmstrong // @description Fix for chessboard images not working on Safari // @grant none // @match https://*.wikipedia.org/* // @name wikipedia-chess // @namespace https://github.com/dylanarmstrong/userscripts/ // @supportURL https://github.com/dylanarmstrong/userscripts/issues // @updateURL https://raw.githubusercontent.com/dylanarmstrong/userscripts/master/wikipedia-chess.js // @version 1 // ==/UserScript== (function() { 'use strict'; const els = document.getElementsByClassName('chess-board'); const svg = 'https://upload.wikimedia.org/wikipedia/commons/d/d7/Chessboard480.svg'; const each = (el) => { const old = el.querySelector('img'); const img = document.createElement('img'); img.src = svg; img.alt = old.alt; img.width = old.width; img.height = old.height; old.parentNode.replaceChild(img, old); }; Array.prototype.forEach.call(els, each); })();
module.exports={viewBox:'0 0 256 512',d:'M88 166.059V468c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12V166.059h46.059c21.382 0 32.09-25.851 16.971-40.971l-86.059-86.059c-9.373-9.373-24.569-9.373-33.941 0l-86.059 86.059c-15.119 15.119-4.411 40.971 16.971 40.971H88z'}
import { useDispatch, useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import { Box } from '@material-ui/core'; import Book from '../components/Book'; import { changeFilter, removeBook } from '../actions'; import CategoryFilter from '../components/CategoryFilter'; const BooksList = () => { const books = useSelector((state) => state.bookReducer); const categories = useSelector((state) => state.filterReducer); const dispatch = useDispatch(); const handleRemoveBook = (book) => { dispatch(removeBook(book)); }; const handleFilterChange = (category) => dispatch(changeFilter(category)); return ( <div> <CategoryFilter filterHandler={handleFilterChange} /> <Box> { books.filter((book) => (categories === 'All' ? books : book.category === categories)).map((book, index) => ( <Box key={book.id}> <Book book={book} id={index + 1} removeBookHandler={ (book) => handleRemoveBook(book)} /> </Box> )) } </Box> </div> ); }; BooksList.propTypes = { books: PropTypes.array, }; BooksList.defaultProps = { books: [], }; export default BooksList;
import React from 'react' import PropTypes from 'prop-types' import ReactMarkdown from 'react-markdown' import { connect } from 'react-redux' import Layout from '../layout' import { Loader } from '../../components' import styles from './styles.css' class DetailPage extends React.Component { static propTypes = { match: PropTypes.object.isRequired } componentDidMount() { const { createArticleAction, article, match, body, fetching } = this.props const regex = new RegExp(`\/?${process.env.PUBLIC_URL}\/?`) const articlePath = match.url.replace(regex, '/') if (!body && !fetching) { createArticleAction([articlePath, 'article.md']) } } render() { const { module, name, fetching, body, title } = this.props if (fetching || !body) { return <Loader /> } return ( <Layout className="articles-detail"> <div className={styles.markdownWrap}> <h1 className={styles.h1}>{title}</h1> <ReactMarkdown source={body} /> </div> </Layout> ) } } const mapStateToProps = state => { const { common } = state return { common } } export default connect(mapStateToProps)(DetailPage)
import styled from "@emotion/styled/macro"; import Logo from "./Logo"; import MenuIcon from "./MenuIcon"; const Root = styled.nav` top: 0; position: fixed; z-index: 9901; display: flex; flex-direction: column; overflow-y: scroll; height: -webkit-fill-available; touch-action: none; pointer-events: none; transition: all 0.56s cubic-bezier(0.52, 0.16, 0.24, 1); justify-content: flex-start; color: var(--systemSecondary); width: 100%; /* height: -webkit-fill-available; */ height: 100%; @media (min-width: 767px) { height: 100%; position: static; overflow-y: auto; display: flex; flex-direction: column; border-right: solid 1px rgba(0, 0, 0, 0.1); } `; const Header = styled.div` height: 44px; display: flex; align-items: center; background-color: var(--sidebar-background-color); pointer-events: initial; transition: all 0.3s ease-out; justify-content: center; @media (min-width: 767px) { height: auto; justify-content: initial; button { display: none; } } `; const Scrollable = styled.div` overflow: auto; transition: all 0.3s ease-out; height: 100%; z-index: 9902; background-color: var(--sidebar-background-color); transform: ${({ open }) => (open ? " translateX(0)" : " translateX(-767px)")}; pointer-events: initial; display: flex; flex-direction: column; height: -webkit-fill-available; height: 100vh; @media (min-width: 767px) { transform: translateX(0); } `; const Sidebar = ({ children, vendor, open, setOpen, footer }) => { return ( <Root open={open}> <Header> <MenuIcon onClick={() => setOpen(!open)} open={open} /> <Logo vendor={vendor} /> </Header> <Scrollable open={open}> {children} {/* {footer} */} </Scrollable> </Root> ); }; export default Sidebar;
// @flow import type { InternalQueryAnyFunctionType, } from '../types'; import { createQueryId, } from '../utilities'; import query from './query'; /** * Makes a query and expects any number of results. */ const any: InternalQueryAnyFunctionType = async (log, connection, clientConfiguration, rawSql, values, inheritedQueryId) => { const queryId = inheritedQueryId || createQueryId(); const { rows, } = await query(log, connection, clientConfiguration, rawSql, values, queryId); return rows; }; export default any;
/** * Handles the styles document. This is the go to class for parsing the styles * xml page. */ goog.provide('jsopenxml.styles.StyleSheet'); //----------------------------------------------------------------------------// //--- Automatically generated to provide intellisense for visual studio, -----// //--- please do not edit manually. -------------------------------------------// //----------------------------------------------------------------------------// window.jsopenxml = window.jsopenxml || {}; window.jsopenxml.styles = window.jsopenxml.styles || {}; //--- intellisense end -------------------------------------------------------// window.jsopenxml = window.jsopenxml || {}; goog.require('jsopenxml.styles.CellStyle'); goog.require('jsopenxml.styles.Xf'); goog.require('jsopenxml.styles.Fill'); goog.require('jsopenxml.styles.CellXfs'); goog.require('jsopenxml.styles.CellStyleXfs'); goog.require('jsopenxml.styles.Fills'); goog.require('jsopenxml.styles.Fonts'); goog.require('jsopenxml.styles.Borders'); /** * @constructor */ jsopenxml.styles.StyleSheet = function (stylesDocument, openXmlDocument) { if (stylesDocument.nodeName && stylesDocument.nodeName == "styleSheet") { // The PresetCellStyles class needs to construct a StyleSheet object // directly from the element without using a document. this.element = stylesDocument; } else { this.document = stylesDocument; this.element = this.document.firstChild; } // If the first node is a processing instruction, skip over it. This occurs // in IE 11, the first node is the xml declaration node. if (this.element.nodeType == 7) { this.element = this.element.nextSibling; } this.openXmlDocument = openXmlDocument; goog.array.forEach(this.element.childNodes, function (childElement) { switch (childElement.nodeName) { case "cellStyles": this.cellStyles = childElement; break; case "cellStyleXfs": this.cellStyleXfs = new jsopenxml.styles.CellStyleXfs(childElement); break; case "cellXfs": this.cellXfs = new jsopenxml.styles.CellXfs(childElement); break; case "fills": this.fills = new jsopenxml.styles.Fills(childElement, this.openXmlDocument); break; case "fonts": this.fonts = new jsopenxml.styles.Fonts(childElement, this.openXmlDocument); break; case "borders": this.borders = new jsopenxml.styles.Borders(childElement); break; } }, this); }; /** * Get the cell style * @param {Number} The cell style index * @returns {jsopenxml.styles.CellStyle} */ jsopenxml.styles.StyleSheet.prototype.getCellStyle = function (index) { // TODO Update this to worth the same way with an instance used like // getCellFx or getCellStyleFx throw "Needs updating to not create a new instance every time, should " + "reference an existing instance."; var cellStyleElement = this.cellStyles.childNodes[index]; return new jsopenxml.styles.CellStyle(cellStyleElement, this); }; /** * Get an xf record from the cellStyleXfs element * @returns {jsopenxml.styles.Xf} An xf element */ jsopenxml.styles.StyleSheet.prototype.getCellStyleXf = function (index) { return this.cellStyleXfs.getChild(index); }; /** * Get an xf record from the cellXfs element. These are what individual * cells in the worksheet reference. * @returns {jsopenxml.styles.Xf} An xf element */ jsopenxml.styles.StyleSheet.prototype.getCellXf = function (index) { return this.cellXfs.getChild(index); }; /** * Get a fill element * @param {Number} index * @returns {jsopenxml.styles.Fill} */ jsopenxml.styles.StyleSheet.prototype.getFill = function (index) { return this.fills.getChild(index); }; /** * Get cell fill * @param {jsopenxml.workbook.C} cell * @returns {string|null} If the cell doesn't have a specific fill will return * null, this doesn't mean the row or column doesn't have a default fill. * TODO Does not cater for pattern fills. */ jsopenxml.styles.StyleSheet.prototype.getCellFill = function (cell) { throw "Method needs removing or updating."; /*var styleIndex = cell.getStyleIndex(); if (!styleIndex) return null; var xf = this.getCellXf(styleIndex); // Should fill be applied if (!xf.applyFill) return; var fillId = xf.getFillId("fillId"); var fill = this.getFill(fillId); return fill.getColour();*/ }; /** * Get font * @param {number} index * @return {jsopenxml.styles.Font} */ jsopenxml.styles.StyleSheet.prototype.getFont = function (index) { return this.fonts.getChild(index); }; /** * Get a border element * @param {Number} index * @returns {jsopenxml.styles.Border} */ jsopenxml.styles.StyleSheet.prototype.getBorder = function (index) { return this.borders.getChild(index); };