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], '&')
.replace(encodeRegExp[1], '"')
.replace(encodeRegExp[2], ''')
.replace(encodeRegExp[3], '<')
.replace(encodeRegExp[4], '>');
};
})();
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?
<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
},
},
]);
|