code stringlengths 2 1.05M |
|---|
const { authenticate } = require('feathers-authentication').hooks;
const hooks = require('feathers-authentication-hooks');
const { populate, iff } = require('feathers-hooks-common');
const commonHooks = require('feathers-hooks-common');
const popSchema = {
include: [
{
service: 'comments',
nameAs: 'comments',
parentField: '_id',
childField: 'event'
},
{
service: 'users',
nameAs: 'user',
parentField: 'userId',
childField: '_id'
},
{
service: 'photos',
nameAs: 'photos',
parentField: 'photos',
childField: '_id'
}
]
};
module.exports = {
before: {
all: [ authenticate('jwt') ],
find: [],
get: [],
create: [hooks.queryWithCurrentUser()],
update: [
iff(hook => !hook.params.user.roles.contains('admin'), [commonHooks.disableMultiItemChange(), commonHooks.preventChanges('_id'),
commonHooks.preventChanges('userId')]),
hooks.restrictToRoles({
roles: ['admin', 'moderator'],
owner: true
})],
patch: [
iff(hook => !hook.params.user.roles.contains('admin'), [commonHooks.disableMultiItemChange(), commonHooks.preventChanges('_id'),
commonHooks.preventChanges('userId')]),
hooks.restrictToRoles({
roles: ['admin', 'moderator'],
owner: true
})],
remove: [hooks.restrictToRoles({
roles: ['admin', 'moderator'],
owner: true
})]
},
after: {
all: [],
find: [populate({schema: popSchema})],
get: [populate({schema: popSchema})],
create: [],
update: [],
patch: [],
remove: []
},
error: {
all: [],
find: [],
get: [],
create: [],
update: [],
patch: [],
remove: []
}
};
|
// oxy.io
// Files: oxyio/webpacks/base/js/selects.js
// Desc: handle <select> form elements
import selectedJS from 'selected.js';
function handleSelectDefault($select) {
$select.addEventListener('change', (ev) => {
let $target = ev.target;
if ($target.value === '')
$target.classList.add('empty');
else
$target.classList.remove('empty');
});
if ($select.value === '')
$select.classList.add('empty');
};
window.addEventListener('load', () => {
// Convert multiselects into something usable with selected.js
selectedJS.init('[multiple]');
// Handle default/blank status on others
_.each(document.querySelectorAll('select'), ($select) => {
if (!$select.multiple)
handleSelectDefault($select);
});
});
|
/* eslint-disable no-console */
const Sentry = require('@sentry/node')
const express = require('express')
const cors = require('cors')
const path = require('path')
const zmdVersion = require('../package.json').version
Sentry.init({
dsn: process.env.SENTRY_DSN,
release: process.env.SENTRY_RELEASE || zmdVersion,
environment: process.env.SENTRY_ENVIRONMENT || process.env.ZDS_ENVIRONMENT,
})
const app = express()
// Sentry error handling
app.use(Sentry.Handlers.requestHandler())
app.use(Sentry.Handlers.errorHandler())
app.use(cors())
// Expose an image for tests
if (process.env.ZMD_ENV !== 'production') {
app.use('/static', express.static(path.join(__dirname, 'static')))
}
// Depend on routers
app.use('/', require('./routes/endpoints'))
app.use('/munin', require('./routes/munin'))
const server = app.listen(process.env.PORT || 27272, () => {
const host = server.address().address
const port = server.address().port
console.log('zmarkdown server listening at http://%s:%s', host, port)
})
|
module.exports = {
options: {
logConcurrentOutput: true
},
all: ['watch', 'browserify:watch']
};
|
// Regular expression that matches all symbols in the `Coptic` script as per Unicode v6.2.0:
/[\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF]/; |
'use strict'
var Order = require('./order.schema');
// NodeJS does not support import/export till now
module.exports = class OrderService {
constructor() {
// Bind the functions to class
this.saveOrder = this.saveOrder.bind(this);
this.getOrders = this.getOrders.bind(this);
this.getOrderById = this.getOrderById.bind(this);
}
saveOrder(req, res){
var newOrder = new Order({
orderId: req.body.orderId,
orderName: req.body.orderName,
billAmount: req.body.billAmount,
orderType: req.body.orderType,
paymentType: req.body.paymentType,
deliveryType: req.body.deliveryType,
paid: true
});
newOrder.save(function(err) {
if (err) return next(err);
res.send({ message: ' Order has been added successfully!' });
});
}
getOrders(req, res){
Order
.find()
.select('orderId orderName billAmount orderType paymentType deliveryType')
.exec(function(err, orders) {
if (err) return next(err);
if(!orders){
return res.status(404).send({ message: 'No Orders Found.' });
}
res.send(orders);
});
}
getOrderById(req, res){
var id = req.params.id;
Order.findOne({ orderId: id }, function(err, order) {
if (err) return next(err);
if (!order) {
return res.status(404).send({ message: 'Order not found.' });
}
res.send(order);
});
}
getFilteredOrders(req, res){
var conditions = {};
if(req.body.paymentType)
{
conditions["paymentType"] = req.body.paymentType;
}
if(req.body.orderType)
{
conditions["orderType"] = req.body.orderType;
}
Order
.find(conditions)
.limit(100)
.select('orderId orderName billAmount orderType paymentType deliveryType')
.exec(function(err, orders) {
if (err) return next(err);
if(!orders){
return res.status(404).send({ message: 'No Orders Found.' });
}
res.send(orders);
});
}
} |
export function createSnapshot (doc) {
// defaults everything to false, so no need to set
return Object.defineProperty(doc.data(), 'id', {
value: doc.id,
})
}
const isObject = o => o && typeof o === 'object'
const isTimestamp = o => o.toDate
const isRef = o => o && o.onSnapshot
export function extractRefs (doc, oldDoc, path = '', result = [{}, {}]) {
// must be set here because walkGet can return null or undefined
oldDoc = oldDoc || {}
const idDescriptor = Object.getOwnPropertyDescriptor(doc, 'id')
if (idDescriptor && !idDescriptor.enumerable) {
Object.defineProperty(result[0], 'id', idDescriptor)
}
return Object.keys(doc).reduce((tot, key) => {
const ref = doc[key]
// if it's a ref
if (isRef(ref)) {
tot[0][key] = oldDoc[key] || ref.path
tot[1][path + key] = ref
} else if (Array.isArray(ref)) {
tot[0][key] = Array(ref.length).fill(null)
extractRefs(ref, oldDoc[key], path + key + '.', [tot[0][key], tot[1]])
} else if (
ref == null ||
// Firestore < 4.13
ref instanceof Date ||
isTimestamp(ref) ||
(ref.longitude && ref.latitude) // GeoPoint
) {
tot[0][key] = ref
} else if (isObject(ref)) {
tot[0][key] = {}
extractRefs(ref, oldDoc[key], path + key + '.', [tot[0][key], tot[1]])
} else {
tot[0][key] = ref
}
return tot
}, result)
}
export function callOnceWithArg (fn, argFn) {
let called
return () => {
if (!called) {
called = true
return fn(argFn())
}
}
}
export function walkGet (obj, path) {
return path.split('.').reduce((target, key) => target[key], obj)
}
export function walkSet (obj, path, value) {
// path can be a number
const keys = ('' + path).split('.')
const key = keys.pop()
const target = keys.reduce((target, key) => target[key], obj)
// global isFinite is different from Number.isFinite
// it converts values to numbers
if (isFinite(key)) target.splice(key, 1, value)
else target[key] = value
}
|
function displayMWError() {
kony.ui.Alert("Middleware Error ", null, "error", null, null);
};
function displaySessionError() {
kony.ui.Alert("Session Expired .. Please re-login", null, "error", null, null);
};
function displayError(code, msg) {
// Commented for SWA: kony.ui.Alert("Error Code: "..code .." Message: " ..msg,null,"error",null,null);
kony.ui.Alert(code + "- " + msg, null, "error", null, null);
};
var mergeHeaders = function(httpHeaders, globalHeaders) {
for (var attrName in globalHeaders) {
httpHeaders[attrName] = globalHeaders[attrName];
}
return httpHeaders;
};
function appmiddlewareinvoker(inputParam, isBlocking, indicator, datasetID) {
var url = appConfig.url;
var sessionIdKey = "cacheid";
inputParam.appID = appConfig.appId;
inputParam.appver = appConfig.appVersion;
inputParam["channel"] = "rc";
inputParam["platform"] = kony.os.deviceInfo().name;
if (indicator) {
inputParam["indicator"] = indicator;
};
if (datasetID) {
inputParam["datasetID"] = datasetID;
};
inputParam[sessionIdKey] = sessionID;
if (globalhttpheaders) {
if (inputParam["httpheaders"]) {
inputParam.httpheaders = mergeHeaders(inputParam.httpheaders, globalhttpheaders);
} else {
inputParam["httpheaders"] = globalhttpheaders;
};
};
var resulttable = _invokeServiceSyncForMF_(url, inputParam, isBlocking);
if (resulttable) {
if (resulttable[sessionIdKey]) {
sessionID = resulttable[sessionIdKey];
};
};
return resulttable;
};
function appmiddlewaresecureinvoker(inputParam, isBlocking, indicator, datasetID) {
var url = appConfig.secureurl;
var sessionIdKey = "cacheid";
inputParam.appID = appConfig.appId;
inputParam.appver = appConfig.appVersion;
inputParam["channel"] = "rc";
inputParam["platform"] = kony.os.deviceInfo().name;
if (indicator) {
inputParam["indicator"] = indicator;
};
if (datasetID) {
inputParam["datasetID"] = datasetID;
};
inputParam[sessionIdKey] = sessionID;
if (globalhttpheaders) {
if (inputParam["httpheaders"]) {
inputParam.httpheaders = mergeHeaders(inputParam.httpheaders, globalhttpheaders);
} else {
inputParam["httpheaders"] = globalhttpheaders;
};
};
var resulttable = _invokeServiceSyncForMF_(url, inputParam, isBlocking);
if (resulttable) {
if (resulttable[sessionIdKey]) {
sessionID = resulttable[sessionIdKey];
};
};
return resulttable;
};
function appmiddlewareinvokerasync(inputParam, callBack) {
var url = appConfig.url;
var sessionIdKey = "cacheid";
inputParam.appID = appConfig.appId;
inputParam.appver = appConfig.appVersion;
inputParam["channel"] = "rc";
inputParam["platform"] = kony.os.deviceInfo().name;
inputParam[sessionIdKey] = sessionID;
if (globalhttpheaders) {
if (inputParam["httpheaders"]) {
inputParam.httpheaders = mergeHeaders(inputParam.httpheaders, globalhttpheaders);
} else {
inputParam.httpheaders = globalhttpheaders;
};
};
var connHandle = _invokeServiceAsyncForMF_(url, inputParam, callBack);
return connHandle;
};
function appmiddlewaresecureinvokerasync(inputParam, callBack) {
var url = appConfig.secureurl;
var sessionIdKey = "cacheid";
inputParam.appID = appConfig.appId;
inputParam.appver = appConfig.appVersion;
inputParam["channel"] = "rc";
inputParam["platform"] = kony.os.deviceInfo().name;
inputParam[sessionIdKey] = sessionID;
if (globalhttpheaders) {
if (inputParam["httpheaders"]) {
inputParam.httpheaders = mergeHeaders(inputParam.httpheaders, globalhttpheaders);
} else {
inputParam["httpheaders"] = globalhttpheaders;
};
};
var connHandle = _invokeServiceAsyncForMF_(url, inputParam, callBack);
return connHandle;
};
function mfgetidentityservice(idProviderName) {
var currentInstance = kony.sdk.getCurrentInstance();
if (!currentInstance) {
throw new Exception("INIT_FAILURE", "Please call init before getting identity provider");
}
return currentInstance.getIdentityService(idProviderName);
};
function mfintegrationsecureinvokerasync(inputParam, serviceID, operationID, callBack) {
var url = appConfig.secureurl;
var sessionIdKey = "cacheid";
inputParam.appID = appConfig.appId;
inputParam.appver = appConfig.appVersion;
inputParam["channel"] = "rc";
inputParam["platform"] = kony.os.deviceInfo().name;
inputParam[sessionIdKey] = sessionID;
if (globalhttpheaders) {
if (inputParam["httpheaders"]) {
inputParam.httpheaders = mergeHeaders(inputParam.httpheaders, globalhttpheaders);
} else {
inputParam["httpheaders"] = mergeHeaders({}, globalhttpheaders);
};
};
kony.print("Async : Invoking service through mobileFabric with url : " + url + " service id : " + serviceID + " operationid : " + operationID + "\n input params" + JSON.stringify(inputParam));
if (kony.mbaas) {
kony.mbaas.invokeMbaasServiceFromKonyStudio(url, inputParam, serviceID, operationID, callBack);
} else {
alert("Unable to find the mobileFabric SDK for KonyStudio. Please download the SDK from the Kony Cloud Console and add as module to the Kony Project.");
}
};
function mfintegrationsecureinvokersync(inputParam, serviceID, operationID) {
var url = appConfig.secureurl;
var sessionIdKey = "cacheid";
var resulttable;
inputParam.appID = appConfig.appId;
inputParam.appver = appConfig.appVersion;
inputParam["channel"] = "rc";
inputParam["platform"] = kony.os.deviceInfo().name;
inputParam[sessionIdKey] = sessionID;
if (globalhttpheaders) {
if (inputParam["httpheaders"]) {
inputParam.httpheaders = mergeHeaders(inputParam.httpheaders, globalhttpheaders);
} else {
inputParam["httpheaders"] = mergeHeaders({}, globalhttpheaders);
};
};
kony.print("Invoking service through mobileFabric with url : " + url + " service id : " + serviceID + " operationid : " + operationID + "\n input params" + JSON.stringify(inputParam));
if (kony.mbaas) {
resulttable = kony.mbaas.invokeMbaasServiceFromKonyStudioSync(url, inputParam, serviceID, operationID);
kony.print("Result table for service id : " + serviceID + " operationid : " + operationID + " : " + JSON.stringify(resulttable));
} else {
alert("Unable to find the mobileFabric SDK for KonyStudio. Please download the SDK from the Kony Cloud Console and add as module to the Kony Project.");
}
return resulttable;
};
_invokeServiceAsyncForMF_ = function(url, inputParam, callBack) {
var operationID = inputParam["serviceID"];
if (!operationID) {
resulttable = kony.net.invokeServiceAsync(url, inputParam, callBack);
} else {
var _mfServicesMap_ = {};
kony.print("Getting serviceID for : " + operationID);
var serviceID = _mfServicesMap_[operationID] && _mfServicesMap_[operationID]["servicename"];
kony.print("Got serviceID for : " + operationID + " : " + serviceID);
kony.print("Async : Invoking service through mobileFabric with url : " + url + " service id : " + serviceID + " operationid : " + operationID + "\n input params" + JSON.stringify(inputParam));
if (serviceID && operationID) {
var url = appConfig.secureurl;
if (kony.mbaas) {
kony.mbaas.invokeMbaasServiceFromKonyStudio(url, inputParam, serviceID, operationID, callBack);
} else {
alert("Unable to find the mobileFabric SDK for KonyStudio. Please download the SDK from the Kony Cloud Console and add as module to the Kony Project.");
}
} else {
resulttable = kony.net.invokeServiceAsync(url, inputParam, callBack);
}
}
};
_invokeServiceSyncForMF_ = function(url, inputParam, isBlocking) {
var resulttable;
var operationID = inputParam["serviceID"];
if (!operationID) {
resulttable = kony.net.invokeService(url, inputParam, isBlocking);
} else {
var _mfServicesMap_ = {};
kony.print("Getting serviceID for : " + operationID);
var serviceID = _mfServicesMap_[operationID] && _mfServicesMap_[operationID]["servicename"];
kony.print("Got serviceID for : " + operationID + " : " + serviceID);
kony.print("Invoking service through mobileFabric with url : " + url + " service id : " + serviceID + " operationid : " + operationID + "\n input params" + JSON.stringify(inputParam));
if (serviceID && operationID) {
var url = appConfig.secureurl;
if (kony.mbaas) {
resulttable = kony.mbaas.invokeMbaasServiceFromKonyStudioSync(url, inputParam, serviceID, operationID);
kony.print("Result table for service id : " + serviceID + " operationid : " + operationID + " : " + JSON.stringify(resulttable));
} else {
alert("Unable to find the mobileFabric SDK for KonyStudio. Please download the SDK from the Kony Cloud Console and add as module to the Kony Project.");
}
} else {
resulttable = kony.net.invokeService(url, inputParam, isBlocking);
}
}
return resulttable;
};
/*
Sample invocation code
var inputparam = {};
inputparam.options = {
"access": "online",
"CRUD_TYPE": "get",//get/create..
"odataurl": "$filter=UserId eq xxx",
"data" : {a:1,b:2}//in case of create/update
};
*/
function mfobjectsecureinvokerasync(inputParam, serviceID, objectID, callBack) {
var options = {
"access": inputParam.options.access
};
var serviceObj = kony.sdk.getCurrentInstance().getObjectService(serviceID, options);
var CRUD_TYPE = inputParam.options.CRUD_TYPE;
switch (CRUD_TYPE) {
case 'get':
var dataObject = new kony.sdk.dto.DataObject(objectID);
var headers = inputParam.httpheaders || {};
if (inputParam.options && inputParam.options.odataurl) dataObject.setOdataUrl(inputParam.options.odataurl.toString());
options = {
"dataObject": dataObject,
"headers": headers
};
serviceObj.fetch(options, callBack, callBack);
break;
case 'create':
var dataObject = new kony.sdk.dto.DataObject(objectID);
var headers = inputParam.httpheaders || {};
var data = inputParam.options && inputParam.options.data || {};
var key;
for (key in data) {
dataObject.addField(key, data[key]);
}
options = {
"dataObject": dataObject,
"headers": headers
};
serviceObj.create(options, callBack, callBack);
break;
case 'update':
var dataObject = new kony.sdk.dto.DataObject(objectID);
var headers = inputParam.httpheaders || {};
var data = inputParam.options && inputParam.options.data || {};
var key;
for (key in data) {
dataObject.addField(key, data[key]);
}
options = {
"dataObject": dataObject,
"headers": headers
};
serviceObj.update(options, callBack, callBack);
break;
case 'partialupdate':
var dataObject = new kony.sdk.dto.DataObject(objectID);
var headers = inputParam.httpheaders || {};
var data = inputParam.options && inputParam.options.data || {};
var key;
for (key in data) {
dataObject.addField(key, data[key]);
}
options = {
"dataObject": dataObject,
"headers": headers
};
serviceObj.partialUpdate(options, callBack, callBack);
break;
case 'delete':
var dataObject = new kony.sdk.dto.DataObject(objectID);
var headers = inputParam.httpheaders || {};
var data = inputParam.options && inputParam.options.data || {};
var key;
for (key in data) {
dataObject.addField(key, data[key]);
}
options = {
"dataObject": dataObject,
"headers": headers
};
serviceObj.deleteRecord(options, callBack, callBack);
break;
default:
}
};
function appmenuseq() {
frmHome.show();
};
function callAppMenu() {
var appMenu = [
["appmenuitemid1", "Item 1", "option1.png", appmenuseq,
{}],
["appmenuitemid2", "Item 2", "option2.png", appmenuseq,
{}],
["appmenuitemid3", "Item 3", "option3.png", appmenuseq,
{}],
["appmenuitemid4", "Item 4", "option4.png", appmenuseq,
{}]
];
kony.application.createAppMenu("sampAppMenu", appMenu, "", "");
kony.application.setCurrentAppMenu("sampAppMenu");
};
function makeCall(eventobject) {
kony.phone.dial(eventobject.text);
};
function initializeGlobalVariables() {}; |
import Post from '../layouts/post'
import Code from '../components/code'
import Snippet from '../components/snippet'
import posts from '../posts'
const props = posts.find(p => p.slug === 'plugins-recomendados-para-vim-neovim')
export default () => (
<Post {...props}>
<p>
En estos momentos mi editor de código favorito es Neovim una versión
moderna de Vim, hoy describiré algunos plugins que uso diariamente y una
que otra de mis configuraciones.
</p>
<h2>Esquema de colores</h2>
<p>
El esquema de colores que utilizo es una{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/joshdick/onedark.vim"
>
versión del tema oficial de Atom One dark
</a>, cuando utilice Atom me gusto bastante su aspecto me parece muy
simple y bonito. Con la única modificación del color de fondo que es
transparente y toma el color de la terminal.
</p>
<img
src="https://firebasestorage.googleapis.com/v0/b/evilpudu.appspot.com/o/Posts%2Fplugins-recomendados-para-vim-neovim%2Ftheme.png?alt=media&token=e7870ffc-3987-4207-a4b9-3f474a22a0fa"
alt="Neovim"
/>
<p>
Podemos instalarlo usando cualquier plugin manager, en mi caso uso{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/junegunn/vim-plug"
>
vim-plug
</a>
</p>
<Snippet>{`Plug 'joshdick/onedark.vim'
syntax on
set termguicolors
set background=dark
colorscheme onedark
" transparent background color
hi Normal guibg=NONE ctermbg=NONE`}</Snippet>
<h2>Git</h2>
<p>
Para ver las lineas de codigo nuevas, modificadas o eliminadas utilizó{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/airblade/vim-gitgutter"
>
vim-gitgutter
</a>, como si fuera un <Code>git diff</Code>
</p>
<img
src="https://firebasestorage.googleapis.com/v0/b/evilpudu.appspot.com/o/Posts%2Fplugins-recomendados-para-vim-neovim%2Fgit.PNG?alt=media&token=0f4e1a40-6de0-4be3-9331-a040a88703c9"
alt="vim-gitgutter"
/>
<h2 id="utilidades">Utilidades</h2>
<p>
Como explorador de archivos utilizó{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/scrooloose/nerdtree"
>
NERDTree
</a>, permite visualizar y navegar por los directorios de una forma
jerárquica.
</p>
<img
src="https://firebasestorage.googleapis.com/v0/b/evilpudu.appspot.com/o/Posts%2Fplugins-recomendados-para-vim-neovim%2Fnerdtree.png?alt=media&token=45e72f98-4d47-4db5-b562-51bd2ee0a7c2"
alt="NERDTree Neovim"
/>
<p>
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/metakirby5/codi.vim"
>
codi.vim
</a>{' '}
un plugin que descubrí hace poco para interactuar con el código que
escribes, abre un panel nuevo y muestra los resultados de las evaluaciones
como si fuera un intérprete interactivo.
</p>
<h2 id="linting">Linting</h2>
<p>
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/neomake/neomake"
>
Neomake
</a>{' '}
para validar el código asincrónicamente, funciona como un framework con
soporte para diferentes herramientas de validación de código. Suelo
utilizarlo con{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://www.npmjs.com/package/standard"
>
Standard
</a>{' '}
o{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://www.npmjs.com/package/xo"
>
XO
</a>{' '}
para Javascript.
</p>
<h2 id="edicion">Edición</h2>
<p>Para agilizar la escritura de código utilizó los siguientes plugins:</p>
<ul>
<li>
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/jiangmiao/auto-pairs"
>
auto-pairs
</a>{' '}
inserta y elimina automaticamente los parentesis, llaves o comillas.
</li>
<li>
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/tpope/vim-commentary"
>
vim-commentary
</a>{' '}
nos permite comentar lineas, funciona muy bien con diferentes tipos de
archivos.
</li>
<li>
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/tpope/vim-surround"
>
vim-surround
</a>{' '}
nos permite cambiar comillas simples a dobles o viceversa, soporta
paréntesis, llaves, XML tags y más.
</li>
</ul>
<h2 id="sintaxis">Sintaxis</h2>
<p>
Para mejorar un poco los colores de sintaxis y la compatibilidad con los
nuevos estándares de Javascript utilizó{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/gavocanov/vim-js-indent"
>
vim-js-indent
</a>,{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/othree/es.next.syntax.vim"
>
es.next.syntax.vim
</a>{' '}
y{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/othree/yajs.vim"
>
yajs.vim
</a>
</p>
<p>
Para CSS me funciona muy bien{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/hail2u/vim-css3-syntax"
>
vim-css3-syntax
</a>
</p>
<h2 id="configuraciones">Configuraciones</h2>
<p>
Estas son algunas configuraciones que hacen un poco más ameno a Vim.
Remover automáticamente todos los espacios en blanco finales al guardar un
archivo:
</p>
<Snippet>{`autocmd BufWritePre * :%s/\\s\\+$//e`}</Snippet>
<p>
Permitir guardar un archivo con permisos de administrador usando{' '}
<Code>:W</Code>
</p>
<Snippet>{`command W w !sudo tee % > /dev/null`}</Snippet>
<p>
Retornar a la última línea que estábamos trabajando luego de re abrir un
archivo.
</p>
<Snippet>{`augroup line_return
au!
au BufReadPost *
\\ if line("'\\"") > 0 && line("'\\"") <= line("$") |
\\ execute 'normal! g\`"zvzz' |
\\ endif
augroup END`}</Snippet>
<p>
El archivo completo de las configuraciones de Neovim está disponible en el
siguiente repositorio{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/jlobos/dotfiles/blob/master/config/nvim/init.vim"
>
jlobos/dotfiles
</a>
</p>
</Post>
)
|
import fetch from 'isomorphic-fetch';
import { prefix } from 'utils/start';
import { getServerUrl } from 'src/utils';
const FETCH_REDIBOX_INSTANCE_REQUEST = 'FETCH_REDIBOX_INSTANCE_REQUEST';
const FETCH_REDIBOX_INSTANCE_SUCCESS = 'FETCH_REDIBOX_INSTANCE_SUCCESS';
const FETCH_REDIBOX_INSTANCE_ERROR = 'FETCH_REDIBOX_INSTANCE_ERROR';
const fetchRediboxInstanceRequest = payload => ({
type: FETCH_REDIBOX_INSTANCE_REQUEST,
payload,
});
const fetchRediboxInstanceSuccess = payload => ({
type: FETCH_REDIBOX_INSTANCE_SUCCESS,
payload,
});
const fetchRediboxInstanceError = payload => ({
type: FETCH_REDIBOX_INSTANCE_ERROR,
payload,
});
const fetchRediboxInstance = () => (dispatch) => {
dispatch(fetchRediboxInstanceRequest());
return fetch(`${getServerUrl()}/${prefix}`)
.then(res => res.json())
.then(data => dispatch(fetchRediboxInstanceSuccess(data)))
.catch(err => dispatch(fetchRediboxInstanceError(err)));
};
export {
FETCH_REDIBOX_INSTANCE_REQUEST,
FETCH_REDIBOX_INSTANCE_SUCCESS,
FETCH_REDIBOX_INSTANCE_ERROR,
fetchRediboxInstanceRequest,
fetchRediboxInstanceSuccess,
fetchRediboxInstanceError,
fetchRediboxInstance,
};
|
define(function()
{
"use strict";
function Position(xIn, yIn, headingIn)
{
var x = Math.round(xIn);
var y = Math.round(yIn);
var heading = Position.normalizeAngle(headingIn);
this.x = function()
{
return x;
};
this.y = function()
{
return y;
};
this.heading = function()
{
return heading;
};
}
Position.prototype.computeBearing = function(x2, y2)
{
var answer = Position.computeHeading(this.x(), this.y(), x2, y2);
answer -= this.heading();
answer = Position.normalizeAngle(answer);
return answer;
};
Position.prototype.computeDistance = function(position)
{
InputValidator.validateNotNull("position", position);
var dx = position.x() - this.x();
var dy = position.y() - this.y();
return Math.round(Math.sqrt((dx * dx) + (dy * dy)));
};
Position.prototype.toString = function()
{
return "(" + this.x() + ", " + this.y() + ", " + this.heading() + ")";
};
Position.computeHeading = function(x1, y1, x2, y2)
{
var dx = x2 - x1;
var dy = y2 - y1;
var answer = Math.round(Math.atan2(dy, dx) * 180.0 / Math.PI);
answer = Position.normalizeAngle(answer);
return answer;
};
Position.normalizeAngle = function(angle)
{
var answer = angle;
while (answer < 0)
{
answer += 360;
}
answer = answer % 360;
return answer;
};
Position.ZERO = new Position(0, 0, 0);
return Position;
});
|
const express = require('express');
const router = express.Router();
const controller = require('./controller');
router.get('/:lat/:long/:term', controller.index);
module.exports = router;
|
var css = require('dom-css');
var container = document.createElement('div');
var message = document.createElement('div');
var elError = document.createElement('pre');
styleContainer(container);
styleMessage(message);
styleError(elError);
elError.innerHTML = '{{errorMessage}}';
message.innerHTML = 'There was an issue while parsing your scripts:';
container.appendChild(message);
container.appendChild(elError);
document.body.insertBefore(container, document.body.firstChild);
function styleContainer(el) {
css(el, {
'background': '#0F0D15',
'color': '#9D94B5',
'font-size': '15px',
'padding-bottom': '20px',
'font-family': 'Verdana, Geneva, sans-serif'
});
}
function styleMessage(el) {
css(el, {
'font-size': '20px',
'color': '#AEA4C8',
'background': '#1E1A28',
'border-left': '5px solid #B8AED3',
'padding': '10px'
});
}
function styleError(el) {
css(el, {
'overflow': 'scroll',
'background': '#1E1A28',
'margin': '20px 20px 0px 20px',
'min-height': '100px',
'border-left': '2px solid #ED93AE',
'padding': '10px',
'font-family': 'Verdana, Geneva, sans-serif'
});
} |
import {combineReducers} from 'redux';
import movie from './movie';
import search from './search';
import year from './year';
import {navigator} from './navigator';
import category from './category';
import user from './user';
const rootReducer = combineReducers({
movie,
navigator,
search,
year,
category,
user
});
export default rootReducer; |
(function () {
'use strict';
/**
* @ngdoc object
* @name app.account:cfgAccountRoute
*
* @requires ($stateProvider)
* @propertyOf app.account
*
* @description
* State definitions and configuration for the account module
*/
angular
.module('wsSeed.app.core.module', ['ngRoute'])
.config(appCoreConfig);
appCoreConfig.$inject = ['$routeProvider', '$authProvider', '$httpProvider'];
function appCoreConfig($routeProvider, $authProvider, $httpProvider) {
$routeProvider.otherwise('/');
$httpProvider.interceptors.push(function() {
return {
'request': function(config) {
return config;
}
};
});
$authProvider.httpInterceptor = true;
}
})(); |
version https://git-lfs.github.com/spec/v1
oid sha256:95d16b7a83eb0292f260e256d1f80d2f55706576e6966bb8031ec1e6fc18801c
size 1723
|
import Radio from './Radio';
import './Radio.post.css';
export default Radio;
|
// ==UserScript==
// @name ServiceCloud Email Signature
// @namespace com.esko.bevi.scesig
// @author bevi@esko.com
// @description Adds a Signature at the bottom of a ServiceCloud reply
// @downloadURL https://github.com/tuxfre/esko-SC-scripts/raw/master/ServiceCloud%20Email%20Signature.user.js
// @include https://esko.my.salesforce.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 3
// @icon data:image/gif;base64,R0lGODlhIAAgAKIHAAGd3K/CNOz4/aje8zGv3HLJ63PAsv///yH5BAEAAAcALAAAAAAgACAAQAPGeLrc/k4MQKu9lIxRyhaCIhBVYAZGdgZYCwwMKLmFLEOPDeL8MgKEFXBFclkIoMJxRTRmaqGedEqtigSFYmYgGRAInV3vlzGsDFonoCZSAlAAQyqeKrDUFK7FHCDJh3B4bBJueBYeNmOEX4hRVo+QkZKTV4SNBzpiUlguXxcamRFphhhgmgIVQSZyJ6NGgz98Jl9npFwTFLOlJqQ1FkIqJ4ZIZIAEfGi6amyYacdnrk8dXI6YXVlGX4yam9hHXJTWOuHk5RAJADs=
// @grant none
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
document.addEventListener("DOMNodeInserted", function () {
jQuery(".cke_wysiwyg_frame").contents().replace("--------------- Original Message ---------------", "Yeepeee<br />--------------- Original Message ---------------");
},
false);
|
'use strict';
var fs = require('fs'),
path = require('path'),
alltested = require('alltested'),
utils = require('../index');
module.exports = {
'Checks that every submodule is available': function(test){
fs.readdirSync(__dirname + '/../lib').forEach(function(file){
var match = file.match(/^(.*)Utils\.js$/);
if(match){
test.ok(utils[match[1]], file + ' is not being exposed');
}
});
test.done();
},
'Ensures there is a test for every function': function(test){
var appPath = path.resolve(path.join(__dirname, '/../lib')),
testsPath = __dirname;
alltested(appPath, testsPath, {
ignore: ['accentMap.js',
'index.js']
});
test.done();
}
}; |
const gear = require("../gearbox.js");
const paths = require("../paths.json");
const channelDB = gear.channelDB,
userDB = gear.userDB,
DB = gear.serverDB;
function eventChecks(svDATA){
if (!svDATA.event) return 1;
if (!svDATA.event.enabled) return 1;
if (!svDATA.event.channel) return 1;
if (!svDATA.event.iterations) return 1;
let I = Math.round(svDATA.event.iterations)
return I;
}
module.exports = {
lootbox: async function loot(event) {
const locale = require('../../utils/multilang_b');
const mm = locale.getT();
let date = new Date();
if (event.content !== "--forcedroploot" && event.author.id!=="88120564400553984") {
if (date.getSeconds() === 0)return;
if (date.getSeconds() % 5 === 0)return;
};
if (event.guild.lootie) return console.log("lootie is ON");
event.guild.lootie = false;
const msg = event
const MSG = event.content;
const SVR = msg.guild;
const CHN = msg.channel;
const L = msg.lang
let serverDATA= await gear.serverDB.findOne({id:SVR.id});
if ((await channelDB.findOne({id:CHN.id})).modules.DROPS == false) return;
let prerf = (await DB.findOne({id:msg.guild.id})).modules.PREFIX || "+";
const P = {
lngs: msg.lang
}
const v = {
dropLoot: mm("loot.lootDrop." + (gear.randomize(1, 5)), P) + mm("loot.lootPick", P).replace(prerf, ""),
disputing: mm("loot.contesting", P),
oscarGoesTo: mm("loot.goesTo", P),
gratz: mm("loot.congrats", P),
morons: mm("loot.morons", P),
eventDrop: mm("loot.eventDrop", P),
suprareDrop: mm("loot.suprareDrop", P)+ mm("loot.lootPick", P),
rareDrop: mm("loot.rareDrop", P)+ mm("loot.lootPick", P),
ultraRareDrop: mm("loot.ultraRareDrop", P)+ mm("loot.lootPick", P)
}
try{
await dropLoot(event, DB, userDB, MSG, SVR, CHN, L, v);
event.guild.lootie = false
}catch(e){
console.log(e)
event.guild.lootie = false
};
event.guild.lootie = false
async function dropLoot(event) {
return new Promise(async resolve => {
let droprate = gear.randomize(1, 1000);
event.botUser.ivetal = event.botUser.ivetal || 0
event.botUser.ivetal++
if (event.content === "--forcedroploot" && event.author.id==="88120564400553984") droprate=777;
let iterate= eventChecks(serverDATA);
for (i=0;i<iterate;i++){
droprate = gear.randomize(1, 1000);
//let dropevent = gear.randomize(1, 5);
//if (dropevent >= 5)convertToEvent(i);
};
if (droprate === 777) {
try{
event.botUser.channels.get('382413370579484694').send("Lootbox Drop at **"+event.guild.name+"** | #"+event.channel.name+` after ${event.botUser.ivetal} messages`);
}catch(e){}
event.botUser.ivetal = 0;
let options = [
[v.ultraRareDrop,"lootbox_UR_O"] , //10
[v.suprareDrop,"lootbox_SR_O"], //98
[v.rareDrop,"lootbox_R_O"], //765
[v.dropLoot,"lootbox_U_O"] //4321
[v.dropLoot,"lootbox_C_O"] //4321
];
let cax;
let rand = gear.randomize(0, 20)
switch (rand) {
case 20:
cax = options[0]
break;
case 19:
case 18:
cax = options[1]
break;
case 17:
case 16:
case 15:
cax = options[2]
break;
case 14:
case 13:
case 11:
case 10:
cax = options[3]
break;
default:
cax = options[4]
break;
};
let itemPic = "chest.png"
function convertToEvent(i){
try{
//cax[1] = cax[1].replace("O", "event_2")
//if(i&&i==0){cax[0] += "\n" + v.eventDrop}
//itemPic = "xmas_chest.png"
}catch(e){}
}
if (!cax)cax= [v.dropLoot,"lootbox_C_O"] ;
CHN.send(cax[0], {
files: [paths.BUILD + itemPic]
})
.then(dropMsg => event.channel.send(v.disputing)
.then(dispMsg => processDropChest(dropMsg, dispMsg, cax[1])))
.catch(err => {
CHN.send(cax[0])
.then(dropMsg => event.channel.send(v.disputing)
.then(dispMsg => processDropChest(dropMsg, dispMsg, cax[1])))
.catch(err => console.log(err))
})
}
})
}
async function processDropChest(drop, disp,it) {
try {
if (!CHN.loot) {
CHN.loot = true
}
return new Promise(async resolve => {
let oldDropsly = CHN.DROPSLY;
let pickers = new gear.Discord.Collection;
let responses = await CHN.awaitMessages(async msg2 => {
if (!pickers.has(msg2.author.id) && (msg2.content.toLowerCase().includes('pick'))) {
pickers.set(msg2.author.id, msg2);
//console.log(pickers.has(msg2.author.id))
await disp.edit(disp.content + "\n" + msg2.author.username).then(neue => {
disp.content = neue.content;
return true;
})
} else {
return false
}
}, {time: 30000});
if (pickers.size === 0) {
drop.delete()
disp.delete()
CHN.send(v.morons)
event.guild.lootie = false
return resolve(false);
} else {
if (oldDropsly > CHN.DROPSLY) {
drop.delete().catch(e => {});
event.guild.lootie = false
return resolve(true);
};
let drama = [],
ments = [],
ids = [];
pickers.forEach(ms => {
drama.push(ms.guild.member(ms.author).displayName)
ments.push(ms.author).toString()
ids.push(ms.author.id)
})
let rnd = gear.randomize(0, ments.length - 1);
//console.log("----------- PICK by" + drama[rnd])
await pickers.deleteAll();
await drop.delete().catch(e => {});
await disp.delete().catch(e => {});
CHN.send(v.oscarGoesTo).then(goes => {
CHN.send(drama).then(async dra => {
setTimeout(async fn => {
drama[rnd] = ments[rnd]
await dra.edit(drama).then(async fin => {
//console.log(ids[rnd],it,"A A A")
userDB.set(ids[rnd],{$push:{'modules.inventory':it}}).then(ok=>{
setTimeout(async fn => {
event.guild.lootie = false
fin.delete().catch(e => {event.guild.lootie = false})
}, 5000);
});
});
}, 5000)
});
CHN.loot = false;
event.guild.lootie = false;
return resolve(true);
});
};
});
} catch (e) {
let v = "Rubine Send Forbidden: " + drop.guild.name + " C: " + drop.channel.name
gear.hook.send(e.error);
hook.send(v)
}
}
}
};
|
/**
* Created by Mark Sarukhanov on 29.07.2016.
*/
var dbRequest = require('./dbRequests');
module.exports = function (app, fs) {
app.post('/api/getSports',function (req, res) {
dbRequest.getSports(function(callback){
res.send(callback).end();
});
});
app.post('/api/getEvents',function (req, res) {
dbRequest.getEvents(req.body, function(callback){
res.send(callback).end();
});
});
app.post('/api/getVilkas',function (req, res) {
dbRequest.getEvents(req.body, function(events){
dbRequest.getVilkas(events, function(callback){
res.send(callback).end();
});
});
});
app.get('*', function (req, res) {
res.sendFile('index.html', { root: './files/' });
});
app.post('*', function (req, res) {
res.sendFile('index.html', { root: './files/' });
});
};
|
/*
*
* ContactPage actions
*
*/
import {
CREATE_MESSAGE,
CREATE_MESSAGE_SUCCESS,
CREATE_MESSAGE_FAILURE,
OPEN_MODAL,
CLOSE_MODAL,
} from './constants';
export function createMessage() {
return {
type: CREATE_MESSAGE,
payload: true,
};
}
export function createMessageSuccess() {
return {
type: CREATE_MESSAGE_SUCCESS,
payload: false,
};
}
export function createMessageFailure() {
return {
type: CREATE_MESSAGE_FAILURE,
payload: false,
isCreateFailed: true,
};
}
export function openModal() {
console.log('action dispatched')
return {
type: OPEN_MODAL,
payload: true,
};
}
export function closeModal() {
return {
type: CLOSE_MODAL,
payload: false,
};
}
|
import * as React from 'react';
import { capitalize } from '@mui/material/utils';
import Box from '@mui/material/Box';
import CssBaseline from '@mui/material/CssBaseline';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import Container from '@mui/material/Container';
import Typography from '@mui/material/Typography';
import GradientText from 'docs/src/components/typography/GradientText';
import Link from 'docs/src/modules/components/Link';
import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded';
export default function Experiments({ experiments }) {
const categories = {};
experiments.forEach((name) => {
const paths = name.split('/');
const categoryName = paths.length === 1 ? 'Uncategorized' : capitalize(paths[0] || '');
if (!categories[categoryName]) {
categories[categoryName] = [];
}
categories[categoryName].push({
name: capitalize(paths[1] || paths[0]),
pathname: `/experiments/${name}`,
});
});
return (
<React.Fragment>
<CssBaseline />
<Container>
<Box
sx={{
minHeight: 300,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
maxWidth: 600,
mx: 'auto',
textAlign: 'center',
}}
>
<Typography variant="body2" color="primary.600" fontWeight="bold">
Welcome to
</Typography>
<Typography component="h1" variant="h2" sx={{ my: 1 }}>
MUI <GradientText>Experiments</GradientText>
</Typography>
<Box sx={{ textAlign: 'left' }}>
<ul>
<Typography component="li">
All the files under <code>/experiments</code> are committed to git.
</Typography>
<Typography component="li">
URLs start with <code>/experiments/*</code> are deployed only on the pull request.
</Typography>
<Typography component="li">
<code>/experiments/*</code> are not included in docsearch indexing.
</Typography>
</ul>
</Box>
</Box>
</Container>
<Box
sx={{ bgcolor: (theme) => (theme.palette.mode === 'dark' ? 'primaryDark.900' : 'grey.50') }}
>
<Container sx={{ py: { xs: 4, md: 8 } }}>
<Typography
variant="body2"
color="grey.600"
fontWeight="bold"
textAlign="center"
sx={{ mb: 2 }}
>
All Experiments ({experiments.length})
</Typography>
{experiments.length > 0 && (
<Box
sx={{
display: 'grid',
gap: 2,
gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))',
}}
>
{Object.entries(categories).map(([categoryName, children]) => (
<Box key={categoryName} sx={{ pb: 2 }}>
<Typography
component="h2"
variant="body2"
sx={{
fontWeight: 500,
color: 'grey.600',
px: 1,
}}
>
{categoryName}
</Typography>
<List>
{(children || []).map((aPage) => {
return (
<ListItem key={aPage.pathname} disablePadding>
<ListItemButton
component={Link}
noLinkStyle
href={aPage.pathname}
sx={{
px: 1,
py: 0.5,
fontSize: '0.84375rem',
fontWeight: 500,
'&:hover, &:focus': { '& svg': { opacity: 1 } },
}}
>
{aPage.name}
<KeyboardArrowRightRounded
sx={{
ml: 'auto',
fontSize: '1.125rem',
opacity: 0,
color: 'primary.main',
}}
/>
</ListItemButton>
</ListItem>
);
})}
</List>
</Box>
))}
</Box>
)}
</Container>
</Box>
</React.Fragment>
);
}
Experiments.getInitialProps = () => {
const experiments = [];
const req = require.context('./', true, /^\.\/.*(?<!index)\.(js|tsx)$/);
req.keys().forEach((k) => {
experiments.push(k.replace(/^\.\/(.*)\.(js|tsx)$/, '$1'));
});
return {
experiments,
};
};
|
'use strict';
var expect = require('expect');
var app = require(process.env.PROJECT_ROOT + '/index');
var co = require('co');
var server = app.listen();
var request = require('co-supertest').agent(server);
var config = require(process.env.PROJECT_ROOT + '/lib/config');
describe('Auth:', function() {
var res;
after( function(done) {
server.close();
done();
});
before( function(done) {
co( function*() {
res = yield request
.post(config.app.namespace + '/auth/login')
.set('Content-Type', 'application/json')
.send({
email: process.env.USER_EMAIL,
password: process.env.USER_PASSWORD
})
.end();
done();
});
});
describe('POST /auth/login -', function() {
it('Should return a JWT', function(done) {
expect(res.body).toBeA('object');
expect(res.body.token).toBeA('string');
expect(res.body.token.length).toBeGreaterThan(10);
process.env.USER_TOKEN = res.body.token;
done();
});
it('Should set USER_TOKEN', function(done) {
expect(process.env.USER_TOKEN).toBe(res.body.token);
done();
});
});
});
|
/**
* Created by yanshaowen on 2017/9/29
* 检查对应的thrift状态和规范响应数据
*/
'use strict';
function copyObjectAttr(des, src) {
if (typeof des === 'object' && typeof src === 'object') {
for (let key in src) {
des[key] = src[key];
}
}
}
function setLog(logSocket,response) {
logSocket.info("===================");
logSocket.info('\n',response);
logSocket.info("===================");
}
function func(opt) {
let source = {};
let isSetSuccessLog = false;
let isSetFailLog = false;
if (opt && typeof opt === 'object') {
if (opt.jsonFile && typeof opt.jsonFile === 'object') {
source = opt.jsonFile;
}
if (opt.successLog && typeof opt.successLog === 'object') {
isSetSuccessLog = true;
}
if (opt.failLog && typeof opt.failLog === 'object') {
isSetFailLog = true;
}
}
return async function (ctx, next) {
await next();
if ('body' in ctx && ctx.body !== null && ctx.body !== undefined) {
const result = {
success: true,
data: ctx.body,
message: "success",
code: 0,
error_source:"success",
en_message:"success"
};
ctx.body = result;
if (isSetSuccessLog) setLog(opt.successLog,result);
return
}
if (ctx.error) {
const messageObject = {
success: false,
data: []
};
const errorValue = ctx.error;
if (errorValue in source) {
copyObjectAttr(messageObject, source[errorValue]);
ctx.body = messageObject;
if (isSetFailLog) setLog(opt.failLog,messageObject);
return;
}
if (typeof errorValue !== 'object' && 'UNKNOWN_ERROR' in source) {
copyObjectAttr(messageObject, source['UNKNOWN_ERROR']);
ctx.body = messageObject;
if (isSetFailLog) setLog(opt.failLog,messageObject);
return;
}
if (errorValue.name === 'TApplicationException' && 'THRIFT_ASK_EXCEPTION' in source) {
copyObjectAttr(messageObject, source['THRIFT_ASK_EXCEPTION']);
ctx.body = messageObject;
if (isSetFailLog) setLog(opt.failLog,messageObject);
return;
}
if (typeof errorValue === 'object'){
copyObjectAttr(messageObject, source['UNKNOWN_ERROR']);
ctx.body = messageObject;
if (isSetFailLog) setLog(opt.failLog,messageObject);
}
}
}
}
module.exports = func;
|
'use strict';
require('es6-shim');
var sql = require('sql');
sql.setDialect('postgres');
var databaseP = require('../management/databaseClientP');
var measurements = require('../management/declarations.js').measurements;
module.exports = {
create: function (data) {
return databaseP.then(function (db) {
var cloneData = Object.assign({}, data);
var query = measurements
.insert(cloneData)
.returning('*')
.toQuery();
return new Promise(function (resolve, reject) {
db.query(query, function (err, result) {
if (err) reject(err);
else {
resolve(result.rows[0]);
}
});
});
});
},
// Delete all measurements of a sensor.
deleteBySim: function(sim) {
return databaseP.then(function (db) {
var query = measurements
.delete()
.where(measurements.sensor_sim.equals(sim))
.returning('*')
.toQuery();
return new Promise(function (resolve, reject) {
db.query(query, function (err, result) {
if (err) reject(err);
else resolve(result.rows[0]);
});
});
})
.catch(function(err){
console.log('ERROR in delete measurements', err);
});
},
deleteAll: function() {
return databaseP.then(function (db) {
var query = measurements
.delete()
.returning('*')
.toQuery();
return new Promise(function (resolve, reject) {
db.query(query, function (err, result) {
if (err) reject(err);
else resolve(result.rows);
});
});
})
.catch(function(err){
console.log('ERROR in deleteAll measurements', err);
});
}
};
|
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(2);var r=n(1),o=new r.default;console.log(o)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){console.log("hey")}return e.prototype.toString=function(){return"a game obj"},e}();t.default=r},function(e,t){},function(e,t,n){e.exports=n(0)}]);
//# sourceMappingURL=main.4f176074183807782651.js.map |
const Benchmark = require('benchmark');
const suites = require('./suites');
suites.forEach((suiteData) => {
let suite = new Benchmark.Suite(suiteData.name);
suite = suiteData.cases.reduce((s, c) => {
return s.add(c.name, c.fn);
}, suite);
suite
.on('start', function() {
// eslint-disable-next-line no-console
console.log(`# ${this.name}:`);
})
.on('cycle', (event) => {
// eslint-disable-next-line no-console
console.log(String(event.target));
})
.on('complete', () => {
// eslint-disable-next-line no-console
console.log('\n=========\n');
})
.run(true);
});
|
import styled from 'styled-components'
const CenteredBlock = styled.div`
margin: 0 auto;
text-align: center;
`
export default CenteredBlock
|
var osx = 'OS X 10.10';
var windows = 'Windows 8.1';
var browsers = [{
// OSX
browserName: 'safari',
platform: osx
}, {
// Windows
browserName: 'firefox',
platform: windows
}, {
browserName: 'chrome',
platform: windows
}, {
browserName: 'microsoftedge',
platform: 'Windows 10'
}, {
browserName: 'internet explorer',
platform: windows,
version: '11'
}, {
browserName: 'internet explorer',
platform: 'Windows 8',
version: '10'
}];
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
var jsFiles = ['src/app/**/*.js', 'src/esrx/*.js', 'src/ext/*.js'];
var otherFiles = [
'src/app/**/*.html',
'src/app/**/*.css',
'src/css/**/*.css',
'src/*.php',
'src/common_html/**/*.php'
];
var bumpFiles = [
'package.json',
'bower.json',
'src/app/package.json',
'src/app/config.js'
];
var internFile = 'tests/intern.js';
var packageFile = 'package.json';
var eslintFiles = jsFiles.concat([internFile, packageFile]);
var deployFiles = [
'**',
'!**/*.uncompressed.js',
'!**/*consoleStripped.js',
'!**/bootstrap/less/**',
'!**/bootstrap/test-infra/**',
'!**/tests/**',
'!build-report.txt',
'!components-jasmine/**',
'!favico.js/**',
'!jasmine-favicon-reporter/**',
'!jasmine-jsreporter/**',
'!stubmodule/**',
'!util/**'
];
var deployDir = 'wwwroot/wvc/desktop';
var sauceConfig = {
urls: ['http://127.0.0.1:8000/_SpecRunner.html?catch=false'],
tunnelTimeout: 120,
build: process.env.TRAVIS_JOB_ID,
browsers: browsers,
testname: 'roadkill-desktop',
maxRetries: 10,
maxPollRetries: 10,
'public': 'public',
throttled: 5,
sauceConfig: {
'max-duration': 1800
},
statusCheckAttempts: 500
};
var secrets;
try {
secrets = grunt.file.readJSON('secrets.json');
sauceConfig.username = secrets.sauce_name;
sauceConfig.key = secrets.sauce_key;
} catch (e) {
// swallow for build server
secrets = {
stageHost: '',
prodHost: '',
username: '',
password: ''
};
}
// Project configuration.
grunt.initConfig({
bump: {
options: {
files: bumpFiles,
commitFiles: bumpFiles.concat('src/release_notes.php'),
push: false
}
},
clean: {
build: ['dist'],
deploy: ['deploy']
},
connect: {
uses_defaults: {}
},
compress: {
main: {
options: {
archive: 'deploy/deploy.zip'
},
files: [{
src: deployFiles,
// dest: './',
cwd: 'dist/',
expand: true
}]
}
},
dojo: {
prod: {
options: {
profiles: ['profiles/prod.build.profile.js', 'profiles/build.profile.js'] // Profile for build
}
},
stage: {
options: {
profiles: ['profiles/stage.build.profile.js', 'profiles/build.profile.js'] // Profile for build
}
},
options: {
dojo: 'src/dojo/dojo.js', // Path to dojo.js file in dojo source
load: 'build', // Optional: Utility to bootstrap (Default: 'build')
releaseDir: '../dist',
requires: ['src/app/run.js', 'src/app/packages.js'], // Optional: Module to require for the build (Default: nothing)
basePath: './src'
}
},
imagemin: {
main: {
options: {
optimizationLevel: 3
},
files: [{
expand: true,
cwd: 'src/',
// exclude tests because some images in dojox throw errors
src: ['**/*.{png,jpg,gif}', '!**/tests/**/*.*'],
dest: 'src/'
}]
}
},
jasmine: {
main: {
options: {
specs: ['src/app/**/Spec*.js'],
vendor: [
'src/jasmine-favicon-reporter/vendor/favico.js',
'src/jasmine-favicon-reporter/jasmine-favicon-reporter.js',
'src/jasmine-jsreporter/jasmine-jsreporter.js',
'src/app/tests/jasmineTestBootstrap.js',
'src/dojo/dojo.js',
'src/app/packages.js',
'src/app/tests/jsReporterSanitizer.js',
'src/app/tests/jasmineAMDErrorChecking.js',
'src/jquery/dist/jquery.js',
'src/bootstrap/dist/js/bootstrap.js'
],
host: 'http://localhost:8000'
}
}
},
eslint: {
options: {
configFile: '.eslintrc'
},
main: {
src: jsFiles
}
},
pkg: grunt.file.readJSON('package.json'),
'saucelabs-jasmine': {
all: {
options: sauceConfig
}
},
secrets: secrets,
sftp: {
stage: {
files: {
'./': 'deploy/deploy.zip'
},
options: {
host: '<%= secrets.stageHost %>'
}
},
prod: {
files: {
'./': 'deploy/deploy.zip'
},
options: {
host: '<%= secrets.prodHost %>'
}
},
options: {
path: './' + deployDir + '/',
srcBasePath: 'deploy/',
username: '<%= secrets.username %>',
password: '<%= secrets.password %>',
showProgress: true
}
},
sshexec: {
options: {
username: '<%= secrets.username %>',
password: '<%= secrets.password %>'
},
stage: {
command: ['cd ' + deployDir, 'unzip -oq deploy.zip', 'rm deploy.zip'].join(';'),
options: {
host: '<%= secrets.stageHost %>'
}
},
prod: {
command: ['cd ' + deployDir, 'unzip -oq deploy.zip', 'rm deploy.zip'].join(';'),
options: {
host: '<%= secrets.prodHost %>'
}
}
},
uglify: {
options: {
preserveComments: false,
sourceMap: true,
compress: {
drop_console: true,
passes: 2,
dead_code: true
}
},
stage: {
options: {
compress: {
drop_console: false
}
},
src: ['dist/dojo/dojo.js'],
dest: 'dist/dojo/dojo.js'
},
prod: {
files: [{
expand: true,
cwd: 'dist',
src: ['**/*.js', '!proj4/**/*.js'],
dest: 'dist'
}]
}
},
watch: {
eslint: {
files: eslintFiles,
tasks: ['newer:eslint:main', 'jasmine:main:build']
},
src: {
files: eslintFiles.concat(otherFiles),
options: {
livereload: true
}
}
}
});
grunt.registerTask('default', ['eslint', 'jasmine:main:build', 'connect', 'watch']);
grunt.registerTask('build-prod', [
'clean:build',
'newer:imagemin:main',
'dojo:prod',
'uglify:prod'
]);
grunt.registerTask('build-stage', [
'clean:build',
'newer:imagemin:main',
'dojo:stage',
'uglify:stage'
]);
grunt.registerTask('deploy-prod', [
'clean:deploy',
'compress:main',
'sftp:prod',
'sshexec:prod'
]);
grunt.registerTask('deploy-stage', [
'clean:deploy',
'compress:main',
'sftp:stage',
'sshexec:stage'
]);
grunt.registerTask('sauce', [
'jasmine:main:build',
'connect',
'saucelabs-jasmine'
]);
grunt.registerTask('travis', [
'eslint',
'sauce',
'build-prod'
]);
};
|
'use strict';
angular.module('southbayfession')
.factory('Tweet', ['$resource', function ($resource) {
return $resource('southbayfession/tweets/:id', {}, {
'query': { method: 'GET', isArray: true},
'get': { method: 'GET'}
});
}]);
|
let fs = require('fs');
function readData(filename, contentType, response) {
fs.exists(filename, function(exists) {
if (exists) {
fs.readFile(filename, function(error, data) {
if (!error) {
response.writeHead(200, contentType);
response.end(data);
} else {
response.writeHead(500);
response.end('Internal Server Error');
}
});
} else {
response.writeHead(404);
response.end('Image not found');
}
});
}
exports.provideData = function(filename, contentType, response) {
readData(filename,contentType, response);
};
exports.provideList = function(filename, contentType, response) {
readData(filename,contentType, response);
};
exports.queryData = function(filename, headers, query, response) {
fs.exists(filename, function(exists) {
if (exists) {
fs.readFile(filename, function(error, data) {
if (!error) {
let result = {};
let filteredData = [];
let allData = JSON.parse(data);
if (Array.isArray(allData.characters)) {
allData.characters.forEach(function(character) {
let matching = true;
for(let key in query) {
if(query[key] != character[key]) {
matching = false;
break;
}
}
if(matching) {
filteredData.push(character);
}
});
}
if (filteredData.length > 0) {
result = filteredData;
headers["Image-Url"] = 'http://localhost:8122/?image=' + query.type;
}
response.writeHead(200, headers);
response.end(JSON.stringify(result));
} else {
response.writeHead(500);
response.end('Internal Server Error');
}
});
} else {
response.writeHead(404);
response.end('Image not found');
}
});
}; |
import {inject} from 'aurelia-framework';
import {Incident} from '../../incident/incident';
import {IncidentManager} from '../../incident/incidentManager';
import routing from '../../services/routing';
import './create-incident.less';
@inject(IncidentManager)
export class CreateIncident {
constructor(incidentManager) {
this.incidentManager = incidentManager;
this.header = 'Create Incident';
}
attached(incident = new Incident(undefined, '', '', '', [])) {
this.incident = incident;
}
create() {
this.incidentManager.createIncident(this.incident);
routing.navigate('home');
}
cancel() {
routing.navigate('home');
}
} |
class Foo {
#privDecl = 3;
#if = "if"; // "keywords" are ok.
reads() {
var foo = this.#privUse;
var bar = this["#publicComputed"]
var baz = this.#if;
}
equals(o) {
return this.#privDecl === o.#privDecl;
}
writes() {
this.#privDecl = 4;
this["#public"] = 5;
}
#privSecond; // is a PropNode, not a PropRef. Doesn't matter.
["#publicField"] = 6;
calls() {
this.#privDecl();
new this.#privDecl();
}
}
class C {
#brand;
#method() {}
get #getter() {}
static isC(obj) {
return #brand in obj && #method in obj && #getter in obj;
}
} |
module.exports = (sanitize, params) => {
let query = ``
for (const permissionId of params.permissions) {
query += sanitize`
INSERT INTO core.RolePermissions (RoleId, PermissionId)
VALUES (${params.roleId}, ${permissionId})
`
}
return `
BEGIN TRANSACTION EditRole
BEGIN TRY
DELETE FROM core.RolePermissions WHERE RoleId = ${sanitize.single(Number(params.roleId))}
${query}
IF @@TRANCOUNT > 0
COMMIT TRANSACTION EditRole
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0
ROLLBACK TRANSACTION EditRole
SELECT ERROR_MESSAGE() AS Error
END CATCH
`
}
|
const Datastore = require('nedb')
const db = new Datastore({ filename: './datafile', autoload: true });
const save = ( object, callback ) => db.insert( object, callback )
const find = ( query, callback ) => db.find( query, callback )
const findOne = ( query, callback ) => db.findOne( query, callback )
const remove = ( query, callback ) => db.remove( query, {}, callback )
const update = ( query, update, options, callback ) => db.update( query, update, options, callback )
const count = ( query, callback ) => db.count( query, callback )
module.exports = {
crud: {
save,
find,
findOne,
remove,
update,
count,
db
}
} |
import React from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import {RSHeaderSimple} from '../header';
let RSLayoutSimple;
const muiTheme = getMuiTheme();
export default RSLayoutSimple = (props) => {
const ChildElement = props.route.element;
return (
<MuiThemeProvider muiTheme={muiTheme}>
<div>
<RSHeaderSimple {...props.route} />
<ChildElement {...props} />
</div>
</MuiThemeProvider>
)
} |
application.controller('usernavController', function ($scope, $http, $sce) {
$scope.navigate = function (site) {
$http.get("/Home/" + site + "/").then(function (response) {
$scope.content = response.data;
});
};
}); |
describe('SummonerUtil test suite', function () {
'use strict';
const SummonerUtil = require('../../lib/util/SummonerUtil');
const chai = require('chai');
const should = chai.should;
const expect = chai.expect;
chai.should();
describe('validateSummonerNameInputCharacters', function () {
const VALID_CHARS_NA_OCE = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
const VALID_CHARS_EUW = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿĄąĆćĘęıŁłŃńŒœŚśŠšŸŹźŻżŽžƒˆˇˉμfifl';
const VALID_CHARS_EUNE = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿĂ㥹ĆćĘęıŁłŃńŐőŒœŚśŞşŠšŢţŰűŸŹźŻżŽžƒȘșȚțˆˇˉΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩάέήίαβγδεζηθικλμνξοπρςστυφχψωόύώfifl';
const VALID_CHARS_BR = '0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÀÁÂÃÇÉÊÍÓÔÕÚàáâãçéêíóôõú';
const VALID_CHARS_RU = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя';
const VALID_CHARS_TR = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïð 0123456789ABCDEFGĞHIİJKLMNOPQRSŞTUVWXYZabcçdefgğhıijklmnoöpqrsştuvwxyzªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿıŁłŒœŠšŸŽžƒˆˇˉμfiflĄąĘęÓóĆ棳ŃńŚśŹźŻż';
const VALID_CHARS_LAN_LAS = '0123456789ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚÜ abcdefghijklmnñopqrstuvwxyzáéíóúü';
it('should return null for valid characters in NA/OCE', function () {
expect(SummonerUtil.validateSummonerNameInputCharacters('ˆJannaˆ')).to.be.null;
expect(SummonerUtil.validateSummonerNameInputCharacters(VALID_CHARS_NA_OCE)).to.be.null;
});
it('should return null for valid characters in EUW', function () {
expect(SummonerUtil.validateSummonerNameInputCharacters(VALID_CHARS_EUW)).to.be.null;
});
it('should return null for valid characters in EUNE', function () {
expect(SummonerUtil.validateSummonerNameInputCharacters(VALID_CHARS_EUNE)).to.be.null;
});
it('should return null for valid characters in Brazil', function () {
expect(SummonerUtil.validateSummonerNameInputCharacters(VALID_CHARS_BR)).to.be.null;
});
it('should return null for valid characters in Russia', function () {
expect(SummonerUtil.validateSummonerNameInputCharacters(VALID_CHARS_RU)).to.be.null;
});
it('should return null for valid characters in Turkey', function () {
expect(SummonerUtil.validateSummonerNameInputCharacters(VALID_CHARS_TR)).to.be.null;
});
it('should return null for valid characters in LATAM', function () {
expect(SummonerUtil.validateSummonerNameInputCharacters(VALID_CHARS_LAN_LAS)).to.be.null;
});
it('should return the invalid character if present', function () {
const invalidCharacters = '|-!§$%&/\\()=?^°';
const actual = SummonerUtil.validateSummonerNameInputCharacters(invalidCharacters);
expect(actual).an('Array').length(invalidCharacters.length);
actual.forEach((char, index) => {
expect(char).equals(invalidCharacters[index]);
});
});
it('works with fullwidth characters (asian)', function () {
const validName = 'CS命';
const actual = SummonerUtil.validateSummonerNameInputCharacters(validName);
expect(actual).to.be.null;
});
});
}); |
// Author Artem Batutin //
$('a[href^="#"]').on('click', function(event) {
//Smooth scroll for all a tags with href.
var target = $(this.getAttribute('href'));
if( target.length ) {
event.preventDefault();
//Collapsing menu if open on mobile.
$(".navbar-collapse").collapse('hide');
$('html, body').stop().animate({
scrollTop: target.offset().top
}, 1000);
}
});
|
(function($) {
$.fn.extend({
requireConfirmation: function() {
return this.each(function() {
return $(this).on('click', function(event) {
event.preventDefault();
var actionButton = $(this);
if (actionButton.is('a')) {
$('#confirmation-button').attr('href', actionButton.attr('href'));
}
if (actionButton.is('button')) {
$('#confirmation-button').on('click', function(event) {
event.preventDefault();
return actionButton.closest('form').submit();
});
}
return $('#confirmation-modal').modal('show');
});
});
}
});
$(document).ready(function() {
$('#sidebar')
.first()
.sidebar('attach events', '#sidebar-toggle', 'show')
;
$('.ui.checkbox').checkbox();
$('.form button').on('click', function() {
return $(this).closest('form').addClass('loading');
});
$('.message .close').on('click', function() {
return $(this).closest('.message').transition('fade');
});
$('[data-requires-confirmation]').requireConfirmation();
});
})(jQuery);
|
// flow-typed signature: ff2bfb6bd9c75ac98f98f6a35d0a1131
// flow-typed version: <<STUB>>/eslint-plugin-jsx-a11y_v5.0.1/flow_v0.49.1
/**
* This is an autogenerated libdef stub for:
*
* 'eslint-plugin-jsx-a11y'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/
declare module 'eslint-plugin-jsx-a11y' {
declare module.exports: any;
}
/**
* We include stubs for each file inside this npm package in case you need to
* require those files directly. Feel free to delete any files that aren't
* needed.
*/
declare module 'eslint-plugin-jsx-a11y/__mocks__/genInteractives' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/index-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/href-no-hash-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/index' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/alt-text' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/href-no-hash' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/html-has-lang' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/lang' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/media-has-caption' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-access-key' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-autofocus' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-onchange' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/scope' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getSuggestion' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getTabIndex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/schemas' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/scripts/create-rule' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/index' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/accessible-emoji' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/alt-text' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/anchor-has-content' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-activedescendant-has-tabindex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-proptypes' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-unsupported-elements' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/click-events-have-key-events' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/heading-has-content' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/href-no-hash' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/html-has-lang' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/iframe-has-title' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/img-redundant-alt' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/interactive-supports-focus' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/label-has-for' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/lang' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/media-has-caption' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/mouse-events-have-key-events' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-access-key' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-autofocus' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-distracting-elements' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-interactive-element-to-noninteractive-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-interactions' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-to-interactive-role' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-tabindex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-onchange' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-redundant-roles' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-static-element-interactions' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/role-has-required-aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/role-supports-aria-props' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/scope' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/tabindex-no-positive' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/attributesComparator' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/getImplicitRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/getSuggestion' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/getTabIndex' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/hasAccessibleChild' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/a' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/area' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/article' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/aside' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/body' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/button' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/datalist' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/details' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dialog' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dl' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/form' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h1' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h2' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h3' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h4' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h5' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h6' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/hr' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/img' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/index' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/input' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/li' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/link' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menu' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menuitem' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/meter' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/nav' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ol' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/option' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/output' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/progress' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/section' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/select' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tbody' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/textarea' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tfoot' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/thead' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ul' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isAbstractRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isHiddenFromScreenReader' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveElement' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveElement' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isPresentationRole' {
declare module.exports: any;
}
declare module 'eslint-plugin-jsx-a11y/src/util/schemas' {
declare module.exports: any;
}
// Filename aliases
declare module 'eslint-plugin-jsx-a11y/__mocks__/genInteractives.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/genInteractives'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/IdentifierMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXAttributeMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXElementMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__mocks__/JSXExpressionContainerMock'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/parserOptionsMapper'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/__util__/ruleOptionsMapperFactory'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/index-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/index-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/accessible-emoji-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/alt-text-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/anchor-has-content-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-activedescendant-has-tabindex-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-props-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-proptypes-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-role-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/aria-unsupported-elements-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/click-events-have-key-events-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/heading-has-content-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/href-no-hash-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/href-no-hash-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/html-has-lang-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/iframe-has-title-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/img-redundant-alt-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/interactive-supports-focus-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/label-has-for-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/lang-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/media-has-caption-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/mouse-events-have-key-events-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-access-key-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-autofocus-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-distracting-elements-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-interactive-element-to-noninteractive-role-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-interactions-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-element-to-interactive-role-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-noninteractive-tabindex-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-onchange-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-redundant-roles-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/no-static-element-interactions-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/role-has-required-aria-props-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/role-supports-aria-props-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/scope-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/rules/tabindex-no-positive-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/attributesComparator-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getSuggestion-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/getTabIndex-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/hasAccessibleChild-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isAbstractRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveElement-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isInteractiveRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveElement-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/isNonInteractiveRole-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/parserOptionsMapper-test'>;
}
declare module 'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/__tests__/src/util/schemas-test'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/index.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/index'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/accessible-emoji'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/alt-text.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/alt-text'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/anchor-has-content'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-activedescendant-has-tabindex'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-proptypes'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-role'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/aria-unsupported-elements'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/click-events-have-key-events'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/heading-has-content.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/heading-has-content'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/href-no-hash.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/href-no-hash'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/html-has-lang.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/html-has-lang'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/iframe-has-title'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/img-redundant-alt'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/interactive-supports-focus'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/label-has-for.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/label-has-for'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/lang.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/lang'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/media-has-caption.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/media-has-caption'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/mouse-events-have-key-events'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-access-key.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-access-key'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-autofocus.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-autofocus'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-distracting-elements'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-interactive-element-to-noninteractive-role'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-interactions'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-element-to-interactive-role'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-noninteractive-tabindex'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-onchange.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-onchange'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-redundant-roles'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/no-static-element-interactions'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/role-has-required-aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/role-supports-aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/scope.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/scope'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/rules/tabindex-no-positive'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/attributesComparator.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/attributesComparator'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getImplicitRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getImplicitRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getSuggestion.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getSuggestion'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/getTabIndex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/getTabIndex'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/hasAccessibleChild'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/a'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/area'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/article'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/aside'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/body'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/button'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/datalist'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/details'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dialog'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/dl'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/form'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h1'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h2'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h3'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h4'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h5'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/h6'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/hr'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/img'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/index'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/input'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/li'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/link'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menu'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/menuitem'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/meter'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/nav'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ol'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/option'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/output'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/progress'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/section'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/select'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tbody'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/textarea'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/tfoot'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/thead'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/implicitRoles/ul'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isAbstractRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isAbstractRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isInteractiveElement'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isInteractiveRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveElement'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isNonInteractiveRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/isPresentationRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/isPresentationRole'>;
}
declare module 'eslint-plugin-jsx-a11y/lib/util/schemas.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/lib/util/schemas'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/addRuleToIndex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/addRuleToIndex'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/doc.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/doc'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/rule.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/rule'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/boilerplate/test.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/boilerplate/test'>;
}
declare module 'eslint-plugin-jsx-a11y/scripts/create-rule.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/scripts/create-rule'>;
}
declare module 'eslint-plugin-jsx-a11y/src/index.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/index'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/accessible-emoji.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/accessible-emoji'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/alt-text.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/alt-text'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/anchor-has-content.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/anchor-has-content'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-activedescendant-has-tabindex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-activedescendant-has-tabindex'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-proptypes.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-proptypes'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-role'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/aria-unsupported-elements.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/aria-unsupported-elements'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/click-events-have-key-events.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/click-events-have-key-events'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/heading-has-content.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/heading-has-content'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/href-no-hash.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/href-no-hash'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/html-has-lang.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/html-has-lang'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/iframe-has-title.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/iframe-has-title'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/img-redundant-alt.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/img-redundant-alt'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/interactive-supports-focus.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/interactive-supports-focus'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/label-has-for.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/label-has-for'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/lang.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/lang'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/media-has-caption.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/media-has-caption'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/mouse-events-have-key-events.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/mouse-events-have-key-events'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-access-key.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-access-key'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-autofocus.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-autofocus'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-distracting-elements.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-distracting-elements'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-interactive-element-to-noninteractive-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-interactive-element-to-noninteractive-role'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-interactions.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-interactions'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-to-interactive-role.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-element-to-interactive-role'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-tabindex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-noninteractive-tabindex'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-onchange.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-onchange'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-redundant-roles.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-redundant-roles'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/no-static-element-interactions.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/no-static-element-interactions'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/role-has-required-aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/role-has-required-aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/role-supports-aria-props.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/role-supports-aria-props'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/scope.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/scope'>;
}
declare module 'eslint-plugin-jsx-a11y/src/rules/tabindex-no-positive.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/rules/tabindex-no-positive'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/attributesComparator.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/attributesComparator'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/getImplicitRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/getImplicitRole'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/getSuggestion.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/getSuggestion'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/getTabIndex.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/getTabIndex'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/hasAccessibleChild.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/hasAccessibleChild'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/a.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/a'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/area.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/area'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/article.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/article'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/aside.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/aside'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/body.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/body'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/button.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/button'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/datalist.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/datalist'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/details.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/details'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dialog.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/dialog'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/dl.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/dl'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/form.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/form'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h1.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h1'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h2.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h2'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h3.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h3'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h4.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h4'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h5.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h5'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/h6.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/h6'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/hr.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/hr'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/img.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/img'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/index.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/index'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/input.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/input'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/li.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/li'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/link.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/link'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menu.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/menu'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/menuitem.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/menuitem'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/meter.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/meter'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/nav.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/nav'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ol.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/ol'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/option.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/option'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/output.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/output'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/progress.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/progress'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/section.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/section'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/select.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/select'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tbody.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/tbody'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/textarea.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/textarea'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/tfoot.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/tfoot'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/thead.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/thead'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/implicitRoles/ul.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/implicitRoles/ul'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isAbstractRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isAbstractRole'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isHiddenFromScreenReader.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isHiddenFromScreenReader'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveElement.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isInteractiveElement'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isInteractiveRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isInteractiveRole'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveElement.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isNonInteractiveElement'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isNonInteractiveRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isNonInteractiveRole'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/isPresentationRole.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/isPresentationRole'>;
}
declare module 'eslint-plugin-jsx-a11y/src/util/schemas.js' {
declare module.exports: $Exports<'eslint-plugin-jsx-a11y/src/util/schemas'>;
}
|
(function () {
function bindPersonalProjectList() {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
if (this.status == 200) {
var projectsCnt = document.querySelector('#projects-container');
var response = JSON.parse(this.responseText);
for (var i = 0; i < response.length; i++) {
var div = getGithubBoxDiv(response[i]);
projectsCnt.appendChild(div);
}
}
};
xhr.open('GET', 'https://api.github.com/users/mapaiva/repos', true);
xhr.send();
}
function bindOrganizationProjectList() {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
if (this.status == 200) {
var projectsCnt = document.querySelector('#projects-container');
var response = JSON.parse(this.responseText);
for (var i = 0; i < response.length; i++) {
var div = getGithubBoxDiv(response[i]);
projectsCnt.appendChild(div);
}
}
};
xhr.open('GET', 'https://api.github.com/users/gitpie/repos', true);
xhr.send();
}
function getGithubBoxDiv(repo) {
var div = document.createElement('div');
div.className = 'github-box';
div.innerHTML = [
'<div class="github-box-header">',
'<h3><a href="', repo.html_url,'" title="', repo.name,'" target="_blank">', repo.name,'</a></h3>',
'<div class="github-stats">',
'<a class="repo-watchers" href="', repo.html_url.concat('/watchers'),'" target="_blank"><i class="fa fa-eye"></i>', repo.watchers,'</a>',
'<a class="repo-stargazers" href="', repo.html_url.concat('/stargazers'),'" target="_blank"><i class="fa fa-star"></i>', repo.stargazers_count,'</a>',
'<a class="repo-forks" href="', repo.html_url.concat('/network'),'" target="_blank"><i class="fa fa-code-fork"></i>', repo.forks,'</a>',
'</div>',
'</div>',
'<div class="github-box-content">',
repo.description,
' - <a href="', repo.html_url.concat('#readme'),'" target="_blank">Read More</a>',
'</div>',
'<div class="github-box-update">',
'Latest commit to <strong>', repo.default_branch,'</strong> on ', (new Date(repo.updated_at).toLocaleString()),
'</div>'
].join('');
return div;
}
window.onload = function () {
bindOrganizationProjectList();
bindPersonalProjectList()
};
})();
|
( function( ) {
'use strict';
angular
.module( 'authtopusexample.config' )
.config( config );
config.$inject = [ '$locationProvider' ];
/**
* @name config
* @desc Enable HTML5 routing
*/
function config( $locationProvider ) {
$locationProvider.html5Mode( true );
$locationProvider.hashPrefix( '!' );
}
} )( );
|
/* gallery.js v1.0.0 | GNU GENERAL PUBLIC LICENSE
Author: Jean Frank Arias Sanchez
Description: Simple Fade Gallery
*/
function slider(){
// Variables
var gallery = $('.slider');
var slides = $('.slider li');
var activeSlide = 1; // Set to 1 since the slides animation must start in the second slide
// Function to remove the .active class from all the slides
function resetGallery() {
for (var slide = 0; slide < slides.length; slide++){
$(slides[slide]).removeClass('active');
}
}
// Function to add the .active class to the current slide
function setActiveSlide() {
$(slides[activeSlide]).addClass('active');
activeSlide++;
if (activeSlide >= slides.length){
activeSlide = 0;
};
}
// Running the gallery
setInterval(function(){
resetGallery();
setActiveSlide();
},
4000); // Slides time in mili seconds. 4000 = 4 seconds
}
|
/* Euskarako oinarria 'jQuery date picker' jquery-ko extentsioarentzat */
/* Karrikas-ek itzulia (karrikas@karrikas.com) */
(function($){
$.datepick.regional['eu'] = {
clearText: 'X', clearStatus: '',
closeText: 'Egina', closeStatus: '',
prevText: '<Aur', prevStatus: '',
prevBigText: '<<', prevBigStatus: '',
nextText: 'Hur>', nextStatus: '',
nextBigText: '>>', nextBigStatus: '',
currentText: 'Gaur', currentStatus: '',
monthNames: ['Urtarrila','Otsaila','Martxoa','Apirila','Maiatza','Ekaina',
'Uztaila','Abuztua','Iraila','Urria','Azaroa','Abendua'],
monthNamesShort: ['Urt','Ots','Mar','Api','Mai','Eka',
'Uzt','Abu','Ira','Urr','Aza','Abe'],
monthStatus: '', yearStatus: '',
weekHeader: 'Wk', weekStatus: '',
dayNames: ['Igandea','Astelehena','Asteartea','Asteazkena','Osteguna','Ostirala','Larunbata'],
dayNamesShort: ['Iga','Ast','Ast','Ast','Ost','Ost','Lar'],
dayNamesMin: ['Ig','As','As','As','Os','Os','La'],
dayStatus: '', dateStatus: 'DD d MM',
dateFormat: 'yy/mm/dd', firstDay: 1,
initStatus: '', isRTL: false,
showMonthAfterYear: false, yearSuffix: ''};
$.datepick.setDefaults($.datepick.regional['eu']);
})(jQuery);
|
'use strict';
angular.module('rideshareApp')
.factory('Modal', function ($rootScope, $modal) {
/**
* Opens a modal
* @param {Object} scope - an object to be merged with modal's scope
* @param {String} modalClass - (optional) class(es) to be applied to the modal
* @return {Object} - the instance $modal.open() returns
*/
function openModal(scope, modalClass) {
var modalScope = $rootScope.$new();
scope = scope || {};
modalClass = modalClass || 'modal-default';
angular.extend(modalScope, scope);
return $modal.open({
templateUrl: 'components/modal/modal.html',
windowClass: modalClass,
scope: modalScope
});
}
// Public API here
return {
/* Confirmation modals */
confirm: {
/**
* Create a function to open a delete confirmation modal (ex. ng-click='myModalFn(name, arg1, arg2...)')
* @param {Function} del - callback, ran when delete is confirmed
* @return {Function} - the function to open the modal (ex. myModalFn)
*/
delete: function(del) {
del = del || angular.noop;
/**
* Open a delete confirmation modal
* @param {String} name - name or info to show on modal
* @param {All} - any additional args are passed staight to del callback
*/
return function() {
var args = Array.prototype.slice.call(arguments),
name = args.shift(),
deleteModal;
deleteModal = openModal({
modal: {
dismissable: true,
title: 'Confirm Delete',
html: '<p>Are you sure you want to delete <strong>' + name + '</strong> ?</p>',
buttons: [{
classes: 'btn-danger',
text: 'Delete',
click: function(e) {
deleteModal.close(e);
}
}, {
classes: 'btn-default',
text: 'Cancel',
click: function(e) {
deleteModal.dismiss(e);
}
}]
}
}, 'modal-danger');
deleteModal.result.then(function(event) {
del.apply(event, args);
});
};
}
}
};
});
|
import React from 'react'
import Header from './header'
import Footer from './footer'
// import Likes from './likes'
import CommentsHeader from './commentsHeader'
import Comments from './comments'
import Image from './image'
var DetailView = React.createClass({
render: function() {
return (
<div className="detail-body-container">
<Header />
<div className="flex-wrapper">
<ImagePost model={this.props.model} />
</div>
<Footer />
</div>
)
}
})
var ImagePost = React.createClass({
render: function() {
var detailData = this.props.model
return (
<section className="image-wrapper">
<div className="image-container">
<Image model={this.props.model} />
</div>
<div className="details-container">
<CommentsHeader model={this.props.model} />
<Comments model={this.props.model} />
</div>
</section>
)
}
})
export default DetailView |
var gulp = require('gulp');
var $ = plugins = require('gulp-load-plugins')();
var config = require('./gulp.config').config;
gulp.task('lint', function() {
gulp.watch(config.js.client, ['lint:client']);
});
gulp.task('lint:client', function() {
return lint(config.js.client);
});
function lint(src) {
return gulp.src(src)
.pipe($.jshint('./.jshintrc'))
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.notify({
onLast: false,
message: function(file) {
if (file.jshint.success) {
// Don't show something if success
return false;
}
return file.relative + ' (' + file.jshint.results.length + ' errors)\n';
},
sound: 'Submarine'
}));
}
|
/**
* Test that each of our configuration settings are properly set when
* passed through on our config method as an object.
*/
describe('ngNotify config method', function() {
'use strict';
var ngNotify,
doc,
interval,
timeout,
element,
scope;
var message = 'Message to display during tests.';
/**
* Setup our application before running each test.
*/
beforeEach(module('ngNotify'));
beforeEach(inject(function($injector, $document, $interval, $timeout) {
ngNotify = $injector.get('ngNotify');
$timeout.flush();
doc = $document;
interval = $interval;
timeout = $timeout;
element = angular.element(
document.querySelector('.ngn')
);
scope = element.scope();
}));
/**
* Start from a clean slate between every single test.
*/
afterEach(function() {
doc.find('body').empty();
});
/**
* Setup config method tests.
*
* Just need to test a single, non-default param here for
* each config option. In-depth testing for every available option
* is done in each config's specific test.
*/
it('is empty', function() {
ngNotify.config();
ngNotify.set(message);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-info") > -1
).toBe(true);
});
it('type warn is set', function() {
ngNotify.config({
type: 'warn'
});
ngNotify.set(message);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-warn") > -1
).toBe(true);
});
it('theme pastel is set', function() {
ngNotify.config({
theme: 'pastel'
});
ngNotify.set(message);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-pastel") > -1
).toBe(true);
});
it('html true is set', function() {
ngNotify.config({
html: true
});
ngNotify.set(message);
expect(
scope.ngNotify.notifyHtml
).toBe(true);
});
it('sticky true is set', function() {
ngNotify.config({
sticky: true
});
ngNotify.set(message);
interval.flush(200);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-sticky") > -1
).toBe(true);
// Expect to always be visible, even after default duration would have expired.
timeout.flush(6000);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// Manually closing the notification should hide it.
ngNotify.dismiss();
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
});
it('position top is set', function() {
ngNotify.config({
position: 'top'
});
ngNotify.set(message);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-top") > -1
).toBe(true);
});
it('duration abc is set', function() {
// Should revert to default of 3000...
ngNotify.config({
duration: 'abc'
});
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
ngNotify.set(message);
interval.flush(200);
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// 1ms before the duration concludes, notification should still be visible.
timeout.flush(2999);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// Step forward 1ms and our fadeOut should be triggered.
timeout.flush(1);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
});
it('duration 1000 is set', function() {
ngNotify.config({
duration: 1000
});
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
// Initial fadeIn.
ngNotify.set(message);
interval.flush(200);
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// 1ms before the duration concludes, notification should still be visible.
timeout.flush(999);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// Step forward 1ms and our fadeOut should be triggered.
timeout.flush(1);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
});
it('all non-default options (except duration) are set', function() {
// Tests all options EXCEPT for duration.
// Being sticky, duration fades will not apply.
ngNotify.config({
type: 'success',
theme: 'prime',
html: true,
sticky: true,
position: 'top',
duration: 3000
});
ngNotify.set(message);
interval.flush(200);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-success") > -1
).toBe(true);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-prime") > -1
).toBe(true);
expect(
scope.ngNotify.notifyHtml
).toBe(true);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-sticky") > -1
).toBe(true);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-top") > -1
).toBe(true);
// Expect to always be visible, even after default duration would have expired.
timeout.flush(8000);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// Manually closing the notification should hide it.
ngNotify.dismiss();
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
});
it('all non-default options (except sticky) are set', function() {
// Tests all options EXCEPT for sticky.
// Having a duration, stickiness will not apply.
ngNotify.config({
type: 'success',
theme: 'prime',
html: true,
duration: 9876,
position: 'top',
sticky: false
});
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
// Initial fadeIn.
ngNotify.set(message);
interval.flush(200);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-success") > -1
).toBe(true);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-prime") > -1
).toBe(true);
expect(
scope.ngNotify.notifyHtml
).toBe(true);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-sticky") > -1
).toBe(false);
expect(
scope.ngNotify.notifyClass.indexOf("ngn-top") > -1
).toBe(true);
// Duration tests...
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// 1ms before the duration concludes, notification should still be visible.
timeout.flush(9875);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('block');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(1);
// Step forward 1ms and our fadeOut should be triggered.
timeout.flush(1);
interval.flush(500);
expect(
scope.ngNotify.notifyStyle.display
).toBe('none');
expect(
scope.ngNotify.notifyStyle.opacity
).toBe(0);
});
});
|
'use strict';
const request = require('request');
const fs = require('fs');
const url = require('url');
const path = require('path');
module.exports = function(uri, callback) {
let urlObj = url.parse(uri);
let filename = path.basename(urlObj.pathname);
let done = false;
let innerCallback = function() {
if (done) {
return;
}
done = true;
return callback.apply(callback, arguments);
};
request
.get(uri)
.on('error', innerCallback)
.on('end', function() {
return innerCallback(null, filename);
})
.pipe(fs.createWriteStream(path.join(process.cwd(), filename)));
};
|
var mockery = require('mockery');
describe('index', function() {
var mockNodeSchedule,
spyOnMockSlackNotify,
spyOnScheduleJob,
spyOnSlackNotifySend;
beforeEach(function() {
var date = new Date(2015, 9, 4);
jasmine.clock().install();
jasmine.clock().mockDate(date);
spyOnScheduleJob = jasmine
.createSpy('nodeSchedule.scheduleJob')
.and.callFake(function(cron, callback) {
callback();
});
spyOnSlackNotifySend = jasmine
.createSpy('slackNotify.send');
spyOnMockSlackNotify = jasmine
.createSpy('slackNotify')
.and.returnValue({send: spyOnSlackNotifySend});
mockNodeSchedule = {scheduleJob: spyOnScheduleJob};
mockery.enable({
useCleanCache: true,
warnOnUnregistered: false
});
mockery.registerMock('node-schedule', mockNodeSchedule);
mockery.registerMock('slack-notify', spyOnMockSlackNotify);
require('./index.js');
});
afterEach(function() {
jasmine.clock().uninstall();
mockery.disable();
mockery.deregisterAll();
});
describe('node-schedule', function() {
it('should be set up', function() {
expect(spyOnScheduleJob)
.toHaveBeenCalledWith(jasmine.any(String), jasmine.any(Function));
});
});
describe('slack-notify', function() {
it('should be set up', function() {
expect(spyOnMockSlackNotify)
.toHaveBeenCalled();
});
it('should send a message', function() {
expect(spyOnSlackNotifySend)
.toHaveBeenCalledWith({
channel: jasmine.any(String),
icon_url: jasmine.any(String),
text: jasmine.stringMatching('2015-10-04'),
unfurl_links: jasmine.any(Boolean),
username: jasmine.any(String)
});
});
});
});
|
/*
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
(function(scope) {
// imports
var extend = scope.extend;
var api = scope.api;
// imperative implementation: Polymer()
// specify an 'own' prototype for tag `name`
function element(name, prototype) {
if (typeof name !== 'string') {
var script = prototype || document._currentScript;
prototype = name;
name = script && script.parentNode && script.parentNode.getAttribute ?
script.parentNode.getAttribute('name') : '';
if (!name) {
throw 'Element name could not be inferred.';
}
}
if (getRegisteredPrototype[name]) {
throw 'Already registered (Polymer) prototype for element ' + name;
}
// cache the prototype
registerPrototype(name, prototype);
// notify the registrar waiting for 'name', if any
notifyPrototype(name);
}
// async prototype source
function waitingForPrototype(name, client) {
waitPrototype[name] = client;
}
var waitPrototype = {};
function notifyPrototype(name) {
if (waitPrototype[name]) {
waitPrototype[name].registerWhenReady();
delete waitPrototype[name];
}
}
// utility and bookkeeping
// maps tag names to prototypes, as registered with
// Polymer. Prototypes associated with a tag name
// using document.registerElement are available from
// HTMLElement.getPrototypeForTag().
// If an element was fully registered by Polymer, then
// Polymer.getRegisteredPrototype(name) ===
// HTMLElement.getPrototypeForTag(name)
var prototypesByName = {};
function registerPrototype(name, prototype) {
return prototypesByName[name] = prototype || {};
}
function getRegisteredPrototype(name) {
return prototypesByName[name];
}
// exports
scope.getRegisteredPrototype = getRegisteredPrototype;
scope.waitingForPrototype = waitingForPrototype;
// namespace shenanigans so we can expose our scope on the registration
// function
// make window.Polymer reference `element()`
window.Polymer = element;
// TODO(sjmiles): find a way to do this that is less terrible
// copy window.Polymer properties onto `element()`
extend(Polymer, scope);
// Under the HTMLImports polyfill, scripts in the main document
// do not block on imports; we want to allow calls to Polymer in the main
// document. Platform collects those calls until we can process them, which
// we do here.
if (Platform.consumeDeclarations) {
Platform.consumeDeclarations(function(declarations) {;
if (declarations) {
for (var i=0, l=declarations.length, d; (i<l) && (d=declarations[i]); i++) {
element.apply(null, d);
}
}
});
}
})(Polymer);
|
"use strict";
var express = require('express');
var path = require('path');
var requestLogger = require('morgan');
var bodyParser = require('body-parser');
var log = require('./logger');
var config = require('./config');
var deviceMeasurementsApi = require('./routes/deviceMeasurementsApi');
var deviceTopologyApi = require('./routes/deviceTopologyApi');
var pingApi = require('./routes/pingApi');
var app = express();
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.static(path.join(__dirname, 'public')));
app.use(requestLogger(config.requestLoggerFormat, { stream: log.stream }));
app.use(bodyParser.json({
limit: '50mb',
type: ['+json', 'json']
}));
app.use(bodyParser.urlencoded({ extended: false }));
app.get('/device-measurements/:vendor/:productType/:serialNumber', deviceMeasurementsApi.get);
app.post('/devices/:serialNumber/topology', deviceTopologyApi.post);
app.get('/ping', pingApi.ping);
// catch 404 and forward to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use(function(err, req, res, next) {
if (!err.status || err.status >= 500) {
log.error(err);
}
res.status(err.status || 500);
if (!req.accepts('html')) {
res.json({
message: err.message,
error: config.stackTraceOnError ? err : {}
});
} else {
res.render('error', {
message: err.message,
error: config.stackTraceOnError ? err : {}
});
}
});
module.exports = app;
|
/* vi: ts=8 sts=4 sw=4 et
*
* compat.js: Javascript compatiblity library.
*
* This file is part of Draco2, a dynamic web content system in Python.
* Draco2 is copyright (C) 1999-2005 Geert Jansen <geert@boskant.nl>.
* All rights are reserved.
*
* $Revision: $
*/
function parentNode(el)
{
if (el.parentNode)
return el.parentNode;
return el.parentElement;
}
function childNodes(el)
{
if (el.childNodes)
return el.childNodes;
return el.children;
}
function isChildNode(p, c)
{
while (parentNode(c) && (parentNode(c) != p))
c = parentNode(c);
return parentNode(c) != null;
}
function getAttribute(el, name)
{
if (el.getAttribute)
return el.getAttribute(name);
}
function getElementById(id, w)
{
if (w == null)
w = window;
if (w.document.getElementById)
return w.document.getElementById(id);
return w.document.all[id];
}
function getElementsByTagName(tagname, w)
{
if (w == null)
w = window;
if (w.document.getElementsByTagName)
return w.document.getElementsByTagName(tagname);
return w.document.all.tags(tagname);
}
function srcElement(event)
{
if (event.srcElement)
return event.srcElement;
return event.target;
}
function activecursor()
{
if (navigator.userAgent.indexOf("MSIE") > 0)
return 'hand';
else
return 'pointer';
}
function normalcursor()
{
return 'auto';
}
function tableRow()
{
if (navigator.userAgent.indexOf("MSIE") > 0)
return "block";
else
return "table-row";
}
function getXmlHttpRequest()
{
if (window.XMLHttpRequest)
return new XMLHttpRequest();
else if (window.ActiveXObject)
return new ActiveXObject("Microsoft.XMLHTTP");
}
function getEvent(event)
{
if (event == null)
event = window.event;
return event;
}
|
import Router from 'koa-router'
import Boom from 'boom'
import convert from 'koa-convert'
import _validate from 'koa-req-validator'
import _ from 'lodash'
import User from '../../models/users'
import { getCleanUser } from '../../utils/mixed'
import { mailTransport, checkEmailStatus } from '../../utils/email'
import Config from '../../config'
/*
account-settings (!!!此 component 頁面可跟 register component 頁面共用,差別在於 email 不能改)
(1) Login => jwt token
(2) 才能到修改頁面 (setting) => 可改 nickname (60 days), photo, password
(3) Submit to server + email to user with modify password (no URL)
*/
const validate = (...args) => convert(_validate(...args))
const router = new Router({
prefix: '/v1/account_settings',
})
router.post('/',
validate({
'nickname:body': ['require', 'isAlphanumeric', 'nickname is required or not alphanumeric'],
'email:body': ['require', 'isEmail', 'email is required or not valid'],
'password:body': ['require', 'password is required'],
'photo:body': ['require', 'isDataURI', 'photo is required or not dataURI'],
}),
async(ctx, next) => {
try {
const { email, nickname, password, photo } = ctx.request.body
const result = await User.findOne({ email })
if (!result) {
throw Boom.notFound('user not found')
}
let user
const oldNickname = result.nickname
//如果 user 有嘗試改動 nickname
if (oldNickname !== nickname) {
user = await User.findById(result._id).where('nicknameChangeLimit').lt(Date.now())
if (!user) {
throw Boom.forbidden('nickname 60 days limit')
}
//除了改動 nickname、password 與 photo 外,也要重設 60 days 限制
_.extend(user, {
nickname,
password,
photo,
nicknameChangeLimit: Config.dbSchema.user.nicknameChangeLimit()
})
await user.save()
} else {
user = await User.findById(result._id)
_.extend(user, {
password,
photo
})
await user.save()
}
ctx.state.user = user
ctx.state.nodemailerInfo = await mailTransport(ctx.request.body)
await next()
} catch (err) {
if (err.output.statusCode) {
ctx.throw(err.output.statusCode, err)
} else {
ctx.throw(500, err)
}
}
},
checkEmailStatus
)
export default router
|
#!/usr/bin/env node
'use strict';
const assert = require('assert');
const utils = require('../utils.js');
assert(!module.parent);
assert(__dirname === process.cwd());
const target = process.argv[2] || 'host';
const input = './test-x-index.js';
const output = './test-output.exe';
const standard = 'stdout';
let right;
const inspect = (standard === 'stdout')
? [ 'inherit', 'pipe', 'inherit' ]
: [ 'inherit', 'inherit', 'pipe' ];
right = utils.pkg.sync([
'--target', target,
'--output', output, input
], inspect);
assert(right.indexOf('\x1B\x5B') < 0, 'colors detected');
right = right.replace(/\\/g, '/');
assert(right.indexOf('test-50-cannot-include-addon/time.node') >= 0);
assert(right.indexOf('path-to-executable/time.node') >= 0);
utils.vacuum.sync(output);
|
/*global angular, ionic*/
angular.module('koc.controllers')
.controller('SettingsCtrl', ['$scope', '$stateParams', '$state', '$ionicLoading', '$rootScope', '$log', 'User',
function($scope, $stateParams, $state, $ionicLoading, $rootScope, $log, User) {
$scope.cacheSize = User.getCacheSize();
$log.debug("SettingsCtrl");
$scope.platform = ionic.Platform.platform();
$scope.showAdvisor = User.showAdvisor();
$scope.speechRecognition = User.useSpeechRecognition();
$rootScope.$broadcast('kocAdvisor', "");
$scope.speechRecognitionSupported = ionic.Platform.platform() == "android";
$scope.isCordovaApp = !!window.cordova;
$scope.onShowAdvisorChange = function() {
$scope.showAdvisor = !$scope.showAdvisor;
User.setShowAdvisor($scope.showAdvisor);
};
$scope.onSpeechRecognitionChange = function() {
$scope.speechRecognition = !$scope.speechRecognition;
User.setSpeechRecognition($scope.speechRecognition);
};
$scope.clearCache = function() {
User.clearCache();
$scope.cacheSize = User.getCacheSize();
$ionicLoading.show({ template: 'Cache Cleared', noBackdrop: true, duration: 1000 });
};
}]); |
var my = require('../');
exports.Buffer = my.Class(Buffer, {
constructor: function(arg) {
Buffer.call(this, arg);
this.position = 0;
},
append: function(data) {
var nbWritten;
if (typeof data === 'string')
nbWritten = this.write(data, this.position);
else if (Buffer.isBuffer(data))
nbWritten = data.copy(this, this.position);
else
throw new TyperError(
'my.util.AppendBuffer.append: <data> must be a string or buffer');
this.position += nbWritten;
},
clear: function() {
this.position = 0;
},
getRemaining: function() {
return this.length - this.position;
},
sliceData: function() {
return this.slice(0, this.position);
},
toString: function() {
return this.sliceData().toString();
}
});
|
/*!
* SAP UI development toolkit for HTML5 (SAPUI5/OpenUI5)
* (c) Copyright 2009-2015 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides control sap.ui.unified.Menu.
sap.ui.define(['jquery.sap.global', 'sap/ui/core/Control', 'sap/ui/core/Popup', './MenuItemBase', './library', 'jquery.sap.script'],
function(jQuery, Control, Popup, MenuItemBase, library/* , jQuerySap */) {
"use strict";
/**
* Constructor for a new Menu.
*
* @param {string} [sId] id for the new control, generated automatically if no id is given
* @param {object} [mSettings] initial settings for the new control
*
* @class
* A container for menu items. When the space in the browser is not large enough to display all defined items, a scroll bar is provided.
* @extends sap.ui.core.Control
*
* @author SAP SE
* @version 1.26.8
*
* @constructor
* @public
* @alias sap.ui.unified.Menu
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
*/
var Menu = Control.extend("sap.ui.unified.Menu", /** @lends sap.ui.unified.Menu.prototype */ { metadata : {
library : "sap.ui.unified",
properties : {
/**
*
* Disabled menus have other colors than enabled ones, depending on customer settings.
*/
enabled : {type : "boolean", group : "Behavior", defaultValue : true},
/**
*
* The label/description provided for screen readers
*/
ariaDescription : {type : "string", group : "Accessibility", defaultValue : null},
/**
*
* Max. number of items to be displayed before an overflow mechanimn appears. Values smaller than 1 mean infinite number of visible items.
* The menu can not become larger than the screen height.
*/
maxVisibleItems : {type : "int", group : "Behavior", defaultValue : 0},
/**
*
* The number of items to be shifted up or down upon Page-up or Page-up key navigation. Values smaller than 1 mean infinite number of page items.
* @since 1.25.0
*/
pageSize : {type : "int", group : "Behavior", defaultValue : 5}
},
defaultAggregation : "items",
aggregations : {
/**
* Aggregation of menu items
*/
items : {type : "sap.ui.unified.MenuItemBase", multiple : true, singularName : "item"}
},
associations : {
/**
* Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby).
* @since 1.26.3
*/
ariaLabelledBy : {type : "sap.ui.core.Control", multiple : true, singularName : "ariaLabelledBy"}
},
events : {
/**
*
* Provides the application an alternative option to listen to select events. This event is only fired on the root menu of a menu hierarchy.
* Note that there is also a select event available for MenuItem; if the current event is used, the select event of a MenuItem becomes redundant.
*/
itemSelect : {
parameters : {
/**
* The selected item
*/
item : {type : "sap.ui.unified.MenuItemBase"}
}
}
}
}});
(function(window) {
Menu.prototype.init = function(){
var that = this;
this.bOpen = false;
this.oOpenedSubMenu = null;
this.oHoveredItem = null;
this.oPopup = null; // Will be created lazily
this.fAnyEventHandlerProxy = jQuery.proxy(function(oEvent){
var oRoot = this.getRootMenu();
if (oRoot != this || !this.bOpen || !this.getDomRef() || (oEvent.type != "mousedown" && oEvent.type != "touchstart")) {
return;
}
oRoot.handleOuterEvent(this.getId(), oEvent); //TBD: standard popup autoclose
}, this);
this.fOrientationChangeHandler = function(){
that.close();
};
this.bUseTopStyle = false;
};
/**
* Does all the cleanup when the Menu is to be destroyed.
* Called from Element's destroy() method.
* @private
*/
Menu.prototype.exit = function(){
if (this.oPopup) {
this.oPopup.detachOpened(this._menuOpened, this);
this.oPopup.detachClosed(this._menuClosed, this);
this.oPopup.destroy();
delete this.oPopup;
}
jQuery.sap.unbindAnyEvent(this.fAnyEventHandlerProxy);
if (this._bOrientationChangeBound) {
jQuery(window).unbind("orientationchange", this.fOrientationChangeHandler);
this._bOrientationChangeBound = false;
}
// Cleanup
this._resetDelayedRerenderItems();
};
/**
* Called when the control or its children are changed.
* @private
*/
Menu.prototype.invalidate = function(oOrigin){
if (oOrigin instanceof MenuItemBase && this.getDomRef()) {
this._delayedRerenderItems();
} else {
Control.prototype.invalidate.apply(this, arguments);
}
};
/**
* Called before rendering starts by the renderer
* @private
*/
Menu.prototype.onBeforeRendering = function() {
this._resetDelayedRerenderItems();
};
/**
* Called when the rendering is complete
* @private
*/
Menu.prototype.onAfterRendering = function() {
var aItems = this.getItems();
for (var i = 0; i < aItems.length; i++) {
if (aItems[i].onAfterRendering && aItems[i].getDomRef()) {
aItems[i].onAfterRendering();
}
}
if (this.oHoveredItem) {
this.oHoveredItem.hover(true, this);
}
checkAndLimitHeight(this);
};
Menu.prototype.onThemeChanged = function(){
if (this.getDomRef() && this.getPopup().getOpenState() === sap.ui.core.OpenState.OPEN) {
checkAndLimitHeight(this);
this.getPopup()._applyPosition(this.getPopup()._oLastPosition);
}
};
//****** API Methods ******
Menu.prototype.setPageSize = function(iSize){
return this.setProperty("pageSize", iSize, true); /*No rerendering required*/
};
Menu.prototype.addItem = function(oItem){
this.addAggregation("items", oItem, !!this.getDomRef());
this._delayedRerenderItems();
return this;
};
Menu.prototype.insertItem = function(oItem, idx){
this.insertAggregation("items", oItem, idx, !!this.getDomRef());
this._delayedRerenderItems();
return this;
};
Menu.prototype.removeItem = function(oItem){
this.removeAggregation("items", oItem, !!this.getDomRef());
this._delayedRerenderItems();
return this;
};
Menu.prototype.removeAllItems = function(){
var oRes = this.removeAllAggregation("items", !!this.getDomRef());
this._delayedRerenderItems();
return oRes;
};
Menu.prototype.destroyItems = function(){
this.destroyAggregation("items", !!this.getDomRef());
this._delayedRerenderItems();
return this;
};
Menu.prototype._delayedRerenderItems = function(){
if (!this.getDomRef()) {
return;
}
this._resetDelayedRerenderItems();
this._itemRerenderTimer = jQuery.sap.delayedCall(0, this, function(){
var oDomRef = this.getDomRef();
if (oDomRef) {
var oRm = sap.ui.getCore().createRenderManager();
sap.ui.unified.MenuRenderer.renderItems(oRm, this);
oRm.flush(oDomRef);
oRm.destroy();
this.onAfterRendering();
this.getPopup()._applyPosition(this.getPopup()._oLastPosition);
}
});
};
Menu.prototype._resetDelayedRerenderItems = function(){
if (this._itemRerenderTimer) {
jQuery.sap.clearDelayedCall(this._itemRerenderTimer);
delete this._itemRerenderTimer;
}
};
/**
* Opens the menu
*
* @param {boolean} bWithKeyboard
*
* An indicator whether the first item shall be highlighted, or not. It is highlighted in the case that the menu is opened via keyboard.
* @param {object} oOpenerRef
*
* DOMNode or sap.ui.core.Element that opens the menu; the DOMNode or sap.ui.core.Element will be focused again after the menu is closed. This parameter is optional.
* @param {sap.ui.core.Dock} sMy
*
* The popup content's reference position for docking.
* See also sap.ui.core.Popup.Dock and sap.ui.core.Popup.open.
* @param {sap.ui.core.Dock} sAt
*
* The 'of' element's reference point for docking to.
* See also sap.ui.core.Popup.Dock and sap.ui.core.Popup.open.
* @param {object} oOf
*
* The DOM element or sap.ui.core.Element to dock to.
* See also sap.ui.core.Popup.open.
* @param {string} sOffset
*
* The offset relative to the docking point, specified as a string with space-separated pixel values (e.g. "0 10" to move the popup 10 pixels to the right).
* See also sap.ui.core.Popup.open.
* @param {sap.ui.core.Collision} sCollision
*
* The collision defines how the position of an element should be adjusted in case it overflows the window in some direction.
* See also sap.ui.core.Popup.open.
* @type void
* @public
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
*/
Menu.prototype.open = function(bWithKeyboard, oOpenerRef, my, at, of, offset, collision){
if (this.bOpen) {
return;
}
setItemToggleState(this, true);
this.bOpen = true;
this.oOpenerRef = oOpenerRef;
// Open the sap.ui.core.Popup
this.getPopup().open(0, my, at, of, offset || "0 0", collision || "_sapUiCommonsMenuFlip _sapUiCommonsMenuFlip", true);
// Set the tab index of the menu and focus
var oDomRef = this.getDomRef();
jQuery(oDomRef).attr("tabIndex", 0).focus();
// Mark the first item when using the keyboard
if (bWithKeyboard) {
this.setHoveredItem(this.getNextSelectableItem(-1));
}
jQuery.sap.bindAnyEvent(this.fAnyEventHandlerProxy);
if (sap.ui.Device.support.orientation && this.getRootMenu() === this) {
jQuery(window).bind("orientationchange", this.fOrientationChangeHandler);
this._bOrientationChangeBound = true;
}
};
/**
* This function is called when the Menu was opened.
*
* @since 1.17.0
* @private
*/
Menu.prototype._menuOpened = function() {
fnIe8RepaintBug(this);
};
/**
* Closes the menu
*
* @type void
* @public
* @ui5-metamodel This method also will be described in the UI5 (legacy) designtime metamodel
*/
Menu.prototype.close = function() {
if (!this.bOpen || Menu._dbg /*Avoid closing for debugging purposes*/) {
return;
}
setItemToggleState(this, false);
// Remove fixed flag if it existed
delete this._bFixed;
jQuery.sap.unbindAnyEvent(this.fAnyEventHandlerProxy);
if (this._bOrientationChangeBound) {
jQuery(window).unbind("orientationchange", this.fOrientationChangeHandler);
this._bOrientationChangeBound = false;
}
this.bOpen = false;
// Close all sub menus if there are any
if (this.oOpenedSubMenu) {
this.oOpenedSubMenu.close();
}
// Reset the hover state
this.setHoveredItem();
// Reset the tab index of the menu and focus the opener (if there is any)
jQuery(this.getDomRef()).attr("tabIndex", -1);
// Close the sap.ui.core.Popup
this.getPopup().close(0);
//Remove the Menus DOM after it is closed
this._resetDelayedRerenderItems();
this.$().remove();
this.bOutput = false;
if (this.isSubMenu()) {
this.getParent().getParent().oOpenedSubMenu = null;
}
};
/**
* This function is called when the Menu was closed.
*
* @since 1.17.0
* @private
*/
Menu.prototype._menuClosed = function() {
//TBD: standard popup autoclose: this.close(); //Ensure proper cleanup
if (this.oOpenerRef) {
if (!this.ignoreOpenerDOMRef) {
try {
this.oOpenerRef.focus();
} catch (e) {
jQuery.sap.log.warning("Menu.close cannot restore the focus on opener " + this.oOpenerRef + ", " + e);
}
}
this.oOpenerRef = undefined;
}
};
//****** Event Handlers ******
Menu.prototype.onclick = function(oEvent){
this.selectItem(this.getItemByDomRef(oEvent.target), false, !!(oEvent.metaKey || oEvent.ctrlKey));
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsapnext = function(oEvent){
//right or down (RTL: left or down)
if (oEvent.keyCode != jQuery.sap.KeyCodes.ARROW_DOWN) {
//Go to sub menu if available
if (this.oHoveredItem && this.oHoveredItem.getSubmenu() && this.checkEnabled(this.oHoveredItem)) {
this.openSubmenu(this.oHoveredItem, true);
}
return;
}
//Go to the next selectable item
var iIdx = this.oHoveredItem ? this.indexOfAggregation("items", this.oHoveredItem) : -1;
this.setHoveredItem(this.getNextSelectableItem(iIdx));
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsapprevious = function(oEvent){
//left or up (RTL: right or up)
if (oEvent.keyCode != jQuery.sap.KeyCodes.ARROW_UP) {
//Go to parent menu if this is a sub menu
if (this.isSubMenu()) {
this.close();
}
oEvent.preventDefault();
oEvent.stopPropagation();
return;
}
//Go to the previous selectable item
var iIdx = this.oHoveredItem ? this.indexOfAggregation("items", this.oHoveredItem) : -1;
this.setHoveredItem(this.getPreviousSelectableItem(iIdx));
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsaphome = function(oEvent){
//Go to the first selectable item
this.setHoveredItem(this.getNextSelectableItem(-1));
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsapend = function(oEvent){
//Go to the last selectable item
this.setHoveredItem(this.getPreviousSelectableItem(this.getItems().length));
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsappagedown = function(oEvent) {
if (this.getPageSize() < 1) {
this.onsapend(oEvent);
return;
}
var iIdx = this.oHoveredItem ? this.indexOfAggregation("items", this.oHoveredItem) : -1;
iIdx += this.getPageSize();
if (iIdx >= this.getItems().length) {
this.onsapend(oEvent);
return;
}
this.setHoveredItem(this.getNextSelectableItem(iIdx - 1)); //subtract 1 to preserve computed page offset because getNextSelectableItem already offsets 1 item down
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsappageup = function(oEvent) {
if (this.getPageSize() < 1) {
this.onsaphome(oEvent);
return;
}
var iIdx = this.oHoveredItem ? this.indexOfAggregation("items", this.oHoveredItem) : -1;
iIdx -= this.getPageSize();
if (iIdx < 0) {
this.onsaphome(oEvent);
return;
}
this.setHoveredItem(this.getPreviousSelectableItem(iIdx + 1)); //add 1 to preserve computed page offset because getPreviousSelectableItem already offsets one item up
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsapselect = function(oEvent){
this._sapSelectOnKeyDown = true;
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onkeyup = function(oEvent){
//like sapselect but on keyup:
//Using keydown has the following side effect:
//If the selection leads to a close of the menu and the focus is restored to the caller (e.g. a button)
//the keyup is fired on the caller (in case of a button a click event is fired there in FF -> Bad!)
//The attribute _sapSelectOnKeyDown is used to avoid the problem the other way round (Space is pressed
//on Button which opens the menu and the space keyup immediately selects the first item)
if (!this._sapSelectOnKeyDown) {
return;
} else {
this._sapSelectOnKeyDown = false;
}
if (!jQuery.sap.PseudoEvents.sapselect.fnCheck(oEvent)) {
return;
}
this.selectItem(this.oHoveredItem, true, false);
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsapbackspace = function(oEvent){
if (jQuery(oEvent.target).prop("tagName") != "INPUT") {
oEvent.preventDefault(); //CSN 4537657 2012: Stop browser history navigation
}
};
Menu.prototype.onsapbackspacemodifiers = Menu.prototype.onsapbackspace;
Menu.prototype.onsapescape = function(oEvent){
this.close();
oEvent.preventDefault();
oEvent.stopPropagation();
};
Menu.prototype.onsaptabnext = Menu.prototype.onsapescape;
Menu.prototype.onsaptabprevious = Menu.prototype.onsapescape;
Menu.prototype.onmouseover = function(oEvent){
if (!sap.ui.Device.system.desktop) {
return;
}
var oItem = this.getItemByDomRef(oEvent.target);
if (!this.bOpen || !oItem || oItem == this.oHoveredItem) {
return;
}
if (this.oOpenedSubMenu && jQuery.sap.containsOrEquals(this.oOpenedSubMenu.getDomRef(), oEvent.target)) {
return;
}
this.setHoveredItem(oItem);
if (this.oOpenedSubMenu && !this.oOpenedSubMenu._bFixed) {
this.oOpenedSubMenu.close();
this.oOpenedSubMenu = null;
}
if (jQuery.sap.checkMouseEnterOrLeave(oEvent, this.getDomRef())) {
this.getDomRef().focus();
}
if (this.checkEnabled(oItem)) {
this.openSubmenu(oItem, false, true);
}
};
Menu.prototype.onmouseout = function(oEvent){
if (!sap.ui.Device.system.desktop) {
return;
}
fnIe8RepaintBug(this);
if (jQuery.sap.checkMouseEnterOrLeave(oEvent, this.getDomRef())) {
if (!this.oOpenedSubMenu || !this.oOpenedSubMenu.getParent() === this.oHoveredItem) {
this.setHoveredItem(null);
}
}
};
/**
* Handles the onsapfocusleave event
* @param {jQuery.Event} oEvent The browser event
* @private
*/
Menu.prototype.onsapfocusleave = function(oEvent){
// Only the deepest opened sub menu should handle the event or ignore the event from an item
if (this.oOpenedSubMenu || !this.bOpen) {
return;
}
this.getRootMenu().handleOuterEvent(this.getId(), oEvent); //TBD: standard popup autoclose
};
//****** Helper Methods ******
Menu.prototype.handleOuterEvent = function(oMenuId, oEvent){
//See sap.ui.core.Popup implementation: Target is to use autoclose mechanismn of the popup
//but currently there autoclose only works for 2 hierarchy levels and not for n as needed by the menu
//-> This function and all its callers are obsolete when switching later to standard popup autoclose
// (all needed further code locations for that change are marked with "TBD: standard popup autoclose")
var isInMenuHierarchy = false,
touchEnabled = this.getPopup().touchEnabled;
if (oEvent.type == "mousedown" || oEvent.type == "touchstart") {
// Suppress the delayed mouse event from mobile browser
if (touchEnabled && (oEvent.isMarked("delayedMouseEvent") || oEvent.isMarked("cancelAutoClose"))) {
return;
}
var that = this;
while (that && !isInMenuHierarchy) {
if (jQuery.sap.containsOrEquals(that.getDomRef(), oEvent.target)) {
isInMenuHierarchy = true;
}
that = that.oOpenedSubMenu;
}
} else if (oEvent.type == "sapfocusleave") {
if (touchEnabled) {
return;
}
if (oEvent.relatedControlId) {
var that = this;
while (that && !isInMenuHierarchy) {
if ((that.oOpenedSubMenu && that.oOpenedSubMenu.getId() == oEvent.relatedControlId)
|| jQuery.sap.containsOrEquals(that.getDomRef(), jQuery.sap.byId(oEvent.relatedControlId).get(0))) {
isInMenuHierarchy = true;
}
that = that.oOpenedSubMenu;
}
}
}
if (!isInMenuHierarchy) {
this.ignoreOpenerDOMRef = true;
this.close();
this.ignoreOpenerDOMRef = false;
}
};
Menu.prototype.getItemByDomRef = function(oDomRef){
var oItems = this.getItems(),
iLength = oItems.length;
for (var i = 0;i < iLength;i++) {
var oItem = oItems[i],
oItemRef = oItem.getDomRef();
if (jQuery.sap.containsOrEquals(oItemRef, oDomRef)) {
return oItem;
}
}
return null;
};
Menu.prototype.selectItem = function(oItem, bWithKeyboard, bCtrlKey){
if (!oItem || !(oItem instanceof MenuItemBase && this.checkEnabled(oItem))) {
return;
}
var oSubMenu = oItem.getSubmenu();
if (!oSubMenu) {
// This is a normal item -> Close all menus and fire event.
this.getRootMenu().close();
} else {
if (!sap.ui.Device.system.desktop && this.oOpenedSubMenu === oSubMenu) {
this.oOpenedSubMenu.close();
this.oOpenedSubMenu = null;
} else {
// Item with sub menu was triggered -> Open sub menu and fire event.
this.openSubmenu(oItem, bWithKeyboard);
}
}
oItem.fireSelect({item: oItem, ctrlKey: bCtrlKey});
this.getRootMenu().fireItemSelect({item: oItem});
};
Menu.prototype.isSubMenu = function(){
return this.getParent() && this.getParent().getParent && this.getParent().getParent() instanceof Menu;
};
Menu.prototype.getRootMenu = function(){
var that = this;
while (that.isSubMenu()) {
that = that.getParent().getParent();
}
return that;
};
Menu.prototype.getMenuLevel = function(){
var iLevel = 1;
var that = this;
while (that.isSubMenu()) {
that = that.getParent().getParent();
iLevel++;
}
return iLevel;
};
Menu.prototype.getPopup = function (){
if (!this.oPopup) {
this.oPopup = new Popup(this, false, true, false); // content, modal, shadow, autoclose (TBD: standard popup autoclose)
this.oPopup.setDurations(0, 0);
this.oPopup.attachOpened(this._menuOpened, this);
this.oPopup.attachClosed(this._menuClosed, this);
}
return this.oPopup;
};
Menu.prototype.setHoveredItem = function(oItem){
if (this.oHoveredItem) {
this.oHoveredItem.hover(false, this);
}
if (!oItem) {
this.oHoveredItem = null;
jQuery(this.getDomRef()).removeAttr("aria-activedescendant");
return;
}
this.oHoveredItem = oItem;
oItem.hover(true, this);
this._setActiveDescendant(this.oHoveredItem);
this.scrollToItem(this.oHoveredItem);
};
Menu.prototype._setActiveDescendant = function(oItem){
if (sap.ui.getCore().getConfiguration().getAccessibility()) {
var that = this;
setTimeout(function(){
//Setting active descendant must be a bit delayed. Otherwise the screenreader does not announce it.
if (that.oHoveredItem === oItem) {
that.$().attr("aria-activedescendant", that.oHoveredItem.getId());
}
}, 10);
}
};
Menu.prototype.openSubmenu = function(oItem, bWithKeyboard, bWithHover){
var oSubMenu = oItem.getSubmenu();
if (!oSubMenu) {
return;
}
if (this.oOpenedSubMenu && this.oOpenedSubMenu !== oSubMenu) {
// Another sub menu is open and has not been fixed. Close it at first.
this.oOpenedSubMenu.close();
this.oOpenedSubMenu = null;
}
if (this.oOpenedSubMenu) {
// Already open. Keep open, bring to front and fix/unfix menu...
// Fix/Unfix Menu if clicked. Do not change status if just hovering over
this.oOpenedSubMenu._bFixed =
(bWithHover && this.oOpenedSubMenu._bFixed)
|| (!bWithHover && !this.oOpenedSubMenu._bFixed);
this.oOpenedSubMenu._bringToFront();
} else {
// Open the sub menu
this.oOpenedSubMenu = oSubMenu;
var eDock = Popup.Dock;
oSubMenu.open(bWithKeyboard, this, eDock.BeginTop, eDock.EndTop, oItem, "0 0");
}
};
/**
* Scrolls an item into the visual viewport.
*
* @private
*/
Menu.prototype.scrollToItem = function(oItem) {
var oMenuRef = this.getDomRef(),
oItemRef = oItem ? oItem.getDomRef() : null;
if (!oItemRef || !oMenuRef) {
return;
}
var iMenuScrollTop = oMenuRef.scrollTop,
iItemOffsetTop = oItemRef.offsetTop,
iMenuHeight = jQuery(oMenuRef).height(),
iItemHeight = jQuery(oItemRef).height();
if (iMenuScrollTop > iItemOffsetTop) { // scroll up
oMenuRef.scrollTop = iItemOffsetTop;
} else if ((iItemOffsetTop + iItemHeight) > (iMenuScrollTop + iMenuHeight)) { // scroll down
oMenuRef.scrollTop = Math.ceil(iItemOffsetTop + iItemHeight - iMenuHeight);
}
};
/**
* Brings this menu to the front of the menu stack.
* This simulates a mouse-event and raises the z-index which is internally tracked by the Popup.
*
* @private
*/
Menu.prototype._bringToFront = function() {
// This is a hack. We "simulate" a mouse-down-event on the submenu so that it brings itself
// to the front.
jQuery.sap.byId(this.getPopup().getId()).mousedown();
};
Menu.prototype.checkEnabled = function(oItem){
fnIe8RepaintBug(this);
return oItem && oItem.getEnabled() && this.getEnabled();
};
Menu.prototype.getNextSelectableItem = function(iIdx){
var oItem = null;
var aItems = this.getItems();
// At first, start with the next index
for (var i = iIdx + 1; i < aItems.length; i++) {
if (aItems[i].getVisible() && this.checkEnabled(aItems[i])) {
oItem = aItems[i];
break;
}
}
// If nothing found, start from the beginning
if (!oItem) {
for (var i = 0; i <= iIdx; i++) {
if (aItems[i].getVisible() && this.checkEnabled(aItems[i])) {
oItem = aItems[i];
break;
}
}
}
return oItem;
};
Menu.prototype.getPreviousSelectableItem = function(iIdx){
var oItem = null;
var aItems = this.getItems();
// At first, start with the previous index
for (var i = iIdx - 1; i >= 0; i--) {
if (aItems[i].getVisible() && this.checkEnabled(aItems[i])) {
oItem = aItems[i];
break;
}
}
// If nothing found, start from the end
if (!oItem) {
for (var i = aItems.length - 1; i >= iIdx; i--) {
if (aItems[i].getVisible() && this.checkEnabled(aItems[i])) {
oItem = aItems[i];
break;
}
}
}
return oItem;
};
Menu.prototype.setRootMenuTopStyle = function(bUseTopStyle){
this.getRootMenu().bUseTopStyle = bUseTopStyle;
Menu.rerenderMenu(this.getRootMenu());
};
Menu.rerenderMenu = function(oMenu){
var aItems = oMenu.getItems();
for (var i = 0; i < aItems.length; i++) {
var oSubMenu = aItems[i].getSubmenu();
if (oSubMenu) {
Menu.rerenderMenu(oSubMenu);
}
}
oMenu.invalidate();
oMenu.rerender();
};
///////////////////////////////////////// Hidden Functions /////////////////////////////////////////
function setItemToggleState(oMenu, bOpen){
var oParent = oMenu.getParent();
if (oParent && oParent instanceof MenuItemBase) {
oParent.onSubmenuToggle(bOpen);
}
}
function checkAndLimitHeight(oMenu) {
var iMaxVisibleItems = oMenu.getMaxVisibleItems(),
iMaxHeight = document.documentElement.clientHeight - 10,
$Menu = oMenu.$();
if (iMaxVisibleItems > 0) {
var aItems = oMenu.getItems();
for (var i = 0; i < aItems.length; i++) {
if (aItems[i].getDomRef()) {
iMaxHeight = Math.min(iMaxHeight, aItems[i].$().outerHeight(true) * iMaxVisibleItems);
break;
}
}
}
if ($Menu.outerHeight(true) > iMaxHeight) {
$Menu.css("max-height", iMaxHeight + "px").toggleClass("sapUiMnuScroll", true);
} else {
$Menu.css("max-height", "").toggleClass("sapUiMnuScroll", false);
}
}
//IE 8 repainting bug when hovering over MenuItems with IconFont
var fnIe8RepaintBug = function() {};
if (sap.ui.Device.browser.internet_explorer && sap.ui.Device.browser.version < 9) {
fnIe8RepaintBug = function(oMenu, iDelay) {
if (iDelay === undefined) {
iDelay = 50;
}
/* In case of perdormance issues, the commented code around the delayedCall might help:
jQuery.sap.clearDelayedCall(oMenu.data("delayedRepaintId"));
var iDelayedId = */
jQuery.sap.delayedCall(iDelay, oMenu, function() {
var $Elem = this.$(); // this is the Menu instance from the oMenu argument
if ($Elem.length > 0) {
var oDomRef = $Elem[0].firstChild;
sap.ui.core.RenderManager.forceRepaint(oDomRef);
}
});
/* oMenu.data("delayedRepaintId", iDelayedId); */
};
}
//**********************************************
/*!
* The following code is taken from
* jQuery UI 1.10.3 - 2013-11-18
* jquery.ui.position.js
*
* http://jqueryui.com
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT
*/
//TODO: Get rid of this coding when jQuery UI 1.8 is no longer supported and the framework was switched to jQuery UI 1.9 ff.
function _migrateDataTojQueryUI110(data){
var withinElement = jQuery(window);
data.within = {
element: withinElement,
isWindow: true,
offset: withinElement.offset() || { left: 0, top: 0 },
scrollLeft: withinElement.scrollLeft(),
scrollTop: withinElement.scrollTop(),
width: withinElement.width(),
height: withinElement.height()
};
data.collisionPosition = {
marginLeft: 0,
marginTop: 0
};
return data;
}
var _pos_jQueryUI110 = {
fit: {
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = withinOffset - collisionPosLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
newOverRight;
// element is wider than within
if ( data.collisionWidth > outerWidth ) {
// element is initially over the left side of within
if ( overLeft > 0 && overRight <= 0 ) {
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
position.left += overLeft - newOverRight;
// element is initially over right side of within
} else if ( overRight > 0 && overLeft <= 0 ) {
position.left = withinOffset;
// element is initially over both left and right sides of within
} else {
if ( overLeft > overRight ) {
position.left = withinOffset + outerWidth - data.collisionWidth;
} else {
position.left = withinOffset;
}
}
// too far left -> align with left edge
} else if ( overLeft > 0 ) {
position.left += overLeft;
// too far right -> align with right edge
} else if ( overRight > 0 ) {
position.left -= overRight;
// adjust based on position and margin
} else {
position.left = Math.max( position.left - collisionPosLeft, position.left );
}
},
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = withinOffset - collisionPosTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
newOverBottom;
// element is taller than within
if ( data.collisionHeight > outerHeight ) {
// element is initially over the top of within
if ( overTop > 0 && overBottom <= 0 ) {
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
position.top += overTop - newOverBottom;
// element is initially over bottom of within
} else if ( overBottom > 0 && overTop <= 0 ) {
position.top = withinOffset;
// element is initially over both top and bottom of within
} else {
if ( overTop > overBottom ) {
position.top = withinOffset + outerHeight - data.collisionHeight;
} else {
position.top = withinOffset;
}
}
// too far up -> align with top
} else if ( overTop > 0 ) {
position.top += overTop;
// too far down -> align with bottom edge
} else if ( overBottom > 0 ) {
position.top -= overBottom;
// adjust based on position and margin
} else {
position.top = Math.max( position.top - collisionPosTop, position.top );
}
}
},
flip: {
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = collisionPosLeft - offsetLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
/*eslint-disable no-nested-ternary */
myOffset = data.my[ 0 ] === "left" ?
-data.elemWidth :
data.my[ 0 ] === "right" ?
data.elemWidth :
0,
atOffset = data.at[ 0 ] === "left" ?
data.targetWidth :
data.at[ 0 ] === "right" ?
-data.targetWidth :
0,
/*eslint-enable no-nested-ternary */
offset = -2 * data.offset[ 0 ],
newOverRight,
newOverLeft;
if ( overLeft < 0 ) {
newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
if ( newOverRight < 0 || newOverRight < Math.abs( overLeft ) ) {
position.left += myOffset + atOffset + offset;
}
}
else if ( overRight > 0 ) {
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
if ( newOverLeft > 0 || Math.abs( newOverLeft ) < overRight ) {
position.left += myOffset + atOffset + offset;
}
}
},
top: function( position, data ) {
var within = data.within,
withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height,
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = collisionPosTop - offsetTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
top = data.my[ 1 ] === "top",
/*eslint-disable no-nested-ternary */
myOffset = top ?
-data.elemHeight :
data.my[ 1 ] === "bottom" ?
data.elemHeight :
0,
atOffset = data.at[ 1 ] === "top" ?
data.targetHeight :
data.at[ 1 ] === "bottom" ?
-data.targetHeight :
0,
/*eslint-enable no-nested-ternary */
offset = -2 * data.offset[ 1 ],
newOverTop,
newOverBottom;
if ( overTop < 0 ) {
newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < Math.abs( overTop ) ) ) {
position.top += myOffset + atOffset + offset;
}
}
else if ( overBottom > 0 ) {
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || Math.abs( newOverTop ) < overBottom ) ) {
position.top += myOffset + atOffset + offset;
}
}
}
},
flipfit: {
left: function() {
_pos_jQueryUI110.flip.left.apply( this, arguments );
_pos_jQueryUI110.fit.left.apply( this, arguments );
},
top: function() {
_pos_jQueryUI110.flip.top.apply( this, arguments );
_pos_jQueryUI110.fit.top.apply( this, arguments );
}
}
};
jQuery.ui.position._sapUiCommonsMenuFlip = {
left: function(position, data){
if (jQuery.ui.position.flipfit) { //jQuery UI 1.9 ff.
jQuery.ui.position.flipfit.left.apply(this, arguments);
return;
}
//jQuery UI 1.8
data = _migrateDataTojQueryUI110(data);
_pos_jQueryUI110.flipfit.left.apply(this, arguments);
},
top: function(position, data){
if (jQuery.ui.position.flipfit) { //jQuery UI 1.9 ff.
jQuery.ui.position.flipfit.top.apply(this, arguments);
return;
}
//jQuery UI 1.8
data = _migrateDataTojQueryUI110(data);
_pos_jQueryUI110.flipfit.top.apply(this, arguments);
}
};
//******************** jQuery UI 1.10.3 End **************************
})(window);
return Menu;
}, /* bExport= */ true);
|
"use strict";
/**
* Created by Alex Levshin on 20/7/16.
*/
var RootFolder = process.env.ROOT_FOLDER;
var ApiMajorVersion = process.env.API_MAJOR_VERSION;
if (!global.rootRequire) {
global.rootRequire = function (name) {
return require(RootFolder + '/' + name);
};
}
var restify = require('restify');
var _ = require('lodash');
var config = rootRequire('config');
var expect = require('chai').expect;
var SubVersion = config.restapi.getLatestVersion().sub; // YYYY.M.D
var util = require('util');
require('log-timestamp');
var WorktyRepositoryCodePath = RootFolder + '/workties-repository';
var Q = require('Q');
var RestApiHelper = (function () {
var Workties = [
{
name: 'with-delay',
path: 'unsorted/nodejs/unit-tests/with-delay.zip'
},
{
name: 'without-delay',
path: 'unsorted/nodejs/unit-tests/without-delay.zip'
}
];
var ApiPrefix = '/api/v' + ApiMajorVersion;
// Init the test client using supervisor account (all acl permissions)
var adminClient = restify.createJsonClient({
version: SubVersion,
url: config.restapi.getConnectionString(),
headers: {
'Authorization': 'Basic ' + new Buffer(config.supervisor.email + ':' + config.supervisor.password).toString('base64') // supervisor
},
rejectUnauthorized: false
});
function _error(data) {
var msg = util.inspect(data, { depth: null });
console.error(msg);
}
function _debug(data) {
var msg = util.inspect(data, { depth: null });
console.log(msg);
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '_' + s4() + '_' + s4() + '_' + s4() + '_' + s4() + s4() + s4();
}
var _createPromises = function(callback, count) {
var promises = [];
for (var idx = 0; idx < count; idx++) {
promises.push(callback(idx));
}
return promises;
};
var _createRegularUserAccount = function() {
return new Q.Promise(function (resolve, reject) {
try {
var name = 'regular_user_' + guid();
adminClient.post(ApiPrefix + '/accounts', {
name: name,
email: name + '@workty.com',
password: name
}, function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _deleteRegularUserAccount = function(regularUser) {
if (!regularUser) return Q.resolve();
return new Q.Promise(function (resolve, reject) {
try {
adminClient.del(ApiPrefix + '/accounts/' + regularUser._id + '?removing=true', function (err, req, res, data) {
resolve({res: res});
});
} catch (ex) {
reject(ex);
}
});
};
var _loginRegularUserAccount = function(email, password) {
return new Q.Promise(function (resolve, reject) {
try {
var regularUserClient = restify.createJsonClient({
version: SubVersion,
url: config.restapi.getConnectionString(),
headers: {
'Authorization': 'Basic ' + new Buffer(email + ':' + password).toString('base64')
},
rejectUnauthorized: false
});
resolve({data: regularUserClient});
} catch (ex) {
reject(ex);
}
});
};
var _createWorktyTemplate = function(worktyParams) {
return new Q.Promise(function (resolve, reject) {
try {
var workty = _.find(Workties, function(obj) {
return obj.name === worktyParams.name;
});
var name = workty.name + '_' + guid();;
var compressedCode = fs.readFileSync(WorktyRepositoryCodePath + '/' + workty.path);
adminClient.post(ApiPrefix + '/workties', {
name: name,
desc: name,
compressedCode: compressedCode,
template: true
}, function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _deleteWorkty = function(worktyId) {
if (!worktyId) return Q.resolve();
return new Q.Promise(function (resolve, reject) {
try {
adminClient.del(ApiPrefix + '/workties/' + worktyId, function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _getAllWorkties = function(regularUserClient) {
return new Q.Promise(function (resolve, reject) {
try {
var client = regularUserClient || adminClient;
client.get(ApiPrefix + '/workties', function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _buyWorktyTemplate = function(regularUserClient, worktyTemplateId) {
return new Q.Promise(function (resolve, reject) {
try {
regularUserClient.post(ApiPrefix + '/payments', {worktyId: worktyTemplateId}, function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _createWorkflow = function(regularUserClient) {
return new Q.Promise(function (resolve, reject) {
try {
var name = 'workflow' + '_' + guid();
regularUserClient.post(ApiPrefix + '/workflows', {
name: name,
desc: name
}, function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _deleteWorkflow = function(regularUserClient, workflowId) {
if (!workflowId) return Q.resolve();
return new Q.Promise(function (resolve, reject) {
try {
regularUserClient.del(ApiPrefix + '/workflows/' + workflowId, function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _createWorktyInstance = function(regularUserClient, worktyId, workflowId) {
return new Q.Promise(function (resolve, reject) {
try {
var name = 'worktyinstance' + '_' + guid();
regularUserClient.post(ApiPrefix + '/workflows/' + workflowId + '/worktiesInstances', {
name: name,
desc: name,
worktyId: worktyId,
embed: 'properties'
}, function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _runWorkflow = function (regularUserClient, workflowId) {
return new Q.Promise(function (resolve, reject) {
try {
regularUserClient.put(ApiPrefix + '/workflows/' + workflowId + '/running', function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _stopWorkflow = function (regularUserClient, workflowId) {
return new Q.Promise(function (resolve, reject) {
try {
regularUserClient.del(ApiPrefix + '/workflows/' + workflowId + '/running', function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
var _getWorkflowState = function (regularUserClient, workflowId, worktiesInstancesIds) {
var worktiesInstancesIdsPromises = [];
var _createWorktyInstancePromise = function(worktyInstanceId) {
return new Q.Promise(function (resolve, reject) {
try {
//_debug(ApiPrefix + '/workflows/' + workflowId + '/worktiesInstances/' + worktyInstanceId);
regularUserClient.get(ApiPrefix + '/workflows/' + workflowId + '/worktiesInstances/' + worktyInstanceId + '?embed=state', function (err, req, res, data) {
resolve({res: res, data: data});
});
} catch (ex) {
reject(ex);
}
});
};
for (var idx = 0; idx < worktiesInstancesIds.length; idx++) {
var promise = _createWorktyInstancePromise(worktiesInstancesIds[idx]);
worktiesInstancesIdsPromises.push(promise);
}
return Q.all(worktiesInstancesIdsPromises);
};
var _init = function(numOfWorkflows, numOfWorktiesIntances, numOfWorkties, userIdx) {
var regularUser, regularUserClient;
var workflowsIds = [];
var worktiesTemplatesIds = [];
var worktiesOwnIds = [];
var worktiesInstances = [];
return new Q.Promise(function (resolve, reject) {
_debug('[supervisor] Begin init');
_debug('[supervisor] Create regular user #' + userIdx);
// Create regular user (use name as password)
var promise = _createRegularUserAccount();
var _onFail = function(err) {
_error(err);
reject(err);
};
// Login as regular user
Q.delay(1500).then(function _onSuccess(results) {
_debug('Wait 1500 msec...');
return promise;
})
.then(function _onSuccess(results) {
expect(results.res.statusCode).to.equals(201);
expect(results.data).to.not.be.empty;
regularUser = results.data;
_debug('[' + regularUser._id + '] Login as regular user');
return _loginRegularUserAccount(regularUser.email, regularUser.name);
}, _onFail)
.then(function _onSuccess(results) {
expect(results.data).to.not.be.empty;
_debug('[' + regularUser._id + '] Get templates and owned workties');
regularUserClient = results.data;
return _getAllWorkties(regularUserClient);
}, _onFail)
.then(function _onSuccess(results) {
expect(results.res.statusCode).to.equals(200);
expect(results.data).to.not.be.empty;
_.forEach(results.data, function(workty) {
if (workty.template === true) {
worktiesTemplatesIds.push(workty._id);
}
});
var buyWorktiesPromises = [];
for (var idx = 0; idx < numOfWorkties; idx++) {
(function(i) {
_debug('[' + regularUser._id + '] Buy workty #' + (i + 1));
buyWorktiesPromises.push(_buyWorktyTemplate(regularUserClient, worktiesTemplatesIds[i]));
})(idx);
}
return Q.all(buyWorktiesPromises);
}, _onFail)
.then(function _onSuccess(results) {
for (var idx = 0; idx < numOfWorkties; idx++) {
(function(i) {
expect(results[i].res.statusCode).to.equals(201);
expect(results[i].data).to.not.be.empty;
worktiesOwnIds.push(results[i].data.worktyId);
})(idx);
}
var createWorfklowsPromises = [];
for (idx = 0; idx < numOfWorkflows; idx++) {
_debug('[' + regularUser._id + '] Create workflow #' + (idx + 1));
createWorfklowsPromises.push(_createWorkflow(regularUserClient));
}
return Q.all(createWorfklowsPromises);
}, _onFail)
.then(function _onSuccess(results) {
for (var idx = 0; idx < numOfWorkflows; idx++) {
(function(i) {
expect(results[i].res.statusCode).to.equals(201);
expect(results[i].data).to.not.be.empty;
workflowsIds.push(results[i].data._id);
})(idx);
}
var createWorktyInstancePromises = [];
for (var workflowIdx = 0; workflowIdx < numOfWorkflows; workflowIdx++) {
for (var worktyInstanceIdx = 0; worktyInstanceIdx < numOfWorktiesIntances; worktyInstanceIdx++) {
(function(i, j) {
_debug('[' + regularUser._id + '] Create workty instance #' + (j + 1) + ' for workflow #' + (i + 1));
var worktyIdx = getRandomInt(0, numOfWorkties);
createWorktyInstancePromises.push(_createWorktyInstance(regularUserClient, worktiesOwnIds[worktyIdx], workflowsIds[i]));
})(workflowIdx, worktyInstanceIdx);
}
}
return Q.all(createWorktyInstancePromises);
}, _onFail)
.then(function _onSuccess(results) {
for (var idx = 0; idx < results.length; idx++) {
(function(i) {
expect(results[i].res.statusCode).to.equals(201);
expect(results[i].data).to.not.be.empty;
worktiesInstances.push(results[i].data);
})(idx);
}
}, _onFail)
.finally(function() {
_debug('[' + regularUser._id + '] End init');
resolve({regularUser: regularUser, regularUserClient: regularUserClient, workflowsIds: workflowsIds, worktiesInstances: worktiesInstances, worktiesOwnIds: worktiesOwnIds});
});
});
};
var _wait = function(regularUserClient, workflowsIds, worktiesInstances, stateToFind) {
var worktiesInstancesGroup = [];
var _createGetWorkflowStatePromise = function(worktiesInstancesGroup) {
return new Q.Promise(function (resolve, reject) {
//_debug(worktiesInstancesGroup);
_getWorkflowState(regularUserClient, worktiesInstancesGroup.workflowId, worktiesInstancesGroup.worktiesInstancesIds)
.then(function _onSuccess(results) {
//_debug(results.length);
var initialCount = 0;
var runningCount = 0;
var waitingCount = 0;
var completedCount = 0;
for (var idx = 0; idx < results.length; idx++) {
(function (i) {
// _debug(results[i].res.statusCode + ',' + results[i].data._id.toString() + ',' + results[i].data.stateId.name);
if (results[i].res.statusCode !== 500) {
switch (results[i].data.stateId.name) {
case 'initial':
++initialCount;
break;
case 'running':
++runningCount;
break;
case 'waiting':
++waitingCount;
break;
case 'completed':
++completedCount;
break;
}
if (results[i].data.stateId.name === stateToFind) {
worktiesInstancesGroup.worktiesInstancesIds = _.dropWhile(worktiesInstancesGroup.worktiesInstancesIds, function _onEachWorktyInstance(worktyInstanceId) {
return worktyInstanceId === results[i].data._id;
});
}
} else {
_error('Workflow ' + worktiesInstancesGroup.workflowId + ' has status code ' + results[i].res.statusCode);
reject({err: results[i].res.statusCode, workflowId: worktiesInstancesGroup.workflowId});
}
if (i === results.length - 1) {
resolve({data: {
workflowId: worktiesInstancesGroup.workflowId,
stats: {
initial: initialCount,
waiting: waitingCount,
running: runningCount,
completed: completedCount
}}});
}
})(idx);
}
}, function _onError(err) {
_error(err);
reject({err: err, workflowId: worktiesInstancesGroup.workflowId});
});
});
};
for (var workflowIdx = 0; workflowIdx < workflowsIds.length; workflowIdx++) {
var workflowId = workflowsIds[workflowIdx];
var filtered = _.filter(worktiesInstances, function(worktyInstance) {
return worktyInstance.workflowId.toString() === workflowId;
});
filtered = filtered.map(function (worktyInstance) {
return worktyInstance._id;
});
worktiesInstancesGroup.push({workflowId: workflowId, worktiesInstancesIds: filtered});
}
var worktiesInstancesGroupPromises = [];
for (var idx = 0; idx < worktiesInstancesGroup.length; idx++) {
(function(i) {
worktiesInstancesGroupPromises.push(_createGetWorkflowStatePromise(worktiesInstancesGroup[i]));
})(idx);
}
return Q.allSettled(worktiesInstancesGroupPromises);
};
var _run = function(regularUserClient, regularUser, workflowsIds) {
var runWorkflowsPromises = [];
for (var idx = 0; idx < workflowsIds.length; idx++) {
(function(i) {
_debug('[' + regularUser._id + '] Run workflow ' + workflowsIds[i]);
runWorkflowsPromises.push(_runWorkflow(regularUserClient, workflowsIds[i]));
})(idx);
}
return Q.allSettled(runWorkflowsPromises);
};
var _stop = function(regularUserClient, regularUser, workflowsIds) {
var stopWorkflowsPromises = [];
for (var idx = 0; idx < workflowsIds.length; idx++) {
(function(i) {
_debug('[' + regularUser._id + '] Stop workflow ' + workflowsIds[i]);
stopWorkflowsPromises.push(_stopWorkflow(regularUserClient, workflowsIds[i]));
})(idx);
}
return Q.allSettled(stopWorkflowsPromises);
};
var _doCleanup = function(data, done) {
_debug('[supervisor] Begin all clean up');
var cleanupPromises = [];
_.forEach(data, function _onEachResult(dataResult) {
cleanupPromises.push(_cleanup(dataResult));
});
Q.all(cleanupPromises).then(function (results) {
_debug('[supervisor] End all clean up');
done();
});
};
var _cleanup = function(data) {
return new Q.Promise(function (resolve, reject) {
_debug('[' + data.regularUser._id + '] Begin clean up');
var worktiesPromises = [];
_.forEach(data.worktiesOwnIds, function (worktyOwnId) {
worktiesPromises.push(_deleteWorkty(worktyOwnId));
});
_debug('[' + data.regularUser._id + '] Delete workties');
Q.all(worktiesPromises).then(function _onSuccess(results) {
_.forEach(results, function (result) {
expect(result.res.statusCode).to.equals(204);
});
_debug('[' + data.regularUser._id + '] Delete workflows');
var workflowsPromises = [];
_.forEach(data.workflowsIds, function (workflowId) {
workflowsPromises.push(_deleteWorkflow(data.regularUserClient, workflowId));
});
return Q.all(workflowsPromises);
})
.then(function _onSuccess(results) {
_.forEach(results, function (result) {
expect(result.res.statusCode).to.equals(204);
});
_debug('[' + data.regularUser._id + '] Delete regular user');
return _deleteRegularUserAccount(data.regularUser);
})
.then(function _onSuccess(results) {
expect(results.res.statusCode).to.equals(204);
})
.finally(function () {
_debug('[' + data.regularUser._id + '] End clean up');
resolve();
});
});
};
var _doRunTest = function(usersOptions, pollingTimeoutMs, done) {
var data = [];
var userIdx = 1;
var numOfAllWorkflows = 0;
var lastResult = usersOptions.reduce(function _onEachUserOptions(previousPromise, userOptions) {
return previousPromise.then(function _onSuccess(results) {
if (results) {
data.push(results);
}
numOfAllWorkflows += userOptions.numOfWorkflows;
return _init(userOptions.numOfWorkflows, userOptions.numOfWorktiesInstances, userOptions.numOfWorkties, userIdx++);
});
}, Q.resolve());
lastResult.then(function _onSuccess(results) {
data.push(results);
var lastRunResult = data.reduce(function _onEachResult(previousPromise, result) {
return previousPromise.then(function _onSuccess(results) {
return Q.delay(1000).then(function (results) {
return _run(result.regularUserClient, result.regularUser, result.workflowsIds);
});
});
}, Q.resolve());
return lastRunResult;
})
.then(function _onSuccess(results) {
for (var idx = 0; idx < results.length; idx++) {
for (var jdx = 0; jdx < results[idx].length; jdx++) {
(function (i,j) {
expect(results[i][j].res.statusCode).to.equals(200);
expect(results[i][j].data).to.not.be.empty;
})(idx, jdx);
}
}
var attempt = 0;
var _resolve, _reject;
var _pollingFn = function(resolve, reject) {
if (attempt === 0) {
_resolve = resolve;
_reject = reject;
}
var waitPromises = [];
_.forEach(data, function _onEachUserOptions(dataResult) {
waitPromises.push(_wait(dataResult.regularUserClient, dataResult.workflowsIds, dataResult.worktiesInstances));
})
_debug('Polling attempt: ' + (attempt + 1));
Q.all(waitPromises)
.then(function _onSuccess(results) {
var workflowsCompletedCount = 0;
for (var idx = 0; idx < results.length; idx++) {
for (var jdx = 0; jdx < results[idx].length; jdx++) {
(function (i,j) {
var result = results[i][j].value;
//_error(results[i][j].err);
expect(result.err).to.be.undefined;
expect(result.data).to.not.be.empty;
if (!result.data.err) {
var stats = result.data.stats;
if (stats.completed < (stats.initial + stats.waiting + stats.running)) {
_debug('Workflow ' + result.data.workflowId + ' (initial: ' + stats.initial + ', waiting: ' + stats.waiting + ', running: ' + stats.running + ', completed: ' + stats.completed + ')');
} else {
++workflowsCompletedCount;
}
} else {
_error('Workflow ' + result.data.workflowId + ' has error');
}
if (j === results[i].length - 1 && i === results.length - 1) {
_debug('Workflows ' + workflowsCompletedCount + ' completed');
if (numOfAllWorkflows === workflowsCompletedCount) {
_resolve(results);
} else {
attempt++;
setTimeout(_pollingFn, pollingTimeoutMs);
}
}
})(idx, jdx);
}
}
}, function _onError(err) {
_reject(err);
});
};
return new Q.Promise(_pollingFn);
})
.done(function _onSuccess(results) {
_doCleanup(data, done);
}, function _onError(err) {
_error(err);
_doCleanup(data, done);
});
};
var _doStopTest = function(usersOptions, pollingTimeoutMs, done) {
var data = [];
var userIdx = 1;
var numOfAllWorkflows = 0;
var lastResult = usersOptions.reduce(function _onEachUserOptions(previousPromise, userOptions) {
return previousPromise.then(function _onSuccess(results) {
if (results) {
data.push(results);
}
numOfAllWorkflows += userOptions.numOfWorkflows;
return _init(userOptions.numOfWorkflows, userOptions.numOfWorktiesInstances, userOptions.numOfWorkties, userIdx++);
});
}, Q.resolve());
lastResult.then(function _onSuccess(results) {
data.push(results);
var lastRunResult = data.reduce(function _onEachResult(previousPromise, result) {
return previousPromise.then(function _onSuccess(results) {
return Q.delay(1000).then(function (results) {
return _run(result.regularUserClient, result.regularUser, result.workflowsIds);
});
});
}, Q.resolve());
return lastRunResult;
})
.then(function _onSuccess(results) {
// Stop the all workflows after 10 seconds
return Q.delay(5000).then(function _onSuccess(results) {
var lastStopResult = data.reduce(function _onEachResult(previousPromise, result) {
return previousPromise.then(function _onSuccess(results) {
return Q.delay(1000).then(function (results) {
return _stop(result.regularUserClient, result.regularUser, result.workflowsIds);
});
});
}, Q.resolve());
return lastStopResult;
});
})
.then(function _onSuccess(results) {
var attempt = 0;
var _resolve, _reject;
var _pollingFn = function(resolve, reject) {
if (attempt === 0) {
_resolve = resolve;
_reject = reject;
}
var waitPromises = [];
_.forEach(data, function _onEachUserOptions(dataResult) {
waitPromises.push(_wait(dataResult.regularUserClient, dataResult.workflowsIds, dataResult.worktiesInstances, 'initial'));
});
_debug('Polling attempt (initial): ' + (attempt + 1));
Q.all(waitPromises)
.then(function _onSuccess(results) {
var workflowsInitialCount = 0;
for (var idx = 0; idx < results.length; idx++) {
for (var jdx = 0; jdx < results[idx].length; jdx++) {
(function (i, j) {
var result = results[i][j].value;
expect(result.err).to.be.undefined;
expect(result.data).to.not.be.empty;
if (!result.data.err) {
var stats = result.data.stats;
if (stats.completed !== 0 || stats.waiting !== 0 || stats.running !== 0) {
_debug('Workflow ' + result.data.workflowId + ' (initial: ' + stats.initial + ', waiting: ' + stats.waiting + ', running: ' + stats.running + ', completed: ' + stats.completed + ')');
} else {
++workflowsInitialCount;
}
} else {
_error('Workflow ' + result.data.workflowId + ' has error');
}
if (j === results[i].length - 1 && i === results.length - 1) {
if (numOfAllWorkflows === workflowsInitialCount) {
_resolve(results);
} else {
attempt++;
setTimeout(_pollingFn, pollingTimeoutMs);
}
}
})(idx, jdx);
}
}
}, function _onError(err) {
_reject(err);
});
};
return new Q.Promise(_pollingFn);
})
.then(function _onSuccess(results) {
// Run the all workflows after 10 seconds
return Q.delay(5000).then(function _onSuccess(results) {
var lastRunResult = data.reduce(function _onEachResult(previousPromise, result) {
return previousPromise.then(function _onSuccess(results) {
return Q.delay(1000).then(function (results) {
return _run(result.regularUserClient, result.regularUser, result.workflowsIds);
});
});
}, Q.resolve());
return lastRunResult;
});
})
.then(function _onSuccess(results) {
for (var idx = 0; idx < results.length; idx++) {
for (var jdx = 0; jdx < results[idx].length; jdx++) {
(function (i, j) {
expect(results[i][j].res.statusCode).to.equals(200);
expect(results[i][j].data).to.not.be.empty;
})(idx, jdx);
}
}
var attempt = 0;
var _resolve, _reject;
var _pollingFn = function(resolve, reject) {
if (attempt === 0) {
_resolve = resolve;
_reject = reject;
}
var waitPromises = [];
_.forEach(data, function _onEachUserOptions(dataResult) {
waitPromises.push(_wait(dataResult.regularUserClient, dataResult.workflowsIds, dataResult.worktiesInstances, 'completed'));
});
_debug('Polling attempt (completed): ' + (attempt + 1));
Q.all(waitPromises)
.then(function _onSuccess(results) {
var workflowsCompletedCount = 0;
for (var idx = 0; idx < results.length; idx++) {
for (var jdx = 0; jdx < results[idx].length; jdx++) {
(function (i,j) {
var result = results[i][j].value;
//_error(results[i][j].err);
expect(result.err).to.be.undefined;
expect(result.data).to.not.be.empty;
if (!result.data.err) {
var stats = result.data.stats;
if (stats.completed < (stats.initial + stats.waiting + stats.running)) {
_debug('Workflow ' + result.data.workflowId + ' (initial: ' + stats.initial + ', waiting: ' + stats.waiting + ', running: ' + stats.running + ', completed: ' + stats.completed + ')');
} else {
++workflowsCompletedCount;
}
} else {
_error('Workflow ' + result.data.workflowId + ' has error');
}
if (j === results[i].length - 1 && i === results.length - 1) {
_debug('Workflows ' + workflowsCompletedCount + ' completed');
if (numOfAllWorkflows === workflowsCompletedCount) {
_resolve(results);
} else {
attempt++;
setTimeout(_pollingFn, pollingTimeoutMs);
}
}
})(idx, jdx);
}
}
}, function _onError(err) {
_reject(err);
});
};
return new Q.Promise(_pollingFn);
})
.done(function _onSuccess(results) {
_doCleanup(data, done);
}, function _onError(err) {
_error(err);
_doCleanup(data, done);
});
};
return {
createPromises: _createPromises,
createRegularUserAccount: _createRegularUserAccount,
deleteRegularUserAccount:_deleteRegularUserAccount,
loginRegularUserAccount: _loginRegularUserAccount,
createWorktyTemplate: _createWorktyTemplate,
deleteWorkty: _deleteWorkty,
buyWorktyTemplate: _buyWorktyTemplate,
getAllWorkties: _getAllWorkties,
createWorkflow: _createWorkflow,
deleteWorkflow: _deleteWorkflow,
createWorktyInstance: _createWorktyInstance,
runWorkflow: _runWorkflow,
stopWorkflow: _stopWorkflow,
getWorkflowState: _getWorkflowState,
doRunTest: _doRunTest,
doStopTest: _doStopTest
}
})();
module.exports = RestApiHelper;
|
version https://git-lfs.github.com/spec/v1
oid sha256:063f6ba5d50dd634d984e3942bef243522bca2dba6bb582bcb5d6f3bb1e7e7fd
size 48399
|
version https://git-lfs.github.com/spec/v1
oid sha256:d2ec0a232cd460b5c608fb1fb2e3f538b04257c5d2e37ce220daecf9c8404864
size 691
|
/// <binding BeforeBuild='less' AfterBuild='less' />
// This file in the main entry point for defining grunt tasks and using grunt plugins.
// Click here to learn more. http://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {
options: {
targetDir: "Scripts",
layout: "byComponent"
//cleanTargetDir: true
}
}
},
concat: {
options: {
separator: ';'
},
install: {
src: [
// 'bower_components/jquery/dist/jquery.min.js',
'bower_components/angular/angular.min.js',
'bower_components/angular-animate/angular-animate.min.js',
'bower_components/angular-route/angular-route.min.js'
],
dest: 'Scripts/sitescripts.js'
},
dist: {
src: ['dev/*.js','dev/nonApp/*.js'],
dest: 'Scripts/nonApp.js'
},
angularApp: {
src: ['dev/app/*.js'],
dest: 'app/app-main.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'Scripts/nonApp.min.js': ['<%= concat.dist.dest %>']
}
},
angularApp: {
files: {
'app/app-main.min.js':['<%= concat.angularApp.dest %>']
}
}
},
jshint: {
files: ['Gruntfile.js', 'dev/**/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
sass: {
development: {
options: {
style: 'expanded'
},
files: { "Content/site.css": "sass/site.scss" }
}
},
compass: {
options: {
config: 'config.rb'
},
dist: {
options: {
// sassDir: 'sass',
//cssDir: 'wwwroot/stylesheets'
}
}
},
connect: {
server: {
options: {
port: 9001,
hostname: 'localhost',
base: '',
keepalive:true
}
}
},
watch: {
options: {
livereload: true
},
js: {
files: ['<%= jshint.files %>' ],
tasks: ['jshint','concat:dist', 'concat:angularApp' ,'uglify'],
options:{
reload: true//,
// livereload: true
},
},
css: {
files: ['index.html' ,'app/**/*.html' , 'sass/*.scss'],
tasks: ['compass'],
options: {
// livereload: true,
},
},
html: {
files: ['index.html' ,'app/**/*.html' ,'Content/*.css'],
//tasks: ['compass'],
options: {
//livereload: true,
},
},
}
});
// The following line loads the grunt plugins.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
// grunt.loadNpmTasks('grunt-wiredep');
grunt.loadNpmTasks("grunt-bower-task");
grunt.loadNpmTasks("grunt-contrib-sass");
grunt.loadNpmTasks('grunt-contrib-compass');
// Grunt Tasks;
grunt.registerTask("default", ["bower:install" , "concat"]);
grunt.registerTask("serve", ["connect"]);
grunt.registerTask("css", ["watch:css"]);
grunt.registerTask("html", ["watch:html"]);
}; |
// JavaScript Document
var api;
var w;
$(function(){
$(".info_slides").each(function(){
var cur = $(this);
cur.children('li').children('a').click(function(){
var cur_li = $(this).closest('li');
cur_li.toggleClass('active');
cur_li.children('.text').slideToggle(300);
cur_li.siblings().removeClass('active').children('.text').slideUp(300);
return false;
})
})
$('.checkbox').each(function(){
var cur = $(this);
var label = cur.find('label');
var checkbox = cur.find('input[type="checkbox"]');
if(checkbox.attr('checked') || checkbox.attr('checked') == 'checked'){
label.addClass('active');
}
label.on('click', function(){
label.toggleClass('active');
checkbox.removeClass('error');
if(label.hasClass('active')){
checkbox.attr('checked', true);
} else {
checkbox.attr('checked', false);
}
})
})
$('.contact_form input[type="text"], .contact_form textarea').on('keyup', function(){
$(this).removeClass('error');
})
w = $(window).width();
if($(".fullwidthbanner").length) {
$('.fullwidthbanner').revolution({
delay:9000,
startheight:520,
startwidth:960,
navigationType:"none", //bullet, thumb, none, both (No Thumbs In FullWidth Version !)
navigationArrows:"nexttobullets", //nexttobullets, verticalcentered, none
navigationStyle:"round", //round,square,navbar
touchenabled:"on", // Enable Swipe Function : on/off
onHoverStop:"on", // Stop Banner Timet at Hover on Slide on/off
navOffsetHorizontal:0,
navOffsetVertical:20,
stopAtSlide:-1,
stopAfterLoops:-1,
fullWidth:"on" // Turns On or Off the Fullwidth Image Centering in FullWidth Modus
});
}
topMenu();
footer();
carousels();
infoDeviders();
if($(".fancy").length){
$("a.fancy").fancybox({
'padding' : 10,
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : 600,
'speedOut' : 200,
'overlayShow' : true,
'hideOnContentClick' : true,
'hideOnOverlayClick' : true,
'enableEscapeButton' : true
});
}
if($(".fancy-video").length){
$("a.fancy-video").click(function() {
$.fancybox({
'padding' : 0,
'autoScale' : false,
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'title' : this.title,
'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
'type' : 'swf',
'swf' : {
'wmode' : 'transparent',
'allowfullscreen' : 'true'
}
});
return false;
});
}
})
$(window).resize(function(){
w = $(window).width();
footer();
carousels();
infographBottom();
fixedHeader();
blockPosition($('#main_advert .slide img'));
})
$(window).load(function(){
infographBottom();
blockPosition($('#main_advert .slide img'));
$('body').css('visibility', 'visible');
processBox();
initProgressBarWithImage();
progress_bars();
easePieChart();
trends();
var hash = location.hash;
if(hash) {
$("#top_menu li a[href='" + hash + "']").click();
}
fixedHeader();
})
function fixedHeader(){
if(w > 979){
var h_bar = $('.notify-bar').outerHeight();
var h_header = $('#header .inner').height();
$('#header').css('height', h_header);
} else {
$('#header').removeAttr('style');
}
$(".notify-close").click(function(){
var speed = 300;
$(".notify-bar").slideUp(speed);
if(w > 979) $('#header').animate({
'height': '-=' + h_bar + 'px'
}, speed);
return false;
});
}
function topMenu(){
var scrollByClick = false;
$("#top_menu li a").click(function(){
var href = $(this).attr('href');
if(href.search('_anchor') != -1){
href = href.replace('_anchor', '_marker');
if($(href).length){
scrollByClick = true;
var position = $(href).offset().top;
$('body, html').animate({
scrollTop: position - 120
}, 500);
setTimeout(function(){
scrollByClick = false;
}, 500);
return false;
}
}
});
$("#top_menu select").change(function(){
var href = $(this).val();
if(href.search('_anchor') != -1){
href = href.replace('_anchor', '_marker');
scrollByClick = true;
var position = $(href).offset().top;
$('body, html').animate({
scrollTop: position
}, 500);
setTimeout(function(){
scrollByClick = false;
}, 500);
}
});
var markers = $('[id*="_marker"]');
var top = $(window).scrollTop();
var setActive = function(){
markers.each(function(){
var name_marker = '#' + $(this).attr('id');
if(!scrollByClick) {
var position = $(this).offset().top;
var name_anchor = name_marker.replace('_marker', '_anchor');
if(top >= position - $("#header .inner").outerHeight()){
$("#top_menu li a[href='" + name_anchor + "']").closest('li').addClass('active').siblings().removeClass('active');
$("#top_menu select option[value='" + name_anchor + "']").attr('selected', true).siblings().attr('selected', false);
}
}
})
}
setActive();
$(window).scroll(function(){
top = $(window).scrollTop();
if(top > 15 && w > 768) {
$("#header").addClass('fixed');
} else {
$("#header").removeClass('fixed');
}
setActive();
})
}
function footer(){
var h = $("#footer").height();
$("#footer").css('margin-top', -(h + parseInt($("#container").css('padding-bottom'))));
$("#empty").css('height', h - 19);
}
var carousel_enable;
function carousels(){
$(".carousel ul").trigger("destroy", true);
if(w > 768) {
$(".carousel").each(function(){
var ul = $(this).find('ul');
var prev_arr = $(this).find('.left_arr');
var next_arr = $(this).find('.right_arr');
ul.carouFredSel({
width : "100%",
align: 'left',
prev: {
button: prev_arr
},
next: {
button: next_arr
},
auto: false
});
})
}
}
function infographBottom(){
var h = 0;
$('.infograph .desc').each(function(){
var height = $(this).outerHeight();
if(height > h) h = height;
})
if(h < 153) h = 153;
$('#wrapper .infograph > sup').css('height', h);
}
function blockPosition(obj, relative){
obj.each(function(index, element) {
var w = $(this).width();
var h = $(this).height();
var d = w/h;
if(relative) {
var parent = relative;
} else {
var parent = $(this).parent();
}
var border_top_p = parseInt(parent.css('border-top')) ? parseInt(parent.css('border-top')) : 0;
var border_bottom_p = parseInt(parent.css('border-bottom')) ? parseInt(parent.css('border-bottom')) : 0;
var border_left_p = parseInt(parent.css('border-left')) ? parseInt(parent.css('border-left')) : 0;
var border_right_p = parseInt(parent.css('border-right')) ? parseInt(parent.css('border-right')) : 0;
var w_p = parent.outerWidth() - border_left_p - border_right_p;
var h_p = parent.outerHeight() - border_top_p - border_bottom_p;
var d_p = w_p/h_p;
if(d > d_p) {
h = h_p;
w = h*d;
m = "0 0 0 " + (-w/2) + "px";
l = "50%";
t = 0;
} else {
w = w_p;
h = w/d;
m = -h/2 + "px 0 0 0";
t = "50%";
l = 0;
}
var position = $(this).css('position');
if(position != 'relative' && position != 'absolute') position = 'absolute';
$(this).css({
"width": w + "px",
"height" : h + "px",
"margin": m,
"top": t,
"left": l,
"position": position
});
});
}
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function(){
$("html, body").animate({
scrollTop: 0
}, 600);
return false;
});
$(document).ready(function() {
$("#clients-slider, #results-slider, #awards-slider").owlCarousel({
navigation : false, // Show next and prev buttons
slideSpeed : 300,
paginationSpeed : 400,
singleItem:true,
pagination: true
});
});
$( "#item1" ).click(function() {
$( "#property-item1" ).removeClass("property-hidden")
});
$( "#item2" ).click(function() {
$( "#property-item2" ).removeClass("property-hidden")
});
$( "#item3" ).click(function() {
$( "#property-item3" ).removeClass("property-hidden")
});
$( "#item4" ).click(function() {
$( "#property-item4" ).removeClass("property-hidden")
});
$( "#item5" ).click(function() {
$( "#property-item5" ).removeClass("property-hidden")
});
$( "#item6" ).click(function() {
$( "#property-item6" ).removeClass("property-hidden")
});
$(".close-details").click(function() {
$(".property-item").slideUp(500);
});
$('.property-link').on('click', function(){
moreBlock = $(this).closest('.more');
moreBlock.addClass('load');
var id = $(this).attr('id').replace('item', '');
var block = $('#property-item' + id);
if($('.property-item:visible').length && !$('.property-item:visible').is(block)){
$('.property-item').hide();
block.show();
var time = 0;
} else {
var time = 500;
block.slideDown(time);
}
setTimeout(function(){
var topP = block.offset().top - 20;
if(window.innerWidth > 979) topP -= $('#header').height();
var topNow = $(window).scrollTop();
var speed = (topP - topNow)*0.8;
if(!block.hasClass('init')){
var slider = block.find('.royalSlider');
var map = block.find('.map');
var tabsBlock = block.find('.tabs');
map_initialize(map);
tabs(tabsBlock);
rsSlider(slider);
var t = setInterval(function(){
if(slider.hasClass('rendered')) {
block.addClass('init');
clearInterval(t);
$('html, body').animate({scrollTop: topP}, speed);
moreBlock.removeClass('load');
}
}, 100)
} else {
$('html, body').animate({scrollTop: topP}, speed);
moreBlock.removeClass('load');
}
}, time)
return false;
})
});
function tabs(tabsBlock){
tabsBlock.each(function(index, element) {
var curObject = $(this);
if(!curObject.children("li.active").length) curObject.children("li:first").addClass("active").siblings("li").removeClass("active");
curObject.siblings(".tabs_blocks").children("div").eq(curObject.children("li.active").index()).css('height', 'auto').siblings().css('height', '0');
curObject.children("li").each(function(index, element) {
$(this).children("a").bind("click", function(){
$(this).parent().addClass("active").siblings("li").removeClass("active");
curObject.siblings(".tabs_blocks").children("div").eq(curObject.children("li.active").index()).css('height', 'auto').siblings(":visible").css('height', '0');
return false;
})
});
});
}
function rsSlider(slider){
slider.royalSlider({
fullscreen: {
enabled: false,
nativeFS: true
},
controlNavigation: 'thumbnails',
autoScaleSlider: true,
autoScaleSliderWidth: 960,
autoScaleSliderHeight: 850,
loop: false,
imageScaleMode: 'fit',
navigateByClick: true,
numImagesToPreload:2,
arrowsNav:true,
arrowsNavAutoHide: true,
arrowsNavHideOnTouch: true,
keyboardNavEnabled: true,
fadeinLoadedSlide: true,
globalCaption: false,
globalCaptionInside: false,
thumbs: {
appendSpan: true,
firstMargin: true
}
});
slider.addClass('rendered');
}
map();
function map(){
google.load('maps', '3', {
other_params: 'sensor=false'
});
}
function map_initialize(mapBlock) {
mapBlock.each(function(){
var currMap = $(this);
var coordinates = $(this).data('coordinates').split(',');
var title = $(this).data('title');
var myMarker = new google.maps.LatLng(coordinates[0],coordinates[1]);
map = new google.maps.Map( this, {
zoom: 14,
scrollwheel: false,
center: myMarker,
disableDefaultUI: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var marker1 = new google.maps.Marker({
position: myMarker,
map: map,
title: title,
icon: 'img/map_marker2.png'
});
google.maps.event.addDomListener(window, 'resize', function() {
map.setCenter(myMarker);
});
})
} |
iris.ui(function (self) {
"use strict";
// self.settings({
// name : 'value'
// });
// var resource = iris.resource(iris.path.resource);
// var model = iris.model(iris.path.model);
self.create = function() {
self.tmpl(iris.path.ui.{{component}}.html);
// self.listen(model, 'event', fn);
};
// self.awake = function () {
// self.resumeListeners();
// };
// self.sleep = function () {
// self.pauseListeners();
// };
// self.destroy = function () {
// self.removeListeners();
// };
}, iris.path.ui.{{component}}.js);
|
(function() {
'use strict';
function Menubar($rootScope, $state, Authentication) {
var link = function($scope, $element, $attrs) {
var $menuOptions = $element.find('li.option');
var $collapsibleOptions = $element.find('.collapsible-container');
var $submenuOptions = $element.find('.collapsible-body li');
$scope.currentUser = Authentication.user;
$scope.onMenuOptionSelected = function($event) {
var $selectedOption = angular.element($event.currentTarget);
$scope.deactiveAllMenuOptions();
deactiveAllCollapsibleOptions();
deactiveAllSubmenuOptions();
$selectedOption.addClass('active bold');
};
$scope.deactiveAllMenuOptions = function() {
$menuOptions.removeClass('active bold');
};
var deactiveAllCollapsibleOptions = function() {
$collapsibleOptions.removeClass('active bold');
$collapsibleOptions.removeClass('selected');
};
var deactiveAllSubmenuOptions = function() {
$submenuOptions.removeClass('active bold');
};
$scope.onSubmenuOptionSelected = function($event) {
$event.stopPropagation();
var $selectedOption = angular.element($event.currentTarget)
.closest('.collapsible-container');
$scope.deactiveAllMenuOptions();
deactiveAllSubmenuOptions();
deactiveAllCollapsibleOptions();
$selectedOption.addClass('selected');
};
$element.find('.collapsible').collapsible();
var selectMenuOptionByState = function(state) {
$scope.deactiveAllMenuOptions();
deactiveAllSubmenuOptions();
var option = $element.find('[data-menu="' + state.menuOption +'"]');
if(option.hasClass('collapsible-container')) {
option.addClass('active selected bold');
} else {
option.addClass('active bold');
}
};
selectMenuOptionByState($state.current);
$rootScope.$on('$stateChangeSuccess', function(event, toState) {
selectMenuOptionByState(toState);
});
};
return {
restrict: 'EA',
link: link,
templateUrl: 'modules/core/views/menubar.client.view.html'
};
}
angular.module('core').directive('menubar', [
'$rootScope',
'$state',
'Authentication',
Menubar
]);
})();
|
'use strict';
var path = require('path')
, home = process.env.HOME || process.env.USERPROFILE
, root = path.join(home, '.config', 'replpad')
, cachesRoot = path.join(root, 'cache')
, caches = path.join(cachesRoot, process.version)
;
module.exports = {
root : root
, caches : caches
, configFile : path.join(root, 'config.js')
};
|
import React from 'react';
import PropTypes from 'prop-types';
import styles from './CreateGame.css';
const CreateGame = ({ onOpenCreateGameForm, isFormOpen }) => (
<div className={styles.createGame}>
<div
data-test-id="create-game-button"
display-if={!isFormOpen}
className={styles.createGameButton}
onClick={onOpenCreateGameForm}
>
+ Create Game
</div>
</div>
);
CreateGame.propTypes = {
onOpenCreateGameForm: PropTypes.func,
isFormOpen: PropTypes.bool
};
export default CreateGame;
|
var BigBlock = {};
BigBlock.Sprites = [];
// initial props
BigBlock.curentFrame = 0;
BigBlock.inputBlock = false; // set = true to block user input
BigBlock.URL_ittybitty8bit = 'http://www.ittybitty8bit.com';
BigBlock.URL_Facebook = 'http://www.facebook.com/pages/ittybitty8bit/124916544219794';
BigBlock.URL_Twitter = 'http://www.twitter.com/ittybitty8bit';
BigBlock.CSSid_core = '.core';
BigBlock.CSSid_color = '.color';
BigBlock.CSSid_char_pos = '.char_pos';
BigBlock.CSSid_grid_pos = '.grid_pos';
/**
* BigBlock.ready() is called from <body> onload()
* To pass params to BigBlock.Timer.play(), overwrite this function in the html file.
* Params should be json formatted.
*/
BigBlock.ready = function () {
BigBlock.Timer.play();
};
//
/**
* Background object
* Builds a background image out of divs described in a passed array of json objects.
*
* @author Vince Allen 07-12-2010
*/
BigBlock.Background = (function () {
return {
alias : 'bg',
busy : false,
/**
* Adds the Background image to the scene.
*
* @param {Object} bg_pix
*/
add: function(bg_pix, beforeAdd, afterAdd){
try{
if (typeof(bg_pix) != 'object') {
throw new Error("Err: BA001");
} else {
this.busy = true;
if (typeof(beforeAdd) == 'function') {
beforeAdd();
}
for (var i = 0; i < bg_pix.length; i++) {
BigBlock.SpriteAdvanced.create({
alias: this.alias,
x: 0,
y: 0,
life: 0,
render_static: true,
anim_state: 'stop',
anim_loop: 1,
anim: [{
'frm': {
'duration': 3,
'pix': [bg_pix[i]],
'label': '1'
}
}]
});
}
this.busy = false;
if (typeof(afterAdd) == 'function') {
afterAdd();
}
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
},
/**
* Replaces the Background image. Pass a function to run after replacement.
*
* @param {Object} bg_pix
* @param {Object} callback
*/
replace: function (bg_pix, callback) {
BigBlock.Background.remove();
BigBlock.Background.add(bg_pix);
if (typeof(callback) == 'function') {
callback();
}
},
/**
* Removes the Background. Pass a function to run after removal.
*
* @param {Function} callback
*/
remove : function (callback) {
for (var i = 0; i < BigBlock.GridStatic.quads.length; i++) {
var gs = document.getElementById(BigBlock.GridStatic.quads[i].id);
if (gs.hasChildNodes()) {
var nodes = gs.childNodes; // get a collection of all children in BigBlock.GridStatic.id;
var tmp = [];
// DOM collections are live; iterating over a static array is faster than iterating over a live DOM collection
for( var x = 0; x < nodes.length; x++ ) { // make copy of DOM collection
tmp[tmp.length] = nodes[x];
}
for (var j = 0; j < tmp.length; j++) { // loop thru children
if (this.alias == tmp[j].getAttribute('alias')) {
gs.removeChild(tmp[j]); // remove from DOM
}
}
tmp = null;
}
}
if (typeof(callback) == 'function') {
callback();
}
},
/**
* Overrides defaults properties before Header is created.
*
* @param {Object} params
*/
setProps : function (params) {
if (typeof(params) != 'undefined') {
for (var key in params) {
if (params.hasOwnProperty(key)) {
this[key] = params[key];
}
}
}
},
/**
* Allows setting specific styles after Background has been created and body styles have been set.
*
* @param {String} key
* @param {String} value
*/
setBodyStyle : function (key, value) {
try {
if (typeof(key) == 'undefined') {
throw new Error('Err: BSBS001');
}
if (typeof(value) == 'undefined') {
throw new Error('Err: BSBS002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
var b = document.getElementsByTagName('body').item(0);
b.style[key] = value;
}
};
})();
/**
* Char
* A generic object that carries core text charcter properties. All text characters appearing in a scene should inherit from the Char object.
* Chars make Words.
*
* @author Vince Allen 05-10-2010
*/
BigBlock.Char = (function () {
return {
/**
* Sets all properties.
*/
configure: function() {
this.alias = 'Char';
this.x = 80;
this.y = 1;
this.state = 'start';
this.pix_index = BigBlock.getPixIndex(this.x, this.y); // get new pixel index to render; depends on this.x, this.y;
this.value = 'B'; // the default character to render
this.word_id = 'B'; // the id of the parent word; used to delete chars
this.render = -1; // set to positive number to eventually not render this object; value decrements in render()
this.clock = 0;
this.index = BigBlock.Sprites.length; // the position of this object in the Sprite array
this.angle = Math.degreesToRadians(0);
this.vel = 0;
this.step = 0;
this.life = 0; // 0 = forever
this.className = 'white'; // color
this.color_index = this.className + '0';
this.color_max = 0;
this.pulse_rate = 10; // controls the pulse speed
this.anim_frame = 0;
this.anim_frame_duration = 0;
this.anim_loop = 1;
this.anim_state = 'stop';
this.action = function () {};
this.render_static = true;
this.afterDie = null;
this.url = false;
this.link_color = false;
},
/**
* Returns the anim property.
*
* @param {String} color_index
*/
getAnim : function (color_index) {
return [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':color_index,'i':0}
]
}
}
];
},
/**
* Returns the current frame from the anim property. Sets the color to this.color_index.
*
* @param {Object} anim
*/
getPix : function (anim) {
var a = anim[0];
if (typeof(a.frm.pix[0]) != 'undefined') {
a.frm.pix[0].c = this.color_index; // change to this.color_index
}
return a.frm;
},
/**
* Called by Timer every each time screen is rendered.
*/
run : function () {
switch (this.state) {
case 'stop':
break;
case 'start':
this.state = 'run';
break;
case 'run':
this.action.call(this);
break;
}
this.pix_index = BigBlock.getPixIndex(this.x, this.y); // get new pixel index to render
this.img = this.getPix(this.anim); // get pixels
if (this.life !== 0) {
var p = this.clock / this.life;
this.color_index = this.className + Math.round(this.color_max * p); // life adjusts color
} else {
this.color_index = this.className + (this.color_max - Math.round(this.color_max * (Math.abs(Math.cos(this.clock/this.pulse_rate))))); // will pulse thru the available colors in the class; pulse_rate controls the pulse speed
}
if (this.clock++ >= this.life && this.life !== 0) {
BigBlock.Timer.killObject(this);
} else {
this.clock++; // increment lifecycle clock
}
},
start : function () {
this.state = 'start';
},
stop : function () {
this.state = 'stop';
},
/**
* Removes the Char from the Sprites array.
*
* @param {Function} callback
*/
die : function (callback) {
this.render_static = false;
if (typeof(callback) == 'function') { this.afterDie = callback; }
BigBlock.Timer.killObject(this);
},
goToFrame : function (arg, anim_frame, anim) {
return goToFrame(arg, anim_frame, anim);
}
};
})();
/**
* Simple Char object
* A single character object w no animation.
*
* @author Vince Allen 05-10-2010
*/
BigBlock.CharSimple = (function () {
return {
/**
* Clones the Char objects. Runs configure(). Overrides any Char properties with passed properties. Adds this object to the Sprites array.
*
* @param {Object} params
*/
create: function (params) {
var obj = BigBlock.clone(BigBlock.Char); // CLONE Char
obj.configure(); // run configure() to inherit Char properties
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
obj[i] = params[i];
}
}
}
var pal = BigBlock.Color.getPalette(); // Color
for (i = 0; i < pal.classes.length; i++) { // get length of color palette for this className
if (pal.classes[i].name == obj.className) {
obj.color_max = pal.classes[i].val.length-1;
break;
}
}
obj.color_index = obj.className + '0'; // overwrite color_index w passed className
obj.anim = obj.getAnim(obj.color_index); // get new anim w overwritten color_index
obj.char_pos = BigBlock.CharPresets.getChar(obj.value, obj.font);
obj.render_static = true;
BigBlock.Sprites[BigBlock.Sprites.length] = obj;
}
};
})();
/**
* Color object
* Defines the color palette available to pixels.
*
* @author Vince Allen 12-05-2009
*/
/*global BigBlock, console, document */
BigBlock.Color = (function () {
var pInfoLogo = "rgb(191, 192, 194);rgb(0, 0, 0);rgb(153, 153, 153);rgb(238, 137, 151);rgb(102, 102, 102);rgb(255, 255, 255);rgb(240, 78, 99);rgb(204, 204, 204);rgb(128, 145, 173);rgb(192, 239, 255)";
var pPhnBg = "rgb(191, 192, 194);rgb(0, 0, 0);rgb(153, 153, 153);rgb(102, 102, 102);rgb(204, 204, 204);rgb(128, 145, 173);rgb(255, 255, 255);rgb(192, 239, 255)";
var pTxtLogo = "rgb(238, 137, 151);rgb(255, 255, 255);rgb(240, 78, 99)";
var pTxtPanel = "rgb(238, 137, 151);rgb(255, 255, 255);rgb(240, 78, 99)";
var palette = {'classes' : [ // default colors
{name: 'pInfoLogo',val: pInfoLogo.split(";")},
{name: 'pPhnBg',val: pPhnBg.split(";")},
{name: 'pTxtLogo',val: pTxtLogo.split(";")},
{name: 'pTxtPanel',val: pTxtPanel.split(";")},
{name : 'white',val: ['rgb(255,255,255)']},
{name : 'black',val: ['rgb(0,0,0)']},
{name : 'black0_glass',val: ['rgb(102,102,102)']},
{name : 'grey_dark',val: ['rgb(90,90,90)']},
{name : 'grey',val: ['rgb(150,150,150)']},
{name : 'grey0_glass',val: ['rgb(255,255,255)']},
{name : 'grey_light',val: ['rgb(200,200,200)']},
{name: 'red',val : ['rgb(255,0,0)']},
{name: 'magenta',val : ['rgb(255,0,255)']},
{name: 'blue',val: ['rgb(0,0,255)']},
{name: 'cyan',val: ['rgb(0,255,255)']},
{name: 'green',val: ['rgb(0,255,0)']},
{name: 'yellow',val: ['rgb(255,255,0)']},
{name: 'orange',val: ['rgb(255,126,0)']},
{name: 'brown',val: ['rgb(160,82,45)']},
{name: 'pink',val: ['rgb(238,130,238)']}
]};
// default gradients
var className = 'white_black';
palette.classes[palette.classes.length] = {'name' : {},'val' : []};
var s = "";
for (var i = 255; i > -1; i -= 50) {
if (i - 50 > -1) {
s += "rgb(" + i + ", " + i + ", " + i + ");";
} else {
s += "rgb(" + i + ", " + i + ", " + i + ")";
}
}
var colors = s.split(";");
palette.classes[palette.classes.length-1].name = className;
palette.classes[palette.classes.length-1].val = [];
for (i in colors) { // insert a css rule for every color
if (colors.hasOwnProperty(i)) {
palette.classes[palette.classes.length - 1].val[i] = colors[i];
}
}
function getPalette () {
return palette;
}
function getTotalColors () {
var total = 0;
for (var i = 0; i < palette.classes.length; i++) {
total += palette.classes[i].val.length;
}
return total;
}
function addToPalette (class_name) {
palette.classes[palette.classes.length] = class_name;
}
return {
current_class : 0,
build : function () {
var p = getPalette();
var s = BigBlock.getBigBlockCSS(BigBlock.CSSid_color);
for (var i in p.classes[this.current_class].val) {
try {
if (s.insertRule) { // Mozilla
if (p.classes[this.current_class].val.hasOwnProperty(i)) {
s.insertRule("div.color" + p.classes[this.current_class].name + i + " {background-color:" + p.classes[this.current_class].val[i] + ";}", 0);
}
} else if (s.addRule) { // IE
if (p.classes[this.current_class].val.hasOwnProperty(i)) {
s.addRule("div.color" + p.classes[this.current_class].name + i, "background-color:" + p.classes[this.current_class].val[i] + ";color:" + p.classes[this.current_class].val[i]);
}
} else {
throw new Error('Err: CB001');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
}
this.current_class++;
var total_rules;
try {
if (s.cssRules) { // Mozilla
BigBlock.Loader.update({
'total' : Math.round((s.cssRules.length / (getTotalColors())) * 100)
});
total_rules = s.cssRules.length;
} else if (s.rules) { // IE
BigBlock.Loader.update({
'total' : Math.round((s.rules.length / (getTotalColors())) * 100)
});
total_rules = s.rules.length;
} else {
throw new Error('Err: CB002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
if (total_rules < getTotalColors()) { // if all styles are not complete, send false back to Timer; Timer will call build again
return false;
} else {
return true;
}
},
add : function (params) {
try {
if (typeof(params) == 'undefined') {
throw new Error(console.log('Err: CA001'));
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
for (var i = 0; i < params.classes.length; i++) {
addToPalette(params.classes[i]);
}
},
getPalette: function () {
return getPalette();
}
};
})();
/**
* Emitter
* The Emitter object creates new Particle objects based on properites passed on Sprite.add().
* Particles are single pixels with no animation.
*
* @author Vince Allen 12-05-2009
*/
/*global BigBlock, document */
BigBlock.Emitter = (function () {
getTransformVariants = function (x, y, p_life, p_life_spread, p_velocity, p_velocity_spread, p_angle_spread, p_init_pos_spread_x, p_life_offset_x, p_init_pos_spread_y, p_life_offset_y) {
var vars = {};
var val = Math.ceil(Math.random() * ((100 - (p_life_spread * 100)) + 1)); // life spread
vars.life = Math.ceil(p_life * ((100 - val) / 100));
val = Math.ceil(Math.random() * ((100 - (p_velocity_spread * 100)) + 1)); // velocity spread
vars.vel = p_velocity * ((100 - val) / 100);
var dir = [1, -1];
var d = dir[Math.getRamdomNumber(0,1)];
vars.angle_var = Math.ceil(Math.random() * (p_angle_spread + 1)) * d; // angle spread
var x_d = dir[Math.getRamdomNumber(0,1)];
var adjusted_x = 0;
if (p_init_pos_spread_x !== 0) {
adjusted_x = Math.ceil(Math.random() * (p_init_pos_spread_x * BigBlock.Grid.pix_dim)) * x_d; // init pos spread_x
}
var per;
if (p_life_offset_x == 1) { // reduce life based on distance from Emitter location
per = Math.abs(adjusted_x)/(p_init_pos_spread_x * BigBlock.Grid.pix_dim);
if (Math.ceil(vars.life * (1-per)) > 0) {
vars.life = Math.ceil(vars.life * (1-per));
} else {
vars.life = 1;
}
}
var y_d = dir[Math.getRamdomNumber(0,1)];
var adjusted_y = Math.floor(Math.random() * (p_init_pos_spread_y * BigBlock.Grid.pix_dim)) * y_d; // init pos spread_y
if (p_life_offset_y == 1) { // reduce life based on distance from Emitter location
per = Math.abs(adjusted_y)/(p_init_pos_spread_y * BigBlock.Grid.pix_dim);
if (Math.ceil(vars.life * (1-per)) > 0) {
vars.life = Math.ceil(vars.life * (1-per));
} else {
vars.life = 1;
}
}
vars.x = x + adjusted_x;
vars.y = y + adjusted_y;
return vars;
};
return {
create: function (params) {
var emitter = BigBlock.clone(BigBlock.Sprite); // CLONE Sprite
emitter.configure(); // run configure() to inherit Sprite properties
// Default emitter properties
emitter.x = BigBlock.Grid.width/2;
emitter.y = BigBlock.Grid.height/2 + BigBlock.Grid.height/3;
emitter.alias = 'emitter';
emitter.emission_rate = 3; // values closer to 1 equal more frequent emissions
emitter.p_count = 0; // tracks total particles created
emitter.p_burst = 3;
emitter.p_velocity = 3;
emitter.p_velocity_spread = 1; // values closer to zero create more variability
emitter.p_angle = 270;
emitter.p_angle_spread = 20;
emitter.p_life = 100;
emitter.p_life_spread = 0.5; // values closer to zero create more variability
emitter.p_life_offset_x = 0; // boolean 0 = no offset; 1 = offset
emitter.p_life_offset_y = 0; // boolean 0 = no offset; 1 = offset
emitter.p_gravity = 0;
emitter.p_init_pos_spread_x = 0;
emitter.p_init_pos_spread_y = 0;
emitter.p_spiral_vel_x = 0;
emitter.p_spiral_vel_y = 0;
emitter.action = function () {};
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
emitter[i] = params[i];
}
}
}
var palette = BigBlock.Color.getPalette(); // Color
for (i = 0; i < palette.classes.length; i++) { // get length of color palette for this className
if (palette.classes[i].name == emitter.className) {
emitter.color_max = palette.classes[i].val.length-1;
break;
}
}
emitter.anim = [
{'frm':
{
'duration' : 1,
'pix' : []
}
}
];
emitter.run = function () {
switch (this.state) {
case 'stop':
break;
case 'start':
if (this.clock % this.emission_rate === 0) {
this.state = 'emit';
}
this.action.call(this);
break;
case 'emit':
for (var i = 0; i < this.p_burst; i++) {
vars = getTransformVariants(this.x, this.y, this.p_life, this.p_life_spread, this.p_velocity, this.p_velocity_spread, this.p_angle_spread, this.p_init_pos_spread_x, this.p_life_offset_x, this.p_init_pos_spread_y, this.p_life_offset_y);
var p_params = {
alias: 'particle',
className : this.className, // particles inherit the emitter's class name
x: vars.x,
y: vars.y,
life : vars.life,
gravity: this.p_gravity,
angle: Math.degreesToRadians(this.p_angle + vars.angle_var),
vel: vars.vel,
color_max : this.color_max,
p_spiral_vel_x : this.p_spiral_vel_x,
p_spiral_vel_y : this.p_spiral_vel_y
};
BigBlock.Particle.create(p_params);
this.p_count++;
}
this.state = 'start';
break;
}
this.pix_index = BigBlock.getPixIndex(this.x, this.y); // get new pixel index to render
this.img = this.getPix(this.anim, this.color_index); // get pixels
if (this.clock++ >= this.life && this.life !== 0 && this.state != 'dead') {
BigBlock.Timer.killObject(this);
} else {
this.clock++; // increment lifecycle clock
}
};
emitter.getPix = function (anim) {
return [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'particle','i':0}
]
}
}
];
};
emitter.start = function () {
this.state = 'start';
};
emitter.stop = function () {
this.state = 'stop';
};
BigBlock.Sprites[BigBlock.Sprites.length] = emitter;
}
};
})();
/**
* Footer object
* Adds a div below the active area that's visible in iPhone full screen mode and Android default mode.
*
* @author Vince Allen 07-21-2010
*/
BigBlock.Footer = (function () {
return {
alias : 'app_footer',
width : 320,
height : 56,
styles : {
'zIndex' : -1,
'position' : 'absolute'
},
/**
* Adds the Footer to the dom.
*
* @param {Number} x
* @param {Number} y
* @param {String} backgroundColor
*/
add: function(x, y, backgroundColor){
try {
if (typeof(x) == 'undefined' || typeof(y) == 'undefined') {
throw new Error('FA001');
} else {
var d = document.createElement('div');
d.setAttribute('id', this.alias);
this.styles.width = this.width + 'px';
this.styles.height = this.height + 'px';
this.styles.left = x + 'px';
this.styles.top = y + 'px';
if (typeof(backgroundColor) != 'undefined') {
this.styles.backgroundColor = backgroundColor;
}
for (key in this.styles) {
if (this.styles.hasOwnProperty(key)) {
d.style[key] = this.styles[key];
}
}
document.body.appendChild(d);
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
},
/**
* Removes the Footer. Pass a function to run after removal.
*
* @param {Function} callback
*/
remove : function (callback) {
var d = document.getElementById(this.alias);
document.body.removeChild(d);
if (typeof(callback) == 'function') {
callback();
}
},
/**
* Overrides defaults properties before Footer is created.
*
* @param {Object} params
*/
setProps : function (params) {
if (typeof(params) != 'undefined') {
for (var key in params) {
if (params.hasOwnProperty(key)) {
this[key] = params[key];
}
}
}
},
/**
* Sets an individual style after Footer has been created.
*
* @param {String} key
* @param {String} value
*/
setStyle : function (key, value) {
try {
if (typeof(key) == 'undefined') {
throw new Error('Err: FSS001');
}
if (typeof(value) == 'undefined') {
throw new Error('Err: FSS002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
var d = document.getElementById(this.alias);
d.style[key] = value;
}
};
})();
/**
* Grid
* A generic object that carries core grid properties. All grids appearing in a scene should inherit from the Grid object.
*
* Default iPhone viewport 320px X 356px
* Status bar (cannot hide) 20px
* Url bar 60px
* Button bar 44px
*
* iPhone viewport running in full screen mode (installation on home screen) 320px X 480px
*
* Full Grid running in iPhone mode 320px X 368px (40 cols X 46 cols)
*
* @author Vince Allen 7-15-2010
*/
BigBlock.Grid = (function () {
return {
alias : 'Grid',
pix_dim : 8, // the pixel dimensions; width & height; pixels are square
width : 320, // global grid width
height : 368, // global grid height
x : 0, // will be set when grid divs are added to the dom
y : 0,
//cols : Math.round(320/8), // number of GLOBAL grid columns // replaced w Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim)
//rows : Math.round(368/8), // number of GLOBAL grid rows // replaced w Math.round(BigBlock.Grid.height/BigBlock.Grid.pix_dim)
//quad_width : 160, // replaced w BigBlock.Grid.width/2
//quad_height : 184, // replaced w BigBlock.Grid.height/2
//quad_cols : Math.round(160/8), // number of QUAD grid columns // replaced w Math.round((BigBlock.Grid.width/2)/BigBlock.Grid.pix_dim)
//quad_rows : Math.round(184/8), // number of QUAD grid rows // replaced w Math.round((BigBlock.Grid.height/2)/BigBlock.Grid.pix_dim)
build_start_time : new Date().getTime(),
build_end_time : new Date().getTime(),
build_offset : 0,
build_section_count : 0,
//build_section_total : Math.round((184/8))/2, // replaced w Math.round(((BigBlock.Grid.width/2)/8))/2
build_rowNum : 0,
char_width : 8,
char_height : 8,
styles : {},
configure : function (params) {
if (typeof(params) != 'undefined') {
for (var key in params) {
if (params.hasOwnProperty(key)) {
this[key] = params[key];
}
}
}
},
setProps : function (params) {
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
this[i] = params[i];
}
}
}
},
/**
* Allows setting specific styles after GridActive has been created and div has been added to the dom.
* @param key
* @param value
*
*/
setStyle : function (key, value) {
try {
if (typeof(key) == 'undefined') {
throw new Error('Err: GSS001');
}
if (typeof(value) == 'undefined') {
throw new Error('Err: GSS002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
for (var i = 0; i < this.quads.length; i++) {
document.getElementById(this.quads[i].id).style[key] = value;
}
this.styles[key] = value; // save new value
},
add: function(){
this.build_start_time = new Date().getTime();
var win_dim = BigBlock.getWindowDim();
try {
if (win_dim.width === false || win_dim.height === false) {
win_dim.width = 800;
win_dim.height = 600;
throw new Error('Err: GA001');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
var s = BigBlock.getBigBlockCSS(BigBlock.CSSid_grid_pos);
for (var i = 0; i < 4; i++) {
try {
if (s.insertRule) { // Mozilla
s.insertRule("div#" + this.quads[i].id + " {background-color:transparent;width: " + BigBlock.Grid.width/2 + "px;height: " + BigBlock.Grid.height/2 + "px;position: absolute;left: " + ((win_dim.width / 2) - (this.quads[i].left)) + "px;top: " + ((win_dim.height / 2) - (this.quads[i].top)) + "px;z-index: " + this.quads[i].zIndex + "}", 0);
} else if (s.addRule) { // IE
s.addRule("div#" + this.quads[i].id, "background-color:transparent;width: " + BigBlock.Grid.width/2 + "px;height: " + BigBlock.Grid.height/2 + "px;position: absolute;left: " + ((win_dim.width / 2) - (this.quads[i].left)) + "px;top: " + ((win_dim.height / 2) - (this.quads[i].top)) + "px;z-index: " + this.quads[i].zIndex);
} else {
throw new Error('Err: GA002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
}
this.x = ((win_dim.width / 2) - (this.quads[0].left)); // set the Grid x, y to the first quad's x, y
this.y = ((win_dim.height / 2) - (this.quads[0].top));
var grid_quad;
for (i = 0; i < this.quads.length; i++) {
grid_quad = document.createElement('div');
grid_quad.setAttribute('id', this.quads[i].id);
for (var key in this.styles) {
if (this.styles.hasOwnProperty(key)) {
grid_quad.style[key] = this.styles[key];
}
}
document.body.appendChild(grid_quad);
}
},
/**
* Creates a css rule for every position in the grid
* @param key
* @param value
*
*/
build : function () {
var colNum = 0;
var quad_width = BigBlock.Grid.width/2;
var quad_height = BigBlock.Grid.height/2;
var build_section_total = Math.round((quad_height/BigBlock.Grid.pix_dim))/2;
var s = BigBlock.getBigBlockCSS(BigBlock.CSSid_grid_pos);
for (var i = 0; i < ((Math.round(quad_width/BigBlock.Grid.pix_dim) * Math.round(quad_height/BigBlock.Grid.pix_dim)) / build_section_total); i++) {
if (colNum < Math.round(quad_width/BigBlock.Grid.pix_dim)) {
colNum++;
} else {
colNum = 1;
}
if (i % Math.round(quad_width/BigBlock.Grid.pix_dim) === 0) {
this.build_rowNum++;
}
if (s.insertRule) { // Mozilla
s.insertRule(".pos" + (i + this.build_offset) + " {left:" + ((colNum - 1) * this.pix_dim) + "px;top:" + ((this.build_rowNum - 1) * this.pix_dim) + "px;}", 0); // setup pos rules
} else if (s.addRule) { // IE
s.addRule(".pos" + (i + this.build_offset), " left:" + ((colNum - 1) * this.pix_dim) + "px;top:" + ((this.build_rowNum - 1) * this.pix_dim) + "px"); // setup pos rules
}
}
var total_rules;
try {
if (s.cssRules) { // Mozilla
total_rules = s.cssRules.length-1; // must subtract 1 rule for the id selectorText added in the Timer
} else if (s.rules) { // IE
total_rules = s.rules.length-1;
} else {
throw new Error('Err: GB002');
}
} catch(f) {
BigBlock.Log.display(f.name + ': ' + f.message);
}
this.build_offset = total_rules;
BigBlock.Loader.update({
'total' : Math.round((total_rules / (Math.round(quad_width/BigBlock.Grid.pix_dim) * Math.round(quad_height/BigBlock.Grid.pix_dim))) * 100)
});
end_time = new Date().getTime();
if (total_rules < (Math.round(quad_width/BigBlock.Grid.pix_dim) * Math.round(quad_height/BigBlock.Grid.pix_dim))) { // if all styles are not complete, send false back to Timer; Timer will call build again
return false;
} else {
return true;
}
},
buildCharStyles : function () {
var s = BigBlock.getBigBlockCSS(BigBlock.CSSid_char_pos);
if (s.insertRule) { // Mozilla
s.insertRule(".text_bg{background-color: transparent;}", 0);
s.insertRule(".char{width : 1px;height : 1px;position: absolute;float: left;line-height:0px;font-size:1%;}", 0);
} else if (s.addRule) { // IE
s.addRule(".text_bg", "background-color: transparent");
s.addRule(".char", "width : 1px;height : 1px;position: absolute;float: left;line-height:0px;font-size:1%;");
}
var col_count = 1;
for (var i=0; i < this.char_width*this.char_height; i++) {
if (s.insertRule) { // Mozilla
s.insertRule(".char_pos" + (i + 1) + "{left:" + col_count + "px;top:" + (Math.floor((i/8))+1) + "px;}", 0);
} else if (s.addRule) { // IE
s.addRule(".char_pos" + (i + 1), "left:" + col_count + "px;top:" + (Math.floor((i/8))+1) + "px;");
}
if (col_count + 1 <= this.char_width) {
col_count++;
} else {
col_count = 1;
}
}
return true;
}
};
})();
/**
* Header object
* Adds a div above the active area that's visible in iPhone full screen mode and Android default mode.
*
* @author Vince Allen 07-21-2010
*/
BigBlock.Header = (function () {
return {
alias : 'app_header',
width : 320,
height : 56,
styles : {
'zIndex' : -1,
'position' : 'absolute'
},
/**
* Adds the Header to the dom.
*
* @param {Number} x
* @param {Number} y
* @param {String} backgroundColor
*/
add: function(x, y, backgroundColor){
try {
if (typeof(x) == 'undefined' || typeof(y) == 'undefined') {
throw new Error('Err: HA001');
} else {
var d = document.createElement('div');
d.setAttribute('id', this.alias);
this.styles.width = this.width + 'px';
this.styles.height = this.height + 'px';
this.styles.left = x + 'px';
this.styles.top = (y - this.height) + 'px';
if (typeof(backgroundColor) != 'undefined') {
this.styles.backgroundColor = backgroundColor;
}
for (key in this.styles) {
if (this.styles.hasOwnProperty(key)) {
d.style[key] = this.styles[key];
}
}
document.body.appendChild(d);
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
},
/**
* Removes the Header. Pass a function to run after removal.
*
* @param {Function} callback
*/
remove : function (callback) {
var d = document.getElementById(this.alias);
document.body.removeChild(d);
if (typeof(callback) == 'function') {
callback();
}
},
/**
* Overrides defaults properties before Header is created.
*
* @param {Object} params
*/
setProps : function (params) {
if (typeof(params) != 'undefined') {
for (var key in params) {
if (params.hasOwnProperty(key)) {
this[key] = params[key];
}
}
}
},
/**
* Sets an individual style after Header has been created.
*
* @param {String} key
* @param {String} value
*/
setStyle : function (key, value) {
try {
if (typeof(key) == 'undefined') {
throw new Error('Err: HSS001');
}
if (typeof(value) == 'undefined') {
throw new Error('Err: HSS002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
var d = document.getElementById(this.alias);
d.style[key] = value;
}
};
})();
/**
* Input Feedback object
* Renders a block where user either clicks or touches.
*
* @author Vince Allen 05-29-2010
*/
BigBlock.InputFeedback = (function () {
return {
life : 10,
className : 'white',
configure: function (params) {
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
this[i] = params[i];
}
}
}
},
display : function (x, y) {
try {
if (typeof(x) == 'undefined' || typeof(y) == 'undefined') {
throw new Error('Err: IFD001');
} else {
BigBlock.SpriteSimple.create({
alias : 'input_feedback',
className : this.className,
x : x - BigBlock.GridActive.x,
y : y - BigBlock.GridActive.y,
life : this.life
});
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
},
die : function () {
BigBlock.Sprites[BigBlock.getObjIdByAlias('input_feedback')].die();
delete BigBlock.InputFeedback;
}
};
})();
/**
* Behavior Library
* Returns preset behaviors
*
* @author Vince Allen 12-21-2010
*/
BigBlock.BehaviorPresets = (function() { // uses lazy instantiation; only instantiate if using a preset
var u; // Private attribute that holds the single instance.
function cnstr() { // All of the normal singleton code goes here.
return {
getPreset: function(name){
switch (name) {
case 'move_wallCollide':
return function(){
var vx = (this.vel * BigBlock.Grid.pix_dim) * Math.cos(this.angle);
var vy = (this.vel * BigBlock.Grid.pix_dim) * Math.sin(this.angle);
if (this.x + vx > 0 && this.x + vx < BigBlock.Grid.width) {
this.x = this.x + vx;
}
else {
this.vel *= 1.5;
this.angle += Math.degreesToRadians(180);
}
if (this.y + vy > 0 && this.y + vy < BigBlock.Grid.height) {
this.y = this.y + vy;
}
else {
this.vel *= 1.5;
this.angle += Math.degreesToRadians(180);
}
if (Math.floor(this.vel--) > 0) { // decelerate
this.vel--;
}
else {
this.vel = 0;
}
};
case 'move':
return function(){
this.x += BigBlock.Grid.pix_dim;
};
}
}
};
}
return {
install: function() {
if(!u) { // Instantiate only if the instance doesn't exist.
u = cnstr();
}
return u;
}
};
})();
/**
* Character Library
* Returns preset text characters
*
* @author Vince Allen 05-10-2009
*/
BigBlock.CharPresets = (function() { // uses lazy instantiation; only instantiate if using a preset
var u; // Private attribute that holds the single instance.
function cnstr() { // All of the normal singleton code goes here.
return {
getChar: function(val, font) {
if (typeof(font) == 'undefined') {
font = 'bigblock_bold';
}
var character = false;
switch (font) {
case 'bigblock_plain':
switch (val) {
case ' ':
character = [];
break;
case 'A':
case 'a':
character = [
{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:21},{p:25},{p:29},{p:33},{p:37}
];
break;
case 'B':
case 'b':
character = [
{p:1},{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:25},{p:29},{p:33},{p:34},{p:35},{p:36}
];
break;
case 'C':
case 'c':
character = [
{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:25},{p:29},{p:34},{p:35},{p:36}
];
break;
case 'D':
case 'd':
character = [
{p:1},{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:33},{p:34},{p:35},{p:36}
];
break;
case 'E':
case 'e':
character = [
{p:1},{p:2},{p:3},{p:4},{p:9},{p:17},{p:18},{p:19},{p:25},{p:33},{p:34},{p:35},{p:36}
];
break;
case 'F':
case 'f':
character = [
{p:1},{p:2},{p:3},{p:4},{p:9},{p:17},{p:18},{p:19},{p:25},{p:33}
];
break;
case 'G':
case 'g':
character = [
{p:2},{p:3},{p:4},{p:5},{p:9},{p:17},{p:20},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36},{p:37}
];
break;
case 'H':
case 'h':
character = [
{p:1},{p:5},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:21},{p:25},{p:29},{p:33},{p:37}
];
break;
case 'I':
case 'i':
character = [
{p:2},{p:3},{p:4},{p:11},{p:19},{p:27},{p:34},{p:35},{p:36}
];
break;
case 'J':
case 'j':
character = [
{p:5},{p:13},{p:21},{p:25},{p:29},{p:26},{p:34},{p:35},{p:36}
];
break;
case 'K':
case 'k':
character = [
{p:1},{p:5},{p:9},{p:12},{p:17},{p:18},{p:19},{p:25},{p:28},{p:33},{p:37}
];
break;
case 'L':
case 'l':
character = [
{p:1},{p:9},{p:17},{p:25},{p:33},{p:34},{p:35},{p:36}
];
break;
case 'M':
case 'm':
character = [
{p:1},{p:5},{p:9},{p:10},{p:12},{p:13},{p:17},{p:19},{p:21},{p:25},{p:29},{p:33},{p:37}
];
break;
case 'N':
case 'n':
character = [
{p:1},{p:5},{p:9},{p:10},{p:13},{p:17},{p:19},{p:21},{p:25},{p:28},{p:29},{p:33},{p:37}
];
break;
case 'O':
case 'o':
character = [
{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36}
];
break;
case 'P':
case 'p':
character = [
{p:1},{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:25},{p:33}
];
break;
case 'Q':
case 'q':
character = [
{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:19},{p:21},{p:25},{p:28},{p:29},{p:34},{p:35},{p:36},{p:37}
];
break;
case 'R':
case 'r':
character = [
{p:1},{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:18},{p:19},{p:20},{p:25},{p:29},{p:33},{p:37}
];
break;
case 'S':
case 's':
character = [
{p:2},{p:3},{p:4},{p:5},{p:9},{p:18},{p:19},{p:20},{p:29},{p:33},{p:34},{p:35},{p:36}
];
break;
case 'T':
case 't':
character = [
{p:1},{p:2},{p:3},{p:4},{p:5},{p:11},{p:19},{p:27},{p:35}
];
break;
case 'U':
case 'u':
character = [
{p:1},{p:5},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36}
];
break;
case 'V':
case 'v':
character = [
{p:1},{p:5},{p:9},{p:13},{p:17},{p:21},{p:26},{p:28},{p:35}
];
break;
case 'W':
case 'w':
character = [
{p:1},{p:4},{p:7},{p:9},{p:12},{p:15},{p:17},{p:20},{p:23},{p:25},{p:28},{p:31},{p:34},{p:35},{p:37},{p:38}
];
break;
case 'X':
case 'x':
character = [
{p:1},{p:5},{p:10},{p:12},{p:19},{p:26},{p:28},{p:33},{p:37}
];
break;
case 'Y':
case 'y':
character = [
{p:1},{p:5},{p:10},{p:12},{p:19},{p:27},{p:35}
];
break;
case 'Z':
case 'z':
character = [
{p:1},{p:2},{p:3},{p:4},{p:5},{p:12},{p:19},{p:26},{p:33},{p:34},{p:35},{p:36},{p:37}
];
break;
// numbers
case '1':
character = [
{p:3},{p:10},{p:11},{p:19},{p:27},{p:35}
];
break;
case '2':
character = [
{p:1},{p:2},{p:3},{p:4},{p:13},{p:18},{p:19},{p:20},{p:25},{p:33},{p:34},{p:35},{p:36},{p:37}
];
break;
case '3':
character = [
{p:1},{p:2},{p:3},{p:4},{p:13},{p:18},{p:19},{p:20},{p:29},{p:33},{p:34},{p:35},{p:36}
];
break;
case '4':
character = [
{p:3},{p:4},{p:10},{p:12},{p:17},{p:20},{p:25},{p:26},{p:27},{p:28},{p:29},{p:36}
];
break;
case '5':
character = [
{p:1},{p:2},{p:3},{p:4},{p:5},{p:9},{p:17},{p:18},{p:19},{p:20},{p:29},{p:33},{p:34},{p:35},{p:36}
];
break;
case '6':
character = [
{p:2},{p:3},{p:4},{p:9},{p:17},{p:18},{p:19},{p:20},{p:25},{p:29},{p:34},{p:35},{p:36}
];
break;
case '7':
character = [
{p:2},{p:3},{p:4},{p:5},{p:13},{p:20},{p:27},{p:35}
];
break;
case '8':
character = [
{p:2},{p:3},{p:4},{p:9},{p:13},{p:18},{p:19},{p:20},{p:25},{p:29},{p:34},{p:35},{p:36}
];
break;
case '9':
character = [
{p:2},{p:3},{p:4},{p:9},{p:13},{p:18},{p:19},{p:20},{p:21},{p:28},{p:34},{p:35},{p:36}
];
break;
case '0':
character = [
{p:2},{p:3},{p:4},{p:9},{p:13},{p:17},{p:21},{p:25},{p:29},{p:34},{p:35},{p:36}
];
break;
// arrows
case 'arrow_down':
character = [
{p:3},{p:11},{p:17},{p:19},{p:21},{p:26},{p:27},{p:28},{p:35}
];
break;
case 'arrow_up':
character = [
{p:3},{p:10},{p:11},{p:12},{p:17},{p:19},{p:21},{p:27},{p:35}
];
break;
case 'arrow_left':
character = [
{p:3},{p:10},{p:17},{p:18},{p:19},{p:20},{p:21},{p:26},{p:35}
];
break;
case 'arrow_right':
character = [
{p:3},{p:12},{p:17},{p:18},{p:19},{p:20},{p:21},{p:28},{p:35}
];
break;
// punctuation
case "!":
character = [
{p:3},{p:11},{p:19},{p:35}
];
break;
case "@":
character = [
{p:2},{p:3},{p:4},{p:9},{p:11},{p:13},{p:17},{p:19},{p:20},{p:21},{p:25},{p:34},{p:35},{p:36}
];
break;
case "#":
character = [
{p:2},{p:4},{p:9},{p:10},{p:11},{p:12},{p:13},{p:18},{p:20},{p:25},{p:26},{p:27},{p:28},{p:29},{p:34},{p:36}
];
break;
case "$":
character = [
{p:2},{p:3},{p:4},{p:5},{p:9},{p:11},{p:18},{p:19},{p:20},{p:27},{p:29},{p:33},{p:34},{p:35},{p:36},{p:43}
];
break;
case "%":
character = [
{p:1},{p:2},{p:4},{p:9},{p:10},{p:12},{p:19},{p:26},{p:28},{p:29},{p:34},{p:36},{p:37}
];
break;
case "^":
character = [
{p:3},{p:10},{p:12}
];
break;
case "&":
character = [
{p:2},{p:3},{p:9},{p:12},{p:18},{p:19},{p:25},{p:29},{p:34},{p:35},{p:36},{p:37}
];
break;
case "*":
character = [
{p:3},{p:9},{p:11},{p:13},{p:18},{p:19},{p:20},{p:25},{p:27},{p:29},{p:35}
];
break;
case "(":
character = [
{p:3},{p:10},{p:18},{p:26},{p:35}
];
break;
case ")":
character = [
{p:3},{p:12},{p:20},{p:28},{p:35}
];
break;
case "-":
character = [
{p:18},{p:19},{p:20}
];
break;
case "_":
character = [
{p:34},{p:35},{p:36},{p:37}
];
break;
case "=":
character = [
{p:10},{p:11},{p:12},{p:13},{p:26},{p:27},{p:28},{p:29}
];
break;
case "+":
character = [
{p:3},{p:11},{p:17},{p:18},{p:19},{p:20},{p:21},{p:27},{p:35}
];
break;
case ";":
character = [
{p:3},{p:27},{p:34}
];
break;
case ":":
character = [
{p:11},{p:35}
];
break;
case "'":
character = [
{p:3},{p:10},{p:18}
];
break;
case ',':
character = [
{p:34},{p:41}
];
break;
case ".":
character = [
{p:33}
];
break;
case '<':
character = [
{p:3},{p:10},{p:17},{p:26},{p:35}
];
break;
case '>':
character = [
{p:3},{p:12},{p:21},{p:28},{p:35}
];
break;
case "/":
character = [
{p:4},{p:12},{p:19},{p:26},{p:34}
];
break;
case "?":
character = [
{p:1},{p:2},{p:3},{p:12},{p:18},{p:19},{p:34}
];
break;
case "{":
character = [
{p:3},{p:4},{p:11},{p:18},{p:27},{p:35},{p:36}
];
break;
case "}":
character = [
{p:2},{p:3},{p:11},{p:20},{p:27},{p:34},{p:35}
];
break;
case "[":
character = [
{p:3},{p:4},{p:11},{p:19},{p:27},{p:35},{p:36}
];
break;
case "]":
character = [
{p:2},{p:3},{p:11},{p:19},{p:27},{p:34},{p:35}
];
break;
case "|":
character = [
{p:3},{p:11},{p:19},{p:27},{p:35}
];
break;
default:
break;
}
break;
case 'bigblock_bold':
switch (val) {
case ' ':
character = [];
break;
case 'A':
case 'a':
character = [
{p : 4},{p : 5},{p : 12},{p : 13},{p : 18},{p : 19},{p : 22},{p : 23},{p : 26},{p : 27},{p : 30},{p : 31},{p : 34},{p : 35},{p : 36},{p : 37},{p : 38},{p : 39},{p : 42},{p : 43},{p : 44},{p : 45},{p : 46},{p : 47},{p : 50},{p : 51},{p : 54},{p : 55},{p : 58},{p : 59},{p : 62},{p : 63}
];
break;
case 'B':
case 'b':
character = [
{p:2},{p:3},{p:10},{p:11},{p:18},{p:19},{p:20},{p:21},{p:22},{p:23},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'C':
case 'c':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:26},{p:27},{p:34},{p:35},{p:42},{p:43},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'D':
case 'd':
character = [
{p:2},{p:3},{p:4},{p:5},{p:10},{p:11},{p:12},{p:13},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:58},{p:59},{p:60},{p:61}
];
break;
case 'E':
case 'e':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:26},{p:27},{p:34},{p:35},{p:36},{p:37},{p:42},{p:43},{p:44},{p:45},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'F':
case 'f':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:26},{p:27},{p:34},{p:35},{p:36},{p:37},{p:42},{p:43},{p:44},{p:45},{p:50},{p:51},{p:58},{p:59}
];
break;
case 'G':
case 'g':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:26},{p:27},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'H':
case 'h':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:54},{p:55},{p:58},{p:59},{p:62},{p:63}
];
break;
case 'I':
case 'i':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:20},{p:21},{p:28},{p:29},{p:36},{p:37},{p:44},{p:45},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'J':
case 'j':
character = [
{p:6},{p:7},{p:14},{p:15},{p:22},{p:23},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'K':
case 'k':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:42},{p:43},{p:44},{p:45},{p:50},{p:51},{p:54},{p:55},{p:58},{p:59},{p:62},{p:63}
];
break;
case 'L':
case 'l':
character = [
{p:2},{p:3},{p:10},{p:11},{p:18},{p:19},{p:26},{p:27},{p:34},{p:35},{p:42},{p:43},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'M':
case 'm':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:20},{p:21},{p:22},{p:23},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:54},{p:55},{p:58},{p:59},{p:62},{p:63}
];
break;
case 'N':
case 'n':
character = [
{p:2},{p:3},{p:4},{p:5},{p:10},{p:11},{p:12},{p:13},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:54},{p:55},{p:58},{p:59},{p:62},{p:63}
];
break;
case 'O':
case 'o':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'P':
case 'p':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:58},{p:59}
];
break;
case 'Q':
case 'q':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:54},{p:55},{p:62},{p:63}
];
break;
case 'R':
case 'r':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:42},{p:43},{p:44},{p:45},{p:50},{p:51},{p:54},{p:55},{p:58},{p:59},{p:62},{p:63}
];
break;
case 'S':
case 's':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:26},{p:27},{p:36},{p:37},{p:38},{p:39},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'T':
case 't':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:20},{p:21},{p:28},{p:29},{p:36},{p:37},{p:44},{p:45},{p:52},{p:53},{p:60},{p:61}
];
break;
case 'U':
case 'u':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case 'V':
case 'v':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:52},{p:53},{p:60},{p:61}
];
break;
case 'W':
case 'w':
character = [
{p:1},{p:2},{p:7},{p:8},{p:9},{p:10},{p:15},{p:16},{p:17},{p:18},{p:23},{p:24},{p:25},{p:26},{p:31},{p:32},{p:33},{p:34},{p:37},{p:38},{p:39},{p:40},{p:41},{p:42},{p:45},{p:46},{p:47},{p:48},{p:49},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:56},{p:57},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63},{p:64}
];
break;
case 'X':
case 'x':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:36},{p:37},{p:44},{p:45},{p:50},{p:51},{p:54},{p:55},{p:58},{p:59},{p:62},{p:63}
];
break;
case 'Y':
case 'y':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:36},{p:37},{p:44},{p:45},{p:52},{p:53},{p:60},{p:61}
];
break;
case 'Z':
case 'z':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:20},{p:21},{p:22},{p:23},{p:28},{p:29},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:42},{p:43},{p:44},{p:45},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
// numbers
case '1':
character = [
{p:4},{p:5},{p:12},{p:13},{p:18},{p:19},{p:20},{p:21},{p:26},{p:27},{p:28},{p:29},{p:36},{p:37},{p:44},{p:45},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case '2':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:22},{p:23},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:42},{p:43},{p:44},{p:45},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case '3':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:22},{p:23},{p:30},{p:31},{p:36},{p:37},{p:38},{p:39},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case '4':
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:54},{p:55},{p:62},{p:63}
];
break;
case '5':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:26},{p:27},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:52},{p:53},{p:54},{p:55},{p:60},{p:61},{p:62},{p:63}
];
break;
case '6':
character = [
{p:2},{p:3},{p:10},{p:11},{p:18},{p:19},{p:20},{p:21},{p:22},{p:23},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case '7':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:22},{p:23},{p:30},{p:31},{p:38},{p:39},{p:46},{p:47},{p:54},{p:55},{p:62},{p:63}
];
break;
case '8':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case '9':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:54},{p:55},{p:62},{p:63}
];
break;
case '0':
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:22},{p:23},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
// arrows
case 'arrow_down':
character = [
{p:4},{p:5},{p:12},{p:13},{p:20},{p:21},{p:28},{p:29},{p:33},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:40},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:51},{p:52},{p:53},{p:54},{p:60},{p:61}
];
break;
case 'arrow_up':
character = [
{p:4},{p:5},{p:11},{p:12},{p:13},{p:14},{p:18},{p:19},{p:20},{p:21},{p:22},{p:23},{p:25},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:32},{p:36},{p:37},{p:44},{p:45},{p:52},{p:53},{p:60},{p:61}
];
break;
case 'arrow_left':
character = [
{p:4},{p:11},{p:12},{p:18},{p:19},{p:20},{p:25},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:32},{p:33},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:40},{p:42},{p:43},{p:44},{p:51},{p:52},{p:60}
];
break;
case 'arrow_right':
character = [
{p:5},{p:13},{p:14},{p:21},{p:22},{p:23},{p:25},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:32},{p:33},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:40},{p:45},{p:46},{p:47},{p:53},{p:54},{p:61}
];
break;
// punctuation
case "!":
character = [
{p:4},{p:5},{p:12},{p:13},{p:20},{p:21},{p:28},{p:29},{p:52},{p:53},{p:60},{p:61}
];
break;
case "@":
character = [
{p:3},{p:4},{p:5},{p:6},{p:11},{p:12},{p:13},{p:14},{p:17},{p:18},{p:21},{p:22},{p:23},{p:24},{p:25},{p:26},{p:29},{p:30},{p:31},{p:32},{p:33},{p:34},{p:41},{p:42},{p:51},{p:52},{p:53},{p:54},{p:59},{p:60},{p:61},{p:62}
];
break;
case "#":
character = [
{p:2},{p:3},{p:6},{p:7},{p:9},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:16},{p:17},{p:18},{p:19},{p:20},{p:21},{p:22},{p:23},{p:24},{p:26},{p:27},{p:30},{p:31},{p:34},{p:35},{p:38},{p:39},{p:41},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:48},{p:49},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:56},{p:58},{p:59},{p:62},{p:63}
];
break;
case "$":
character = [
{p:4},{p:5},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:20},{p:21},{p:22},{p:27},{p:28},{p:29},{p:36},{p:37},{p:38},{p:43},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:60},{p:61}
];
break;
case "%":
character = [
{p:2},{p:3},{p:6},{p:7},{p:10},{p:11},{p:14},{p:15},{p:22},{p:23},{p:28},{p:29},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:42},{p:43},{p:50},{p:51},{p:54},{p:55},{p:58},{p:59},{p:62},{p:63}
];
break;
case "^":
character = [
{p:4},{p:5},{p:12},{p:13},{p:19},{p:20},{p:21},{p:22},{p:27},{p:28},{p:29},{p:30},{p:34},{p:35},{p:38},{p:39},{p:42},{p:43},{p:46},{p:47}
];
break;
case "&":
character = [
{p:3},{p:4},{p:11},{p:12},{p:17},{p:18},{p:21},{p:22},{p:25},{p:26},{p:27},{p:28},{p:29},{p:30},{p:35},{p:36},{p:41},{p:42},{p:47},{p:48},{p:49},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:56},{p:59},{p:60},{p:61},{p:62}
];
break;
case "*":
character = [
{p:4},{p:10},{p:12},{p:14},{p:20},{p:21},{p:25},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:35},{p:36},{p:37},{p:42},{p:44},{p:46},{p:52}
];
break;
case "(":
character = [
{p:4},{p:5},{p:12},{p:13},{p:18},{p:19},{p:26},{p:27},{p:34},{p:35},{p:42},{p:43},{p:52},{p:53},{p:60},{p:61}
];
break;
case ")":
character = [
{p:4},{p:5},{p:12},{p:13},{p:22},{p:23},{p:30},{p:31},{p:38},{p:39},{p:46},{p:47},{p:52},{p:53},{p:60},{p:61}
];
break;
case "-":
character = [
{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39}
];
break;
case "_":
character = [
{p:50},{p:51},{p:52},{p:53},{p:54},{p:55},{p:58},{p:59},{p:60},{p:61},{p:62},{p:63}
];
break;
case "=":
character = [
{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:18},{p:19},{p:20},{p:21},{p:22},{p:23},{p:42},{p:43},{p:44},{p:45},{p:46},{p:47},{p:50},{p:51},{p:52},{p:53},{p:54},{p:55}
];
break;
case "+":
character = [
{p:12},{p:13},{p:20},{p:21},{p:26},{p:27},{p:28},{p:29},{p:30},{p:31},{p:34},{p:35},{p:36},{p:37},{p:38},{p:39},{p:44},{p:45},{p:52},{p:53}
];
break;
case ";":
character = [
{p:12},{p:13},{p:20},{p:21},{p:36},{p:37},{p:44},{p:45},{p:50},{p:51},{p:58},{p:59}
];
break;
case ":":
character = [
{p:12},{p:13},{p:20},{p:21},{p:44},{p:45},{p:52},{p:53}
];
break;
case "'":
character = [
{p:6},{p:7},{p:14},{p:15},{p:20},{p:21},{p:28},{p:29}
];
break;
case ',':
character = [
{p:37},{p:38},{p:45},{p:46},{p:51},{p:52},{p:59},{p:60}
];
break;
case ".":
character = [
{p:52},{p:53},{p:60},{p:61}
];
break;
case '<':
character = [
{p:14},{p:15},{p:20},{p:21},{p:22},{p:23},{p:26},{p:27},{p:28},{p:29},{p:34},{p:35},{p:36},{p:37},{p:44},{p:45},{p:46},{p:47},{p:54},{p:55}
];
break;
case '>':
character = [
{p:10},{p:11},{p:18},{p:19},{p:20},{p:21},{p:28},{p:29},{p:30},{p:31},{p:36},{p:37},{p:38},{p:39},{p:42},{p:43},{p:44},{p:45},{p:50},{p:51}
];
break;
case "/":
character = [
{p:5},{p:6},{p:13},{p:14},{p:20},{p:21},{p:28},{p:29},{p:35},{p:36},{p:43},{p:44},{p:50},{p:51},{p:58},{p:59}
];
break;
case "?":
character = [
{p:2},{p:3},{p:4},{p:5},{p:6},{p:7},{p:10},{p:11},{p:12},{p:13},{p:14},{p:15},{p:22},{p:23},{p:30},{p:31},{p:36},{p:37},{p:44},{p:45},{p:60},{p:61}
];
break;
case "{":
character = [
{p:5},{p:6},{p:13},{p:14},{p:20},{p:21},{p:27},{p:28},{p:29},{p:35},{p:36},{p:37},{p:44},{p:45},{p:53},{p:54},{p:61},{p:62}
];
break;
case "}":
character = [
{p:3},{p:4},{p:11},{p:12},{p:20},{p:21},{p:28},{p:29},{p:30},{p:36},{p:37},{p:38},{p:44},{p:45},{p:51},{p:52},{p:59},{p:60}
];
break;
case "[":
character = [
{p:3},{p:4},{p:5},{p:6},{p:11},{p:12},{p:13},{p:14},{p:19},{p:20},{p:27},{p:28},{p:35},{p:36},{p:43},{p:44},{p:51},{p:52},{p:53},{p:54},{p:59},{p:60},{p:61},{p:62}
];
break;
case "]":
character = [
{p:3},{p:4},{p:5},{p:6},{p:11},{p:12},{p:13},{p:14},{p:21},{p:22},{p:29},{p:30},{p:37},{p:38},{p:45},{p:46},{p:51},{p:52},{p:53},{p:54},{p:59},{p:60},{p:61},{p:62}
];
break;
case "|":
character = [
{p:4},{p:5},{p:12},{p:13},{p:20},{p:21},{p:28},{p:29},{p:36},{p:37},{p:44},{p:45},{p:52},{p:53},{p:60},{p:61}
];
break;
default:
break;
}
break;
case 'bigblock_tiny':
switch (val) {
case ' ':
character = [];
break;
case 'A':
case 'a':
character = [
{p:20},{p:27},{p:29},{p:35},{p:36},{p:37},{p:43},{p:45}
];
break;
case 'B':
case 'b':
character = [
{p:19},{p:27},{p:28},{p:29},{p:35},{p:37},{p:43},{p:44},{p:45}
];
break;
case 'C':
case 'c':
character = [
{p:19},{p:20},{p:21},{p:27},{p:35},{p:43},{p:44},{p:45}
];
break;
case 'D':
case 'd':
character = [
{p:19},{p:20},{p:27},{p:29},{p:35},{p:37},{p:43},{p:44}
];
break;
case 'E':
case 'e':
character = [
{p:19},{p:20},{p:21},{p:27},{p:35},{p:36},{p:43},{p:44},{p:45}
];
break;
case 'F':
case 'f':
character = [
{p:19},{p:20},{p:21},{p:27},{p:35},{p:36},{p:43}
];
break;
case 'G':
case 'g':
character = [
{p:19},{p:20},{p:21},{p:27},{p:35},{p:37},{p:43},{p:44},{p:45}
];
break;
case 'H':
case 'h':
character = [
{p:19},{p:21},{p:27},{p:29},{p:35},{p:36},{p:37},{p:43},{p:45}
];
break;
case 'I':
case 'i':
character = [
{p:19},{p:20},{p:21},{p:28},{p:36},{p:43},{p:44},{p:45}
];
break;
case 'J':
case 'j':
character = [
{p:21},{p:29},{p:35},{p:37},{p:43},{p:44},{p:45}
];
break;
case 'K':
case 'k':
character = [
{p:19},{p:21},{p:27},{p:29},{p:35},{p:36},{p:43},{p:45}
];
break;
case 'L':
case 'l':
character = [
{p:19},{p:27},{p:35},{p:43},{p:44},{p:45}
];
break;
case 'M':
case 'm':
character = [
{p:19},{p:21},{p:27},{p:28},{p:29},{p:35},{p:36},{p:37},{p:43},{p:45}
];
break;
case 'N':
case 'n':
character = [
{p:19},{p:20},{p:27},{p:29},{p:35},{p:37},{p:43},{p:45}
];
break;
case 'O':
case 'o':
character = [
{p:19},{p:20},{p:21},{p:27},{p:29},{p:35},{p:37},{p:43},{p:44},{p:45}
];
break;
case 'P':
case 'p':
character = [
{p:19},{p:20},{p:21},{p:27},{p:29},{p:35},{p:36},{p:37},{p:43}
];
break;
case 'Q':
case 'q':
character = [
{p:19},{p:20},{p:21},{p:27},{p:29},{p:35},{p:36},{p:37},{p:45}
];
break;
case 'R':
case 'r':
character = [
{p:19},{p:20},{p:21},{p:27},{p:29},{p:35},{p:36},{p:43},{p:45}
];
break;
case 'S':
case 's':
character = [
{p:19},{p:20},{p:21},{p:27},{p:36},{p:37},{p:43},{p:44},{p:45}
];
break;
case 'T':
case 't':
character = [
{p:19},{p:20},{p:21},{p:28},{p:36},{p:44}
];
break;
case 'U':
case 'u':
character = [
{p:19},{p:21},{p:27},{p:29},{p:35},{p:37},{p:43},{p:44},{p:45}
];
break;
case 'V':
case 'v':
character = [
{p:19},{p:21},{p:27},{p:29},{p:35},{p:37},{p:44}
];
break;
case 'W':
case 'w':
character = [
{p:19},{p:22},{p:27},{p:30},{p:35},{p:37},{p:38},{p:43},{p:44},{p:45},{p:46}
];
break;
case 'X':
case 'x':
character = [
{p:19},{p:21},{p:27},{p:29},{p:36},{p:43},{p:45}
];
break;
case 'Y':
case 'y':
character = [
{p:19},{p:21},{p:27},{p:29},{p:36},{p:44}
];
break;
case 'Z':
case 'z':
character = [
{p:19},{p:20},{p:21},{p:28},{p:29},{p:35},{p:36},{p:43},{p:44},{p:45}
];
break;
// numbers
case '1':
character = [
{p:20},{p:27},{p:28},{p:36},{p:43},{p:44},{p:45}
];
break;
case '2':
character = [
{p:19},{p:20},{p:21},{p:29},{p:35},{p:36},{p:43},{p:44},{p:45}
];
break;
case '3':
character = [
{p:19},{p:20},{p:21},{p:29},{p:36},{p:37},{p:43},{p:44},{p:45}
];
break;
case '4':
character = [
{p:19},{p:21},{p:27},{p:29},{p:35},{p:36},{p:37},{p:45}
];
break;
case '5':
character = [
{p:19},{p:20},{p:21},{p:27},{p:35},{p:36},{p:37},{p:44},{p:45}
];
break;
case '6':
character = [
{p:19},{p:27},{p:28},{p:29},{p:35},{p:37},{p:43},{p:44},{p:45}
];
break;
case '7':
character = [
{p:19},{p:20},{p:21},{p:29},{p:37},{p:45}
];
break;
case '8':
character = [
{p:19},{p:20},{p:21},{p:27},{p:29},{p:35},{p:36},{p:37},{p:43},{p:44},{p:45}
];
break;
case '9':
character = [
{p:19},{p:20},{p:21},{p:27},{p:29},{p:35},{p:36},{p:37},{p:45}
];
break;
case '0':
character = [
{p:19},{p:20},{p:21},{p:27},{p:29},{p:35},{p:37},{p:43},{p:44},{p:45}
];
break;
// arrows
case 'arrow_down':
character = [
{p:20},{p:28},{p:35},{p:36},{p:37},{p:44}
];
break;
case 'arrow_up':
character = [
{p:20},{p:27},{p:28},{p:29},{p:36},{p:44}
];
break;
case 'arrow_left':
character = [
{p:20},{p:27},{p:28},{p:29},{p:30},{p:36}
];
break;
case 'arrow_right':
character = [
{p:21},{p:27},{p:28},{p:29},{p:30},{p:37}
];
break;
// punctuation
case "!":
character = [
{p:20},{p:28},{p:44}
];
break;
case "@":
character = [
{p:20},{p:21},{p:27},{p:29},{p:30},{p:35},{p:44},{p:45}
];
break;
case "#":
character = [
{p:19},{p:20},{p:21},{p:22},{p:27},{p:29},{p:35},{p:36},{p:37},{p:38},{p:43},{p:45}
];
break;
case "$":
character = [
{p:20},{p:21},{p:28},{p:36},{p:37},{p:44}
];
break;
case "%":
character = [
{p:19},{p:21},{p:28},{p:29},{p:35},{p:43},{p:45}
];
break;
case "^":
character = [
{p:20},{p:28},{p:35},{p:37}
];
break;
case "&":
character = [
{p:20},{p:27},{p:28},{p:29},{p:35},{p:38},{p:44},{p:45}
];
break;
case "*":
character = [
{p:19},{p:20},{p:21},{p:27},{p:28},{p:29},{p:35},{p:36},{p:37}
];
break;
case "(":
character = [
{p:20},{p:27},{p:35},{p:44}
];
break;
case ")":
character = [
{p:20},{p:29},{p:37},{p:44}
];
break;
case "-":
character = [
{p:27},{p:28},{p:29}
];
break;
case "_":
character = [
{p:43},{p:44},{p:45}
];
break;
case "=":
character = [
{p:19},{p:20},{p:21},{p:35},{p:36},{p:37}
];
break;
case "+":
character = [
{p:20},{p:27},{p:28},{p:29},{p:36}
];
break;
case ";":
character = [
{p:20},{p:36},{p:43}
];
break;
case ":":
character = [
{p:20},{p:36}
];
break;
case "'":
character = [
{p:21},{p:28}
];
break;
case ',':
character = [
{p:37},{p:44}
];
break;
case ".":
character = [
{p:44}
];
break;
case '<':
character = [
{p:21},{p:27},{p:28},{p:36},{p:37}
];
break;
case '>':
character = [
{p:19},{p:28},{p:29},{p:35},{p:36}
];
break;
case "/":
character = [
{p:21},{p:28},{p:36},{p:43}
];
break;
case "?":
character = [
{p:19},{p:20},{p:21},{p:29},{p:36},{p:44}
];
break;
case "{":
character = [
{p:21},{p:28},{p:36},{p:45}
];
break;
case "}":
character = [
{p:20},{p:28},{p:29},{p:44}
];
break;
case "[":
character = [
{p:20},{p:21},{p:28},{p:36},{p:44},{p:45}
];
break;
case "]":
character = [
{p:20},{p:21},{p:29},{p:37},{p:44},{p:45}
];
break;
case "|":
character = [
{p:20},{p:28},{p:36},{p:44}
];
break;
default:
break;
}
break;
}
return character;
}
};
}
return {
install: function() {
if(!u) { // Instantiate only if the instance doesn't exist.
u = cnstr();
}
return u;
}
};
})();
/**
* Emitter Library
* Returns preset Emitters
*
* @author Vince Allen 12-05-2009
*/
BigBlock.EmitterPresets = (function() { // uses lazy instantiation; only instantiate if using a preset
var u; // Private attribute that holds the single instance.
function cnstr() { // All of the normal singleton code goes here.
return {
getPreset: function(name, params){
var grid = BigBlock.Grid;
var em = {};
switch (name) {
case 'fire':
em = {
className : 'fire',
x: grid.width / 2,
y: grid.height / 1.25,
life: 0,
emission_rate: 1,
//
p_burst: 16,
p_velocity: 1.5,
p_velocity_spread: .1, // values closer to zero create more variability
p_angle: 270,
p_angle_spread: 0,
p_life: 35,
p_life_spread: 1, // values closer to zero create more variability
p_life_offset_x : 1, // boolean 0 = no offset; 1 = offset
p_life_offset_y : 0, // boolean 0 = no offset; 1 = offset
p_gravity: 0,
p_init_pos_spread_x: 4,
p_init_pos_spread_y: 0,
p_spiral_vel_x : 0,
p_spiral_vel_y : 0
};
break;
case 'spark':
em = {
className : 'fire',
x: grid.width / 2,
y: grid.height / 1.25,
life: 0,
emission_rate: 50,
//
p_burst: 1,
p_velocity: 1.5,
p_velocity_spread: 1, // values closer to zero create more variability
p_angle: 270,
p_angle_spread: 0,
p_life: 50,
p_life_spread: 1, // values closer to zero create more variability
p_life_offset_x : 1, // boolean 0 = no offset; 1 = offset
p_life_offset_y : 0, // boolean 0 = no offset; 1 = offset
p_gravity: 0,
p_init_pos_spread_x: 4,
p_init_pos_spread_y: 0,
p_spiral_vel_x : 1,
p_spiral_vel_y : 0
};
break;
case 'speak':
em = {
className : 'speak',
x: grid.width / 2,
y: grid.height / 2,
life: 10,
emission_rate: 10,
//
p_burst: 3,
p_velocity: 1.5,
p_velocity_spread: .75, // values closer to zero create more variability
p_angle: 0,
p_angle_spread: 15,
p_life: 25,
p_life_spread: 1, // values closer to zero create more variability
p_life_offset_x : 0, // boolean 0 = no offset; 1 = offset
p_life_offset_y : 0, // boolean 0 = no offset; 1 = offset
p_gravity: 0,
p_init_pos_spread_x: 0,
p_init_pos_spread_y: 0,
p_spiral_vel_x : 0,
p_spiral_vel_y : 0
};
break;
case 'trail_red':
em = {
className : 'red_black',
x: grid.width / 2,
y: grid.height / 2,
life: 10,
emission_rate: 10,
//
p_burst: 3,
p_velocity: 1.5,
p_velocity_spread: .1, // values closer to zero create more variability
p_angle: 0,
p_angle_spread: 10,
p_life: 35,
p_life_spread: 1, // values closer to zero create more variability
p_life_offset_x : 1, // boolean 0 = no offset; 1 = offset
p_life_offset_y : 0, // boolean 0 = no offset; 1 = offset
p_gravity: 0,
p_init_pos_spread_x: 4,
p_init_pos_spread_y: 0,
p_spiral_vel_x : 0,
p_spiral_vel_y : 0
};
break;
case 'trail_white':
em = {
className : 'white_black',
x: grid.width / 2,
y: grid.height / 2,
life: 10,
emission_rate: 10,
//
p_burst: 3,
p_velocity: 1.5,
p_velocity_spread: .1, // values closer to zero create more variability
p_angle: 0,
p_angle_spread: 10,
p_life: 35,
p_life_spread: 1, // values closer to zero create more variability
p_life_offset_x : 1, // boolean 0 = no offset; 1 = offset
p_life_offset_y : 0, // boolean 0 = no offset; 1 = offset
p_gravity: 0,
p_init_pos_spread_x: 4,
p_init_pos_spread_y: 0,
p_spiral_vel_x : 0,
p_spiral_vel_y : 0
};
break;
default:
try {
throw new Error('Err: EPGP001');
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
break;
}
// Params
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
em[i] = params[i];
}
}
}
return em;
}
};
}
return {
install: function() {
if(!u) { // Instantiate only if the instance doesn't exist.
u = cnstr();
}
return u;
}
};
})();
/**
* Loader object
* Renders loading info to a div in the DOM
*
* @author Vince Allen 12-05-2009
*/
BigBlock.Loader = (function () {
return {
id : 'loader',
class_name : 'loader_container',
style : {
position : 'absolute',
backgroundColor : 'transparent',
border : '1px solid #aaa',
padding : '2px',
textAlign : 'center',
color: '#aaa'
},
style_bar : {
fontSize: '1%',
position: 'absolute',
top: '2px',
left: '2px',
backgroundColor: '#999',
color: '#999',
height: '10px',
cssFloat: 'left'
},
width : 100,
height : 10,
format : 'percentage',
total : 0,
msg : ' ',
bar_color : '#999',
add: function(){
try {
if (window.innerWidth) { // mozilla
this.style.left = (window.innerWidth / 2 - (this.width / 2)) + 'px';
this.style.top = (window.innerHeight / 2 - (this.height / 2)) + 'px';
} else if (document.documentElement.clientWidth) { // IE
this.style.left = (document.documentElement.clientWidth / 2 - (this.width / 2)) + 'px';
this.style.top = (document.documentElement.clientHeight / 2 - (this.height / 2)) + 'px';
} else {
this.style.left = '350px';
this.style.top = '195px';
throw new Error('Err: LA001');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
this.style.width = this.width + 'px';
this.style.height = this.height + 'px';
//document.body.innerHTML = "<div id='" + this.id + "' class='" + this.class_name + "'><div id='" + this.id + "_bar' class='" + this.class_name + "_bar'>.</div></div>"; // insert the Loader container into the body
var lc = document.createElement("div"); // create loader container div
lc.setAttribute('id', this.id);
lc.setAttribute('class', this.class_name);
if (typeof document.addEventListener != 'function') { // test for IE
lc.setAttribute('className', this.class_name); // IE6
}
var b = document.getElementsByTagName('body').item(0);
b.appendChild(lc); // add loader container to body
var l = document.createElement("div"); // create loader
l.setAttribute('id', this.id + '_bar');
l.setAttribute('class', this.class_name + '_bar');
if (typeof document.addEventListener != 'function') { // test for IE
l.setAttribute('className', this.class_name + '_bar'); // IE6
}
var lc_ = document.getElementById(this.id);
lc_.appendChild(l); // add loader to loader container
for (var key in this.style) { // loop thru styles and apply
if (this.style.hasOwnProperty(key)) {
document.getElementById(this.id).style[key] = this.style[key];
}
}
for (key in this.style_bar) { // loop thru styles and apply
if (this.style_bar.hasOwnProperty(key)) {
document.getElementById(this.id + '_bar').style[key] = this.style_bar[key];
}
}
document.getElementById(this.id + '_bar').style.cssFloat = 'left';
},
update: function (params) {
if (typeof(params) != 'undefined') {
if (typeof(params.total) != 'undefined') {
this.total = params.total;
}
}
var width = (this.total/100) * 100;
document.getElementById(this.id+'_bar').style.width = width + 'px';
}
};
})();
/**
* PanelInfo object
* Builds an overlay panel for ittybitty8bit.
*
* @author Vince Allen 08-02-2010
*/
BigBlock.PanelInfo = (function() { // uses lazy instantiation;
function cnstr(before, after) { // All of the normal singleton code goes here.
return {
panel_timeout: false,
before : before,
after : after,
restoreProps : {
Sprites : [],
GridStaticStyles : {},
GridActiveStyles : {},
GridTextStyles : {},
StaticDivs : {
'qS_tl' : [],
'qS_tr' : [],
'qS_bl' : [],
'qS_br' : []
},
TextDivs : {
'qT_tl' : [],
'qT_tr' : [],
'qT_bl' : [],
'qT_br' : []
}
},
evtListner : [],
logoScreen: function(){
if (typeof(this.before) == 'function') {
this.before();
}
var quads = BigBlock.GridStatic.quads;
for (var i = 0; i < quads.length; i++) { // make a copy of all static divs
var q = document.getElementById(quads[i].id);
if (q.hasChildNodes()) {
var nodes = q.childNodes; // get a collection of all children in quad;
var tmp = [];
// DOM collections are live; iterating over a static array is faster than iterating over a live DOM collection
for( var x = 0; x < nodes.length; x++ ) { // make copy of DOM collection
tmp[tmp.length] = nodes[x];
}
for (var j = 0; j < tmp.length; j++) { // add child to array
this.restoreProps.StaticDivs[quads[i].id].push(tmp[j]);
}
nodes = null;
tmp = null;
}
}
var quads = BigBlock.GridText.quads;
for (i = 0; i < quads.length; i++) { // make a copy of all text divs
q = document.getElementById(quads[i].id);
if (q.hasChildNodes()) {
var nodes = q.childNodes; // get a collection of all children in quad;
var tmp = [];
// DOM collections are live; iterating over a static array is faster than iterating over a live DOM collection
for( var x = 0; x < nodes.length; x++ ) { // make copy of DOM collection
tmp[tmp.length] = nodes[x];
}
for (var j = 0; j < tmp.length; j++) { // add child to array
this.restoreProps.TextDivs[quads[i].id].push(tmp[j]);
}
nodes = null;
tmp = null;
}
}
// adds event listener for any sprites carrying input actions
var quads = BigBlock.GridActive.quads;
var dm = BigBlock.Grid.pix_dim;
var inputAction = function (evt_x, evt_y, event) {
for (var i = 0; i < BigBlock.Sprites.length; i++) { // check to fire any active sprite events
if (BigBlock.Sprites[i].input_action !== false && typeof(BigBlock.Sprites[i].input_action) == 'function') {
var x = BigBlock.Sprites[i].x;
var y = BigBlock.Sprites[i].y;
if (BigBlock.ptInsideRect(evt_x, evt_y, x, (x + dm), y, (y + dm))) {
BigBlock.Sprites[i].input_action(event);
}
}
}
};
var mouseup_event = function (event) {
if (typeof(BigBlock.GridActive) != 'undefined') {
inputAction((event.clientX - BigBlock.GridActive.x), (event.clientY - BigBlock.GridActive.y), event);
}
};
for (i = 0; i < quads.length; i++) {
q = document.getElementById(quads[i].id);
if (q.addEventListener) { // mozilla
q.addEventListener('mouseup', mouseup_event, false); // add mouseup event listener
} else if (q.attachEvent) { // IE
q.attachEvent('onmouseup', mouseup_event)
}
this.evtListner[this.evtListner.length] = mouseup_event;
}
//
this.restoreProps.Sprites = BigBlock.Sprites; // make a copy of the Sprite array
for (var key in BigBlock.GridStatic.styles) { // copy of the GridStatic styles
if (BigBlock.GridStatic.styles.hasOwnProperty(key)) {
this.restoreProps.GridStaticStyles[key] = BigBlock.GridStatic.styles[key];
}
}
for (var key in BigBlock.GridActive.styles) { // copy of the GridActive styles
if (BigBlock.GridActive.styles.hasOwnProperty(key)) {
this.restoreProps.GridActiveStyles[key] = BigBlock.GridActive.styles[key];
}
}
for (var key in BigBlock.GridText.styles) { // copy of the GridText styles
if (BigBlock.GridText.styles.hasOwnProperty(key)) {
this.restoreProps.GridTextStyles[key] = BigBlock.GridText.styles[key];
}
}
BigBlock.RenderMgr.clearScene(); // clear the scene
BigBlock.GridStatic.setStyle('backgroundColor', '#fff'); // set GridStatic backgroundColor = white
BigBlock.inputBlock = true; // block user input
BigBlock.TapTimeout.stop(); // stop tap timeout
BigBlock.SpriteAdvanced.create({
alias : 'logo',
x : (BigBlock.Grid.width - 168)/2,
y : (BigBlock.Grid.height - 296)/2,
life : 0,
anim_state: 'stop',
anim_loop: 1,
render_static: true,
anim : this.pPhnBg
});
BigBlock.SpriteAdvanced.create({
alias : 'pTxtLogo',
x : 24,
y : 120,
life : 0,
anim_state: 'stop',
anim_loop: 1,
render_static: false,
anim : this.pTxtLogo
});
this.panel_timeout = setTimeout(function () {
BigBlock.PanelInfoInst.infoScreen_text1()
}, 2000); // pause for info screen
},
infoScreen_text1 : function () {
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByAlias('pTxtLogo')]) != 'undefined') {
BigBlock.Sprites[BigBlock.getObjIdByAlias('pTxtLogo')].die();
}
//
BigBlock.WordSimple.create({
word_id: 'btn_link',
x: 256,
y : 88,
value: " close ",
className: "white",
url : function (event) {
BigBlock.PanelInfoInst.removeAndRestore(event);
},
link_color : "#333"
});
this.panel_timeout = setTimeout(function () {
BigBlock.PanelInfoInst.infoScreen_text2()
}, 500); // pause for info screen
},
infoScreen_text2 : function () {
BigBlock.SpriteAdvanced.create({
alias : 'pTxtPanel1',
x : 160,
y : 128,
life : 0,
anim_state: 'stop',
anim_loop: 1,
render_static: true,
anim : this.pTxtPanel1
});
BigBlock.WordSimple.create({
word_id : 'ln1',
x : 176,
y : 144,
value : "view this app",
className : 'black',
font : 'bigblock_bold',
glass : true
});
BigBlock.WordSimple.create({
word_id : 'ln2',
x : 176,
y : 160,
value : "on your phone",
className : 'black',
font : 'bigblock_bold',
glass : true
});
this.panel_timeout = setTimeout(function () {
BigBlock.PanelInfoInst.infoScreen_text3()
}, 1000); // pause for info screen
},
infoScreen_text3 : function () {
BigBlock.SpriteAdvanced.create({
alias : 'pTxtPanel2',
x : 16,
y : 208,
life : 0,
anim_state: 'stop',
anim_loop: 1,
render_static: true,
anim : this.pTxtPanel2
});
BigBlock.WordSimple.create({
word_id : 'ln3',
x : 32,
y : 224,
value : "visit",
className : 'black',
font : 'bigblock_bold',
glass : true
});
BigBlock.WordSimple.create({
word_id : 'ln4',
x : 80,
y : 224,
value : "arrow_right",
className : 'black',
font : 'bigblock_bold',
glass : true
});
BigBlock.WordSimple.create({
word_id : 'ln5',
x : 96,
y : 224,
value : "ittybitty8bit.com",
className : 'white',
font : 'bigblock_bold',
glass : false,
url : BigBlock.URL_ittybitty8bit,
link_color : '#000'
});
this.panel_timeout = setTimeout(function () {
BigBlock.PanelInfoInst.infoScreen_text4()
}, 1000); // pause for info screen
},
infoScreen_text4 : function () {
BigBlock.SpriteAdvanced.create({
alias : 'pTxtPanel3',
x : 104,
y : 280,
life : 0,
anim_state: 'stop',
anim_loop: 1,
render_static: true,
anim : this.pTxtPanel3
});
BigBlock.WordSimple.create({
word_id : 'ln6',
x : 120,
y : 312,
value : "ittybitty8bit creates",
className : 'black',
font : 'bigblock_bold',
glass : true
});
BigBlock.WordSimple.create({
word_id : 'ln7',
x : 120,
y : 328,
value : "interactive pixel art",
className : 'black',
font : 'bigblock_bold',
glass : true
});
BigBlock.WordSimple.create({
word_id : 'ln8',
x : 120,
y : 344,
value : "for mobile devices.",
className : 'black',
font : 'bigblock_bold',
glass : true
});
this.panel_timeout = setTimeout(function () {
BigBlock.PanelInfoInst.infoScreen_text5()
}, 1000); // pause for info screen
},
infoScreen_text5 : function () {
BigBlock.SpriteAdvanced.create({
alias : 'pTxtPanel4',
x : 16,
y : 352,
life : 0,
anim_state: 'stop',
anim_loop: 1,
render_static: true,
anim : this.pTxtPanel4
});
BigBlock.WordSimple.create({
word_id : 'ln10',
x : 32,
y : 384,
value : "arrow_right",
className : 'black',
font : 'bigblock_bold',
glass : true
});
BigBlock.WordSimple.create({
word_id : 'ln11',
x : 48,
y : 384,
value : "facebook",
className : 'white',
font : 'bigblock_bold',
glass : false,
url : BigBlock.URL_Facebook,
link_color : '#000'
});
BigBlock.WordSimple.create({
word_id : 'ln12',
x : 120,
y : 384,
value : "arrow_right",
className : 'black',
font : 'bigblock_bold',
glass : true
});
BigBlock.WordSimple.create({
word_id : 'ln13',
x : 136,
y : 384,
value : "twitter",
className : 'white',
font : 'bigblock_bold',
glass : false,
url : BigBlock.URL_Twitter,
link_color : '#000'
});
},
removeAndRestore : function (event) {
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
clearTimeout(this.panel_timeout);
var quads = BigBlock.GridActive.quads; // remove event listeners
for (var i = 0; i < quads.length; i++) {
var q = document.getElementById(quads[i].id);
if (q.removeEventListener) { // mozilla
q.removeEventListener('mouseup', this.evtListner[i], false);
} else if (q.attachEvent) { // IE
q.detachEvent('onmouseup', this.evtListner[i])
}
}
BigBlock.RenderMgr.clearScene(); // clear the scene
for (var key in this.restoreProps.GridStaticStyles) { // restore styles
if (this.restoreProps.GridStaticStyles.hasOwnProperty(key)) {
BigBlock.GridStatic.setStyle(key, this.restoreProps.GridStaticStyles[key]);
}
}
for (var key in this.restoreProps.GridActiveStyles) {
if (this.restoreProps.GridActiveStyles.hasOwnProperty(key)) {
BigBlock.GridActive.setStyle(key, this.restoreProps.GridActiveStyles[key]);
}
}
for (var key in this.restoreProps.GridTextStyles) {
if (this.restoreProps.GridTextStyles.hasOwnProperty(key)) {
BigBlock.GridText.setStyle(key, this.restoreProps.GridTextStyles[key]);
}
}
BigBlock.Sprites = this.restoreProps.Sprites; // restore the Sprite array
for (var key in this.restoreProps.StaticDivs) { // replace all Static Divs
if (this.restoreProps.StaticDivs.hasOwnProperty(key)) {
var q = document.getElementById(key);
for (var d in this.restoreProps.StaticDivs[key]) {
q.appendChild(this.restoreProps.StaticDivs[key][d]);
}
}
}
for (key in this.restoreProps.TextDivs) { // replace all Text Divs
if (this.restoreProps.TextDivs.hasOwnProperty(key)) {
q = document.getElementById(key);
for (d in this.restoreProps.TextDivs[key]) {
q.appendChild(this.restoreProps.TextDivs[key][d]);
}
}
}
BigBlock.inputBlock = false; // release input block
delete BigBlock.PanelInfoInst; // delete instance
if (typeof(this.after) == 'function') {
this.after();
}
},
remove: function (before, after) {
},
pPhnBg : [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'pPhnBg0','i': (40*0)+2},
{'c':'pPhnBg0','i': (40*0)+3},
{'c':'pPhnBg0','i': (40*0)+4},
{'c':'pPhnBg0','i': (40*0)+5},
{'c':'pPhnBg0','i': (40*0)+6},
{'c':'pPhnBg0','i': (40*0)+7},
{'c':'pPhnBg0','i': (40*0)+8},
{'c':'pPhnBg0','i': (40*0)+9},
{'c':'pPhnBg0','i': (40*0)+10},
{'c':'pPhnBg0','i': (40*0)+11},
{'c':'pPhnBg0','i': (40*0)+12},
{'c':'pPhnBg0','i': (40*0)+13},
{'c':'pPhnBg0','i': (40*0)+14},
{'c':'pPhnBg0','i': (40*0)+15},
{'c':'pPhnBg0','i': (40*0)+16},
{'c':'pPhnBg0','i': (40*0)+17},
{'c':'pPhnBg0','i': (40*0)+18},
{'c':'pPhnBg0','i': (40*1)+1},
{'c':'pPhnBg1','i': (40*1)+2},
{'c':'pPhnBg1','i': (40*1)+3},
{'c':'pPhnBg1','i': (40*1)+4},
{'c':'pPhnBg1','i': (40*1)+5},
{'c':'pPhnBg1','i': (40*1)+6},
{'c':'pPhnBg1','i': (40*1)+7},
{'c':'pPhnBg1','i': (40*1)+8},
{'c':'pPhnBg1','i': (40*1)+9},
{'c':'pPhnBg1','i': (40*1)+10},
{'c':'pPhnBg1','i': (40*1)+11},
{'c':'pPhnBg1','i': (40*1)+12},
{'c':'pPhnBg1','i': (40*1)+13},
{'c':'pPhnBg1','i': (40*1)+14},
{'c':'pPhnBg1','i': (40*1)+15},
{'c':'pPhnBg1','i': (40*1)+16},
{'c':'pPhnBg1','i': (40*1)+17},
{'c':'pPhnBg1','i': (40*1)+18},
{'c':'pPhnBg2','i': (40*1)+19},
{'c':'pPhnBg0','i': (40*2)+0},
{'c':'pPhnBg1','i': (40*2)+1},
{'c':'pPhnBg1','i': (40*2)+2},
{'c':'pPhnBg1','i': (40*2)+3},
{'c':'pPhnBg1','i': (40*2)+4},
{'c':'pPhnBg1','i': (40*2)+5},
{'c':'pPhnBg1','i': (40*2)+6},
{'c':'pPhnBg1','i': (40*2)+7},
{'c':'pPhnBg1','i': (40*2)+8},
{'c':'pPhnBg1','i': (40*2)+9},
{'c':'pPhnBg1','i': (40*2)+10},
{'c':'pPhnBg1','i': (40*2)+11},
{'c':'pPhnBg1','i': (40*2)+12},
{'c':'pPhnBg1','i': (40*2)+13},
{'c':'pPhnBg1','i': (40*2)+14},
{'c':'pPhnBg1','i': (40*2)+15},
{'c':'pPhnBg1','i': (40*2)+16},
{'c':'pPhnBg1','i': (40*2)+17},
{'c':'pPhnBg1','i': (40*2)+18},
{'c':'pPhnBg1','i': (40*2)+19},
{'c':'pPhnBg3','i': (40*2)+20},
{'c':'pPhnBg0','i': (40*3)+0},
{'c':'pPhnBg1','i': (40*3)+1},
{'c':'pPhnBg1','i': (40*3)+2},
{'c':'pPhnBg1','i': (40*3)+3},
{'c':'pPhnBg1','i': (40*3)+4},
{'c':'pPhnBg1','i': (40*3)+5},
{'c':'pPhnBg1','i': (40*3)+6},
{'c':'pPhnBg1','i': (40*3)+7},
{'c':'pPhnBg1','i': (40*3)+8},
{'c':'pPhnBg3','i': (40*3)+9},
{'c':'pPhnBg3','i': (40*3)+10},
{'c':'pPhnBg3','i': (40*3)+11},
{'c':'pPhnBg1','i': (40*3)+12},
{'c':'pPhnBg1','i': (40*3)+13},
{'c':'pPhnBg1','i': (40*3)+14},
{'c':'pPhnBg1','i': (40*3)+15},
{'c':'pPhnBg1','i': (40*3)+16},
{'c':'pPhnBg1','i': (40*3)+17},
{'c':'pPhnBg1','i': (40*3)+18},
{'c':'pPhnBg1','i': (40*3)+19},
{'c':'pPhnBg3','i': (40*3)+20},
{'c':'pPhnBg0','i': (40*4)+0},
{'c':'pPhnBg1','i': (40*4)+1},
{'c':'pPhnBg1','i': (40*4)+2},
{'c':'pPhnBg1','i': (40*4)+3},
{'c':'pPhnBg1','i': (40*4)+4},
{'c':'pPhnBg1','i': (40*4)+5},
{'c':'pPhnBg1','i': (40*4)+6},
{'c':'pPhnBg1','i': (40*4)+7},
{'c':'pPhnBg1','i': (40*4)+8},
{'c':'pPhnBg1','i': (40*4)+9},
{'c':'pPhnBg1','i': (40*4)+10},
{'c':'pPhnBg1','i': (40*4)+11},
{'c':'pPhnBg1','i': (40*4)+12},
{'c':'pPhnBg1','i': (40*4)+13},
{'c':'pPhnBg1','i': (40*4)+14},
{'c':'pPhnBg1','i': (40*4)+15},
{'c':'pPhnBg1','i': (40*4)+16},
{'c':'pPhnBg1','i': (40*4)+17},
{'c':'pPhnBg1','i': (40*4)+18},
{'c':'pPhnBg1','i': (40*4)+19},
{'c':'pPhnBg3','i': (40*4)+20},
{'c':'pPhnBg0','i': (40*5)+0},
{'c':'pPhnBg1','i': (40*5)+1},
{'c':'pPhnBg1','i': (40*5)+2},
{'c':'pPhnBg1','i': (40*5)+3},
{'c':'pPhnBg1','i': (40*5)+4},
{'c':'pPhnBg1','i': (40*5)+5},
{'c':'pPhnBg1','i': (40*5)+6},
{'c':'pPhnBg1','i': (40*5)+7},
{'c':'pPhnBg1','i': (40*5)+8},
{'c':'pPhnBg1','i': (40*5)+9},
{'c':'pPhnBg1','i': (40*5)+10},
{'c':'pPhnBg1','i': (40*5)+11},
{'c':'pPhnBg1','i': (40*5)+12},
{'c':'pPhnBg1','i': (40*5)+13},
{'c':'pPhnBg1','i': (40*5)+14},
{'c':'pPhnBg1','i': (40*5)+15},
{'c':'pPhnBg1','i': (40*5)+16},
{'c':'pPhnBg1','i': (40*5)+17},
{'c':'pPhnBg1','i': (40*5)+18},
{'c':'pPhnBg1','i': (40*5)+19},
{'c':'pPhnBg3','i': (40*5)+20},
{'c':'pPhnBg0','i': (40*6)+0},
{'c':'pPhnBg1','i': (40*6)+1},
{'c':'pPhnBg4','i': (40*6)+2},
{'c':'pPhnBg4','i': (40*6)+3},
{'c':'pPhnBg4','i': (40*6)+4},
{'c':'pPhnBg4','i': (40*6)+5},
{'c':'pPhnBg4','i': (40*6)+6},
{'c':'pPhnBg4','i': (40*6)+7},
{'c':'pPhnBg4','i': (40*6)+8},
{'c':'pPhnBg4','i': (40*6)+9},
{'c':'pPhnBg4','i': (40*6)+10},
{'c':'pPhnBg4','i': (40*6)+11},
{'c':'pPhnBg4','i': (40*6)+12},
{'c':'pPhnBg4','i': (40*6)+13},
{'c':'pPhnBg4','i': (40*6)+14},
{'c':'pPhnBg4','i': (40*6)+15},
{'c':'pPhnBg4','i': (40*6)+16},
{'c':'pPhnBg4','i': (40*6)+17},
{'c':'pPhnBg4','i': (40*6)+18},
{'c':'pPhnBg1','i': (40*6)+19},
{'c':'pPhnBg3','i': (40*6)+20},
{'c':'pPhnBg0','i': (40*7)+0},
{'c':'pPhnBg1','i': (40*7)+1},
{'c':'pPhnBg5','i': (40*7)+2},
{'c':'pPhnBg5','i': (40*7)+3},
{'c':'pPhnBg5','i': (40*7)+4},
{'c':'pPhnBg5','i': (40*7)+5},
{'c':'pPhnBg5','i': (40*7)+6},
{'c':'pPhnBg5','i': (40*7)+7},
{'c':'pPhnBg5','i': (40*7)+8},
{'c':'pPhnBg5','i': (40*7)+9},
{'c':'pPhnBg5','i': (40*7)+10},
{'c':'pPhnBg5','i': (40*7)+11},
{'c':'pPhnBg5','i': (40*7)+12},
{'c':'pPhnBg5','i': (40*7)+13},
{'c':'pPhnBg5','i': (40*7)+14},
{'c':'pPhnBg5','i': (40*7)+15},
{'c':'pPhnBg5','i': (40*7)+16},
{'c':'pPhnBg5','i': (40*7)+17},
{'c':'pPhnBg5','i': (40*7)+18},
{'c':'pPhnBg1','i': (40*7)+19},
{'c':'pPhnBg3','i': (40*7)+20},
{'c':'pPhnBg0','i': (40*8)+0},
{'c':'pPhnBg1','i': (40*8)+1},
{'c':'pPhnBg5','i': (40*8)+2},
{'c':'pPhnBg5','i': (40*8)+3},
{'c':'pPhnBg6','i': (40*8)+4},
{'c':'pPhnBg6','i': (40*8)+5},
{'c':'pPhnBg6','i': (40*8)+6},
{'c':'pPhnBg6','i': (40*8)+7},
{'c':'pPhnBg6','i': (40*8)+8},
{'c':'pPhnBg6','i': (40*8)+9},
{'c':'pPhnBg6','i': (40*8)+10},
{'c':'pPhnBg6','i': (40*8)+11},
{'c':'pPhnBg6','i': (40*8)+12},
{'c':'pPhnBg6','i': (40*8)+13},
{'c':'pPhnBg6','i': (40*8)+14},
{'c':'pPhnBg6','i': (40*8)+15},
{'c':'pPhnBg6','i': (40*8)+16},
{'c':'pPhnBg5','i': (40*8)+17},
{'c':'pPhnBg5','i': (40*8)+18},
{'c':'pPhnBg1','i': (40*8)+19},
{'c':'pPhnBg3','i': (40*8)+20},
{'c':'pPhnBg0','i': (40*9)+0},
{'c':'pPhnBg1','i': (40*9)+1},
{'c':'pPhnBg5','i': (40*9)+2},
{'c':'pPhnBg5','i': (40*9)+3},
{'c':'pPhnBg6','i': (40*9)+4},
{'c':'pPhnBg6','i': (40*9)+5},
{'c':'pPhnBg6','i': (40*9)+6},
{'c':'pPhnBg6','i': (40*9)+7},
{'c':'pPhnBg6','i': (40*9)+8},
{'c':'pPhnBg6','i': (40*9)+9},
{'c':'pPhnBg6','i': (40*9)+10},
{'c':'pPhnBg6','i': (40*9)+11},
{'c':'pPhnBg6','i': (40*9)+12},
{'c':'pPhnBg6','i': (40*9)+13},
{'c':'pPhnBg6','i': (40*9)+14},
{'c':'pPhnBg6','i': (40*9)+15},
{'c':'pPhnBg6','i': (40*9)+16},
{'c':'pPhnBg5','i': (40*9)+17},
{'c':'pPhnBg5','i': (40*9)+18},
{'c':'pPhnBg1','i': (40*9)+19},
{'c':'pPhnBg3','i': (40*9)+20},
{'c':'pPhnBg0','i': (40*10)+0},
{'c':'pPhnBg1','i': (40*10)+1},
{'c':'pPhnBg5','i': (40*10)+2},
{'c':'pPhnBg5','i': (40*10)+3},
{'c':'pPhnBg5','i': (40*10)+4},
{'c':'pPhnBg5','i': (40*10)+5},
{'c':'pPhnBg5','i': (40*10)+6},
{'c':'pPhnBg5','i': (40*10)+7},
{'c':'pPhnBg5','i': (40*10)+8},
{'c':'pPhnBg5','i': (40*10)+9},
{'c':'pPhnBg5','i': (40*10)+10},
{'c':'pPhnBg5','i': (40*10)+11},
{'c':'pPhnBg5','i': (40*10)+12},
{'c':'pPhnBg5','i': (40*10)+13},
{'c':'pPhnBg5','i': (40*10)+14},
{'c':'pPhnBg5','i': (40*10)+15},
{'c':'pPhnBg5','i': (40*10)+16},
{'c':'pPhnBg5','i': (40*10)+17},
{'c':'pPhnBg5','i': (40*10)+18},
{'c':'pPhnBg1','i': (40*10)+19},
{'c':'pPhnBg3','i': (40*10)+20},
{'c':'pPhnBg0','i': (40*11)+0},
{'c':'pPhnBg1','i': (40*11)+1},
{'c':'pPhnBg7','i': (40*11)+2},
{'c':'pPhnBg7','i': (40*11)+3},
{'c':'pPhnBg7','i': (40*11)+4},
{'c':'pPhnBg7','i': (40*11)+5},
{'c':'pPhnBg7','i': (40*11)+6},
{'c':'pPhnBg7','i': (40*11)+7},
{'c':'pPhnBg7','i': (40*11)+8},
{'c':'pPhnBg7','i': (40*11)+9},
{'c':'pPhnBg7','i': (40*11)+10},
{'c':'pPhnBg7','i': (40*11)+11},
{'c':'pPhnBg7','i': (40*11)+12},
{'c':'pPhnBg7','i': (40*11)+13},
{'c':'pPhnBg7','i': (40*11)+14},
{'c':'pPhnBg7','i': (40*11)+15},
{'c':'pPhnBg7','i': (40*11)+16},
{'c':'pPhnBg7','i': (40*11)+17},
{'c':'pPhnBg7','i': (40*11)+18},
{'c':'pPhnBg1','i': (40*11)+19},
{'c':'pPhnBg3','i': (40*11)+20},
{'c':'pPhnBg0','i': (40*12)+0},
{'c':'pPhnBg1','i': (40*12)+1},
{'c':'pPhnBg7','i': (40*12)+2},
{'c':'pPhnBg7','i': (40*12)+3},
{'c':'pPhnBg7','i': (40*12)+4},
{'c':'pPhnBg7','i': (40*12)+5},
{'c':'pPhnBg7','i': (40*12)+6},
{'c':'pPhnBg7','i': (40*12)+7},
{'c':'pPhnBg7','i': (40*12)+8},
{'c':'pPhnBg7','i': (40*12)+9},
{'c':'pPhnBg7','i': (40*12)+10},
{'c':'pPhnBg7','i': (40*12)+11},
{'c':'pPhnBg7','i': (40*12)+12},
{'c':'pPhnBg7','i': (40*12)+13},
{'c':'pPhnBg7','i': (40*12)+14},
{'c':'pPhnBg7','i': (40*12)+15},
{'c':'pPhnBg7','i': (40*12)+16},
{'c':'pPhnBg7','i': (40*12)+17},
{'c':'pPhnBg7','i': (40*12)+18},
{'c':'pPhnBg1','i': (40*12)+19},
{'c':'pPhnBg3','i': (40*12)+20},
{'c':'pPhnBg0','i': (40*13)+0},
{'c':'pPhnBg1','i': (40*13)+1},
{'c':'pPhnBg7','i': (40*13)+2},
{'c':'pPhnBg7','i': (40*13)+3},
{'c':'pPhnBg7','i': (40*13)+4},
{'c':'pPhnBg7','i': (40*13)+5},
{'c':'pPhnBg7','i': (40*13)+6},
{'c':'pPhnBg7','i': (40*13)+7},
{'c':'pPhnBg7','i': (40*13)+8},
{'c':'pPhnBg7','i': (40*13)+9},
{'c':'pPhnBg7','i': (40*13)+10},
{'c':'pPhnBg7','i': (40*13)+11},
{'c':'pPhnBg7','i': (40*13)+12},
{'c':'pPhnBg7','i': (40*13)+13},
{'c':'pPhnBg7','i': (40*13)+14},
{'c':'pPhnBg7','i': (40*13)+15},
{'c':'pPhnBg7','i': (40*13)+16},
{'c':'pPhnBg7','i': (40*13)+17},
{'c':'pPhnBg7','i': (40*13)+18},
{'c':'pPhnBg1','i': (40*13)+19},
{'c':'pPhnBg3','i': (40*13)+20},
{'c':'pPhnBg0','i': (40*14)+0},
{'c':'pPhnBg1','i': (40*14)+1},
{'c':'pPhnBg7','i': (40*14)+2},
{'c':'pPhnBg7','i': (40*14)+3},
{'c':'pPhnBg7','i': (40*14)+4},
{'c':'pPhnBg7','i': (40*14)+5},
{'c':'pPhnBg7','i': (40*14)+6},
{'c':'pPhnBg7','i': (40*14)+7},
{'c':'pPhnBg7','i': (40*14)+8},
{'c':'pPhnBg7','i': (40*14)+9},
{'c':'pPhnBg7','i': (40*14)+10},
{'c':'pPhnBg7','i': (40*14)+11},
{'c':'pPhnBg7','i': (40*14)+12},
{'c':'pPhnBg7','i': (40*14)+13},
{'c':'pPhnBg7','i': (40*14)+14},
{'c':'pPhnBg7','i': (40*14)+15},
{'c':'pPhnBg7','i': (40*14)+16},
{'c':'pPhnBg7','i': (40*14)+17},
{'c':'pPhnBg7','i': (40*14)+18},
{'c':'pPhnBg1','i': (40*14)+19},
{'c':'pPhnBg3','i': (40*14)+20},
{'c':'pPhnBg0','i': (40*15)+0},
{'c':'pPhnBg1','i': (40*15)+1},
{'c':'pPhnBg7','i': (40*15)+2},
{'c':'pPhnBg7','i': (40*15)+3},
{'c':'pPhnBg7','i': (40*15)+4},
{'c':'pPhnBg7','i': (40*15)+5},
{'c':'pPhnBg7','i': (40*15)+6},
{'c':'pPhnBg7','i': (40*15)+7},
{'c':'pPhnBg7','i': (40*15)+8},
{'c':'pPhnBg7','i': (40*15)+9},
{'c':'pPhnBg7','i': (40*15)+10},
{'c':'pPhnBg7','i': (40*15)+11},
{'c':'pPhnBg7','i': (40*15)+12},
{'c':'pPhnBg7','i': (40*15)+13},
{'c':'pPhnBg7','i': (40*15)+14},
{'c':'pPhnBg7','i': (40*15)+15},
{'c':'pPhnBg7','i': (40*15)+16},
{'c':'pPhnBg7','i': (40*15)+17},
{'c':'pPhnBg7','i': (40*15)+18},
{'c':'pPhnBg1','i': (40*15)+19},
{'c':'pPhnBg3','i': (40*15)+20},
{'c':'pPhnBg0','i': (40*16)+0},
{'c':'pPhnBg1','i': (40*16)+1},
{'c':'pPhnBg7','i': (40*16)+2},
{'c':'pPhnBg7','i': (40*16)+3},
{'c':'pPhnBg7','i': (40*16)+4},
{'c':'pPhnBg7','i': (40*16)+5},
{'c':'pPhnBg7','i': (40*16)+6},
{'c':'pPhnBg7','i': (40*16)+7},
{'c':'pPhnBg7','i': (40*16)+8},
{'c':'pPhnBg7','i': (40*16)+9},
{'c':'pPhnBg7','i': (40*16)+10},
{'c':'pPhnBg7','i': (40*16)+11},
{'c':'pPhnBg7','i': (40*16)+12},
{'c':'pPhnBg7','i': (40*16)+13},
{'c':'pPhnBg7','i': (40*16)+14},
{'c':'pPhnBg7','i': (40*16)+15},
{'c':'pPhnBg7','i': (40*16)+16},
{'c':'pPhnBg7','i': (40*16)+17},
{'c':'pPhnBg7','i': (40*16)+18},
{'c':'pPhnBg1','i': (40*16)+19},
{'c':'pPhnBg3','i': (40*16)+20},
{'c':'pPhnBg0','i': (40*17)+0},
{'c':'pPhnBg1','i': (40*17)+1},
{'c':'pPhnBg7','i': (40*17)+2},
{'c':'pPhnBg7','i': (40*17)+3},
{'c':'pPhnBg7','i': (40*17)+4},
{'c':'pPhnBg7','i': (40*17)+5},
{'c':'pPhnBg7','i': (40*17)+6},
{'c':'pPhnBg7','i': (40*17)+7},
{'c':'pPhnBg7','i': (40*17)+8},
{'c':'pPhnBg7','i': (40*17)+9},
{'c':'pPhnBg7','i': (40*17)+10},
{'c':'pPhnBg7','i': (40*17)+11},
{'c':'pPhnBg7','i': (40*17)+12},
{'c':'pPhnBg7','i': (40*17)+13},
{'c':'pPhnBg7','i': (40*17)+14},
{'c':'pPhnBg7','i': (40*17)+15},
{'c':'pPhnBg7','i': (40*17)+16},
{'c':'pPhnBg7','i': (40*17)+17},
{'c':'pPhnBg7','i': (40*17)+18},
{'c':'pPhnBg1','i': (40*17)+19},
{'c':'pPhnBg3','i': (40*17)+20},
{'c':'pPhnBg0','i': (40*18)+0},
{'c':'pPhnBg1','i': (40*18)+1},
{'c':'pPhnBg7','i': (40*18)+2},
{'c':'pPhnBg7','i': (40*18)+3},
{'c':'pPhnBg7','i': (40*18)+4},
{'c':'pPhnBg7','i': (40*18)+5},
{'c':'pPhnBg7','i': (40*18)+6},
{'c':'pPhnBg7','i': (40*18)+7},
{'c':'pPhnBg7','i': (40*18)+8},
{'c':'pPhnBg7','i': (40*18)+9},
{'c':'pPhnBg7','i': (40*18)+10},
{'c':'pPhnBg7','i': (40*18)+11},
{'c':'pPhnBg7','i': (40*18)+12},
{'c':'pPhnBg7','i': (40*18)+13},
{'c':'pPhnBg7','i': (40*18)+14},
{'c':'pPhnBg7','i': (40*18)+15},
{'c':'pPhnBg7','i': (40*18)+16},
{'c':'pPhnBg7','i': (40*18)+17},
{'c':'pPhnBg7','i': (40*18)+18},
{'c':'pPhnBg1','i': (40*18)+19},
{'c':'pPhnBg3','i': (40*18)+20},
{'c':'pPhnBg0','i': (40*19)+0},
{'c':'pPhnBg1','i': (40*19)+1},
{'c':'pPhnBg7','i': (40*19)+2},
{'c':'pPhnBg7','i': (40*19)+3},
{'c':'pPhnBg7','i': (40*19)+4},
{'c':'pPhnBg7','i': (40*19)+5},
{'c':'pPhnBg7','i': (40*19)+6},
{'c':'pPhnBg7','i': (40*19)+7},
{'c':'pPhnBg7','i': (40*19)+8},
{'c':'pPhnBg7','i': (40*19)+9},
{'c':'pPhnBg7','i': (40*19)+10},
{'c':'pPhnBg7','i': (40*19)+11},
{'c':'pPhnBg7','i': (40*19)+12},
{'c':'pPhnBg7','i': (40*19)+13},
{'c':'pPhnBg7','i': (40*19)+14},
{'c':'pPhnBg7','i': (40*19)+15},
{'c':'pPhnBg7','i': (40*19)+16},
{'c':'pPhnBg7','i': (40*19)+17},
{'c':'pPhnBg7','i': (40*19)+18},
{'c':'pPhnBg1','i': (40*19)+19},
{'c':'pPhnBg3','i': (40*19)+20},
{'c':'pPhnBg0','i': (40*20)+0},
{'c':'pPhnBg1','i': (40*20)+1},
{'c':'pPhnBg7','i': (40*20)+2},
{'c':'pPhnBg7','i': (40*20)+3},
{'c':'pPhnBg7','i': (40*20)+4},
{'c':'pPhnBg7','i': (40*20)+5},
{'c':'pPhnBg7','i': (40*20)+6},
{'c':'pPhnBg7','i': (40*20)+7},
{'c':'pPhnBg7','i': (40*20)+8},
{'c':'pPhnBg7','i': (40*20)+9},
{'c':'pPhnBg7','i': (40*20)+10},
{'c':'pPhnBg7','i': (40*20)+11},
{'c':'pPhnBg7','i': (40*20)+12},
{'c':'pPhnBg7','i': (40*20)+13},
{'c':'pPhnBg7','i': (40*20)+14},
{'c':'pPhnBg7','i': (40*20)+15},
{'c':'pPhnBg7','i': (40*20)+16},
{'c':'pPhnBg7','i': (40*20)+17},
{'c':'pPhnBg7','i': (40*20)+18},
{'c':'pPhnBg1','i': (40*20)+19},
{'c':'pPhnBg3','i': (40*20)+20},
{'c':'pPhnBg0','i': (40*21)+0},
{'c':'pPhnBg1','i': (40*21)+1},
{'c':'pPhnBg7','i': (40*21)+2},
{'c':'pPhnBg7','i': (40*21)+3},
{'c':'pPhnBg7','i': (40*21)+4},
{'c':'pPhnBg7','i': (40*21)+5},
{'c':'pPhnBg7','i': (40*21)+6},
{'c':'pPhnBg7','i': (40*21)+7},
{'c':'pPhnBg7','i': (40*21)+8},
{'c':'pPhnBg7','i': (40*21)+9},
{'c':'pPhnBg7','i': (40*21)+10},
{'c':'pPhnBg7','i': (40*21)+11},
{'c':'pPhnBg7','i': (40*21)+12},
{'c':'pPhnBg7','i': (40*21)+13},
{'c':'pPhnBg7','i': (40*21)+14},
{'c':'pPhnBg7','i': (40*21)+15},
{'c':'pPhnBg7','i': (40*21)+16},
{'c':'pPhnBg7','i': (40*21)+17},
{'c':'pPhnBg7','i': (40*21)+18},
{'c':'pPhnBg1','i': (40*21)+19},
{'c':'pPhnBg3','i': (40*21)+20},
{'c':'pPhnBg0','i': (40*22)+0},
{'c':'pPhnBg1','i': (40*22)+1},
{'c':'pPhnBg7','i': (40*22)+2},
{'c':'pPhnBg7','i': (40*22)+3},
{'c':'pPhnBg7','i': (40*22)+4},
{'c':'pPhnBg7','i': (40*22)+5},
{'c':'pPhnBg7','i': (40*22)+6},
{'c':'pPhnBg7','i': (40*22)+7},
{'c':'pPhnBg7','i': (40*22)+8},
{'c':'pPhnBg7','i': (40*22)+9},
{'c':'pPhnBg7','i': (40*22)+10},
{'c':'pPhnBg7','i': (40*22)+11},
{'c':'pPhnBg7','i': (40*22)+12},
{'c':'pPhnBg7','i': (40*22)+13},
{'c':'pPhnBg7','i': (40*22)+14},
{'c':'pPhnBg7','i': (40*22)+15},
{'c':'pPhnBg7','i': (40*22)+16},
{'c':'pPhnBg7','i': (40*22)+17},
{'c':'pPhnBg7','i': (40*22)+18},
{'c':'pPhnBg1','i': (40*22)+19},
{'c':'pPhnBg3','i': (40*22)+20},
{'c':'pPhnBg0','i': (40*23)+0},
{'c':'pPhnBg1','i': (40*23)+1},
{'c':'pPhnBg7','i': (40*23)+2},
{'c':'pPhnBg7','i': (40*23)+3},
{'c':'pPhnBg7','i': (40*23)+4},
{'c':'pPhnBg7','i': (40*23)+5},
{'c':'pPhnBg7','i': (40*23)+6},
{'c':'pPhnBg7','i': (40*23)+7},
{'c':'pPhnBg7','i': (40*23)+8},
{'c':'pPhnBg7','i': (40*23)+9},
{'c':'pPhnBg7','i': (40*23)+10},
{'c':'pPhnBg7','i': (40*23)+11},
{'c':'pPhnBg7','i': (40*23)+12},
{'c':'pPhnBg7','i': (40*23)+13},
{'c':'pPhnBg7','i': (40*23)+14},
{'c':'pPhnBg7','i': (40*23)+15},
{'c':'pPhnBg7','i': (40*23)+16},
{'c':'pPhnBg7','i': (40*23)+17},
{'c':'pPhnBg7','i': (40*23)+18},
{'c':'pPhnBg1','i': (40*23)+19},
{'c':'pPhnBg3','i': (40*23)+20},
{'c':'pPhnBg0','i': (40*24)+0},
{'c':'pPhnBg1','i': (40*24)+1},
{'c':'pPhnBg7','i': (40*24)+2},
{'c':'pPhnBg7','i': (40*24)+3},
{'c':'pPhnBg7','i': (40*24)+4},
{'c':'pPhnBg7','i': (40*24)+5},
{'c':'pPhnBg7','i': (40*24)+6},
{'c':'pPhnBg7','i': (40*24)+7},
{'c':'pPhnBg7','i': (40*24)+8},
{'c':'pPhnBg7','i': (40*24)+9},
{'c':'pPhnBg7','i': (40*24)+10},
{'c':'pPhnBg7','i': (40*24)+11},
{'c':'pPhnBg7','i': (40*24)+12},
{'c':'pPhnBg7','i': (40*24)+13},
{'c':'pPhnBg7','i': (40*24)+14},
{'c':'pPhnBg7','i': (40*24)+15},
{'c':'pPhnBg7','i': (40*24)+16},
{'c':'pPhnBg7','i': (40*24)+17},
{'c':'pPhnBg7','i': (40*24)+18},
{'c':'pPhnBg1','i': (40*24)+19},
{'c':'pPhnBg3','i': (40*24)+20},
{'c':'pPhnBg0','i': (40*25)+0},
{'c':'pPhnBg1','i': (40*25)+1},
{'c':'pPhnBg7','i': (40*25)+2},
{'c':'pPhnBg7','i': (40*25)+3},
{'c':'pPhnBg7','i': (40*25)+4},
{'c':'pPhnBg7','i': (40*25)+5},
{'c':'pPhnBg7','i': (40*25)+6},
{'c':'pPhnBg7','i': (40*25)+7},
{'c':'pPhnBg7','i': (40*25)+8},
{'c':'pPhnBg7','i': (40*25)+9},
{'c':'pPhnBg7','i': (40*25)+10},
{'c':'pPhnBg7','i': (40*25)+11},
{'c':'pPhnBg7','i': (40*25)+12},
{'c':'pPhnBg7','i': (40*25)+13},
{'c':'pPhnBg7','i': (40*25)+14},
{'c':'pPhnBg7','i': (40*25)+15},
{'c':'pPhnBg7','i': (40*25)+16},
{'c':'pPhnBg7','i': (40*25)+17},
{'c':'pPhnBg7','i': (40*25)+18},
{'c':'pPhnBg1','i': (40*25)+19},
{'c':'pPhnBg3','i': (40*25)+20},
{'c':'pPhnBg0','i': (40*26)+0},
{'c':'pPhnBg1','i': (40*26)+1},
{'c':'pPhnBg7','i': (40*26)+2},
{'c':'pPhnBg7','i': (40*26)+3},
{'c':'pPhnBg7','i': (40*26)+4},
{'c':'pPhnBg7','i': (40*26)+5},
{'c':'pPhnBg7','i': (40*26)+6},
{'c':'pPhnBg7','i': (40*26)+7},
{'c':'pPhnBg7','i': (40*26)+8},
{'c':'pPhnBg7','i': (40*26)+9},
{'c':'pPhnBg7','i': (40*26)+10},
{'c':'pPhnBg7','i': (40*26)+11},
{'c':'pPhnBg7','i': (40*26)+12},
{'c':'pPhnBg7','i': (40*26)+13},
{'c':'pPhnBg7','i': (40*26)+14},
{'c':'pPhnBg7','i': (40*26)+15},
{'c':'pPhnBg7','i': (40*26)+16},
{'c':'pPhnBg7','i': (40*26)+17},
{'c':'pPhnBg7','i': (40*26)+18},
{'c':'pPhnBg1','i': (40*26)+19},
{'c':'pPhnBg3','i': (40*26)+20},
{'c':'pPhnBg0','i': (40*27)+0},
{'c':'pPhnBg1','i': (40*27)+1},
{'c':'pPhnBg7','i': (40*27)+2},
{'c':'pPhnBg7','i': (40*27)+3},
{'c':'pPhnBg7','i': (40*27)+4},
{'c':'pPhnBg7','i': (40*27)+5},
{'c':'pPhnBg7','i': (40*27)+6},
{'c':'pPhnBg7','i': (40*27)+7},
{'c':'pPhnBg7','i': (40*27)+8},
{'c':'pPhnBg7','i': (40*27)+9},
{'c':'pPhnBg7','i': (40*27)+10},
{'c':'pPhnBg7','i': (40*27)+11},
{'c':'pPhnBg7','i': (40*27)+12},
{'c':'pPhnBg7','i': (40*27)+13},
{'c':'pPhnBg7','i': (40*27)+14},
{'c':'pPhnBg7','i': (40*27)+15},
{'c':'pPhnBg7','i': (40*27)+16},
{'c':'pPhnBg7','i': (40*27)+17},
{'c':'pPhnBg7','i': (40*27)+18},
{'c':'pPhnBg1','i': (40*27)+19},
{'c':'pPhnBg3','i': (40*27)+20},
{'c':'pPhnBg0','i': (40*28)+0},
{'c':'pPhnBg1','i': (40*28)+1},
{'c':'pPhnBg7','i': (40*28)+2},
{'c':'pPhnBg7','i': (40*28)+3},
{'c':'pPhnBg7','i': (40*28)+4},
{'c':'pPhnBg7','i': (40*28)+5},
{'c':'pPhnBg7','i': (40*28)+6},
{'c':'pPhnBg7','i': (40*28)+7},
{'c':'pPhnBg7','i': (40*28)+8},
{'c':'pPhnBg7','i': (40*28)+9},
{'c':'pPhnBg7','i': (40*28)+10},
{'c':'pPhnBg7','i': (40*28)+11},
{'c':'pPhnBg7','i': (40*28)+12},
{'c':'pPhnBg7','i': (40*28)+13},
{'c':'pPhnBg7','i': (40*28)+14},
{'c':'pPhnBg7','i': (40*28)+15},
{'c':'pPhnBg7','i': (40*28)+16},
{'c':'pPhnBg7','i': (40*28)+17},
{'c':'pPhnBg7','i': (40*28)+18},
{'c':'pPhnBg1','i': (40*28)+19},
{'c':'pPhnBg3','i': (40*28)+20},
{'c':'pPhnBg0','i': (40*29)+0},
{'c':'pPhnBg1','i': (40*29)+1},
{'c':'pPhnBg5','i': (40*29)+2},
{'c':'pPhnBg5','i': (40*29)+3},
{'c':'pPhnBg5','i': (40*29)+4},
{'c':'pPhnBg5','i': (40*29)+5},
{'c':'pPhnBg5','i': (40*29)+6},
{'c':'pPhnBg5','i': (40*29)+7},
{'c':'pPhnBg5','i': (40*29)+8},
{'c':'pPhnBg5','i': (40*29)+9},
{'c':'pPhnBg5','i': (40*29)+10},
{'c':'pPhnBg5','i': (40*29)+11},
{'c':'pPhnBg5','i': (40*29)+12},
{'c':'pPhnBg5','i': (40*29)+13},
{'c':'pPhnBg5','i': (40*29)+14},
{'c':'pPhnBg5','i': (40*29)+15},
{'c':'pPhnBg5','i': (40*29)+16},
{'c':'pPhnBg5','i': (40*29)+17},
{'c':'pPhnBg5','i': (40*29)+18},
{'c':'pPhnBg1','i': (40*29)+19},
{'c':'pPhnBg3','i': (40*29)+20},
{'c':'pPhnBg0','i': (40*30)+0},
{'c':'pPhnBg1','i': (40*30)+1},
{'c':'pPhnBg5','i': (40*30)+2},
{'c':'pPhnBg5','i': (40*30)+3},
{'c':'pPhnBg5','i': (40*30)+4},
{'c':'pPhnBg5','i': (40*30)+5},
{'c':'pPhnBg5','i': (40*30)+6},
{'c':'pPhnBg5','i': (40*30)+7},
{'c':'pPhnBg5','i': (40*30)+8},
{'c':'pPhnBg5','i': (40*30)+9},
{'c':'pPhnBg5','i': (40*30)+10},
{'c':'pPhnBg5','i': (40*30)+11},
{'c':'pPhnBg5','i': (40*30)+12},
{'c':'pPhnBg5','i': (40*30)+13},
{'c':'pPhnBg5','i': (40*30)+14},
{'c':'pPhnBg5','i': (40*30)+15},
{'c':'pPhnBg5','i': (40*30)+16},
{'c':'pPhnBg5','i': (40*30)+17},
{'c':'pPhnBg5','i': (40*30)+18},
{'c':'pPhnBg1','i': (40*30)+19},
{'c':'pPhnBg3','i': (40*30)+20},
{'c':'pPhnBg0','i': (40*31)+0},
{'c':'pPhnBg1','i': (40*31)+1},
{'c':'pPhnBg1','i': (40*31)+2},
{'c':'pPhnBg1','i': (40*31)+3},
{'c':'pPhnBg1','i': (40*31)+4},
{'c':'pPhnBg1','i': (40*31)+5},
{'c':'pPhnBg1','i': (40*31)+6},
{'c':'pPhnBg1','i': (40*31)+7},
{'c':'pPhnBg1','i': (40*31)+8},
{'c':'pPhnBg1','i': (40*31)+9},
{'c':'pPhnBg1','i': (40*31)+10},
{'c':'pPhnBg1','i': (40*31)+11},
{'c':'pPhnBg1','i': (40*31)+12},
{'c':'pPhnBg1','i': (40*31)+13},
{'c':'pPhnBg1','i': (40*31)+14},
{'c':'pPhnBg1','i': (40*31)+15},
{'c':'pPhnBg1','i': (40*31)+16},
{'c':'pPhnBg1','i': (40*31)+17},
{'c':'pPhnBg1','i': (40*31)+18},
{'c':'pPhnBg1','i': (40*31)+19},
{'c':'pPhnBg3','i': (40*31)+20},
{'c':'pPhnBg0','i': (40*32)+0},
{'c':'pPhnBg1','i': (40*32)+1},
{'c':'pPhnBg1','i': (40*32)+2},
{'c':'pPhnBg1','i': (40*32)+3},
{'c':'pPhnBg1','i': (40*32)+4},
{'c':'pPhnBg1','i': (40*32)+5},
{'c':'pPhnBg1','i': (40*32)+6},
{'c':'pPhnBg1','i': (40*32)+7},
{'c':'pPhnBg1','i': (40*32)+8},
{'c':'pPhnBg1','i': (40*32)+9},
{'c':'pPhnBg1','i': (40*32)+10},
{'c':'pPhnBg1','i': (40*32)+11},
{'c':'pPhnBg1','i': (40*32)+12},
{'c':'pPhnBg1','i': (40*32)+13},
{'c':'pPhnBg1','i': (40*32)+14},
{'c':'pPhnBg1','i': (40*32)+15},
{'c':'pPhnBg1','i': (40*32)+16},
{'c':'pPhnBg1','i': (40*32)+17},
{'c':'pPhnBg1','i': (40*32)+18},
{'c':'pPhnBg1','i': (40*32)+19},
{'c':'pPhnBg3','i': (40*32)+20},
{'c':'pPhnBg0','i': (40*33)+0},
{'c':'pPhnBg1','i': (40*33)+1},
{'c':'pPhnBg1','i': (40*33)+2},
{'c':'pPhnBg1','i': (40*33)+3},
{'c':'pPhnBg1','i': (40*33)+4},
{'c':'pPhnBg1','i': (40*33)+5},
{'c':'pPhnBg1','i': (40*33)+6},
{'c':'pPhnBg1','i': (40*33)+7},
{'c':'pPhnBg1','i': (40*33)+8},
{'c':'pPhnBg1','i': (40*33)+9},
{'c':'pPhnBg4','i': (40*33)+10},
{'c':'pPhnBg1','i': (40*33)+11},
{'c':'pPhnBg1','i': (40*33)+12},
{'c':'pPhnBg1','i': (40*33)+13},
{'c':'pPhnBg1','i': (40*33)+14},
{'c':'pPhnBg1','i': (40*33)+15},
{'c':'pPhnBg1','i': (40*33)+16},
{'c':'pPhnBg1','i': (40*33)+17},
{'c':'pPhnBg1','i': (40*33)+18},
{'c':'pPhnBg1','i': (40*33)+19},
{'c':'pPhnBg3','i': (40*33)+20},
{'c':'pPhnBg0','i': (40*34)+0},
{'c':'pPhnBg1','i': (40*34)+1},
{'c':'pPhnBg1','i': (40*34)+2},
{'c':'pPhnBg1','i': (40*34)+3},
{'c':'pPhnBg1','i': (40*34)+4},
{'c':'pPhnBg1','i': (40*34)+5},
{'c':'pPhnBg1','i': (40*34)+6},
{'c':'pPhnBg1','i': (40*34)+7},
{'c':'pPhnBg1','i': (40*34)+8},
{'c':'pPhnBg3','i': (40*34)+9},
{'c':'pPhnBg3','i': (40*34)+10},
{'c':'pPhnBg3','i': (40*34)+11},
{'c':'pPhnBg1','i': (40*34)+12},
{'c':'pPhnBg1','i': (40*34)+13},
{'c':'pPhnBg1','i': (40*34)+14},
{'c':'pPhnBg1','i': (40*34)+15},
{'c':'pPhnBg1','i': (40*34)+16},
{'c':'pPhnBg1','i': (40*34)+17},
{'c':'pPhnBg1','i': (40*34)+18},
{'c':'pPhnBg1','i': (40*34)+19},
{'c':'pPhnBg3','i': (40*34)+20},
{'c':'pPhnBg2','i': (40*35)+1},
{'c':'pPhnBg1','i': (40*35)+2},
{'c':'pPhnBg1','i': (40*35)+3},
{'c':'pPhnBg1','i': (40*35)+4},
{'c':'pPhnBg1','i': (40*35)+5},
{'c':'pPhnBg1','i': (40*35)+6},
{'c':'pPhnBg1','i': (40*35)+7},
{'c':'pPhnBg1','i': (40*35)+8},
{'c':'pPhnBg1','i': (40*35)+9},
{'c':'pPhnBg1','i': (40*35)+10},
{'c':'pPhnBg1','i': (40*35)+11},
{'c':'pPhnBg1','i': (40*35)+12},
{'c':'pPhnBg1','i': (40*35)+13},
{'c':'pPhnBg1','i': (40*35)+14},
{'c':'pPhnBg1','i': (40*35)+15},
{'c':'pPhnBg1','i': (40*35)+16},
{'c':'pPhnBg1','i': (40*35)+17},
{'c':'pPhnBg1','i': (40*35)+18},
{'c':'pPhnBg3','i': (40*35)+19},
{'c':'pPhnBg3','i': (40*36)+2},
{'c':'pPhnBg3','i': (40*36)+3},
{'c':'pPhnBg3','i': (40*36)+4},
{'c':'pPhnBg3','i': (40*36)+5},
{'c':'pPhnBg3','i': (40*36)+6},
{'c':'pPhnBg3','i': (40*36)+7},
{'c':'pPhnBg3','i': (40*36)+8},
{'c':'pPhnBg3','i': (40*36)+9},
{'c':'pPhnBg3','i': (40*36)+10},
{'c':'pPhnBg3','i': (40*36)+11},
{'c':'pPhnBg3','i': (40*36)+12},
{'c':'pPhnBg3','i': (40*36)+13},
{'c':'pPhnBg3','i': (40*36)+14},
{'c':'pPhnBg3','i': (40*36)+15},
{'c':'pPhnBg3','i': (40*36)+16},
{'c':'pPhnBg3','i': (40*36)+17},
{'c':'pPhnBg3','i': (40*36)+18}
],
'label' : '1'
}
}
],
pTxtLogo : [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'pTxtLogo0','i': (40*0)+0},
{'c':'pTxtLogo0','i': (40*0)+1},
{'c':'pTxtLogo0','i': (40*0)+2},
{'c':'pTxtLogo0','i': (40*0)+3},
{'c':'pTxtLogo0','i': (40*0)+4},
{'c':'pTxtLogo0','i': (40*0)+5},
{'c':'pTxtLogo0','i': (40*0)+6},
{'c':'pTxtLogo0','i': (40*0)+7},
{'c':'pTxtLogo0','i': (40*0)+8},
{'c':'pTxtLogo0','i': (40*0)+9},
{'c':'pTxtLogo0','i': (40*0)+10},
{'c':'pTxtLogo0','i': (40*0)+11},
{'c':'pTxtLogo0','i': (40*0)+12},
{'c':'pTxtLogo0','i': (40*0)+13},
{'c':'pTxtLogo0','i': (40*0)+14},
{'c':'pTxtLogo0','i': (40*0)+15},
{'c':'pTxtLogo0','i': (40*0)+16},
{'c':'pTxtLogo0','i': (40*1)+0},
{'c':'pTxtLogo1','i': (40*1)+1},
{'c':'pTxtLogo1','i': (40*1)+2},
{'c':'pTxtLogo1','i': (40*1)+3},
{'c':'pTxtLogo1','i': (40*1)+4},
{'c':'pTxtLogo1','i': (40*1)+5},
{'c':'pTxtLogo1','i': (40*1)+6},
{'c':'pTxtLogo1','i': (40*1)+7},
{'c':'pTxtLogo1','i': (40*1)+8},
{'c':'pTxtLogo1','i': (40*1)+9},
{'c':'pTxtLogo1','i': (40*1)+10},
{'c':'pTxtLogo1','i': (40*1)+11},
{'c':'pTxtLogo1','i': (40*1)+12},
{'c':'pTxtLogo1','i': (40*1)+13},
{'c':'pTxtLogo1','i': (40*1)+14},
{'c':'pTxtLogo1','i': (40*1)+15},
{'c':'pTxtLogo0','i': (40*1)+16},
{'c':'pTxtLogo0','i': (40*2)+0},
{'c':'pTxtLogo1','i': (40*2)+1},
{'c':'pTxtLogo0','i': (40*2)+2},
{'c':'pTxtLogo1','i': (40*2)+3},
{'c':'pTxtLogo0','i': (40*2)+4},
{'c':'pTxtLogo0','i': (40*2)+5},
{'c':'pTxtLogo0','i': (40*2)+6},
{'c':'pTxtLogo1','i': (40*2)+7},
{'c':'pTxtLogo0','i': (40*2)+8},
{'c':'pTxtLogo0','i': (40*2)+9},
{'c':'pTxtLogo0','i': (40*2)+10},
{'c':'pTxtLogo1','i': (40*2)+11},
{'c':'pTxtLogo0','i': (40*2)+12},
{'c':'pTxtLogo1','i': (40*2)+13},
{'c':'pTxtLogo0','i': (40*2)+14},
{'c':'pTxtLogo1','i': (40*2)+15},
{'c':'pTxtLogo0','i': (40*2)+16},
{'c':'pTxtLogo0','i': (40*3)+0},
{'c':'pTxtLogo1','i': (40*3)+1},
{'c':'pTxtLogo0','i': (40*3)+2},
{'c':'pTxtLogo1','i': (40*3)+3},
{'c':'pTxtLogo1','i': (40*3)+4},
{'c':'pTxtLogo0','i': (40*3)+5},
{'c':'pTxtLogo1','i': (40*3)+6},
{'c':'pTxtLogo1','i': (40*3)+7},
{'c':'pTxtLogo1','i': (40*3)+8},
{'c':'pTxtLogo0','i': (40*3)+9},
{'c':'pTxtLogo1','i': (40*3)+10},
{'c':'pTxtLogo1','i': (40*3)+11},
{'c':'pTxtLogo0','i': (40*3)+12},
{'c':'pTxtLogo1','i': (40*3)+13},
{'c':'pTxtLogo0','i': (40*3)+14},
{'c':'pTxtLogo1','i': (40*3)+15},
{'c':'pTxtLogo0','i': (40*3)+16},
{'c':'pTxtLogo2','i': (40*4)+0},
{'c':'pTxtLogo1','i': (40*4)+1},
{'c':'pTxtLogo2','i': (40*4)+2},
{'c':'pTxtLogo1','i': (40*4)+3},
{'c':'pTxtLogo1','i': (40*4)+4},
{'c':'pTxtLogo2','i': (40*4)+5},
{'c':'pTxtLogo1','i': (40*4)+6},
{'c':'pTxtLogo1','i': (40*4)+7},
{'c':'pTxtLogo1','i': (40*4)+8},
{'c':'pTxtLogo2','i': (40*4)+9},
{'c':'pTxtLogo1','i': (40*4)+10},
{'c':'pTxtLogo1','i': (40*4)+11},
{'c':'pTxtLogo1','i': (40*4)+12},
{'c':'pTxtLogo2','i': (40*4)+13},
{'c':'pTxtLogo1','i': (40*4)+14},
{'c':'pTxtLogo1','i': (40*4)+15},
{'c':'pTxtLogo2','i': (40*4)+16},
{'c':'pTxtLogo2','i': (40*5)+0},
{'c':'pTxtLogo1','i': (40*5)+1},
{'c':'pTxtLogo2','i': (40*5)+2},
{'c':'pTxtLogo1','i': (40*5)+3},
{'c':'pTxtLogo1','i': (40*5)+4},
{'c':'pTxtLogo2','i': (40*5)+5},
{'c':'pTxtLogo1','i': (40*5)+6},
{'c':'pTxtLogo1','i': (40*5)+7},
{'c':'pTxtLogo1','i': (40*5)+8},
{'c':'pTxtLogo2','i': (40*5)+9},
{'c':'pTxtLogo1','i': (40*5)+10},
{'c':'pTxtLogo1','i': (40*5)+11},
{'c':'pTxtLogo1','i': (40*5)+12},
{'c':'pTxtLogo2','i': (40*5)+13},
{'c':'pTxtLogo1','i': (40*5)+14},
{'c':'pTxtLogo1','i': (40*5)+15},
{'c':'pTxtLogo2','i': (40*5)+16},
{'c':'pTxtLogo2','i': (40*6)+0},
{'c':'pTxtLogo1','i': (40*6)+1},
{'c':'pTxtLogo1','i': (40*6)+2},
{'c':'pTxtLogo1','i': (40*6)+3},
{'c':'pTxtLogo1','i': (40*6)+4},
{'c':'pTxtLogo1','i': (40*6)+5},
{'c':'pTxtLogo1','i': (40*6)+6},
{'c':'pTxtLogo1','i': (40*6)+7},
{'c':'pTxtLogo1','i': (40*6)+8},
{'c':'pTxtLogo1','i': (40*6)+9},
{'c':'pTxtLogo1','i': (40*6)+10},
{'c':'pTxtLogo1','i': (40*6)+11},
{'c':'pTxtLogo1','i': (40*6)+12},
{'c':'pTxtLogo1','i': (40*6)+13},
{'c':'pTxtLogo1','i': (40*6)+14},
{'c':'pTxtLogo1','i': (40*6)+15},
{'c':'pTxtLogo2','i': (40*6)+16},
{'c':'pTxtLogo2','i': (40*7)+0},
{'c':'pTxtLogo2','i': (40*7)+1},
{'c':'pTxtLogo2','i': (40*7)+2},
{'c':'pTxtLogo2','i': (40*7)+3},
{'c':'pTxtLogo2','i': (40*7)+4},
{'c':'pTxtLogo2','i': (40*7)+5},
{'c':'pTxtLogo2','i': (40*7)+6},
{'c':'pTxtLogo2','i': (40*7)+7},
{'c':'pTxtLogo2','i': (40*7)+8},
{'c':'pTxtLogo2','i': (40*7)+9},
{'c':'pTxtLogo2','i': (40*7)+10},
{'c':'pTxtLogo2','i': (40*7)+11},
{'c':'pTxtLogo2','i': (40*7)+12},
{'c':'pTxtLogo2','i': (40*7)+13},
{'c':'pTxtLogo2','i': (40*7)+14},
{'c':'pTxtLogo2','i': (40*7)+15},
{'c':'pTxtLogo2','i': (40*7)+16},
{'c':'pTxtLogo2','i': (40*8)+12},
{'c':'pTxtLogo2','i': (40*8)+13},
{'c':'pTxtLogo2','i': (40*8)+14},
{'c':'pTxtLogo0','i': (40*8)+15},
{'c':'pTxtLogo0','i': (40*8)+16},
{'c':'pTxtLogo0','i': (40*8)+17},
{'c':'pTxtLogo0','i': (40*8)+18},
{'c':'pTxtLogo0','i': (40*8)+19},
{'c':'pTxtLogo0','i': (40*8)+20},
{'c':'pTxtLogo0','i': (40*8)+21},
{'c':'pTxtLogo0','i': (40*8)+22},
{'c':'pTxtLogo0','i': (40*8)+23},
{'c':'pTxtLogo0','i': (40*8)+24},
{'c':'pTxtLogo0','i': (40*8)+25},
{'c':'pTxtLogo0','i': (40*8)+26},
{'c':'pTxtLogo0','i': (40*8)+27},
{'c':'pTxtLogo0','i': (40*8)+28},
{'c':'pTxtLogo0','i': (40*8)+29},
{'c':'pTxtLogo0','i': (40*8)+30},
{'c':'pTxtLogo0','i': (40*8)+31},
{'c':'pTxtLogo0','i': (40*8)+32},
{'c':'pTxtLogo0','i': (40*8)+33},
{'c':'pTxtLogo0','i': (40*8)+34},
{'c':'pTxtLogo0','i': (40*8)+35},
{'c':'pTxtLogo2','i': (40*9)+14},
{'c':'pTxtLogo0','i': (40*9)+15},
{'c':'pTxtLogo1','i': (40*9)+16},
{'c':'pTxtLogo1','i': (40*9)+17},
{'c':'pTxtLogo1','i': (40*9)+18},
{'c':'pTxtLogo1','i': (40*9)+19},
{'c':'pTxtLogo1','i': (40*9)+20},
{'c':'pTxtLogo1','i': (40*9)+21},
{'c':'pTxtLogo1','i': (40*9)+22},
{'c':'pTxtLogo1','i': (40*9)+23},
{'c':'pTxtLogo1','i': (40*9)+24},
{'c':'pTxtLogo1','i': (40*9)+25},
{'c':'pTxtLogo1','i': (40*9)+26},
{'c':'pTxtLogo1','i': (40*9)+27},
{'c':'pTxtLogo1','i': (40*9)+28},
{'c':'pTxtLogo1','i': (40*9)+29},
{'c':'pTxtLogo1','i': (40*9)+30},
{'c':'pTxtLogo1','i': (40*9)+31},
{'c':'pTxtLogo1','i': (40*9)+32},
{'c':'pTxtLogo1','i': (40*9)+33},
{'c':'pTxtLogo1','i': (40*9)+34},
{'c':'pTxtLogo0','i': (40*9)+35},
{'c':'pTxtLogo0','i': (40*10)+15},
{'c':'pTxtLogo1','i': (40*10)+16},
{'c':'pTxtLogo0','i': (40*10)+17},
{'c':'pTxtLogo1','i': (40*10)+18},
{'c':'pTxtLogo1','i': (40*10)+19},
{'c':'pTxtLogo1','i': (40*10)+20},
{'c':'pTxtLogo0','i': (40*10)+21},
{'c':'pTxtLogo1','i': (40*10)+22},
{'c':'pTxtLogo0','i': (40*10)+23},
{'c':'pTxtLogo0','i': (40*10)+24},
{'c':'pTxtLogo0','i': (40*10)+25},
{'c':'pTxtLogo1','i': (40*10)+26},
{'c':'pTxtLogo0','i': (40*10)+27},
{'c':'pTxtLogo0','i': (40*10)+28},
{'c':'pTxtLogo0','i': (40*10)+29},
{'c':'pTxtLogo1','i': (40*10)+30},
{'c':'pTxtLogo0','i': (40*10)+31},
{'c':'pTxtLogo1','i': (40*10)+32},
{'c':'pTxtLogo0','i': (40*10)+33},
{'c':'pTxtLogo1','i': (40*10)+34},
{'c':'pTxtLogo0','i': (40*10)+35},
{'c':'pTxtLogo0','i': (40*11)+15},
{'c':'pTxtLogo1','i': (40*11)+16},
{'c':'pTxtLogo0','i': (40*11)+17},
{'c':'pTxtLogo0','i': (40*11)+18},
{'c':'pTxtLogo0','i': (40*11)+19},
{'c':'pTxtLogo1','i': (40*11)+20},
{'c':'pTxtLogo0','i': (40*11)+21},
{'c':'pTxtLogo1','i': (40*11)+22},
{'c':'pTxtLogo1','i': (40*11)+23},
{'c':'pTxtLogo0','i': (40*11)+24},
{'c':'pTxtLogo1','i': (40*11)+25},
{'c':'pTxtLogo1','i': (40*11)+26},
{'c':'pTxtLogo1','i': (40*11)+27},
{'c':'pTxtLogo0','i': (40*11)+28},
{'c':'pTxtLogo1','i': (40*11)+29},
{'c':'pTxtLogo1','i': (40*11)+30},
{'c':'pTxtLogo0','i': (40*11)+31},
{'c':'pTxtLogo1','i': (40*11)+32},
{'c':'pTxtLogo0','i': (40*11)+33},
{'c':'pTxtLogo1','i': (40*11)+34},
{'c':'pTxtLogo0','i': (40*11)+35},
{'c':'pTxtLogo2','i': (40*12)+15},
{'c':'pTxtLogo1','i': (40*12)+16},
{'c':'pTxtLogo2','i': (40*12)+17},
{'c':'pTxtLogo1','i': (40*12)+18},
{'c':'pTxtLogo2','i': (40*12)+19},
{'c':'pTxtLogo1','i': (40*12)+20},
{'c':'pTxtLogo2','i': (40*12)+21},
{'c':'pTxtLogo1','i': (40*12)+22},
{'c':'pTxtLogo1','i': (40*12)+23},
{'c':'pTxtLogo2','i': (40*12)+24},
{'c':'pTxtLogo1','i': (40*12)+25},
{'c':'pTxtLogo1','i': (40*12)+26},
{'c':'pTxtLogo1','i': (40*12)+27},
{'c':'pTxtLogo2','i': (40*12)+28},
{'c':'pTxtLogo1','i': (40*12)+29},
{'c':'pTxtLogo1','i': (40*12)+30},
{'c':'pTxtLogo1','i': (40*12)+31},
{'c':'pTxtLogo2','i': (40*12)+32},
{'c':'pTxtLogo1','i': (40*12)+33},
{'c':'pTxtLogo1','i': (40*12)+34},
{'c':'pTxtLogo2','i': (40*12)+35},
{'c':'pTxtLogo2','i': (40*13)+15},
{'c':'pTxtLogo1','i': (40*13)+16},
{'c':'pTxtLogo2','i': (40*13)+17},
{'c':'pTxtLogo2','i': (40*13)+18},
{'c':'pTxtLogo2','i': (40*13)+19},
{'c':'pTxtLogo1','i': (40*13)+20},
{'c':'pTxtLogo2','i': (40*13)+21},
{'c':'pTxtLogo1','i': (40*13)+22},
{'c':'pTxtLogo1','i': (40*13)+23},
{'c':'pTxtLogo2','i': (40*13)+24},
{'c':'pTxtLogo1','i': (40*13)+25},
{'c':'pTxtLogo1','i': (40*13)+26},
{'c':'pTxtLogo1','i': (40*13)+27},
{'c':'pTxtLogo2','i': (40*13)+28},
{'c':'pTxtLogo1','i': (40*13)+29},
{'c':'pTxtLogo1','i': (40*13)+30},
{'c':'pTxtLogo1','i': (40*13)+31},
{'c':'pTxtLogo2','i': (40*13)+32},
{'c':'pTxtLogo1','i': (40*13)+33},
{'c':'pTxtLogo1','i': (40*13)+34},
{'c':'pTxtLogo2','i': (40*13)+35},
{'c':'pTxtLogo2','i': (40*14)+15},
{'c':'pTxtLogo1','i': (40*14)+16},
{'c':'pTxtLogo1','i': (40*14)+17},
{'c':'pTxtLogo1','i': (40*14)+18},
{'c':'pTxtLogo1','i': (40*14)+19},
{'c':'pTxtLogo1','i': (40*14)+20},
{'c':'pTxtLogo1','i': (40*14)+21},
{'c':'pTxtLogo1','i': (40*14)+22},
{'c':'pTxtLogo1','i': (40*14)+23},
{'c':'pTxtLogo1','i': (40*14)+24},
{'c':'pTxtLogo1','i': (40*14)+25},
{'c':'pTxtLogo1','i': (40*14)+26},
{'c':'pTxtLogo1','i': (40*14)+27},
{'c':'pTxtLogo1','i': (40*14)+28},
{'c':'pTxtLogo1','i': (40*14)+29},
{'c':'pTxtLogo1','i': (40*14)+30},
{'c':'pTxtLogo1','i': (40*14)+31},
{'c':'pTxtLogo1','i': (40*14)+32},
{'c':'pTxtLogo1','i': (40*14)+33},
{'c':'pTxtLogo1','i': (40*14)+34},
{'c':'pTxtLogo2','i': (40*14)+35},
{'c':'pTxtLogo2','i': (40*15)+15},
{'c':'pTxtLogo2','i': (40*15)+16},
{'c':'pTxtLogo2','i': (40*15)+17},
{'c':'pTxtLogo2','i': (40*15)+18},
{'c':'pTxtLogo2','i': (40*15)+19},
{'c':'pTxtLogo2','i': (40*15)+20},
{'c':'pTxtLogo2','i': (40*15)+21},
{'c':'pTxtLogo2','i': (40*15)+22},
{'c':'pTxtLogo2','i': (40*15)+23},
{'c':'pTxtLogo2','i': (40*15)+24},
{'c':'pTxtLogo2','i': (40*15)+25},
{'c':'pTxtLogo2','i': (40*15)+26},
{'c':'pTxtLogo2','i': (40*15)+27},
{'c':'pTxtLogo2','i': (40*15)+28},
{'c':'pTxtLogo2','i': (40*15)+29},
{'c':'pTxtLogo2','i': (40*15)+30},
{'c':'pTxtLogo2','i': (40*15)+31},
{'c':'pTxtLogo2','i': (40*15)+32},
{'c':'pTxtLogo2','i': (40*15)+33},
{'c':'pTxtLogo2','i': (40*15)+34},
{'c':'pTxtLogo2','i': (40*15)+35},
{'c':'pTxtLogo0','i': (40*16)+2},
{'c':'pTxtLogo0','i': (40*16)+3},
{'c':'pTxtLogo0','i': (40*16)+4},
{'c':'pTxtLogo0','i': (40*16)+5},
{'c':'pTxtLogo0','i': (40*16)+6},
{'c':'pTxtLogo0','i': (40*16)+7},
{'c':'pTxtLogo0','i': (40*16)+8},
{'c':'pTxtLogo0','i': (40*16)+9},
{'c':'pTxtLogo0','i': (40*16)+10},
{'c':'pTxtLogo0','i': (40*16)+11},
{'c':'pTxtLogo0','i': (40*16)+12},
{'c':'pTxtLogo0','i': (40*16)+13},
{'c':'pTxtLogo0','i': (40*16)+14},
{'c':'pTxtLogo0','i': (40*16)+15},
{'c':'pTxtLogo0','i': (40*16)+16},
{'c':'pTxtLogo0','i': (40*16)+17},
{'c':'pTxtLogo0','i': (40*16)+18},
{'c':'pTxtLogo2','i': (40*16)+19},
{'c':'pTxtLogo2','i': (40*16)+20},
{'c':'pTxtLogo2','i': (40*16)+21},
{'c':'pTxtLogo0','i': (40*17)+2},
{'c':'pTxtLogo1','i': (40*17)+3},
{'c':'pTxtLogo1','i': (40*17)+4},
{'c':'pTxtLogo1','i': (40*17)+5},
{'c':'pTxtLogo1','i': (40*17)+6},
{'c':'pTxtLogo1','i': (40*17)+7},
{'c':'pTxtLogo1','i': (40*17)+8},
{'c':'pTxtLogo1','i': (40*17)+9},
{'c':'pTxtLogo1','i': (40*17)+10},
{'c':'pTxtLogo1','i': (40*17)+11},
{'c':'pTxtLogo1','i': (40*17)+12},
{'c':'pTxtLogo1','i': (40*17)+13},
{'c':'pTxtLogo1','i': (40*17)+14},
{'c':'pTxtLogo1','i': (40*17)+15},
{'c':'pTxtLogo1','i': (40*17)+16},
{'c':'pTxtLogo1','i': (40*17)+17},
{'c':'pTxtLogo0','i': (40*17)+18},
{'c':'pTxtLogo2','i': (40*17)+19},
{'c':'pTxtLogo0','i': (40*18)+2},
{'c':'pTxtLogo1','i': (40*18)+3},
{'c':'pTxtLogo0','i': (40*18)+4},
{'c':'pTxtLogo0','i': (40*18)+5},
{'c':'pTxtLogo0','i': (40*18)+6},
{'c':'pTxtLogo1','i': (40*18)+7},
{'c':'pTxtLogo0','i': (40*18)+8},
{'c':'pTxtLogo1','i': (40*18)+9},
{'c':'pTxtLogo1','i': (40*18)+10},
{'c':'pTxtLogo1','i': (40*18)+11},
{'c':'pTxtLogo0','i': (40*18)+12},
{'c':'pTxtLogo1','i': (40*18)+13},
{'c':'pTxtLogo0','i': (40*18)+14},
{'c':'pTxtLogo0','i': (40*18)+15},
{'c':'pTxtLogo0','i': (40*18)+16},
{'c':'pTxtLogo1','i': (40*18)+17},
{'c':'pTxtLogo0','i': (40*18)+18},
{'c':'pTxtLogo0','i': (40*19)+2},
{'c':'pTxtLogo1','i': (40*19)+3},
{'c':'pTxtLogo0','i': (40*19)+4},
{'c':'pTxtLogo1','i': (40*19)+5},
{'c':'pTxtLogo0','i': (40*19)+6},
{'c':'pTxtLogo1','i': (40*19)+7},
{'c':'pTxtLogo0','i': (40*19)+8},
{'c':'pTxtLogo0','i': (40*19)+9},
{'c':'pTxtLogo0','i': (40*19)+10},
{'c':'pTxtLogo1','i': (40*19)+11},
{'c':'pTxtLogo0','i': (40*19)+12},
{'c':'pTxtLogo1','i': (40*19)+13},
{'c':'pTxtLogo1','i': (40*19)+14},
{'c':'pTxtLogo0','i': (40*19)+15},
{'c':'pTxtLogo1','i': (40*19)+16},
{'c':'pTxtLogo1','i': (40*19)+17},
{'c':'pTxtLogo0','i': (40*19)+18},
{'c':'pTxtLogo2','i': (40*20)+2},
{'c':'pTxtLogo1','i': (40*20)+3},
{'c':'pTxtLogo2','i': (40*20)+4},
{'c':'pTxtLogo2','i': (40*20)+5},
{'c':'pTxtLogo2','i': (40*20)+6},
{'c':'pTxtLogo1','i': (40*20)+7},
{'c':'pTxtLogo2','i': (40*20)+8},
{'c':'pTxtLogo1','i': (40*20)+9},
{'c':'pTxtLogo2','i': (40*20)+10},
{'c':'pTxtLogo1','i': (40*20)+11},
{'c':'pTxtLogo2','i': (40*20)+12},
{'c':'pTxtLogo1','i': (40*20)+13},
{'c':'pTxtLogo1','i': (40*20)+14},
{'c':'pTxtLogo2','i': (40*20)+15},
{'c':'pTxtLogo1','i': (40*20)+16},
{'c':'pTxtLogo1','i': (40*20)+17},
{'c':'pTxtLogo2','i': (40*20)+18},
{'c':'pTxtLogo2','i': (40*21)+2},
{'c':'pTxtLogo1','i': (40*21)+3},
{'c':'pTxtLogo2','i': (40*21)+4},
{'c':'pTxtLogo2','i': (40*21)+5},
{'c':'pTxtLogo2','i': (40*21)+6},
{'c':'pTxtLogo1','i': (40*21)+7},
{'c':'pTxtLogo2','i': (40*21)+8},
{'c':'pTxtLogo2','i': (40*21)+9},
{'c':'pTxtLogo2','i': (40*21)+10},
{'c':'pTxtLogo1','i': (40*21)+11},
{'c':'pTxtLogo2','i': (40*21)+12},
{'c':'pTxtLogo1','i': (40*21)+13},
{'c':'pTxtLogo1','i': (40*21)+14},
{'c':'pTxtLogo2','i': (40*21)+15},
{'c':'pTxtLogo1','i': (40*21)+16},
{'c':'pTxtLogo1','i': (40*21)+17},
{'c':'pTxtLogo2','i': (40*21)+18},
{'c':'pTxtLogo2','i': (40*22)+2},
{'c':'pTxtLogo1','i': (40*22)+3},
{'c':'pTxtLogo1','i': (40*22)+4},
{'c':'pTxtLogo1','i': (40*22)+5},
{'c':'pTxtLogo1','i': (40*22)+6},
{'c':'pTxtLogo1','i': (40*22)+7},
{'c':'pTxtLogo1','i': (40*22)+8},
{'c':'pTxtLogo1','i': (40*22)+9},
{'c':'pTxtLogo1','i': (40*22)+10},
{'c':'pTxtLogo1','i': (40*22)+11},
{'c':'pTxtLogo1','i': (40*22)+12},
{'c':'pTxtLogo1','i': (40*22)+13},
{'c':'pTxtLogo1','i': (40*22)+14},
{'c':'pTxtLogo1','i': (40*22)+15},
{'c':'pTxtLogo1','i': (40*22)+16},
{'c':'pTxtLogo1','i': (40*22)+17},
{'c':'pTxtLogo2','i': (40*22)+18},
{'c':'pTxtLogo2','i': (40*23)+2},
{'c':'pTxtLogo2','i': (40*23)+3},
{'c':'pTxtLogo2','i': (40*23)+4},
{'c':'pTxtLogo2','i': (40*23)+5},
{'c':'pTxtLogo2','i': (40*23)+6},
{'c':'pTxtLogo2','i': (40*23)+7},
{'c':'pTxtLogo2','i': (40*23)+8},
{'c':'pTxtLogo2','i': (40*23)+9},
{'c':'pTxtLogo2','i': (40*23)+10},
{'c':'pTxtLogo2','i': (40*23)+11},
{'c':'pTxtLogo2','i': (40*23)+12},
{'c':'pTxtLogo2','i': (40*23)+13},
{'c':'pTxtLogo2','i': (40*23)+14},
{'c':'pTxtLogo2','i': (40*23)+15},
{'c':'pTxtLogo2','i': (40*23)+16},
{'c':'pTxtLogo2','i': (40*23)+17},
{'c':'pTxtLogo2','i': (40*23)+18},
{'c':'pTxtLogo2','i': (40*24)+14},
{'c':'pTxtLogo2','i': (40*24)+15},
{'c':'pTxtLogo2','i': (40*24)+16},
{'c':'pTxtLogo2','i': (40*25)+16}
],
'label' : '1'
}
}
],
pTxtPanel1 : [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'pTxtPanel0','i': (40*0)+0},
{'c':'pTxtPanel0','i': (40*0)+1},
{'c':'pTxtPanel0','i': (40*0)+2},
{'c':'pTxtPanel0','i': (40*0)+3},
{'c':'pTxtPanel0','i': (40*0)+4},
{'c':'pTxtPanel0','i': (40*0)+5},
{'c':'pTxtPanel0','i': (40*0)+6},
{'c':'pTxtPanel0','i': (40*0)+7},
{'c':'pTxtPanel0','i': (40*0)+8},
{'c':'pTxtPanel0','i': (40*0)+9},
{'c':'pTxtPanel0','i': (40*0)+10},
{'c':'pTxtPanel0','i': (40*0)+11},
{'c':'pTxtPanel0','i': (40*0)+12},
{'c':'pTxtPanel0','i': (40*0)+13},
{'c':'pTxtPanel0','i': (40*0)+14},
{'c':'pTxtPanel0','i': (40*0)+15},
{'c':'pTxtPanel0','i': (40*0)+16},
{'c':'pTxtPanel0','i': (40*1)+0},
{'c':'pTxtPanel1','i': (40*1)+1},
{'c':'pTxtPanel1','i': (40*1)+2},
{'c':'pTxtPanel1','i': (40*1)+3},
{'c':'pTxtPanel1','i': (40*1)+4},
{'c':'pTxtPanel1','i': (40*1)+5},
{'c':'pTxtPanel1','i': (40*1)+6},
{'c':'pTxtPanel1','i': (40*1)+7},
{'c':'pTxtPanel1','i': (40*1)+8},
{'c':'pTxtPanel1','i': (40*1)+9},
{'c':'pTxtPanel1','i': (40*1)+10},
{'c':'pTxtPanel1','i': (40*1)+11},
{'c':'pTxtPanel1','i': (40*1)+12},
{'c':'pTxtPanel1','i': (40*1)+13},
{'c':'pTxtPanel1','i': (40*1)+14},
{'c':'pTxtPanel1','i': (40*1)+15},
{'c':'pTxtPanel0','i': (40*1)+16},
{'c':'pTxtPanel0','i': (40*2)+0},
{'c':'pTxtPanel1','i': (40*2)+1},
{'c':'pTxtPanel1','i': (40*2)+2},
{'c':'pTxtPanel1','i': (40*2)+3},
{'c':'pTxtPanel1','i': (40*2)+4},
{'c':'pTxtPanel1','i': (40*2)+5},
{'c':'pTxtPanel1','i': (40*2)+6},
{'c':'pTxtPanel1','i': (40*2)+7},
{'c':'pTxtPanel1','i': (40*2)+8},
{'c':'pTxtPanel1','i': (40*2)+9},
{'c':'pTxtPanel1','i': (40*2)+10},
{'c':'pTxtPanel1','i': (40*2)+11},
{'c':'pTxtPanel1','i': (40*2)+12},
{'c':'pTxtPanel1','i': (40*2)+13},
{'c':'pTxtPanel1','i': (40*2)+14},
{'c':'pTxtPanel1','i': (40*2)+15},
{'c':'pTxtPanel0','i': (40*2)+16},
{'c':'pTxtPanel2','i': (40*3)+0},
{'c':'pTxtPanel1','i': (40*3)+1},
{'c':'pTxtPanel1','i': (40*3)+2},
{'c':'pTxtPanel1','i': (40*3)+3},
{'c':'pTxtPanel1','i': (40*3)+4},
{'c':'pTxtPanel1','i': (40*3)+5},
{'c':'pTxtPanel1','i': (40*3)+6},
{'c':'pTxtPanel1','i': (40*3)+7},
{'c':'pTxtPanel1','i': (40*3)+8},
{'c':'pTxtPanel1','i': (40*3)+9},
{'c':'pTxtPanel1','i': (40*3)+10},
{'c':'pTxtPanel1','i': (40*3)+11},
{'c':'pTxtPanel1','i': (40*3)+12},
{'c':'pTxtPanel1','i': (40*3)+13},
{'c':'pTxtPanel1','i': (40*3)+14},
{'c':'pTxtPanel1','i': (40*3)+15},
{'c':'pTxtPanel2','i': (40*3)+16},
{'c':'pTxtPanel2','i': (40*4)+0},
{'c':'pTxtPanel1','i': (40*4)+1},
{'c':'pTxtPanel1','i': (40*4)+2},
{'c':'pTxtPanel1','i': (40*4)+3},
{'c':'pTxtPanel1','i': (40*4)+4},
{'c':'pTxtPanel1','i': (40*4)+5},
{'c':'pTxtPanel1','i': (40*4)+6},
{'c':'pTxtPanel1','i': (40*4)+7},
{'c':'pTxtPanel1','i': (40*4)+8},
{'c':'pTxtPanel1','i': (40*4)+9},
{'c':'pTxtPanel1','i': (40*4)+10},
{'c':'pTxtPanel1','i': (40*4)+11},
{'c':'pTxtPanel1','i': (40*4)+12},
{'c':'pTxtPanel1','i': (40*4)+13},
{'c':'pTxtPanel1','i': (40*4)+14},
{'c':'pTxtPanel1','i': (40*4)+15},
{'c':'pTxtPanel2','i': (40*4)+16},
{'c':'pTxtPanel2','i': (40*5)+0},
{'c':'pTxtPanel1','i': (40*5)+1},
{'c':'pTxtPanel1','i': (40*5)+2},
{'c':'pTxtPanel1','i': (40*5)+3},
{'c':'pTxtPanel1','i': (40*5)+4},
{'c':'pTxtPanel1','i': (40*5)+5},
{'c':'pTxtPanel1','i': (40*5)+6},
{'c':'pTxtPanel1','i': (40*5)+7},
{'c':'pTxtPanel1','i': (40*5)+8},
{'c':'pTxtPanel1','i': (40*5)+9},
{'c':'pTxtPanel1','i': (40*5)+10},
{'c':'pTxtPanel1','i': (40*5)+11},
{'c':'pTxtPanel1','i': (40*5)+12},
{'c':'pTxtPanel1','i': (40*5)+13},
{'c':'pTxtPanel1','i': (40*5)+14},
{'c':'pTxtPanel1','i': (40*5)+15},
{'c':'pTxtPanel2','i': (40*5)+16},
{'c':'pTxtPanel2','i': (40*6)+0},
{'c':'pTxtPanel2','i': (40*6)+1},
{'c':'pTxtPanel2','i': (40*6)+2},
{'c':'pTxtPanel2','i': (40*6)+3},
{'c':'pTxtPanel2','i': (40*6)+4},
{'c':'pTxtPanel2','i': (40*6)+5},
{'c':'pTxtPanel2','i': (40*6)+6},
{'c':'pTxtPanel2','i': (40*6)+7},
{'c':'pTxtPanel2','i': (40*6)+8},
{'c':'pTxtPanel2','i': (40*6)+9},
{'c':'pTxtPanel2','i': (40*6)+10},
{'c':'pTxtPanel2','i': (40*6)+11},
{'c':'pTxtPanel2','i': (40*6)+12},
{'c':'pTxtPanel2','i': (40*6)+13},
{'c':'pTxtPanel2','i': (40*6)+14},
{'c':'pTxtPanel2','i': (40*6)+15},
{'c':'pTxtPanel2','i': (40*6)+16},
{'c':'pTxtPanel2','i': (40*7)+2},
{'c':'pTxtPanel2','i': (40*7)+3},
{'c':'pTxtPanel2','i': (40*7)+4},
{'c':'pTxtPanel2','i': (40*8)+2}
],
'label' : '1'
}
}
],
pTxtPanel2 : [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'pTxtPanel0','i': (40*0)+0},
{'c':'pTxtPanel0','i': (40*0)+1},
{'c':'pTxtPanel0','i': (40*0)+2},
{'c':'pTxtPanel0','i': (40*0)+3},
{'c':'pTxtPanel0','i': (40*0)+4},
{'c':'pTxtPanel0','i': (40*0)+5},
{'c':'pTxtPanel0','i': (40*0)+6},
{'c':'pTxtPanel0','i': (40*0)+7},
{'c':'pTxtPanel0','i': (40*0)+8},
{'c':'pTxtPanel0','i': (40*0)+9},
{'c':'pTxtPanel0','i': (40*0)+10},
{'c':'pTxtPanel0','i': (40*0)+11},
{'c':'pTxtPanel0','i': (40*0)+12},
{'c':'pTxtPanel0','i': (40*0)+13},
{'c':'pTxtPanel0','i': (40*0)+14},
{'c':'pTxtPanel0','i': (40*0)+15},
{'c':'pTxtPanel0','i': (40*0)+16},
{'c':'pTxtPanel0','i': (40*0)+17},
{'c':'pTxtPanel0','i': (40*0)+18},
{'c':'pTxtPanel0','i': (40*0)+19},
{'c':'pTxtPanel0','i': (40*0)+20},
{'c':'pTxtPanel0','i': (40*0)+21},
{'c':'pTxtPanel0','i': (40*0)+22},
{'c':'pTxtPanel0','i': (40*0)+23},
{'c':'pTxtPanel0','i': (40*0)+24},
{'c':'pTxtPanel0','i': (40*0)+25},
{'c':'pTxtPanel0','i': (40*0)+26},
{'c':'pTxtPanel0','i': (40*0)+27},
{'c':'pTxtPanel0','i': (40*0)+28},
{'c':'pTxtPanel0','i': (40*1)+0},
{'c':'pTxtPanel1','i': (40*1)+1},
{'c':'pTxtPanel1','i': (40*1)+2},
{'c':'pTxtPanel1','i': (40*1)+3},
{'c':'pTxtPanel1','i': (40*1)+4},
{'c':'pTxtPanel1','i': (40*1)+5},
{'c':'pTxtPanel1','i': (40*1)+6},
{'c':'pTxtPanel1','i': (40*1)+7},
{'c':'pTxtPanel1','i': (40*1)+8},
{'c':'pTxtPanel1','i': (40*1)+9},
{'c':'pTxtPanel1','i': (40*1)+10},
{'c':'pTxtPanel1','i': (40*1)+11},
{'c':'pTxtPanel1','i': (40*1)+12},
{'c':'pTxtPanel1','i': (40*1)+13},
{'c':'pTxtPanel1','i': (40*1)+14},
{'c':'pTxtPanel1','i': (40*1)+15},
{'c':'pTxtPanel1','i': (40*1)+16},
{'c':'pTxtPanel1','i': (40*1)+17},
{'c':'pTxtPanel1','i': (40*1)+18},
{'c':'pTxtPanel1','i': (40*1)+19},
{'c':'pTxtPanel1','i': (40*1)+20},
{'c':'pTxtPanel1','i': (40*1)+21},
{'c':'pTxtPanel1','i': (40*1)+22},
{'c':'pTxtPanel1','i': (40*1)+23},
{'c':'pTxtPanel1','i': (40*1)+24},
{'c':'pTxtPanel1','i': (40*1)+25},
{'c':'pTxtPanel1','i': (40*1)+26},
{'c':'pTxtPanel1','i': (40*1)+27},
{'c':'pTxtPanel0','i': (40*1)+28},
{'c':'pTxtPanel2','i': (40*2)+0},
{'c':'pTxtPanel1','i': (40*2)+1},
{'c':'pTxtPanel1','i': (40*2)+2},
{'c':'pTxtPanel1','i': (40*2)+3},
{'c':'pTxtPanel1','i': (40*2)+4},
{'c':'pTxtPanel1','i': (40*2)+5},
{'c':'pTxtPanel1','i': (40*2)+6},
{'c':'pTxtPanel1','i': (40*2)+7},
{'c':'pTxtPanel1','i': (40*2)+8},
{'c':'pTxtPanel1','i': (40*2)+9},
{'c':'pTxtPanel1','i': (40*2)+10},
{'c':'pTxtPanel1','i': (40*2)+11},
{'c':'pTxtPanel1','i': (40*2)+12},
{'c':'pTxtPanel1','i': (40*2)+13},
{'c':'pTxtPanel1','i': (40*2)+14},
{'c':'pTxtPanel1','i': (40*2)+15},
{'c':'pTxtPanel1','i': (40*2)+16},
{'c':'pTxtPanel1','i': (40*2)+17},
{'c':'pTxtPanel1','i': (40*2)+18},
{'c':'pTxtPanel1','i': (40*2)+19},
{'c':'pTxtPanel1','i': (40*2)+20},
{'c':'pTxtPanel1','i': (40*2)+21},
{'c':'pTxtPanel1','i': (40*2)+22},
{'c':'pTxtPanel1','i': (40*2)+23},
{'c':'pTxtPanel1','i': (40*2)+24},
{'c':'pTxtPanel1','i': (40*2)+25},
{'c':'pTxtPanel1','i': (40*2)+26},
{'c':'pTxtPanel1','i': (40*2)+27},
{'c':'pTxtPanel2','i': (40*2)+28},
{'c':'pTxtPanel2','i': (40*3)+0},
{'c':'pTxtPanel1','i': (40*3)+1},
{'c':'pTxtPanel1','i': (40*3)+2},
{'c':'pTxtPanel1','i': (40*3)+3},
{'c':'pTxtPanel1','i': (40*3)+4},
{'c':'pTxtPanel1','i': (40*3)+5},
{'c':'pTxtPanel1','i': (40*3)+6},
{'c':'pTxtPanel1','i': (40*3)+7},
{'c':'pTxtPanel1','i': (40*3)+8},
{'c':'pTxtPanel1','i': (40*3)+9},
{'c':'pTxtPanel1','i': (40*3)+10},
{'c':'pTxtPanel1','i': (40*3)+11},
{'c':'pTxtPanel1','i': (40*3)+12},
{'c':'pTxtPanel1','i': (40*3)+13},
{'c':'pTxtPanel1','i': (40*3)+14},
{'c':'pTxtPanel1','i': (40*3)+15},
{'c':'pTxtPanel1','i': (40*3)+16},
{'c':'pTxtPanel1','i': (40*3)+17},
{'c':'pTxtPanel1','i': (40*3)+18},
{'c':'pTxtPanel1','i': (40*3)+19},
{'c':'pTxtPanel1','i': (40*3)+20},
{'c':'pTxtPanel1','i': (40*3)+21},
{'c':'pTxtPanel1','i': (40*3)+22},
{'c':'pTxtPanel1','i': (40*3)+23},
{'c':'pTxtPanel1','i': (40*3)+24},
{'c':'pTxtPanel1','i': (40*3)+25},
{'c':'pTxtPanel1','i': (40*3)+26},
{'c':'pTxtPanel1','i': (40*3)+27},
{'c':'pTxtPanel2','i': (40*3)+28},
{'c':'pTxtPanel2','i': (40*4)+0},
{'c':'pTxtPanel2','i': (40*4)+1},
{'c':'pTxtPanel2','i': (40*4)+2},
{'c':'pTxtPanel2','i': (40*4)+3},
{'c':'pTxtPanel2','i': (40*4)+4},
{'c':'pTxtPanel2','i': (40*4)+5},
{'c':'pTxtPanel2','i': (40*4)+6},
{'c':'pTxtPanel2','i': (40*4)+7},
{'c':'pTxtPanel2','i': (40*4)+8},
{'c':'pTxtPanel2','i': (40*4)+9},
{'c':'pTxtPanel2','i': (40*4)+10},
{'c':'pTxtPanel2','i': (40*4)+11},
{'c':'pTxtPanel2','i': (40*4)+12},
{'c':'pTxtPanel2','i': (40*4)+13},
{'c':'pTxtPanel2','i': (40*4)+14},
{'c':'pTxtPanel2','i': (40*4)+15},
{'c':'pTxtPanel2','i': (40*4)+16},
{'c':'pTxtPanel2','i': (40*4)+17},
{'c':'pTxtPanel2','i': (40*4)+18},
{'c':'pTxtPanel2','i': (40*4)+19},
{'c':'pTxtPanel2','i': (40*4)+20},
{'c':'pTxtPanel2','i': (40*4)+21},
{'c':'pTxtPanel2','i': (40*4)+22},
{'c':'pTxtPanel2','i': (40*4)+23},
{'c':'pTxtPanel2','i': (40*4)+24},
{'c':'pTxtPanel2','i': (40*4)+25},
{'c':'pTxtPanel2','i': (40*4)+26},
{'c':'pTxtPanel2','i': (40*4)+27},
{'c':'pTxtPanel2','i': (40*4)+28},
{'c':'pTxtPanel2','i': (40*5)+20},
{'c':'pTxtPanel2','i': (40*5)+21},
{'c':'pTxtPanel2','i': (40*5)+22},
{'c':'pTxtPanel2','i': (40*6)+22}
],
'label' : '1'
}
}
],
pTxtPanel3 : [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'pTxtPanel0','i': (40*0)+4},
{'c':'pTxtPanel0','i': (40*1)+4},
{'c':'pTxtPanel0','i': (40*1)+5},
{'c':'pTxtPanel0','i': (40*1)+6},
{'c':'pTxtPanel0','i': (40*2)+0},
{'c':'pTxtPanel0','i': (40*2)+1},
{'c':'pTxtPanel0','i': (40*2)+2},
{'c':'pTxtPanel0','i': (40*2)+3},
{'c':'pTxtPanel0','i': (40*2)+4},
{'c':'pTxtPanel0','i': (40*2)+5},
{'c':'pTxtPanel0','i': (40*2)+6},
{'c':'pTxtPanel0','i': (40*2)+7},
{'c':'pTxtPanel0','i': (40*2)+8},
{'c':'pTxtPanel0','i': (40*2)+9},
{'c':'pTxtPanel0','i': (40*2)+10},
{'c':'pTxtPanel0','i': (40*2)+11},
{'c':'pTxtPanel0','i': (40*2)+12},
{'c':'pTxtPanel0','i': (40*2)+13},
{'c':'pTxtPanel0','i': (40*2)+14},
{'c':'pTxtPanel0','i': (40*2)+15},
{'c':'pTxtPanel0','i': (40*2)+16},
{'c':'pTxtPanel0','i': (40*2)+17},
{'c':'pTxtPanel0','i': (40*2)+18},
{'c':'pTxtPanel0','i': (40*2)+19},
{'c':'pTxtPanel0','i': (40*2)+20},
{'c':'pTxtPanel0','i': (40*2)+21},
{'c':'pTxtPanel0','i': (40*2)+22},
{'c':'pTxtPanel0','i': (40*2)+23},
{'c':'pTxtPanel0','i': (40*2)+24},
{'c':'pTxtPanel0','i': (40*3)+0},
{'c':'pTxtPanel1','i': (40*3)+1},
{'c':'pTxtPanel1','i': (40*3)+2},
{'c':'pTxtPanel1','i': (40*3)+3},
{'c':'pTxtPanel1','i': (40*3)+4},
{'c':'pTxtPanel1','i': (40*3)+5},
{'c':'pTxtPanel1','i': (40*3)+6},
{'c':'pTxtPanel1','i': (40*3)+7},
{'c':'pTxtPanel1','i': (40*3)+8},
{'c':'pTxtPanel1','i': (40*3)+9},
{'c':'pTxtPanel1','i': (40*3)+10},
{'c':'pTxtPanel1','i': (40*3)+11},
{'c':'pTxtPanel1','i': (40*3)+12},
{'c':'pTxtPanel1','i': (40*3)+13},
{'c':'pTxtPanel1','i': (40*3)+14},
{'c':'pTxtPanel1','i': (40*3)+15},
{'c':'pTxtPanel1','i': (40*3)+16},
{'c':'pTxtPanel1','i': (40*3)+17},
{'c':'pTxtPanel1','i': (40*3)+18},
{'c':'pTxtPanel1','i': (40*3)+19},
{'c':'pTxtPanel1','i': (40*3)+20},
{'c':'pTxtPanel1','i': (40*3)+21},
{'c':'pTxtPanel1','i': (40*3)+22},
{'c':'pTxtPanel1','i': (40*3)+23},
{'c':'pTxtPanel0','i': (40*3)+24},
{'c':'pTxtPanel0','i': (40*4)+0},
{'c':'pTxtPanel1','i': (40*4)+1},
{'c':'pTxtPanel1','i': (40*4)+2},
{'c':'pTxtPanel1','i': (40*4)+3},
{'c':'pTxtPanel1','i': (40*4)+4},
{'c':'pTxtPanel1','i': (40*4)+5},
{'c':'pTxtPanel1','i': (40*4)+6},
{'c':'pTxtPanel1','i': (40*4)+7},
{'c':'pTxtPanel1','i': (40*4)+8},
{'c':'pTxtPanel1','i': (40*4)+9},
{'c':'pTxtPanel1','i': (40*4)+10},
{'c':'pTxtPanel1','i': (40*4)+11},
{'c':'pTxtPanel1','i': (40*4)+12},
{'c':'pTxtPanel1','i': (40*4)+13},
{'c':'pTxtPanel1','i': (40*4)+14},
{'c':'pTxtPanel1','i': (40*4)+15},
{'c':'pTxtPanel1','i': (40*4)+16},
{'c':'pTxtPanel1','i': (40*4)+17},
{'c':'pTxtPanel1','i': (40*4)+18},
{'c':'pTxtPanel1','i': (40*4)+19},
{'c':'pTxtPanel1','i': (40*4)+20},
{'c':'pTxtPanel1','i': (40*4)+21},
{'c':'pTxtPanel1','i': (40*4)+22},
{'c':'pTxtPanel1','i': (40*4)+23},
{'c':'pTxtPanel0','i': (40*4)+24},
{'c':'pTxtPanel0','i': (40*5)+0},
{'c':'pTxtPanel1','i': (40*5)+1},
{'c':'pTxtPanel1','i': (40*5)+2},
{'c':'pTxtPanel1','i': (40*5)+3},
{'c':'pTxtPanel1','i': (40*5)+4},
{'c':'pTxtPanel1','i': (40*5)+5},
{'c':'pTxtPanel1','i': (40*5)+6},
{'c':'pTxtPanel1','i': (40*5)+7},
{'c':'pTxtPanel1','i': (40*5)+8},
{'c':'pTxtPanel1','i': (40*5)+9},
{'c':'pTxtPanel1','i': (40*5)+10},
{'c':'pTxtPanel1','i': (40*5)+11},
{'c':'pTxtPanel1','i': (40*5)+12},
{'c':'pTxtPanel1','i': (40*5)+13},
{'c':'pTxtPanel1','i': (40*5)+14},
{'c':'pTxtPanel1','i': (40*5)+15},
{'c':'pTxtPanel1','i': (40*5)+16},
{'c':'pTxtPanel1','i': (40*5)+17},
{'c':'pTxtPanel1','i': (40*5)+18},
{'c':'pTxtPanel1','i': (40*5)+19},
{'c':'pTxtPanel1','i': (40*5)+20},
{'c':'pTxtPanel1','i': (40*5)+21},
{'c':'pTxtPanel1','i': (40*5)+22},
{'c':'pTxtPanel1','i': (40*5)+23},
{'c':'pTxtPanel0','i': (40*5)+24},
{'c':'pTxtPanel2','i': (40*6)+0},
{'c':'pTxtPanel1','i': (40*6)+1},
{'c':'pTxtPanel1','i': (40*6)+2},
{'c':'pTxtPanel1','i': (40*6)+3},
{'c':'pTxtPanel1','i': (40*6)+4},
{'c':'pTxtPanel1','i': (40*6)+5},
{'c':'pTxtPanel1','i': (40*6)+6},
{'c':'pTxtPanel1','i': (40*6)+7},
{'c':'pTxtPanel1','i': (40*6)+8},
{'c':'pTxtPanel1','i': (40*6)+9},
{'c':'pTxtPanel1','i': (40*6)+10},
{'c':'pTxtPanel1','i': (40*6)+11},
{'c':'pTxtPanel1','i': (40*6)+12},
{'c':'pTxtPanel1','i': (40*6)+13},
{'c':'pTxtPanel1','i': (40*6)+14},
{'c':'pTxtPanel1','i': (40*6)+15},
{'c':'pTxtPanel1','i': (40*6)+16},
{'c':'pTxtPanel1','i': (40*6)+17},
{'c':'pTxtPanel1','i': (40*6)+18},
{'c':'pTxtPanel1','i': (40*6)+19},
{'c':'pTxtPanel1','i': (40*6)+20},
{'c':'pTxtPanel1','i': (40*6)+21},
{'c':'pTxtPanel1','i': (40*6)+22},
{'c':'pTxtPanel1','i': (40*6)+23},
{'c':'pTxtPanel2','i': (40*6)+24},
{'c':'pTxtPanel2','i': (40*7)+0},
{'c':'pTxtPanel1','i': (40*7)+1},
{'c':'pTxtPanel1','i': (40*7)+2},
{'c':'pTxtPanel1','i': (40*7)+3},
{'c':'pTxtPanel1','i': (40*7)+4},
{'c':'pTxtPanel1','i': (40*7)+5},
{'c':'pTxtPanel1','i': (40*7)+6},
{'c':'pTxtPanel1','i': (40*7)+7},
{'c':'pTxtPanel1','i': (40*7)+8},
{'c':'pTxtPanel1','i': (40*7)+9},
{'c':'pTxtPanel1','i': (40*7)+10},
{'c':'pTxtPanel1','i': (40*7)+11},
{'c':'pTxtPanel1','i': (40*7)+12},
{'c':'pTxtPanel1','i': (40*7)+13},
{'c':'pTxtPanel1','i': (40*7)+14},
{'c':'pTxtPanel1','i': (40*7)+15},
{'c':'pTxtPanel1','i': (40*7)+16},
{'c':'pTxtPanel1','i': (40*7)+17},
{'c':'pTxtPanel1','i': (40*7)+18},
{'c':'pTxtPanel1','i': (40*7)+19},
{'c':'pTxtPanel1','i': (40*7)+20},
{'c':'pTxtPanel1','i': (40*7)+21},
{'c':'pTxtPanel1','i': (40*7)+22},
{'c':'pTxtPanel1','i': (40*7)+23},
{'c':'pTxtPanel2','i': (40*7)+24},
{'c':'pTxtPanel2','i': (40*8)+0},
{'c':'pTxtPanel1','i': (40*8)+1},
{'c':'pTxtPanel1','i': (40*8)+2},
{'c':'pTxtPanel1','i': (40*8)+3},
{'c':'pTxtPanel1','i': (40*8)+4},
{'c':'pTxtPanel1','i': (40*8)+5},
{'c':'pTxtPanel1','i': (40*8)+6},
{'c':'pTxtPanel1','i': (40*8)+7},
{'c':'pTxtPanel1','i': (40*8)+8},
{'c':'pTxtPanel1','i': (40*8)+9},
{'c':'pTxtPanel1','i': (40*8)+10},
{'c':'pTxtPanel1','i': (40*8)+11},
{'c':'pTxtPanel1','i': (40*8)+12},
{'c':'pTxtPanel1','i': (40*8)+13},
{'c':'pTxtPanel1','i': (40*8)+14},
{'c':'pTxtPanel1','i': (40*8)+15},
{'c':'pTxtPanel1','i': (40*8)+16},
{'c':'pTxtPanel1','i': (40*8)+17},
{'c':'pTxtPanel1','i': (40*8)+18},
{'c':'pTxtPanel1','i': (40*8)+19},
{'c':'pTxtPanel1','i': (40*8)+20},
{'c':'pTxtPanel1','i': (40*8)+21},
{'c':'pTxtPanel1','i': (40*8)+22},
{'c':'pTxtPanel1','i': (40*8)+23},
{'c':'pTxtPanel2','i': (40*8)+24},
{'c':'pTxtPanel2','i': (40*9)+0},
{'c':'pTxtPanel1','i': (40*9)+1},
{'c':'pTxtPanel1','i': (40*9)+2},
{'c':'pTxtPanel1','i': (40*9)+3},
{'c':'pTxtPanel1','i': (40*9)+4},
{'c':'pTxtPanel1','i': (40*9)+5},
{'c':'pTxtPanel1','i': (40*9)+6},
{'c':'pTxtPanel1','i': (40*9)+7},
{'c':'pTxtPanel1','i': (40*9)+8},
{'c':'pTxtPanel1','i': (40*9)+9},
{'c':'pTxtPanel1','i': (40*9)+10},
{'c':'pTxtPanel1','i': (40*9)+11},
{'c':'pTxtPanel1','i': (40*9)+12},
{'c':'pTxtPanel1','i': (40*9)+13},
{'c':'pTxtPanel1','i': (40*9)+14},
{'c':'pTxtPanel1','i': (40*9)+15},
{'c':'pTxtPanel1','i': (40*9)+16},
{'c':'pTxtPanel1','i': (40*9)+17},
{'c':'pTxtPanel1','i': (40*9)+18},
{'c':'pTxtPanel1','i': (40*9)+19},
{'c':'pTxtPanel1','i': (40*9)+20},
{'c':'pTxtPanel1','i': (40*9)+21},
{'c':'pTxtPanel1','i': (40*9)+22},
{'c':'pTxtPanel1','i': (40*9)+23},
{'c':'pTxtPanel2','i': (40*9)+24},
{'c':'pTxtPanel2','i': (40*10)+0},
{'c':'pTxtPanel2','i': (40*10)+1},
{'c':'pTxtPanel2','i': (40*10)+2},
{'c':'pTxtPanel2','i': (40*10)+3},
{'c':'pTxtPanel2','i': (40*10)+4},
{'c':'pTxtPanel2','i': (40*10)+5},
{'c':'pTxtPanel2','i': (40*10)+6},
{'c':'pTxtPanel2','i': (40*10)+7},
{'c':'pTxtPanel2','i': (40*10)+8},
{'c':'pTxtPanel2','i': (40*10)+9},
{'c':'pTxtPanel2','i': (40*10)+10},
{'c':'pTxtPanel2','i': (40*10)+11},
{'c':'pTxtPanel2','i': (40*10)+12},
{'c':'pTxtPanel2','i': (40*10)+13},
{'c':'pTxtPanel2','i': (40*10)+14},
{'c':'pTxtPanel2','i': (40*10)+15},
{'c':'pTxtPanel2','i': (40*10)+16},
{'c':'pTxtPanel2','i': (40*10)+17},
{'c':'pTxtPanel2','i': (40*10)+18},
{'c':'pTxtPanel2','i': (40*10)+19},
{'c':'pTxtPanel2','i': (40*10)+20},
{'c':'pTxtPanel2','i': (40*10)+21},
{'c':'pTxtPanel2','i': (40*10)+22},
{'c':'pTxtPanel2','i': (40*10)+23},
{'c':'pTxtPanel2','i': (40*10)+24}
],
'label' : '1'
}
}
],
pTxtPanel4 : [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'pTxtPanel0','i': (40*0)+10},
{'c':'pTxtPanel0','i': (40*1)+8},
{'c':'pTxtPanel0','i': (40*1)+9},
{'c':'pTxtPanel0','i': (40*1)+10},
{'c':'pTxtPanel0','i': (40*2)+0},
{'c':'pTxtPanel0','i': (40*2)+1},
{'c':'pTxtPanel0','i': (40*2)+2},
{'c':'pTxtPanel0','i': (40*2)+3},
{'c':'pTxtPanel0','i': (40*2)+4},
{'c':'pTxtPanel0','i': (40*2)+5},
{'c':'pTxtPanel0','i': (40*2)+6},
{'c':'pTxtPanel0','i': (40*2)+7},
{'c':'pTxtPanel0','i': (40*2)+8},
{'c':'pTxtPanel0','i': (40*2)+9},
{'c':'pTxtPanel0','i': (40*2)+10},
{'c':'pTxtPanel0','i': (40*2)+11},
{'c':'pTxtPanel0','i': (40*2)+12},
{'c':'pTxtPanel0','i': (40*2)+13},
{'c':'pTxtPanel0','i': (40*2)+14},
{'c':'pTxtPanel0','i': (40*2)+15},
{'c':'pTxtPanel0','i': (40*2)+16},
{'c':'pTxtPanel0','i': (40*2)+17},
{'c':'pTxtPanel0','i': (40*2)+18},
{'c':'pTxtPanel0','i': (40*2)+19},
{'c':'pTxtPanel0','i': (40*2)+20},
{'c':'pTxtPanel0','i': (40*2)+21},
{'c':'pTxtPanel0','i': (40*2)+22},
{'c':'pTxtPanel0','i': (40*2)+23},
{'c':'pTxtPanel0','i': (40*3)+0},
{'c':'pTxtPanel1','i': (40*3)+1},
{'c':'pTxtPanel1','i': (40*3)+2},
{'c':'pTxtPanel1','i': (40*3)+3},
{'c':'pTxtPanel1','i': (40*3)+4},
{'c':'pTxtPanel1','i': (40*3)+5},
{'c':'pTxtPanel1','i': (40*3)+6},
{'c':'pTxtPanel1','i': (40*3)+7},
{'c':'pTxtPanel1','i': (40*3)+8},
{'c':'pTxtPanel1','i': (40*3)+9},
{'c':'pTxtPanel1','i': (40*3)+10},
{'c':'pTxtPanel1','i': (40*3)+11},
{'c':'pTxtPanel1','i': (40*3)+12},
{'c':'pTxtPanel1','i': (40*3)+13},
{'c':'pTxtPanel1','i': (40*3)+14},
{'c':'pTxtPanel1','i': (40*3)+15},
{'c':'pTxtPanel1','i': (40*3)+16},
{'c':'pTxtPanel1','i': (40*3)+17},
{'c':'pTxtPanel1','i': (40*3)+18},
{'c':'pTxtPanel1','i': (40*3)+19},
{'c':'pTxtPanel1','i': (40*3)+20},
{'c':'pTxtPanel1','i': (40*3)+21},
{'c':'pTxtPanel1','i': (40*3)+22},
{'c':'pTxtPanel0','i': (40*3)+23},
{'c':'pTxtPanel2','i': (40*4)+0},
{'c':'pTxtPanel1','i': (40*4)+1},
{'c':'pTxtPanel1','i': (40*4)+2},
{'c':'pTxtPanel1','i': (40*4)+3},
{'c':'pTxtPanel1','i': (40*4)+4},
{'c':'pTxtPanel1','i': (40*4)+5},
{'c':'pTxtPanel1','i': (40*4)+6},
{'c':'pTxtPanel1','i': (40*4)+7},
{'c':'pTxtPanel1','i': (40*4)+8},
{'c':'pTxtPanel1','i': (40*4)+9},
{'c':'pTxtPanel1','i': (40*4)+10},
{'c':'pTxtPanel1','i': (40*4)+11},
{'c':'pTxtPanel1','i': (40*4)+12},
{'c':'pTxtPanel1','i': (40*4)+13},
{'c':'pTxtPanel1','i': (40*4)+14},
{'c':'pTxtPanel1','i': (40*4)+15},
{'c':'pTxtPanel1','i': (40*4)+16},
{'c':'pTxtPanel1','i': (40*4)+17},
{'c':'pTxtPanel1','i': (40*4)+18},
{'c':'pTxtPanel1','i': (40*4)+19},
{'c':'pTxtPanel1','i': (40*4)+20},
{'c':'pTxtPanel1','i': (40*4)+21},
{'c':'pTxtPanel1','i': (40*4)+22},
{'c':'pTxtPanel2','i': (40*4)+23},
{'c':'pTxtPanel2','i': (40*5)+0},
{'c':'pTxtPanel1','i': (40*5)+1},
{'c':'pTxtPanel1','i': (40*5)+2},
{'c':'pTxtPanel1','i': (40*5)+3},
{'c':'pTxtPanel1','i': (40*5)+4},
{'c':'pTxtPanel1','i': (40*5)+5},
{'c':'pTxtPanel1','i': (40*5)+6},
{'c':'pTxtPanel1','i': (40*5)+7},
{'c':'pTxtPanel1','i': (40*5)+8},
{'c':'pTxtPanel1','i': (40*5)+9},
{'c':'pTxtPanel1','i': (40*5)+10},
{'c':'pTxtPanel1','i': (40*5)+11},
{'c':'pTxtPanel1','i': (40*5)+12},
{'c':'pTxtPanel1','i': (40*5)+13},
{'c':'pTxtPanel1','i': (40*5)+14},
{'c':'pTxtPanel1','i': (40*5)+15},
{'c':'pTxtPanel1','i': (40*5)+16},
{'c':'pTxtPanel1','i': (40*5)+17},
{'c':'pTxtPanel1','i': (40*5)+18},
{'c':'pTxtPanel1','i': (40*5)+19},
{'c':'pTxtPanel1','i': (40*5)+20},
{'c':'pTxtPanel1','i': (40*5)+21},
{'c':'pTxtPanel1','i': (40*5)+22},
{'c':'pTxtPanel2','i': (40*5)+23},
{'c':'pTxtPanel2','i': (40*6)+0},
{'c':'pTxtPanel2','i': (40*6)+1},
{'c':'pTxtPanel2','i': (40*6)+2},
{'c':'pTxtPanel2','i': (40*6)+3},
{'c':'pTxtPanel2','i': (40*6)+4},
{'c':'pTxtPanel2','i': (40*6)+5},
{'c':'pTxtPanel2','i': (40*6)+6},
{'c':'pTxtPanel2','i': (40*6)+7},
{'c':'pTxtPanel2','i': (40*6)+8},
{'c':'pTxtPanel2','i': (40*6)+9},
{'c':'pTxtPanel2','i': (40*6)+10},
{'c':'pTxtPanel2','i': (40*6)+11},
{'c':'pTxtPanel2','i': (40*6)+12},
{'c':'pTxtPanel2','i': (40*6)+13},
{'c':'pTxtPanel2','i': (40*6)+14},
{'c':'pTxtPanel2','i': (40*6)+15},
{'c':'pTxtPanel2','i': (40*6)+16},
{'c':'pTxtPanel2','i': (40*6)+17},
{'c':'pTxtPanel2','i': (40*6)+18},
{'c':'pTxtPanel2','i': (40*6)+19},
{'c':'pTxtPanel2','i': (40*6)+20},
{'c':'pTxtPanel2','i': (40*6)+21},
{'c':'pTxtPanel2','i': (40*6)+22},
{'c':'pTxtPanel2','i': (40*6)+23}
],
'label' : '1'
}
}
]
};
}
return {
add: function(before, after) {
if (typeof(BigBlock.PanelInfoInst) == 'undefined') { // Instantiate only if the instance doesn't exist.
BigBlock.PanelInfoInst = cnstr(before, after);
BigBlock.PanelInfoInst.logoScreen();
}
}
};
})();
/**
* Particle
* Created by Emitters; the Emitter sets the intial properties and passes them to particles. They also inherit Sprite props.
*
* @author Vince Allen 12-05-2009
*/
/*global Sprite, Grid, killObject */
BigBlock.Particle = (function () {
getTransform = function (vel, angle, x, y, gravity, clock, life, className, color_max, particle_spiral_vel_x, particle_spiral_vel_y) {
var trans = {};
var spiral_offset = Math.round(Math.cos(clock) * (particle_spiral_vel_x * BigBlock.Grid.pix_dim));
var vx = (vel*BigBlock.Grid.pix_dim) * Math.cos(angle) + spiral_offset; // calculate how far obj should move on x,y axis
spiral_offset = Math.round(Math.cos(clock) * (particle_spiral_vel_y * BigBlock.Grid.pix_dim));
var vy = (vel*BigBlock.Grid.pix_dim) * Math.sin(angle) + spiral_offset;
// uncomment to disregard spiral offset
//var vx = (vel*BigBlock.Grid.pix_dim) * Math.cos(angle);
//var vy = (vel*BigBlock.Grid.pix_dim) * Math.sin(angle);
if (x + vx >= BigBlock.Grid.width) {
//killObject(this); // !! 'this' is problematic here; created from a function invoked by call(); kills the obj invoking call()
} else {
trans.x = x + vx;
trans.y = y + vy + (gravity*BigBlock.Grid.pix_dim);
}
var p = clock/life;
trans.color_index = className + Math.round(color_max*p);
return trans;
};
return {
create: function(params){
var particle = BigBlock.clone(BigBlock.Sprite); // CLONE Sprite
particle.configure(); // run configure() to inherit Sprite properties
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
particle[i] = params[i];
}
}
}
particle.color_index = particle.className + '0'; // overwrite color_index w passed className
particle.anim = [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':this.color_index,'i':0}
]
}
}
];
particle.run = function () {
switch (this.state) {
case 'stop':
break;
case 'start':
var trans = getTransform(this.vel, this.angle, this.x, this.y, this.gravity, this.clock, this.life, this.className, this.color_max, this.p_spiral_vel_x, this.p_spiral_vel_y);
this.x = trans.x;
this.y = trans.y;
this.color_index = trans.color_index;
this.gravity *= 1.08;
break;
case 'dead':
break;
}
this.pix_index = BigBlock.getPixIndex(this.x, this.y); // get new pixel index to render
this.img = this.getPix(this.anim, this.color_index); // get pixels
if (this.clock++ >= this.life && this.life !== 0 && this.state != 'dead') {
BigBlock.Timer.killObject(this);
} else {
this.clock++; // increment lifecycle clock
}
};
particle.stop = function () {
this.state = 'stop';
};
BigBlock.Sprites[BigBlock.Sprites.length] = particle;
}
};
})();
/**
* RenderManager object
* Renders pixels to the grid.
*
* @author Vince Allen 12-05-2009
*/
BigBlock.RenderMgr = (function () {
return {
renderTime : [],
renderPix : function (sprites, start) {
/*
* CLEAN UP
* Resets the class of all divs in GridActive div
*/
var quads = BigBlock.GridActive.quads;
for (var i = 0; i < quads.length; i++) {
var q = document.getElementById(quads[i].id);
if (q.hasChildNodes()) {
var nodes = q.childNodes; // get a DOM collection of all children in quad;
var tmp = [];
/* DOM collections are live; iterating over a static array is faster than iterating over a live DOM collection
* After testing saw a 6.6% performance increase w iPhone 4; 7.1% w iPhone 3GS; 5.7% w iPad 3.2
*/
for( var x = 0; x < nodes.length; x++ ) { // make copy of DOM collection
tmp[tmp.length] = nodes[x];
}
for (x = 0; x < tmp.length; x++) { // reset classes in all children
tmp[x].setAttribute('class', 'pix color');
if (!document.addEventListener) { // test for IE
tmp[x].setAttribute('className', 'pix color'); // IE6
}
tmp[x].onmouseup = null; // remove events
tmp[x].ontouchstart = null;
}
tmp = null;
}
}
/*
* SPRITE LOOP
*/
// loop thru all existing non-text objects
var parent_div;
var pix_x;
var pix_y;
var div_id = 0;
var d;
for (i = 0; i < BigBlock.Sprites.length; i++) {
/*
* RENDER CONDITIONS
* Do not render pixel or increment render counter if:
* Render property has timed out.
* State = 'dead'.
*
* Do not render pixel but increment render counter if:
* Img property is undefined.
* Img.pix property is undefined.
*
* Img.pix carries the properties of the pixel.
* c = the color class
* i = the position index in the grid
*
* Do not render pixel but increment render and div_id if:
* Pixel position is off screen.
*
* Static sprites are appended to the 'pix_grid_static' div and
* immediately deleted from the Sprite array. You cannot kill
* static sprites.
*
*/
if (BigBlock.Sprites[i].render !== 0 && BigBlock.Sprites[i].state != 'dead') {
var y = 0;
if (typeof(BigBlock.Sprites[i].img) != 'undefined' && typeof(BigBlock.Sprites[i].img.pix) != 'undefined') {
for (y in BigBlock.Sprites[i].img.pix) { // loop thru blocks attached to this Sprite
// render pixel
var pix_index_offset = BigBlock.Sprites[i].img.pix[y].i;
var pix_index = pix_index_offset + BigBlock.Sprites[i].pix_index;
if (pix_index !== false) { // check that block is on screen; index should correspond to a location in the grid
var color = BigBlock.Sprites[i].img.pix[y].c;
var child = document.createElement("div");
if (BigBlock.Sprites[i].render_static) {
switch (BigBlock.Sprites[i].alias) {
case 'Char':
pix_x = BigBlock.getPixLoc('x', BigBlock.Sprites[i].x, pix_index_offset); // get global x, y coords based on parent sprite's coords
pix_y = BigBlock.getPixLoc('y', BigBlock.Sprites[i].y, pix_index_offset);
if (pix_x >= 0 && pix_x < BigBlock.GridStatic.width && pix_y >= 0 && pix_y < BigBlock.GridStatic.height) { // check that block is on screen
pix_index = BigBlock.getPixIndex(pix_x, pix_y);
child.setAttribute('class', 'pix text_bg pos' + pix_index); // overwrite class set above
if (typeof document.addEventListener != 'function') { // test for IE
child.setAttribute('className', 'pix text_bg pos' + pix_index); // IE6
child.innerHTML = '.'; // IE6
}
var char_pos = BigBlock.Sprites[i].char_pos; // get positions of all divs in the character
for (var k = 0; k < char_pos.length; k++) {
var char_div = document.createElement("div");
var gl_limit = BigBlock.Grid.pix_dim * 4;
if (char_pos[k].p < gl_limit && BigBlock.Sprites[i].glass === true) {
char_div.setAttribute('class', 'char char_pos' + char_pos[k].p + ' color' + color + '_glass0');
if (typeof document.addEventListener != 'function') { // test for IE
char_div.setAttribute('className', 'char char_pos' + char_pos[k].p + ' color' + color + '_glass0'); // IE6
char_div.innerHTML = '.'; // IE6
}
} else {
char_div.setAttribute('class', 'char char_pos' + char_pos[k].p + ' color' + color);
if (typeof document.addEventListener != 'function') { // test for IE
char_div.setAttribute('className', 'char char_pos' + char_pos[k].p + ' color' + color); // IE6
char_div.innerHTML = '.'; // IE6
}
}
child.appendChild(char_div); // add the character div to the Sprite's div
}
child.setAttribute('name', BigBlock.Sprites[i].word_id);
child.setAttribute('id', BigBlock.getUniqueId());
if (BigBlock.Sprites[i].url !== false) { // if a url is attached to the char, add an event listener
child.style['backgroundColor'] = BigBlock.Sprites[i].link_color;
}
document.getElementById(BigBlock.RenderMgr.getQuad('text', pix_x, pix_y)).appendChild(child); // add character to dom
}
break;
default:
pix_x = BigBlock.getPixLoc('x', BigBlock.Sprites[i].x, pix_index_offset); // get global x, y coords based on parent sprite's coords
pix_y = BigBlock.getPixLoc('y', BigBlock.Sprites[i].y, pix_index_offset);
if (pix_x >= 0 && pix_x < BigBlock.GridStatic.width && pix_y >= 0 && pix_y < BigBlock.GridStatic.height) { // check that block is on screen
pix_index = BigBlock.getPixIndex(pix_x, pix_y);
child.setAttribute('class', 'pix color' + color + ' pos' + pix_index);
if (typeof document.addEventListener != 'function') { // test for IE
child.setAttribute('className', 'pix color' + color + ' pos' + pix_index); // IE6
child.innerHTML = '.'; // IE6
}
child.setAttribute('id', '_static');
child.setAttribute('name', BigBlock.Sprites[i].alias);
document.getElementById(BigBlock.RenderMgr.getQuad('static', pix_x, pix_y)).appendChild(child);
}
break;
}
} else {
d = document.getElementById(div_id);
pix_x = BigBlock.getPixLoc('x', BigBlock.Sprites[i].x, pix_index_offset); // get global x, y coords based on parent sprite's coords
pix_y = BigBlock.getPixLoc('y', BigBlock.Sprites[i].y, pix_index_offset);
if (pix_x >= 0 && pix_x < BigBlock.GridActive.width && pix_y >= 0 && pix_y < BigBlock.GridActive.height) { // check that block is on screen
pix_index = BigBlock.getPixIndex(pix_x, pix_y);
if (!d) { // if this div does not exist, create it
child.setAttribute('id', div_id);
child.setAttribute('class', 'pix color' + color + ' pos' + pix_index); // update its class
if (typeof document.addEventListener != 'function') { // test for IE
child.setAttribute('className', 'pix color' + color + ' pos' + pix_index); // IE6
child.innerHTML = '.'; // IE6
}
document.getElementById(BigBlock.RenderMgr.getQuad('active', pix_x, pix_y)).appendChild(child);
} else {
d.setAttribute('class', 'pix color' + color + ' pos' + pix_index); // update its class
if (typeof document.addEventListener != 'function') { // test for IE
d.setAttribute('className', 'pix color' + color + ' pos' + pix_index); // IE6
}
parent_div = d.parentNode.getAttribute("id");
var target_div = BigBlock.RenderMgr.getQuad('active', pix_x, pix_y);
if (parent_div != target_div) { // div does not switch quadrants
document.getElementById(parent_div).removeChild(d); // remove div from old quad
document.getElementById(target_div).appendChild(d); // append div to new quad
}
}
}
}
} else { // block is off screen
d = document.getElementById(div_id);
if (d) { // if div exists; remove it
parent_div = d.parentNode.getAttribute("id");
document.getElementById(parent_div).removeChild(d);
}
}
div_id++; // increment the div_id; important for cycling thru static divs
}
}
BigBlock.Sprites[i].render--; // decrement the render counter
}
if (BigBlock.Sprites[i].render_static && typeof(BigBlock.Sprites[i].img) != 'undefined') { // if this is a static object and the object has its img property
BigBlock.Sprites[i].render_static = false; // MUST set the static property = 0; static sprites will not be deleted
BigBlock.Sprites[i].die(); // kill the sprite
}
}
if (BigBlock.Timer.report_fr === true) {
var end = new Date().getTime(); // mark the end of the run
var time = end - start; // calculate how long the run took in milliseconds
var testInterval = BigBlock.Timer.fr_rate_test_interval;
var total = 0;
this.renderTime[this.renderTime.length] = time;
if (BigBlock.Timer.clock%testInterval == 0) {
for (var t = 0; t < testInterval; t++) {
total += this.renderTime[t];
}
BigBlock.Log.display(total/testInterval);
this.renderTime = [];
}
}
},
/**
* Returns the correct quad grid based on passed x, y coords
* @param x
* @param y
*
*/
getQuad: function (quad_name, x, y) {
var quad_obj;
switch (quad_name) {
case 'active':
quad_obj = BigBlock.GridActive;
break;
case 'static':
quad_obj = BigBlock.GridStatic;
break;
case 'text':
quad_obj = BigBlock.GridText;
break;
}
if (x < BigBlock.Grid.width / 2 && y < BigBlock.Grid.height / 2) {
return quad_obj.quads[0].id;
}
if (x >= BigBlock.Grid.width/2 && y < BigBlock.Grid.height/2) {
return quad_obj.quads[1].id;
}
if (x < BigBlock.Grid.width/2 && y >= BigBlock.Grid.height/2) {
return quad_obj.quads[2].id;
}
if (x >= BigBlock.Grid.width/2 && y >= BigBlock.Grid.height/2) {
return quad_obj.quads[3].id;
}
},
/**
* clearScene() will clear all divs from all quads as well as empty the Sprites array.
*
* @param {Function} beforeClear
* @param {Function} afterClear
*/
clearScene: function(beforeClear, afterClear) {
BigBlock.inputBlock = true; // block user input when clearing scene
try {
if (typeof(beforeClear) != 'undefined' && beforeClear != null) {
if (typeof(beforeClear) != 'function') {
throw new Error('Err: RMCS001');
} else {
beforeClear();
}
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
var quads;
var i;
var q;
if (typeof(BigBlock.GridStatic) != 'undefined') {
quads = BigBlock.GridStatic.quads;
for (var i = 0; i < quads.length; i++) {
q = document.getElementById(quads[i].id);
if (q.hasChildNodes()) {
while (q.firstChild) {
q.removeChild(q.firstChild);
}
}
}
BigBlock.GridStatic.setStyle('backgroundColor', 'transparent');
}
if (typeof(BigBlock.GridText) != 'undefined') {
quads = BigBlock.GridText.quads;
for (var i = 0; i < quads.length; i++) {
q = document.getElementById(quads[i].id);
if (q.hasChildNodes()) {
while (q.firstChild) {
q.removeChild(q.firstChild);
}
}
}
BigBlock.GridText.setStyle('backgroundColor', 'transparent');
}
if (typeof(BigBlock.GridActive) != 'undefined') {
quads = BigBlock.GridActive.quads;
for (var i = 0; i < quads.length; i++) {
q = document.getElementById(quads[i].id);
if (q.hasChildNodes()) {
while (q.firstChild) {
q.removeChild(q.firstChild);
}
}
}
BigBlock.GridActive.setStyle('backgroundColor', 'transparent');
}
if (typeof(BigBlock.Sprites) != 'undefined') {
BigBlock.Sprites = [];
}
try {
if (typeof(afterClear) != 'undefined' && afterClear != null) {
if (typeof(afterClear) != 'function') {
throw new Error('Err: RMCS002');
} else {
afterClear();
}
}
} catch(er) {
BigBlock.Log.display(er.name + ': ' + er.message);
}
//
BigBlock.inputBlock = false; // release user input block
}
};
})();
/**
* ScreenEvent object
* Defines all events.
*
* @author Vince Allen 12-05-2009
*/
BigBlock.ScreenEvent = (function () {
return {
/**
* Sets the properties of the ScreenEvent object.
* params are passed as a json string. params can be an empty object ie. {}
*
*
* @param params
*
*/
create: function (params) {
this.alias = "ScreenEvent"; // DO NOT REMOVE; Timer checks BigBlock.ScreenEvent.alias to determine if BigBlock.ScreenEvent has been created in the html file
try {
if (typeof(params) == 'undefined') {
throw new Error('Err: SEC001');
} else {
/*
* The following properties are used to prevent the user from clicking/tapping to fast.
*/
this.event_start = new Date().getTime();
this.event_end = 0;
this.event_time = 0;
if (typeof(params.event_buffer) != 'undefined') { // can pass in an event_buffer
this.event_buffer = params.event_buffer;
} else {
this.event_buffer = 200;
}
// MOUSEUP
if (typeof(params.mouseup) != 'undefined') {
this.mouseup_event = params.mouseup;
} else {
this.mouseup_event = function(event) {
if (BigBlock.inputBlock === true) { // check to block user input
return false;
}
BigBlock.ScreenEvent.event_end = new Date().getTime(); // time now
BigBlock.ScreenEvent.event_time = BigBlock.ScreenEvent.event_end - BigBlock.ScreenEvent.event_start; // calculate how long bw last event in milliseconds
//
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
if (document.removeEventListener) { // mozilla
document.removeEventListener('touchstart', BigBlock.ScreenEvent.touch_event, false);
} // IE does not have an equivalent event; 07-22-2010
if (BigBlock.ScreenEvent.event_time > BigBlock.ScreenEvent.event_buffer) {
if (typeof(BigBlock.GridActive) != 'undefined') {
var evt_x = event.clientX - BigBlock.GridActive.x;
var evt_y = event.clientY - BigBlock.GridActive.y;
}
var ia_check = false;
for (var i = 0; i < BigBlock.Sprites.length; i++) { // check to fire any active sprite events
if (BigBlock.Sprites[i].input_action !== false && typeof(BigBlock.Sprites[i].input_action) == 'function') {
var x = BigBlock.Sprites[i].x;
var y = BigBlock.Sprites[i].y;
var dm = BigBlock.Grid.pix_dim;
if (BigBlock.ptInsideRect(evt_x, evt_y, x, (x + dm), y, (y + dm))) {
BigBlock.Sprites[i].input_action(event);
ia_check = true;
}
}
}
if (typeof(BigBlock.TapTimeout) != 'undefined') {
BigBlock.TapTimeout.stop();
BigBlock.TapTimeout.start();
}
if (ia_check === true) { // if triggering an input_action on an active sprite, do not advance the frame
return false;
}
BigBlock.ScreenEvent.frameAdvance(event, event.clientX, event.clientY);
if (typeof(BigBlock.InputFeedback) != 'undefined' && BigBlock.Timer.input_feedback === true) {
BigBlock.InputFeedback.display(event.clientX, event.clientY);
}
BigBlock.ScreenEvent.event_start = new Date().getTime(); // mark the end of the event
}
};
}
// MOUSEMOVE
if (typeof(params.mousemove) != 'undefined') {
this.mousemove_event = params.mousemove;
} else {
this.mousemove_event = function(event){
if (BigBlock.inputBlock === true) { // check to block user input
return false;
}
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
};
}
// MOUSEDOWN
if (typeof(params.mousedown) != 'undefined') {
this.mousedown_event = params.mousedown;
} else {
this.mousedown_event = function(event){
if (BigBlock.inputBlock === true) { // check to block user input
return false;
}
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
};
}
// TOUCH START
if (typeof(params.touchstart) != 'undefined') {
this.touch_event_start = params.touchstart;
} else {
this.touch_event_start = function(event){
if (BigBlock.inputBlock === true) { // check to block user input
return false;
}
BigBlock.ScreenEvent.event_end = new Date().getTime(); // time now
BigBlock.ScreenEvent.event_time = BigBlock.ScreenEvent.event_end - BigBlock.ScreenEvent.event_start; // calculate how long bw last event in milliseconds
//
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
this.touch = event.touches[0];
document.removeEventListener('click', BigBlock.ScreenEvent.click_event, false);
if (BigBlock.ScreenEvent.event_time > BigBlock.ScreenEvent.event_buffer) {
if (typeof(BigBlock.GridActive) != 'undefined') {
var evt_x = this.touch.clientX - BigBlock.GridActive.x;
var evt_y = this.touch.clientY - BigBlock.GridActive.y;
}
var ia_check = false;
for (var i = 0; i < BigBlock.Sprites.length; i++) { // check to fire any active sprite events
if (BigBlock.Sprites[i].input_action !== false && typeof(BigBlock.Sprites[i].input_action) == 'function') {
var x = BigBlock.Sprites[i].x;
var y = BigBlock.Sprites[i].y;
var dm = BigBlock.Grid.pix_dim;
if (BigBlock.ptInsideRect(evt_x, evt_y, x, (x + dm), y, (y + dm))) {
BigBlock.Sprites[i].input_action(event);
}
}
}
if (typeof(BigBlock.TapTimeout) != 'undefined') {
BigBlock.TapTimeout.stop();
BigBlock.TapTimeout.start();
}
if (ia_check === true) { // if triggering an input_action on an active sprite, do not advance the frame
return false;
}
BigBlock.ScreenEvent.frameAdvance(event, this.touch.clientX, this.touch.clientY);
if (typeof(BigBlock.InputFeedback) != 'undefined' && BigBlock.Timer.input_feedback === true) {
BigBlock.InputFeedback.display(this.touch.clientX, this.touch.clientY);
}
BigBlock.ScreenEvent.event_start = new Date().getTime(); // mark the end of the event
}
};
}
// TOUCH MOVE
if (typeof(params.touchmove) != 'undefined') {
this.touch_event_move = params.touchmove;
} else {
this.touch_event_move = function(event){
if (BigBlock.inputBlock === true) { // check to block user input
return false;
}
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
};
}
// TOUCH END
if (typeof(params.touchend) != 'undefined') {
this.touch_event_end = params.touchend;
} else {
this.touch_event_end = function(event){
if (BigBlock.inputBlock === true) { // check to block user input
return false;
}
if (event.preventDefault) {
event.preventDefault();
} else {
event.returnValue = false;
}
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
};
}
//
if (typeof(params.frameAdvance) != 'undefined') {
this.frameAdvance = params.frameAdvance; // manages scene frames
} else {
this.frameAdvance = function (event, x, y) {
if (BigBlock.inputBlock === true) { // check to block user input
return false;
}
if (typeof(event.touches) != 'undefined') {
var touch = event.touches[0];
}
switch (BigBlock.curentFrame) {
case 1:
if (typeof(BigBlock.TapTimeout) != 'undefined') {
BigBlock.TapTimeout.die();
}
break;
}
};
}
if (typeof(params.inputFeedback) != 'undefined') {
this.inputFeedback = params.inputFeedback; // manages event input feedback
}
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
}
};
})();
/**
* Sprite
* A generic object that carries core sprite properties. All sprites appearing in a scene should inherit from the Sprite object.
*
* IMPORTANT: Advanced Sprites should not carry input_actions; if they do, only the top left block of the sprite will trigger the action.
*
* @author Vince Allen 12-05-2009
*/
BigBlock.Sprite = (function () {
function goToFrame (arg, anim_frame, anim) {
try {
if (typeof(arg) == 'undefined') {
throw new Error('Err: SGTF001');
}
if (typeof(anim_frame) == 'undefined') {
throw new Error('Err: SGTF002');
}
if (typeof(anim) == 'undefined') {
throw new Error('Err: SGTF003');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
switch (typeof(arg)) {
case 'number':
try {
if (arg - 1 < 0 || arg - 1 >= anim.length) {
throw new Error('Err: SGTF004');
}
} catch(er) {
BigBlock.Log.display(er.name + ': ' + er.message);
}
return arg-1;
case 'string':
switch (arg) {
case 'nextFrame':
return anim_frame++;
case 'lastFrame':
return anim_frame--;
default: // search for index of frame label
var a = getFrameIndexByLabel(arg, anim);
return a;
}
break;
}
}
function getFrameIndexByLabel (arg, anim) {
try {
if (typeof(arg) == 'undefined') {
throw new Error('Err: SGFIBL001');
}
if (typeof(anim) == 'undefined') {
throw new Error('Err: SGFIBL002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
var error = 0;
for (var i in anim) {
if (anim.hasOwnProperty(i)) {
if (arg == anim[i].frm.label) {
return i;
}
error++;
}
}
try {
if (error !== 0) {
throw new Error('Err: SGFIBL003');
}
} catch(er) {
BigBlock.Log.display(er.name + ': ' + er.message);
}
}
return {
configure: function(){
this.alias = 'Sprite';
this.x = 1;
this.y = 1;
this.state = 'start';
this.pix_index = BigBlock.getPixIndex(this.x, this.y); // get new pixel index to render; depends on this.x, this.y;
this.render = -1; // set to positive number to eventually not render this object; value decrements in render()
this.clock = 0;
this.index = BigBlock.Sprites.length; // the position of this object in the Sprite array
this.angle = Math.degreesToRadians(0);
this.vel = 0;
this.step = 0;
this.life = 0; // 0 = forever
this.className = 'white'; // color
this.color_index = this.className + '0';
this.color_max = 0;
this.pulse_rate = 10; // controls the pulse speed
this.anim_frame = 0;
this.anim_frame_duration = 0;
this.anim_loop = 1;
this.anim_state = 'stop';
this.afterDie = null;
/*
* STATIC SPRITES
* if sprite never moves, set = 1 to prevents unneccessary cleanup and increase performance
* to kill the sprite, first set = 0, then call die()
*
*/
this.render_static = false;
//
this.action = function () {};
this.input_action = false; // called by the mouseup and touchstart methods of ScreenEvent; use for links on Words or to trigger actions on Simple Sprites; do not use on Advanced Sprites
},
getAnim : function (color_index) {
return [
{'frm':
{
'duration' : 1,
'pix' : [
{'c':color_index,'i':0}
]
}
}
];
},
getPix : function (anim) {
var a = anim[0];
if (typeof(a.frm.pix[0]) != 'undefined') {
a.frm.pix[0].c = this.color_index; // change to this.color_index
}
return a.frm;
},
run : function () {
switch (this.state) {
case 'stop':
break;
case 'start':
this.state = 'run';
break;
case 'run':
this.action.call(this);
break;
}
if (this.x >= 0 && this.x < BigBlock.Grid.width && this.y >= 0 && this.y < BigBlock.Grid.height) {
this.pix_index = BigBlock.getPixIndex(this.x, this.y); // get new pixel index to render
} else {
this.pix_index = false;
}
this.img = this.getPix(this.anim, this.color_index); // get pixels
if (this.life !== 0) {
var p = this.clock / this.life;
this.color_index = this.className + Math.round(this.color_max * p); // life adjusts color
} else {
if (this.pulse_rate !== 0) {
this.color_index = this.className + (this.color_max - Math.round(this.color_max * (Math.abs(Math.cos(this.clock / this.pulse_rate))))); // will pulse thru the available colors in the class; pulse_rate controls the pulse speed
} else {
this.color_index = this.className + '0';
}
}
if (this.clock++ >= this.life && this.life !== 0) {
BigBlock.Timer.killObject(this);
} else {
this.clock++; // increment lifecycle clock
}
},
start : function () {
this.state = 'start';
},
stop : function () {
this.state = 'stop';
},
die : function (callback) {
if (typeof(callback) == 'function') { this.afterDie = callback; }
BigBlock.Timer.killObject(this);
},
goToFrame : function (arg, anim_frame, anim) {
return goToFrame(arg, anim_frame, anim);
}
};
})();
/**
* Advanced Sprite object
* An extension of the simple Sprite object. Supports animation and multi-color.
* Anim is passed via Sprite.anim() as a json object. Colors are set in anim json.
*
* IMPORTANT: Advanced Sprites should not carry input_actions; if they do, only the top left block of the sprite will trigger the action.
*
* @author Vince Allen 01-16-2009
*/
BigBlock.SpriteAdvanced = (function () {
return {
create: function (params) {
var sprite = BigBlock.clone(BigBlock.Sprite); // CLONE Sprite
sprite.configure(); // run configure() to inherit Sprite properties
sprite.anim = [ // will provide a single pixel if no anim param is supplied
{'frm':
{
'duration' : 1,
'pix' : [
{'c':'white0','i':0}
]
}
}
]; // get blank anim
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
sprite[i] = params[i];
}
}
}
var palette = BigBlock.Color.getPalette(); // Color
for (i = 0; i < palette.classes.length; i++) { // get length of color palette for this className
if (palette.classes[i].name == sprite.className) {
sprite.color_max = palette.classes[i].val.length-1;
break;
}
}
sprite.getPix = function (anim) { // overwrite the getPix function
try {
if (typeof(anim) == 'undefined') {
throw new Error('Err: SAGP001');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
switch (this.anim_state) {
case 'stop':
if (typeof(anim[this.anim_frame]) == 'undefined') {
this.anim_frame = 0;
}
var a = anim[this.anim_frame];
if (this.anim_frame_duration === 0) {
a = anim[this.anim_frame];
if (typeof(a.frm.enterFrame) == 'function') {
a.frm.enterFrame.call(this);
}
}
this.anim_frame_duration++;
break;
case 'play':
if (typeof(anim[this.anim_frame]) == 'undefined') {
this.anim_frame = 0;
}
a = anim[this.anim_frame];
var duration = a.frm.duration; // get this frame's duration
if (this.anim_frame_duration < duration) { // check if the frame's current duration is less than the total duration
if (this.anim_frame_duration === 0) { // if this
a = anim[this.anim_frame];
if (typeof(a.frm.enterFrame) == 'function') {
a.frm.enterFrame.call(this);
} // call enter frame
}
this.anim_frame_duration++; // if yes, increment
} else { // if no, call exitFrame() and advance frame
a = anim[this.anim_frame];
if (typeof(a.frm.exitFrame) == 'function') {
a.frm.exitFrame.call(this);
} // call exit frame
this.anim_frame_duration = 0;
this.anim_frame++;
if (typeof(anim[this.anim_frame]) == 'undefined') { // if anim is complete
if (this.anim_loop == 1) { // if anim should loop, reset anim_frame
this.anim_frame = 0;
} else { // if anim does NOT loop, send back an empty frame, kill object
a = {'frm':
{
'duration' : 1,
'pix' : []
}
};
this.die(this);
return a;
}
}
a = anim[this.anim_frame];
}
break;
}
// always return frm regardless of state
if (typeof(a) != 'undefined') {
return a.frm;
}
};
sprite.start = function () {
this.anim_state = 'start';
};
sprite.stop = function () {
this.anim_state = 'stop';
};
sprite.goToAndPlay = function (arg) {
try {
if (typeof(arg) == 'undefined') {
throw new Error('Err: SAGTAP001');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
this.anim_frame = this.goToFrame(arg, this.anim_frame, this.anim);
this.anim_state = 'play';
};
sprite.goToAndStop = function (arg) {
try {
if (typeof(arg) == 'undefined') {
throw new Error('Err: SAGTAS001');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
this.anim_frame = this.goToFrame(arg, this.anim_frame, this.anim);
if (typeof(arg) == 'number') {
this.anim_frame_duration = 0;
}
this.anim_state = 'stop';
};
BigBlock.Sprites[BigBlock.Sprites.length] = sprite;
}
};
})();
/**
* Simple Sprite object
* A single pixel object w no animation.
*
*
* @author Vince Allen 01-16-2009
*/
BigBlock.SpriteSimple = (function () {
return {
create: function (params) {
var sprite = BigBlock.clone(BigBlock.Sprite); // CLONE Sprite
sprite.configure(); // run configure() to inherit Sprite properties
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
sprite[i] = params[i];
}
}
}
var palette = BigBlock.Color.getPalette(); // Color
for (i = 0; i < palette.classes.length; i++) { // get length of color palette for this className
if (palette.classes[i].name == sprite.className) {
sprite.color_max = palette.classes[i].val.length-1;
break;
}
}
sprite.color_index = sprite.className + '0'; // overwrite color_index w passed className
sprite.anim = sprite.getAnim(sprite.color_index); // get new anim w overwritten color_index
BigBlock.Sprites[BigBlock.Sprites.length] = sprite;
}
};
})();
/**
* Tap Timeout object
* Use to trigger a visual cue after a specified time interval.
*
* @author Vince Allen 05-29-2010
*/
BigBlock.TapTimeout = (function () {
return {
timeout_length : 3000,
timeout_obj : false,
arrow_direction : 'up',
x : BigBlock.Grid.width/2 - (BigBlock.Grid.pix_dim),
y : BigBlock.Grid.height - (BigBlock.Grid.pix_dim * 2),
className : 'grey',
font : 'bigblock_bold',
glass : false,
start: function (params) {
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
this[i] = params[i];
}
}
}
this.timeout_obj = setTimeout(function () {
BigBlock.TapTimeout.display();
}, this.timeout_length);
},
display : function () {
BigBlock.WordSimple.create({
word_id : 'tap_timeout_word_tap',
x : this.x,
y : this.y,
value : "tap",
className : this.className,
font : this.font,
glass : this.glass
});
switch (this.arrow_direction) {
case 'left':
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x - (BigBlock.Grid.pix_dim * 1),
y : this.y,
value : "arrow_left",
className : this.className,
font : this.font,
glass : this.glass
});
break;
case 'right':
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x + (BigBlock.Grid.pix_dim * 2),
y : this.y,
value : "arrow_right",
className : this.className,
font : this.font,
glass : this.glass
});
break;
case 'down':
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x,
y : this.y + (BigBlock.Grid.pix_dim * 2),
value : "arrow_down",
className : this.className,
font : this.font,
glass : this.glass
});
break;
default:
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x + BigBlock.Grid.pix_dim,
y : this.y - (BigBlock.Grid.pix_dim * 1),
value : "arrow_up",
className : this.className,
font : this.font,
glass : this.glass
});
break;
}
},
stop : function () {
clearTimeout(this.timeout_obj);
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_word_tap')]) != 'undefined') {
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_word_tap')].remove) != 'undefined') {
BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_word_tap')].remove();
}
}
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_arrow')]) != 'undefined') {
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_arrow')].remove) != 'undefined') {
BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_arrow')].remove();
}
}
},
setProps : function (params) {
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
this[i] = params[i];
}
}
}
},
die : function () {
this.stop();
delete BigBlock.TapTimeout;
}
};
})();
/**
* Tap Timeout object
* Use to trigger a visual cue after a specified time interval.
*
* @author Vince Allen 05-29-2010
*/
BigBlock.TapTimeout = (function () {
return {
timeout_length : 3000,
timeout_obj : false,
arrow_direction : 'up',
x : BigBlock.Grid.width/2 - (BigBlock.Grid.pix_dim),
y : BigBlock.Grid.height - (BigBlock.Grid.pix_dim * 2),
className : 'grey',
font : 'bigblock_bold',
glass : false,
start: function (params) {
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
this[i] = params[i];
}
}
}
this.timeout_obj = setTimeout(function () {
BigBlock.TapTimeout.display();
}, this.timeout_length);
},
display : function () {
BigBlock.WordSimple.create({
word_id : 'tap_timeout_word_tap',
x : this.x,
y : this.y,
value : "tap",
className : this.className,
font : this.font,
glass : this.glass
});
switch (this.arrow_direction) {
case 'left':
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x - (BigBlock.Grid.pix_dim * 1),
y : this.y,
value : "arrow_left",
className : this.className,
font : this.font,
glass : this.glass
});
break;
case 'right':
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x + (BigBlock.Grid.pix_dim * 2),
y : this.y,
value : "arrow_right",
className : this.className,
font : this.font,
glass : this.glass
});
break;
case 'down':
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x,
y : this.y + (BigBlock.Grid.pix_dim * 2),
value : "arrow_down",
className : this.className,
font : this.font,
glass : this.glass
});
break;
default:
BigBlock.WordSimple.create({
word_id : 'tap_timeout_arrow',
x : this.x + BigBlock.Grid.pix_dim,
y : this.y - (BigBlock.Grid.pix_dim * 1),
value : "arrow_up",
className : this.className,
font : this.font,
glass : this.glass
});
break;
}
},
stop : function () {
clearTimeout(this.timeout_obj);
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_word_tap')]) != 'undefined') {
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_word_tap')].remove) != 'undefined') {
BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_word_tap')].remove();
}
}
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_arrow')]) != 'undefined') {
if (typeof(BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_arrow')].remove) != 'undefined') {
BigBlock.Sprites[BigBlock.getObjIdByWordId('tap_timeout_arrow')].remove();
}
}
},
setProps : function (params) {
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
this[i] = params[i];
}
}
}
},
die : function () {
this.stop();
delete BigBlock.TapTimeout;
}
};
})();
/**
* UTILTY FUNCTIONS
*
* @author Vince Allen 12-05-2009
*/
/*global checkHasDupes : true, killObject : true, killAllObjects : true, Sprites : true, Grid */
Math.degreesToRadians = function (degrees) {
return (Math.PI / 180.0) * degrees;
};
Math.radiansToDegrees = function (radians) {
return (180.0 / Math.PI) * radians;
};
Math.getRamdomNumber = function (floor, ceiling) {
return Math.floor(Math.random()*(ceiling+1)) + floor;
};
Math.getDistanceBwTwoPts = function (x1, y1, x2, y2) {
d = Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2));
return d;
};
BigBlock.clone = function(object) {
function F() {}
F.prototype = object;
return new F;
};
BigBlock.getPixIndex = function (x,y) {
// uses BigBlock.Grid.width/2; = quad width
// uses BigBlock.Grid.height/2; = quad height
// uses Math.round((BigBlock.Grid.width/2)/BigBlock.Grid.pix_dim; = total quad grid columns
if (x >= BigBlock.Grid.width/2) {
x -= BigBlock.Grid.width/2;
}
if (y >= BigBlock.Grid.height/2) {
y -= BigBlock.Grid.height/2;
}
if (BigBlock.Grid.pix_dim !== 0) {
var target_x = Math.floor(x / BigBlock.Grid.pix_dim);
var target_y = Math.floor(y / BigBlock.Grid.pix_dim);
return target_x + (Math.round((BigBlock.Grid.width/2)/BigBlock.Grid.pix_dim) * target_y);
} else {
return 1;
}
};
/**
* Returns the global x,y coordinate of a block based on its Sprite's pix_index
* @param type
* @param pix_index
*
*/
BigBlock.getPixLoc = function (type, val, pix_index_offset) {
// uses Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim); = total global grid columns
var loc;
if (type == 'x') {
pix_index_offset = pix_index_offset % Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim);
loc = val + (pix_index_offset * BigBlock.Grid.pix_dim);
}
if (type == 'y') {
var offset_y;
if (pix_index_offset > 0) {
offset_y = Math.floor(pix_index_offset / Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim));
} else {
offset_y = Math.ceil(pix_index_offset / Math.round(BigBlock.Grid.width/BigBlock.Grid.pix_dim));
}
loc = val + (offset_y * BigBlock.Grid.pix_dim);
}
return loc;
};
BigBlock.getObjIdByAlias = function (alias) {
var id = false;
for (var i = 0; i < BigBlock.Sprites.length; i++) {
if (BigBlock.Sprites[i].alias == alias) {
id = i;
return id;
}
}
return id;
};
BigBlock.getObjIdByWordId = function (word_id) {
var id = false;
for (var i = 0; i < BigBlock.Sprites.length; i++) {
if (BigBlock.Sprites[i].word_id == word_id) {
id = i;
return id;
}
}
return id;
};
BigBlock.Log = (function(){
return {
display: function(str) {
try {
if (typeof(console) != 'undefined') {
console.log(str); // output error to console
} else if (typeof(opera) != 'undefined' && typeof(opera.wiiremote) != 'undefined') { // wii uses alerts
alert(str);
} else if (typeof(opera) != 'undefined') { // opera uses error console
opera.postError(str);
}
} catch(e) {
// do nothing
}
}
};
})();
BigBlock.getUniqueId = function () {
var dateObj = new Date();
return dateObj.getTime() + Math.getRamdomNumber(0,1000);
};
BigBlock.removeStatic = function (alias, callback) {
/*
* remove static sprites from Static Grid.
* requires alias; callback is optional
*/
try {
if (typeof(alias) == 'undefined') {
throw new Error('URS001');
}
if (typeof(alias) != 'string') {
throw new Error('URS002');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
for (var i = 0; i < BigBlock.GridStatic.quads.length; i++) {
var gs = document.getElementById(BigBlock.GridStatic.quads[i].id);
if (gs.hasChildNodes()) {
var nodes = gs.childNodes; // get a collection of all children in BigBlock.GridText.id;
var tmp = [];
// DOM collections are live; iterating over a static array is faster than iterating over a live DOM collection
for( var x = 0; x < nodes.length; x++ ) { // make copy of DOM collection
tmp[tmp.length] = nodes[x];
}
for (var j = 0; j < tmp.length; j++) { // loop thru children
if (alias == tmp[j].getAttribute('name')) {
gs.removeChild(tmp[j]);
}
}
tmp = null;
}
}
if (typeof(callback) == 'function') {
callback();
}
};
/**
* Returns true if point is inside rect.
*
* @param {Number} pt_x
* @param {Number} pt_y
* @param {Number} rect_x1
* @param {Number} rect_x2
* @param {Number} rect_y1
* @param {Number} rect_y2
*/
BigBlock.ptInsideRect = function (pt_x, pt_y, rect_x1, rect_x2, rect_y1, rect_y2) {
if (pt_x > rect_x1 && pt_x < rect_x2 && pt_y > rect_y1 && pt_y < rect_y2) {
return true;
}
return false
};
/**
* Returns the style sheet element by type.
* @param {String} type
*/
BigBlock.getBigBlockCSS = function (id) {
var c = document.styleSheets;
for (i=0; i<c.length; i++) {
if (c[i].cssRules) { // Mozilla
var rules = c[i].cssRules;
for (x=0; x<rules.length; x++) {
if (rules[x].selectorText == id) {
return c[i];
}
}
} else if (c[i].rules) { // IE
var rules = c[i].rules;
for (x=0; x<rules.length; x++) {
if (rules[x].selectorText == id) {
return c[i];
}
}
}
}
return false;
}
/**
* Returns the current window width and height in json format.
*/
BigBlock.getWindowDim = function () {
var d = {
'width' : false,
'height' : false
};
if (typeof(window.innerWidth) != 'undefined') {
d.width = window.innerWidth;
} else if (typeof(document.documentElement) != 'undefined' && typeof(document.documentElement.clientWidth) != 'undefined') {
d.width = document.documentElement.clientWidth;
} else if (typeof(document.body) != 'undefined') {
d.width = document.body.clientWidth;
}
if (typeof(window.innerHeight) != 'undefined') {
d.height = window.innerHeight;
} else if (typeof(document.documentElement) != 'undefined' && typeof(document.documentElement.clientHeight) != 'undefined') {
d.height = document.documentElement.clientHeight;
} else if (typeof(document.body) != 'undefined') {
d.height = document.body.clientHeight;
}
return d;
}
BigBlock.inArray = function (needle, haystack) {
var check = false;
for (var i = 0; i < haystack.length; i++) {
if (typeof(needle) == typeof(haystack[i]) && needle == haystack) {
check = true;
}
}
return check;
};
//
BigBlock.checkHasDupes = function (A) {
var i, j, n;
var objs = [];
n=A.pix.length;
for (i = 0; i < n; i++) { // outer loop uses each item i at 0 through n
for (j = i + 1; j < n; j++) { // inner loop only compares items j at i+1 to n
if (A.pix.i.i == A.pix.j.i) {
objs = [A.pix.i, A.pix.j];
return objs;
}
}
}
return false;
};
/**
* Word
* A generic object that carries core word properties. All words appearing in a scene should inherit from the Word object.
*
* @author Vince Allen 05-11-2010
*/
BigBlock.Word = (function () {
return {
configure: function(){
this.alias = 'Word';
this.word_id = 'word1';
this.x = BigBlock.Grid.width/2;
this.y = BigBlock.Grid.height/2;
this.state = 'run';
this.value = 'BIG BLOCK'; // the default character to render
this.url = false;
this.link_color = false;
this.center = false; // set = true to center text
this.className = 'white'; // color
this.afterDie = null;
this.render = 0;
this.render_static = true;
this.index = BigBlock.Sprites.length; // the position of this object in the Sprite array
},
die : function (callback) { // use remove() to kill Words; !! need to change back to using this function
},
remove : function (callback) { // removes div from dom; the corresponding character objects have already been removed from the Sprites array
var word_id = this.word_id;
var quads = BigBlock.GridText.quads;
for (var i = 0; i < quads.length; i++) {
var q = document.getElementById(quads[i].id);
if (q.hasChildNodes()) {
var nodes = q.childNodes; // get a collection of all children in BigBlock.GridText.id;
var tmp = [];
// DOM collections are live; iterating over a static array is faster than iterating over a live DOM collection
for( var x = 0; x < nodes.length; x++ ) { // make copy of DOM collection
tmp[tmp.length] = nodes[x];
}
for (var j = 0; j < tmp.length; j++) { // loop thru children
var id = tmp[j].getAttribute('name');
if (id == word_id) {
q.removeChild(tmp[j]);
}
}
}
}
if (typeof(callback) == 'function') { this.afterDie = callback; }
// remove the word
this.render_static = false;
BigBlock.Timer.killObject(this);
// remove the click target divs
// these are Sprites in the GridActive
for (i = 0; i < BigBlock.Sprites.length; i++) {
if (BigBlock.Sprites[i].word_id == word_id) {
BigBlock.Timer.killObject(BigBlock.Sprites[i]);
}
}
}
};
})();
/**
* Simple Word object
* Loops thru passed word and creates characters.
* All words on on the same horizontal line.
*
* @author Vince Allen 05-11-2010
*/
BigBlock.WordSimple = (function () {
return {
create: function (params) {
var obj = BigBlock.clone(BigBlock.Word); // CLONE Word
obj.configure(); // run configure() to inherit Word properties
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var j in params) {
if (params.hasOwnProperty(j)) {
obj[j] = params[j];
}
}
}
var palette = BigBlock.Color.getPalette(); // Color
for (var i = 0; i < palette.classes.length; i++) { // get length of color palette for this className
if (palette.classes[i].name == obj.className) {
obj.color_max = palette.classes[i].val.length-1;
break;
}
}
// check to center text
if (obj.center) {
var word_width = obj.value.length * BigBlock.Grid.pix_dim;
obj.x = BigBlock.Grid.width/2 - word_width/2;
}
/* IMPORTANT:
* Need to keep word in Sprites array so we have a reference to its characters when we need to remove them.
*/
BigBlock.Sprites[BigBlock.Sprites.length] = obj;
try {
if (typeof(BigBlock.CharPresets.getChar) == 'undefined') {
throw new Error('Err: WSC001');
} else {
if (BigBlock.CharPresets.getChar(obj.value)) { // if the value of this word matches a preset in the character library, use a predefined character like 'arrow_up'
BigBlock.CharSimple.create({
word_id : obj.word_id, // pass the word id to the characters
value: obj.value,
x : obj.x,
y : obj.y,
className : obj.className,
url : obj.url,
link_color : obj.link_color,
font : obj.font,
glass : obj.glass
});
if (obj.url !== false) {
BigBlock.SpriteSimple.create({
x : obj.x + (i * BigBlock.Grid.pix_dim),
y : obj.y,
className : false,
input_action : function (event) {
if (typeof(obj.url) == 'function') {
obj.url(event);
} else if (typeof(obj.url) == 'string') {
window.open(obj.url, '');
}
}
});
}
} else {
var s = new String(obj.value); // convert Literal (obj.value) into Object; faster than iterating over the Literal
for (i=0;i<s.length;i++) { // use a standard for loop to iterate over a string; Opera does not like using for..in
BigBlock.CharSimple.create({
word_id : obj.word_id, // pass the word id to the characters
value: s.substr(i,1),
x : obj.x + (i * BigBlock.Grid.pix_dim),
y : obj.y,
className : obj.className,
url : obj.url,
link_color : obj.link_color,
font : obj.font,
glass : obj.glass
});
if (obj.url !== false) {
BigBlock.SpriteSimple.create({
word_id : obj.word_id,
x : obj.x + (i * BigBlock.Grid.pix_dim),
y : obj.y,
className : false,
input_action : function (event) {
if (typeof(obj.url) == 'function') {
obj.url(event);
} else if (typeof(obj.url) == 'string') {
window.open(obj.url, '');
}
}
});
}
}
}
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
}
};
})();
/**
* Timer object
* Sets up a render loop based on the Javascript timer object.
*
* @author Vince Allen 12-05-2009
*/
BigBlock.Timer = (function () {
var build_start = new Date().getTime();
function getBuildStart () {
return build_start;
}
return {
// public defaults
report_fr : false,
fr_rate_test_interval : 100,
run_interval : '',
alias : "Timer",
frame_rate : 33, // set the frame rate in milliseconds
start : new Date().getTime(),
end : new Date().getTime(),
time : 0,
clock : 0,
errors : [],
build_start : new Date().getTime(),
sprites_to_kill : [],
tap_timeout : true,
tap_timeout_params : false,
input_feedback : true,
input_feedback_grad : false,
grid_active_styles : false,
grid_static_styles : false,
grid_text_styles : false,
document_body_style : {
backgroundColor : '#333'
},
app_header : false,
app_header_styles : {
},
app_footer : false,
app_footer_styles : {
},
before_play : false,
play : function(params) { // called after all objects are ready
// Timer
if (typeof(params) != 'undefined') { // loop thru passed params to override above defaults
for (var i in params) {
if (params.hasOwnProperty(i)) {
this[i] = params[i];
}
}
}
// <body>
var b = document.getElementsByTagName('body').item(0);
for (var key in this.document_body_style) { // loop thru styles and apply to <body>
if (this.document_body_style.hasOwnProperty(key)) {
b.style[key] = this.document_body_style[key];
}
}
// CORE STYLES
var el = document.createElement('style'); // add core style sheet
el.setAttribute('type', 'text/css');
var h = document.getElementsByTagName('head').item(0);
h.appendChild(el);
var s = document.styleSheets[document.styleSheets.length - 1];
if (s.insertRule) { // Mozilla
s.insertRule(BigBlock.CSSid_core+"{}", 0);
} else if (s.addRule) { // IE
s.addRule(BigBlock.CSSid_core, "display : block;");
}
var css = {
'body' : 'margin: 0;padding: 0;background-color:#ccc;',
'div.color' : 'background-color : transparent;',
'div.pix' : 'float:left;width:' + BigBlock.Grid.pix_dim + 'px;height:' + BigBlock.Grid.pix_dim + 'px;position:absolute;line-height:0px;font-size:1%;'
};
try {
if (s.insertRule) { // Mozilla
for (var i in css) {
if (css.hasOwnProperty(i)) {
s.insertRule(i + " {" + css[i] + "}", 0);
}
}
} else if (s.addRule) { // IE
for (var i in css) {
if (css.hasOwnProperty(i)) {
s.addRule(i, css[i], 0);
}
}
} else {
throw new Error('Err: TP001');
}
} catch(e) {
BigBlock.Log.display(e.name + ': ' + e.message);
}
/**
* Create GridInit
*
* The GridInit is added to the DOM before other Grids. It will trigger any scrollbars if app
* is viewed in a frame (Facebook). Subsequent Grids will calculate width and height accurately.
*/
BigBlock.GridInit = BigBlock.clone(BigBlock.Grid); // CLONE Grid
BigBlock.GridInit.configure({
'quads': [
{'id' : 'qI_tl', 'left' : BigBlock.Grid.width/2, 'top' : BigBlock.Grid.height/2, 'zIndex' : -100},
{'id' : 'qI_tr', 'left' : 0, 'top' : BigBlock.Grid.height/2, 'zIndex' : -100},
{'id' : 'qI_bl', 'left' : BigBlock.Grid.width/2, 'top' : 0, 'zIndex' : -100},
{'id' : 'qI_br', 'left' : 0, 'top' : 0, 'zIndex' : -100}
]
});
// Create GridActive
BigBlock.GridActive = BigBlock.clone(BigBlock.Grid); // CLONE Grid
/*
* IE Divs will not detect mouse up if there's no background color or image.
* However, image reference does NOT need to be valid. IE just needs to think there's an image.
*
*/
var qA_styles;
if (document.attachEvent) { // IE
qA_styles = {
backgroundImage : "url('trans.gif')" // this do not need to be a valid reference
}
} else {
qA_styles = this.grid_active_styles;
}
BigBlock.GridActive.configure({
'quads': [
{'id' : 'qA_tl', 'left' : BigBlock.Grid.width/2, 'top' : BigBlock.Grid.height/2, 'zIndex' : 10},
{'id' : 'qA_tr', 'left' : 0, 'top' : BigBlock.Grid.height/2, 'zIndex' : 10},
{'id' : 'qA_bl', 'left' : BigBlock.Grid.width/2, 'top' : 0, 'zIndex' : 10},
{'id' : 'qA_br', 'left' : 0, 'top' : 0, 'zIndex' : 10}
],
'styles' : qA_styles
});
// Create GridStatic
BigBlock.GridStatic = BigBlock.clone(BigBlock.Grid); // CLONE Grid
BigBlock.GridStatic.configure({
'quads': [
{'id' : 'qS_tl', 'left' : BigBlock.Grid.width/2, 'top' : BigBlock.Grid.height/2, 'zIndex' : -10},
{'id' : 'qS_tr', 'left' : 0, 'top' : BigBlock.Grid.height/2, 'zIndex' : -10},
{'id' : 'qS_bl', 'left' : BigBlock.Grid.width/2, 'top' : 0, 'zIndex' : -10},
{'id' : 'qS_br', 'left' : 0, 'top' : 0, 'zIndex' : -10}
],
'styles' : this.grid_static_styles
});
// Create GridText
BigBlock.GridText = BigBlock.clone(BigBlock.Grid); // CLONE Grid
BigBlock.GridText.configure({
'quads': [
{'id' : 'qT_tl', 'left' : BigBlock.Grid.width/2, 'top' : BigBlock.Grid.height/2, 'zIndex' : 1},
{'id' : 'qT_tr', 'left' : 0, 'top' : BigBlock.Grid.height/2, 'zIndex' : 1},
{'id' : 'qT_bl', 'left' : BigBlock.Grid.width/2, 'top' : 0, 'zIndex' : 1},
{'id' : 'qT_br', 'left' : 0, 'top' : 0, 'zIndex' : 1}
],
'styles' : this.grid_text_styles
});
// Input Feedback
if (this.input_feedback === true) {
if (this.input_feedback_grad !== false) {
input_feedback = this.input_feedback_grad;
} else {
input_feedback = "rgb(255, 255, 255);rgb(239, 239, 239);rgb(216, 216, 216);rgb(189, 189, 189);rgb(159, 159, 159);rgb(127, 127, 127);rgb(96, 96, 96);rgb(66, 66, 66);rgb(39, 39, 39);rgb(16, 16, 16)";
}
var my_palette = {
'classes': [{
name: 'input_feedback',
val: input_feedback.split(";")
}]
};
BigBlock.Color.add(my_palette);
BigBlock.InputFeedback.configure({
className: 'input_feedback'
});
}
//
this.add_char_loader();
},
add_char_loader : function () {
BigBlock.Loader.add(); // add loader to DOM
BigBlock.Loader.update();
var el = document.createElement('style'); // add color style sheet
el.setAttribute('type', 'text/css');
var h = document.getElementsByTagName('head').item(0);
h.appendChild(el);
var s = document.styleSheets[document.styleSheets.length - 1];
if (s.insertRule) { // Mozilla
s.insertRule(BigBlock.CSSid_char_pos+"{}", 0);
} else if (s.addRule) { // IE
s.addRule(BigBlock.CSSid_char_pos, "display : block;");
}
this.build_char();
},
build_char : function () {
if (BigBlock.GridActive.buildCharStyles()) {
this.add_color_loader();
} else {
var t = setTimeout(this.build_char, 1); // if not finishing building the colors, call again
}
},
add_color_loader : function () {
BigBlock.Loader.add(); // add loader to DOM
BigBlock.Loader.update();
var el = document.createElement('style'); // add color style sheet
el.setAttribute('type', 'text/css');
var h = document.getElementsByTagName('head').item(0);
h.appendChild(el);
var s = document.styleSheets[document.styleSheets.length - 1];
if (s.insertRule) { // Mozilla
s.insertRule(BigBlock.CSSid_color+"{}", 0);
} else if (s.addRule) { // IE
s.addRule(BigBlock.CSSid_color, "display : block;");
}
this.build_color();
},
build_color : function () {
if (BigBlock.Color.build()) {
BigBlock.Timer.add_grid_loader();
} else {
var t = setTimeout(BigBlock.Timer.build_color, 1); // if not finishing building the colors, call again
}
},
add_grid_loader : function () {
BigBlock.Loader.add(); // add loader to DOM
BigBlock.Loader.update();
var el = document.createElement('style'); // add a style sheet node to the head element to hold grid styles
el.setAttribute('type', 'text/css');
var h = document.getElementsByTagName('head').item(0);
h.appendChild(el);
var s = document.styleSheets[document.styleSheets.length - 1];
if (s.insertRule) { // Mozilla
s.insertRule(BigBlock.CSSid_grid_pos+"{}", 0);
} else if (s.addRule) { // IE
s.addRule(BigBlock.CSSid_grid_pos, "display : block;");
}
BigBlock.Timer.build_grid();
},
build_grid : function(){
if (BigBlock.GridActive.build()) {
var b = document.getElementsByTagName('body').item(0);
while (document.getElementById('loader')) {
var l = document.getElementById('loader');
b.removeChild(l);
}
BigBlock.GridInit.add(); // add grid to DOM
BigBlock.GridActive.add(); // add grid to DOM
BigBlock.GridStatic.add(); // add grid_static to DOM
BigBlock.GridText.add(); // add grid_static to DOM
for (var i = 0; i < BigBlock.Sprites.length; i++) { // loop thru Sprites and set state = start
BigBlock.Sprites[i].state = 'start';
}
BigBlock.Log.display(new Date().getTime() - getBuildStart() + 'ms'); // log the build time
delete BigBlock.GridInit.build; // remove GridInit methods
delete BigBlock.GridInit.add;
delete BigBlock.GridActive.build; // remove GridActive methods
delete BigBlock.GridActive.add;
delete BigBlock.GridStatic.add; // remove GridStatic methods
delete BigBlock.GridStatic.build;
delete BigBlock.GridText.add; // remove GridText methods
delete BigBlock.GridText.build;
delete BigBlock.Loader; // remove Loader object
delete BigBlock.Timer.add_color_loader; // remove build methods
delete BigBlock.Timer.build_color;
delete BigBlock.Timer.add_grid_loader;
delete BigBlock.Timer.build_grid;
delete BigBlock.Timer.play;
if (BigBlock.Timer.tap_timeout) {
if (typeof(BigBlock.CharPresets.getChar) != 'function') { // if not already installed
BigBlock.CharPresets = BigBlock.CharPresets.install(); // needed for timeout chars
}
if (typeof(BigBlock.TapTimeout) != 'undefined') {
BigBlock.TapTimeout.start(BigBlock.Timer.tap_timeout_params); // setup tap timeout
}
}
// app_header
if (BigBlock.Timer.app_header !== false) {
var header_x = BigBlock.GridActive.x;
var header_y = BigBlock.GridActive.y;
var header_bgColor;
if (typeof(BigBlock.Timer.app_header_styles.backgroundColor) == 'undefined') {
header_bgColor = BigBlock.Timer.document_body_style.backgroundColor;
} else {
header_bgColor = BigBlock.Timer.app_header_styles.backgroundColor;
}
BigBlock.Header.add(header_x, header_y, header_bgColor);
}
// app_footer
if (BigBlock.Timer.app_footer !== false) {
var footer_x = BigBlock.GridActive.x;
var footer_y = BigBlock.GridActive.y + BigBlock.GridActive.height;
var footer_bgColor;
if (typeof(BigBlock.Timer.app_footer_styles.backgroundColor) == 'undefined') {
footer_bgColor = BigBlock.Timer.document_body_style.backgroundColor;
} else {
footer_bgColor = BigBlock.Timer.app_footer_styles.backgroundColor;
}
BigBlock.Footer.add(footer_x, footer_y, footer_bgColor);
}
// Screen Event
if (typeof(BigBlock.ScreenEvent.alias) == 'undefined') {
BigBlock.ScreenEvent.create({});
}
// add all screen events to GridActive
for (var i = 0; i < BigBlock.GridActive.quads.length; i++) {
var q = document.getElementById(BigBlock.GridActive.quads[i].id);
if (q.addEventListener) { // mozilla
q.addEventListener('mouseup', BigBlock.ScreenEvent.mouseup_event, false); // add mouseup event listener
} else if (q.attachEvent) { // IE
q.attachEvent('onmouseup', BigBlock.ScreenEvent.mouseup_event)
}
if (q.addEventListener) { // mozilla
q.addEventListener('mousemove', BigBlock.ScreenEvent.mousemove_event, false); // add mousemove event listener
} else if (q.attachEvent) { // IE
q.attachEvent('onmousemove', BigBlock.ScreenEvent.mousemove_event)
}
if (q.addEventListener) { // mozilla
q.addEventListener('mousedown', BigBlock.ScreenEvent.mousedown_event, false); // add mouseup event listener
} else if (q.attachEvent) { // IE
q.attachEvent('onmousedown', BigBlock.ScreenEvent.mousedown_event)
}
if (q.addEventListener) { // mozilla
q.addEventListener('touchstart', BigBlock.ScreenEvent.touch_event_start, false); // add touch event listener
} // IE does not have an equivalent event; 07-22-2010
if (q.addEventListener) { // mozilla
q.addEventListener('touchmove', BigBlock.ScreenEvent.touch_event_move, false); // add touch event listener
} // IE does not have an equivalent event; 07-22-2010
if (q.addEventListener) { // mozilla
q.addEventListener('touchend', BigBlock.ScreenEvent.touch_event_end, false); // add touch event listener
} // IE does not have an equivalent event; 07-22-2010
}
// before_play function
if (BigBlock.Timer.before_play !== false) {
if (typeof(BigBlock.Timer.before_play) == 'function') {
BigBlock.Timer.before_play();
}
}
// reveals and positions ittybitty8bit info panel link; override w PHP in the host page
if (typeof(PanelInfoTrigger) != 'undefined') {
if (PanelInfoTrigger.set) {
PanelInfoTrigger.set();
}
}
// reveals and positions Facebook 'Like' button; override w PHP in the host page
if (typeof(BtnLike) != 'undefined') {
if (BtnLike.fb_like) {
setTimeout(function () {
BtnLike.fb_like();
}, 500);
}
}
this.run_interval = setInterval(function () {
BigBlock.Timer.run();
},BigBlock.Timer.frame_rate);
} else {
var t = setTimeout(BigBlock.Timer.build_grid, 1); // if not finishing building the grid, call again
}
},
run : function () {
BigBlock.Timer.start = new Date().getTime(); // mark the beginning of the run
for (var i=0;i<BigBlock.Sprites.length;i++) {
if (typeof(BigBlock.Sprites[i]) == "object" && typeof(BigBlock.Sprites[i].run) == "function" && this.pause == -1) { // check pause value
BigBlock.Sprites[i].run();
}
}
BigBlock.Timer.cleanUpSprites('hello');
this.clock++; // opt
BigBlock.RenderMgr.renderPix(BigBlock.Sprites, BigBlock.Timer.start);
},
cleanUpSprites : function (msg) {
for (var i = 0; i < this.sprites_to_kill.length; i++) { // loop thru Timer.sprites_to_kill and tag Sprites to remove
if (typeof(this.sprites_to_kill[i]) != 'undefined' && typeof(BigBlock.Sprites[this.sprites_to_kill[i]]) != 'undefined') {
BigBlock.Sprites[this.sprites_to_kill[i]].state = 'dead'; // cannot remove sprites here bc indexes will be out of synch
}
}
var reset_index = false;
for (var y = 0; y < BigBlock.Sprites.length; y++) {
if (BigBlock.Sprites[y].state == 'dead') {
if (typeof(BigBlock.Sprites[y].afterDie) == 'function') {
BigBlock.Sprites[y].afterDie(); // call afterDie function
}
BigBlock.Sprites.splice(y, 1); // remove Sprite
reset_index = true;
}
}
if (reset_index) { // only loop thru Sprites to reset index if a Sprite was removed from the array
for (var x = 0; x < BigBlock.Sprites.length; x++) { // loop thru the Sprites and reset their index
BigBlock.Sprites[x].index = x;
}
}
this.sprites_to_kill = [];
},
render : function(){
this.clock++;
BigBlock.RenderMgr.renderPix(BigBlock.Sprites, BigBlock.Timer.start);
this.buffer = setTimeout(function () {
BigBlock.Timer.run();
},this.frame_rate); // call run again
},
pause: -1, // pause value; 1 = paused; -1 = not paused
pauseToggle: function () {
this.pause *= -1;
},
killObject : function (obj) {
if (typeof(obj) != 'undefined') {
if (typeof(BigBlock.Sprites[obj.index]) == "object") {
this.sprites_to_kill[this.sprites_to_kill.length] = obj.index; // copy object to an array; cannot remove object here bc indexes will be out of synch for the remainder of the Run cycle
}
}
}
};
})(); |
'use strict'
/* application libraries */
var db = require('../lib/database.js')
var immutable = require('../lib/immutable')
var jsonParseMulti = require('../lib/json-parse-multi')
var setId = require('../lib/set-id')
var stringifyObject = require('../lib/stringify-object')
/* public functions */
module.exports = immutable.model('Auth', {
createAuth: createAuth,
getAuthByAccountId: getAuthByAccountId,
getAuthByProviderNameAndAccountId: getAuthByProviderNameAndAccountId,
})
/**
* @function createAuth
*
* @param {string} authProviderAccountId - user id of account with auth provider
* @param {object} authProviderData
* @param {string} authProviderName - name of auth provider
* @param {string} accountId - hex id of account
* @param {string} originalAuthId - hex id
* @param {string} parentAuthId - hex id
* @param {object} session - request session
*
* @returns {Promise}
*/
function createAuth (args) {
// build data
var auth = {
authCreateTime: args.session.requestTimestamp,
authProviderAccountId: args.authProviderAccountId,
authProviderData: stringifyObject(args.authProviderData),
authProviderName: args.authProviderName,
accountId: args.accountId,
originalAuthId: args.originalAuthId,
parentAuthId: args.parentAuthId,
}
// get id
setId(auth, 'authId', 'originalAuthId')
// insert
return db('immutable').query(
'INSERT INTO auth VALUES(UNHEX(:authId), UNHEX(:originalAuthId), UNHEX(:parentAuthId), UNHEX(:accountId), :authProviderName, :authProviderAccountId, :authProviderData, :authCreateTime)',
auth,
undefined,
args.session
)
// success
.then(function (res) {
// unpack JSON encoded data
return jsonParseMulti(auth, ['authProviderData'])
})
}
/**
* @function getAuthByAccountId
*
* @param {string} accountId - hex id
*
* @returns {Promise}
*/
function getAuthByAccountId (args) {
// select
return db('immutable').query(
'SELECT HEX(a.authId) AS authId, HEX(a.originalAuthId) AS originalAuthId, HEX(a.parentAuthId) AS parentAuthId, HEX(a.accountId) AS accountId, a.authProviderName, a.authProviderAccountId, a.authProviderData, a.authCreateTime FROM auth a LEFT JOIN auth a2 ON a2.parentAuthId = a.authId WHERE a.accountId = UNHEX(:accountId) AND a2.authId IS NULL',
args,
undefined,
args.session
)
// success
.then(function (res) {
// unpack JSON encoded data
return res.length ? jsonParseMulti(res, ['authProviderData']) : []
})
}
/**
* @function getAuthByProviderNameAndAccountId
*
* @param {string} authProviderName - name of auth provider
* @param {string} authProviderAccountId - user id of account with auth provider
*
* @returns {Promise}
*/
function getAuthByProviderNameAndAccountId (args) {
// select
return db('immutable').query(
'SELECT HEX(a.authId) AS authId, HEX(a.originalAuthId) AS originalAuthId, HEX(a.parentAuthId) AS parentAuthId, HEX(a.accountId) AS accountId, a.authProviderName, a.authProviderAccountId, a.authProviderData, a.authCreateTime FROM auth a LEFT JOIN auth a2 ON a2.parentAuthId = a.authId WHERE a.authProviderName = :authProviderName AND a.authProviderAccountId = :authProviderAccountId AND a2.authId IS NULL',
args,
undefined,
args.session
)
// success
.then(function (res) {
// unpack JSON encoded data
return res.length ? jsonParseMulti(res[0], ['authProviderData']) : undefined
})
} |
'use strict';
var _ = require('lodash');
var NotFoundError = require('../components/errors/notfound.error');
var ForbiddenError = require('../components/errors/forbidden.error');
var nextIfErr = function (req, res, next, successCallback) {
return function (err, result) {
if (err) {
next(err);
} else if (_.isFunction(successCallback)) {
successCallback(result, next, res, req);
}
}
};
exports.nextIfErr = function () {
if (arguments.length === 4) {
return nextIfErr.apply(this, arguments);
} else if (arguments.length === 2) {
return nextIfErr(undefined, undefined, arguments[0], arguments[1]);
} else {
throw new Error('Wrong number of arguments for nextIfErr: ' + arguments.length);
}
};
var notFoundIfEmpty = exports.notFoundIfEmpty = function (foundCallback) {
return function (result, next, res, req) {
if (result && _.isFunction(foundCallback)) {
foundCallback(result, next, res, req);
} else {
next(new NotFoundError());
}
}
};
var forbiddenIfRestricted = exports.forbiddenIfRestricted = function (permittedCallback) {
return function (result, next, res, req) {
if (result.user && String(result.user) === req.user.id) {
permittedCallback(result, next, res, req);
} else {
next(new ForbiddenError());
}
}
};
var resultAsJson = exports.resultAsJson = function (status) {
return function (result, next, res) {
res.status(status || 200).json(result);
}
};
function hasUser(model) {
return !_.isUndefined(model.schema.path('user'));
}
exports.find = function (model) {
return function (req, res, next) {
var filter = hasUser(model) ? {user: req.user.id} : {};
model.find(filter,
nextIfErr(req, res, next,
resultAsJson()));
}
};
exports.findById = function (model) {
return function (req, res, next) {
model.findById(req.params.id,
nextIfErr(req, res, next,
notFoundIfEmpty(
forbiddenIfRestricted(
resultAsJson()))));
}
};
exports.create = function (model) {
return function (req, res, next) {
if (hasUser(model)) {
req.body.user = req.user.id;
}
model.create(req.body,
nextIfErr(req, res, next,
resultAsJson(201)));
};
};
exports.update = function (model) {
return function (req, res, next) {
if (req.body._id) {
delete req.body._id;
}
model.findById(req.params.id,
nextIfErr(req, res, next,
notFoundIfEmpty(
forbiddenIfRestricted(function (result, next, res, req) {
var updated = _.merge(result, req.body);
updated.save(
nextIfErr(req, res, next,
resultAsJson()
));
}))));
};
};
exports.destroy = function (model) {
return function (req, res, next) {
model.findById(req.params.id,
nextIfErr(req, res, next,
notFoundIfEmpty(
forbiddenIfRestricted(function (result, next, res, req) {
result.remove(
nextIfErr(req, res, next,
resultAsJson(204)));
}))));
};
};
|
import React, { Component } from 'react'
import { connect } from 'react-redux'
import Header from '@/components/header'
import { getLogout } from '@/actions'
class AppContainer extends Component {
render () {
const { children, channelTitle, handleLogout } = this.props
return (
<div>
<Header channelTitle={channelTitle} handleLogout={handleLogout} />
{children}
</div>
)
}
}
const mapDispatchToProps = (dispatch) => ({
handleLogout: () => {
dispatch(getLogout())
}
})
const mapStateToProps = (state) => ({
channelTitle: state.video.channelTitle
})
export default connect(mapStateToProps, mapDispatchToProps)(AppContainer)
|
const config = require('./config.json')
module.exports = require('monk')(config.db.database)
|
'use strict';
/*global require, module, Buffer, jsGen*/
/*
*/
var union = jsGen.lib.tools.union,
intersect = jsGen.lib.tools.intersect,
globalConfig = jsGen.lib.json.GlobalConfig,
wrapCallback = jsGen.lib.tools.wrapCallback,
callbackFn = jsGen.lib.tools.callbackFn;
var that = jsGen.dao.db.bind('global', {
getGlobalConfig: function (callback) {
that.findOne({
_id: 'GlobalConfig'
}, {
sort: {
_id: -1
}
}, wrapCallback(callback));
},
setGlobalConfig: function (Obj, callback) {
var setObj = {},
newObj = {
domain: '',
beian: '',
title: '',
url: '',
logo: '',
email: '',
description: '',
metatitle: '',
metadesc: '',
keywords: '',
robots: '',
visitors: 0,
users: 0,
articles: 0,
comments: 0,
onlineNum: 0,
onlineUsers: 0,
maxOnlineNum: 0,
maxOnlineTime: 0,
TimeInterval: 0,
ArticleTagsMax: 0,
UserTagsMax: 0,
TitleMinLen: 0,
TitleMaxLen: 0,
SummaryMaxLen: 0,
ContentMinLen: 0,
ContentMaxLen: 0,
UserNameMinLen: 0,
UserNameMaxLen: 0,
register: true,
emailVerification: true,
UsersScore: [0, 0, 0, 0, 0, 0, 0],
ArticleStatus: [0, 0],
ArticleHots: [0, 0, 0, 0, 0],
userCache: 0,
articleCache: 0,
commentCache: 0,
listCache: 0,
tagCache: 0,
collectionCache: 0,
messageCache: 0,
paginationCache: 0,
smtp: {
host: '',
secureConnection: true,
port: 0,
auth: {
user: '',
pass: ''
},
senderName: '',
senderEmail: ''
},
info: {}
};
intersect(newObj, Obj);
setObj.$set = newObj;
if (callback) {
that.findAndModify({
_id: 'GlobalConfig'
}, [], setObj, {
w: 1,
'new': true
}, wrapCallback(callback));
} else {
that.update({
_id: 'GlobalConfig'
}, setObj);
}
},
initGlobalConfig: function (callback) {
globalConfig.date = Date.now();
that.insert(
globalConfig, {
w: 1
}, wrapCallback(callback));
}
});
module.exports = {
getGlobalConfig: that.getGlobalConfig,
setGlobalConfig: that.setGlobalConfig,
initGlobalConfig: that.initGlobalConfig
}; |
import React from 'react';
import styled from 'styled-components';
import lastFmLogo from './lastfm-logo.png';
const Wrapper = styled.footer`
padding: 20px;
display: flex;
justify-content: flex-end;
`;
const Footer = () => (
<Wrapper>
<a href="https://last.fm/">
<img src={lastFmLogo} alt="last.fm" />
</a>
</Wrapper>
);
export default Footer;
|
var path = require("path");
var findRoot = require("find-root");
var chalk = require("chalk");
var _ = require("lodash");
var semver = require("semver");
const defaults = {
verbose: false,
showHelp: true,
emitError: false,
exclude: null,
strict: true
};
function DuplicatePackageCheckerPlugin(options) {
this.options = _.extend({}, defaults, options);
}
function cleanPath(path) {
return path.split(/[\/\\]node_modules[\/\\]/).join("/~/");
}
// Get closest package definition from path
function getClosestPackage(modulePath) {
let root;
let pkg;
// Catch findRoot or require errors
try {
root = findRoot(modulePath);
pkg = require(path.join(root, "package.json"));
} catch (e) {
return null;
}
// If the package.json does not have a name property, try again from
// one level higher.
// https://github.com/jsdnxx/find-root/issues/2
// https://github.com/date-fns/date-fns/issues/264#issuecomment-265128399
if (!pkg.name) {
return getClosestPackage(path.resolve(root, ".."));
}
return {
package: pkg,
path: root
};
}
DuplicatePackageCheckerPlugin.prototype.apply = function(compiler) {
let verbose = this.options.verbose;
let showHelp = this.options.showHelp;
let emitError = this.options.emitError;
let exclude = this.options.exclude;
let strict = this.options.strict;
compiler.hooks.emit.tapAsync("DuplicatePackageCheckerPlugin", function(
compilation,
callback
) {
let context = compilation.compiler.context;
let modules = {};
function cleanPathRelativeToContext(modulePath) {
let cleanedPath = cleanPath(modulePath);
// Make relative to compilation context
if (cleanedPath.indexOf(context) === 0) {
cleanedPath = "." + cleanedPath.replace(context, "");
}
return cleanedPath;
}
compilation.modules.forEach(module => {
if (!module.resource) {
return;
}
let pkg;
let packagePath;
let closestPackage = getClosestPackage(module.resource);
// Skip module if no closest package is found
if (!closestPackage) {
return;
}
pkg = closestPackage.package;
packagePath = closestPackage.path;
let modulePath = cleanPathRelativeToContext(packagePath);
let version = pkg.version;
modules[pkg.name] = modules[pkg.name] || [];
let isSeen = _.find(modules[pkg.name], module => {
return module.version === version;
});
if (!isSeen) {
let entry = { version, path: modulePath };
let issuer =
module.issuer && module.issuer.resource
? cleanPathRelativeToContext(module.issuer.resource)
: null;
entry.issuer = issuer;
modules[pkg.name].push(entry);
}
});
let duplicates = {};
for (let name in modules) {
const instances = modules[name];
if (instances.length <= 1) {
continue;
}
let filtered = instances;
if (!strict) {
filtered = [];
const groups = _.groupBy(instances, instance =>
semver.major(instance.version)
);
_.each(groups, group => {
if (group.length > 1) {
filtered = filtered.concat(group);
}
});
if (filtered.length <= 1) {
continue;
}
}
if (exclude) {
filtered = filtered.filter(instance => {
instance = Object.assign({ name }, instance);
return !exclude(instance);
});
if (filtered.length <= 1) {
continue;
}
}
duplicates[name] = filtered;
}
const duplicateCount = Object.keys(duplicates).length;
if (duplicateCount) {
let array = emitError ? compilation.errors : compilation.warnings;
let i = 0;
let sortedDuplicateKeys = Object.keys(duplicates).sort();
sortedDuplicateKeys.map(name => {
let instances = duplicates[name].sort(
(a, b) => (a.version < b.version ? -1 : 1)
);
let error =
name +
"\n" +
chalk.reset(" Multiple versions of ") +
chalk.green.bold(name) +
chalk.white(` found:\n`);
instances = instances.map(version => {
let str = `${chalk.green.bold(version.version)} ${chalk.white.bold(
version.path
)}`;
if (verbose && version.issuer) {
str += ` from ${chalk.white.bold(version.issuer)}`;
}
return str;
});
error += ` ${instances.join("\n ")}\n`;
// only on last warning
if (showHelp && ++i === duplicateCount) {
error += `\n${chalk.white.bold(
"Check how you can resolve duplicate packages: "
)}\nhttps://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#resolving-duplicate-packages-in-your-bundle\n`;
}
array.push(new Error(error));
});
}
callback();
});
};
module.exports = DuplicatePackageCheckerPlugin;
|
import pif
from './personal-information-formatter-service';
import cmf
from './communication-methods-formatter';
const Formatter = {
createPairString,
beautifyAcceptedPair,
};
export default Formatter;
function createPairString(context) {
const s = cmf.createCommunicationMethodslist(context).map(function(v) {
return `\n - ${v}`;
});
return `${pif.createProfile(context)}${s}`;
}
function beautifyAcceptedPair(dumps) {
const a = dumps.map((d) => createPairString(d.context));
return a.join('\n\n');
}
|
import { HTTP } from 'meteor/http';
import { Mail } from './Mail';
import { GlobalSettings } from '../config/GlobalSettings';
export class MailgunMail extends Mail {
constructor(replyTo, recipient) {
super(replyTo, recipient);
}
_sendMail() {
console.log('Sending mail via mailgun');
let mailgunSettings = GlobalSettings.getMailgunSettings();
let postURL = mailgunSettings.apiUrl + '/' + mailgunSettings.domain + '/messages';
let recipient = (typeof this._recipients === 'string') ? [this._recipients] : this._recipients;
let options = {
auth: 'api:' + mailgunSettings.apiKey,
params: {
'from': this._from,
'to': recipient,
'h:Reply-To': this._replyTo,
'subject': this._subject
}
};
if (this._text) {
options.params.text = this._text;
}
if (this._html) {
options.params.html = this._html;
}
// Send the request
const result = HTTP.post(postURL, options); // do not pass callback so the post request will run synchronously
this._verifyStatus(result);
}
_verifyStatus(result) {
if (result.data && result.data.message === 'Queued. Thank you.') {
return; // everything seems to be ok
}
const msg = 'Could not verify if mailgun has succeeded. Please check your configuration. Mailgun response: '
+ result.content;
throw new Error(msg);
}
} |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: The length property of eval has the attribute ReadOnly
es5id: 15.1.2.1_A4.3
description: Checking if varying the length property fails
flags: [noStrict]
---*/
//CHECK#1
var x = eval.length;
eval.length = Infinity;
if (eval.length !== x) {
$ERROR('#1: x = eval.length; eval.length = Infinity; eval.length === x. Actual: ' + (eval.length));
}
|
goog.provide('DubStash.compiler.PlaceholderBlock');
goog.require('DubStash.runtime.Runtime');
/**
* Represents a placeholder to be replaced with data at runtime. Discovered by the compiler.
*
* @param {string} name The name of the field to look up at runtime.
* @param {boolean} isRecursive Whether to treat the resulting value as a template and process
* that.
* @param {boolean} htmlEscape Whether to escape the runtime value to make it safe for inclusion
* in HTML.
* @constructor
* @implements {DubStash.compiler.Block}
*/
DubStash.compiler.PlaceholderBlock = function(name, isRecursive, htmlEscape){
/**
* Name of property to evaluate.
*
* @type {string}
* @private
*/
this.name_ = name;
/**
* Whether to evaluate the property recursively.
*
* @type {boolean}
* @private
*/
this.isRecursive_ = isRecursive;
/**
* Whether to escape the results to make them safe to include in HTML.
*
* @type {boolean}
* @private
*/
this.htmlEscape_ = htmlEscape;
};
/**
* Returns a function that when called will generate the run-time text of the block according to
* a supplied data object and options.
*
* @return {DubStash.functions.ContextualRenderingFunction}
*/
DubStash.compiler.PlaceholderBlock.prototype.getRenderer = function(){
// Curry the design-time configuration settings into the runtime rendering function.
var self = this;
return /** @type {DubStash.functions.ContextualRenderingFunction} */(function(context,
ignoreUndefined){
return DubStash.runtime.Runtime.getInstance().renderPlaceHolderBlock(self.name_,
self.isRecursive_, self.htmlEscape_, context, ignoreUndefined);
});
};
/**
* Returns the source code for a function that when called will generate the run-time text of
* the block according to a supplied data object and options.
*
* @return {string}
*/
DubStash.compiler.PlaceholderBlock.prototype.getRendererSource = function(){
// We would like to partially bind the runtime block renderer function with design-time
// params, but because we will serialize the function to text, it will lose its scope
// variables - i.e. the binding will be worthless. We therefore have to freeze the values of
// the design-time variables into the function.
return [
'function(c, i){',
' return DubStash.P(' +
['"' + this.name_ + '"', this.isRecursive_, this.htmlEscape_].join(', ') +
', c, i);',
'}'
].join('\n');
};
/**
* Adds a subordinFor compatibility with the Block interface.
*
* @param {!DubStash.compiler.Block} block
*/
DubStash.compiler.PlaceholderBlock.prototype.addBlock = function(block){};
|
'use strict';
var _ = require('lodash'),
cluster = require('cluster'),
i18n = require('i18n');
module.exports = function (callback) {
if (!_.isFunction(callback)) {
callback = false;
}
this.i18n.debug('DEBUG_ADD');
var self = this,
worker = cluster.fork(this.options.env),
maxListen = this.options.maxListeningMs || 0,
maxWarmup = this.options.maxLoadingMs || 0,
minRunning = this.options.minRunningMs || 0,
finished = false,
timeout;
if (maxListen > 0) {
timeout = setTimeout(function () {
worker.kill();
self.i18n.err('ERROR_MAX_LISTENING', maxListen);
if (callback) {
callback(i18n.__('ERROR_MAX_LISTENING'));
}
}, maxListen);
}
worker.on('message', function (msg) {
if (msg === 'loading') {
if (timeout) {
clearTimeout(timeout);
}
worker.removeAllListeners('listening');
self.i18n.debug('DEBUG_ADD_LOADING');
worker.once('listening', function (address) {
worker.address = address;
});
if (maxWarmup > 0) {
timeout = setTimeout(function () {
// Took to long to warm-up
worker.removeAllListeners('message');
worker.removeAllListeners('exit');
worker.kill();
finished = true;
self.i18n.err('ERROR_MAX_LOADING', maxWarmup);
if (callback) {
callback(i18n.__('ERROR_MAX_LOADING'));
}
}, maxWarmup);
}
} else if (msg === 'listening') {
if (timeout) {
clearTimeout(timeout);
}
worker.removeAllListeners('exit');
worker.removeAllListeners('message');
if (finished) {
return;
}
finished = true;
self.i18n.debug('DEBUG_ADDED', worker.address);
if (callback) {
callback();
}
}
});
worker.once('listening', function (address) {
if (timeout) {
clearTimeout(timeout);
}
worker.address = address;
var done = function () {
worker.removeAllListeners('exit');
worker.removeAllListeners('message');
if (finished) {
return;
}
finished = true;
var onexit = function () {
self.warn('WARN_WORKER_DIED', worker.id);
self.addWorkers(1);
};
try {
worker.on('SIGHUP', onexit);
worker.on('SIGINT', onexit);
} catch (e) {
self.err(e);
// Not available on Windows
}
worker.on('exit', onexit);
worker.on('disconnect', onexit);
self.i18n.debug('DEBUG_ADDED', worker.address);
if (callback) {
callback();
}
};
if (minRunning > 0) {
if (finished) {
return;
}
self.i18n.debug('DEBUG_ADD_WAITING', minRunning);
timeout = setTimeout(function () {
done();
}, minRunning);
} else {
done();
}
});
worker.once('exit', function () {
if (timeout) {
clearTimeout(timeout);
}
worker.removeAllListeners('listening');
worker.removeAllListeners('message');
worker.kill();
if (finished) {
return;
}
finished = true;
self.i18n.err('ERROR_ADDING');
if (callback) {
callback(i18n.__('ERROR_ADDING'));
}
});
return worker;
}; |
/*jslint node: true */
"use strict";
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var mongoose = require('mongoose');
var User = mongoose.model('User');
passport.use(new LocalStrategy(
function(username, password, done) {
User.findOne({
username: username
}, function(err, user) {
if (err) {
return done(err);
}
if (!user) {
return done(null, false, {
message: 'Incorrect username.'
});
}
if (!user.validPassword(password)) {
return done(null, false, {
message: 'Incorrect password.'
});
}
return done(null, user);
});
}
));
|
//>>built
define("dojorama/layers/nls/release-pages_en-gb",{"dojorama/ui/release/nls/ReleaseCreatePage":{pageTitle:"Create New Release"},"dojorama/ui/release/nls/ReleaseIndexPage":{pageTitle:"Releases"},"dojorama/ui/release/nls/ReleaseUpdatePage":{pageTitle:"Releases"}});
//@ sourceMappingURL=release-pages_en-gb.js.map |
var expect = require('chai').expect,
dht = require('../index');
describe('sensor', function() {
it('should return a sensor number value', function() {
expect(dht.sensor('DHT22')).to.equal(22);
});
it('should be undefined', function() {
expect(dht.sensor('ABC')).to.be.undefined;
});
});
describe('current errors', function() {
it('should return true for having timeout or checksum errors', function() {
expect(dht.checkErrors(-1)).to.equal(true);
expect(dht.checkErrors(-2)).to.equal(true);
});
it('should not be able to access a GPIO pin', function() {
expect(function() {
dht.checkErrors(-4);
}).to.throw(Error, /Error accessing GPIO. Make sure program is run as root with sudo!/);
});
it('should throw a general current error', function() {
expect(function() {
dht.checkErrors(-10);
}).to.throw(Error, /Error calling DHT test driver read: -10/);
});
it('should not have any errors', function() {
expect(dht.checkErrors(10)).to.equal(false);
});
});
describe('read', function() {
it('should expect a GPIO pin', function() {
expect(function() {
dht.read();
}).to.throw(Error, /No GPIO pin provided!/);
});
it('should expect a correct GPIO pin', function() {
expect(function() {
dht.read('P9_1000');
}).to.throw(Error, /Pin must be a valid GPIO identifier!/);
});
it('should expect a sensor model', function() {
expect(function() {
dht.read('P9_15');
}).to.throw(Error, /Expected DHT11, DHT22, or AM2302 sensor value./);
});
});
|
import fs from 'fs-extra'
import chalk from 'chalk'
import { time, timeEnd } from '../utils'
export default async function cleanDistDirectory(state) {
// Remove the DIST folder
console.log('Cleaning dist...')
time(chalk.green('[\u2713] Dist cleaned'))
await fs.remove(state.config.paths.DIST)
timeEnd(chalk.green('[\u2713] Dist cleaned'))
// Remove the ARTIFACTS folder
console.log('Cleaning artifacts...')
time(chalk.green('[\u2713] Artifacts cleaned'))
await fs.remove(state.config.paths.ARTIFACTS)
timeEnd(chalk.green('[\u2713] Artifacts cleaned'))
// Empty ASSETS folder
if (
state.config.paths.ASSETS &&
state.config.paths.ASSETS !== state.config.paths.DIST
) {
console.log('Cleaning assets...')
time(chalk.green('[\u2713] Assets cleaned'))
await fs.emptyDir(state.config.paths.ASSETS)
timeEnd(chalk.green('[\u2713] Assets cleaned'))
}
return state
}
|
var url = "http://geocarto.igac.gov.co/geoservicios",
geoserver = require("..")(url);
geoserver.wms.serviceMetadata(function(err, serviceMetadata) {
if (err) {
return console.log("error: %j", err);
}
console.log(serviceMetadata);
}); |
(function () {
'use strict';
angular.module('core').
controller('CarouselDemoCtrl', function ($scope) {
$scope.myInterval = 5000;
$scope.noWrapSlides = false;
$scope.active = 0;
var slides = $scope.slides = [];
var currIndex = 0;
$scope.addSlide = function() {
var newWidth = 600 + slides.length + 1;
slides.push({
image: '//unsplash.it/' + newWidth + '/300',
text: ['Nice image', 'Awesome photograph', 'That is so cool', 'I love that'][slides.length % 4],
id: currIndex++
});
};
$scope.randomize = function() {
var indexes = generateIndexesArray();
assignNewIndexesToSlides(indexes);
};
for (var i = 0; i < 4; i++) {
$scope.addSlide();
}
// Randomize logic below
function assignNewIndexesToSlides(indexes) {
for (var i = 0, l = slides.length; i < l; i++) {
slides[i].id = indexes.pop();
}
}
function generateIndexesArray() {
var indexes = [];
for (var i = 0; i < currIndex; ++i) {
indexes[i] = i;
}
return shuffle(indexes);
}
// http://stackoverflow.com/questions/962802#962890
function shuffle(array) {
var tmp;
var current;
var top = array.length;
if (top) {
while (--top) {
current = Math.floor(Math.random() * (top + 1));
tmp = array[current];
array[current] = array[top];
array[top] = tmp;
}
}
return array;
}
});
}());
|
import { normalize, schema } from 'normalizr'
import { camelizeKeys } from 'humps'
// Extracts the next page URL from Github API response.
const getNextPageUrl = response => {
const link = response.headers.get('link')
if (!link) {
return null
}
const nextLink = link.split(',').find(s => s.indexOf('rel="next"') > -1)
if (!nextLink) {
return null
}
return nextLink.split(';')[0].slice(1, -1)
}
const API_ROOT = 'https://api.github.com/'
// Fetches an API response and normalizes the result JSON according to schema.
// This makes every API response have the same shape, regardless of how nested it was.
const callApi = (endpoint, schema) => {
const fullUrl = (endpoint.indexOf(API_ROOT) === -1) ? API_ROOT + endpoint : endpoint
return fetch(fullUrl)
.then(response =>
response.json().then(json => {
if (!response.ok) {
return Promise.reject(json)
}
const camelizedJson = camelizeKeys(json)
const nextPageUrl = getNextPageUrl(response)
return Object.assign({},
normalize(camelizedJson, schema),
{ nextPageUrl }
)
})
)
}
// We use this Normalizr schemas to transform API responses from a nested form
// to a flat form where repos and users are placed in `entities`, and nested
// JSON objects are replaced with their IDs. This is very convenient for
// consumption by reducers, because we can easily build a normalized tree
// and keep it updated as we fetch more data.
// Read more about Normalizr: https://github.com/paularmstrong/normalizr
// GitHub's API may return results with uppercase letters while the query
// doesn't contain any. For example, "someuser" could result in "SomeUser"
// leading to a frozen UI as it wouldn't find "someuser" in the entities.
// That's why we're forcing lower cases down there.
const userSchema = new schema.Entity('users', {}, {
idAttribute: user => user.login.toLowerCase()
})
const repoSchema = new schema.Entity('repos', {
owner: userSchema
}, {
idAttribute: repo => repo.fullName.toLowerCase()
})
// Schemas for Github API responses.
export const Schemas = {
USER: userSchema,
USER_ARRAY: new schema.Array(userSchema),
REPO: repoSchema,
REPO_ARRAY: new schema.Array(repoSchema)
}
// Action key that carries API call info interpreted by this Redux middleware.
export const CALL_API = 'Call API'
// A Redux middleware that interprets actions with CALL_API info specified.
// Performs the call and promises when such actions are dispatched.
export default store => next => action => {
const callAPI = action[CALL_API]
if (typeof callAPI === 'undefined') {
return next(action)
}
let { endpoint } = callAPI
const { schema, types } = callAPI
if (typeof endpoint === 'function') {
endpoint = endpoint(store.getState())
}
if (typeof endpoint !== 'string') {
throw new Error('Specify a string endpoint URL.')
}
if (!schema) {
throw new Error('Specify one of the exported Schemas.')
}
if (!Array.isArray(types) || types.length !== 3) {
throw new Error('Expected an array of three action types.')
}
if (!types.every(type => typeof type === 'string')) {
throw new Error('Expected action types to be strings.')
}
const actionWith = data => {
const finalAction = Object.assign({}, action, data)
delete finalAction[CALL_API]
return finalAction
}
const [ requestType, successType, failureType ] = types
next(actionWith({ type: requestType }))
return callApi(endpoint, schema).then(
response => next(actionWith({
response,
type: successType
})),
error => next(actionWith({
type: failureType,
error: error.message || 'Something bad happened'
}))
)
}
|
expectedExtractedStyles = {
'1024': function(cssUrl){
return [
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(255, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"504px 21px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(255, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(255, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(255, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"504px 21px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(255, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(255, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(255, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(255, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(255, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"block",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"32px",
"font-style":"normal",
"font-variant":"normal",
"font-weight":"bold",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"42px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"21px",
"margin-left":"0px",
"margin-right":"0px",
"margin-top":"21px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(255, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"1008px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"auto",
"zoom":"1"
},
"children":[
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(255, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"0px 0px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(255, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(255, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(255, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"0px 0px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(255, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(255, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(255, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(255, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(255, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"inline",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"32px",
"font-style":"italic",
"font-variant":"normal",
"font-weight":"bold",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"0px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"0px",
"margin-left":"0px",
"margin-right":"0px",
"margin-top":"0px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(255, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"0px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"auto",
"zoom":"1"
},
"children":[
],
"ignore":false,
"rules":[
],
"selector":"BODY>H1:nth-child(1)>EM:nth-child(1)"
}
],
"ignore":false,
"rules":[
{
"attributes":{
"color":"rgb(255, 0, 0)"
},
"selector":"h1",
"sheet":cssUrl
}
],
"selector":"BODY>H1:nth-child(1)"
},
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(0, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"512px 400px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(0, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(0, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(0, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"512px 400px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(0, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(0, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(0, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(0, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(0, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"block",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"16px",
"font-style":"normal",
"font-variant":"normal",
"font-weight":"normal",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"800px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"0px",
"margin-left":"0px",
"margin-right":"0px",
"margin-top":"0px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(0, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"1024px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"0",
"zoom":"1"
},
"children":[
],
"ignore":true,
"selector":"HTML"
},
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(0, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"504px 385px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(0, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(0, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(0, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"504px 385px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(0, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(0, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(0, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(0, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(0, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"block",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"16px",
"font-style":"normal",
"font-variant":"normal",
"font-weight":"normal",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"771px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"8px",
"margin-left":"8px",
"margin-right":"8px",
"margin-top":"8px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(0, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"1008px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"auto",
"zoom":"1"
},
"children":[
],
"ignore":true,
"selector":"BODY"
}
];
},
'720': function(cssUrl){
return [
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(255, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"352px 21px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(255, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(255, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(255, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"352px 21px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(255, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(255, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(255, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(255, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(255, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"block",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"32px",
"font-style":"normal",
"font-variant":"normal",
"font-weight":"bold",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"42px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"21px",
"margin-left":"0px",
"margin-right":"0px",
"margin-top":"21px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(255, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"704px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"auto",
"zoom":"1"
},
"children":[
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(255, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"0px 0px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(255, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(255, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(255, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"0px 0px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(255, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(255, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(255, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(255, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(255, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"inline",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"32px",
"font-style":"italic",
"font-variant":"normal",
"font-weight":"bold",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"0px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"0px",
"margin-left":"0px",
"margin-right":"0px",
"margin-top":"0px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(255, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"0px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"auto",
"zoom":"1"
},
"children":[
],
"ignore":false,
"rules":[
],
"selector":"BODY>H1:nth-child(1)>EM:nth-child(1)"
}
],
"ignore":false,
"rules":[
{
"attributes":{
"color":"rgb(255, 0, 0)"
},
"selector":"h1",
"sheet":cssUrl
}
],
"selector":"BODY>H1:nth-child(1)"
},
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(0, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"360px 400px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(0, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(0, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(0, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"360px 400px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(0, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(0, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(0, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(0, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(0, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"block",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"16px",
"font-style":"normal",
"font-variant":"normal",
"font-weight":"normal",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"800px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"0px",
"margin-left":"0px",
"margin-right":"0px",
"margin-top":"0px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(0, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"720px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"0",
"zoom":"1"
},
"children":[
],
"ignore":true,
"selector":"HTML"
},
{
"attributes":{
"-webkit-animation-delay":"0s",
"-webkit-animation-direction":"normal",
"-webkit-animation-duration":"0s",
"-webkit-animation-fill-mode":"none",
"-webkit-animation-iteration-count":"1",
"-webkit-animation-name":"none",
"-webkit-animation-play-state":"running",
"-webkit-animation-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-appearance":"none",
"-webkit-backface-visibility":"visible",
"-webkit-background-clip":"border-box",
"-webkit-background-composite":"source-over",
"-webkit-background-origin":"padding-box",
"-webkit-background-size":"auto auto",
"-webkit-border-fit":"border",
"-webkit-border-horizontal-spacing":"0px",
"-webkit-border-image":"none",
"-webkit-border-vertical-spacing":"0px",
"-webkit-box-align":"stretch",
"-webkit-box-direction":"normal",
"-webkit-box-flex":"0",
"-webkit-box-flex-group":"1",
"-webkit-box-lines":"single",
"-webkit-box-ordinal-group":"1",
"-webkit-box-orient":"horizontal",
"-webkit-box-pack":"start",
"-webkit-box-reflect":"none",
"-webkit-box-shadow":"none",
"-webkit-color-correction":"default",
"-webkit-column-break-after":"auto",
"-webkit-column-break-before":"auto",
"-webkit-column-break-inside":"auto",
"-webkit-column-count":"auto",
"-webkit-column-gap":"normal",
"-webkit-column-rule-color":"rgb(0, 0, 0)",
"-webkit-column-rule-style":"none",
"-webkit-column-rule-width":"0px",
"-webkit-column-span":"1",
"-webkit-column-width":"auto",
"-webkit-font-smoothing":"auto",
"-webkit-highlight":"none",
"-webkit-hyphenate-character":"auto",
"-webkit-hyphenate-limit-after":"auto",
"-webkit-hyphenate-limit-before":"auto",
"-webkit-hyphens":"manual",
"-webkit-line-box-contain":"block inline replaced",
"-webkit-line-break":"normal",
"-webkit-line-clamp":"none",
"-webkit-locale":"auto",
"-webkit-margin-after-collapse":"collapse",
"-webkit-margin-before-collapse":"collapse",
"-webkit-marquee-direction":"auto",
"-webkit-marquee-increment":"6px",
"-webkit-marquee-repetition":"infinite",
"-webkit-marquee-style":"scroll",
"-webkit-mask-attachment":"scroll",
"-webkit-mask-box-image":"none",
"-webkit-mask-clip":"border-box",
"-webkit-mask-composite":"source-over",
"-webkit-mask-image":"none",
"-webkit-mask-origin":"border-box",
"-webkit-mask-position":"0% 0%",
"-webkit-mask-repeat":"repeat",
"-webkit-mask-size":"auto auto",
"-webkit-nbsp-mode":"normal",
"-webkit-perspective":"none",
"-webkit-perspective-origin":"352px 385px",
"-webkit-rtl-ordering":"logical",
"-webkit-svg-shadow":"none",
"-webkit-text-combine":"none",
"-webkit-text-decorations-in-effect":"none",
"-webkit-text-emphasis-color":"rgb(0, 0, 0)",
"-webkit-text-emphasis-position":"over",
"-webkit-text-emphasis-style":"none",
"-webkit-text-fill-color":"rgb(0, 0, 0)",
"-webkit-text-orientation":"vertical-right",
"-webkit-text-security":"none",
"-webkit-text-stroke-color":"rgb(0, 0, 0)",
"-webkit-text-stroke-width":"0px",
"-webkit-transform":"none",
"-webkit-transform-origin":"352px 385px",
"-webkit-transform-style":"flat",
"-webkit-transition-delay":"0s",
"-webkit-transition-duration":"0s",
"-webkit-transition-property":"all",
"-webkit-transition-timing-function":"cubic-bezier(0.25, 0.1, 0.25, 1)",
"-webkit-user-drag":"auto",
"-webkit-user-modify":"read-only",
"-webkit-user-select":"text",
"-webkit-writing-mode":"horizontal-tb",
"alignment-baseline":"auto",
"background-attachment":"scroll",
"background-clip":"border-box",
"background-color":"rgba(0, 0, 0, 0)",
"background-image":"none",
"background-origin":"padding-box",
"background-position":"0% 0%",
"background-repeat":"repeat",
"background-size":"auto auto",
"baseline-shift":"baseline",
"border-bottom-color":"rgb(0, 0, 0)",
"border-bottom-left-radius":"0px",
"border-bottom-right-radius":"0px",
"border-bottom-style":"none",
"border-bottom-width":"0px",
"border-collapse":"separate",
"border-left-color":"rgb(0, 0, 0)",
"border-left-style":"none",
"border-left-width":"0px",
"border-right-color":"rgb(0, 0, 0)",
"border-right-style":"none",
"border-right-width":"0px",
"border-top-color":"rgb(0, 0, 0)",
"border-top-left-radius":"0px",
"border-top-right-radius":"0px",
"border-top-style":"none",
"border-top-width":"0px",
"bottom":"auto",
"box-shadow":"none",
"box-sizing":"content-box",
"caption-side":"top",
"clear":"none",
"clip":"auto",
"clip-path":"none",
"clip-rule":"nonzero",
"color":"rgb(0, 0, 0)",
"color-interpolation":"srgb",
"color-interpolation-filters":"linearrgb",
"color-rendering":"auto",
"cursor":"auto",
"direction":"ltr",
"display":"block",
"dominant-baseline":"auto",
"empty-cells":"show",
"fill":"#000000",
"fill-opacity":"1",
"fill-rule":"nonzero",
"filter":"none",
"float":"none",
"flood-color":"rgb(0, 0, 0)",
"flood-opacity":"1",
"font-family":"'Nimbus Sans L'",
"font-size":"16px",
"font-style":"normal",
"font-variant":"normal",
"font-weight":"normal",
"glyph-orientation-horizontal":"0deg",
"glyph-orientation-vertical":"auto",
"height":"771px",
"image-rendering":"auto",
"kerning":"0",
"left":"auto",
"letter-spacing":"normal",
"lighting-color":"rgb(255, 255, 255)",
"line-height":"normal",
"list-style-image":"none",
"list-style-position":"outside",
"list-style-type":"disc",
"margin-bottom":"8px",
"margin-left":"8px",
"margin-right":"8px",
"margin-top":"8px",
"marker-end":"none",
"marker-mid":"none",
"marker-start":"none",
"mask":"none",
"max-height":"none",
"max-width":"none",
"min-height":"0px",
"min-width":"0px",
"opacity":"1",
"orphans":"2",
"outline-color":"rgb(0, 0, 0)",
"outline-style":"none",
"outline-width":"0px",
"overflow-x":"visible",
"overflow-y":"visible",
"padding-bottom":"0px",
"padding-left":"0px",
"padding-right":"0px",
"padding-top":"0px",
"page-break-after":"auto",
"page-break-before":"auto",
"page-break-inside":"auto",
"pointer-events":"auto",
"position":"static",
"resize":"none",
"right":"auto",
"shape-rendering":"auto",
"speak":"normal",
"stop-color":"rgb(0, 0, 0)",
"stop-opacity":"1",
"stroke":"none",
"stroke-dasharray":"none",
"stroke-dashoffset":"0",
"stroke-linecap":"butt",
"stroke-linejoin":"miter",
"stroke-miterlimit":"4",
"stroke-opacity":"1",
"stroke-width":"1",
"table-layout":"auto",
"text-align":"-webkit-auto",
"text-anchor":"start",
"text-decoration":"none",
"text-indent":"0px",
"text-overflow":"clip",
"text-rendering":"auto",
"text-shadow":"none",
"text-transform":"none",
"top":"auto",
"unicode-bidi":"normal",
"vector-effect":"none",
"vertical-align":"baseline",
"visibility":"visible",
"white-space":"normal",
"widows":"2",
"width":"704px",
"word-break":"normal",
"word-spacing":"0px",
"word-wrap":"normal",
"writing-mode":"lr-tb",
"z-index":"auto",
"zoom":"1"
},
"children":[
],
"ignore":true,
"selector":"BODY"
}
];
}
};
|
var React = require('react');
var Sidebar =React.createClass({
render : function(){
var {ratings} = this.props;
var barContainer = [];
var totalVoters = 0;
for (var key in ratings) {
totalVoters = totalVoters + ratings[key]
};
for (var key in ratings) {
var divStyle = {
width: (ratings[key]/totalVoters)*100 +'%'
};
barContainer.push(
<div className="rating-bar-container" key={key}>
<span className="bar-inf">{key} STAR</span><span className="rating-bar rating-bar-bg ">
<span className="rating-bar rating-bar-fill" style={divStyle}/>
</span><span className="bar-cntr">({ratings[key]})</span>
</div>
);
};
var weight = 0;
var totalVotes = 0;
for (var key in ratings) {
weight = weight + ratings[key]*key;
totalVotes = totalVotes + ratings[key];
}
var avg = weight/totalVotes;
var rounded_avg =Math.round(avg);
var stars = [];
for (var i=0; i < rounded_avg; i++) {
stars.push(<div className="summary-star" key={i} ><img src="./images/summary_star.png" /></div>);
};
for (var i=stars.length; i<5; i++) {
stars.push(<div className="summary-star" key={i} ><img src="./images/rating_gray_star.png" /></div>);
}
return (
<div>
<aside className="Sidebar">
<div className="rating-summary">
<div className="summary-stars">
{stars}
<p>Avarage Rating:{rounded_avg} out 5 stars</p>
</div>
<div className="rating-bars">
{barContainer}
</div>
<p>View All {this.props.reviewNumber} Reviews</p>
<div className="blue-btn"><button className="add-review-icon"> ADD A REVIEW</button></div>
</div>
<div className="purchase">
<span className="sign-painter"> Paperback</span>
$2.00
<div className="clear" />
<button className="purchase-item std-btn yellow-btn">ADD TO CARD</button>
<div className="purchase-item select-container"><select><option value="BUY ELSEWHERE">BUY ELSEWHERE</option></select></div>
<div>-OR-</div>
<button className="purchase-item std-btn orange-btn">BUY EBOOK NOW</button>
</div>
</aside>
</div>
)
}
});
module.exports = Sidebar;
|
import React,{PropTypes} from 'react';
import { connect } from 'react-redux';
import { handlerAdd } from '../actions';
import HeadNav from '../components/HeadNav/HeadNav';
import AppTopCon from '../components/AppTopCon/AppTopCon';
import AppZhuSu from '../components/AppZhuSu/AppZhuSu';
import AppFoot from '../components/AppFoot/AppFoot';
import AppCart from '../components/AppCart/AppCart';
import AppDatePicker from '../components/AppDatePicker/AppDatePicker';
import { getVisibleProducts } from '../reducers/getInfo';
require ('../styles/App.css');
// 引入json数据
let Details=require('../data/Detail.json');
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
displayStyle:true,
data:Details,
AppCartDisplay:true,
cartId:0,
CartDate:'选择时间',//购物车选择时间
CartCount:1,//购物车中计数器
HeadNavCartCount:0// 顶部购物车计数器
};
}
handleToggle(){
this.setState({
displayStyle: !this.state.displayStyle,
});
}
// 点击加入购物车调用的方法
HandlerJoinCart(){
this.setState({
AppCartDisplay: !this.state.AppCartDisplay,
HeadNavCartCount:this.state.HeadNavCartCount+1
});
}
handleAppCartDisplay(e){
this.setState({
AppCartDisplay: !this.state.AppCartDisplay,
});
let cartAddId=e.target.id;
if(cartAddId!=''){
this.setState({
cartId: e.target.id,
});
}
}
render() {
console.log(this.props);
const { AppCartAddNumInfo,actions} = this.props;
const {handlerAdd}=actions;
return (
<div>
<div className="index">
<HeadNav HeadNavCartCount={this.state.HeadNavCartCount}/>
<AppTopCon />
<AppZhuSu
DetailsData={this.state.data}
handleAppCartDisplay={this.handleAppCartDisplay.bind(this)}/>
</div>
<AppCart
DetailsData={this.state.data}
CartDate={this.state.CartDate}
CartCount={AppCartAddNumInfo}
HandlerJoinCart={this.HandlerJoinCart.bind(this)}
cartId={this.state.cartId}
handleAppCartDisplay={this.handleAppCartDisplay.bind(this)}
AppCartDisplay={this.state.AppCartDisplay}
handlerAdd={handlerAdd}/>
<div className="AppFoot">
<AppFoot
handleToggle={this.handleToggle.bind(this)}
displayStyle={this.state.displayStyle}/>
</div>
<AppDatePicker />
</div>
);
}
}
App.defaultProps = {
};
App.propTypes = {
products: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.number.isRequired,
title: PropTypes.string.isRequired,
price: PropTypes.number.isRequired,
inventory: PropTypes.number.isRequired
})).isRequired,
handlerAdd: PropTypes.func.isRequired
}
function mapStateToProps(state) {
return {
products: getVisibleProducts(state.products)
}
}
export default connect(
mapStateToProps,
{ handlerAdd }
)(App) |
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['awesomeTableJs'], factory);
} else {
// Browser globals
root.awesomeTableJs = factory(root.awesomeTableJs);
}
}(this, function() {
var VERSION = "0.1.2";
//Acceppted data :
//var array=[{"Total":"34","Version":"1.0.4","Office":"New York"},{"Total":"67","Version":"1.1.0","Office":"Paris"}];
//Or Use an url that return a Standard Json
//functions that contain 'create' in their name , are which export to outside
//and functiins tha contains 'make' are internal an private
function AwesomeTableJs(options) {
//check if a parameter pass to function
this.globalOptions = {
url: "",
data: "",
pageSize: 15,
//wrapper: "",
tableWrapper: "",
paginationWrapper: "",
searchboxWrapper: "",
pageSizeWrapper: "",
buildSearch: true,
buildPagination: true,
buildPageSize: true,
buildSorting: true,
columnsTypes: ""
};
for (var key in this.globalOptions) {
if (options.hasOwnProperty(key)) {
this.globalOptions[key] = options[key];
}
}
if (this.globalOptions.tableWrapper) {
this.tableWrapper = document.querySelector(this.globalOptions.tableWrapper)
};
if (this.globalOptions.searchboxWrapper) {
this.searchboxWrapper = document.querySelector(this.globalOptions.searchboxWrapper)
};
if (this.globalOptions.paginationWrapper) {
this.paginationWrapper = document.querySelector(this.globalOptions.paginationWrapper)
};
if (this.globalOptions.pageSizeWrapper) {
this.pageSizeWrapper = document.querySelector(this.globalOptions.pageSizeWrapper)
};
if (!this.tableWrapper) {
var divWrapper = document.createElement('DIV');
divWrapper.className = "aweTbl-table-wrapper";
var table = document.createElement('table');
table.className = "table table-bordered";
this.tableElement = table;
divWrapper.appendChild(table);
document.body.appendChild(divWrapper);
} else {
var table = document.createElement('table');
table.className = "table table-bordered";
this.tableElement = table;
this.tableWrapper.appendChild(table);
}
if (!this.paginationWrapper) {
var divWrapper = document.createElement('DIV');
divWrapper.className = "aweTbl-pagination-wrapper";
this.paginationWrapper = divWrapper;
document.body.appendChild(divWrapper);
}
if (!this.pageSizeWrapper) {
var divWrapper = document.createElement('DIV');
divWrapper.className = "aweTbl-pageCount-wrapper";
this.pageSizeWrapper = divWrapper;
document.body.appendChild(divWrapper);
}
if (!this.searchboxWrapper) {
var divWrapper = document.createElement('DIV');
divWrapper.className = "aweTbl-searchBox-wrapper";
this.searchboxWrapper = divWrapper;
document.body.appendChild(divWrapper);
}
this.jsonKeys = [];
}
//Get A WebService Address for Using Its JSon Result
//options = url,data
AwesomeTableJs.prototype.createTable = function() {
if (this.globalOptions.data) {
findOutDataType.call(this, this.globalOptions.data);
} else if (this.globalOptions.url) {
var self = this;
var httpRequest = new XMLHttpRequest();
console.log(self, " self");
var loadingDiv = document.createElement('div');
loadingDiv.innerHTML = " Loading ... ";
loadingDiv.className = "aweTbl-loading";
this.tableWrapper.appendChild(loadingDiv);
httpRequest.addEventListener("load", getXhrResponse.bind(self,
httpRequest));
httpRequest.addEventListener("error", function() {
throw "requesting that url come with an error \n" + this.responseText;
});
httpRequest.addEventListener("abort", function() {
throw "request canceled by you";
});
httpRequest.open("GET", this.globalOptions.url);
httpRequest.send();
} else {
throw "please pass an url ,becuase i want to create table from its json result,or data like an array";
}
}
AwesomeTableJs.prototype.paging = function(inCurrentPage) {
if (inCurrentPage) {
var currentPage = parseInt(inCurrentPage)
console.log(inCurrentPage);
} else {
var currentPage = 1;
};
if (sessionStorage.awesomeTabledata) {
var result = JSON.parse(sessionStorage.awesomeTabledata);
var pageCount = result.length;
var skip = (currentPage - 1) * this.globalOptions.pageSize;
var paged = result.splice(skip, this.globalOptions.pageSize);
makePagination.call(this, pageCount, currentPage);
changeTableBody.call(this, paged);
} else {
this.createTable();
}
}
AwesomeTableJs.prototype.filter = function(inputElement) {
var filterText = inputElement.value;
if (sessionStorage.awesomeTabledata) {
var result = JSON.parse(sessionStorage.awesomeTabledata);
var filteredArray = [];
console.log(filterText);
for (var i = 0, reslen = result.length; i < reslen; i++) {
for (var j = 0, objLen = this.jsonKeys.length; j < objLen; j++) {
if (result[i][this.jsonKeys[j]].toString().match(filterText)) {
filteredArray.push(result[i]);
break;
}
}
}
changeTableBody.call(this, filteredArray);
makePagination.call(this, filteredArray.length, 1);
console.log(filteredArray);
} else {
this.createTable();
}
}
AwesomeTableJs.prototype.sort = function(headerElement) {
var key = headerElement.getAttribute('data-sortkey');
key = key || this.jsonKeys[0];
var direction = headerElement.getAttribute('data-sortDirection');
direction = direction || "asc";
console.log("dirextion : ", direction, " key : ", key);
if (sessionStorage.awesomeTabledata) {
var result = JSON.parse(sessionStorage.awesomeTabledata);
result.sort(makeSort_by(key, direction == "asc", null));
sessionStorage.awesomeTabledata = JSON.stringify(result);
changeTableBody.call(this, result);
//makePagination.call(this, result.length);
//remove asc from other
for (var i = 0, len = this.jsonKeys.length; i < len; i++) {
headerElement.parentNode.parentNode.childNodes[i].childNodes[0].setAttribute(
'data-sortDirection', "asc");
}
headerElement.setAttribute('data-sortDirection', direction == "asc" ?
"desc" : "asc");
} else {
this.createTable();
}
}
function findOutDataType(data) {
switch (typeof(data)) {
case "object":
{
if (Array.isArray(data)) {
//check for header
if (data[0]) {
sessionStorage.awesomeTabledata = JSON.stringify(data);
makeTable.call(this, data);
makeOtherstuff.call(this, data.length);
}
} else {
throw "pass an array with this format : [{'Name':'ronaldo',...},{'Name':'sarah'}]";
}
break;
}
case "string":
{
//check for Json
if (/^[\],:{}\s]*$/.test(data.replace(/\\["\\\/bfnrtu]/g, '@').replace(
/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
//the json is ok
} else {
//the json is not ok
}
break;
}
default:
}
}
function makeSort_by(field, reverse, primer) {
var key = primer ?
function(x) {
return primer(x[field])
} :
function(x) {
return x[field]
};
reverse = !reverse ? 1 : -1;
return function(a, b) {
return a = key(a), b = key(b), reverse * ((a > b) - (b > a));
}
}
function makePagination(resultLeng, currentPage) {
var pageCount = Math.ceil(resultLeng / this.globalOptions.pageSize);
var prevPagination = document.querySelector(".aweTbl-pagination");
if (prevPagination) {
prevPagination.innerHTML = "";
}
var paginationWrapper = prevPagination || document.createElement('Div');
paginationWrapper.className = "aweTbl-pagination";
var pagingConfig = {
first: {
'start': null,
'end': null,
'showDot': null
},
middle: {
'start': null,
'end': null,
},
last: {
'start': null,
'end': null,
'showDot': null
}
}
if (pageCount > 10) {
if (currentPage <= 3) {
pagingConfig.first.start = "1";
pagingConfig.first.end = "5";
pagingConfig.last.start = pageCount - 1;
pagingConfig.last.end = pageCount;
pagingConfig.last.showDot = true;
} else if (currentPage == 4) {
pagingConfig.first.start = "1";
pagingConfig.first.end = "6";
pagingConfig.last.start = pageCount - 1;
pagingConfig.last.end = pageCount;
pagingConfig.last.showDot = true;
} else if (currentPage == 5) {
pagingConfig.first.start = "1";
pagingConfig.first.end = "7";
pagingConfig.last.start = pageCount - 1;
pagingConfig.last.end = pageCount;
pagingConfig.last.showDot = true;
} else if (currentPage > 5 && pageCount - currentPage > 3) {
pagingConfig.first.start = "1";
pagingConfig.first.end = "2";
pagingConfig.first.showDot = true;
pagingConfig.middle.start = currentPage - 2;
pagingConfig.middle.end = currentPage + 2;
pagingConfig.last.start = pageCount - 1;
pagingConfig.last.end = pageCount;
pagingConfig.last.showDot = true;
} else if (pageCount - currentPage <= 3) {
pagingConfig.first.start = "1";
pagingConfig.first.end = "2";
pagingConfig.first.showDot = true;
pagingConfig.last.start = currentPage - 5;
pagingConfig.last.end = pageCount;
}
//fisrtPart
for (var i = pagingConfig.first.start; i <= pagingConfig.first.end; i++) {
var label = document.createElement("a");
label.className = "aweTbl-pagination-label".concat(i == currentPage ?
" currentPage " : "");
label.innerHTML = i;
label.href = "javascript:void(0);";
label.addEventListener("click", this.paging.bind(this, i), false);
paginationWrapper.appendChild(label);
}
if (pagingConfig.first.showDot) {
// create ..
var label = document.createElement("a");
label.className = "aweTbl-pagination-label";
label.innerHTML = "..";
label.href = "javascript:void(0);";
paginationWrapper.appendChild(label);
}
//middlePart
if (pagingConfig.middle.start) {
for (var i = pagingConfig.middle.start; i <= pagingConfig.middle.end; i++) {
var label = document.createElement("a");
label.className = "aweTbl-pagination-label".concat(i ==
currentPage ?
" currentPage " : "");
label.innerHTML = i;
label.href = "javascript:void(0);";
label.addEventListener("click", this.paging.bind(this, i), false);
paginationWrapper.appendChild(label);
}
}
//LastPart
if (pagingConfig.last.showDot) {
// create ..
var label = document.createElement("a");
label.className = "aweTbl-pagination-label";
label.innerHTML = "..";
label.href = "javascript:void(0);";
paginationWrapper.appendChild(label);
}
for (var i = pagingConfig.last.start; i <= pagingConfig.last.end; i++) {
var label = document.createElement("a");
label.className = "aweTbl-pagination-label".concat(i == currentPage ?
" currentPage " : "");
label.innerHTML = i;
label.href = "javascript:void(0);";
label.addEventListener("click", this.paging.bind(this, i), false);
paginationWrapper.appendChild(label);
}
} else if (true) {
for (var i = 1; i <= pageCount; i++) {
var label = document.createElement("a");
label.className = "aweTbl-pagination-label";
label.innerHTML = i;
label.href = "javascript:void(0);";
label.addEventListener("click", this.paging.bind(this, i), false);
paginationWrapper.appendChild(label);
}
}
this.paginationWrapper.appendChild(paginationWrapper);
}
function makeSearchBox() {
var divWrapper = document.createElement('DIV');
divWrapper.className = "aweTbl-searchBox";
var input = document.createElement('input');
input.type = "text";
input.className = "form-control";
input.placeholder = "Write + ENTER";
input.addEventListener("keydown", this.filter.bind(this, input), false);
divWrapper.appendChild(input);
this.searchboxWrapper.appendChild(divWrapper);
}
//internalFunction that create a table from json result
function getXhrResponse(xhr) {
if (xhr.status === 200) {
var loadingDiv = document.querySelector('.aweTbl-loading');
if (loadingDiv) {
this.tableWrapper.removeChild(loadingDiv);
}
var result = JSON.parse(xhr.responseText);
//console.log("these are what i had recievd from that url \n", result);
if (result.Length == 0) {
throw "There is now recorde ro make a table with";
}
//SaveResult in webStorage
sessionStorage.awesomeTabledata = xhr.responseText;
makeTable.call(this, result);
makeOtherstuff.call(this, result.length);
} else {
throw "i cant use url response as json,check url and make sure that it will respond as json";
}
}
function makeOtherstuff(resultLength) {
//check global options for Pagination user privilege
if (this.globalOptions.buildPagination) {
makePagination.call(this, resultLength, 1);
}
//check global options for search user privilege
if (this.globalOptions.buildSearch) {
makeSearchBox.call(this);
}
//check global options for pageSize Selectbox user privilege
if (this.globalOptions.buildPageSize) {
makePageSize.call(this);
}
}
AwesomeTableJs.prototype.changePageSize = function(pageSize) {
console.log(pageSize);
var size = parseInt(pageSize, 10);
if (size > 0) {
this.globalOptions.pageSize = size;
} else {
var dropDown = document.querySelector('.aweTbl-pageSize');
if (dropDown) {
this.globalOptions.pageSize = parseInt(dropDown.value, 10);
} else {
this.globalOptions.pageSize = 15;
}
}
this.paging(1);
}
function makePageSize() {
var dropDown = document.createElement('select');
dropDown.className = "aweTbl-pageSize";
// var self = this;
for (var i = 1; i <= 5; i++) {
var option = document.createElement('option');
option.innerHTML = i * 15;
dropDown.appendChild(option);
}
dropDown.addEventListener('change', this.changePageSize.bind(this,
''), false);
this.pageSizeWrapper.appendChild(dropDown);
}
function changeTableBody(result) {
var tbdy = document.createElement('tbody');
//get Object Array Length
var trlen = result.length;
//check If json data is object or string
if (typeof(result[0]) == "object") {
//Create Table With TR and TD
var keyLen = this.jsonKeys.length;
var take = this.globalOptions.pageSize < trlen ? this.globalOptions.pageSize :
trlen;
if (this.globalOptions.columnsTypes) {
for (var i = 0; i < take; i++) {
var tr = document.createElement("tr");
for (j = 0; j < keyLen; j++) {
var td = document.createElement("td");
if (Object.keys(this.globalOptions.columnsTypes).indexOf(this.jsonKeys[
j]) > -1) {
switch (this.globalOptions.columnsTypes[this.jsonKeys[j]]) {
case "image":
{
var img = document.createElement('img');
img.src = result[i][this.jsonKeys[j]];
img.alt = result[i][this.jsonKeys[j]];
img.className = "aweTbl-img-".concat(this.jsonKeys[j]);
td.appendChild(img);
break;
}
case "link":
{
var anchor = document.createElement('a');
anchor.href = result[i][this.jsonKeys[j]];
anchor.target = "_blank";
anchor.className = "aweTbl-link-".concat(this.jsonKeys[
j]);
anchor.innerHTML = result[i][this.jsonKeys[j]];
td.appendChild(anchor);
break;
}
default:
{
td.className = "aweTbl-text-".concat(this.jsonKeys[j]);
td.innerHTML = result[i][this.jsonKeys[j]];
}
}
} else {
td.className = "aweTbl-text-".concat(this.jsonKeys[j]);
td.innerHTML = result[i][this.jsonKeys[j]];
}
tr.appendChild(td);
}
tbdy.appendChild(tr);
}
} else {
for (var i = 0; i < take; i++) {
var tr = document.createElement("tr");
for (j = 0; j < keyLen; j++) {
var td = document.createElement("td");
td.className = "aweTbl-text-".concat(this.jsonKeys[j]);
td.innerHTML = result[i][this.jsonKeys[j]];
tr.appendChild(td);
}
tbdy.appendChild(tr);
}
}
var prevTbody = this.tableElement.querySelector("tbody");
if (prevTbody) {
this.tableElement.removeChild(prevTbody);
}
this.tableElement.appendChild(tbdy);
} else {
var tr = document.createElement("tr");
var td = document.createElement("td");
td.colSpan = 1000;
td.innerHTML = "Nothing found :(";
tr.appendChild(td);
tbdy.appendChild(tr);
var prevTbody = this.tableElement.querySelector("tbody");
if (prevTbody) {
this.tableElement.removeChild(prevTbody);
}
this.tableElement.appendChild(tbdy);
}
}
function makeTable(result) {
// TBODY
var tbdy = document.createElement('tbody');
//get Object Array Length
var trlen = result.length;
//check If json data is object or string
if (typeof(result[0]) == "object") {
//automatic create header
var header = document.createElement("thead");
for (var key in result[0]) {
var th = document.createElement("th");
var a = document.createElement("a");
a.innerHTML = key;
a.href = "javascript:void(0);";
a.setAttribute('data-sortKey', key);
a.setAttribute('data-sortDirection', "asc");
//check global options for sorting user privilege
if (this.globalOptions.buildSorting) {
a.addEventListener("click", this.sort.bind(this, a));
}
th.appendChild(a);
this.jsonKeys.push(key);
header.appendChild(th);
}
//Create Table With TR and TD
var keyLen = this.jsonKeys.length;
var take = this.globalOptions.pageSize < trlen ? this.globalOptions.pageSize :
trlen;
if (this.globalOptions.columnsTypes) {
for (var i = 0; i < take; i++) {
var tr = document.createElement("tr");
for (j = 0; j < keyLen; j++) {
var td = document.createElement("td");
if (Object.keys(this.globalOptions.columnsTypes).indexOf(this.jsonKeys[
j]) > -1) {
switch (this.globalOptions.columnsTypes[this.jsonKeys[j]]) {
case "image":
{
var img = document.createElement('img');
img.src = result[i][this.jsonKeys[j]];
img.alt = result[i][this.jsonKeys[j]];
img.className = "aweTbl-img-".concat(this.jsonKeys[j]);
td.appendChild(img);
break;
}
case "link":
{
var anchor = document.createElement('a');
anchor.href = result[i][this.jsonKeys[j]];
anchor.target = "_blank";
anchor.className = "aweTbl-link-".concat(this.jsonKeys[
j]);
anchor.innerHTML = result[i][this.jsonKeys[j]];
td.appendChild(anchor);
break;
}
default:
{
td.className = "aweTbl-text-".concat(this.jsonKeys[j]);
td.innerHTML = result[i][this.jsonKeys[j]];
}
}
} else {
td.className = "aweTbl-text-".concat(this.jsonKeys[j]);
td.innerHTML = result[i][this.jsonKeys[j]];
}
tr.appendChild(td);
}
tbdy.appendChild(tr);
}
} else {
for (var i = 0; i < take; i++) {
var tr = document.createElement("tr");
for (j = 0; j < keyLen; j++) {
var td = document.createElement("td");
td.className = "aweTbl-text-".concat(this.jsonKeys[j]);
td.innerHTML = result[i][this.jsonKeys[j]];
tr.appendChild(td);
}
tbdy.appendChild(tr);
}
}
var prevTbody = this.tableElement.querySelector("tbody");
if (prevTbody) {
this.tableElement.removeChild(prevTbody);
}
this.tableElement.appendChild(header);
this.tableElement.appendChild(tbdy);
} else {
console.log("string");
}
}
return AwesomeTableJs;
}));
|
import React from 'react'
import markdownCompiler from 'markdown-to-jsx'
import {diffToHtml} from '../util/dubdiff'
const ShowMarkdown = (props) => {
return <div>
{
props.text
? markdownCompiler(props.text)
: props.diff
? markdownCompiler(diffToHtml(props.diff))
: null
}
</div>
}
export default ShowMarkdown
|
/*
* Copyright (c) André Bargull
* Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms.
*
* <https://github.com/anba/es6draft>
*/
const {
assertSame, assertNotSame, assertNotNull,
assertThrows, assertBuiltinFunction,
} = Assert;
/* 26.2.3.3 get Reflect.Realm.prototype.global */
const get_global = Object.getOwnPropertyDescriptor(Reflect.Realm.prototype, "global").get;
assertBuiltinFunction(get_global, "get global", 0);
// steps 1-2 - TypeError if thisValue is not an object
{
let primitives = [void 0, true, false, 0, 1, 0.1, 0 / 0, "", "abc", Symbol()];
for (let v of primitives) {
assertThrows(TypeError, () => get_global.call(v));
}
}
// steps 1-2 - TypeError if thisValue is not a Realm object
{
let objects = [{}, [], Object, Object.create, function(){}, () => {}];
for (let v of objects) {
assertThrows(TypeError, () => get_global.call(v));
}
}
// steps 3-4 - TypeError if thisValue is an uninitialized Realm object
{
assertThrows(TypeError, () => get_global.call(Reflect.Realm[Symbol.create]()));
}
// step 5 - Return the Realm's [[globalThis]] object
{
let realmA = new Reflect.Realm(), realmB = new Reflect.Realm();
// Global object is an object type
assertNotNull(get_global.call(realmA));
assertSame(get_global.call(realmA), Object(get_global.call(realmA)));
// A new realm has a new global object
assertNotSame(this, get_global.call(realmA));
// Different realms have different global objects
assertNotSame(get_global.call(realmA), get_global.call(realmB));
// "get global" returns the global object
assertSame(get_global.call(realmA), get_global.call(realmA).Function("return this")());
}
|
import Item from './Item';
import resolve from '../../resolvers/resolve';
export default class Mustache extends Item {
constructor ( options ) {
super( options );
this.parentFragment = options.parentFragment;
this.template = options.template;
this.index = options.index;
if ( options.owner ) this.parent = options.owner;
this.isStatic = !!options.template.s;
this.model = null;
this.dirty = false;
}
bind () {
// try to find a model for this view
const model = resolve( this.parentFragment, this.template );
const value = model ? model.get() : undefined;
if ( this.isStatic ) {
this.model = { get: () => value };
return;
}
if ( model ) {
model.register( this );
this.model = model;
} else {
this.resolver = this.parentFragment.resolve( this.template.r, model => {
this.model = model;
model.register( this );
this.handleChange();
this.resolver = null;
});
}
}
handleChange () {
this.bubble();
}
rebind () {
if ( this.static ) return;
const model = resolve( this.parentFragment, this.template );
if ( model === this.model ) return;
if ( this.model ) this.model.unregister( this );
this.model = model;
if ( model ) model.register( this );
this.handleChange();
}
unbind () {
if ( !this.isStatic ) {
this.model && this.model.unregister( this );
this.model = undefined;
this.resolver && this.resolver.unbind();
}
}
}
|
(function() {
var AbstractView, BooleanView,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
AbstractView = require('./abstract_view');
BooleanView = (function(_super) {
__extends(BooleanView, _super);
function BooleanView() {
return BooleanView.__super__.constructor.apply(this, arguments);
}
BooleanView.setComponent({
html: {
"div.shadow-abstract-view .shadow-boolean-view": "{ item }"
},
css: {
".shadow-boolean-view": {
"color": "#ef2929"
}
}
});
return BooleanView;
})(AbstractView);
module.exports = BooleanView;
}).call(this);
//# sourceMappingURL=boolean_view.js.map
|
MapRoute.Map.Actions.View = function() {
MapRoute.Map.Actions.Action.apply(this, arguments);
};
MapRoute.Map.Actions.View.inherit(MapRoute.Map.Actions.Action, {
execute: function() {
MapRoute.Map.Actions.Action.prototype.execute.apply(this, arguments);
},
bindEvents: function() {
$.each(MapRoute.Map.Route.markers(), this.bindMarkerEvents.bind(this));
},
bindMarkerEvents: function(i, marker) {
marker.setCursor('pointer');
marker.setDraggable(true);
this.handlers.push(google.maps.event.addListener(marker, 'click', function(e) {
this.toggleInfoWindow(e, marker);
}.bind(this)));
this.bindInfoWindowEvents(marker);
},
bindInfoWindowEvents: function(marker) {
var content = $(marker.infoWindow.getContent());
// content.on('click.pin', 'a.remove-pin', function(e) {
// this.onRemoveMarkerClick.call(this, e, marker);
// }.bind(this));
},
toggleInfoWindow: function(e, marker) {
if (!marker.infoWindow.getMap()) {
marker.infoWindow.open(this.map, marker);
} else {
marker.infoWindow.close();
}
}
}); |
"use strict";
var request = require('request');
var fs = require('fs');
var Seq = require('seq');
var util = require('util');
var querystring = require('querystring');
var path = require('path');
var helper = require('./helper');
module.exports = function () {
return new Unio()
};
// allowed verbs
var VERBS = [
'delete',
'get',
'patch',
'post',
'put'
];
function Unio() {
var self = this;
self.specs = {};
// import specs from fs into unio
var specDir = path.resolve(__dirname, './specs');
var specs = fs.readdirSync(specDir).map(function (specFile) {
return path.resolve(__dirname, './specs/' + specFile)
});
specs.forEach(self.spec.bind(this))
}
// attach http verbs as methods on `unio`
VERBS.forEach(function (verb) {
Unio.prototype[verb] = function (resource, params, callback) {
if (!this.usingSpec) {
throw new Error('must call Unio.use() first to tell unio which resource to request.');
}
return this.request(verb, resource, params, callback);
}
});
/**
* Import a new REST API spec into Unio
*
* @param {Object or String or Array} spec
*
* `spec` can be:
* (1) Object (single API spec)
* (2) Array (Array of (1))
* (3) String representing:
* - local fs path to json file that
* is parsed as (1) or (2)
*
*/
Unio.prototype.spec = function (spec) {
var self = this;
if (Array.isArray(spec)) {
spec.forEach(function (entry) {
self.addSpec(entry)
});
return self;
} else if (typeof spec === 'object') {
return self.addSpec(spec);
} else if (typeof spec === 'string') {
//expects file on fs to be a json file
//or js file exporting an object
if (fs.existsSync(spec)) {
spec = require(spec);
return this.addSpec(spec);
} else {
throw new Error('string argument passed to `unio.spec()` does not exist on the local fs');
}
} else {
throw new Error('unsupported type supplied as first argument to `unio.spec()`. Got:' + typeof spec);
}
};
Unio.prototype.addSpec = function (spec) {
if (this.specs[spec.name]) {
throw new Error('spec with this name already exists.');
}
this.specs[spec.name] = spec;
return this
};
Unio.prototype.use = function (specName) {
if (!this.specs[specName])
throw new Error('Cannot use `' + specName + '`. Call unio.spec() to add this spec before calling .use().');
this.usingSpec = this.specs[specName];
return this;
};
/**
* Finalize and send the request, then pass control to `callback`.
*
* @param {String} verb http verb e.g. get, post
* @param {String} resource API resource e.g. search/tweets
* @param {Function} callback completion callback. Signature: function (err, res, reply) {}
*/
Unio.prototype.request = function (verb, resource, params, callback) {
var self = this;
var validCallback = callback && typeof callback === 'function';
verb = verb.toLowerCase();
if (typeof params === 'function') {
callback = params;
params = {};
}
// determine the matching resource from the spec
var specResource = self.findMatchingResource(verb, resource);
var specErr = new Error(verb.toUpperCase() + ' ' + resource + ' not supported for API `' +
this.usingSpec.name + '`. Make sure the spec is correct, or `.use()` the correct API.');
if (!specResource) {
if (validCallback) return callback(specErr);
throw specErr;
}
// validate `params` against the currently used spec
Object.keys(specResource.params).forEach(function (keyName) {
var isRequired = specResource.params[keyName] === 'required';
var validationErr = new Error('Invalid request: params object must have `' +
keyName + '`. It is listed as a required parameter in the spec.');
if (isRequired && typeof params[keyName] === 'undefined') {
if (validCallback) return callback(validationErr);
else throw validationErr;
}
});
var reqOpts = self.buildRequestOpts(verb, resource, specResource, params);
console.log('\nfinal reqOpts', util.inspect(reqOpts, true, 10, true));
return request(reqOpts, function (err, res, body) {
// pass error to callback, or throw if no callback was passed in
if (err) {
if (validCallback)
return callback(err, null);
throw err;
}
var parsed = null;
// attempt to parse the string as JSON
// if we fail, pass the callback the raw response body
try {
parsed = JSON.parse(body);
} catch (e) {
parsed = body;
} finally {
if (validCallback)
return callback(null, res, parsed);
}
})
};
/**
* Find the first matching API resource for `verb` and `resource`
* from the spec we are currently using.
*
* @param {String} verb HTTP verb; eg. 'get', 'post'.
* @param {String} resource user's requested resource.
* @return {Object} matching resource object from the spec.
*/
Unio.prototype.findMatchingResource = function (verb, resource) {
var self = this;
var specResource = null;
var resourceCandidates = this.usingSpec.resources;
// find the first matching resource in the spec, by
// checking the name and then the path of each resource in the spec
resourceCandidates.some(function (candidate, index) {
//var normName = candidate.name && self.normalizeUri(candidate.name);
var normName = candidate.name && path.normalize(candidate.name);
//var normPath = candidate.path && self.normalizeUri(candidate.path);
var normPath = candidate.path && path.normalize(candidate.path);
var rgxName = new RegExp(normName);
var rgxPath = new RegExp(normPath);
// check for a match in the resource name or path
var nameMatch = (normName && rgxName.test(resource))
|| (normPath && rgxPath.test(resource));
// check that the verbs allowed with this resource match `verb`
var verbMatch = candidate.methods.indexOf(verb) !== -1;
// console.log('nameMatch: %s, candidate.name: %s, candidate.path: %s, resource: %s, rgxName: %s', nameMatch, candidate.name, candidate.path, resource, rgxName)
if (nameMatch && verbMatch) {
specResource = self.usingSpec.resources[index];
return true;
}
});
//console.log(this.usingSpec);
specResource.auth = this.usingSpec.auth; //include basic authentication if it exists
specResource.strictSSL = this.usingSpec.strictSSL; //include strict SSL checking
return specResource;
}
Unio.prototype.buildRequestOpts = function (verb, resource, specResource, params) {
var self = this;
var paramsClone = helper.clone(params);
var reqOpts = {
method: verb
};
// determine absolute url to resource
// if resource path is an absolute url, just hit that url directly
var rgxDomain = /^http/;
if (rgxDomain.test(specResource.path)) {
reqOpts.url = specResource.path
} else {
var queryPath = specResource.path ? specResource.path : resource;
// otherwise append the resource url fragment to the api root
reqOpts.url = this.usingSpec.api_root + '/' + queryPath
}
// add auth to request if basic authentication
reqOpts.auth = specResource.auth ? specResource.auth : null;
reqOpts.strictSSL = specResource.strictSSL ? specResource.strictSSL : null;
var rgxParam = /\/:(\w+)/g;
// url-encode all parameters needed to build the url,
// and strip them from `paramsClone`
// if /:params are used in the resource path, populate them
reqOpts.url = reqOpts.url.replace(rgxParam, function (hit) {
var paramName = hit.slice(2);
var userValue = paramsClone[paramName];
// if user supplied extra values in the params object that
// the spec doesn't take, ignore them
if (!userValue) {
var missingUrlParamErr = new Error('Params object is missing a required parameter from url path: ' + paramName + '.');
throw new Error(missingUrlParamErr)
}
var paramVal = helper.clone(userValue);
// strip this off `paramsClone`, so we don't also encode it
// in the querystring or body of `reqOpts`
delete paramsClone[paramName];
// console.log('paramName: %s. paramVal: %s', paramName, paramVal)
return '/' + paramVal
});
// encode the oauth params (if specified) and strip from `paramsClone`
if (paramsClone.oauth) {
// handle oauth info from params
var oauthClone = helper.clone(paramsClone.oauth);
reqOpts.oauth = paramsClone.oauth;
delete paramsClone.oauth;
}
// encode the rest of the parameters as appropriate (querystring or body)
if ([ 'post', 'put', 'patch' ].indexOf(verb) !== -1) {
reqOpts.body = self.urlEncode(paramsClone);
reqOpts.headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/json"
};
//DON'T DO THIS BECAUSE IT SETS THE CONTENT-TYPE TO 'JSON' WHEN IN SHOULD BE X-WWW-FORM-URLENCODED
// encode the body as JSON
//reqOpts.json = true
} else {
// otherwise encode any remaining params as querystring
if (Object.keys(paramsClone).length)
reqOpts.qs = paramsClone
}
return reqOpts
};
Unio.prototype.urlEncode = function (obj) {
console.log('querystring', querystring.stringify(obj));
return querystring.stringify(obj)
.replace(/\!/g, "%21")
.replace(/\'/g, "%27")
.replace(/\(/g, "%28")
.replace(/\)/g, "%29")
.replace(/\*/g, "%2A")
};
/**
* Normalize `uri` string to its corresponding regex string.
* Used for matching unio requests to the appropriate resource.
*
* @param {String} uri
* @return {String}
*/
Unio.prototype.normalizeUri = function (uri) {
var normUri = uri
// normalize :params
.replace(/:w+/g, ':w+')
// string forward slash -> regex match for forward slash
.replace(/\//g, '\\/')
return '^' + normUri + '$'
};
|
import {createAction} from 'redux-actions';
export default createAction('WINDOW_RESIZE', ({width, height}) => ({width, height}));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.