code
stringlengths 2
1.05M
|
|---|
cl = function(msg){
if (window.console && console.log) {
console.log(msg);
}
};
ll = function(msg, prepend, type, append){
if (window.console && console.log) {
var d = performance.now();
prepend ? '': prepend = '';
console.log('=>'+prepend+': '+msg);
if(!type) type = 'normal';
$('#events').append('<div class="msgwrap '+type+'"><div class="time">'+d.toFixed(2)+'</div><div class="type">'+prepend+'</div><div class="msg"> '+msg+'</div></div>');
if(type && type=='error') alert('fatal error: restart test');
}
};
jsl = function(obj){
var p = JSON.stringify(obj, null, 4);
$('#results').append('<pre>'+p+'</pre>');
};
filel = function(){
var list_of_files = [].concat(vrtTest.results.files.facevideos, vrtTest.results.files.timedmetadatas,vrtTest.results.files.logs);
for(var j = 0; j<list_of_files.length; j++){
$('#filelist').append('<div class="msgwrap normal"><a href="'+list_of_files[j]+'" target="_blank">'+j+':'+list_of_files[j].slice(-4)+'</a></div>');
}
};
clog = function (msg,type) {
ll(msg, 'EVENT',type);
};
dlog = function (msg) {
ll(msg, 'DESCRIBE');
};
ilog = function (msg) {
ll(msg, 'IT');
};
tlog = function (msg) {
ll(msg, '');
};
/*
TODO test list
publish
unpublish
save
event
vrt_event_fatal_error
vrt_event_create_response
vrt_event_no_requirement
vrt_event_browser_old
vrt_event_recorder_publish
vrt_event_recorder_unpublish
vrt_event_producer_camera_blocked
vrt_event_recorder_html5
vrt_event_flash_no
vrt_event_flash_old
vrt_event_flash_is_present
vrt_event_flash_version_ok
vrt_event_preview_loaded: all objects are loaded
vrt_event_producer_camera_ok: the user camera is ok
producer_init_camera_ok the user camera is ok (real=
vrt_event_api_login_fail: login to api is failed
vrt_event_producer_camera_muted: webcam is waiting for user permission
vrt_event_producer_camera_blocked: user block webcam
vrt_event_start_video_session: the first video stimuli is played and producer is recording
vrt_event_video_step_completed: one video stimuli is ended and facevideos is uplodead, a responseId is received
vrt_event_user_next_video: user is ready for next video
vrt_event_skip_or_end_video: video stimuli reach the end or skipped by user
vrt_event_video_session_complete: all video stimuli are played
vrt_event_user_session_complete: user finish his session
vrt_event_flash_old: the Flash version included is too old (Flash 11.1.0 is required)
vrt_event_flash_no: there is no Flash included
vrt_event_producer_no_camera_found: no camera found
vrt_event_frame_open: use this event to open a frame OR user the openFrame() method
vrt_event_frame_close: triggere by the closeFrame() method
vrt_event_create_response: if the option responseAtStart is true, this event will send you the response id before the video play
vrt_event_browser_old: this error is trigger when the browser is IE 9 or older
*/
/*
sequences
setting
html tag
js object init
platform check
no ios
mo old browser
if flash
check flash
webcam
have a webcam EVT[]
webcam allowed EVT[]
*/
window.vrtTest = {
time:{
a:null,b:null,c:null,d:null,e:null,playback:null,recorder:null
},
path:null,
rid: null,
haveWebcam:null,
webcamAllowed:null,
maxTimeDiffAllowed:300,
responseID:null,
type:null,
videoext: null,
isMobile: false,
isDesktop: false,
connected: null,
hasPlay: false,
hasRec: false,
respondentId:null,
responseId:[],
tempdata: null,
videoToTest: 0,
isPlayAndPublishDone: false,
handleIsPlayAndPublish: null,
isStopAndUnpublishDone: false,
handleIsStopAndUnpublish: null,
currentMediaIndex: 0,
stimuliNumber: null,
stimuli: null,
proceedToShow: false,
results:{
db: {
research: null,
respondent:null,
stimuli:[],
responses:[],
respondentMetadata:{},
responsesMetadata:[],
facevideos:[],
timeseries: []
},
files: {
logs:[],
facevideos:[],
timedmetadatas:[]
},
filesResp: {
logs:[],
facevideos:[],
timedmetadatas:[]
},
stimuli:[]
},
isDemo: false
};
var mobilecheck = function() {
return vrt.isAndroid || !vrt.requirement || vrt.isChromeMobile
};
var setType = function(type){
if(window.vrtTest.type!=null) return;
if(!type || type=='html5'){
window.vrtTest.type='html5';
window.vrtTest.videoext='webm';
}else{
window.vrtTest.type='flash';
window.vrtTest.videoext='mp4';
}
$(vrtTest).trigger('vrttest_event_settype')
};
var vrtOnEvent = function(){
$(vrt).on('vrt_event_recorder_html5', function () {
clog('vrt_event_recorder_html5');
setType('html5')
});
/* flash yes */
$(vrt).on('vrt_event_flash_old', function () {
clog('vrt_event_flash_old','warning');
setType('flash');
});
$(vrt).on('vrt_event_flash_no', function () {
clog('vrt_event_flash_no','warning');
setType('flash');
});
$(vrt).on('vrt_event_flash_is_present', function () {
clog('vrt_event_flash_is_present');
setType('flash');
});
$(vrt).on('vrt_event_flash_version_ok', function () {
clog('vrt_event_flash_version_ok');
setType('flash');
});
/* flash yes end */
$(vrt).on('producer_init_camera_ok', function () {
clog('producer_init_camera_ok');
window.vrtTest.haveWebcam=true;
window.vrtTest.webcamAllowed=true;
});
$(vrt).on('vrt_event_producer_camera_found', function () {
clog('vrt_event_producer_camera_found');
window.vrtTest.haveWebcam=true;
});
$(vrt).on('vrt_event_producer_no_camera_found', function () {
clog('vrt_event_producer_no_camera_found','warning');
window.vrtTest.haveWebcam=false;
});
$(vrt).on('vrt_event_streamname', function(e, data){
clog('vrt_event_streamname');
window.vrtTest.path=data.streamname;
});
$(vrt).on('producer_init_ok', function () {
clog('producer_init_ok');
});
$(vrt).on('vrt_event_producer_camera_ok', function () {
clog('vrt_event_producer_camera_ok');
window.vrtTest.webcamAllowed=true;
});
$(vrt).on('vrt_event_producer_camera_muted', function () {
clog('vrt_event_producer_camera_muted','warning');
window.vrtTest.webcamAllowed=false;
});
$(vrt).on('vrt_event_producer_camera_blocked', function () {
clog('vrt_event_producer_camera_blocked','warning');
window.vrtTest.webcamAllowed=false;
});
$(vrt).on('vrtstep_connect', function () {
clog('vrtstep_connect');
window.vrtTest.connected=true;
});
$(vrt).on('vrt_event_respondent_created', function () {
clog('vrt_event_respondent_created');
tlog(vrt.respondentId);
vrtTest.respondentId = vrt.respondentId;
});
$(vrt).on('vrtevent_player_ts', function (evt, data) {
clog('vrtevent_player_ts_'+data.status);
if(data.status==11){
$(vrtTest).trigger('vrttest_player_play')
}
});
$(vrt).on('vrt_event_video_step_completed', function (evt, data) {
clog('vrt_event_video_step_completed');
if(data.responseId){
tlog(data.responseId);
vrtTest.responseId.push(data.responseId);
tlog(window.vrt.options.customData);
}
});
$(vrt).on('vrt_event_video_session_proceedToShow', function () {
clog('vrt_event_video_session_proceedToShow');
});
$(vrt).on('vrt_event_start_video_session', function () {
clog('vrt_event_start_video_session');
});
$(vrt).on('vrt_event_user_next_video', function () {
clog('vrt_event_user_next_video');
});
$(vrtTest).on('vrttest_player_play', function (e, data) {
clog('vrttest_player_play');
vrtTest.time.a = performance.now().toFixed(0);
isPlayAndPublish()
});
$(vrt).on('vrt_event_recorder_publish', function (e, data) {
clog('vrt_event_recorder_publish');
vrtTest.time.b = performance.now().toFixed(0);
isPlayAndPublish()
});
$(vrt).on('vrt_event_create_response', function (e, data) {
clog('vrt_event_create_response #'+data.responseId);
});
$(window.vrt).on('vrt_event_stimuli_end', function (e, data) {
clog('vrt_event_stimuli_end');
vrtTest.time.c = performance.now().toFixed(0);
isStopAndUnpublish();
});
$(window.vrt).on('vrt_event_recorder_unpublish', function (e, data) {
clog('vrt_event_recorder_unpublish');
vrtTest.time.d = performance.now().toFixed(0);
isStopAndUnpublish();
});
$(window.vrt).on('vrt_event_recorder_save', function(){
clog('vrt_event_producer_saved');
vrtTest.time.e = performance.now().toFixed(0);
});
$(window.vrt).on('vrt_event_recorder_save_error', function(){
clog('vrt_event_producer_no_facevideo_saved','error');
vrtTest.time.e = false;
});
$(window.vrt).on('vrt_event_error_plugin_error', function(){
clog('vrt_event_error_plugin_error','error');
});
$(window.vrt).on('vrt_event_error_session_error', function(){
clog('vrt_event_error_session_error','error');
});
};
function isPlayAndPublish(){
if(vrtTest.time.a && vrtTest.time.b && !vrtTest.isPlayAndPublishDone){
vrtTest.isPlayAndPublishDone = true;
if (vrtTest.handleIsPlayAndPublish) clearTimeout(vrtTest.handleIsPlayAndPublish);
tlog('vrttest_playandpublish');
$(vrtTest).trigger('vrttest_playandpublish')
}
vrtTest.handleIsPlayAndPublish = setTimeout(function(){
if(!vrtTest.isPlayAndPublishDone){
vrtTest.isPlayAndPublishDone = true;
tlog('vrttest_playandpublish TO');
$(vrtTest).trigger('vrttest_playandpublish')
}
},(vrtTest.maxTimeDiffAllowed*2));
};
function isStopAndUnpublish(){
if(vrtTest.time.c && vrtTest.time.d && !vrtTest.isStopAndUnpublishDone){
vrtTest.isStopAndUnpublishDone = true;
if (vrtTest.handleIsStopAndUnpublish) clearTimeout(vrtTest.handleIsStopAndUnpublish);
tlog('vrttest_stopandunpublish');
$(vrtTest).trigger('vrttest_stopandunpublish')
}
vrtTest.handleIsStopAndUnpublish = setTimeout(function(){
if(!vrtTest.isStopAndUnpublishDone){
vrtTest.isStopAndUnpublishDone = true;
tlog('vrttest_stopandunpublish TO');
$(vrtTest).trigger('vrttest_stopandunpublish')
}
},(vrtTest.maxTimeDiffAllowed*2));
};
function cleanUpStart() {
vrtTest.time.a = 0;
vrtTest.time.b = 0;
vrtTest.isPlayAndPublishDone = false;
if (vrtTest.handleIsPlayAndPublish) clearTimeout(vrtTest.handleIsPlayAndPublish);
vrtTest.proceedToShow = false;
}
function cleanUpEnd(){
vrtTest.time.c = 0;
vrtTest.time.d = 0;
vrtTest.isStopAndUnpublishDone = false;
if(vrtTest.handleIsStopAndUnpublish) clearTimeout(vrtTest.handleIsStopAndUnpublish);
}
function isVideoListComplete(videoList) {
if (videoList instanceof Array) {
if (videoList.length <= 0) {
return false;
}
for (var i = 0; i < videoList.length; i++) {
if (videoList[i] instanceof Object) {
if (!videoList[i].id) return false;
if (!videoList[i].path) return false;
if (!videoList[i].name) return false;
} else return false;
}
return true;
} else return false;
};
function alertMessage(msg){
if(console.log)console.log('TEST MSG');
if(console.log)console.log(msg);
};
function fvToMetadata(remotelocation){
return remotelocation.substr(0, remotelocation.lastIndexOf(".")) + ".json";;
};
function fvTolog(filename, full){
var original = parseURL(full);
filename = filename.substr(0, filename.lastIndexOf(".")) + ".log";
return 'https://'+original.domain+'/logs/remote/'+filename;
}
function getFile(name,type){
//http://mediabox.crowdemotion.co.uk:8082/contents/test_0__1535005240.json
var ret = fileExists("http://"+vrt.producerStreamUrl+":8082/contents/"+name+'.'+type);
if(ret.status == 200){
if(ret.response.length>500 && type == 'json'){
return true;
}else if(ret.response.length>3000 && type == 'mp4'){
return true;
}else if(ret.response.length>1){
return true;
}else return false;
}else{
return false
}
};
function createCORSRequest(method, url) {
method? '': method ='GET';
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// XHR for Chrome/Firefox/Opera/Safari.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
// XDomainRequest for IE.
xhr = new XDomainRequest();
xhr.open(method, url);
} else {
// CORS not supported.
xhr = null;
}
return xhr;
}
function makeCorsRequest(url) {
// All HTML5 Rocks properties support CORS.
var xhr = createCORSRequest('GET', url);
if (!xhr) {
return false;
}
// Response handlers.
xhr.onload = function() {
return xhr;
// alert('Response from CORS request to ' + url + ': ' + title);
};
xhr.onerror = function() {
return false
// alert('Woops, there was an error making the request.');
};
xhr.send();
}
function fileExists(url){
if(!url)return false;
if(vrtTest.isDemo){
var u = new URL(url);
url = window.location.origin + u.pathname
}
return _fileExists(url);
}
function _fileExists(url) {
var rnd = ''; //'&num='+Math.floor((Math.random() * 1000) + 1);
var origin = ''; //"?origin="+window.location.host;
var req = new XMLHttpRequest();
req.open('GET', url+origin+rnd, false);
req.send();
console.log('======fileExists======');
console.log(req);
return req;
//return req;//req.status==200;
};
var stopTest = function(msg){
var m = msg ? msg+' ' : '';
throw new Error(m+"Aborting test.");
};
this.gup = function( name, url ) {
if (!url) url = location.href;
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( url );
return results == null ? null : results[1];
};
window.gup = gup;
function parseURL(url){
parsed_url = {}
if ( url == null || url.length == 0 )
return parsed_url;
protocol_i = url.indexOf('://');
parsed_url.protocol = url.substr(0,protocol_i);
remaining_url = url.substr(protocol_i + 3, url.length);
domain_i = remaining_url.indexOf('/');
domain_i = domain_i == -1 ? remaining_url.length - 1 : domain_i;
parsed_url.domain = remaining_url.substr(0, domain_i);
parsed_url.path = domain_i == -1 || domain_i + 1 == remaining_url.length ? null : remaining_url.substr(domain_i + 1, remaining_url.length);
domain_parts = parsed_url.domain.split('.');
switch ( domain_parts.length ){
case 2:
parsed_url.subdomain = null;
parsed_url.host = domain_parts[0];
parsed_url.tld = domain_parts[1];
break;
case 3:
parsed_url.subdomain = domain_parts[0];
parsed_url.host = domain_parts[1];
parsed_url.tld = domain_parts[2];
break;
case 4:
parsed_url.subdomain = domain_parts[0];
parsed_url.host = domain_parts[1];
parsed_url.tld = domain_parts[2] + '.' + domain_parts[3];
break;
}
parsed_url.parent_domain = parsed_url.host + '.' + parsed_url.tld;
return parsed_url;
}
var testStart = function () {
mocha.run();
};
var apiLoadDataVideo = function (ceInit, rkey, akey, cb) {
var ceClient = new CEClient(ceInit);
ceClient.setToken(akey);
ceClient.loadResearch(rkey, function (res) {
ceClient.loadMediaList(res.id,
function (res, err) {
ceClient.logout();
cb(res, err);
});
});
};
var apiLoadDataResults = function (ceInit, rkey, akey, respondentid , cb) {
var cc = new CEClient(ceInit);
cc.setToken(akey);
cc.readRespondent(respondentid,
function (res) {
if(res && res.status)
vrtTest.results.db.respondent = {};
else
vrtTest.results.db.respondent = res;
}
);
cc.searchResponseIN('respondent_id',respondentid,
function (res, err) {
vrtTest.results.db.responses = res;
if(res && res.status)
vrtTest.results.db.responses = [];
else
vrtTest.results.db.responses = res;
var i = 0;
while(res[i]){
cc.readResponseCustomData(res[i].id,
function (res, err) {
if (res && res.status)
vrtTest.results.db.responsesMetadata.push([]);
else
vrtTest.results.db.responsesMetadata.push(res);
});
cc.readFacevideoInfo(res[i].id,
function (res, err) {
vrtTest.results.db.facevideos.push(res);
if(res.remoteLocation){
vrtTest.results.files.facevideos.push(res.remoteLocation);
vrtTest.results.files.timedmetadatas.push(fvToMetadata(res.remoteLocation));
vrtTest.results.files.logs.push(fvTolog(res.filename,res.remoteLocation));
}
});
i++;
};
});
cc.readRespondentCustomData(respondentid,
function (res, err) {
if(err)
vrtTest.results.db.respondentMetadata = null
else
vrtTest.results.db.respondentMetadata = res;
});
cc.loadResearch(rkey, function (res) {
vrtTest.results.db.research = res;
cc.loadMediaList(res.id,
function (res, err) {
vrtTest.results.db.stimuli = res;
});
});
//TODO fix this
setTimeout(function(){
cc.logout();
if(cb)cb()
}.bind(this),2000);
};
Boolean.parse = function(val) {
var falsy = /^(?:f(?:alse)?|no?|0+)$/i;
return !falsy.test(val) && !!val;
};
|
module.exports = function(mongoose) {
var config = require(process.cwd() + '/config');
var sha256 = require('sha256');
return function(req, res) {
if(req.method == "GET") {
if(req.session.user) {
res.json(req.session.user);
console.log("User logged in: ", req.session.user.username);
} else {
res.json(false);
}
} else if(req.method == "POST") {
if(!req.body.username || !req.body.password) {
res.json(false);
return;
}
// encrypt password
req.body.password = sha256(config.hashSalt + req.body.password);
mongoose.model("User").findOne(req.body, function(err, data) {
if(err) {
throw err;
}
// we never store the password
data && (data.password = undefined);
// store the other info in session
data && (req.session.user = data);
// return the logged in user if there is one
res.json(data ? data : false);
});
} else if(req.method == "DELETE") {
req.session.destroy(function(err) {
if(err) {
throw err;
}
res.json(true);
});
} else {
res.json({error: "Method not allowed"});
}
};
};
|
/* eslint-disable ember/no-mixins, ember/no-new-mixins */
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import Route from '@ember/routing/route';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
module('ApplicationRoute', function(hooks) {
setupTest(hooks);
hooks.beforeEach(function() {
this.owner.register('route:application', Route.extend(ApplicationRouteMixin));
});
test('is still testable when using the ApplicationRouteMixin', function(assert) {
const route = this.owner.lookup('route:application');
assert.ok(route);
});
});
|
/* Jison generated parser */
var parser = (function(){
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"pattern":3,"route":4,"EOF":5,"parts":6,"part":7,"OPEN_OPTIONAL":8,"CLOSE":9,"OPEN_PARAM":10,"substrings":11,"STRING":12,"$accept":0,"$end":1},
terminals_: {2:"error",5:"EOF",8:"OPEN_OPTIONAL",9:"CLOSE",10:"OPEN_PARAM",12:"STRING"},
productions_: [0,[3,2],[4,1],[4,0],[6,1],[6,2],[7,3],[7,3],[7,1],[11,1],[11,2]],
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: return $$[$0-1]
break;
case 2: this.$ = $$[$0];
break;
case 3: this.$ = [];
break;
case 4: this.$ = [$$[$0]];
break;
case 5: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break;
case 6: this.$ = new yy.OptionalGroupNode($$[$0-1]);
break;
case 7: this.$ = new yy.ParamNode($$[$0-1]);
break;
case 8: this.$ = new yy.StringNode($$[$0]);
break;
case 10: this.$ = $$[$0-1] + $$[$0];
break;
}
},
table: [{3:1,4:2,5:[2,3],6:3,7:4,8:[1,5],10:[1,6],12:[1,7]},{1:[3]},{5:[1,8]},{5:[2,2],7:9,8:[1,5],9:[2,2],10:[1,6],12:[1,7]},{5:[2,4],8:[2,4],9:[2,4],10:[2,4],12:[2,4]},{4:10,6:3,7:4,8:[1,5],9:[2,3],10:[1,6],12:[1,7]},{11:11,12:[1,12]},{5:[2,8],8:[2,8],9:[2,8],10:[2,8],12:[2,8]},{1:[2,1]},{5:[2,5],8:[2,5],9:[2,5],10:[2,5],12:[2,5]},{9:[1,13]},{9:[1,14],12:[1,15]},{9:[2,9],12:[2,9]},{5:[2,6],8:[2,6],9:[2,6],10:[2,6],12:[2,6]},{5:[2,7],8:[2,7],9:[2,7],10:[2,7],12:[2,7]},{9:[2,10],12:[2,10]}],
defaultActions: {8:[2,1]},
parseError: function parseError(str, hash) {
throw new Error(str);
},
parse: function parse(input) {
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
this.lexer.setInput(input);
this.lexer.yy = this.yy;
this.yy.lexer = this.lexer;
this.yy.parser = this;
if (typeof this.lexer.yylloc == "undefined")
this.lexer.yylloc = {};
var yyloc = this.lexer.yylloc;
lstack.push(yyloc);
var ranges = this.lexer.options && this.lexer.options.ranges;
if (typeof this.yy.parseError === "function")
this.parseError = this.yy.parseError;
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
function lex() {
var token;
token = self.lexer.lex() || 1;
if (typeof token !== "number") {
token = self.symbols_[token] || token;
}
return token;
}
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
while (true) {
state = stack[stack.length - 1];
if (this.defaultActions[state]) {
action = this.defaultActions[state];
} else {
if (symbol === null || typeof symbol == "undefined") {
symbol = lex();
}
action = table[state] && table[state][symbol];
}
if (typeof action === "undefined" || !action.length || !action[0]) {
var errStr = "";
if (!recovering) {
expected = [];
for (p in table[state])
if (this.terminals_[p] && p > 2) {
expected.push("'" + this.terminals_[p] + "'");
}
if (this.lexer.showPosition) {
errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
} else {
errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
}
this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
}
}
if (action[0] instanceof Array && action.length > 1) {
throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
}
switch (action[0]) {
case 1:
stack.push(symbol);
vstack.push(this.lexer.yytext);
lstack.push(this.lexer.yylloc);
stack.push(action[1]);
symbol = null;
if (!preErrorSymbol) {
yyleng = this.lexer.yyleng;
yytext = this.lexer.yytext;
yylineno = this.lexer.yylineno;
yyloc = this.lexer.yylloc;
if (recovering > 0)
recovering--;
} else {
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
len = this.productions_[action[1]][1];
yyval.$ = vstack[vstack.length - len];
yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
if (ranges) {
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
}
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
if (typeof r !== "undefined") {
return r;
}
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]);
vstack.push(yyval.$);
lstack.push(yyval._$);
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
return true;
}
}
return true;
}
};
/* Jison generated lexer */
var lexer = (function(){
var lexer = ({EOF:1,
parseError:function parseError(str, hash) {
if (this.yy.parser) {
this.yy.parser.parseError(str, hash);
} else {
throw new Error(str);
}
},
setInput:function (input) {
this._input = input;
this._more = this._less = this.done = false;
this.yylineno = this.yyleng = 0;
this.yytext = this.matched = this.match = '';
this.conditionStack = ['INITIAL'];
this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
if (this.options.ranges) this.yylloc.range = [0,0];
this.offset = 0;
return this;
},
input:function () {
var ch = this._input[0];
this.yytext += ch;
this.yyleng++;
this.offset++;
this.match += ch;
this.matched += ch;
var lines = ch.match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno++;
this.yylloc.last_line++;
} else {
this.yylloc.last_column++;
}
if (this.options.ranges) this.yylloc.range[1]++;
this._input = this._input.slice(1);
return ch;
},
unput:function (ch) {
var len = ch.length;
var lines = ch.split(/(?:\r\n?|\n)/g);
this._input = ch + this._input;
this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
//this.yyleng -= len;
this.offset -= len;
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length-1);
this.matched = this.matched.substr(0, this.matched.length-1);
if (lines.length-1) this.yylineno -= lines.length-1;
var r = this.yylloc.range;
this.yylloc = {first_line: this.yylloc.first_line,
last_line: this.yylineno+1,
first_column: this.yylloc.first_column,
last_column: lines ?
(lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
this.yylloc.first_column - len
};
if (this.options.ranges) {
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
}
return this;
},
more:function () {
this._more = true;
return this;
},
less:function (n) {
this.unput(this.match.slice(n));
},
pastInput:function () {
var past = this.matched.substr(0, this.matched.length - this.match.length);
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
},
upcomingInput:function () {
var next = this.match;
if (next.length < 20) {
next += this._input.substr(0, 20-next.length);
}
return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
},
showPosition:function () {
var pre = this.pastInput();
var c = new Array(pre.length + 1).join("-");
return pre + this.upcomingInput() + "\n" + c+"^";
},
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) this.done = true;
var token,
match,
tempMatch,
index,
col,
lines;
if (!this._more) {
this.yytext = '';
this.match = '';
}
var rules = this._currentRules();
for (var i=0;i < rules.length; i++) {
tempMatch = this._input.match(this.rules[rules[i]]);
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
match = tempMatch;
index = i;
if (!this.options.flex) break;
}
}
if (match) {
lines = match[0].match(/(?:\r\n?|\n).*/g);
if (lines) this.yylineno += lines.length;
this.yylloc = {first_line: this.yylloc.last_line,
last_line: this.yylineno+1,
first_column: this.yylloc.last_column,
last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
this.yytext += match[0];
this.match += match[0];
this.matches = match;
this.yyleng = this.yytext.length;
if (this.options.ranges) {
this.yylloc.range = [this.offset, this.offset += this.yyleng];
}
this._more = false;
this._input = this._input.slice(match[0].length);
this.matched += match[0];
token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
if (this.done && this._input) this.done = false;
if (token) return token;
else return;
}
if (this._input === "") {
return this.EOF;
} else {
return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
{text: "", token: null, line: this.yylineno});
}
},
lex:function lex() {
var r = this.next();
if (typeof r !== 'undefined') {
return r;
} else {
return this.lex();
}
},
begin:function begin(condition) {
this.conditionStack.push(condition);
},
popState:function popState() {
return this.conditionStack.pop();
},
_currentRules:function _currentRules() {
return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
},
topState:function () {
return this.conditionStack[this.conditionStack.length-2];
},
pushState:function begin(condition) {
this.begin(condition);
}});
lexer.options = {};
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
var YYSTATE=YY_START
switch($avoiding_name_collisions) {
case 0: this.begin("escape");
break;
case 1: this.popState(); return "STRING";
break;
case 2: return "STRING";
break;
case 3: return "STRING";
break;
case 4: this.begin("param"); return "OPEN_PARAM";
break;
case 5: this.begin("optional"); return "OPEN_OPTIONAL";
break;
case 6: this.popState(); return "CLOSE";
break;
case 7: this.popState(); return "CLOSE";
break;
case 8: return "STRING";
break;
case 9: return 5;
break;
}
};
lexer.rules = [/^(?:\\(?=[{}()]))/,/^(?:[{}()])/,/^(?:\\(?![{}()]))/,/^(?:[^{}()\\]+)/,/^(?:\{)/,/^(?:\()/,/^(?:\})/,/^(?:\))/,/^(?:\}|\))/,/^(?:$)/];
lexer.conditions = {"escape":{"rules":[0,1,2,3,4,5],"inclusive":false},"param":{"rules":[0,2,3,4,5,6],"inclusive":false},"optional":{"rules":[0,2,3,4,5,7,9],"inclusive":false},"INITIAL":{"rules":[0,2,3,4,5,8,9],"inclusive":true}};
return lexer;})()
parser.lexer = lexer;
function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
return new Parser;
})();
module.exports = { parser: parser };
|
var webpack = require('webpack');
var path = require('path');
var BUILD_DIR = path.resolve(__dirname, '../techbot_web/static');
var APP_DIR = path.resolve(__dirname, 'src/app');
var config = {
entry: APP_DIR + '/index.jsx',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
resolve: {
extensions: ['.js', '.jsx', '.scss'],
modules: [
'node_modules'
]
},
module : {
loaders : [
{
test : /\.jsx?/,
include : APP_DIR,
loader : 'babel-loader',
query: {
presets: ['es2015', 'react']
}
},
{ test: /\.css/, loader: "style-loader!css-loader" },
{test: /\.scss$/, loaders: [ 'style', 'css', 'sass' ]},
{
test: /\.(png|jpg|)$/,
loader: 'url-loader?limit=200000'
},
{
test: /\.(ttf|eot|woff|woff2)$/,
loader: 'file-loader',
options: {
name: '../techbot_web/static/fonts/[name].[ext]',
},
}
]
}
};
module.exports = config;
|
/**
* PipelineTimer
* Keeps track of the time left for a HIT and updates the page as necessary.
* onExpiration will be de-thunked when the timer expires.
*/
PipelineTimer.create = function(serverTimestamp, counterId, totalSeconds, endTime, onExpiration) {
var offset = new ClientOffset(serverTimestamp);
OnLoadHandler.functions.push(function() {
var counter = document.getElementById(counterId);
var timer = new PipelineTimer(offset, counter, totalSeconds, endTime, onExpiration);
timer.start();
});
}
function PipelineTimer(offset, counterElement, totalSeconds, endTime, onExpiration) {
this.offset = offset;
this.counterElement = counterElement;
this.totalSeconds = totalSeconds;
this.endTime = endTime;
this.onExpiration = onExpiration;
}
PipelineTimer.prototype.start = function() {
this.looping = true;
this.loop();
}
PipelineTimer.prototype.stop = function() {
this.looping = false;
}
PipelineTimer.prototype.loop = function() {
this.count();
if (this.looping) {
var _this = this;
setTimeout(function() { _this.loop() }, 1000);
}
}
PipelineTimer.prototype.count = function() {
var now = new Date();
var millisecondsRemaining = this.endTime.getTime() - now.getTime() + this.offset.getMilliseconds();
var secondsRemaining = Math.floor(millisecondsRemaining / 1000);
if (secondsRemaining > 0) {
var secondsElapsed = Math.max(totalSeconds - secondsRemaining, 0);
this.setCounter(secondsElapsed);
} else {
this.onExpiration && this.onExpiration();
this.setCounter(this.totalSeconds);
this.stop();
}
}
PipelineTimer.prototype.setCounter = function(seconds) {
var counterValue = this.formatTime(seconds);
this.counterElement.innerHTML = counterValue;
this.counterElement.size = counterValue.length - 1;
}
PipelineTimer.prototype.formatTime = function(totalSeconds) {
var seconds = totalSeconds % 60;
var minutes = Math.floor(totalSeconds / 60) % 60;
var hours = Math.floor(totalSeconds / (60 * 60)) % 24;
var days = Math.floor(totalSeconds / (60 * 60 * 24));
var disp = " ";
if (days > 0) {
disp += days + (days == 1 ? ' day ' : ' days ')
}
disp += this.formatNumber(hours) + ':' + this.formatNumber(minutes) + ':' + this.formatNumber(seconds);
return disp;
}
PipelineTimer.prototype.formatNumber = function(value) {
var string = value + '';
if (string.length < 2) { string = '0' + string }
return string;
}
/**
* ClientOffset
* Calculates the client's offset from the server's time
*/
ClientOffset.cookieName = 'clientOffset';
ClientOffset.loadDelayMilliseconds = 500;
function ClientOffset(serverTimestamp) {
var cookie = Cookie.get(ClientOffset.cookieName);
if (cookie && cookie.value) {
this.milliseconds = parseInt(cookie.value);
if (!this.milliseconds) { cookie.remove() }
} else {
if (!serverTimestamp) { alert('No server timestamp was set!') }
var serverGmtMilliseconds = parseInt(serverTimestamp);
var clientGmtMilliseconds = (new Date()).getTime();
this.milliseconds = clientGmtMilliseconds - serverGmtMilliseconds - ClientOffset.loadDelayMilliseconds;
Cookie.create(ClientOffset.cookieName, this.milliseconds);
}
}
ClientOffset.prototype.getMilliseconds = function() {
return this.milliseconds
}
/**
* Cookie
* Wrapper class for cookies
*/
Cookie.get = function(name, path, domain) {
var prefix = name + "=";
var begin = document.cookie.indexOf("; " + prefix);
if (begin == -1) {
begin = document.cookie.indexOf(prefix);
if (begin != 0) return null;
} else {
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1) {
end = document.cookie.length;
}
var value = unescape(document.cookie.substring(begin + prefix.length, end));
return new Cookie(name, value, path, domain);
}
/**
* Sets a Cookie with the given name and value.
*
* name Name of the cookie
* value Value of the cookie
* [expires] Expiration date of the cookie (default: end of current session)
* [path] Path where the cookie is valid (default: path of calling document)
* [domain] Domain where the cookie is valid
* (default: domain of calling document)
* [secure] Boolean value indicating if the cookie transmission requires a
* secure transmission
*/
Cookie.create = function(name, value, expires, path, domain, secure) {
document.cookie = name + '=' + escape(value) +
(expires ? '; expires=' + expires.toGMTString() : '') +
(path ? '; path=' + path : '') +
(domain ? '; domain=' + domain : '') +
(secure ? '; secure' : '');
return new Cookie(name, value, path, domain);
}
function Cookie(name, value, path, domain) {
this.name = name;
this.value = value;
this.path = path;
this.domain = domain;
}
Cookie.prototype.remove = function() {
document.cookie = this.name + '=' +
(this.path ? '; path=' + this.path : '') +
(this.domain ? '; domain=' + this.domain : '') +
'; expires=Thu, 01-Jan-70 00:00:01 GMT';
}
|
webpackJsonp([60335399758886],{199:function(t,e){t.exports={data:{site:{siteMetadata:{title:"Ted"}}},layoutContext:{}}}});
//# sourceMappingURL=path----39eaccc68746c5e5b853.js.map
|
module.exports = {
onInput: function (input) {
this.state = {
heading: input.heading || "",
message: input.message || "",
colors: input.colors || []
};
}
};
|
import { setData } from '@progress/kendo-angular-intl';
setData({
name: "es-HN",
identity: {
language: "es",
territory: "HN"
},
territory: "HN",
numbers: {
symbols: {
decimal: ".",
group: ",",
list: ";",
percentSign: "%",
plusSign: "+",
minusSign: "-",
exponential: "E",
superscriptingExponent: "×",
perMille: "‰",
infinity: "∞",
nan: "NaN",
timeSeparator: ":"
},
decimal: {
patterns: [
"n"
],
groupSize: [
3
]
},
scientific: {
patterns: [
"nEn"
],
groupSize: []
},
percent: {
patterns: [
"n %"
],
groupSize: [
3
]
},
currency: {
patterns: [
"$n"
],
groupSize: [
3
],
"unitPattern-count-one": "n $",
"unitPattern-count-other": "n $"
},
accounting: {
patterns: [
"$n"
],
groupSize: [
3
]
},
currencies: {
ADP: {
displayName: "peseta andorrana",
"displayName-count-one": "peseta andorrana",
"displayName-count-other": "pesetas andorranas",
symbol: "ADP"
},
AED: {
displayName: "dírham de los Emiratos Árabes Unidos",
"displayName-count-one": "dírham de los Emiratos Árabes Unidos",
"displayName-count-other": "dírhams de los Emiratos Árabes Unidos",
symbol: "AED"
},
AFA: {
displayName: "afgani (1927–2002)",
symbol: "AFA"
},
AFN: {
displayName: "afgani",
"displayName-count-one": "afgani",
"displayName-count-other": "afganis",
symbol: "AFN"
},
ALL: {
displayName: "lek",
"displayName-count-one": "lek",
"displayName-count-other": "lekes",
symbol: "ALL"
},
AMD: {
displayName: "dram armenio",
"displayName-count-one": "dram",
"displayName-count-other": "drams",
symbol: "AMD"
},
ANG: {
displayName: "florín de las Antillas Neerlandesas",
"displayName-count-one": "florín de las Antillas Neerlandesas",
"displayName-count-other": "florines de las Antillas Neerlandesas",
symbol: "ANG"
},
AOA: {
displayName: "kuanza",
"displayName-count-one": "kuanza",
"displayName-count-other": "kuanzas",
symbol: "AOA",
"symbol-alt-narrow": "Kz"
},
AOK: {
displayName: "kwanza angoleño (1977–1990)",
symbol: "AOK"
},
AON: {
displayName: "nuevo kwanza angoleño (1990–2000)",
symbol: "AON"
},
AOR: {
displayName: "kwanza reajustado angoleño (1995–1999)",
symbol: "AOR"
},
ARA: {
displayName: "austral argentino",
"displayName-count-one": "austral argentino",
"displayName-count-other": "australes argentinos",
symbol: "ARA"
},
ARL: {
displayName: "ARL",
symbol: "ARL"
},
ARM: {
displayName: "ARM",
symbol: "ARM"
},
ARP: {
displayName: "peso argentino (1983–1985)",
"displayName-count-one": "peso argentino (ARP)",
"displayName-count-other": "pesos argentinos (ARP)",
symbol: "ARP"
},
ARS: {
displayName: "peso argentino",
"displayName-count-one": "peso argentino",
"displayName-count-other": "pesos argentinos",
symbol: "ARS",
"symbol-alt-narrow": "$"
},
ATS: {
displayName: "chelín austriaco",
"displayName-count-one": "chelín austriaco",
"displayName-count-other": "chelines austriacos",
symbol: "ATS"
},
AUD: {
displayName: "dólar australiano",
"displayName-count-one": "dólar australiano",
"displayName-count-other": "dólares australianos",
symbol: "AUD",
"symbol-alt-narrow": "$"
},
AWG: {
displayName: "florín arubeño",
"displayName-count-one": "florín arubeño",
"displayName-count-other": "florines arubeños",
symbol: "AWG"
},
AZM: {
displayName: "manat azerí (1993–2006)",
symbol: "AZM"
},
AZN: {
displayName: "manat azerí",
"displayName-count-one": "manat azerí",
"displayName-count-other": "manat azeríes",
symbol: "AZN"
},
BAD: {
displayName: "dinar bosnio",
"displayName-count-one": "dinar bosnio",
"displayName-count-other": "dinares bosnios",
symbol: "BAD"
},
BAM: {
displayName: "marco convertible de Bosnia-Herzegovina",
"displayName-count-one": "marco convertible de Bosnia-Herzegovina",
"displayName-count-other": "marcos convertibles de Bosnia-Herzegovina",
symbol: "BAM",
"symbol-alt-narrow": "KM"
},
BAN: {
displayName: "BAN",
symbol: "BAN"
},
BBD: {
displayName: "dólar barbadense",
"displayName-count-one": "dólar barbadense",
"displayName-count-other": "dólares barbadenses",
symbol: "BBD",
"symbol-alt-narrow": "$"
},
BDT: {
displayName: "taka",
"displayName-count-one": "taka",
"displayName-count-other": "takas",
symbol: "BDT",
"symbol-alt-narrow": "৳"
},
BEC: {
displayName: "franco belga (convertible)",
"displayName-count-one": "franco belga (convertible)",
"displayName-count-other": "francos belgas (convertibles)",
symbol: "BEC"
},
BEF: {
displayName: "franco belga",
"displayName-count-one": "franco belga",
"displayName-count-other": "francos belgas",
symbol: "BEF"
},
BEL: {
displayName: "franco belga (financiero)",
"displayName-count-one": "franco belga (financiero)",
"displayName-count-other": "francos belgas (financieros)",
symbol: "BEL"
},
BGL: {
displayName: "lev fuerte búlgaro",
"displayName-count-one": "lev fuerte búlgaro",
"displayName-count-other": "leva fuertes búlgaros",
symbol: "BGL"
},
BGM: {
displayName: "BGM",
symbol: "BGM"
},
BGN: {
displayName: "lev búlgaro",
"displayName-count-one": "lev búlgaro",
"displayName-count-other": "leva búlgaros",
symbol: "BGN"
},
BGO: {
displayName: "BGO",
symbol: "BGO"
},
BHD: {
displayName: "dinar bahreiní",
"displayName-count-one": "dinar bahreiní",
"displayName-count-other": "dinares bahreiníes",
symbol: "BHD"
},
BIF: {
displayName: "franco burundés",
"displayName-count-one": "franco burundés",
"displayName-count-other": "francos burundeses",
symbol: "BIF"
},
BMD: {
displayName: "dólar de Bermudas",
"displayName-count-one": "dólar de Bermudas",
"displayName-count-other": "dólares de Bermudas",
symbol: "BMD",
"symbol-alt-narrow": "$"
},
BND: {
displayName: "dólar bruneano",
"displayName-count-one": "dólar bruneano",
"displayName-count-other": "dólares bruneanos",
symbol: "BND",
"symbol-alt-narrow": "$"
},
BOB: {
displayName: "boliviano",
"displayName-count-one": "boliviano",
"displayName-count-other": "bolivianos",
symbol: "BOB",
"symbol-alt-narrow": "Bs"
},
BOL: {
displayName: "BOL",
symbol: "BOL"
},
BOP: {
displayName: "peso boliviano",
"displayName-count-one": "peso boliviano",
"displayName-count-other": "pesos bolivianos",
symbol: "BOP"
},
BOV: {
displayName: "MVDOL boliviano",
"displayName-count-one": "MVDOL boliviano",
"displayName-count-other": "MVDOL bolivianos",
symbol: "BOV"
},
BRB: {
displayName: "nuevo cruceiro brasileño (1967–1986)",
"displayName-count-one": "nuevo cruzado brasileño (BRB)",
"displayName-count-other": "nuevos cruzados brasileños (BRB)",
symbol: "BRB"
},
BRC: {
displayName: "cruzado brasileño",
"displayName-count-one": "cruzado brasileño",
"displayName-count-other": "cruzados brasileños",
symbol: "BRC"
},
BRE: {
displayName: "cruceiro brasileño (1990–1993)",
"displayName-count-one": "cruceiro brasileño (BRE)",
"displayName-count-other": "cruceiros brasileños (BRE)",
symbol: "BRE"
},
BRL: {
displayName: "real brasileño",
"displayName-count-one": "real brasileño",
"displayName-count-other": "reales brasileños",
symbol: "BRL",
"symbol-alt-narrow": "R$"
},
BRN: {
displayName: "nuevo cruzado brasileño",
"displayName-count-one": "nuevo cruzado brasileño",
"displayName-count-other": "nuevos cruzados brasileños",
symbol: "BRN"
},
BRR: {
displayName: "cruceiro brasileño",
"displayName-count-one": "cruceiro brasileño",
"displayName-count-other": "cruceiros brasileños",
symbol: "BRR"
},
BRZ: {
displayName: "BRZ",
symbol: "BRZ"
},
BSD: {
displayName: "dólar bahameño",
"displayName-count-one": "dólar bahameño",
"displayName-count-other": "dólares bahameños",
symbol: "BSD",
"symbol-alt-narrow": "$"
},
BTN: {
displayName: "gultrum",
"displayName-count-one": "gultrum",
"displayName-count-other": "gultrums",
symbol: "BTN"
},
BUK: {
displayName: "kyat birmano",
"displayName-count-one": "kyat birmano",
"displayName-count-other": "kyat birmanos",
symbol: "BUK"
},
BWP: {
displayName: "pula",
"displayName-count-one": "pula",
"displayName-count-other": "pulas",
symbol: "BWP",
"symbol-alt-narrow": "P"
},
BYB: {
displayName: "nuevo rublo bielorruso (1994–1999)",
"displayName-count-one": "nuevo rublo bielorruso",
"displayName-count-other": "nuevos rublos bielorrusos",
symbol: "BYB"
},
BYN: {
displayName: "rublo bielorruso",
"displayName-count-one": "rublo bielorruso",
"displayName-count-other": "rublos bielorrusos",
symbol: "BYN",
"symbol-alt-narrow": "р."
},
BYR: {
displayName: "rublo bielorruso (2000–2016)",
"displayName-count-one": "rublo bielorruso (2000–2016)",
"displayName-count-other": "rublos bielorrusos (2000–2016)",
symbol: "BYR"
},
BZD: {
displayName: "dólar beliceño",
"displayName-count-one": "dólar beliceño",
"displayName-count-other": "dólares beliceños",
symbol: "BZD",
"symbol-alt-narrow": "$"
},
CAD: {
displayName: "dólar canadiense",
"displayName-count-one": "dólar canadiense",
"displayName-count-other": "dólares canadienses",
symbol: "CAD",
"symbol-alt-narrow": "$"
},
CDF: {
displayName: "franco congoleño",
"displayName-count-one": "franco congoleño",
"displayName-count-other": "francos congoleños",
symbol: "CDF"
},
CHE: {
displayName: "euro WIR",
"displayName-count-one": "euro WIR",
"displayName-count-other": "euros WIR",
symbol: "CHE"
},
CHF: {
displayName: "franco suizo",
"displayName-count-one": "franco suizo",
"displayName-count-other": "francos suizos",
symbol: "CHF"
},
CHW: {
displayName: "franco WIR",
"displayName-count-one": "franco WIR",
"displayName-count-other": "francos WIR",
symbol: "CHW"
},
CLE: {
displayName: "CLE",
symbol: "CLE"
},
CLF: {
displayName: "unidad de fomento chilena",
"displayName-count-one": "unidad de fomento chilena",
"displayName-count-other": "unidades de fomento chilenas",
symbol: "CLF"
},
CLP: {
displayName: "peso chileno",
"displayName-count-one": "peso chileno",
"displayName-count-other": "pesos chilenos",
symbol: "CLP",
"symbol-alt-narrow": "$"
},
CNY: {
displayName: "yuan",
"displayName-count-one": "yuan",
"displayName-count-other": "yuanes",
symbol: "CNY",
"symbol-alt-narrow": "¥"
},
COP: {
displayName: "peso colombiano",
"displayName-count-one": "peso colombiano",
"displayName-count-other": "pesos colombianos",
symbol: "COP",
"symbol-alt-narrow": "$"
},
COU: {
displayName: "unidad de valor real colombiana",
"displayName-count-one": "unidad de valor real",
"displayName-count-other": "unidades de valor reales",
symbol: "COU"
},
CRC: {
displayName: "colón costarricense",
"displayName-count-one": "colón costarricense",
"displayName-count-other": "colones costarricenses",
symbol: "CRC",
"symbol-alt-narrow": "₡"
},
CSD: {
displayName: "antiguo dinar serbio",
"displayName-count-one": "antiguo dinar serbio",
"displayName-count-other": "antiguos dinares serbios",
symbol: "CSD"
},
CSK: {
displayName: "corona fuerte checoslovaca",
"displayName-count-one": "corona fuerte checoslovaca",
"displayName-count-other": "coronas fuertes checoslovacas",
symbol: "CSK"
},
CUC: {
displayName: "peso cubano convertible",
"displayName-count-one": "peso cubano convertible",
"displayName-count-other": "pesos cubanos convertibles",
symbol: "CUC",
"symbol-alt-narrow": "$"
},
CUP: {
displayName: "peso cubano",
"displayName-count-one": "peso cubano",
"displayName-count-other": "pesos cubanos",
symbol: "CUP",
"symbol-alt-narrow": "$"
},
CVE: {
displayName: "escudo de Cabo Verde",
"displayName-count-one": "escudo de Cabo Verde",
"displayName-count-other": "escudos de Cabo Verde",
symbol: "CVE"
},
CYP: {
displayName: "libra chipriota",
"displayName-count-one": "libra chipriota",
"displayName-count-other": "libras chipriotas",
symbol: "CYP"
},
CZK: {
displayName: "corona checa",
"displayName-count-one": "corona checa",
"displayName-count-other": "coronas checas",
symbol: "CZK",
"symbol-alt-narrow": "Kč"
},
DDM: {
displayName: "ostmark de Alemania del Este",
"displayName-count-one": "marco de la República Democrática Alemana",
"displayName-count-other": "marcos de la República Democrática Alemana",
symbol: "DDM"
},
DEM: {
displayName: "marco alemán",
"displayName-count-one": "marco alemán",
"displayName-count-other": "marcos alemanes",
symbol: "DEM"
},
DJF: {
displayName: "franco yibutiano",
"displayName-count-one": "franco yibutiano",
"displayName-count-other": "francos yibutianos",
symbol: "DJF"
},
DKK: {
displayName: "corona danesa",
"displayName-count-one": "corona danesa",
"displayName-count-other": "coronas danesas",
symbol: "DKK",
"symbol-alt-narrow": "kr"
},
DOP: {
displayName: "peso dominicano",
"displayName-count-one": "peso dominicano",
"displayName-count-other": "pesos dominicanos",
symbol: "DOP",
"symbol-alt-narrow": "$"
},
DZD: {
displayName: "dinar argelino",
"displayName-count-one": "dinar argelino",
"displayName-count-other": "dinares argelinos",
symbol: "DZD"
},
ECS: {
displayName: "sucre ecuatoriano",
"displayName-count-one": "sucre ecuatoriano",
"displayName-count-other": "sucres ecuatorianos",
symbol: "ECS"
},
ECV: {
displayName: "unidad de valor constante (UVC) ecuatoriana",
"displayName-count-one": "unidad de valor constante (UVC) ecuatoriana",
"displayName-count-other": "unidades de valor constante (UVC) ecuatorianas",
symbol: "ECV"
},
EEK: {
displayName: "corona estonia",
"displayName-count-one": "corona estonia",
"displayName-count-other": "coronas estonias",
symbol: "EEK"
},
EGP: {
displayName: "libra egipcia",
"displayName-count-one": "libra egipcia",
"displayName-count-other": "libras egipcias",
symbol: "EGP",
"symbol-alt-narrow": "E£"
},
ERN: {
displayName: "nafka",
"displayName-count-one": "nakfa",
"displayName-count-other": "nakfas",
symbol: "ERN"
},
ESA: {
displayName: "peseta española (cuenta A)",
"displayName-count-one": "peseta española (cuenta A)",
"displayName-count-other": "pesetas españolas (cuenta A)",
symbol: "ESA"
},
ESB: {
displayName: "peseta española (cuenta convertible)",
"displayName-count-one": "peseta española (cuenta convertible)",
"displayName-count-other": "pesetas españolas (cuenta convertible)",
symbol: "ESB"
},
ESP: {
displayName: "peseta española",
"displayName-count-one": "peseta española",
"displayName-count-other": "pesetas españolas",
symbol: "₧",
"symbol-alt-narrow": "₧"
},
ETB: {
displayName: "bir",
"displayName-count-one": "bir",
"displayName-count-other": "bires",
symbol: "ETB"
},
EUR: {
displayName: "euro",
"displayName-count-one": "euro",
"displayName-count-other": "euros",
symbol: "EUR",
"symbol-alt-narrow": "€"
},
FIM: {
displayName: "marco finlandés",
"displayName-count-one": "marco finlandés",
"displayName-count-other": "marcos finlandeses",
symbol: "FIM"
},
FJD: {
displayName: "dólar fiyiano",
"displayName-count-one": "dólar fiyiano",
"displayName-count-other": "dólares fiyianos",
symbol: "FJD",
"symbol-alt-narrow": "$"
},
FKP: {
displayName: "libra malvinense",
"displayName-count-one": "libra malvinense",
"displayName-count-other": "libras malvinenses",
symbol: "FKP",
"symbol-alt-narrow": "£"
},
FRF: {
displayName: "franco francés",
"displayName-count-one": "franco francés",
"displayName-count-other": "francos franceses",
symbol: "FRF"
},
GBP: {
displayName: "libra británica",
"displayName-count-one": "libra británica",
"displayName-count-other": "libras británicas",
symbol: "GBP",
"symbol-alt-narrow": "£"
},
GEK: {
displayName: "kupon larit georgiano",
symbol: "GEK"
},
GEL: {
displayName: "lari",
"displayName-count-one": "lari",
"displayName-count-other": "laris",
symbol: "GEL",
"symbol-alt-narrow": "₾",
"symbol-alt-variant": "₾"
},
GHC: {
displayName: "cedi ghanés (1979–2007)",
symbol: "GHC"
},
GHS: {
displayName: "cedi",
"displayName-count-one": "cedi",
"displayName-count-other": "cedis",
symbol: "GHS"
},
GIP: {
displayName: "libra gibraltareña",
"displayName-count-one": "libra gibraltareña",
"displayName-count-other": "libras gibraltareñas",
symbol: "GIP",
"symbol-alt-narrow": "£"
},
GMD: {
displayName: "dalasi",
"displayName-count-one": "dalasi",
"displayName-count-other": "dalasis",
symbol: "GMD"
},
GNF: {
displayName: "franco guineano",
"displayName-count-one": "franco guineano",
"displayName-count-other": "francos guineanos",
symbol: "GNF",
"symbol-alt-narrow": "FG"
},
GNS: {
displayName: "syli guineano",
symbol: "GNS"
},
GQE: {
displayName: "ekuele de Guinea Ecuatorial",
"displayName-count-one": "ekuele de Guinea Ecuatorial",
"displayName-count-other": "ekueles de Guinea Ecuatorial",
symbol: "GQE"
},
GRD: {
displayName: "dracma griego",
"displayName-count-one": "dracma griego",
"displayName-count-other": "dracmas griegos",
symbol: "GRD"
},
GTQ: {
displayName: "quetzal guatemalteco",
"displayName-count-one": "quetzal guatemalteco",
"displayName-count-other": "quetzales guatemaltecos",
symbol: "GTQ",
"symbol-alt-narrow": "Q"
},
GWE: {
displayName: "escudo de Guinea Portuguesa",
symbol: "GWE"
},
GWP: {
displayName: "peso de Guinea-Bissáu",
symbol: "GWP"
},
GYD: {
displayName: "dólar guyanés",
"displayName-count-one": "dólar guyanés",
"displayName-count-other": "dólares guyaneses",
symbol: "GYD",
"symbol-alt-narrow": "$"
},
HKD: {
displayName: "dólar hongkonés",
"displayName-count-one": "dólar hongkonés",
"displayName-count-other": "dólares hongkoneses",
symbol: "HKD",
"symbol-alt-narrow": "$"
},
HNL: {
displayName: "lempira hondureño",
"displayName-count-one": "lempira hondureño",
"displayName-count-other": "lempiras hondureños",
symbol: "L",
"symbol-alt-narrow": "L"
},
HRD: {
displayName: "dinar croata",
"displayName-count-one": "dinar croata",
"displayName-count-other": "dinares croatas",
symbol: "HRD"
},
HRK: {
displayName: "kuna",
"displayName-count-one": "kuna",
"displayName-count-other": "kunas",
symbol: "HRK",
"symbol-alt-narrow": "kn"
},
HTG: {
displayName: "gourde haitiano",
"displayName-count-one": "gourde haitiano",
"displayName-count-other": "gourdes haitianos",
symbol: "HTG"
},
HUF: {
displayName: "forinto húngaro",
"displayName-count-one": "forinto húngaro",
"displayName-count-other": "forintos húngaros",
symbol: "HUF",
"symbol-alt-narrow": "Ft"
},
IDR: {
displayName: "rupia indonesia",
"displayName-count-one": "rupia indonesia",
"displayName-count-other": "rupias indonesias",
symbol: "IDR",
"symbol-alt-narrow": "Rp"
},
IEP: {
displayName: "libra irlandesa",
"displayName-count-one": "libra irlandesa",
"displayName-count-other": "libras irlandesas",
symbol: "IEP"
},
ILP: {
displayName: "libra israelí",
"displayName-count-one": "libra israelí",
"displayName-count-other": "libras israelíes",
symbol: "ILP"
},
ILS: {
displayName: "nuevo séquel israelí",
"displayName-count-one": "nuevo séquel israelí",
"displayName-count-other": "nuevos séqueles israelíes",
symbol: "ILS",
"symbol-alt-narrow": "₪"
},
INR: {
displayName: "rupia india",
"displayName-count-one": "rupia india",
"displayName-count-other": "rupias indias",
symbol: "INR",
"symbol-alt-narrow": "₹"
},
IQD: {
displayName: "dinar iraquí",
"displayName-count-one": "dinar iraquí",
"displayName-count-other": "dinares iraquíes",
symbol: "IQD"
},
IRR: {
displayName: "rial iraní",
"displayName-count-one": "rial iraní",
"displayName-count-other": "riales iraníes",
symbol: "IRR"
},
ISK: {
displayName: "corona islandesa",
"displayName-count-one": "corona islandesa",
"displayName-count-other": "coronas islandesas",
symbol: "ISK",
"symbol-alt-narrow": "kr"
},
ITL: {
displayName: "lira italiana",
"displayName-count-one": "lira italiana",
"displayName-count-other": "liras italianas",
symbol: "ITL"
},
JMD: {
displayName: "dólar jamaicano",
"displayName-count-one": "dólar jamaicano",
"displayName-count-other": "dólares jamaicanos",
symbol: "JMD",
"symbol-alt-narrow": "$"
},
JOD: {
displayName: "dinar jordano",
"displayName-count-one": "dinar jordano",
"displayName-count-other": "dinares jordanos",
symbol: "JOD"
},
JPY: {
displayName: "yen",
"displayName-count-one": "yen",
"displayName-count-other": "yenes",
symbol: "JPY",
"symbol-alt-narrow": "¥"
},
KES: {
displayName: "chelín keniano",
"displayName-count-one": "chelín keniano",
"displayName-count-other": "chelines kenianos",
symbol: "KES"
},
KGS: {
displayName: "som",
"displayName-count-one": "som",
"displayName-count-other": "soms",
symbol: "KGS"
},
KHR: {
displayName: "riel",
"displayName-count-one": "riel",
"displayName-count-other": "rieles",
symbol: "KHR",
"symbol-alt-narrow": "៛"
},
KMF: {
displayName: "franco comorense",
"displayName-count-one": "franco comorense",
"displayName-count-other": "francos comorenses",
symbol: "KMF",
"symbol-alt-narrow": "CF"
},
KPW: {
displayName: "won norcoreano",
"displayName-count-one": "won norcoreano",
"displayName-count-other": "wons norcoreanos",
symbol: "KPW",
"symbol-alt-narrow": "₩"
},
KRH: {
displayName: "KRH",
symbol: "KRH"
},
KRO: {
displayName: "KRO",
symbol: "KRO"
},
KRW: {
displayName: "won surcoreano",
"displayName-count-one": "won surcoreano",
"displayName-count-other": "wons surcoreanos",
symbol: "KRW",
"symbol-alt-narrow": "₩"
},
KWD: {
displayName: "dinar kuwaití",
"displayName-count-one": "dinar kuwaití",
"displayName-count-other": "dinares kuwaitíes",
symbol: "KWD"
},
KYD: {
displayName: "dólar de las Islas Caimán",
"displayName-count-one": "dólar de las Islas Caimán",
"displayName-count-other": "dólares de las Islas Caimán",
symbol: "KYD",
"symbol-alt-narrow": "$"
},
KZT: {
displayName: "tenge kazako",
"displayName-count-one": "tenge kazako",
"displayName-count-other": "tenges kazakos",
symbol: "KZT",
"symbol-alt-narrow": "₸"
},
LAK: {
displayName: "kip",
"displayName-count-one": "kip",
"displayName-count-other": "kips",
symbol: "LAK",
"symbol-alt-narrow": "₭"
},
LBP: {
displayName: "libra libanesa",
"displayName-count-one": "libra libanesa",
"displayName-count-other": "libras libanesas",
symbol: "LBP",
"symbol-alt-narrow": "L£"
},
LKR: {
displayName: "rupia esrilanquesa",
"displayName-count-one": "rupia esrilanquesa",
"displayName-count-other": "rupias esrilanquesas",
symbol: "LKR",
"symbol-alt-narrow": "Rs"
},
LRD: {
displayName: "dólar liberiano",
"displayName-count-one": "dólar liberiano",
"displayName-count-other": "dólares liberianos",
symbol: "LRD",
"symbol-alt-narrow": "$"
},
LSL: {
displayName: "loti lesothense",
symbol: "LSL"
},
LTL: {
displayName: "litas lituano",
"displayName-count-one": "litas lituana",
"displayName-count-other": "litas lituanas",
symbol: "LTL",
"symbol-alt-narrow": "Lt"
},
LTT: {
displayName: "talonas lituano",
"displayName-count-one": "talonas lituana",
"displayName-count-other": "talonas lituanas",
symbol: "LTT"
},
LUC: {
displayName: "franco convertible luxemburgués",
"displayName-count-one": "franco convertible luxemburgués",
"displayName-count-other": "francos convertibles luxemburgueses",
symbol: "LUC"
},
LUF: {
displayName: "franco luxemburgués",
"displayName-count-one": "franco luxemburgués",
"displayName-count-other": "francos luxemburgueses",
symbol: "LUF"
},
LUL: {
displayName: "franco financiero luxemburgués",
"displayName-count-one": "franco financiero luxemburgués",
"displayName-count-other": "francos financieros luxemburgueses",
symbol: "LUL"
},
LVL: {
displayName: "lats letón",
"displayName-count-one": "lats letón",
"displayName-count-other": "lats letónes",
symbol: "LVL",
"symbol-alt-narrow": "Ls"
},
LVR: {
displayName: "rublo letón",
"displayName-count-one": "rublo letón",
"displayName-count-other": "rublos letones",
symbol: "LVR"
},
LYD: {
displayName: "dinar libio",
"displayName-count-one": "dinar libio",
"displayName-count-other": "dinares libios",
symbol: "LYD"
},
MAD: {
displayName: "dírham marroquí",
"displayName-count-one": "dírham marroquí",
"displayName-count-other": "dírhams marroquíes",
symbol: "MAD"
},
MAF: {
displayName: "franco marroquí",
"displayName-count-one": "franco marroquí",
"displayName-count-other": "francos marroquíes",
symbol: "MAF"
},
MCF: {
displayName: "MCF",
symbol: "MCF"
},
MDC: {
displayName: "MDC",
symbol: "MDC"
},
MDL: {
displayName: "leu moldavo",
"displayName-count-one": "leu moldavo",
"displayName-count-other": "leus moldavos",
symbol: "MDL"
},
MGA: {
displayName: "ariari",
"displayName-count-one": "ariari",
"displayName-count-other": "ariaris",
symbol: "MGA",
"symbol-alt-narrow": "Ar"
},
MGF: {
displayName: "franco malgache",
symbol: "MGF"
},
MKD: {
displayName: "dinar macedonio",
"displayName-count-one": "dinar macedonio",
"displayName-count-other": "dinares macedonios",
symbol: "MKD"
},
MKN: {
displayName: "MKN",
symbol: "MKN"
},
MLF: {
displayName: "franco malí",
symbol: "MLF"
},
MMK: {
displayName: "kiat",
"displayName-count-one": "kiat",
"displayName-count-other": "kiats",
symbol: "MMK",
"symbol-alt-narrow": "K"
},
MNT: {
displayName: "tugrik",
"displayName-count-one": "tugrik",
"displayName-count-other": "tugriks",
symbol: "MNT",
"symbol-alt-narrow": "₮"
},
MOP: {
displayName: "pataca de Macao",
"displayName-count-one": "pataca de Macao",
"displayName-count-other": "patacas de Macao",
symbol: "MOP"
},
MRO: {
displayName: "uguiya",
"displayName-count-one": "uguiya",
"displayName-count-other": "uguiyas",
symbol: "MRO"
},
MTL: {
displayName: "lira maltesa",
"displayName-count-one": "lira maltesa",
"displayName-count-other": "liras maltesas",
symbol: "MTL"
},
MTP: {
displayName: "libra maltesa",
"displayName-count-one": "libra maltesa",
"displayName-count-other": "libras maltesas",
symbol: "MTP"
},
MUR: {
displayName: "rupia mauriciana",
"displayName-count-one": "rupia mauriciana",
"displayName-count-other": "rupias mauricianas",
symbol: "MUR",
"symbol-alt-narrow": "Rs"
},
MVR: {
displayName: "rufiya",
"displayName-count-one": "rufiya",
"displayName-count-other": "rufiyas",
symbol: "MVR"
},
MWK: {
displayName: "kwacha malauí",
"displayName-count-one": "kwacha malauí",
"displayName-count-other": "kwachas malauís",
symbol: "MWK"
},
MXN: {
displayName: "peso mexicano",
"displayName-count-one": "peso mexicano",
"displayName-count-other": "pesos mexicanos",
symbol: "MXN",
"symbol-alt-narrow": "$"
},
MXP: {
displayName: "peso de plata mexicano (1861–1992)",
"displayName-count-one": "peso de plata mexicano (MXP)",
"displayName-count-other": "pesos de plata mexicanos (MXP)",
symbol: "MXP"
},
MXV: {
displayName: "unidad de inversión (UDI) mexicana",
"displayName-count-one": "unidad de inversión (UDI) mexicana",
"displayName-count-other": "unidades de inversión (UDI) mexicanas",
symbol: "MXV"
},
MYR: {
displayName: "ringit",
"displayName-count-one": "ringit",
"displayName-count-other": "ringits",
symbol: "MYR",
"symbol-alt-narrow": "RM"
},
MZE: {
displayName: "escudo mozambiqueño",
"displayName-count-one": "escudo mozambiqueño",
"displayName-count-other": "escudos mozambiqueños",
symbol: "MZE"
},
MZM: {
displayName: "antiguo metical mozambiqueño",
symbol: "MZM"
},
MZN: {
displayName: "metical",
"displayName-count-one": "metical",
"displayName-count-other": "meticales",
symbol: "MZN"
},
NAD: {
displayName: "dólar namibio",
"displayName-count-one": "dólar namibio",
"displayName-count-other": "dólares namibios",
symbol: "NAD",
"symbol-alt-narrow": "$"
},
NGN: {
displayName: "naira",
"displayName-count-one": "naira",
"displayName-count-other": "nairas",
symbol: "NGN",
"symbol-alt-narrow": "₦"
},
NIC: {
displayName: "córdoba nicaragüense (1988–1991)",
"displayName-count-one": "córdoba nicaragüense (1988–1991)",
"displayName-count-other": "córdobas nicaragüenses (1988–1991)",
symbol: "NIC"
},
NIO: {
displayName: "córdoba nicaragüense",
"displayName-count-one": "córdoba nicaragüense",
"displayName-count-other": "córdobas nicaragüenses",
symbol: "NIO",
"symbol-alt-narrow": "C$"
},
NLG: {
displayName: "florín neerlandés",
"displayName-count-one": "florín neerlandés",
"displayName-count-other": "florines neerlandeses",
symbol: "NLG"
},
NOK: {
displayName: "corona noruega",
"displayName-count-one": "corona noruega",
"displayName-count-other": "coronas noruegas",
symbol: "NOK",
"symbol-alt-narrow": "kr"
},
NPR: {
displayName: "rupia nepalí",
"displayName-count-one": "rupia nepalí",
"displayName-count-other": "rupias nepalíes",
symbol: "NPR",
"symbol-alt-narrow": "Rs"
},
NZD: {
displayName: "dólar neozelandés",
"displayName-count-one": "dólar neozelandés",
"displayName-count-other": "dólares neozelandeses",
symbol: "NZD",
"symbol-alt-narrow": "$"
},
OMR: {
displayName: "rial omaní",
"displayName-count-one": "rial omaní",
"displayName-count-other": "riales omaníes",
symbol: "OMR"
},
PAB: {
displayName: "balboa panameño",
"displayName-count-one": "balboa panameño",
"displayName-count-other": "balboas panameños",
symbol: "PAB"
},
PEI: {
displayName: "inti peruano",
"displayName-count-one": "inti peruano",
"displayName-count-other": "intis peruanos",
symbol: "PEI"
},
PEN: {
displayName: "sol peruano",
"displayName-count-one": "sol peruano",
"displayName-count-other": "soles peruanos",
symbol: "PEN"
},
PES: {
displayName: "sol peruano (1863–1965)",
"displayName-count-one": "sol peruano (1863–1965)",
"displayName-count-other": "soles peruanos (1863–1965)",
symbol: "PES"
},
PGK: {
displayName: "kina",
"displayName-count-one": "kina",
"displayName-count-other": "kinas",
symbol: "PGK"
},
PHP: {
displayName: "peso filipino",
"displayName-count-one": "peso filipino",
"displayName-count-other": "pesos filipinos",
symbol: "PHP",
"symbol-alt-narrow": "₱"
},
PKR: {
displayName: "rupia pakistaní",
"displayName-count-one": "rupia pakistaní",
"displayName-count-other": "rupias pakistaníes",
symbol: "PKR",
"symbol-alt-narrow": "Rs"
},
PLN: {
displayName: "esloti",
"displayName-count-one": "esloti",
"displayName-count-other": "eslotis",
symbol: "PLN",
"symbol-alt-narrow": "zł"
},
PLZ: {
displayName: "zloty polaco (1950–1995)",
"displayName-count-one": "zloty polaco (PLZ)",
"displayName-count-other": "zlotys polacos (PLZ)",
symbol: "PLZ"
},
PTE: {
displayName: "escudo portugués",
"displayName-count-one": "escudo portugués",
"displayName-count-other": "escudos portugueses",
symbol: "PTE"
},
PYG: {
displayName: "guaraní paraguayo",
"displayName-count-one": "guaraní paraguayo",
"displayName-count-other": "guaraníes paraguayos",
symbol: "PYG",
"symbol-alt-narrow": "₲"
},
QAR: {
displayName: "rial catarí",
"displayName-count-one": "rial catarí",
"displayName-count-other": "riales cataríes",
symbol: "QAR"
},
RHD: {
displayName: "dólar rodesiano",
symbol: "RHD"
},
ROL: {
displayName: "antiguo leu rumano",
"displayName-count-one": "antiguo leu rumano",
"displayName-count-other": "antiguos lei rumanos",
symbol: "ROL"
},
RON: {
displayName: "leu rumano",
"displayName-count-one": "leu rumano",
"displayName-count-other": "leus rumanos",
symbol: "RON",
"symbol-alt-narrow": "L"
},
RSD: {
displayName: "dinar serbio",
"displayName-count-one": "dinar serbio",
"displayName-count-other": "dinares serbios",
symbol: "RSD"
},
RUB: {
displayName: "rublo ruso",
"displayName-count-one": "rublo ruso",
"displayName-count-other": "rublos rusos",
symbol: "RUB",
"symbol-alt-narrow": "₽"
},
RUR: {
displayName: "rublo ruso (1991–1998)",
"displayName-count-one": "rublo ruso (RUR)",
"displayName-count-other": "rublos rusos (RUR)",
symbol: "RUR",
"symbol-alt-narrow": "р."
},
RWF: {
displayName: "franco ruandés",
"displayName-count-one": "franco ruandés",
"displayName-count-other": "francos ruandeses",
symbol: "RWF",
"symbol-alt-narrow": "RF"
},
SAR: {
displayName: "rial saudí",
"displayName-count-one": "rial saudí",
"displayName-count-other": "riales saudíes",
symbol: "SAR"
},
SBD: {
displayName: "dólar salomonense",
"displayName-count-one": "dólar salomonense",
"displayName-count-other": "dólares salomonenses",
symbol: "SBD",
"symbol-alt-narrow": "$"
},
SCR: {
displayName: "rupia seychellense",
"displayName-count-one": "rupia seychellense",
"displayName-count-other": "rupias seychellenses",
symbol: "SCR"
},
SDD: {
displayName: "dinar sudanés",
"displayName-count-one": "dinar sudanés",
"displayName-count-other": "dinares sudaneses",
symbol: "SDD"
},
SDG: {
displayName: "libra sudanesa",
"displayName-count-one": "libra sudanesa",
"displayName-count-other": "libras sudanesas",
symbol: "SDG"
},
SDP: {
displayName: "libra sudanesa antigua",
"displayName-count-one": "libra sudanesa antigua",
"displayName-count-other": "libras sudanesas antiguas",
symbol: "SDP"
},
SEK: {
displayName: "corona sueca",
"displayName-count-one": "corona sueca",
"displayName-count-other": "coronas suecas",
symbol: "SEK",
"symbol-alt-narrow": "kr"
},
SGD: {
displayName: "dólar singapurense",
"displayName-count-one": "dólar singapurense",
"displayName-count-other": "dólares singapurenses",
symbol: "SGD",
"symbol-alt-narrow": "$"
},
SHP: {
displayName: "libra de Santa Elena",
"displayName-count-one": "libra de Santa Elena",
"displayName-count-other": "libras de Santa Elena",
symbol: "SHP",
"symbol-alt-narrow": "£"
},
SIT: {
displayName: "tólar esloveno",
"displayName-count-one": "tólar esloveno",
"displayName-count-other": "tólares eslovenos",
symbol: "SIT"
},
SKK: {
displayName: "corona eslovaca",
"displayName-count-one": "corona eslovaca",
"displayName-count-other": "coronas eslovacas",
symbol: "SKK"
},
SLL: {
displayName: "leona",
"displayName-count-one": "leona",
"displayName-count-other": "leonas",
symbol: "SLL"
},
SOS: {
displayName: "chelín somalí",
"displayName-count-one": "chelín somalí",
"displayName-count-other": "chelines somalíes",
symbol: "SOS"
},
SRD: {
displayName: "dólar surinamés",
"displayName-count-one": "dólar surinamés",
"displayName-count-other": "dólares surinameses",
symbol: "SRD",
"symbol-alt-narrow": "$"
},
SRG: {
displayName: "florín surinamés",
symbol: "SRG"
},
SSP: {
displayName: "libra sursudanesa",
"displayName-count-one": "libra sursudanesa",
"displayName-count-other": "libras sursudanesas",
symbol: "SSP",
"symbol-alt-narrow": "£"
},
STD: {
displayName: "dobra",
"displayName-count-one": "dobra",
"displayName-count-other": "dobras",
symbol: "STD",
"symbol-alt-narrow": "Db"
},
SUR: {
displayName: "rublo soviético",
"displayName-count-one": "rublo soviético",
"displayName-count-other": "rublos soviéticos",
symbol: "SUR"
},
SVC: {
displayName: "colón salvadoreño",
"displayName-count-one": "colón salvadoreño",
"displayName-count-other": "colones salvadoreños",
symbol: "SVC"
},
SYP: {
displayName: "libra siria",
"displayName-count-one": "libra siria",
"displayName-count-other": "libras sirias",
symbol: "SYP",
"symbol-alt-narrow": "£"
},
SZL: {
displayName: "lilangeni",
"displayName-count-one": "lilangeni",
"displayName-count-other": "lilangenis",
symbol: "SZL"
},
THB: {
displayName: "bat",
"displayName-count-one": "bat",
"displayName-count-other": "bats",
symbol: "THB",
"symbol-alt-narrow": "฿"
},
TJR: {
displayName: "rublo tayiko",
symbol: "TJR"
},
TJS: {
displayName: "somoni tayiko",
"displayName-count-one": "somoni tayiko",
"displayName-count-other": "somonis tayikos",
symbol: "TJS"
},
TMM: {
displayName: "manat turcomano (1993–2009)",
"displayName-count-one": "manat turcomano (1993–2009)",
"displayName-count-other": "manats turcomanos (1993–2009)",
symbol: "TMM"
},
TMT: {
displayName: "manat turcomano",
"displayName-count-one": "manat turcomano",
"displayName-count-other": "manats turcomanos",
symbol: "TMT"
},
TND: {
displayName: "dinar tunecino",
"displayName-count-one": "dinar tunecino",
"displayName-count-other": "dinares tunecinos",
symbol: "TND"
},
TOP: {
displayName: "paanga",
"displayName-count-one": "paanga",
"displayName-count-other": "paangas",
symbol: "TOP",
"symbol-alt-narrow": "T$"
},
TPE: {
displayName: "escudo timorense",
symbol: "TPE"
},
TRL: {
displayName: "lira turca (1922–2005)",
"displayName-count-one": "lira turca (1922–2005)",
"displayName-count-other": "liras turcas (1922–2005)",
symbol: "TRL"
},
TRY: {
displayName: "lira turca",
"displayName-count-one": "lira turca",
"displayName-count-other": "liras turcas",
symbol: "TRY",
"symbol-alt-narrow": "₺",
"symbol-alt-variant": "TL"
},
TTD: {
displayName: "dólar de Trinidad y Tobago",
"displayName-count-one": "dólar de Trinidad y Tobago",
"displayName-count-other": "dólares de Trinidad y Tobago",
symbol: "TTD",
"symbol-alt-narrow": "$"
},
TWD: {
displayName: "nuevo dólar taiwanés",
"displayName-count-one": "nuevo dólar taiwanés",
"displayName-count-other": "nuevos dólares taiwaneses",
symbol: "TWD",
"symbol-alt-narrow": "NT$"
},
TZS: {
displayName: "chelín tanzano",
"displayName-count-one": "chelín tanzano",
"displayName-count-other": "chelines tanzanos",
symbol: "TZS"
},
UAH: {
displayName: "grivna",
"displayName-count-one": "grivna",
"displayName-count-other": "grivnas",
symbol: "UAH",
"symbol-alt-narrow": "₴"
},
UAK: {
displayName: "karbovanet ucraniano",
"displayName-count-one": "karbovanet ucraniano",
"displayName-count-other": "karbovanets ucranianos",
symbol: "UAK"
},
UGS: {
displayName: "chelín ugandés (1966–1987)",
symbol: "UGS"
},
UGX: {
displayName: "chelín ugandés",
"displayName-count-one": "chelín ugandés",
"displayName-count-other": "chelines ugandeses",
symbol: "UGX"
},
USD: {
displayName: "dólar estadounidense",
"displayName-count-one": "dólar estadounidense",
"displayName-count-other": "dólares estadounidenses",
symbol: "USD",
"symbol-alt-narrow": "$"
},
USN: {
displayName: "dólar estadounidense (día siguiente)",
"displayName-count-one": "dólar estadounidense (día siguiente)",
"displayName-count-other": "dólares estadounidenses (día siguiente)",
symbol: "USN"
},
USS: {
displayName: "dólar estadounidense (mismo día)",
"displayName-count-one": "dólar estadounidense (mismo día)",
"displayName-count-other": "dólares estadounidenses (mismo día)",
symbol: "USS"
},
UYI: {
displayName: "peso uruguayo en unidades indexadas",
"displayName-count-one": "peso uruguayo en unidades indexadas",
"displayName-count-other": "pesos uruguayos en unidades indexadas",
symbol: "UYI"
},
UYP: {
displayName: "peso uruguayo (1975–1993)",
"displayName-count-one": "peso uruguayo (UYP)",
"displayName-count-other": "pesos uruguayos (UYP)",
symbol: "UYP"
},
UYU: {
displayName: "peso uruguayo",
"displayName-count-one": "peso uruguayo",
"displayName-count-other": "pesos uruguayos",
symbol: "UYU",
"symbol-alt-narrow": "$"
},
UZS: {
displayName: "sum",
"displayName-count-one": "sum",
"displayName-count-other": "sums",
symbol: "UZS"
},
VEB: {
displayName: "bolívar venezolano (1871–2008)",
"displayName-count-one": "bolívar venezolano (1871–2008)",
"displayName-count-other": "bolívares venezolanos (1871–2008)",
symbol: "VEB"
},
VEF: {
displayName: "bolívar venezolano",
"displayName-count-one": "bolívar venezolano",
"displayName-count-other": "bolívares venezolanos",
symbol: "VEF",
"symbol-alt-narrow": "BsF"
},
VND: {
displayName: "dong",
"displayName-count-one": "dong",
"displayName-count-other": "dongs",
symbol: "VND",
"symbol-alt-narrow": "₫"
},
VNN: {
displayName: "VNN",
symbol: "VNN"
},
VUV: {
displayName: "vatu",
"displayName-count-one": "vatu",
"displayName-count-other": "vatus",
symbol: "VUV"
},
WST: {
displayName: "tala",
"displayName-count-one": "tala",
"displayName-count-other": "talas",
symbol: "WST"
},
XAF: {
displayName: "franco CFA BEAC",
"displayName-count-one": "franco CFA BEAC",
"displayName-count-other": "francos CFA BEAC",
symbol: "XAF"
},
XAG: {
displayName: "plata",
"displayName-count-one": "plata",
"displayName-count-other": "plata",
symbol: "XAG"
},
XAU: {
displayName: "oro",
"displayName-count-one": "oro",
"displayName-count-other": "oro",
symbol: "XAU"
},
XBA: {
displayName: "unidad compuesta europea",
"displayName-count-one": "unidad compuesta europea",
"displayName-count-other": "unidades compuestas europeas",
symbol: "XBA"
},
XBB: {
displayName: "unidad monetaria europea",
"displayName-count-one": "unidad monetaria europea",
"displayName-count-other": "unidades monetarias europeas",
symbol: "XBB"
},
XBC: {
displayName: "unidad de cuenta europea (XBC)",
"displayName-count-one": "unidad de cuenta europea (XBC)",
"displayName-count-other": "unidades de cuenta europeas (XBC)",
symbol: "XBC"
},
XBD: {
displayName: "unidad de cuenta europea (XBD)",
"displayName-count-one": "unidad de cuenta europea (XBD)",
"displayName-count-other": "unidades de cuenta europeas (XBD)",
symbol: "XBD"
},
XCD: {
displayName: "dólar del Caribe Oriental",
"displayName-count-one": "dólar del Caribe Oriental",
"displayName-count-other": "dólares del Caribe Oriental",
symbol: "XCD",
"symbol-alt-narrow": "$"
},
XDR: {
displayName: "derechos especiales de giro",
symbol: "XDR"
},
XEU: {
displayName: "unidad de moneda europea",
"displayName-count-one": "unidad de moneda europea",
"displayName-count-other": "unidades de moneda europeas",
symbol: "XEU"
},
XFO: {
displayName: "franco oro francés",
"displayName-count-one": "franco oro francés",
"displayName-count-other": "francos oro franceses",
symbol: "XFO"
},
XFU: {
displayName: "franco UIC francés",
"displayName-count-one": "franco UIC francés",
"displayName-count-other": "francos UIC franceses",
symbol: "XFU"
},
XOF: {
displayName: "franco CFA BCEAO",
"displayName-count-one": "franco CFA BCEAO",
"displayName-count-other": "francos CFA BCEAO",
symbol: "XOF"
},
XPD: {
displayName: "paladio",
"displayName-count-one": "paladio",
"displayName-count-other": "paladio",
symbol: "XPD"
},
XPF: {
displayName: "franco CFP",
"displayName-count-one": "franco CFP",
"displayName-count-other": "francos CFP",
symbol: "CFPF"
},
XPT: {
displayName: "platino",
"displayName-count-one": "platino",
"displayName-count-other": "platino",
symbol: "XPT"
},
XRE: {
displayName: "fondos RINET",
symbol: "XRE"
},
XSU: {
displayName: "XSU",
symbol: "XSU"
},
XTS: {
displayName: "código reservado para pruebas",
symbol: "XTS"
},
XUA: {
displayName: "XUA",
symbol: "XUA"
},
XXX: {
displayName: "moneda desconocida",
"displayName-count-one": "(unidad de moneda desconocida)",
"displayName-count-other": "(moneda desconocida)",
symbol: "XXX"
},
YDD: {
displayName: "dinar yemení",
symbol: "YDD"
},
YER: {
displayName: "rial yemení",
"displayName-count-one": "rial yemení",
"displayName-count-other": "riales yemeníes",
symbol: "YER"
},
YUD: {
displayName: "dinar fuerte yugoslavo",
symbol: "YUD"
},
YUM: {
displayName: "super dinar yugoslavo",
symbol: "YUM"
},
YUN: {
displayName: "dinar convertible yugoslavo",
"displayName-count-one": "dinar convertible yugoslavo",
"displayName-count-other": "dinares convertibles yugoslavos",
symbol: "YUN"
},
YUR: {
displayName: "YUR",
symbol: "YUR"
},
ZAL: {
displayName: "rand sudafricano (financiero)",
symbol: "ZAL"
},
ZAR: {
displayName: "rand",
"displayName-count-one": "rand",
"displayName-count-other": "rands",
symbol: "ZAR",
"symbol-alt-narrow": "R"
},
ZMK: {
displayName: "kwacha zambiano (1968–2012)",
"displayName-count-one": "kwacha zambiano (1968–2012)",
"displayName-count-other": "kwachas zambianos (1968–2012)",
symbol: "ZMK"
},
ZMW: {
displayName: "kuacha zambiano",
"displayName-count-one": "kuacha zambiano",
"displayName-count-other": "kuachas zambianos",
symbol: "ZMW",
"symbol-alt-narrow": "ZK"
},
ZRN: {
displayName: "nuevo zaire zaireño",
symbol: "ZRN"
},
ZRZ: {
displayName: "zaire zaireño",
symbol: "ZRZ"
},
ZWD: {
displayName: "dólar de Zimbabue",
symbol: "ZWD"
},
ZWL: {
displayName: "dólar zimbabuense",
symbol: "ZWL"
},
ZWR: {
displayName: "ZWR",
symbol: "ZWR"
}
},
localeCurrency: "HNL"
},
calendar: {
patterns: {
d: "d/M/y",
D: "EEEE dd 'de' MMMM 'de' y",
m: "d MMM",
M: "d 'de' MMMM",
y: "MMMM 'de' y",
Y: "MMMM 'de' y",
F: "EEEE dd 'de' MMMM 'de' y HH:mm:ss",
g: "d/M/y HH:mm",
G: "d/M/y HH:mm:ss",
t: "HH:mm",
T: "HH:mm:ss",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'"
},
dateTimeFormats: {
full: "{1}, {0}",
long: "{1}, {0}",
medium: "{1} {0}",
short: "{1} {0}",
availableFormats: {
d: "d",
E: "ccc",
Ed: "E d",
Ehm: "E, h:mm a",
EHm: "E, HH:mm",
Ehms: "E, h:mm:ss a",
EHms: "E, HH:mm:ss",
Gy: "y G",
GyMMM: "MMM y G",
GyMMMd: "d 'de' MMM 'de' y G",
GyMMMEd: "E, d MMM y G",
GyMMMM: "MMMM 'de' y G",
GyMMMMd: "d 'de' MMMM 'de' y G",
GyMMMMEd: "E, d 'de' MMMM 'de' y G",
h: "h a",
H: "HH",
hm: "h:mm a",
Hm: "HH:mm",
hms: "h:mm:ss a",
Hms: "HH:mm:ss",
hmsv: "h:mm:ss a v",
Hmsv: "H:mm:ss v",
hmsvvvv: "h:mm:ss a (vvvv)",
Hmsvvvv: "H:mm:ss (vvvv)",
hmv: "h:mm a v",
Hmv: "H:mm v",
M: "L",
Md: "d/M",
MEd: "E, d/M",
MMd: "d/M",
MMdd: "d/M",
MMM: "LLL",
MMMd: "d MMM",
MMMdd: "dd-MMM",
MMMEd: "E, d MMM",
MMMMd: "d 'de' MMMM",
MMMMEd: "E, d 'de' MMMM",
"MMMMW-count-one": "'semana' W 'de' MMM",
"MMMMW-count-other": "'semana' W 'de' MMM",
ms: "mm:ss",
y: "y",
yM: "M/y",
yMd: "d/M/y",
yMEd: "E d/M/y",
yMM: "M/y",
yMMM: "MMMM 'de' y",
yMMMd: "d 'de' MMMM 'de' y",
yMMMEd: "E, d 'de' MMM 'de' y",
yMMMM: "MMMM 'de' y",
yMMMMd: "d 'de' MMMM 'de' y",
yMMMMEd: "EEE, d 'de' MMMM 'de' y",
yQQQ: "QQQ 'de' y",
yQQQQ: "QQQQ 'de' y",
"yw-count-one": "'semana' w 'de' y",
"yw-count-other": "'semana' w 'de' y"
}
},
timeFormats: {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
},
dateFormats: {
full: "EEEE dd 'de' MMMM 'de' y",
long: "dd 'de' MMMM 'de' y",
medium: "d MMM y",
short: "d/M/yy"
},
days: {
format: {
abbreviated: [
"dom.",
"lun.",
"mar.",
"mié.",
"jue.",
"vie.",
"sáb."
],
narrow: [
"d",
"l",
"m",
"m",
"j",
"v",
"s"
],
short: [
"DO",
"LU",
"MA",
"MI",
"JU",
"VI",
"SA"
],
wide: [
"domingo",
"lunes",
"martes",
"miércoles",
"jueves",
"viernes",
"sábado"
]
},
"stand-alone": {
abbreviated: [
"dom.",
"lun.",
"mar.",
"mié.",
"jue.",
"vie.",
"sáb."
],
narrow: [
"D",
"L",
"M",
"M",
"J",
"V",
"S"
],
short: [
"DO",
"LU",
"MA",
"MI",
"JU",
"VI",
"SA"
],
wide: [
"domingo",
"lunes",
"martes",
"miércoles",
"jueves",
"viernes",
"sábado"
]
}
},
months: {
format: {
abbreviated: [
"ene.",
"feb.",
"mar.",
"abr.",
"may.",
"jun.",
"jul.",
"ago.",
"sep.",
"oct.",
"nov.",
"dic."
],
narrow: [
"e",
"f",
"m",
"a",
"m",
"j",
"j",
"a",
"s",
"o",
"n",
"d"
],
wide: [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
]
},
"stand-alone": {
abbreviated: [
"ene.",
"feb.",
"mar.",
"abr.",
"may.",
"jun.",
"jul.",
"ago.",
"sep.",
"oct.",
"nov.",
"dic."
],
narrow: [
"E",
"F",
"M",
"A",
"M",
"J",
"J",
"A",
"S",
"O",
"N",
"D"
],
wide: [
"enero",
"febrero",
"marzo",
"abril",
"mayo",
"junio",
"julio",
"agosto",
"septiembre",
"octubre",
"noviembre",
"diciembre"
]
}
},
quarters: {
format: {
abbreviated: [
"T1",
"T2",
"T3",
"T4"
],
narrow: [
"1",
"2",
"3",
"4"
],
wide: [
"1.er trimestre",
"2.º trimestre",
"3.er trimestre",
"4.º trimestre"
]
},
"stand-alone": {
abbreviated: [
"T1",
"T2",
"T3",
"T4"
],
narrow: [
"1",
"2",
"3",
"4"
],
wide: [
"1.er trimestre",
"2.º trimestre",
"3.er trimestre",
"4.º trimestre"
]
}
},
dayPeriods: {
format: {
abbreviated: {
am: "a. m.",
noon: "del mediodía",
pm: "p. m.",
morning1: "de la madrugada",
morning2: "de la mañana",
evening1: "de la tarde",
night1: "de la noche"
},
narrow: {
am: "a. m.",
noon: "del mediodía",
pm: "p. m.",
morning1: "de la madrugada",
morning2: "de la mañana",
evening1: "de la tarde",
night1: "de la noche"
},
wide: {
am: "a. m.",
noon: "del mediodía",
pm: "p. m.",
morning1: "de la madrugada",
morning2: "de la mañana",
evening1: "de la tarde",
night1: "de la noche"
}
},
"stand-alone": {
abbreviated: {
am: "a. m.",
noon: "mediodía",
pm: "p. m.",
morning1: "madrugada",
morning2: "mañana",
evening1: "tarde",
night1: "noche"
},
narrow: {
am: "a. m.",
noon: "mediodía",
pm: "p. m.",
morning1: "madrugada",
morning2: "mañana",
evening1: "tarde",
night1: "noche"
},
wide: {
am: "a. m.",
noon: "mediodía",
pm: "p. m.",
morning1: "madrugada",
morning2: "mañana",
evening1: "tarde",
night1: "noche"
}
}
},
eras: {
format: {
wide: {
0: "antes de Cristo",
1: "después de Cristo",
"0-alt-variant": "antes de la era común",
"1-alt-variant": "era común"
},
abbreviated: {
0: "a. C.",
1: "d. C.",
"0-alt-variant": "a. e. c.",
"1-alt-variant": "e. c."
},
narrow: {
0: "a. C.",
1: "d. C.",
"0-alt-variant": "a. e. c.",
"1-alt-variant": "e. c."
}
}
},
gmtFormat: "GMT{0}",
gmtZeroFormat: "GMT",
dateFields: {
era: {
wide: "era",
short: "era",
narrow: "era"
},
year: {
wide: "año",
short: "a",
narrow: "a"
},
quarter: {
wide: "trimestre",
short: "trim.",
narrow: "trim."
},
month: {
wide: "mes",
short: "m",
narrow: "m"
},
week: {
wide: "semana",
short: "sem.",
narrow: "sem."
},
weekOfMonth: {
wide: "Week Of Month",
short: "Week Of Month",
narrow: "Week Of Month"
},
day: {
wide: "día",
short: "d",
narrow: "d"
},
dayOfYear: {
wide: "Day Of Year",
short: "Day Of Year",
narrow: "Day Of Year"
},
weekday: {
wide: "día de la semana",
short: "día de la semana",
narrow: "día de la semana"
},
weekdayOfMonth: {
wide: "Weekday Of Month",
short: "Weekday Of Month",
narrow: "Weekday Of Month"
},
dayperiod: {
short: "a.m./p.m.",
wide: "a.m./p.m.",
narrow: "a.m./p.m."
},
hour: {
wide: "hora",
short: "h",
narrow: "h"
},
minute: {
wide: "minuto",
short: "min",
narrow: "min"
},
second: {
wide: "segundo",
short: "s",
narrow: "s"
},
zone: {
wide: "Zona horaria",
short: "Zona horaria",
narrow: "Zona horaria"
}
}
},
firstDay: 0,
likelySubtags: {
es: "es-Latn-ES"
}
});
|
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import Pagination from '../src/Pagination';
describe('<Pagination>', () => {
it('should have class', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination>Item content</Pagination>
);
assert.ok(ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'pagination'));
});
it('should show the correct active button', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
items={5}
activePage={3}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons.length, 5);
pageButtons[2].className.should.match(/\bactive\b/);
});
it('should call onSelect when page button is selected', (done) => {
function onSelect(eventKey) {
assert.equal(eventKey, 2);
done();
}
const instance = ReactTestUtils.renderIntoDocument(
<Pagination items={5} onSelect={onSelect} />
);
ReactTestUtils.Simulate.click(
ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'a')[1]
);
});
it('should only show part of buttons and active button in the middle of buttons when given maxButtons', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
items={30}
activePage={10}
maxButtons={9}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
// 9 visible page buttons and 1 ellipsis button
assert.equal(pageButtons.length, 10);
// active button is the second one
assert.equal(pageButtons[0].firstChild.textContent, '6');
pageButtons[4].className.should.match(/\bactive\b/);
});
it('should show the ellipsis, boundaryLinks, first, last, prev and next button with default labels', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
first
last
prev
next
ellipsis
maxButtons={3}
activePage={10}
items={20}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
// add first, last, prev, next and ellipsis button
assert.equal(pageButtons.length, 8);
assert.equal(pageButtons[0].textContent, '«');
assert.equal(pageButtons[1].textContent, '‹');
assert.equal(pageButtons[5].textContent, '…');
assert.equal(pageButtons[6].textContent, '›');
assert.equal(pageButtons[7].textContent, '»');
});
it('should show the boundaryLinks, first, last, prev and next button', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
first
last
prev
next
ellipsis
boundaryLinks
maxButtons={3}
activePage={10}
items={20}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
// add first, last, prev, next and ellipsis button
assert.equal(pageButtons[2].textContent, '1');
assert.equal(pageButtons[3].textContent, '…');
assert.equal(pageButtons[7].textContent, '…');
assert.equal(pageButtons[8].textContent, '20');
});
it('should not render ellipsis with boundaryLinks near start', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
first
last
prev
next
boundaryLinks
maxButtons={5}
activePage={4}
items={20}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[3].textContent, '2');
});
it('should not render ellipsis with boundaryLinks near end', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
first
last
prev
next
boundaryLinks
maxButtons={5}
activePage={17}
items={20}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[pageButtons.length - 4].textContent, '19');
});
it('should show the ellipsis, first, last, prev and next button with custom labels', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
first="first"
last="last"
prev="prev"
next="next"
ellipsis="more"
maxButtons={3}
activePage={10}
items={20}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
// add first, last, prev, next and ellipsis button
assert.equal(pageButtons.length, 8);
assert.equal(pageButtons[0].textContent, 'first');
assert.equal(pageButtons[1].textContent, 'prev');
assert.equal(pageButtons[5].textContent, 'more');
assert.equal(pageButtons[6].textContent, 'next');
assert.equal(pageButtons[7].textContent, 'last');
});
it('should enumerate pagenums correctly when ellipsis=true', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
first
last
prev
next
ellipsis
maxButtons={5}
activePage={1}
items={1}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[0].textContent, '«');
assert.equal(pageButtons[1].textContent, '‹');
assert.equal(pageButtons[2].textContent, '1');
assert.equal(pageButtons[3].textContent, '›');
assert.equal(pageButtons[4].textContent, '»');
});
it('should render next and last buttons as disabled when items=0 and ellipsis=true', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
last
next
ellipsis
maxButtons={1}
activePage={1}
items={0}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[0].textContent, '›');
assert.equal(pageButtons[1].textContent, '»');
assert.include(pageButtons[0].className, 'disabled');
assert.include(pageButtons[1].className, 'disabled');
});
it('should wrap buttons in SafeAnchor when no buttonComponentClass prop is supplied', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
maxButtons={2}
activePage={1}
items={2}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[0].children[0].tagName, 'A');
assert.equal(pageButtons[1].children[0].tagName, 'A');
assert.equal(pageButtons[0].children[0].getAttribute('href'), '#');
assert.equal(pageButtons[1].children[0].getAttribute('href'), '#');
});
it('should wrap each button in a buttonComponentClass when it is present', () => {
class DummyElement extends React.Component {
render() {
return <div>{this.props.children}</div>;
}
}
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
maxButtons={2}
activePage={1}
items={2}
buttonComponentClass={DummyElement}
/>
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[0].children[0].tagName, 'DIV');
assert.equal(pageButtons[1].children[0].tagName, 'DIV');
});
it('should call onSelect with custom buttonComponentClass', (done) => {
class DummyElement extends React.Component {
render() {
return <div onClick={this.props.onClick} />;
}
}
function onSelect(eventKey) {
assert.equal(eventKey, 3);
done();
}
const instance = ReactTestUtils.renderIntoDocument(
<Pagination items={5} onSelect={onSelect} buttonComponentClass={DummyElement} />
);
ReactTestUtils.Simulate.click(
ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'div')[2]
);
});
it('should not fire "onSelect" event on disabled buttons', () => {
function onSelect() {
throw Error('this event should not happen');
}
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
onSelect={onSelect}
last
next
ellipsis
maxButtons={1}
activePage={1}
items={0}
/>
);
const liElements = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
// buttons are disabled
assert.include(liElements[0].className, 'disabled');
assert.include(liElements[1].className, 'disabled');
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'a');
const nextButton = pageButtons[0];
const lastButton = pageButtons[1];
ReactTestUtils.Simulate.click(nextButton);
ReactTestUtils.Simulate.click(lastButton);
});
it('should pass page number to buttonComponentClass', () => {
class DummyElement extends React.Component {
render() {
return (
<a href={`?page=${this.props.eventKey}`}>
{this.props.eventKey}
</a>
);
}
}
const instance = ReactTestUtils.renderIntoDocument(
<Pagination items={5} buttonComponentClass={DummyElement} />
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'a');
assert.equal(pageButtons[1].getAttribute('href'), '?page=2');
});
it('should render three items from 1 to 3 when activePage=1', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination items={4} maxButtons={3} activePage={1} />
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[0].textContent, '1');
assert.equal(pageButtons[1].textContent, '2');
assert.equal(pageButtons[2].textContent, '3');
});
it('should render three items from 2 to 4 when activePage=3', () => {
const instance = ReactTestUtils.renderIntoDocument(
<Pagination
onSelect={()=>{}}
items={4}
maxButtons={3}
activePage={3} />
);
const pageButtons = ReactTestUtils.scryRenderedDOMComponentsWithTag(instance, 'li');
assert.equal(pageButtons[0].textContent, '2');
assert.equal(pageButtons[1].textContent, '3');
assert.equal(pageButtons[2].textContent, '4');
});
});
|
var gulp = require('gulp'),
sass = require('gulp-sass'),
gp_concat = require('gulp-concat'),
gp_uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
minifyCss = require('gulp-minify-css'),
rev = require('gulp-rev'),
replace = require('gulp-replace'),
notify = require('gulp-notify'),
revReplace = require('gulp-rev-replace');
//var css_rev = gulp.src('.css/rev-manifest.json');
//var js_rev = gulp.src('.js/rev-manifest.json');
gulp.task('sass', function () {
return gulp.src('./scss/main.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(gulp.dest('./css'));
});
gulp.task('mincss',['sass'],function(){
gulp.src(['./css/normalize.css','./css/main.css'])
.pipe(gp_concat('main.big.css'))
.pipe(gulp.dest('./css'))
.pipe(minifyCss())
.pipe(rename('main.min.css'))
.pipe(gulp.dest('./css'))
})
gulp.task('watch',function(){
gulp.watch('./scss/*', function() {
gulp.run(['mincss']);
});
gulp.watch('./js/*.js', function() {
gulp.run(['ugly']);
});
});
gulp.task('ugly',function(){
return gulp.src(['./js/main.js'])
.pipe(gp_uglify())
.pipe(rename('main.min.js'))
.pipe(gulp.dest('./js/'))
})
gulp.task('deploy',function(){
return gulp.src([
'./css/main.min.css',
'./js/main.min.js'
], {base: './'})
.pipe(rev())
.pipe(gulp.dest('./'))
.pipe(notify(this))
.pipe(rev.manifest())
.pipe(gulp.dest('./'))
})
|
var BlockView = Backbone.View.extend({
tagName : 'div',
initialize : function() {
this.render();
},
render: function() {
this.$el.attr({
class : 'block gimmick-' + this.model.get('gimmick'),
'data-gimmick' : this.model.get('gimmick')
});
},
collide: function() {
if (this.model.get('isDead'))
return;
var ballX = app.ball.model.get('ballX'),
ballY = app.ball.model.get('ballY'),
ballRadius = app.ball.model.get('ballRadius'),
blockX = this.model.get('blockX'),
blockY = this.model.get('blockY'),
blockW = this.model.get('blockW'),
blockH = this.model.get('blockH');
// Collision
if (ballX + ballRadius < blockX || ballX - ballRadius > blockX + blockW)
return;
if (ballY + ballRadius < blockY || ballY - ballRadius > blockY + blockH)
return;
// Dead
this.die();
this.model.set('isDead', true);
// Updating ball
var prevBallPos_x = app.ball.model.get('prevBallPos.x');
app.ball.model.set('ballX', prevBallPos_x);
var prevBallPos_y = app.ball.model.get('prevBallPos.y');
app.ball.model.set('ballY', prevBallPos_y);
var ballDirectionY = app.ball.model.get('ballDirectionY');
app.ball.model.set('ballDirectionY', ballDirectionY *= -1.0);
},
die : function() {
app.blockCount++;
this.$el.remove();
this.remove();
}
});
|
import {
moduleForComponent,
test
} from 'ember-qunit';
moduleForComponent('plottable-chart', {
unit: true
// specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar']
});
test('it renders', function(assert) {
assert.expect(2);
// creates the component instance
var component = this.subject();
assert.equal(component._state, 'preRender');
// renders the component to the page
this.render();
assert.equal(component._state, 'inDOM');
});
|
/** @license MIT License (c) copyright 2014 original authors */
/** @author Karolis Narkevicius */
var path = require('path');
var knox = require('knox-s3');
var when = require('when');
var thunkify = require('thunkify');
var cp = require('fs-cp');
module.exports = function (config) {
return new S3(config);
};
/**
* Amazon S3 Storage Adapter for CNPM
*
* @param {Object} knox config
* @api public
*/
function S3(config) {
this.config = config;
this.client = knox.createClient(this.config);
this.client.getFile = thunkify(this.client.getFile);
this.client.deleteFile = thunkify(this.client.deleteFile);
}
/**
* Upload a package from filepath to S3.
*
* @param {String} filepath the path of the file to upload
* @param {Object} options with key and size
* @return {Object} an object with the key
* @api public
*/
S3.prototype.upload = function* (filepath, options) {
var s3Config = this.config;
var client = this.client;
var dest = this.getPath(options.key);
var uploadOptions = {};
if (s3Config.storageClass) {
uploadOptions['x-amz-storage-class'] = s3Config.storageClass;
}
yield when.promise(function (resolve, reject) {
client.putFile(filepath, dest, uploadOptions, function (err, res) {
if (err) return reject(err);
if (res.statusCode !== 200) { return reject(new Error('putFile failed with ' + res.statusCode)); }
resolve();
}).on('error', function (err) {
reject(new Error('Network error' + err.message));
});
});
return { key: options.key };
};
/**
* Upload a package from filepath to S3.
*
* @param {String} contents of the file to upload
* @param {Object} options with key and size
* @return {Object} an object with the key
* @api public
*/
S3.prototype.uploadBuffer = function* (content, options) {
var client = this.client;
var filepath = this.getPath(options.key);
var headers = {
'Content-Type': 'application/x-gzip'
};
yield when.promise(function (resolve, reject) {
client.putBuffer(content, filepath, headers, function(err, res) {
if (err) return reject(err);
if (res.statusCode !== 200) return reject(new Error('putBuffer failed with ' + res.statusCode));
resolve();
}).on('error', function (err) {
reject(new Error('Network error' + err.message));
});
});
return { key: options.key };
};
/**
* Download a package from S3.
*
* @param {String} package key
* @param {String} download path
* @param {options} an object with timeout
* @api public
*/
S3.prototype.download = function* (key, savePath) {
var client = this.client;
var filepath = this.getPath(key);
var res = yield client.getFile(filepath);
yield cp(res, savePath);
};
/**
* Remove a package from S3
*
* @param {String} package key
* @api public
*/
S3.prototype.remove = function* (key) {
var client = this.client;
var filepath = this.getPath(key);
yield client.deleteFile(filepath);
};
/**
* escape '/' and '\'
* prepend the config.folder
*/
S3.prototype.getPath = function (key) {
key = key.replace(/\//g, '-').replace(/\\/g, '_');
key = path.join(this.config.folder, key);
return key;
};
|
define( "add", [
"../core/vi"
], function( vi ) {
/**
* func Add
* @param {Int} a
* @param {Int} b
* @return {Int} a+b
*/
vi.add = function( a, b ) {
return a + b;
};
return vi.add;
});
|
/**
* Error parser for apeman.
* @module apemanerror
* @version 5.3.2
*/
'use strict';
var _assign = require('babel-runtime/core-js/object/assign');
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var apemanerror = require('./apemanerror');
var buildin = require('./buildin');
var lib = apemanerror.bind(undefined);
(0, _assign2.default)(lib, apemanerror, {
buildin: buildin
});
module.exports = lib;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbImFwZW1hbmVycm9yIiwicmVxdWlyZSIsImJ1aWxkaW4iLCJsaWIiLCJiaW5kIiwibW9kdWxlIiwiZXhwb3J0cyJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztBQU1BOzs7Ozs7OztBQUVBLElBQU1BLGNBQWNDLFFBQVEsZUFBUixDQUFwQjtBQUNBLElBQU1DLFVBQVVELFFBQVEsV0FBUixDQUFoQjs7QUFFQSxJQUFJRSxNQUFNSCxZQUFZSSxJQUFaLFdBQVY7O0FBRUEsc0JBQWNELEdBQWQsRUFBbUJILFdBQW5CLEVBQWdDO0FBQzlCRTtBQUQ4QixDQUFoQzs7QUFJQUcsT0FBT0MsT0FBUCxHQUFpQkgsR0FBakIiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoibGliIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFcnJvciBwYXJzZXIgZm9yIGFwZW1hbi5cbiAqIEBtb2R1bGUgYXBlbWFuZXJyb3JcbiAqIEB2ZXJzaW9uIDUuMy4yXG4gKi9cblxuJ3VzZSBzdHJpY3QnXG5cbmNvbnN0IGFwZW1hbmVycm9yID0gcmVxdWlyZSgnLi9hcGVtYW5lcnJvcicpXG5jb25zdCBidWlsZGluID0gcmVxdWlyZSgnLi9idWlsZGluJylcblxubGV0IGxpYiA9IGFwZW1hbmVycm9yLmJpbmQodGhpcylcblxuT2JqZWN0LmFzc2lnbihsaWIsIGFwZW1hbmVycm9yLCB7XG4gIGJ1aWxkaW5cbn0pXG5cbm1vZHVsZS5leHBvcnRzID0gbGliXG4iXX0=
|
dojo.provide("t.unit.plugins.dojox.module");
try{
dojo.require("t.unit.plugins.dojox.timing.test");
}
catch(e) {
doh.debug(e);
}
|
import { moduleForModel, test } from 'ember-qunit';
moduleForModel('task', 'Unit | Model | task', {
// Specify the other units that are required for this test.
needs: ['model:unfuddle-project']
});
test('it exists', function(assert) {
let model = this.subject();
// let store = this.store();
assert.ok(!!model);
});
|
/**
* Factory based on OS output
*
*/
var OS = require( "os" );
//Webcam types
var FSWebcam = require( "./webcams/FSWebcam.js" );
var ImageSnapWebcam = require( "./webcams/ImageSnapWebcam.js" );
var WindowsWebcam = require( "./webcams/WindowsWebcam.js" );
//Main singleton
var Factory = new function() {
var scope = this;
//Main Class get
scope.create = function( options, type ) {
var p = type || Factory.Platform;
var Type = Factory.Types[ p ];
if( ! Type ) {
throw new Error( "Sorry, no webcam type specified yet for platform " + p );
}
return new Type( options );
};
};
Factory.Platform = OS.platform();
//OS Webcam types
Factory.Types = {
linux: FSWebcam,
darwin: ImageSnapWebcam,
fswebcam: FSWebcam,
win32: WindowsWebcam,
win64: WindowsWebcam
};
//Export
module.exports = Factory;
|
// "C" is for cookie, that's good enough for me.
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(";");
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == " ") c = c.substring(1);
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
}
return "";
}
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
var expires = "expires=" + d.toUTCString();
document.cookie =
cname + "=" + cvalue + "; " + expires + ";domain=.pokejisho.com;path=/";
}
// COOKIE COOKIE COOKIE STARTS WITH "C"
|
export default class Player extends Phaser.Sprite {
constructor(game) {
super(game, 0, 0, 'hero');
// enable physics for the player
this.game.physics.arcade.enableBody(this);
this.scale.setTo(1.1);
this.body.collideWorldBounds = true;
this.game.physics.arcade.enable(this);
// camera follows player
this.game.camera.follow(this);
// walking animations for the player
this.animations.add("walk-left", [117, 118, 119, 120, 121, 122, 123, 124, 125], 8, true);
this.animations.add("walk-right", [143, 144, 145, 146, 147, 148, 149, 150, 151], 8, true);
this.animations.add("walk-up", [104, 105, 106, 107, 108, 109, 110, 111, 112], 8, true);
this.animations.add("walk-down", [130, 131, 132, 133, 134, 135, 136, 137, 138,], 8, true);
// create control inputs for player
this.cursors = this.game.input.keyboard.createCursorKeys();
}
update() {
this.body.velocity.x = 0;
this.body.velocity.y = 0;
// player moves in specified direction or stands still
if (this.cursors.left.isDown) {
this.animations.play("walk-left");
this.body.velocity.x =- 180;
} else if (this.cursors.right.isDown) {
this.animations.play("walk-right");
this.body.velocity.x =+ 180;
} else {
this.body.velocity.x = 0;
}
if (this.cursors.up.isDown) {
this.animations.play("walk-up");
this.body.velocity.y =- 180;
} else if (this.cursors.down.isDown) {
this.animations.play("walk-down");
this.body.velocity.y =+ 180;
} else {
this.body.velocity.y = 0;
}
if (this.body.velocity.x === 0 && this.body.velocity.y === 0) {
this.animations.stop();
}
}
}
|
//GET /quizes/question
exports.question = function(req, res){
res.render('quizes/question', {pregunta: 'Capital de Italia'});
};
//GET quizes/answer
exports.answer = function(req, res){
if(req.query.respuesta === 'Roma'){
res.render('quizes/answer', {respuesta: 'Correcto'});
}else{
res.render('quizes/answer', {respuesta: 'Incorrecto'});
}
};
|
(function () {
window._paddingsTest = function () {
var test = function (padding) {
for (var len = 0; len <= 32; len++) {
var initialArray = random.default.getUint8Array(len);
var padded = padding.pad(initialArray, 16, random.default);
var padCount = padding.unpad(padded);
if (padCount == -1) {
console.log('Failed! 1');
return;
}
var unpadded = padded.subarray(0, padded.length - padCount);
if (initialArray.length != unpadded.length) {
console.log('Failed! 2');
return;
}
for (var i = 0; i < len; i++)
if (initialArray[i] != unpadded[i]) {
console.log('Failed! 3');
return;
}
}
console.log('passed');
};
console.log('ANSI X.923 test');
test(paddings['ANSI X.923']);
console.log('ISO 10126 test');
test(paddings['ISO 10126']);
console.log('PKCS7 test');
test(paddings['PKCS7']);
console.log('ISO/IEC 7816-4 test');
test(paddings['ISO/IEC 7816-4']);
};
var a40 = [25, 215, 226, 12, 106, 44, 159, 200, 49, 56, 86, 185, 11, 129, 90, 44, 125, 56, 126, 161, 114, 118, 212, 181, 23, 207, 189, 3, 55, 60, 7, 51, 5, 40, 199, 63, 151, 19, 88, 63];
window._md2Test = function () {
var test = function (bytes, hex) {
return bh.byteArrayToHex(hashAlgorithms.md2.computeHash(bytes)) == hex;
};
var result = true;
result &= test([], '8350e5a3e24c153df2275c9f80692773');
result &= test([255], '0797438d0baf3d71b7194ab3c71746b6');
result &= test(a40, '92183ec96932db4a26396b23d4df87a3');
console.log(result ? 'Passed' : 'Failed');
};
window._md4Test = function () {
var test = function (bytes, hex) {
return bh.byteArrayToHex(hashAlgorithms.md4.computeHash(bytes)) == hex;
};
var result = true;
result &= test([], '31d6cfe0d16ae931b73c59d7e0c089c0');
result &= test([255], '82c167af8e345bd055487af8d2b540c9');
result &= test(a40, 'c146aadc86111c7de36c7f319fa8a15d');
console.log(result ? 'Passed' : 'Failed');
};
window._md5Test = function () {
var test = function (bytes, hex) {
return bh.byteArrayToHex(hashAlgorithms.md5.computeHash(bytes)) == hex;
};
var result = true;
result &= test([], 'd41d8cd98f00b204e9800998ecf8427e');
result &= test([255], '00594fd4f42ba43fc1ca0427a0576295');
result &= test(a40, '332f73d56f380cea8ab0d51e855bac41');
console.log(result ? 'Passed' : 'Failed');
}
window._sha1Test = function () {
var test = function (bytes, hex) {
return bh.byteArrayToHex(hashAlgorithms.sha1.computeHash(bytes)) == hex;
};
var result = true;
result &= test([], 'da39a3ee5e6b4b0d3255bfef95601890afd80709');
result &= test([255], '85e53271e14006f0265921d02d4d736cdc580b0b');
result &= test(a40, '7a4ce8e483c6fb3460501e660fb164a4d2928c57');
console.log(result ? 'Passed' : 'Failed');
};
window._sha2Test = function () {
var test = function (bytes, ver, hex) {
if (ver == 224)
return bh.byteArrayToHex(hashAlgorithms.sha224.computeHash(bytes)) == hex;
if (ver == 256)
return bh.byteArrayToHex(hashAlgorithms.sha256.computeHash(bytes)) == hex;
if (ver == 384)
return bh.byteArrayToHex(hashAlgorithms.sha384.computeHash(bytes)) == hex;
if (ver == 512)
return bh.byteArrayToHex(hashAlgorithms.sha512.computeHash(bytes)) == hex;
};
console.log('SHA-224');
var result = true;
result &= test([], 224, 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f');
result &= test([255], 224, 'e33f9d75e6ae1369dbabf81b96b4591ae46bba30b591a6b6c62542b5');
result &= test(a40, 224, '4beabeb77adf912c2270c455dd215f818662c0d61b85508c7def6a73');
console.log(result ? 'Passed' : 'Failed');
console.log('SHA-256');
var result = true;
result &= test([], 256, 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855');
result &= test([255], 256, 'a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb89');
result &= test(a40, 256, '9792f39846b22bee11dbaa2a34014141c90cb4ef2f2c16dc83a48b0456f4705d');
console.log(result ? 'Passed' : 'Failed');
console.log('SHA-384');
var result = true;
result &= test([], 384, '38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b');
result &= test([255], 384, '43950796d9883503655e35b5190aee687a2dd99f265012625b95753978e4efff3e8414d178a6e2318480d8eb6ddee643');
result &= test(a40, 384, '1fde9ca46c6d627edfbda629ce47e9101e803674e9156f9706d7a9406e5fe1c91e981e4276b37c78ce8c329b4a30a765');
console.log(result ? 'Passed' : 'Failed');
console.log('SHA-512');
var result = true;
result &= test([], 512, 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e');
result &= test([255], 512, '6700df6600b118ab0432715a7e8a68b0bf37cdf4adaf0fb9e2b3ebe04ad19c7032cbad55e932792af360bafaa09962e2e690652bc075b2dad0c30688ba2f31a3');
result &= test([97, 98, 99], 512, 'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f');
test(a40, 512, 'a8e64de4f5fa72e7a1a1bee705d87acc50748a810482a088535e53ad741ed68fb0c7cb08035802f63d466ba629b13823705db763f5ec043918f20c2266c0a783');
console.log(result ? 'Passed' : 'Failed');
};
window._ripemd160Test = function () {
var test = function (bytes, hex) {
return bh.byteArrayToHex(hashAlgorithms.ripemd160.computeHash(bytes)) == hex;
};
var result = true;
result &= test([], '9c1185a5c5e9fc54612808977ee8f548b2258d31');
result &= test([255], '2c0c45d3ecab80fe060e5f1d7057cd2f8de5e557');
result &= test(a40, '7b78ec9d05702f000dbb1d88c2c941795b4f62bd');
console.log(result ? 'Passed' : 'Failed');
};
window._hashAlgoTest = function () {
console.log('md2'); _md2Test();
console.log('md4'); _md4Test();
console.log('md5'); _md5Test();
console.log('sha1'); _sha1Test();
_sha2Test();
console.log('ripemd160'); _ripemd160Test();
};
})();
|
#!/usr/bin/env node
const NumberUtil = require("../js/lib/number-util.js");
var Z80_assemble = require('../js/Z80/assembler');
var MZ_TapeHeader = require('../js/lib/mz-tape-header');
var changeExt = require('../js/lib/change-ext.js');
var fs = require('fs');
var getPackageJson = require("./lib/get-package-json");
var npmInfo = getPackageJson(__dirname + "/..");
var Getopt = require('node-getopt');
var getopt = new Getopt([
['m', 'map=FILENAME', 'output map file name'],
['z', 'output-MZT-header', 'output MZT header'],
['a', 'loading-address=ADDR', 'set loading address'],
['e', 'execution-address=ADDR', 'set execution address'],
['t', 'reuse-mzt-header=FILENAME', "reuse the MZT header."],
['o', 'output-file=FILENAME', 'filename to output'],
['h', 'help', 'display this help'],
['v', 'version', 'show version']
]);
var cli = getopt.parseSystem();
var description = "A simple Z80 assembler -- " + npmInfo.name + "@" + npmInfo.version;
getopt.setHelp(
"Usage: mzasm [OPTION] filename [filename ...]\n" +
description + "\n" +
"\n" +
"[[OPTIONS]]\n" +
"\n" +
"Installation: npm install -g mz700-js\n" +
"Repository: https://github.com/takamin/mz700-js");
if(cli.options.help) {
getopt.showHelp();
process.exit(0);
}
if(cli.options.version) {
console.log(description);
process.exit(0);
}
var args = require("hash-arg").get(["input_filenames:string[]"], cli.argv);
if(cli.argv.length < 1) {
console.error('error: no input file');
process.exit(-1);
}
// Determine the output filename
var output_filename = null;
if('output-file' in cli.options) {
output_filename = cli.options['output-file'];
} else {
var ext = null;
if('reuse-mzt-header' in cli.options
|| 'output-MZT-header' in cli.options)
{
ext = ".mzt";
} else {
ext = ".bin";
}
let input_filename = args.input_filenames[0];
output_filename = changeExt(input_filename, ext);
}
// Determine filename of address map
var fnMap = null;
if('map' in cli.options) {
fnMap = cli.options['map'];
} else {
fnMap = changeExt(output_filename, ".map");
}
//
// MZT-Header
//
var mzt_header = null;
if('reuse-mzt-header' in cli.options) {
//
// Load MZT-Header from other MZT-File.
//
var mzt_filebuf = fs.readFileSync(cli.options['reuse-mzt-header']);
mzt_header = new MZ_TapeHeader(mzt_filebuf, 0);
} else if('output-MZT-header' in cli.options) {
//
// Create MZT-Header from the informations specified in command line options
//
var load_addr = 0;
var exec_addr = 0;
if('loading-address' in cli.options) {
load_addr = parseInt(cli.options['loading-address'], 0);
exec_addr = load_addr;
}
if('execution-address' in cli.options) {
exec_addr = parseInt(cli.options['execution-address'], 0);
}
mzt_header = MZ_TapeHeader.createNew();
mzt_header.setFilename(output_filename);
mzt_header.setAddrLoad(load_addr);
mzt_header.setAddrExec(exec_addr);
}
(async function() {
let sources = [];
await Promise.all(args.input_filenames.map( input_filename => {
return new Promise( (resolve, reject) => {
fs.readFile(input_filename, 'utf-8', function(err, data) {
if(err) {
reject(err);
} else {
sources.push(data);
resolve(data);
}
});
});
}));
//
// Assemble
//
let asm = Z80_assemble.assemble(sources);
//
// Set binary size to MZT Header
//
var mzt_header_buf = [];
if(mzt_header != null) {
if(mzt_header.addrLoad == 0) {
mzt_header.setAddrLoad(asm.minAddr);
}
if(mzt_header.addrExec == 0) {
mzt_header.setAddrExec(asm.minAddr);
}
mzt_header.setFilesize(asm.buffer.length);
mzt_header_buf = mzt_header.buffer;
}
//
// Write out
//
fs.writeFileSync(
output_filename,
Buffer.from(mzt_header_buf.concat(asm.buffer)));
//
// Output address map
//
let map = Z80_assemble.hashMapArray(asm.label2value).map(function(item) {
return [item.label, ":\t", NumberUtil.HEX(item.address, 4), "H"].join('');
}).join("\n");
if(map.length > 0) {
fs.writeFileSync(fnMap, map);
}
}());
|
var path = require('path');
var gulp = require('gulp');
var tsc = require('gulp-tsc');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var compass = require('gulp-compass');
const CONF_PATH = 'conf/';
const SRC_PATH = 'frontend_src/';
const PUBLIC_PATH = 'public/';
gulp.task('tsc', function() {
gulp.src(_pj(SRC_PATH, 'ts/**/*.ts'))
.pipe(tsc({
target: 'ES5'
}))
.pipe(concat('app.js'))
.pipe(uglify({
outSourceMap: true
}))
.pipe(gulp.dest(_pj(PUBLIC_PATH, 'js')))
});
gulp.task('compass', function() {
gulp.src(_pj(SRC_PATH, 'sass/**/*.sass'))
.pipe(compass({
config_file : _pj(CONF_PATH, 'compass_config.rb'),
sass : _pj(SRC_PATH, 'sass'),
css : _pj(PUBLIC_PATH, 'css'),
sourcemap : true,
}));
});
gulp.task('develop', ['default'], function() {
gulp.watch([
_pj(SRC_PATH, 'ts/**/*.ts')
], ['tsc']);
gulp.watch([
_pj(SRC_PATH, 'sass/**/*.sass')
], ['compass']);
});
gulp.task('default', ['compass', 'tsc']);
function _pj() {
return path.join.apply(null, arguments);
}
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule AutodocsLayout
*/
var DocsSidebar = require('DocsSidebar');
var H = require('Header');
var Header = require('Header');
var HeaderWithGithub = require('HeaderWithGithub');
var Marked = require('Marked');
var Prism = require('Prism');
var React = require('React');
var Site = require('Site');
var slugify = require('slugify');
var styleReferencePattern = /^[^.]+\.propTypes\.style$/;
function renderEnumValue(value) {
// Use single quote strings even when we are given double quotes
if (value.match(/^"(.+)"$/)) {
return "'" + value.slice(1, -1) + "'";
}
return value;
}
function renderType(type) {
if (type.name === 'enum') {
if (typeof type.value === 'string') {
return type.value;
}
return 'enum(' + type.value.map((v) => renderEnumValue(v.value)).join(', ') + ')';
}
if (type.name === 'shape') {
return '{' + Object.keys(type.value).map((key => key + ': ' + renderType(type.value[key]))).join(', ') + '}';
}
if (type.name == 'union') {
return type.value.map(renderType).join(', ');
}
if (type.name === 'arrayOf') {
return '[' + renderType(type.value) + ']';
}
if (type.name === 'instanceOf') {
return type.value;
}
if (type.name === 'custom') {
if (styleReferencePattern.test(type.raw)) {
var name = type.raw.substring(0, type.raw.indexOf('.'));
return <a href={slugify(name) + '.html#style'}>{name}#style</a>
}
if (type.raw === 'ColorPropType') {
return <a href={'colors.html'}>color</a>
}
if (type.raw === 'EdgeInsetsPropType') {
return '{top: number, left: number, bottom: number, right: number}';
}
return type.raw;
}
if (type.name === 'stylesheet') {
return 'style';
}
if (type.name === 'func') {
return 'function';
}
return type.name;
}
function sortByPlatform(props, nameA, nameB) {
var a = props[nameA];
var b = props[nameB];
if (a.platforms && !b.platforms) {
return 1;
}
if (b.platforms && !a.platforms) {
return -1;
}
// Cheap hack: use < on arrays of strings to compare the two platforms
if (a.platforms < b.platforms) {
return -1;
}
if (a.platforms > b.platforms) {
return 1;
}
if (nameA < nameB) {
return -1;
}
if (nameA > nameB) {
return 1;
}
return 0;
}
var ComponentDoc = React.createClass({
renderProp: function(name, prop) {
return (
<div className="prop" key={name}>
<Header level={4} className="propTitle" toSlug={name}>
{prop.platforms && prop.platforms.map(platform =>
<span className="platform">{platform}</span>
)}
{name}
{' '}
{prop.type && <span className="propType">
{renderType(prop.type)}
</span>}
</Header>
{prop.deprecationMessage && <div className="deprecated">
<div className="deprecatedTitle">
<img className="deprecatedIcon" src="img/Warning.png" />
<span>Deprecated</span>
</div>
<div className="deprecatedMessage">
<Marked>{prop.deprecationMessage}</Marked>
</div>
</div>}
{prop.type && prop.type.name === 'stylesheet' &&
this.renderStylesheetProps(prop.type.value)}
{prop.description && <Marked>{prop.description}</Marked>}
</div>
);
},
renderCompose: function(name) {
return (
<div className="prop" key={name}>
<Header level={4} className="propTitle" toSlug={name}>
<a href={slugify(name) + '.html#props'}>{name} props...</a>
</Header>
</div>
);
},
renderStylesheetProp: function(name, prop) {
return (
<div className="prop" key={name}>
<h6 className="propTitle">
{prop.platforms && prop.platforms.map(platform =>
<span className="platform">{platform}</span>
)}
{name}
{' '}
{prop.type && <span className="propType">
{renderType(prop.type)}
</span>}
{' '}
{prop.description && <Marked>{prop.description}</Marked>}
</h6>
</div>
);
},
renderStylesheetProps: function(stylesheetName) {
var style = this.props.content.styles[stylesheetName];
this.extractPlatformFromProps(style.props);
return (
<div className="compactProps">
{(style.composes || []).map((name) => {
var link;
if (name === 'LayoutPropTypes') {
name = 'Flexbox';
link =
<a href={slugify(name) + '.html#proptypes'}>{name}...</a>;
} else if (name === 'TransformPropTypes') {
name = 'Transforms';
link =
<a href={slugify(name) + '.html#proptypes'}>{name}...</a>;
} else {
name = name.replace('StylePropTypes', '');
link =
<a href={slugify(name) + '.html#style'}>{name}#style...</a>;
}
return (
<div className="prop" key={name}>
<h6 className="propTitle">{link}</h6>
</div>
);
})}
{Object.keys(style.props)
.sort(sortByPlatform.bind(null, style.props))
.map((name) => this.renderStylesheetProp(name, style.props[name]))
}
</div>
);
},
renderProps: function(props, composes) {
return (
<div className="props">
{(composes || []).map((name) =>
this.renderCompose(name)
)}
{Object.keys(props)
.sort(sortByPlatform.bind(null, props))
.map((name) => this.renderProp(name, props[name]))
}
</div>
);
},
extractPlatformFromProps: function(props) {
for (var key in props) {
var prop = props[key];
var description = prop.description || '';
var platforms = description.match(/\@platform (.+)/);
platforms = platforms && platforms[1].replace(/ /g, '').split(',');
description = description.replace(/\@platform (.+)/, '');
prop.description = description;
prop.platforms = platforms;
}
},
render: function() {
var content = this.props.content;
this.extractPlatformFromProps(content.props);
return (
<div>
<Marked>
{content.description}
</Marked>
<H level={3}>Props</H>
{this.renderProps(content.props, content.composes)}
</div>
);
}
});
var APIDoc = React.createClass({
removeCommentsFromDocblock: function(docblock) {
return docblock
.trim('\n ')
.replace(/^\/\*+/, '')
.replace(/\*\/$/, '')
.split('\n')
.map(function(line) {
return line.trim().replace(/^\* ?/, '');
})
.join('\n');
},
renderTypehintRec: function(typehint) {
if (typehint.type === 'simple') {
return typehint.value;
}
if (typehint.type === 'generic') {
return this.renderTypehintRec(typehint.value[0]) + '<' + this.renderTypehintRec(typehint.value[1]) + '>';
}
return JSON.stringify(typehint);
},
renderTypehint: function(typehint) {
try {
var typehint = JSON.parse(typehint);
} catch(e) {
return typehint;
}
return this.renderTypehintRec(typehint);
},
renderMethod: function(method) {
return (
<div className="prop" key={method.name}>
<Header level={4} className="propTitle" toSlug={method.name}>
{method.modifiers.length && <span className="propType">
{method.modifiers.join(' ') + ' '}
</span> || ''}
{method.name}
<span className="propType">
({method.params
.map((param) => {
var res = param.name;
if (param.typehint) {
res += ': ' + this.renderTypehint(param.typehint);
}
return res;
})
.join(', ')})
</span>
</Header>
{method.docblock && <Marked>
{this.removeCommentsFromDocblock(method.docblock)}
</Marked>}
</div>
);
},
renderMethods: function(methods) {
if (!methods.length) {
return null;
}
return (
<span>
<H level={3}>Methods</H>
<div className="props">
{methods.filter((method) => {
return method.name[0] !== '_';
}).map(this.renderMethod)}
</div>
</span>
);
},
renderProperty: function(property) {
return (
<div className="prop" key={property.name}>
<Header level={4} className="propTitle" toSlug={property.name}>
{property.name}
{property.type &&
<span className="propType">
{': ' + renderType(property.type)}
</span>
}
</Header>
{property.docblock && <Marked>
{this.removeCommentsFromDocblock(property.docblock)}
</Marked>}
</div>
);
},
renderProperties: function(properties) {
if (!properties || !properties.length) {
return null;
}
return (
<span>
<H level={3}>Properties</H>
<div className="props">
{properties.filter((property) => {
return property.name[0] !== '_';
}).map(this.renderProperty)}
</div>
</span>
);
},
renderClasses: function(classes) {
if (!classes || !classes.length) {
return null;
}
return (
<span>
<div>
{classes.filter((cls) => {
return cls.name[0] !== '_' && cls.ownerProperty[0] !== '_';
}).map((cls) => {
return (
<span key={cls.name}>
<Header level={2} toSlug={cls.name}>
class {cls.name}
</Header>
<ul>
{cls.docblock && <Marked>
{this.removeCommentsFromDocblock(cls.docblock)}
</Marked>}
{this.renderMethods(cls.methods)}
{this.renderProperties(cls.properties)}
</ul>
</span>
);
})}
</div>
</span>
);
},
render: function() {
var content = this.props.content;
if (!content.methods) {
throw new Error(
'No component methods found for ' + content.componentName
);
}
return (
<div>
<Marked>
{this.removeCommentsFromDocblock(content.docblock)}
</Marked>
{this.renderMethods(content.methods)}
{this.renderProperties(content.properties)}
{this.renderClasses(content.classes)}
</div>
);
}
});
var EmbeddedSimulator = React.createClass({
render: function() {
if (!this.props.shouldRender) {
return null;
}
var metadata = this.props.metadata;
return (
<div className="column-left">
<p><a className="modal-button-open"><strong>Run this example</strong></a></p>
<div className="modal-button-open modal-button-open-img">
<img alt="Run example in simulator" width="170" height="358" src="img/alertIOS.png" />
</div>
<Modal />
</div>
);
}
});
var Modal = React.createClass({
render: function() {
var appParams = {route: 'AlertIOS'};
var encodedParams = encodeURIComponent(JSON.stringify(appParams));
var url = `https://appetize.io/embed/bypdk4jnjra5uwyj2kzd2aenv4?device=iphone5s&scale=70&autoplay=false&orientation=portrait&deviceColor=white¶ms=${encodedParams}`;
return (
<div>
<div className="modal">
<div className="modal-content">
<button className="modal-button-close">×</button>
<div className="center">
<iframe className="simulator" src={url} width="256" height="550" frameborder="0" scrolling="no"></iframe>
<p>Powered by <a target="_blank" href="https://appetize.io">appetize.io</a></p>
</div>
</div>
</div>
<div className="modal-backdrop" />
</div>
);
}
});
var Autodocs = React.createClass({
renderFullDescription: function(docs) {
if (!docs.fullDescription) {
return;
}
return (
<div>
<HeaderWithGithub
title="Description"
path={'docs/' + docs.componentName + '.md'}
/>
<Marked>
{docs.fullDescription}
</Marked>
</div>
);
},
renderExample: function(docs, metadata) {
if (!docs.example) {
return;
}
return (
<div>
<HeaderWithGithub
title="Examples"
path={docs.example.path}
metadata={metadata}
/>
<Prism>
{docs.example.content.replace(/^[\s\S]*?\*\//, '').trim()}
</Prism>
</div>
);
},
render: function() {
var metadata = this.props.metadata;
var docs = JSON.parse(this.props.children);
var content = docs.type === 'component' || docs.type === 'style' ?
<ComponentDoc content={docs} /> :
<APIDoc content={docs} apiName={metadata.title} />;
return (
<Site section="docs" title={metadata.title}>
<section className="content wrap documentationContent">
<DocsSidebar metadata={metadata} />
<div className="inner-content">
<a id="content" />
<HeaderWithGithub
title={metadata.title}
level={1}
path={metadata.path}
/>
{content}
{this.renderFullDescription(docs)}
{this.renderExample(docs, metadata)}
<div className="docs-prevnext">
{metadata.previous && <a className="docs-prev" href={metadata.previous + '.html#content'}>← Prev</a>}
{metadata.next && <a className="docs-next" href={metadata.next + '.html#content'}>Next →</a>}
</div>
</div>
<EmbeddedSimulator shouldRender={metadata.runnable} metadata={metadata} />
</section>
</Site>
);
}
});
module.exports = Autodocs;
|
[25, "hi", true]
|
import Page from '../layouts/page';
import MainContent from '../layouts/main-content';
import PersonHeader from '../components/person-header';
import LevelContainer from '../components/level-container';
export default () => (
<Page>
<PersonHeader />
<MainContent>
<LevelContainer />
</MainContent>
</Page>
);
|
_tmpl.link_entity = function( entity, tagName, returnHTML, count ){
if( !entity )
return false
if( tagName && typeof tagName == 'object' )
return _tmpl.link_entity(
entity,
tagName['tagName'] || null,
tagName['returnHTML'] || null,
tagName['count'] || null
)
tagName = tagName || 'a'
returnHTML = returnHTML || false
count = typeof count == 'undefined' ? false : count
if( typeof entity != 'object' ){
var entityId = parseInt(entity)
entity = _g.data.entities[entityId]
}else{
var entityId = entity['id']
}
return _tmpl.export(
'<' + tagName
+ (tagName == 'a' ? ' href="?infos=entity&id='+entityId+'"' : '')
+ ' class="link_entity" data-entityid="' + entityId + '" data-infos="[[ENTITY::' + entityId + ']]">'
+ (entity.picture && entity.picture.avatar
? '<i style="background-image:url(' + entity.picture.avatar + ')"></i>'
: '<i></i>'
)
+ '<span>'
+ entity._name
+ ( typeof count == 'undefined'
? ''
: ' <small>(' + count + ')</small>'
)
+ '</span>'
+ '</' + tagName + '>',
returnHTML
)
}
|
/* eslint-disable no-await-in-loop */
const assert = require('assert');
const TestUtils = require('../utils');
const query1 = `SELECT 1 AS id, 'blue' AS color`;
function wait(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function testBatchToCompletion(config) {
const utils = new TestUtils(config);
await utils.init(true);
const connection = await utils.post('admin', '/api/connections', {
name: 'test connection',
driver: 'sqlite',
data: {
filename: './test/fixtures/sales.sqlite',
},
});
let batch = await utils.post('admin', `/api/batches`, {
connectionId: connection.id,
batchText: query1,
});
while (batch.status !== 'finished' && batch.status !== 'error') {
await wait(25);
batch = await utils.get('admin', `/api/batches/${batch.id}`);
}
const statements = await utils.get(
'admin',
`/api/batches/${batch.id}/statements`
);
const statement1 = statements[0];
let result1 = await utils.get(
'admin',
`/api/statements/${statement1.id}/results`
);
assert.deepEqual(result1, [[1, 'blue']], 'results as expected');
// remove should succeed
await utils.models.statements.removeById(statement1.id);
await utils.get('admin', `/api/statements/${statement1.id}/results`, 404);
}
describe('api/query-result-stores', function () {
it('file', async function () {
return testBatchToCompletion({ queryResultStore: 'file' });
});
it('redis', async function () {
const available = await TestUtils.redisAvailable('redis://localhost:6379');
if (!available || process.env.SKIP_INTEGRATION === 'true') {
return this.skip();
}
return testBatchToCompletion({
queryResultStore: 'redis',
redisUri: 'redis://localhost:6379',
});
});
it('database', async function () {
return testBatchToCompletion({
queryResultStore: 'database',
});
});
it('memory', async function () {
return testBatchToCompletion({
queryResultStore: 'memory',
});
});
});
|
import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", {
d: "M22 4H2v16h20V4zm-2 4l-8 5-8-5V6l8 5 8-5v2z"
}), 'MailSharp');
|
/* file : collection-test.js
MIT License
Copyright (c) 2016 Thomas Minier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use strict';
require('chai').should();
const Collection = require('../../src/collections/collection.js');
describe('Collection', () => {
it('should be abstract', () => {
(() => new Collection()).should.throw(TypeError);
});
});
|
/*
* Kendo UI v2015.1.408 (http://www.telerik.com/kendo-ui)
* Copyright 2015 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
(function(f, define){
define([], f);
})(function(){
(function( window, undefined ) {
var kendo = window.kendo || (window.kendo = { cultures: {} });
kendo.cultures["pa-Arab-PK"] = {
name: "pa-Arab-PK",
numberFormat: {
pattern: ["- n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
percent: {
pattern: ["% n-","% n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
pattern: ["-$ n","$ n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "Rs"
}
},
calendars: {
standard: {
days: {
names: ["پير","منگل","بدھ","جمعرات","جمعه","هفته","اتوار"],
namesAbbr: ["پير","منگل","بدھ","جمعرات","جمعه","هفته","اتوار"],
namesShort: ["پ","م","ب","ج","ج","ه","ا"]
},
months: {
names: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],
namesAbbr: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"]
},
AM: ["AM","am","AM"],
PM: ["PM","pm","PM"],
patterns: {
d: "dd-MM-yy",
D: "dd MMMM yyyy dddd",
F: "dd MMMM yyyy dddd h.mm.ss tt",
g: "dd-MM-yy h.mm tt",
G: "dd-MM-yy h.mm.ss tt",
m: "dd MMMM",
M: "dd MMMM",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "h.mm tt",
T: "h.mm.ss tt",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM, yyyy",
Y: "MMMM, yyyy"
},
"/": "-",
":": ".",
firstDay: 1
}
}
}
})(this);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
|
import {
VFadeTransition,
VSlideXTransition
} from '~components/transitions'
export default {
name: 'v-progress-linear',
components: {
VFadeTransition,
VSlideXTransition
},
props: {
active: {
type: Boolean,
default: true
},
buffer: Boolean,
bufferValue: Number,
error: Boolean,
height: {
type: [Number, String],
default: 7
},
indeterminate: Boolean,
info: Boolean,
secondary: Boolean,
success: Boolean,
query: Boolean,
warning: Boolean,
value: {
type: [Number, String],
default: 0
},
colorFront: {
type: String,
default: null
},
colorBack: {
type: String,
default: null
}
},
computed: {
classes () {
return {
'progress-linear--query': this.query,
'progress-linear--secondary': this.secondary,
'progress-linear--success': this.success,
'progress-linear--info': this.info,
'progress-linear--warning': this.warning,
'progress-linear--error': this.error
}
},
styles () {
const styles = {}
if (!this.active) {
styles.height = 0
}
if (this.buffer) {
styles.width = `${this.bufferValue}%`
}
return styles
},
bufferStyles () {
const styles = {}
if (!this.active) {
styles.height = 0
}
return styles
}
},
methods: {
genDeterminate (h) {
return h('div', {
ref: 'front',
class: ['progress-linear__bar__determinate', this.colorFront],
style: { width: `${this.value}%` }
})
},
genBar (h, name) {
return h('div', {
class: [
'progress-linear__bar__indeterminate',
name,
this.colorFront
]
})
},
genIndeterminate (h) {
return h('div', {
ref: 'front',
class: {
'progress-linear__bar__indeterminate': true,
'progress-linear__bar__indeterminate--active': this.active
}
}, [
this.genBar(h, 'long'),
this.genBar(h, 'short')
])
}
},
render (h) {
const fade = h('v-fade-transition', [this.indeterminate && this.genIndeterminate(h)])
const slide = h('v-slide-x-transition', [!this.indeterminate && this.genDeterminate(h)])
const bar = h('div', { class: ['progress-linear__bar', this.colorBack], style: this.styles }, [fade, slide])
return h('div', {
class: ['progress-linear', this.classes],
style: { height: `${this.height}px` },
on: this.$listeners
}, [bar])
}
}
|
"use strict";
var fs = require("fs");
var path = require("path");
var Sequelize = require("sequelize");
const appRoot = require('app-root-path');
const config = require(`${appRoot}/lib/config`)();
const sequelize = new Sequelize(config.db);
var db = {};
fs
.readdirSync(__dirname)
.filter(function(file) {
return (file.indexOf(".") !== 0) && (file !== "index.js");
})
.forEach(function(file) {
var model = sequelize.import(path.join(__dirname, file));
db[model.name] = model;
});
console.log(db);
Object.keys(db).forEach(function(modelName) {
if ("associate" in db[modelName]) {
console.log('SE ASOCIA : ' + modelName + db)
db[modelName].associate(db);
console.log("MODELO" + db[modelName]);
}
});
// db['Page'].belongsTo(db['Unit']);
// db['Unit'].hasMany(db['Page'], {as: 'Pages'})
db.sequelize = sequelize;
db.Sequelize = Sequelize;
module.exports = db;
|
import test from 'ava'
import configureStore from 'redux-mock-store'
import { mount } from 'enzyme'
import { createElement } from 'react'
import Home from '../../src/containers/home'
const mockStore = configureStore()
test('home', t => {
const store = mockStore()
const wrapper = mount(createElement(Home, {
store
}))
t.is(wrapper.find('h1').text(), 'Home')
})
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (calc, node, precision) {
var str = stringify(node, precision);
if (node.type === "MathExpression") {
// if calc expression couldn't be resolved to a single value, re-wrap it as
// a calc()
str = calc + "(" + str + ")";
}
return str;
};
var order = {
"*": 0,
"/": 0,
"+": 1,
"-": 1
};
function round(value, prec) {
if (prec !== false) {
var precision = Math.pow(10, prec);
return Math.round(value * precision) / precision;
}
return value;
}
function stringify(node, prec) {
switch (node.type) {
case "MathExpression":
{
var left = node.left,
right = node.right,
op = node.operator;
var str = "";
if (left.type === 'MathExpression' && order[op] < order[left.operator]) str += "(" + stringify(left, prec) + ")";else str += stringify(left, prec);
str += " " + node.operator + " ";
if (right.type === 'MathExpression' && order[op] < order[right.operator]) str += "(" + stringify(right, prec) + ")";else str += stringify(right, prec);
return str;
}
case "Value":
return round(node.value, prec);
case 'CssVariable':
return node.value;
default:
return round(node.value, prec) + node.unit;
}
}
module.exports = exports["default"];
|
import { assert, expect } from 'chai';
import 'angular';
import 'angular-mocks/angular-mocks';
import '../src/component';
describe('User factory', ()=>{
var Client;
beforeEach(angular.mock.module('component'));
beforeEach(angular.mock.inject(function(_client_) {
Client = _client_;
}));
it('sould return "default" when calling loggedUser ', ()=> {
expect(Client.loggedUser()).to.be.equal('default');
});
});
|
export const flatTree = (tree, getBody = node => node.body) => {
let flatList = [];
[].concat(tree).forEach(node => {
const body = getBody(node);
if (body && body.length) {
flatList = flatList.concat(node, flatTree(body, getBody));
} else {
flatList.push(node);
}
});
return flatList;
};
|
var People = function(names) {
this.allNames = [];
names.forEach(function(name) {
name = name.charAt(0).toUpperCase() + name.slice(1);
this.allNames.push(name);
}.bind(this));
};
People.prototype.getNames = function() {
return this.allNames;
};
People.prototype.sort = function() {
this.allNames.sort();
return this.getNames();
};
|
var Watcher = require('./watcher')
var middleware = require('./middleware')
var http = require('http')
var connect = require('connect')
exports.serve = serve
function serve (builder, options) {
options = options || {}
console.log('Serving on http://' + options.host + ':' + options.port + '\n')
var watcher = options.watcher || new Watcher(builder, {verbose: true})
var app = connect().use(middleware(watcher))
var server = http.createServer(app)
// We register these so the 'exit' handler removing temp dirs is called
function cleanupAndExit() {
builder.cleanup().catch(function(err) {
console.error('Cleanup error:')
console.error(err && err.stack ? err.stack : err)
}).finally(function() {
process.exit(1)
})
}
process.on('SIGINT', cleanupAndExit)
process.on('SIGTERM', cleanupAndExit)
watcher.on('change', function(results) {
console.log('Built - ' + Math.round(results.totalTime / 1e6) + ' ms @ ' + new Date().toString())
})
watcher.on('error', function(err) {
console.log('Built with error:')
// Should also show file and line/col if present; see cli.js
if (err.file) {
console.log('File: ' + err.file)
}
console.log(err.stack)
console.log('')
})
server.listen(parseInt(options.port, 10), options.host)
}
|
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
this.route('home', { path: '/' });
this.route('apple');
this.route('banana');
this.route('coconut');
this.route('durian');
this.route('elderberry');
this.route('fig');
this.route('grape');
this.route('honeydew');
});
export default Router;
|
var backgrounds = [
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/google_hq_azlr3e.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/apple_hq_bmqqhh.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/microsoft_hq_c88f8g.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/facebook_hq_bb66i0.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/twitter_hq_cshigs.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/facebook_hq2_q3fuww.jpg')"
// "img/hq/google_hq.jpg",
// "img/hq/apple_hq.jpg",
// "img/hq/microsoft_hq.jpg",
// "img/hq/facebook_hq.jpg",
// "img/hq/twitter_hq.jpg",
// "img/hq/facebook_hq2.jpg"
];
// var images = [];
//
// function preload(){
// for (var i=0; i<backgrounds.length; i++){
// images[i] = new Image();
// images[i].src = backgrounds[i];
// }
// }
var check = true;
var slideIndex =-1;
// preload();
auto();
function auto() {
if (check) {
slideIndex+=1;
carousel();
setTimeout(auto, 8000);
}
}
function currentDiv(n) {
if (check) {
slideIndex = n;
carousel();
}
}
function carousel() {
var i;
check = false;
var x = document.getElementsByClassName("imageselect");
if (slideIndex>=backgrounds.length){slideIndex=0}
for (i=0; i< x.length; i++) {
x[i].className = x[i].className.replace(" whitehover", "");
}
x[slideIndex].className += " whitehover";
document.getElementsByClassName("header")[0].style.background = backgrounds[slideIndex];
document.getElementsByClassName("header")[0].style.backgroundSize = "cover";
document.getElementsByClassName("header")[0].style.backgroundPosition = "center";
setTimeout(function(){
check = true;
}, 500);
}
|
search_result['1024']=["topic_0000000000000254.html","SystemManagementController.UpdateBadge Method",""];
|
import React from 'react';
import styles from './button.css';
let Button = React.createClass({
render() {
return (
<div className={styles.container}>
<button className={styles.button}>Click me!</button>
</div>
);
}
});
React.render(<Button />, document.getElementById('content'));
|
/**
* Copyright (c) 2010 Zef Hemel <zef@zef.me>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
if (typeof exports !== 'undefined') {
exports.createPersistence = function() {
return initPersistence({})
}
var singleton;
exports.__defineGetter__("persistence", function () {
if (!singleton)
singleton = exports.createPersistence();
return singleton;
});
}
else {
window = window || {};
window.persistence = initPersistence(window.persistence || {});
}
function initPersistence(persistence) {
if (persistence.isImmutable) // already initialized
return persistence;
/**
* Check for immutable fields
*/
persistence.isImmutable = function(fieldName) {
return (fieldName == "id");
};
/**
* Default implementation for entity-property
*/
persistence.defineProp = function(scope, field, setterCallback, getterCallback) {
scope.__defineSetter__(field, function (value) {
setterCallback(value);
});
scope.__defineGetter__(field, function () {
return getterCallback();
});
};
/**
* Default implementation for entity-property setter
*/
persistence.set = function(scope, fieldName, value) {
if (persistence.isImmutable(fieldName)) throw new Error("immutable field: "+fieldName);
scope[fieldName] = value;
};
/**
* Default implementation for entity-property getter
*/
persistence.get = function(arg1, arg2) {
return (arguments.length == 1) ? arg1 : arg1[arg2];
};
(function () {
var entityMeta = {};
var entityClassCache = {};
persistence.getEntityMeta = function() { return entityMeta; }
// Per-session data
persistence.trackedObjects = {};
persistence.objectsToRemove = {};
persistence.objectsRemoved = []; // {id: ..., type: ...}
persistence.globalPropertyListeners = {}; // EntityType__prop -> QueryColleciton obj
persistence.queryCollectionCache = {}; // entityName -> uniqueString -> QueryCollection
persistence.getObjectsToRemove = function() { return this.objectsToRemove; };
persistence.getTrackedObjects = function() { return this.trackedObjects; };
// Public Extension hooks
persistence.entityDecoratorHooks = [];
persistence.flushHooks = [];
persistence.schemaSyncHooks = [];
// Enable debugging (display queries using console.log etc)
persistence.debug = true;
persistence.subscribeToGlobalPropertyListener = function(coll, entityName, property) {
var key = entityName + '__' + property;
if(key in this.globalPropertyListeners) {
var listeners = this.globalPropertyListeners[key];
for(var i = 0; i < listeners.length; i++) {
if(listeners[i] === coll) {
return;
}
}
this.globalPropertyListeners[key].push(coll);
} else {
this.globalPropertyListeners[key] = [coll];
}
}
persistence.unsubscribeFromGlobalPropertyListener = function(coll, entityName, property) {
var key = entityName + '__' + property;
var listeners = this.globalPropertyListeners[key];
for(var i = 0; i < listeners.length; i++) {
if(listeners[i] === coll) {
listeners.splice(i, 1);
return;
}
}
}
persistence.propertyChanged = function(obj, property, oldValue, newValue) {
if(!this.trackedObjects[obj.id]) return; // not yet added, ignore for now
var entityName = obj._type;
var key = entityName + '__' + property;
if(key in this.globalPropertyListeners) {
var listeners = this.globalPropertyListeners[key];
for(var i = 0; i < listeners.length; i++) {
var coll = listeners[i];
var dummyObj = obj._data;
dummyObj[property] = oldValue;
var matchedBefore = coll._filter.match(dummyObj);
dummyObj[property] = newValue;
var matchedAfter = coll._filter.match(dummyObj);
if(matchedBefore != matchedAfter) {
coll.triggerEvent('change', coll, obj);
}
}
}
}
persistence.objectRemoved = function(obj) {
var entityName = obj._type;
if(this.queryCollectionCache[entityName]) {
var colls = this.queryCollectionCache[entityName];
for(var key in colls) {
if(colls.hasOwnProperty(key)) {
var coll = colls[key];
if(coll._filter.match(obj)) { // matched the filter -> was part of collection
coll.triggerEvent('change', coll, obj);
}
}
}
}
}
/**
* Retrieves metadata about entity, mostly for internal use
*/
function getMeta(entityName) {
return entityMeta[entityName];
}
persistence.getMeta = getMeta;
/**
* A database session
*/
function Session(conn) {
this.trackedObjects = {};
this.objectsToRemove = {};
this.objectsRemoved = [];
this.globalPropertyListeners = {}; // EntityType__prop -> QueryColleciton obj
this.queryCollectionCache = {}; // entityName -> uniqueString -> QueryCollection
this.conn = conn;
}
Session.prototype = persistence; // Inherit everything from the root persistence object
persistence.Session = Session;
/**
* Define an entity
*
* @param entityName
* the name of the entity (also the table name in the database)
* @param fields
* an object with property names as keys and SQLite types as
* values, e.g. {name: "TEXT", age: "INT"}
* @return the entity's constructor
*/
persistence.define = function (entityName, fields) {
if (entityMeta[entityName]) { // Already defined, ignore
return getEntity(entityName);
}
var meta = {
name: entityName,
fields: fields,
isMixin: false,
indexes: [],
hasMany: {},
hasOne: {}
};
entityMeta[entityName] = meta;
return getEntity(entityName);
};
/**
* Checks whether an entity exists
*
* @param entityName
* the name of the entity (also the table name in the database)
* @return `true` if the entity exists, otherwise `false`
*/
persistence.isDefined = function (entityName) {
return !!entityMeta[entityName];
}
/**
* Define a mixin
*
* @param mixinName
* the name of the mixin
* @param fields
* an object with property names as keys and SQLite types as
* values, e.g. {name: "TEXT", age: "INT"}
* @return the entity's constructor
*/
persistence.defineMixin = function (mixinName, fields) {
var Entity = this.define(mixinName, fields);
Entity.meta.isMixin = true;
return Entity;
};
persistence.isTransaction = function(obj) {
return !obj || (obj && obj.executeSql);
};
persistence.isSession = function(obj) {
return !obj || (obj && obj.schemaSync);
};
/**
* Adds the object to tracked entities to be persisted
*
* @param obj
* the object to be tracked
*/
persistence.add = function (obj) {
if(!obj) return;
//if (!this.trackedObjects[obj.id]) {
this.trackedObjects[obj.id] = obj;
if(obj._new) {
for(var p in obj._data) {
if(obj._data.hasOwnProperty(p)) {
this.propertyChanged(obj, p, undefined, obj._data[p]);
}
}
}
//}
return this;
};
/**
* Marks the object to be removed (on next flush)
* @param obj object to be removed
*/
persistence.remove = function(obj) {
if (!this.objectsToRemove[obj.id]) {
this.objectsToRemove[obj.id] = obj;
}
this.objectsRemoved.push({id: obj.id, entity: obj._type});
this.objectRemoved(obj);
return this;
};
/**
* Clean the persistence context of cached entities and such.
*/
persistence.clean = function () {
this.trackedObjects = {};
this.objectsToRemove = {};
this.objectsRemoved = [];
this.globalPropertyListeners = {};
this.queryCollectionCache = {};
};
/**
* asynchronous sequential version of Array.prototype.forEach
* @param array the array to iterate over
* @param fn the function to apply to each item in the array, function
* has two argument, the first is the item value, the second a
* callback function
* @param callback the function to call when the forEach has ended
*/
persistence.asyncForEach = function(array, fn, callback) {
array = array.slice(0); // Just to be sure
function processOne() {
var item = array.pop();
fn(item, function(result, err) {
if(array.length > 0) {
processOne();
} else {
callback(result, err);
}
});
}
if(array.length > 0) {
processOne();
} else {
callback();
}
};
/**
* asynchronous parallel version of Array.prototype.forEach
* @param array the array to iterate over
* @param fn the function to apply to each item in the array, function
* has two argument, the first is the item value, the second a
* callback function
* @param callback the function to call when the forEach has ended
*/
persistence.asyncParForEach = function(array, fn, callback) {
var completed = 0;
var arLength = array.length;
if(arLength === 0) {
callback();
}
for(var i = 0; i < arLength; i++) {
fn(array[i], function(result, err) {
completed++;
if(completed === arLength) {
callback(result, err);
}
});
}
};
/**
* Retrieves or creates an entity constructor function for a given
* entity name
* @return the entity constructor function to be invoked with `new fn()`
*/
function getEntity(entityName) {
if (entityClassCache[entityName]) {
return entityClassCache[entityName];
}
var meta = entityMeta[entityName];
/**
* @constructor
*/
function Entity (session, obj, noEvents) {
var args = argspec.getArgs(arguments, [
{ name: "session", optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: "obj", optional: true, check: function(obj) { return obj; }, defaultValue: {} }
]);
if (meta.isMixin)
throw new Error("Cannot instantiate mixin");
session = args.session;
obj = args.obj;
var that = this;
this.id = obj.id || persistence.createUUID();
this._new = true;
this._type = entityName;
this._dirtyProperties = {};
this._data = {};
this._data_obj = {}; // references to objects
this._session = session || persistence;
this.subscribers = {}; // observable
for ( var field in meta.fields) {
(function () {
if (meta.fields.hasOwnProperty(field)) {
var f = field; // Javascript scopes/closures SUCK
persistence.defineProp(that, f, function(val) {
// setterCallback
var oldValue = that._data[f];
if(oldValue !== val || (oldValue && val && oldValue.getTime && val.getTime)) { // Don't mark properties as dirty and trigger events unnecessarily
that._data[f] = val;
that._dirtyProperties[f] = oldValue;
that.triggerEvent('set', that, f, val);
that.triggerEvent('change', that, f, val);
session.propertyChanged(that, f, oldValue, val);
}
}, function() {
// getterCallback
return that._data[f];
});
that._data[field] = defaultValue(meta.fields[field]);
}
}());
}
for ( var it in meta.hasOne) {
if (meta.hasOne.hasOwnProperty(it)) {
(function () {
var ref = it;
var mixinClass = meta.hasOne[it].type.meta.isMixin ? ref + '_class' : null;
persistence.defineProp(that, ref, function(val) {
// setterCallback
var oldValue = that._data[ref];
var oldValueObj = that._data_obj[ref] || session.trackedObjects[that._data[ref]];
if (val == null) {
that._data[ref] = null;
that._data_obj[ref] = undefined;
if (mixinClass)
that[mixinClass] = '';
} else if (val.id) {
that._data[ref] = val.id;
that._data_obj[ref] = val;
if (mixinClass)
that[mixinClass] = val._type;
session.add(val);
session.add(that);
} else { // let's assume it's an id
that._data[ref] = val;
}
that._dirtyProperties[ref] = oldValue;
that.triggerEvent('set', that, ref, val);
that.triggerEvent('change', that, ref, val);
// Inverse
if(meta.hasOne[ref].inverseProperty) {
var newVal = that[ref];
if(newVal) {
var inverse = newVal[meta.hasOne[ref].inverseProperty];
if(inverse.list && inverse._filter) {
inverse.triggerEvent('change', that, ref, val);
}
}
if(oldValueObj) {
console.log("OldValue", oldValueObj);
var inverse = oldValueObj[meta.hasOne[ref].inverseProperty];
if(inverse.list && inverse._filter) {
inverse.triggerEvent('change', that, ref, val);
}
}
}
}, function() {
// getterCallback
if (!that._data[ref]) {
return null;
} else if(that._data_obj[ref] !== undefined) {
return that._data_obj[ref];
} else if(that._data[ref] && session.trackedObjects[that._data[ref]]) {
that._data_obj[ref] = session.trackedObjects[that._data[ref]];
return that._data_obj[ref];
} else {
//throw new Error("Property '" + ref + "' of '" + meta.name + "' with id: " + that._data[ref] + " not fetched, either prefetch it or fetch it manually.");
}
});
}());
}
}
for ( var it in meta.hasMany) {
if (meta.hasMany.hasOwnProperty(it)) {
(function () {
var coll = it;
if (meta.hasMany[coll].manyToMany) {
persistence.defineProp(that, coll, function(val) {
// setterCallback
if(val && val._items) {
// Local query collection, just add each item
// TODO: this is technically not correct, should clear out existing items too
var items = val._items;
for(var i = 0; i < items.length; i++) {
persistence.get(that, coll).add(items[i]);
}
} else {
throw new Error("Not yet supported.");
}
}, function() {
// getterCallback
if (that._data[coll]) {
return that._data[coll];
} else {
var rel = meta.hasMany[coll];
var inverseMeta = rel.type.meta;
var inv = inverseMeta.hasMany[rel.inverseProperty];
var direct = rel.mixin ? rel.mixin.meta.name : meta.name;
var inverse = inv.mixin ? inv.mixin.meta.name : inverseMeta.name;
var queryColl = new persistence.ManyToManyDbQueryCollection(session, inverseMeta.name);
queryColl.initManyToMany(that, coll);
queryColl._manyToManyFetch = {
table: rel.tableName,
prop: direct + '_' + coll,
inverseProp: inverse + '_' + rel.inverseProperty,
id: that.id
};
that._data[coll] = queryColl;
return session.uniqueQueryCollection(queryColl);
}
});
} else { // one to many
persistence.defineProp(that, coll, function(val) {
// setterCallback
if(val && val._items) {
// Local query collection, just add each item
// TODO: this is technically not correct, should clear out existing items too
var items = val._items;
for(var i = 0; i < items.length; i++) {
persistence.get(that, coll).add(items[i]);
}
} else {
//throw new Error("Not yet supported.");
}
}, function() {
// getterCallback
if (that._data[coll]) {
return that._data[coll];
} else {
var queryColl = session.uniqueQueryCollection(new persistence.DbQueryCollection(session, meta.hasMany[coll].type.meta.name).filter(meta.hasMany[coll].inverseProperty, '=', that));
that._data[coll] = queryColl;
return queryColl;
}
});
}
}());
}
}
if(this.initialize) {
this.initialize();
}
for ( var f in obj) {
if (obj.hasOwnProperty(f)) {
if(f !== 'id') {
persistence.set(that, f, obj[f]);
}
}
}
} // Entity
Entity.prototype = new Observable();
Entity.meta = meta;
Entity.prototype.equals = function(other) {
return this.id == other.id;
};
Entity.prototype.toJSON = function() {
var json = {id: this.id};
for(var p in this._data) {
if(this._data.hasOwnProperty(p)) {
if (typeof this._data[p] == "object" && this._data[p] != null) {
if (this._data[p].toJSON != undefined) {
json[p] = this._data[p].toJSON();
}
} else {
json[p] = this._data[p];
}
}
}
return json;
};
/**
* Select a subset of data as a JSON structure (Javascript object)
*
* A property specification is passed that selects the
* properties to be part of the resulting JSON object. Examples:
* ['id', 'name'] -> Will return an object with the id and name property of this entity
* ['*'] -> Will return an object with all the properties of this entity, not recursive
* ['project.name'] -> will return an object with a project property which has a name
* property containing the project name (hasOne relationship)
* ['project.[id, name]'] -> will return an object with a project property which has an
* id and name property containing the project name
* (hasOne relationship)
* ['tags.name'] -> will return an object with an array `tags` property containing
* objects each with a single property: name
*
* @param tx database transaction to use, leave out to start a new one
* @param props a property specification
* @param callback(result)
*/
Entity.prototype.selectJSON = function(tx, props, callback) {
var that = this;
var args = argspec.getArgs(arguments, [
{ name: "tx", optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: "props", optional: false },
{ name: "callback", optional: false }
]);
tx = args.tx;
props = args.props;
callback = args.callback;
if(!tx) {
this._session.transaction(function(tx) {
that.selectJSON(tx, props, callback);
});
return;
}
var includeProperties = {};
props.forEach(function(prop) {
var current = includeProperties;
var parts = prop.split('.');
for(var i = 0; i < parts.length; i++) {
var part = parts[i];
if(i === parts.length-1) {
if(part === '*') {
current.id = true;
for(var p in meta.fields) {
if(meta.fields.hasOwnProperty(p)) {
current[p] = true;
}
}
for(var p in meta.hasOne) {
if(meta.hasOne.hasOwnProperty(p)) {
current[p] = true;
}
}
for(var p in meta.hasMany) {
if(meta.hasMany.hasOwnProperty(p)) {
current[p] = true;
}
}
} else if(part[0] === '[') {
part = part.substring(1, part.length-1);
var propList = part.split(/,\s*/);
propList.forEach(function(prop) {
current[prop] = true;
});
} else {
current[part] = true;
}
} else {
current[part] = current[part] || {};
current = current[part];
}
}
});
buildJSON(this, tx, includeProperties, callback);
};
function buildJSON(that, tx, includeProperties, callback) {
var session = that._session;
var properties = [];
var meta = getMeta(that._type);
var fieldSpec = meta.fields;
for(var p in includeProperties) {
if(includeProperties.hasOwnProperty(p)) {
properties.push(p);
}
}
var cheapProperties = [];
var expensiveProperties = [];
properties.forEach(function(p) {
if(includeProperties[p] === true && !meta.hasMany[p]) { // simple, loaded field
cheapProperties.push(p);
} else {
expensiveProperties.push(p);
}
});
var itemData = that._data;
var item = {};
cheapProperties.forEach(function(p) {
if(p === 'id') {
item.id = that.id;
} else if(meta.hasOne[p]) {
item[p] = itemData[p] ? {id: itemData[p]} : null;
} else {
item[p] = persistence.entityValToJson(itemData[p], fieldSpec[p]);
}
});
properties = expensiveProperties.slice();
persistence.asyncForEach(properties, function(p, callback) {
if(meta.hasOne[p]) {
that.fetch(tx, p, function(obj) {
if(obj) {
buildJSON(obj, tx, includeProperties[p], function(result) {
item[p] = result;
callback();
});
} else {
item[p] = null;
callback();
}
});
} else if(meta.hasMany[p]) {
persistence.get(that, p).list(function(objs) {
item[p] = [];
persistence.asyncForEach(objs, function(obj, callback) {
var obj = objs.pop();
if(includeProperties[p] === true) {
item[p].push({id: obj.id});
callback();
} else {
buildJSON(obj, tx, includeProperties[p], function(result) {
item[p].push(result);
callback();
});
}
}, callback);
});
}
}, function() {
callback(item);
});
}; // End of buildJson
Entity.prototype.fetch = function(tx, rel, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'rel', optional: false, check: argspec.hasType('string') },
{ name: 'callback', optional: false, check: argspec.isCallback() }
]);
tx = args.tx;
rel = args.rel;
callback = args.callback;
var that = this;
var session = this._session;
if(!tx) {
session.transaction(function(tx) {
that.fetch(tx, rel, callback);
});
return;
}
if(!this._data[rel]) { // null
if(callback) {
callback(null);
}
} else if(this._data_obj[rel]) { // already loaded
if(callback) {
callback(this._data_obj[rel]);
}
} else {
var type = meta.hasOne[rel].type;
if (type.meta.isMixin) {
type = getEntity(this._data[rel + '_class']);
}
type.load(session, tx, this._data[rel], function(obj) {
that._data_obj[rel] = obj;
if(callback) {
callback(obj);
}
});
}
};
/**
* Currently this is only required when changing JSON properties
*/
Entity.prototype.markDirty = function(prop) {
this._dirtyProperties[prop] = true;
};
/**
* Returns a QueryCollection implementation matching all instances
* of this entity in the database
*/
Entity.all = function(session) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence }
]);
session = args.session;
return session.uniqueQueryCollection(new AllDbQueryCollection(session, entityName));
};
Entity.fromSelectJSON = function(session, tx, jsonObj, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'jsonObj', optional: false },
{ name: 'callback', optional: false, check: argspec.isCallback() }
]);
session = args.session;
tx = args.tx;
jsonObj = args.jsonObj;
callback = args.callback;
if(!tx) {
session.transaction(function(tx) {
Entity.fromSelectJSON(session, tx, jsonObj, callback);
});
return;
}
if(typeof jsonObj === 'string') {
jsonObj = JSON.parse(jsonObj);
}
if(!jsonObj) {
callback(null);
return;
}
function loadedObj(obj) {
if(!obj) {
obj = new Entity(session);
if(jsonObj.id) {
obj.id = jsonObj.id;
}
}
session.add(obj);
var expensiveProperties = [];
for(var p in jsonObj) {
if(jsonObj.hasOwnProperty(p)) {
if(p === 'id') {
continue;
} else if(meta.fields[p]) { // regular field
persistence.set(obj, p, persistence.jsonToEntityVal(jsonObj[p], meta.fields[p]));
} else if(meta.hasOne[p] || meta.hasMany[p]){
expensiveProperties.push(p);
}
}
}
persistence.asyncForEach(expensiveProperties, function(p, callback) {
if(meta.hasOne[p]) {
meta.hasOne[p].type.fromSelectJSON(session, tx, jsonObj[p], function(result) {
persistence.set(obj, p, result);
callback();
});
} else if(meta.hasMany[p]) {
var coll = persistence.get(obj, p);
var ar = jsonObj[p].slice(0);
var PropertyEntity = meta.hasMany[p].type;
// get all current items
coll.list(tx, function(currentItems) {
persistence.asyncForEach(ar, function(item, callback) {
PropertyEntity.fromSelectJSON(session, tx, item, function(result) {
// Check if not already in collection
for(var i = 0; i < currentItems.length; i++) {
if(currentItems[i].id === result.id) {
callback();
return;
}
}
coll.add(result);
callback();
});
}, function() {
callback();
});
});
}
}, function() {
callback(obj);
});
}
if(jsonObj.id) {
Entity.load(session, tx, jsonObj.id, loadedObj);
} else {
loadedObj(new Entity(session));
}
};
Entity.load = function(session, tx, id, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'id', optional: false, check: argspec.hasType('string') },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
Entity.findBy(args.session, args.tx, "id", args.id, args.callback);
};
Entity.findBy = function(session, tx, property, value, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'property', optional: false, check: argspec.hasType('string') },
{ name: 'value', optional: false },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
session = args.session;
tx = args.tx;
property = args.property;
value = args.value;
callback = args.callback;
if(property === 'id' && value in session.trackedObjects) {
callback(session.trackedObjects[value]);
return;
}
if(!tx) {
session.transaction(function(tx) {
Entity.findBy(session, tx, property, value, callback);
});
return;
}
Entity.all(session).filter(property, "=", value).one(tx, function(obj) {
callback(obj);
});
}
Entity.index = function(cols,options) {
var opts = options || {};
if (typeof cols=="string") {
cols = [cols];
}
opts.columns = cols;
meta.indexes.push(opts);
};
/**
* Declares a one-to-many or many-to-many relationship to another entity
* Whether 1:N or N:M is chosed depends on the inverse declaration
* @param collName the name of the collection (becomes a property of
* Entity instances
* @param otherEntity the constructor function of the entity to define
* the relation to
* @param inverseRel the name of the inverse property (to be) defined on otherEntity
*/
Entity.hasMany = function (collName, otherEntity, invRel) {
var otherMeta = otherEntity.meta;
if (otherMeta.hasMany[invRel]) {
// other side has declared it as a one-to-many relation too -> it's in
// fact many-to-many
var tableName = meta.name + "_" + collName + "_" + otherMeta.name;
var inverseTableName = otherMeta.name + '_' + invRel + '_' + meta.name;
if (tableName > inverseTableName) {
// Some arbitrary way to deterministically decide which table to generate
tableName = inverseTableName;
}
meta.hasMany[collName] = {
type: otherEntity,
inverseProperty: invRel,
manyToMany: true,
tableName: tableName
};
otherMeta.hasMany[invRel] = {
type: Entity,
inverseProperty: collName,
manyToMany: true,
tableName: tableName
};
delete meta.hasOne[collName];
delete meta.fields[collName + "_class"]; // in case it existed
} else {
meta.hasMany[collName] = {
type: otherEntity,
inverseProperty: invRel
};
otherMeta.hasOne[invRel] = {
type: Entity,
inverseProperty: collName
};
if (meta.isMixin)
otherMeta.fields[invRel + "_class"] = persistence.typeMapper ? persistence.typeMapper.classNameType : "TEXT";
}
}
Entity.hasOne = function (refName, otherEntity, inverseProperty) {
meta.hasOne[refName] = {
type: otherEntity,
inverseProperty: inverseProperty
};
if (otherEntity.meta.isMixin)
meta.fields[refName + "_class"] = persistence.typeMapper ? persistence.typeMapper.classNameType : "TEXT";
};
Entity.is = function(mixin){
var mixinMeta = mixin.meta;
if (!mixinMeta.isMixin)
throw new Error("not a mixin: " + mixin);
mixin.meta.mixedIns = mixin.meta.mixedIns || [];
mixin.meta.mixedIns.push(meta);
for (var field in mixinMeta.fields) {
if (mixinMeta.fields.hasOwnProperty(field))
meta.fields[field] = mixinMeta.fields[field];
}
for (var it in mixinMeta.hasOne) {
if (mixinMeta.hasOne.hasOwnProperty(it))
meta.hasOne[it] = mixinMeta.hasOne[it];
}
for (var it in mixinMeta.hasMany) {
if (mixinMeta.hasMany.hasOwnProperty(it)) {
mixinMeta.hasMany[it].mixin = mixin;
meta.hasMany[it] = mixinMeta.hasMany[it];
}
}
}
// Allow decorator functions to add more stuff
var fns = persistence.entityDecoratorHooks;
for(var i = 0; i < fns.length; i++) {
fns[i](Entity);
}
entityClassCache[entityName] = Entity;
return Entity;
}
persistence.jsonToEntityVal = function(value, type) {
if(type) {
switch(type) {
case 'DATE':
if(typeof value === 'number') {
if (value > 1000000000000) {
// it's in milliseconds
return new Date(value);
} else {
return new Date(value * 1000);
}
} else {
return null;
}
break;
default:
return value;
}
} else {
return value;
}
};
persistence.entityValToJson = function(value, type) {
if(type) {
switch(type) {
case 'DATE':
if(value) {
value = new Date(value);
return Math.round(value.getTime() / 1000);
} else {
return null;
}
break;
default:
return value;
}
} else {
return value;
}
};
/**
* Dumps the entire database into an object (that can be serialized to JSON for instance)
* @param tx transaction to use, use `null` to start a new one
* @param entities a list of entity constructor functions to serialize, use `null` for all
* @param callback (object) the callback function called with the results.
*/
persistence.dump = function(tx, entities, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'entities', optional: true, check: function(obj) { return !obj || (obj && obj.length && !obj.apply); }, defaultValue: null },
{ name: 'callback', optional: false, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
entities = args.entities;
callback = args.callback;
if(!entities) { // Default: all entity types
entities = [];
for(var e in entityClassCache) {
if(entityClassCache.hasOwnProperty(e)) {
entities.push(entityClassCache[e]);
}
}
}
var result = {};
persistence.asyncParForEach(entities, function(Entity, callback) {
Entity.all().list(tx, function(all) {
var items = [];
persistence.asyncParForEach(all, function(e, callback) {
var rec = {};
var fields = Entity.meta.fields;
for(var f in fields) {
if(fields.hasOwnProperty(f)) {
rec[f] = persistence.entityValToJson(e._data[f], fields[f]);
}
}
var refs = Entity.meta.hasOne;
for(var r in refs) {
if(refs.hasOwnProperty(r)) {
rec[r] = e._data[r];
}
}
var colls = Entity.meta.hasMany;
var collArray = [];
for(var coll in colls) {
if(colls.hasOwnProperty(coll)) {
collArray.push(coll);
}
}
persistence.asyncParForEach(collArray, function(collP, callback) {
var coll = persistence.get(e, collP);
coll.list(tx, function(results) {
rec[collP] = results.map(function(r) { return r.id; });
callback();
});
}, function() {
rec.id = e.id;
items.push(rec);
callback();
});
}, function() {
result[Entity.meta.name] = items;
callback();
});
});
}, function() {
callback(result);
});
};
/**
* Loads a set of entities from a dump object
* @param tx transaction to use, use `null` to start a new one
* @param dump the dump object
* @param callback the callback function called when done.
*/
persistence.load = function(tx, dump, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'dump', optional: false },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
dump = args.dump;
callback = args.callback;
var finishedCount = 0;
var collItemsToAdd = [];
var session = this;
for(var entityName in dump) {
if(dump.hasOwnProperty(entityName)) {
var Entity = getEntity(entityName);
var fields = Entity.meta.fields;
var instances = dump[entityName];
for(var i = 0; i < instances.length; i++) {
var instance = instances[i];
var ent = new Entity();
ent.id = instance.id;
for(var p in instance) {
if(instance.hasOwnProperty(p)) {
if (persistence.isImmutable(p)) {
ent[p] = instance[p];
} else if(Entity.meta.hasMany[p]) { // collection
var many = Entity.meta.hasMany[p];
if(many.manyToMany && Entity.meta.name < many.type.meta.name) { // Arbitrary way to avoid double adding
continue;
}
var coll = persistence.get(ent, p);
if(instance[p].length > 0) {
instance[p].forEach(function(it) {
collItemsToAdd.push({Entity: Entity, coll: coll, id: it});
});
}
} else {
persistence.set(ent, p, persistence.jsonToEntityVal(instance[p], fields[p]));
}
}
}
this.add(ent);
}
}
}
session.flush(tx, function() {
persistence.asyncForEach(collItemsToAdd, function(collItem, callback) {
collItem.Entity.load(session, tx, collItem.id, function(obj) {
collItem.coll.add(obj);
callback();
});
}, function() {
session.flush(tx, callback);
});
});
};
/**
* Dumps the entire database to a JSON string
* @param tx transaction to use, use `null` to start a new one
* @param entities a list of entity constructor functions to serialize, use `null` for all
* @param callback (jsonDump) the callback function called with the results.
*/
persistence.dumpToJson = function(tx, entities, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'entities', optional: true, check: function(obj) { return obj && obj.length && !obj.apply; }, defaultValue: null },
{ name: 'callback', optional: false, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
entities = args.entities;
callback = args.callback;
this.dump(tx, entities, function(obj) {
callback(JSON.stringify(obj));
});
};
/**
* Loads data from a JSON string (as dumped by `dumpToJson`)
* @param tx transaction to use, use `null` to start a new one
* @param jsonDump JSON string
* @param callback the callback function called when done.
*/
persistence.loadFromJson = function(tx, jsonDump, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'jsonDump', optional: false },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
jsonDump = args.jsonDump;
callback = args.callback;
this.load(tx, JSON.parse(jsonDump), callback);
};
/**
* Generates a UUID according to http://www.ietf.org/rfc/rfc4122.txt
*/
function createUUID () {
if(persistence.typeMapper && persistence.typeMapper.newUuid) {
return persistence.typeMapper.newUuid();
}
var s = [];
var hexDigits = "0123456789ABCDEF";
for ( var i = 0; i < 32; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[12] = "4";
s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1);
var uuid = s.join("");
return uuid;
}
persistence.createUUID = createUUID;
function defaultValue(type) {
if(persistence.typeMapper && persistence.typeMapper.defaultValue) {
return persistence.typeMapper.defaultValue(type);
}
switch(type) {
case "TEXT": return "";
case "BOOL": return false;
default:
if(type.indexOf("INT") !== -1) {
return 0;
} else if(type.indexOf("CHAR") !== -1) {
return "";
} else {
return null;
}
}
}
function arrayContains(ar, item) {
var l = ar.length;
for(var i = 0; i < l; i++) {
var el = ar[i];
if(el.equals && el.equals(item)) {
return true;
} else if(el === item) {
return true;
}
}
return false;
}
function arrayRemove(ar, item) {
var l = ar.length;
for(var i = 0; i < l; i++) {
var el = ar[i];
if(el.equals && el.equals(item)) {
ar.splice(i, 1);
return;
} else if(el === item) {
ar.splice(i, 1);
return;
}
}
}
////////////////// QUERY COLLECTIONS \\\\\\\\\\\\\\\\\\\\\\\
function Subscription(obj, eventType, fn) {
this.obj = obj;
this.eventType = eventType;
this.fn = fn;
}
Subscription.prototype.unsubscribe = function() {
this.obj.removeEventListener(this.eventType, this.fn);
};
/**
* Simple observable function constructor
* @constructor
*/
function Observable() {
this.subscribers = {};
}
Observable.prototype.addEventListener = function (eventType, fn) {
if (!this.subscribers[eventType]) {
this.subscribers[eventType] = [];
}
this.subscribers[eventType].push(fn);
return new Subscription(this, eventType, fn);
};
Observable.prototype.removeEventListener = function(eventType, fn) {
var subscribers = this.subscribers[eventType];
for ( var i = 0; i < subscribers.length; i++) {
if(subscribers[i] == fn) {
this.subscribers[eventType].splice(i, 1);
return true;
}
}
return false;
};
Observable.prototype.triggerEvent = function (eventType) {
if (!this.subscribers[eventType]) { // No subscribers to this event type
return;
}
var subscribers = this.subscribers[eventType].slice(0);
for(var i = 0; i < subscribers.length; i++) {
subscribers[i].apply(null, arguments);
}
};
/*
* Each filter has 4 methods:
* - sql(prefix, values) -- returns a SQL representation of this filter,
* possibly pushing additional query arguments to `values` if ?'s are used
* in the query
* - match(o) -- returns whether the filter matches the object o.
* - makeFit(o) -- attempts to adapt the object o in such a way that it matches
* this filter.
* - makeNotFit(o) -- the oppositive of makeFit, makes the object o NOT match
* this filter
*/
/**
* Default filter that does not filter on anything
* currently it generates a 1=1 SQL query, which is kind of ugly
*/
function NullFilter () {
}
NullFilter.prototype.match = function (o) {
return true;
};
NullFilter.prototype.makeFit = function(o) {
};
NullFilter.prototype.makeNotFit = function(o) {
};
NullFilter.prototype.toUniqueString = function() {
return "NULL";
};
NullFilter.prototype.subscribeGlobally = function() { };
NullFilter.prototype.unsubscribeGlobally = function() { };
/**
* Filter that makes sure that both its left and right filter match
* @param left left-hand filter object
* @param right right-hand filter object
*/
function AndFilter (left, right) {
this.left = left;
this.right = right;
}
AndFilter.prototype.match = function (o) {
return this.left.match(o) && this.right.match(o);
};
AndFilter.prototype.makeFit = function(o) {
this.left.makeFit(o);
this.right.makeFit(o);
};
AndFilter.prototype.makeNotFit = function(o) {
this.left.makeNotFit(o);
this.right.makeNotFit(o);
};
AndFilter.prototype.toUniqueString = function() {
return this.left.toUniqueString() + " AND " + this.right.toUniqueString();
};
AndFilter.prototype.subscribeGlobally = function(coll, entityName) {
this.left.subscribeGlobally(coll, entityName);
this.right.subscribeGlobally(coll, entityName);
};
AndFilter.prototype.unsubscribeGlobally = function(coll, entityName) {
this.left.unsubscribeGlobally(coll, entityName);
this.right.unsubscribeGlobally(coll, entityName);
};
/**
* Filter that makes sure that either its left and right filter match
* @param left left-hand filter object
* @param right right-hand filter object
*/
function OrFilter (left, right) {
this.left = left;
this.right = right;
}
OrFilter.prototype.match = function (o) {
return this.left.match(o) || this.right.match(o);
};
OrFilter.prototype.makeFit = function(o) {
this.left.makeFit(o);
this.right.makeFit(o);
};
OrFilter.prototype.makeNotFit = function(o) {
this.left.makeNotFit(o);
this.right.makeNotFit(o);
};
OrFilter.prototype.toUniqueString = function() {
return this.left.toUniqueString() + " OR " + this.right.toUniqueString();
};
OrFilter.prototype.subscribeGlobally = function(coll, entityName) {
this.left.subscribeGlobally(coll, entityName);
this.right.subscribeGlobally(coll, entityName);
};
OrFilter.prototype.unsubscribeGlobally = function(coll, entityName) {
this.left.unsubscribeGlobally(coll, entityName);
this.right.unsubscribeGlobally(coll, entityName);
};
/**
* Filter that checks whether a certain property matches some value, based on an
* operator. Supported operators are '=', '!=', '<', '<=', '>' and '>='.
* @param property the property name
* @param operator the operator to compare with
* @param value the literal value to compare to
*/
function PropertyFilter (property, operator, value) {
this.property = property;
this.operator = operator.toLowerCase();
this.value = value;
}
PropertyFilter.prototype.match = function (o) {
var value = this.value;
var propValue = persistence.get(o, this.property);
if(value && value.getTime) { // DATE
// TODO: Deal with arrays of dates for 'in' and 'not in'
value = Math.round(value.getTime() / 1000) * 1000; // Deal with precision
if(propValue && propValue.getTime) { // DATE
propValue = Math.round(propValue.getTime() / 1000) * 1000; // Deal with precision
}
}
switch (this.operator) {
case '=':
return propValue === value;
break;
case '!=':
return propValue !== value;
break;
case '<':
return propValue < value;
break;
case '<=':
return propValue <= value;
break;
case '>':
return propValue > value;
break;
case '>=':
return propValue >= value;
break;
case 'in':
return arrayContains(value, propValue);
break;
case 'not in':
return !arrayContains(value, propValue);
break;
}
};
PropertyFilter.prototype.makeFit = function(o) {
if(this.operator === '=') {
persistence.set(o, this.property, this.value);
} else {
throw new Error("Sorry, can't perform makeFit for other filters than =");
}
};
PropertyFilter.prototype.makeNotFit = function(o) {
if(this.operator === '=') {
persistence.set(o, this.property, null);
} else {
throw new Error("Sorry, can't perform makeNotFit for other filters than =");
}
};
PropertyFilter.prototype.subscribeGlobally = function(coll, entityName) {
persistence.subscribeToGlobalPropertyListener(coll, entityName, this.property);
};
PropertyFilter.prototype.unsubscribeGlobally = function(coll, entityName) {
persistence.unsubscribeFromGlobalPropertyListener(coll, entityName, this.property);
};
PropertyFilter.prototype.toUniqueString = function() {
var val = this.value;
if(val && val._type) {
val = val.id;
}
return this.property + this.operator + val;
};
persistence.NullFilter = NullFilter;
persistence.AndFilter = AndFilter;
persistence.OrFilter = OrFilter;
persistence.PropertyFilter = PropertyFilter;
/**
* Ensure global uniqueness of query collection object
*/
persistence.uniqueQueryCollection = function(coll) {
var entityName = coll._entityName;
if(coll._items) { // LocalQueryCollection
return coll;
}
if(!this.queryCollectionCache[entityName]) {
this.queryCollectionCache[entityName] = {};
}
var uniqueString = coll.toUniqueString();
if(!this.queryCollectionCache[entityName][uniqueString]) {
this.queryCollectionCache[entityName][uniqueString] = coll;
}
return this.queryCollectionCache[entityName][uniqueString];
}
/**
* The constructor function of the _abstract_ QueryCollection
* DO NOT INSTANTIATE THIS
* @constructor
*/
function QueryCollection () {
}
QueryCollection.prototype = new Observable();
QueryCollection.prototype.oldAddEventListener = QueryCollection.prototype.addEventListener;
QueryCollection.prototype.setupSubscriptions = function() {
this._filter.subscribeGlobally(this, this._entityName);
};
QueryCollection.prototype.teardownSubscriptions = function() {
this._filter.unsubscribeGlobally(this, this._entityName);
};
QueryCollection.prototype.addEventListener = function(eventType, fn) {
var that = this;
var subscription = this.oldAddEventListener(eventType, fn);
if(this.subscribers[eventType].length === 1) { // first subscriber
this.setupSubscriptions();
}
subscription.oldUnsubscribe = subscription.unsubscribe;
subscription.unsubscribe = function() {
this.oldUnsubscribe();
if(that.subscribers[eventType].length === 0) { // last subscriber
that.teardownSubscriptions();
}
};
return subscription;
};
/**
* Function called when session is flushed, returns list of SQL queries to execute
* (as [query, arg] tuples)
*/
QueryCollection.prototype.persistQueries = function() { return []; };
/**
* Invoked by sub-classes to initialize the query collection
*/
QueryCollection.prototype.init = function (session, entityName, constructor) {
this._filter = new NullFilter();
this._orderColumns = []; // tuples of [column, ascending]
this._prefetchFields = [];
this._entityName = entityName;
this._constructor = constructor;
this._limit = -1;
this._skip = 0;
this._reverse = false;
this._session = session || persistence;
// For observable
this.subscribers = {};
}
QueryCollection.prototype.toUniqueString = function() {
var s = this._constructor.name + ": " + this._entityName;
s += '|Filter:';
var values = [];
s += this._filter.toUniqueString();
s += '|Values:';
for(var i = 0; i < values.length; i++) {
s += values + "|^|";
}
s += '|Order:';
for(var i = 0; i < this._orderColumns.length; i++) {
var col = this._orderColumns[i];
s += col[0] + ", " + col[1] + ", " + col[2];
}
s += '|Prefetch:';
for(var i = 0; i < this._prefetchFields.length; i++) {
s += this._prefetchFields[i];
}
s += '|Limit:';
s += this._limit;
s += '|Skip:';
s += this._skip;
s += '|Reverse:';
s += this._reverse;
return s;
};
/**
* Creates a clone of this query collection
* @return a clone of the collection
*/
QueryCollection.prototype.clone = function (cloneSubscribers) {
var c = new (this._constructor)(this._session, this._entityName);
c._filter = this._filter;
c._prefetchFields = this._prefetchFields.slice(0); // clone
c._orderColumns = this._orderColumns.slice(0);
c._limit = this._limit;
c._skip = this._skip;
c._reverse = this._reverse;
if(cloneSubscribers) {
var subscribers = {};
for(var eventType in this.subscribers) {
if(this.subscribers.hasOwnProperty(eventType)) {
subscribers[eventType] = this.subscribers[eventType].slice(0);
}
}
c.subscribers = subscribers; //this.subscribers;
} else {
c.subscribers = this.subscribers;
}
return c;
};
/**
* Returns a new query collection with a property filter condition added
* @param property the property to filter on
* @param operator the operator to use
* @param value the literal value that the property should match
* @return the query collection with the filter added
*/
QueryCollection.prototype.filter = function (property, operator, value) {
var c = this.clone(true);
c._filter = new AndFilter(this._filter, new PropertyFilter(property,
operator, value));
// Add global listener (TODO: memory leak waiting to happen!)
var session = this._session;
c = session.uniqueQueryCollection(c);
//session.subscribeToGlobalPropertyListener(c, this._entityName, property);
return session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection with an OR condition between the
* current filter and the filter specified as argument
* @param filter the other filter
* @return the new query collection
*/
QueryCollection.prototype.or = function (filter) {
var c = this.clone(true);
c._filter = new OrFilter(this._filter, filter);
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection with an AND condition between the
* current filter and the filter specified as argument
* @param filter the other filter
* @return the new query collection
*/
QueryCollection.prototype.and = function (filter) {
var c = this.clone(true);
c._filter = new AndFilter(this._filter, filter);
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection with an ordering imposed on the collection
* @param property the property to sort on
* @param ascending should the order be ascending (= true) or descending (= false)
* @param caseSensitive should the order be case sensitive (= true) or case insensitive (= false)
* note: using case insensitive ordering for anything other than TEXT fields yields
* undefinded behavior
* @return the query collection with imposed ordering
*/
QueryCollection.prototype.order = function (property, ascending, caseSensitive) {
ascending = ascending === undefined ? true : ascending;
caseSensitive = caseSensitive === undefined ? true : caseSensitive;
var c = this.clone();
c._orderColumns.push( [ property, ascending, caseSensitive ]);
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection will limit its size to n items
* @param n the number of items to limit it to
* @return the limited query collection
*/
QueryCollection.prototype.limit = function(n) {
var c = this.clone();
c._limit = n;
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection which will skip the first n results
* @param n the number of results to skip
* @return the query collection that will skip n items
*/
QueryCollection.prototype.skip = function(n) {
var c = this.clone();
c._skip = n;
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection which reverse the order of the result set
* @return the query collection that will reverse its items
*/
QueryCollection.prototype.reverse = function() {
var c = this.clone();
c._reverse = true;
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection which will prefetch a certain object relationship.
* Only works with 1:1 and N:1 relations.
* Relation must target an entity, not a mix-in.
* @param rel the relation name of the relation to prefetch
* @return the query collection prefetching `rel`
*/
QueryCollection.prototype.prefetch = function (rel) {
var c = this.clone();
c._prefetchFields.push(rel);
return this._session.uniqueQueryCollection(c);
};
/**
* Select a subset of data, represented by this query collection as a JSON
* structure (Javascript object)
*
* @param tx database transaction to use, leave out to start a new one
* @param props a property specification
* @param callback(result)
*/
QueryCollection.prototype.selectJSON = function(tx, props, callback) {
var args = argspec.getArgs(arguments, [
{ name: "tx", optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: "props", optional: false },
{ name: "callback", optional: false }
]);
var session = this._session;
var that = this;
tx = args.tx;
props = args.props;
callback = args.callback;
if(!tx) {
session.transaction(function(tx) {
that.selectJSON(tx, props, callback);
});
return;
}
var Entity = getEntity(this._entityName);
// TODO: This could do some clever prefetching to make it more efficient
this.list(function(items) {
var resultArray = [];
persistence.asyncForEach(items, function(item, callback) {
item.selectJSON(tx, props, function(obj) {
resultArray.push(obj);
callback();
});
}, function() {
callback(resultArray);
});
});
};
/**
* Adds an object to a collection
* @param obj the object to add
*/
QueryCollection.prototype.add = function(obj) {
if(!obj.id || !obj._type) {
throw new Error("Cannot add object of non-entity type onto collection.");
}
this._session.add(obj);
this._filter.makeFit(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
}
/**
* Adds an an array of objects to a collection
* @param obj the object to add
*/
QueryCollection.prototype.addAll = function(objs) {
for(var i = 0; i < objs.length; i++) {
var obj = objs[i];
this._session.add(obj);
this._filter.makeFit(obj);
this.triggerEvent('add', this, obj);
}
this.triggerEvent('change', this);
}
/**
* Removes an object from a collection
* @param obj the object to remove from the collection
*/
QueryCollection.prototype.remove = function(obj) {
if(!obj.id || !obj._type) {
throw new Error("Cannot remove object of non-entity type from collection.");
}
this._filter.makeNotFit(obj);
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
}
/**
* A database implementation of the QueryCollection
* @param entityName the name of the entity to create the collection for
* @constructor
*/
function DbQueryCollection (session, entityName) {
this.init(session, entityName, DbQueryCollection);
}
/**
* Execute a function for each item in the list
* @param tx the transaction to use (or null to open a new one)
* @param eachFn (elem) the function to be executed for each item
*/
QueryCollection.prototype.each = function (tx, eachFn) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'eachFn', optional: true, check: argspec.isCallback() }
]);
tx = args.tx;
eachFn = args.eachFn;
this.list(tx, function(results) {
for(var i = 0; i < results.length; i++) {
eachFn(results[i]);
}
});
}
// Alias
QueryCollection.prototype.forEach = QueryCollection.prototype.each;
QueryCollection.prototype.one = function (tx, oneFn) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'oneFn', optional: false, check: argspec.isCallback() }
]);
tx = args.tx;
oneFn = args.oneFn;
var that = this;
this.limit(1).list(tx, function(results) {
if(results.length === 0) {
oneFn(null);
} else {
oneFn(results[0]);
}
});
}
DbQueryCollection.prototype = new QueryCollection();
/**
* An implementation of QueryCollection, that is used
* to represent all instances of an entity type
* @constructor
*/
function AllDbQueryCollection (session, entityName) {
this.init(session, entityName, AllDbQueryCollection);
}
AllDbQueryCollection.prototype = new DbQueryCollection();
AllDbQueryCollection.prototype.add = function(obj) {
this._session.add(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
};
AllDbQueryCollection.prototype.remove = function(obj) {
this._session.remove(obj);
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
};
/**
* A ManyToMany implementation of QueryCollection
* @constructor
*/
function ManyToManyDbQueryCollection (session, entityName) {
this.init(session, entityName, persistence.ManyToManyDbQueryCollection);
this._localAdded = [];
this._localRemoved = [];
}
ManyToManyDbQueryCollection.prototype = new DbQueryCollection();
ManyToManyDbQueryCollection.prototype.initManyToMany = function(obj, coll) {
this._obj = obj;
this._coll = coll;
};
ManyToManyDbQueryCollection.prototype.add = function(obj) {
if(!arrayContains(this._localAdded, obj)) {
this._session.add(obj);
this._localAdded.push(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
}
};
ManyToManyDbQueryCollection.prototype.addAll = function(objs) {
for(var i = 0; i < objs.length; i++) {
var obj = objs[i];
if(!arrayContains(this._localAdded, obj)) {
this._session.add(obj);
this._localAdded.push(obj);
this.triggerEvent('add', this, obj);
}
}
this.triggerEvent('change', this);
}
ManyToManyDbQueryCollection.prototype.clone = function() {
var c = DbQueryCollection.prototype.clone.call(this);
c._localAdded = this._localAdded;
c._localRemoved = this._localRemoved;
c._obj = this._obj;
c._coll = this._coll;
return c;
};
ManyToManyDbQueryCollection.prototype.remove = function(obj) {
if(arrayContains(this._localAdded, obj)) { // added locally, can just remove it from there
arrayRemove(this._localAdded, obj);
} else if(!arrayContains(this._localRemoved, obj)) {
this._localRemoved.push(obj);
}
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
};
////////// Local implementation of QueryCollection \\\\\\\\\\\\\\\\
function LocalQueryCollection(initialArray) {
this.init(persistence, null, LocalQueryCollection);
this._items = initialArray || [];
}
LocalQueryCollection.prototype = new QueryCollection();
LocalQueryCollection.prototype.clone = function() {
var c = DbQueryCollection.prototype.clone.call(this);
c._items = this._items;
return c;
};
LocalQueryCollection.prototype.add = function(obj) {
if(!arrayContains(this._items, obj)) {
this._session.add(obj);
this._items.push(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
}
};
LocalQueryCollection.prototype.addAll = function(objs) {
for(var i = 0; i < objs.length; i++) {
var obj = objs[i];
if(!arrayContains(this._items, obj)) {
this._session.add(obj);
this._items.push(obj);
this.triggerEvent('add', this, obj);
}
}
this.triggerEvent('change', this);
}
LocalQueryCollection.prototype.remove = function(obj) {
var items = this._items;
for(var i = 0; i < items.length; i++) {
if(items[i] === obj) {
this._items.splice(i, 1);
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
}
}
};
LocalQueryCollection.prototype.list = function(tx, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'callback', optional: true, check: argspec.isCallback() }
]);
callback = args.callback;
if(!callback || callback.executeSql) { // first argument is transaction
callback = arguments[1]; // set to second argument
}
var array = this._items.slice(0);
var that = this;
var results = [];
for(var i = 0; i < array.length; i++) {
if(this._filter.match(array[i])) {
results.push(array[i]);
}
}
results.sort(function(a, b) {
for(var i = 0; i < that._orderColumns.length; i++) {
var col = that._orderColumns[i][0];
var asc = that._orderColumns[i][1];
var sens = that._orderColumns[i][2];
var aVal = persistence.get(a, col);
var bVal = persistence.get(b, col);
if (!sens) {
aVal = aVal.toLowerCase();
bVal = bVal.toLowerCase();
}
if(aVal < bVal) {
return asc ? -1 : 1;
} else if(aVal > bVal) {
return asc ? 1 : -1;
}
}
return 0;
});
if(this._skip) {
results.splice(0, this._skip);
}
if(this._limit > -1) {
results = results.slice(0, this._limit);
}
if(this._reverse) {
results.reverse();
}
if(callback) {
callback(results);
} else {
return results;
}
};
LocalQueryCollection.prototype.destroyAll = function(callback) {
if(!callback || callback.executeSql) { // first argument is transaction
callback = arguments[1]; // set to second argument
}
this._items = [];
this.triggerEvent('change', this);
if(callback) callback();
};
LocalQueryCollection.prototype.count = function(tx, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'callback', optional: true, check: argspec.isCallback() }
]);
tx = args.tx;
callback = args.callback;
var result = this.list();
if(callback) {
callback(result.length);
} else {
return result.length;
}
};
persistence.QueryCollection = QueryCollection;
persistence.DbQueryCollection = DbQueryCollection;
persistence.ManyToManyDbQueryCollection = ManyToManyDbQueryCollection;
persistence.LocalQueryCollection = LocalQueryCollection;
persistence.Observable = Observable;
persistence.Subscription = Subscription;
persistence.AndFilter = AndFilter;
persistence.OrFilter = OrFilter;
persistence.PropertyFilter = PropertyFilter;
}());
// ArgSpec.js library: http://github.com/zefhemel/argspecjs
var argspec = {};
(function() {
argspec.getArgs = function(args, specs) {
var argIdx = 0;
var specIdx = 0;
var argObj = {};
while(specIdx < specs.length) {
var s = specs[specIdx];
var a = args[argIdx];
if(s.optional) {
if(a !== undefined && s.check(a)) {
argObj[s.name] = a;
argIdx++;
specIdx++;
} else {
if(s.defaultValue !== undefined) {
argObj[s.name] = s.defaultValue;
}
specIdx++;
}
} else {
if(s.check && !s.check(a)) {
throw new Error("Invalid value for argument: " + s.name + " Value: " + a);
}
argObj[s.name] = a;
specIdx++;
argIdx++;
}
}
return argObj;
}
argspec.hasProperty = function(name) {
return function(obj) {
return obj && obj[name] !== undefined;
};
}
argspec.hasType = function(type) {
return function(obj) {
return typeof obj === type;
};
}
argspec.isCallback = function() {
return function(obj) {
return obj && obj.apply;
};
}
}());
persistence.argspec = argspec;
return persistence;
} // end of createPersistence
// JSON2 library, source: http://www.JSON.org/js.html
// Most modern browsers already support this natively, but mobile
// browsers often don't, hence this implementation
// Relevant APIs:
// JSON.stringify(value, replacer, space)
// JSON.parse(text, reviver)
if(typeof JSON === 'undefined') {
JSON = {};
}
//var JSON = typeof JSON === 'undefined' ? window.JSON : {};
if (!JSON.stringify) {
(function () {
function f(n) {
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
return isFinite(this.valueOf()) ?
this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z' : null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function (key) {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap, indent,
meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
escapable.lastIndex = 0;
return escapable.test(string) ?
'"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' :
'"' + string + '"';
}
function str(key, holder) {
var i, k, v, length, mind = gap, partial, value = holder[key];
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
return String(value);
case 'object':
if (!value) {
return 'null';
}
gap += indent;
partial = [];
if (Object.prototype.toString.apply(value) === '[object Array]') {
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
v = partial.length === 0 ? '[]' :
gap ? '[\n' + gap +
partial.join(',\n' + gap) + '\n' +
mind + ']' :
'[' + partial.join(',') + ']';
gap = mind;
return v;
}
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
k = rep[i];
if (typeof k === 'string') {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
v = partial.length === 0 ? '{}' :
gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
mind + '}' : '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
if (typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
var i;
gap = '';
indent = '';
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
} else if (typeof space === 'string') {
indent = space;
}
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
return str('', {'': value});
};
}
if (typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
var j;
function walk(holder, key) {
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
j = eval('(' + text + ')');
return typeof reviver === 'function' ?
walk({'': j}, '') : j;
}
throw new SyntaxError('JSON.parse');
};
}
}());
}
|
Package.describe({
summary: 'Meteor package to wrap TopoJSON: An extension to GeoJSON that encodes topology'
});
Package.on_use(function(api) {
api.export('topojson');
api.add_files('meteor-topojson.js', 'server');
api.add_files('topojson.js', 'client');
});
Package.on_test(function (api) {
api.use(['topojson', 'tinytest']);
api.add_files('topojson_tests.js', ['server', 'client']);
});
Npm.depends({
topojson: '1.6.8'
});
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=property.js.map
|
describe('ds.utils.loadGoogleMapsAPI()', function() {
this.timeout(20000);
it('should load google maps api', function(done) {
ds.utils.loadGoogleMapsAPI().done(function(google) {
expect(google).to.be.an('object');
done();
});
});
it('should not make a http request second time google is requested', function(done) {
var start = new Date().getTime();
ds.utils.loadGoogleMapsAPI().done(function() {
var elapsed = new Date().getTime() - start;
expect(elapsed).to.be.lessThan(10);
done();
});
});
});
|
import { Resource } from '../api-resource';
import logger from 'kolibri.lib.logging';
const logging = logger.getLogger(__filename);
export default class FacilityUserResource extends Resource {
static resourceName() {
return 'facilityuser';
}
getCurrentFacility() {
const promise = new Promise(
resolve => {
this.client({ path: this.currentFacilityUrl() }).then(
response => {
resolve(response.entity);
},
response => {
logging.error('An error occurred', response);
}
);
},
reject => {
reject(reject);
}
);
return promise;
}
get currentFacilityUrl() {
return this.urls[`currentfacility_list`];
}
}
|
(function(){dust.register("red-tpl.tl",body_0);function body_0(chk,ctx){return chk.write("<div class=\"col-md-8\"><div class=\"row\"><div class=\"col-md-22 col-md-offset-1 red subpagecontrolhighlight\"> </div></div></div>");}return body_0;})();
|
module.exports = (config) => {
const defaults = {
isWarmingUp: (event) => event.source === 'serverless-plugin-warmup',
onWarmup: (event) => console.log('Exiting early via warmup Middleware'),
waitForEmptyEventLoop: null
}
const options = Object.assign({}, defaults, config)
return ({
before: (handler, next) => {
if (options.isWarmingUp(handler.event)) {
options.onWarmup(handler.event)
if (options.waitForEmptyEventLoop !== null) {
handler.context.callbackWaitsForEmptyEventLoop = Boolean(options.waitForEmptyEventLoop)
}
return handler.callback(null, 'warmup')
}
next()
}
})
}
|
'use strict'
var Transform = require('stream').Transform
, util = require('util')
, Segment = require('./segment')
, Message = require('./message')
, utils = require('./utils')
// MLP end frames
var FS = String.fromCharCode(0x1c)
, CR = String.fromCharCode(0x0d)
exports.Message = Message
exports.Segment = Segment
exports.Parser = Parser
exports.utils = utils
/**
* Constructor
*/
function Parser() {
var opts = { objectMode: true }
if (!(this instanceof Parser))
return new Parser(opts)
Transform.call(this, opts)
this._messages = []
this.current = null
}
util.inherits(Parser, Transform)
Parser.prototype._tryParseSegment = function _tryParseSegment(data, delims) {
var self = this
try {
return new Segment(data, delims)
} catch (err) {
self.emit('error', err)
return null
}
}
/**
* Transform for parser
*
* **NOTE: The stream should have been pipe through `split()` already**
*
* @param {Buffer} data The segment as a buffer
* @param {String} encoding The encoding of the buffer
* @param {Function} cb function(err, res)
* @api private
*/
Parser.prototype._transform = function(data, encoding, done) {
var delims = this.current
? this.current.delimiters()
: null
var segment = this._tryParseSegment(data, delims)
if (!segment) return
if (segment && segment.parsed) {
var isHeader = utils.segmentIsHeader(segment)
if (isHeader && this.current) {
this.emit('message', this.current)
var message = new Message()
message.addSegment(segment)
this._messages.push(message)
this.current = message
} else if (isHeader && !this.current) {
this.current = new Message()
this.current.addSegment(segment)
} else {
this.current.addSegment(segment)
}
/*
If the message ended with FS+CR, this indicates the end of the message
and it should be pushed over the transform stream now.
http://www.hl7standards.com/blog/2007/05/02/hl7-mlp-minimum-layer-protocol-defined/
*/
if (data.indexOf(FS + CR) !== -1) {
this.emit('message', this.current)
this.current = null
}
}
done()
}
Parser.prototype._flush = function(done) {
if (this.current && this.current.segments.length) {
this.emit('message', this.current)
this._messages.push(this.current)
this.current = null
}
this.emit('messages', this._messages)
done()
}
|
'use strict';
import imageSearchPage from '../../pageobjects/image-search.page';
module.exports = function() {
this.Given(/^I am on the google image search page$/, () => {
imageSearchPage.open();
});
// Enter term in search: google.js
this.Given(/^I press the image search button$/, () => {
imageSearchPage.pressSearchButton();
});
this.Then(/^I see the results of my image search$/, () => {
expect(imageSearchPage.searchResults).toBeTruthy();
});
};
|
/**
* The MIT License (MIT)
*
* Copyright (c) 2022 Losant IoT, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var uriTemplate = require('uri-template');
module.exports = function (options, client) {
var internals = {};
/**
* Returns the API tokens for an instance
*
* Authentication:
* The client must be configured with a valid api
* access token to call this action. The token
* must include at least one of the following scopes:
* all.Instance, all.Instance.read, all.User, all.User.read, instanceApiTokens.*, or instanceApiTokens.get.
*
* Parameters:
* {string} instanceId - ID associated with the instance
* {string} sortField - Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated, expirationDate
* {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
* {string} page - Which page of results to return
* {string} perPage - How many items to return per page
* {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name, status
* {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
* {string} losantdomain - Domain scope of request (rarely needed)
* {boolean} _actions - Return resource actions in response
* {boolean} _links - Return resource link in response
* {boolean} _embedded - Return embedded resources in response
*
* Responses:
* 200 - Collection of API tokens (https://api.losant.com/#/definitions/apiToken)
*
* Errors:
* 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
*/
internals.get = function (params, opts, cb) {
if ('function' === typeof params) {
cb = params;
params = {};
opts = {};
} else if ('function' === typeof opts) {
cb = opts;
opts = {};
} else if (!opts) {
opts = {};
}
params = params || {};
var tpl = uriTemplate.parse('/instances/{instanceId}/tokens');
var pathParams = {};
var req = {
method: 'GET',
headers: {},
params: { _actions: false, _links: true, _embedded: true }
};
if ('undefined' !== typeof params.instanceId) { pathParams.instanceId = params.instanceId; }
if ('undefined' !== typeof params.sortField) { req.params.sortField = params.sortField; }
if ('undefined' !== typeof params.sortDirection) { req.params.sortDirection = params.sortDirection; }
if ('undefined' !== typeof params.page) { req.params.page = params.page; }
if ('undefined' !== typeof params.perPage) { req.params.perPage = params.perPage; }
if ('undefined' !== typeof params.filterField) { req.params.filterField = params.filterField; }
if ('undefined' !== typeof params.filter) { req.params.filter = params.filter; }
if ('undefined' !== typeof params.losantdomain) { req.headers.losantdomain = params.losantdomain; }
if ('undefined' !== typeof params._actions) { req.params._actions = params._actions; }
if ('undefined' !== typeof params._links) { req.params._links = params._links; }
if ('undefined' !== typeof params._embedded) { req.params._embedded = params._embedded; }
req.url = tpl.expand(pathParams);
return client.request(req, opts, cb);
};
/**
* Create a new API token for an instance
*
* Authentication:
* The client must be configured with a valid api
* access token to call this action. The token
* must include at least one of the following scopes:
* all.Instance, all.User, instanceApiTokens.*, or instanceApiTokens.post.
*
* Parameters:
* {string} instanceId - ID associated with the instance
* {hash} apiToken - API token information (https://api.losant.com/#/definitions/apiTokenPost)
* {string} losantdomain - Domain scope of request (rarely needed)
* {boolean} _actions - Return resource actions in response
* {boolean} _links - Return resource link in response
* {boolean} _embedded - Return embedded resources in response
*
* Responses:
* 201 - The successfully created API token (https://api.losant.com/#/definitions/apiToken)
*
* Errors:
* 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
*/
internals.post = function (params, opts, cb) {
if ('function' === typeof params) {
cb = params;
params = {};
opts = {};
} else if ('function' === typeof opts) {
cb = opts;
opts = {};
} else if (!opts) {
opts = {};
}
params = params || {};
var tpl = uriTemplate.parse('/instances/{instanceId}/tokens');
var pathParams = {};
var req = {
method: 'POST',
data: {},
headers: {},
params: { _actions: false, _links: true, _embedded: true }
};
if ('undefined' !== typeof params.instanceId) { pathParams.instanceId = params.instanceId; }
if ('undefined' !== typeof params.apiToken) { req.data = params.apiToken; }
if ('undefined' !== typeof params.losantdomain) { req.headers.losantdomain = params.losantdomain; }
if ('undefined' !== typeof params._actions) { req.params._actions = params._actions; }
if ('undefined' !== typeof params._links) { req.params._links = params._links; }
if ('undefined' !== typeof params._embedded) { req.params._embedded = params._embedded; }
req.url = tpl.expand(pathParams);
return client.request(req, opts, cb);
};
return internals;
};
|
import React from 'react'
import { mount, shallow } from 'enzyme'
import { Dummy } from './utils'
import { withHandlers } from '..'
describe('withHandlers', () => {
it('passes immutable handlers', () => {
const enhance = withHandlers({
handler: () => () => null,
})
const EnhancedDummy = enhance(Dummy)
expect(EnhancedDummy.displayName).toBe('withHandlers(Dummy)')
const wrapper = shallow(<EnhancedDummy />)
const handler = wrapper.prop('handler')
wrapper.setProps({ foo: 'bar' })
expect(wrapper.prop('foo')).toBe('bar')
expect(wrapper.prop('handler')).toBe(handler)
})
it('caches handlers properly', () => {
const handlerCreationSpy = jest.fn()
const handlerCallSpy = jest.fn()
const enhance = withHandlers({
handler: props => {
handlerCreationSpy(props)
return val => {
handlerCallSpy(val)
}
},
})
const EnhancedDummy = enhance(Dummy)
const wrapper = shallow(<EnhancedDummy foo="bar" />)
const handler = wrapper.prop('handler')
// Don't create handler until it is called.
expect(handlerCreationSpy).toHaveBeenCalledTimes(0)
expect(handlerCallSpy).toHaveBeenCalledTimes(0)
handler(1)
expect(handlerCreationSpy).toHaveBeenCalledTimes(1)
expect(handlerCreationSpy).toHaveBeenCalledWith({ foo: 'bar' })
expect(handlerCallSpy).toHaveBeenCalledTimes(1)
expect(handlerCallSpy).toHaveBeenCalledWith(1)
// Props haven't changed; should use cached handler.
handler(2)
expect(handlerCreationSpy).toHaveBeenCalledTimes(1)
expect(handlerCallSpy).toHaveBeenCalledTimes(2)
expect(handlerCallSpy.mock.calls[1]).toEqual([2])
wrapper.setProps({ foo: 'baz' })
handler(3)
// Props did change; handler should be recreated.
expect(handlerCreationSpy).toHaveBeenCalledTimes(2)
expect(handlerCreationSpy.mock.calls[1]).toEqual([{ foo: 'baz' }])
expect(handlerCallSpy).toHaveBeenCalledTimes(3)
expect(handlerCallSpy.mock.calls[2]).toEqual([3])
})
it('throws if handler is not a higher-order function', () => {
/* eslint-disable no-console */
const originalError = console.error
console.error = jest.fn()
const EnhancedDummy = withHandlers({
foo: () => {},
})(Dummy)
const wrapper = shallow(<EnhancedDummy />)
expect(() => wrapper.prop('foo').call()).toThrowError()
expect(console.error).toBeCalledWith(
// eslint-disable-line no-console
'withHandlers(): Expected a map of higher-order functions. ' +
'Refer to the docs for more info.',
)
console.error = originalError
/* eslint-enable no-console */
})
it('allows handers to be a factory', () => {
const enhance = withHandlers(initialProps => {
let cache
return {
handler: () => () => {
if (cache) {
return cache
}
cache = { ...initialProps }
return cache
},
}
})
const componentHandlers = []
const componentHandlers2 = []
const Component = enhance(({ handler }) => {
componentHandlers.push(handler())
return null
})
const Component2 = enhance(({ handler }) => {
componentHandlers2.push(handler())
return null
})
const wrapper = mount(<Component hello="foo" />)
wrapper.setProps({ hello: 'bar' })
expect(componentHandlers[0]).toBe(componentHandlers[1])
// check that cache is not shared
mount(<Component2 hello="foo" />)
expect(componentHandlers[0]).toEqual(componentHandlers2[0])
expect(componentHandlers[0]).not.toBe(componentHandlers2[0])
})
})
|
var lexer = require('../../index').lex.lexer;
var parser = require('../../index').parse.parser;
var $ = require('../$');
var testParser = function(stream) {
var result = parser.parseStream(stream);
return result.body[0].expression;
};
exports.empty = function(test) {
var result = testParser(lexer.lex("({});"));
test.equal(result.properties.length, 0);
test.done();
};
exports.init_values = function(test) {
var result = testParser(lexer.lex("({ 'a': 0 , 'b': 1, '9': 2});"));
test.equal(result.properties.length, 3);
test.equal(result.properties[0].type, 'ObjectValue');
$.string(test, result.properties[0].key, 'a');
$.number(test, result.properties[0].value, 0);
test.equal(result.properties[1].type, 'ObjectValue');
$.string(test, result.properties[1].key, 'b');
$.number(test, result.properties[1].value, 1);
test.equal(result.properties[2].type, 'ObjectValue');
$.string(test, result.properties[2].key, '9');
$.number(test, result.properties[2].value, 2);
test.done();
};
exports.init_values = function(test) {
var result = testParser(lexer.lex("({ catch: 0 , true: 1, null: 2});"));
test.equal(result.properties.length, 3);
test.equal(result.properties[0].type, 'ObjectValue');
$.id(test, result.properties[0].key, 'catch');
$.number(test, result.properties[0].value, 0);
test.equal(result.properties[1].type, 'ObjectValue');
$.id(test, result.properties[1].key, 'true');
$.number(test, result.properties[1].value, 1);
test.equal(result.properties[2].type, 'ObjectValue');
$.id(test, result.properties[2].key, 'null');
$.number(test, result.properties[2].value, 2);
test.done();
};
|
var locale = require('relative-time-format/locale/sr')
module.exports = {
locale: locale.locale,
// Standard styles.
long: locale.long,
short: locale.short,
narrow: locale.narrow,
// Quantifier.
quantify: locale.quantify
}
|
var baseIteratee = require('./_baseIteratee'),
baseSortedIndexBy = require('./_baseSortedIndexBy');
/**
* This method is like `_.sortedLastIndex` except that it accepts `iteratee`
* which is invoked for `value` and each element of `array` to compute their
* sort ranking. The iteratee is invoked with one argument: (value).
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The sorted array to inspect.
* @param {*} value The value to evaluate.
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
* @returns {number} Returns the index at which `value` should be inserted into `array`.
* @specs
*
* // The `_.property` iteratee shorthand.
* _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
* // => 1
*/
function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, baseIteratee(iteratee), true);
}
module.exports = sortedLastIndexBy;
|
ThinMint.Mixin.Paginate = function() {
var _super = {};
_super.init = ThinMint.Util.callback( this.init );
_super.getPage = ThinMint.Util.callback( this.getPage );
_super.setPage = ThinMint.Util.callback( this.setPage );
_super.getPages = ThinMint.Util.callback( this.getPages );
_super.setPages = ThinMint.Util.callback( this.setPages );
_super.pageNext = ThinMint.Util.callback( this.pageNext );
_super.pagePrevious = ThinMint.Util.callback( this.pagePrevious );
_super.pageTo = ThinMint.Util.callback( this.pageTo );
_super.onPage = ThinMint.Util.callback( this.onPage );
// The first page, cannot paginate before this page.
this.pageFirst = 1;
// The current page.
this.page = 1;
// How many pages are available.
this.pages = 1;
this.getPage = function() {
return this.page;
};
this.setPage = function(page) {
this.page = Number(page);
return this;
};
this.getPages = function() {
return this.pages;
};
this.setPages = function(pages) {
this.pages = Number(pages);
return this;
};
this.pageNext = function() {
if(this.page >= this.pages) {
this.console.warn('ThinMint.Mixin.Paginate', 'Already at the max page.');
return;
}
++this.page;
return this.onPage();
};
this.pagePrevious = function() {
if(this.page <= this.pageFirst) {
this.console.warn('ThinMint.Mixin.Paginate', 'Already at the first page.');
return;
}
--this.page;
return this.onPage();
};
this.pageTo = function(page) {
page = parseInt(page);
if(page >= this.pages
|| page <= this.pageFirst) {
this.console.warn('ThinMint.Mixin.Paginate', 'Cannot go outside of the allowed pages.');
return;
}
this.page = page;
return this.onPage();
};
this.onPage = function() {
// Each panel will imlement onPage, this is how it
// will handle a page change.
_super.onPage.apply(this, arguments);
};
return this;
};
|
const expect = require('chai').expect;
const PragmaThanksSpreadsheet = require('../src/PragmaThanksSpreadsheet');
describe('PragmaThanksSpreadsheet', () => {
describe('#isEmpty', () => {
it('returns true when spreadsheet is empty', () => {
const spreadsheetContent = [];
const sheet = new PragmaThanksSpreadsheet(spreadsheetContent);
expect(sheet.isEmpty()).to.eql(true);
});
it('returns true when spreadsheet is undefined', () => {
const sheet = new PragmaThanksSpreadsheet(undefined);
expect(sheet.isEmpty()).to.eql(true);
});
it('returns false when spreadsheet is not empty', () => {
const spreadsheetContent = [[1], [2]];
const sheet = new PragmaThanksSpreadsheet(spreadsheetContent);
expect(sheet.isEmpty()).to.eql(false);
});
});
describe('#getPointsToUse', () => {
const spreadsheetContent = [
[],
['foo', 'bar', 'biz'],
[],
[20, 42, 32],
[0, 0],
];
const sheet = new PragmaThanksSpreadsheet(spreadsheetContent);
it('returns user balance when it has at least one pragma points', () => {
expect(sheet.getPointsToUse('foo')).to.eql(20);
});
it('returns the balance for different users', () => {
expect(sheet.getPointsToUse('bar')).to.eql(42);
});
it('returns zero balance when user is not found', () => {
expect(sheet.getPointsToUse('unknown')).to.eql(0);
});
});
describe('#getPointsToGive', () => {
const spreadsheetContent = [
[],
['foo', 'bar'],
[],
[0, 0],
[30, 44],
];
const sheet = new PragmaThanksSpreadsheet(spreadsheetContent);
it('returns the points to give when user has at least one pragma points to give', () => {
expect(sheet.getPointsToGive('foo')).to.eql(30);
});
it('returns the points to give for different users', () => {
expect(sheet.getPointsToGive('bar')).to.eql(44);
});
it('returns zero points to give when user is not found', () => {
expect(sheet.getPointsToGive('unknown')).to.eql(0);
});
});
});
|
import React, { PropTypes } from 'react';
import styled from 'styled-components';
import TextInfo from '../TextInfo';
import CardImage from '../CardImage';
import { Row, Col, Card, Avatar } from 'antd';
import { Panel } from 'react-bootstrap';
/*
const CardImage = styled.div`
img {
display: block;
height:200px;
}
`;*/
class CardRaces extends React.Component {
constructor(props) {
super(props);
}
onClick = (id) => {
if (this.props.onClick) {
this.props.onClick(id);
}
}
render() {
const { data } = this.props;
return (
<Row gutter={8}>
{data.map((race, key) =>
<Col key={key} md={12} style={{ marginBottom: 5, marginTop: 5 }}>
<CardImage imageUrl={race.cardImageUrl} onClick={() => this.onClick(race.id)}>
<div >
<h3>{race.title}</h3>
<TextInfo>{race.description}</TextInfo>
</div>
</CardImage>
</Col>
)}
</Row>
)
}
}
/*
CardRaces.defaultProps = {
data: [
{ id:'spartan-challenge', title: 'Spartan Challenge', date: '2017-Aug-12', description: 'Spartan Challenge', url:'http://lorempixel.com/400/200/sports/1' },
{ id:'takbo-marawi', title: 'Takbo Marawi', date: '2017-Aug-12', description: 'Spartan Challenge', url:'http://lorempixel.com/400/200/sports/2' },
]
};
*/
CardRaces.propTypes = {
data: PropTypes.arrayOf(PropTypes.shape({
title: PropTypes.string,
date: PropTypes.date,
description: PropTypes.string,
url: PropTypes.string
}))
};
export default CardRaces;
|
var names = [ 'Whiskers', 'Athena', 'Sir Theodore Tibblesworth', 'Rex' ];
function keyOf (name) { return name.toLowerCase().replace(/\W+/g, '-') }
module.exports = function (db) {
setInterval(function () {
var lives = Math.floor(Math.random() * 9 + 1);
var name = names[Math.floor(Math.random() * names.length)];
db.put('cat!' + keyOf(name), { name: name, lives: lives });
}, 1000);
};
|
'use strict';
var CanvasRenderer = require('./main');
CanvasRenderer.prototype._prepareImages = function () {
// Creating the list of images
var imagesToPrepare = [];
var symbolList = this._extractor._symbolList;
var symbols = this._extractor._symbols;
for (var s = 0; s < symbolList.length; s += 1) {
var symbolId = symbolList[s];
var symbol = symbols[symbolId];
if (symbol.isImage) {
imagesToPrepare.push(symbol.swfObject);
}
var images = symbol.images;
if (images) {
for (var i = 0; i < images.length; i += 1) {
var imageData = images[i];
imagesToPrepare.push(imageData.image);
}
}
}
var nImagesToPrepare = imagesToPrepare.length;
if (nImagesToPrepare === 0) {
this._renderImages();
return;
}
var nImagesReady = 0;
var self = this;
var onWrittenCallBack = function (imageData, imageCanvas) {
if (imageCanvas.width > 0 && imageCanvas.height > 0) {
self._images[imageData.id] = imageCanvas;
} else {
console.warn('[CanvasRenderer.prepareImages] Image is empty', imageCanvas.width, imageCanvas.height, imageData.id);
}
nImagesReady += 1;
if (nImagesReady === nImagesToPrepare) {
self._renderImages();
}
};
for (var i = 0; i < imagesToPrepare.length; i += 1) {
this._renderImageToCanvas(imagesToPrepare[i], onWrittenCallBack);
}
};
|
module.exports = {
'1.train.spikes': {
display: '01',
indicator: 'OGB-1',
area: 'V1',
source: 'Theis et al., 2016'
},
'2.train.spikes': {
display: '02',
indicator: 'OGB-1',
area: 'V1',
source: 'Theis et al., 2016'
},
'3.train.spikes': {
display: '03',
indicator: 'GCaMP6s',
area: 'V1',
source: 'Theis et al., 2016'
},
'4.train.spikes': {
display: '04',
indicator: 'OGB-1',
area: 'Retina',
source: 'Theis et al., 2016'
},
'5.train.spikes': {
display: '05',
indicator: 'GCaMP6s',
area: 'V1',
source: 'Theis et al., 2016'
},
'6.train.spikes': {
display: '06',
indicator: 'GCaMP5k',
area: 'V1',
source: 'Akerboom et al., 2012'
},
'7.train.spikes': {
display: '07',
indicator: 'GCaMP6f',
area: 'V1',
source: 'Chen et al., 2013'
},
'8.train.spikes': {
display: '08',
indicator: 'GCaMP6s',
area: 'V1',
source: 'Chen et al., 2013'
},
'9.train.spikes': {
display: '09',
indicator: 'jRCAMP1a',
area: 'V1',
source: 'Dana et al., 2016'
},
'10.train.spikes': {
display: '10',
indicator: 'jRGECO1a',
area: 'V1',
source: 'Dana et al., 2016'
}
}
|
var etc=require("./etc.js"),
msgtype=require("./msgtype.js");
function constructMessage(type,args){
var len=6+args.map(function(a){return 4+a.length;}).reduce(function(a,b){return a+b;},0);
var buf=new Buffer(len);
//console.log("constructing message with len",len)
buf.writeUInt32BE(len,0);
buf.writeUInt8(type,4);
buf.writeUInt8(args.length,5);
var cursor=6;
for(var i=0;i<args.length;i++){
if(!(args[i] instanceof Buffer))args[i]=new Buffer(""+args[i]);
buf.writeUInt32BE(args[i].length,cursor);
cursor+=4;
args[i].copy(buf,cursor);
cursor+=args[i].length;
}
//console.log("constructing message with len",len,"result:",buf);
return buf;
}
function parseMessage(buf){
var buflen=buf.length;
if(buflen<4)return false;
var len=buf.readUInt32BE(0);
if(buflen<len)return false;
console.log(buf.slice(0,len));
var type=buf.readUInt8(4);
var numargs=buf.readUInt8(5);
var cursor=6;
var args=new Array(numargs),arglen;
for(var i=0;i<numargs;i++){
//console.log("pM: i="+i);
if(cursor+4>len)return {type:null,args:null,len:len};
arglen=buf.readUInt32BE(cursor);
cursor+=4;
//console.log("pM: cursor="+cursor);
if(cursor+arglen>len)return {type:null,args:null,len:len};
args[i]=new Buffer(arglen);
buf.copy(args[i],0,cursor,cursor+arglen);
cursor+=arglen;
}
return {type:type,args:args,len:len};
}
function makeBufferedProtocolHandler(onmessage,obj){
var buffer=new Buffer(0);
return function(data){
if(typeof data=="string")data=new Buffer(data);
//console.log("received",data);
//first append new data to buffer
var tmp=new Buffer(buffer.length+data.length);
if(buffer.length)buffer.copy(tmp);
data.copy(tmp,buffer.length);
buffer=tmp;
//console.log("buffer+data",buffer);
//then while there's a message in there
do {
//try to parse it
var messageBuffer=new Buffer(buffer.length);
buffer.copy(messageBuffer);
var msg=parseMessage(messageBuffer);
if(msg==false)return; //more data needed
//console.log("messageBuffer",messageBuffer);
//console.log("msg.len",msg.len);
//replace buffer with the data that's left
if(buffer.length-msg.len>0){
tmp=new Buffer(buffer.length-msg.len);
buffer.copy(tmp,0,msg.len);
buffer=tmp;
} else {
buffer=new Buffer(0);
}
//console.log("buffer",buffer);
//now all administration is done, we've got ourselves a message
if(msg.type==null)throw new Error("Invalid message received!");
onmessage(msg,obj,messageBuffer);
} while(buffer.length);
};
}
module.exports.constructMessage=constructMessage;
module.exports.parseMessage=parseMessage;
module.exports.makeBufferedProtocolHandler=makeBufferedProtocolHandler;
|
cssx(
@media screen and (min-width: `minWidthForMediaQuery`px) {
`a().reduce(b)` {
`getProperty();`: `a + b / c`%;
}
}
)
|
const fs = require('fs');
const path = require('path');
const EventEmitter = require('events');
const cors = require('cors');
const bodyParser = require('body-parser');
const compression = require('compression');
const cookieParser = require('cookie-parser');
const express = require('express');
const http = require('http');
const https = require('https');
const randomstring = require('randomstring');
const config = require('../config');
const reloadProvider = require('./reloadProviders');
const controllers = require('./controllers');
const socketServer = require('./socketServer');
const purchaseWebservices = require('./lib/purchaseWebservices');
const logger = require('./lib/log');
const bookshelf = require('./lib/bookshelf');
const APIError = require('./errors/APIError');
const sslConfig = require('../scripts/sslConfig');
const { addDevice } = require('../scripts/addDevice');
const log = logger(module);
const LOCK_FILE = path.join(__dirname, '..', 'ready.lock');
const app = express();
app.locals.config = config;
app.locals.models = bookshelf.models;
/**
* Middlewares
*/
app.use(cors({
allowedHeaders: ['content-type', 'Authorization'],
credentials : true,
exposedHeaders: ['device', 'point', 'pointName', 'event', 'eventName'],
origin : true
}));
app.use(bodyParser.json({ limit: '5mb' }));
app.use(cookieParser());
app.use(compression());
/**
* Routes
*/
app.use(controllers);
reloadProvider(app)
.catch(() => {
console.error('No reload provider provided');
process.exit(1);
});
/**
* Error handling
*/
// 404
app.use((req, res, next) => {
next(new APIError(module, 404, 'Not Found'));
});
// Internal error
app.use((err, req, res, next) => { // eslint-disable-line no-unused-vars
let error = err;
/* istanbul ignore next */
if (!(err instanceof APIError)) {
log.error(err, req.details);
error = new APIError(module, 500, 'Unknown error');
} else {
logger(err.module).error(err.message, err.details);
}
res
.status(error.status || 500)
.send(error.toJSON ? error.toJSON() : JSON.stringify(error))
.end();
});
app.start = () => {
const sslFilesPath = {
key : './ssl/certificates/server/server-key.pem',
cert: './ssl/certificates/server/server-crt.pem',
ca : './ssl/certificates/ca/ca-crt.pem'
};
let startingQueue = bookshelf
.waitForDb(2, 15) // 15 retries, one every 2 seconds
.then(() => bookshelf.sync());
/* istanbul ignore if */
if (!fs.existsSync(sslFilesPath.key) ||
!fs.existsSync(sslFilesPath.cert) ||
!fs.existsSync(sslFilesPath.ca)) {
startingQueue = startingQueue
.then(() => {
log.info('No SSL certificates found, generating new ones...');
const result = sslConfig(null, null, true);
log.info(`[ chalPassword ] ${result.chalPassword}`);
log.info(`[ outPassword ] ${result.outPassword}`);
})
.then(() => {
log.info('Seeding database...');
return bookshelf.knex.seed.run();
})
.then(() => {
log.info('Creating admin device...');
const password = process.env.NODE_ENV === 'development' ? 'development' : randomstring.generate();
return addDevice({ admin: true, deviceName: 'admin', password });
})
.then((adminPassword) => {
log.info(`[ admin .p12 password ] ${adminPassword}`);
})
.then(() => {
log.info('Creating manager certificate...');
return addDevice({ admin: true, deviceName: 'manager', password: 'manager' });
});
}
return startingQueue.then(() => {
const server = process.env.SERVER_PROTOCOL === 'http' ? http.createServer(app) : https.createServer({
key : fs.readFileSync(sslFilesPath.key),
cert : fs.readFileSync(sslFilesPath.cert),
ca : fs.readFileSync(sslFilesPath.ca),
requestCert : true,
rejectUnauthorized: false
}, app);
app.locals.modelChanges = new EventEmitter();
app.locals.server = server;
socketServer.ioServer(server, app);
purchaseWebservices(app);
return new Promise((resolve, reject) => {
server.listen(config.http.port, config.http.host, (err) => {
/* istanbul ignore if */
if (err) {
return reject(err);
}
log.info(
'Server is listening %s://%s:%d', process.env.SERVER_PROTOCOL, config.http.host,
config.http.port
);
fs.writeFileSync(LOCK_FILE, '1');
resolve(app);
});
});
});
};
/* istanbul ignore next */
const clearLock = (status) => {
if (status instanceof Error) {
log.error(status);
}
try {
fs.unlinkSync(LOCK_FILE);
} catch (e) {
process.exit(1);
}
process.exit(status || 0);
};
/* istanbul ignore next */
process.on('unhandledRejection', (err) => {
if (err.name === 'ReqlDriverError' &&
err.message === 'None of the pools have an opened connection and failed to open a new one.') {
log.error('Cannot open connection to database');
process.exit(1);
}
});
module.exports = app;
// Start the application
/* istanbul ignore if */
if (require.main === module) {
process.on('exit', clearLock);
process.on('SIGINT', clearLock);
process.on('SIGTERM', clearLock);
process.on('uncaughtException', clearLock);
process.on('unhandledRejection', clearLock);
app
.start()
.catch((err) => {
log.error('Start error: %s', err);
});
}
|
Template.orderListItem.helpers({
//statusName: function(status) {
// var names = {
// ongoing: '进行',
// finished: '完成',
// canceled: '终止'
// };
// return names[status] || '未知';
//},
statusColor: function () {
var colors = {
'进行': 'bg-primary',
'完成': 'bg-success',
'终止': 'bg-warning'
};
return colors[this.status] || 'bg-danger';
},
customerName: function () {
var customer = Customers.findOne(this.customer);
if (customer && customer.name) {
return customer.name;
}
return this.customer;
},
stationName: function () {
var station = Stations.findOne(this.stationId);
return station && station.name;
}
});
Template.addOrder.helpers({
hasError: function (field) {
return !!Session.get('orderManagementSubmitErrors')[field] ?
'has-error' : '';
}
});
Template.orderManagement.onCreated(function () {
Session.set('orderManagementSubmitErrors', {});
});
Template.orderManagement.onRendered(function () {
var key = this.data.filterKey;
//console.log('key: ' + key);
this.$('.order-keyword').val(key);
var target = $('#add-order');
target.hide();
});
Template.orderManagement.events({
'keypress .order-keyword': function (e) {
// 绑定回车键
if (e.keyCode == '13') {
e.preventDefault();
var keyword = $('.order-keyword').val();
keyword = keyword ? '?keyword=' + keyword : '';
//console.log('keyword: ' + keyword);
//alert('contents: ' + $('.order-keyword').val());
Router.go(location.pathname + keyword);
}
},
'click .filter-order': function (e) {
e.preventDefault();
var keyword = $('.order-keyword').val();
keyword = keyword ? '?keyword=' + keyword : '';
Router.go(location.pathname + keyword);
},
'click .condition .today': function(e) {
e.preventDefault();
e.stopPropagation();
setPeriod('today');
},
'click .condition .yesterday': function(e) {
e.preventDefault();
e.stopPropagation();
setPeriod('yesterday');
},
'click .condition .month': function(e) {
e.preventDefault();
e.stopPropagation();
setPeriod('month');
},
'click .condition .pre-month': function(e) {
e.preventDefault();
e.stopPropagation();
setPeriod('pre-month');
},
'click .condition .30days': function(e) {
e.preventDefault();
e.stopPropagation();
setPeriod('30days');
},
'click .condition .year': function(e) {
e.preventDefault();
e.stopPropagation();
setPeriod('year');
},
'click .edit-order': function (e) {
e.preventDefault();
// 清空可能遗留的错误信息
Session.set('orderManagementSubmitErrors', {});
var target = $('#add-order');
// 如果设置了覆盖标识(overlap)则清空,否则只是简单的显示/隐藏切换编辑框
//if (target.find('[name=overlap]').val()) {
// target.find('[name=overlap]').val('');
//} else {
if (target.hasClass('hidden')) {
target.removeClass('hidden');
target.slideDown('fast');
} else {
target.slideUp('fast', function () {
clearForm(target);
target.addClass('hidden');
});
}
//}
},
'click .update-order': function (e) {
e.preventDefault();
// 清空可能遗留的错误信息
Session.set('orderManagementSubmitErrors', {});
// 获取对应数据库条目Id
var _id = $(e.currentTarget).attr('href');
//console.log('_id: ' + _id);
var form = $('#add-order');
// 显示编辑框
if (form.hasClass('hidden')) {
form.removeClass('hidden');
form.slideDown('fast');
}
fillForm(_id);
},
'submit .add-order': function (e) {
e.preventDefault();
var form = $(e.target);
var order = {
code: form.find('[name=code]').val(),
type: form.find('[name=type]').val(),
customer: form.find('[name=customerNameOrId]').val(),
phone: form.find('[name=phone]').val(),
address: form.find('[name=address]').val(),
stationId: form.find('[name=stationId]').val(),
comment: form.find('[name=comment]').val()
};
// 如果表单中的客户名称和data-customer-id对应的客户名称相同则保存id值
console.log('customer: ' + JSON.stringify(order.customer));
var customerId = form.find('[name=customerNameOrId]').data('customerId');
var customer = Customers.findOne(customerId);
console.log('customerId: ' + customerId);
if (customer && customer.name == order.customer) {
order.customer = customerId;
}
var userId = Meteor.userId();
order = _.extend(order, {
status: '进行', deadline: 0, managerId: userId, disposal: {}
});
//console.log('order: ' + JSON.stringify(order));
//var overlap = form.find('[name=overlap]').val();
//console.log('overlap is: ' + overlap);
//var data = {order: order, overlap: overlap};
var errors = validateOrderBase(order);
if (errors.err) {
Session.set('orderManagementSubmitErrors', errors);
throwError(getErrorMessage(errors));
return;
}
Meteor.call('orderInsert', order, function (err) {
if (err) {
return throwError(err.reason);
}
// 清除可能遗留的错误信息
Session.set('orderManagementSubmitErrors', {});
var form = $('#add-order');
// 清除表单的内容
clearForm(form);
form.slideUp('fast', function () {
form.addClass('hidden');
});
});
}
});
function setPeriod(span) {
$('.order-keyword').val('');
if (!span) {
Router.go(location.pathname);
return;
}
var period = '?period=' + span;
Router.go(location.pathname + period);
}
function clearForm(target) {
var form = $(target);
form.find('[name=code]').val('');
form.find('[name=type]').val('');
form.find('[name=customerNameOrId]').val('');
form.find('[name=phone]').val('');
form.find('[name=address]').val('');
form.find('[name=stationId]').val(defaultStationId());
form.find('[name=comment]').val('');
// 清空隐藏文本框中保存的数据库条目Id,即清空覆盖标识
form.find('[name=overlap]').val('');
}
function fillForm(_id) {
var data = Orders.findOne(_id);
//console.log('data: ' + JSON.stringify(data));
var form = $('#add-order');
form.find('[name=code]').val(data.code);
form.find('[name=type]').val(data.type);
form.find('[name=customerNameOrId]').val(data.customer);
form.find('[name=phone]').val(data.phone);
form.find('[name=address]').val(data.address);
form.find('[name=stationId]').val(data.stationId);
form.find('[name=comment]').val(data.comment);
// 将id保存到隐藏的文本框,表示本次操作会强行覆盖对应的数据库条目
form.find('[name=overlap]').val(_id);
}
|
import React from "react";
import { shallow } from "enzyme";
import TableRow from "./TableRow";
describe("TableRow", () => {
it("matches snapshot", () => {
const aTableRow = shallow(<TableRow />);
expect(aTableRow).toMatchSnapshot();
});
});
|
//Get /question
exports.question = function (req, res, next) {
var answer = req.query.answer || '';
res.render('quizzes/question', {question: "Capital de Italia", answer: answer});
};
//GET /check
exports.check = function(req,res, next) {
var answer = req.query.answer || '';
var result = ((answer === 'Roma') ? 'Correcta' : 'Incorrecta');
res.render('quizzes/result', {result: result, answer: answer});
};
//GET /author
exports.author = function(req, res, next) {
res.render('author');
};
|
import * as util from "./util";
const path = require("path");
/**
* Creates a toc object
* @param {Array} items All items of the toc
* @param {Array} root Only the root items
* @return {Object} Toc object
*/
const createToc = function (items, root) {
if (items == null) items = [];
if (root == null) root = [];
return {
items,
root,
};
};
const findByPath = util.findBy("path");
export const createTocFromFolderP = function (pathParam, toc, rootPath) {
if (toc == null) toc = createToc();
if (rootPath == null) rootPath = pathParam;
return util.readdirP(pathParam).then((files) => {
var localItemIds = [];
var prom = Promise.resolve();
files.forEach((f) => {
var fullPath = path.join(pathParam, f);
prom = prom
.then(() => {
return util.lstatP(fullPath);
})
.then((stats) => {
var id =
toc.items.push({
ext: path.extname(f),
isDir: stats.isDirectory(),
absolutePath: fullPath,
path: fullPath.replace(rootPath + path.sep, ""),
name: f,
}) - 1;
localItemIds.push(id);
if (toc.items[id].isDir) {
return createTocFromFolderP(fullPath, toc, rootPath).then(
(newToc) => {
toc = newToc;
toc.items[id].children = toc.root;
toc.root = [];
}
);
}
});
});
prom = prom.then(() => {
toc.root = localItemIds;
return toc;
});
return prom;
});
};
export const mergeTocConfigWithToc = function (toc, tocConfig) {
var newToc = createToc();
var addChildren = function (children) {
var ids = [];
children.forEach(function (childId) {
var childItem = toc.items[childId];
var id = newToc.items.push(childItem) - 1;
ids.push(id);
if (childItem.children != null) {
childItem.children = addChildren(childItem.children);
}
});
return ids;
};
var mergeItems = function (items, basePath) {
if (basePath == null) basePath = "";
var localItemIds = [];
items.forEach((tocItem) => {
var item = {};
if (tocItem.path != null) {
tocItem.path = path.join(basePath, tocItem.path);
var origId = findByPath(toc.items, tocItem.path);
if (origId !== false) {
item = toc.items[origId];
}
}
item.href = tocItem.href;
if (tocItem.title != null) {
item.title = tocItem.title;
}
var id = newToc.items.push(item) - 1;
if (tocItem.children != null) {
newToc.items[id].children = mergeItems(tocItem.children, tocItem.path);
newToc.items[id].isDir = true;
} else if (item.children != null) {
newToc.items[id].children = addChildren(item.children);
}
localItemIds.push(id);
});
return localItemIds;
};
newToc.root = mergeItems(tocConfig);
return newToc;
};
export const calculateItemLevels = function (toc, items, level) {
if (level == null) level = 0;
if (items == null) items = toc.root;
items.forEach(function (itemId) {
let item = toc.items[itemId];
item.level = level;
if (item.children != null) {
calculateItemLevels(toc, item.children, level + 1);
}
});
return toc;
};
export const getHtmlChapters = function (html) {
const chapters = {
root: [],
items: [],
};
const headingRegexStr =
'<h(\\d*)(?: id="(.*?)")?.*?>([\\s\\S]*?)<\\/h\\1(?: .*?)?>';
const headingGlobalRegex = new RegExp(headingRegexStr, "g");
const headingRegex = new RegExp(headingRegexStr);
const htmlTagsRegex = /<(?:.|\n)*?>/gm;
let matches = html.match(headingGlobalRegex);
if (matches != null && matches.length > 0) {
matches = matches.map(function (match) {
const subMatches = match.match(headingRegex);
const hash = subMatches[2];
const heading = subMatches[3].replace(htmlTagsRegex, "");
return { level: subMatches[1], heading: heading, hash };
});
const pushHeadingsRecursive = function (matches) {
var head = matches[0];
var tail = matches.slice(1);
var rest = [];
var broken = false;
var children = [];
tail.forEach(function (item) {
if (item.level === head.level) {
rest.push(item);
broken = true;
} else if (broken === false && head.level < item.level) {
children.push(item);
} else {
rest.push(item);
}
});
if (children.length > 0) {
children = pushHeadingsRecursive(children);
}
head.children = children;
if (rest.length > 0) {
rest = pushHeadingsRecursive(rest);
}
return [head, ...rest];
};
const recursiveHeadings = pushHeadingsRecursive(matches);
const normalizeRecursive = function (items) {
return items.map(function (chapter) {
const idx = chapters.items.push(chapter) - 1;
chapter.id = idx;
chapter.children = normalizeRecursive(chapter.children);
return idx;
});
};
chapters.root = normalizeRecursive(recursiveHeadings);
}
return chapters;
};
|
/* eslint no-console:0 */
var Hapi = require('hapi'),
Path = require('path'),
Swig = require('swig'),
Routes = require('./routes');
Swig.setDefaults({ cache: false });
var server = new Hapi.Server();
server.connection({ port: 3000 });
server.views({
engines: { swig: Swig },
path: Path.join(__dirname, 'views')
});
server.route({ method: 'GET', path: '/', handler: Routes.index });
server.route({ method: 'GET', path: '/action', handler: Routes.action });
server.route({ method: 'GET', path: '/responsive', handler: Routes.responsive});
server.route({ method: 'GET', path: '/form', handler: Routes.form });
server.route({ method: 'GET', path: '/keys', handler: Routes.keys });
server.route({ method: 'GET', path: '/angular', handler: Routes.angular });
server.route({ method: 'GET', path: '/pace', handler: Routes.pace });
server.route({ method: 'GET', path: '/pace-theme-center-simple.css', handler: function (request, reply) { reply.file(Path.join(__dirname, 'pace-theme-center-simple.css')); } });
server.route({ method: 'GET', path: '/pace.js', handler: function (request, reply) { reply.file(Path.join(__dirname, 'pace.js')); } });
server.route({ method: 'GET', path: '/angular/data', handler: Routes.angularData});
server.route({ method: 'POST', path: '/result', handler: Routes.result });
server.route({ method: 'GET', path: '/post/{id}', handler: Routes.post });
server.route({ method: 'GET', path: '/generate/{number}', handler: Routes.generate });
server.route({ method: 'GET', path: '/delay/{number}', handler: Routes.delay });
server.start(function () {
console.log('Server running at:', server.info.uri);
});
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Jesse Ruderman
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
//-----------------------------------------------------------------------------
var BUGNUMBER = 452476;
var summary = 'Do not assert with JIT: !cx->runningJittedCode';
var actual = 'No Crash';
var expect = 'No Crash';
printBugNumber(BUGNUMBER);
printStatus (summary);
jit(true);
for (var j = 0; j < 10; j++)
{
for (var i = 0; i < j; ++i)
this["n" + i] = 1;
__defineGetter__('w', (function(){}));
[1 for each (g in this) for each (t in /x/g)];
}
jit(false);
reportCompare(expect, actual, summary);
|
var crime = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.921416,54.579826 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.9332,54.596372 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wellington Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.921416,54.579826 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.003543,54.577768 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Tullagh Park",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933651,54.595113 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92591,54.598233 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Victoria Square",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934945,54.592484 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.00513,54.549734 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Auburn Place",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.976456,54.595324 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92635,54.607549 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Molyneaux Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.940413,54.620548 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Richmond Square",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.919789,54.606583 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Clarendon Road",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.937253,54.587231 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.94568,54.618957 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Linden Gardens",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.922639,54.597431 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.915548,54.568134 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Acorn Hill",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.913961,54.572564 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rosetta Park",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932404,54.586753 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Botanic Avenue",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935911,54.596328 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Murray Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.926802,54.598958 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ann Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.927313,54.599865 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near High Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.88166,54.60522 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wellwood Avenue",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.931149,54.595941 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Donegall Square West",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928374,54.601518 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Donegall Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.884378,54.602357 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Park Avenue",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929684,54.602853 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Academy Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932781,54.587541 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Botanic Avenue",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933066,54.591086 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dublin Road",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.944067,54.582477 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cussick Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92635,54.607549 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Molyneaux Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.931955,54.603844 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Union Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930149,54.591854 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Maryville Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930154,54.597254 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Donegall Square North",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.914895,54.573343 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Bell Tower",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929306,54.600232 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rosemary Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933461,54.593357 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hope Street",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.9333,54.597155 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wellington Place",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.941305,54.614219 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cliftonpark Court",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977077,54.572503 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Stockmans Way",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977077,54.572503 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Stockmans Way",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.923358,54.600947 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Queens Square",
"Crime type":"Bicycle theft"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.955547,54.595727 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.958293,54.672828 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glenbourne Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.937466,54.627065 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fortwilliam Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.021209,54.573898 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Suffolk Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92889,54.586181 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near University Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935537,54.64069 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Downview Manor",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933119,54.58088 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Pretoria Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.819791,54.640889 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Woodlands",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932543,54.587061 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Botanic Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.905306,54.590222 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Jocelyn Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.938416,54.630954 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Antrim Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977372,54.524088 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Drumbeg Mews",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934431,54.627364 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Somerton Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.942624,54.625203 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rigby Close",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.938347,54.61425 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cliftonville Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.021313,54.56664 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hazelwood Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.884634,54.601004 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Parkgate Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936724,54.623683 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glandore Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.948269,54.581974 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Edinburgh Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924978,54.62811 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fortwilliam Crescent",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930305,54.598533 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Donegall Place",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935533,54.625191 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Skegoneill Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.963412,54.61392 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Brompton Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.939583,54.623804 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kansas Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.943389,54.583966 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lisburn Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.913844,54.671936 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Friars Wood",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932993,54.63831 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Innisfayle Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932536,54.603072 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Union Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.926512,54.597057 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Montgomery Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.913332,54.563684 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.953796,54.622608 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Deanby Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.951541,54.621869 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cardigan Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.949134,54.616769 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Oldpark Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.820225,54.612809 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.926983,54.584136 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Jerusalem Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93091,54.587824 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wolseley Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.023339,54.567275 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Pembroke Manor",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.94876,54.579592 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Derryvolgie Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.925874,54.670426 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunanney",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.002459,54.705066 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ballycraigy Road North",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.036951,54.687067 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lylehill Road East",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.960259,54.572652 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lislea Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93116,54.571924 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Laganvale Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.990838,54.562831 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ashton Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.909178,54.582311 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Broughton Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.910356,54.571082 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rosetta Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.986358,54.560547 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Orpen Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977794,54.523987 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Drumbeg Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928467,54.638673 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Downview Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.986358,54.560547 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Orpen Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.034855,54.552899 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lagmore Meadows",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.950814,54.561477 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Piney Hills",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.988477,54.58344 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Gransha Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924398,54.584469 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Agincourt Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.89073,54.67849 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.901266,54.599892 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Finmore Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.908908,54.661195 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Doagh Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924715,54.585229 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near The Cloisters",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.946341,54.568032 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.960765,54.611755 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Bray Close",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.927918,54.628771 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunlambert Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.923238,54.596012 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924402,54.627866 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fortwilliam Crescent",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.982679,54.586209 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Norfolk Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.95909,54.607476 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Enfield Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.925134,54.584598 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rugby Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.893962,54.591796 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Foxglove Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.02177,54.557528 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glasvey Crescent",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.98195,54.610951 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Westway Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.951786,54.588655 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.970205,54.590026 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rockville Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977018,54.597409 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Springfield Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.938485,54.618871 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Antrim Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.979208,54.609431 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lyndhurst Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.927652,54.584057 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Palestine Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.020586,54.565685 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hazelwood Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.945534,54.613258 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Manor Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.97034,54.62028 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wheatfield Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929138,54.634012 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lansdowne Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924101,54.577527 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Haywood Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933869,54.622269 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ashfield Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930703,54.587335 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wolseley Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92468,54.616631 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Castleton Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928591,54.584756 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Carmel Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.951297,54.583588 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.897223,54.575356 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.98048,54.563432 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Upper Lisburn Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930074,54.635107 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Bristol Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934815,54.625304 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Somerton Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.908498,54.589226 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near London Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.926474,54.592618 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Joy Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.862614,54.593564 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Knockhill Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92249,54.577571 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fernwood Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.927712,54.553015 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.813983,54.649518 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Orchard Way",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930703,54.587335 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wolseley Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.940372,54.5852 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Elmwood Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.885914,54.590936 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.947632,54.633375 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Upper Cavehill Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.894489,54.598364 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Newtownards Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.868965,54.595203 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Upper Newtownards Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.900185,54.583008 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Willowholme Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936543,54.628793 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fortwilliam Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930443,54.586675 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wolseley Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.953211,54.577502 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Brookland Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.993776,54.678884 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Trench Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.922721,54.57851 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ava Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.945861,54.582795 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Tates Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.867581,54.605413 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.015857,54.55735 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Credenhill Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932635,54.591645 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ventry Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.923238,54.585967 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ormeau Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.897098,54.590979 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Clara Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930906,54.591274 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ashburne Mews",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92881,54.585317 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Carmel Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924895,54.638558 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.013086,54.557116 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Credenhill Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.990649,54.589594 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Monagh Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.018005,54.560243 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Corrina Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.89912,54.585677 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.990459,54.596905 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near New Barnsley Crescent",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.931537,54.619093 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Alexandra Park Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.90149,54.588611 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.900596,54.686209 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lynda Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.922247,54.574135 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ailesbury Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.023872,54.555613 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glasvey Walk",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.937336,54.612202 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.983691,54.585768 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Norfolk Parade",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.811046,54.597224 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.873832,54.5998 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.978968,54.602087 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Highfern Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.956972,54.565103 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Shrewsbury Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.94338,54.581064 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.015609,54.559593 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Corrina Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929357,54.552567 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977268,54.597988 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunboyne Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.96465,54.563067 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Bristow Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.925189,54.583206 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977268,54.597988 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunboyne Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932289,54.623805 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Queen Victoria Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.923238,54.596012 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.949097,54.583668 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.940606,54.60294 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Boundary Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.961088,54.559458 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Bristow Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.902627,54.598101 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.961001,54.604544 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Caledon Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.938649,54.621452 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Willowbank Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.851909,54.620537 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Richmond Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.909378,54.581721 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Broughton Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.889414,54.571437 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cregagh Park East",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.903877,54.5545 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Burnside Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.964697,54.676216 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rose Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.923758,54.574233 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.94748,54.632402 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cavehill Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.954585,54.576016 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lisburn Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.931196,54.594091 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Clarence Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.904914,54.582497 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Pirrie Park Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.944767,54.583325 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ashley Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.939027,54.62622 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kenbella Parade",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.983394,54.626204 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.955547,54.595727 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.940621,54.627452 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Chichester Park South",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.940605,54.600811 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fingals Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.049108,54.556427 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Mount Eagles Crescent",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.964411,54.579955 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Boucher Place",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.971792,54.591104 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.905016,54.547655 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Saintfield Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.902186,54.556717 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Colby Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.938882,54.659992 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Whitewell Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.951854,54.574029 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Marlborough Park South",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.902186,54.556717 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Colby Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93423,54.63409 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Somerton Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.911626,54.571041 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rosetta Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934828,54.628099 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fortwilliam Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.956158,54.568693 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Maryville Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.937879,54.577583 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.860149,54.586278 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Knock Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.960674,54.679149 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Burnthill Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.029332,54.558424 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Woodside Walk",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.947817,54.584509 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.983574,54.667915 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Mayfield Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.907931,54.5505 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Saintfield Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934968,54.599367 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934003,54.614427 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Syringa Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.885828,54.598563 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cheviot Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.964814,54.593889 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930747,54.602952 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Royal Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.979367,54.555605 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Benmore Walk",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.984865,54.563244 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Diamond Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.85374,54.584305 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Shandon Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.85374,54.584305 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Shandon Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.939684,54.61323 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Brucevale Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.861436,54.578259 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ravenswood Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.030117,54.554008 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Altan Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.89866,54.593099 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Trillick Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.018446,54.56326 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Upper Dunmurry Lane",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.919916,54.682355 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cherrylands",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.851884,54.587237 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wynard Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.024072,54.55788 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glasvey Close",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92587,54.5832 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Agincourt Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.978145,54.596853 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Sliabh Dubh View",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.84326,54.589995 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Gortin Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924922,54.583283 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.901266,54.599892 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Finmore Court",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.941847,54.582332 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.941255,54.57322 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cleaver Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.939583,54.623804 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kansas Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.955848,54.572425 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cranmore Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.884668,54.592586 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929349,54.60822 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Mccleery Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.871808,54.598255 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Earlswood Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.98006,54.665332 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Mayfield Village",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.904654,54.594192 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near The Mount",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.945273,54.578796 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Derryvolgie Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.032761,54.552397 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lagmore Meadows",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93075,54.60014 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Berry Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.869627,54.60208 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Edgcumbe Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.874522,54.695494 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Gortlane Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.898585,54.597851 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Montrose Walk",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.801218,54.593802 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Burton Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.922347,54.577353 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.9485,54.617387 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Oldpark Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.964814,54.593889 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924518,54.583626 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Penrose Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.964381,54.588302 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930747,54.602952 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Royal Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.943393,54.62563 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cavehill Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.962651,54.590726 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fallswater Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93533,54.548176 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Minnowburn Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936066,54.627805 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fortwilliam Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.925134,54.584598 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rugby Avenue",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.920189,54.544404 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Purdysburn Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.9332,54.596372 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wellington Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.982295,54.598351 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Moyard Park",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.927095,54.60262 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hill Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.961696,54.616353 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929548,54.58754 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lawrence Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.868892,54.601636 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Edgcumbe Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.911571,54.605066 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Queens Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.978278,54.667809 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Mayfield Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934686,54.59637 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Murray Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.906516,54.684784 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hollybank Way",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.943389,54.583966 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lisburn Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934834,54.614235 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hallidays Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.975774,54.543891 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.952969,54.577714 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.937263,54.619155 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Castleton Gardens",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.974456,54.664564 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hollybrook Manor",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.955031,54.577605 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rathcool Street",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.836559,54.58301 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.860149,54.586278 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Knock Road",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.903647,54.591802 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.888088,54.526793 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Burnview Drive",
"Crime type":"Burglary"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.947648,54.59863 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ross Street",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.036521,54.565172 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933559,54.594177 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.964788,54.613646 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Crumlin Road",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.925288,54.602256 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunbar Street",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936644,54.59192 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Sandy Row",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.938064,54.626878 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Antrim Road",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933906,54.599241 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near College Court",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929328,54.598579 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Castle Lane",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933906,54.599241 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near College Court",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933906,54.599241 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near College Court",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.879861,54.59933 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dundela Drive",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.951174,54.684577 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Carnvue Road",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.897717,54.58107 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Haddington Gardens",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.948986,54.56371 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Newforge Grange",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928221,54.608794 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Earl Close",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.917032,54.59693 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Mays Meadow",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.991581,54.573176 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Andersonstown Road",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928221,54.608794 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Earl Close",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.960765,54.611755 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Bray Close",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928221,54.608794 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Earl Close",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92881,54.585317 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Carmel Street",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.955547,54.595727 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.945368,54.583066 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932232,54.611207 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near New Lodge Road",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.946673,54.586026 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunluce Avenue",
"Crime type":"Robbery"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.943917,54.633959 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Merryfield Drive",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.987968,54.571185 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Riverdale Gardens",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.927755,54.613692 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glenrosa Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.819791,54.640889 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Woodlands",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.944929,54.631083 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ophir Gardens",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.967521,54.618445 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ardoyne Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.978876,54.558355 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.952378,54.60491 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Edwina Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933779,54.603588 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.988721,54.677632 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cloughmore Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.980405,54.585569 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Divis Drive",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936572,54.608029 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Annesley Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935929,54.610633 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kinnaird Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936452,54.587146 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.947112,54.597902 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Roumania Rise",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928538,54.595555 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.912672,54.579011 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ravenhill Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930157,54.594127 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Clarence Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930157,54.594127 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Clarence Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.945343,54.598007 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Albert Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.901849,54.589165 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Willowfield Parade",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.945343,54.598007 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Albert Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.921379,54.623376 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near St. Aubyn Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.986013,54.533685 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ballyskeagh Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.955366,54.59594 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Springfield Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.939027,54.62622 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kenbella Parade",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.939027,54.62622 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kenbella Parade",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.92567,54.616639 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near North Queen Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93895,54.598042 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Galway Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.029587,54.558923 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Woodside View",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932499,54.598004 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near College Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932958,54.621912 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ashfield Gardens",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.983375,54.574927 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Andersonstown Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.958365,54.580527 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wildflower Way",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.029035,54.560432 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glenwood Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935911,54.596328 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Murray Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933559,54.594177 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.981361,54.608784 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lyndhurst Way",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.90357,54.58968 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Willowfield Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.911582,54.584302 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ravenhill Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933461,54.593357 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hope Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.868604,54.572204 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Grey Castle Manor",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.979746,54.582944 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glen Parade",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.979208,54.609431 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lyndhurst Drive",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.902171,54.582001 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ardenlee Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.927349,54.592462 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ormeau Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.977268,54.597988 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunboyne Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.989392,54.592503 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Norglen Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.867913,54.599947 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Clonallon Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934968,54.599367 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936677,54.593421 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Sandy Row",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934968,54.599367 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.905009,54.677022 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Fernagh Parade",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.880215,54.600262 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Holywood Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936878,54.611152 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kinnaird Terrace",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934968,54.599367 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.888249,54.576313 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Stirling Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.89381,54.591137 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Grove Street East",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.955547,54.595727 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.943605,54.583054 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wellington Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.915195,54.658886 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ardgart Place",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.94628,54.610117 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Shannon Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.973843,54.61741 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Abbeydale Gardens",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928966,54.58346 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rugby Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.911138,54.656094 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Merville Garden Village",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.9512,54.613866 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Antigua Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.973531,54.623065 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Tedburn Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.973531,54.623065 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Tedburn Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.975737,54.619796 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Abbeydale Parade",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.942369,54.582709 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wellington Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934898,54.591881 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928653,54.601811 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Donegall Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.928735,54.609953 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hardinge Place",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.022716,54.56545 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935911,54.596328 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Murray Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.966682,54.617263 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.931465,54.585731 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.940995,54.580206 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Malone Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.031369,54.54312 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Derriaghy Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.942684,54.616965 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Orient Gardens",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.898526,54.592396 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Beersbridge Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.957205,54.611425 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Leopold Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -6.030852,54.551279 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lagmore Drive",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.949153,54.598548 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.968221,54.688234 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Sentry Hill Drive",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.891862,54.551577 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Briar Hill",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.945343,54.598007 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Albert Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935466,54.634156 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lansdowne Mews",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936644,54.59192 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Sandy Row",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.935911,54.596328 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Murray Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.904702,54.58421 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Chesham Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.924252,54.579722 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Candahar Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.960516,54.676424 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933992,54.611588 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Hartwell Place",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.930563,54.594988 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Franklin Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.923364,54.581369 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936322,54.613586 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.843072,54.640641 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Kinnegar Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.943065,54.633648 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Old Cavehill Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.936427,54.59835 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near College Place North",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.942657,54.624872 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Indiana Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.816774,54.648624 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Old Cultra Lane",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.917677,54.694572 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.891737,54.598019 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Connswater Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.9485,54.617387 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Oldpark Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.908939,54.657278 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Merville Mews",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.85168,54.616965 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Knocknagoney Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.920026,54.578275 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Blackwood Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.942436,54.622181 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cavehill Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.963162,54.594121 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ardnaclowney Drive",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.915933,54.662322 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Rathcoole Drive",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.932244,54.591126 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Salisbury Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.910344,54.568898 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Knockbreda Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.942436,54.622181 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cavehill Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.911571,54.605066 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Queens Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93091,54.587824 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wolseley Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.946507,54.613607 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Southport Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.934633,54.597106 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near College Square East",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.893291,54.556832 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Windrush Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.947277,54.585084 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ulsterville Gardens",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.958833,54.585719 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Glenmachan Pl Roundabout",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.93091,54.587824 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Wolseley Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.899176,54.592093 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Castlereagh Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.910282,54.586112 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Ravenhill Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.958659,54.625062 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Marmount Gardens",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929421,54.590341 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929041,54.594171 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.951776,54.619968 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cliftonville Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.91058,54.624394 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933906,54.599241 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near College Court",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.978149,54.561155 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Locksley Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.923238,54.596012 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.889215,54.600105 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lewis Park",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.926248,54.599505 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Pottingers Entry",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.9554,54.606372 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dewey Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.929041,54.594171 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.933066,54.591086 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dublin Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.898907,54.572375 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near The Straight",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.957335,54.62397 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Dunblane Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.950679,54.581413 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Lower Windsor Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.946151,54.585325 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.981031,54.593253 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Whitecliff Crescent",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.887872,54.597934 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Westminister Avenue",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.926474,54.592618 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Joy Street",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.938347,54.61425 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near Cliftonville Road",
"Crime type":"Vehicle crime"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [ -5.976532,54.576008 ]
},
"properties": {
"Month":"2016-08",
"Location":"On or near ",
"Crime type":"Vehicle crime"
}
}
]
};
|
/*
Copyright (c) 2012. Adobe Systems Incorporated.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
(function(a,b){function c(){}var d={version:0.1,inherit:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.prototype._super=b},ensureArray:function(){var b=[],c=arguments.length;c>0&&(b=c>1||!a.isArray(arguments[0])?a.makeArray(arguments):arguments[0]);return b},scopedFind:function(b,c,d,h){for(var d=" "+d+" ",l=[],b=a(b).find(c),c=b.length,h=a(h)[0],j=0;j<c;j++)for(var i=b[j],n=i;n;){if(n.className&&(" "+n.className+" ").indexOf(d)!==-1){n===h&&
l.push(i);break}n=n.parentNode}return a(l)}};a.extend(c.prototype,{bind:function(b,c,d){return a(this).bind(b,c,d)},unbind:function(b,c){return a(this).unbind(b,c)},trigger:function(b,c){var d=a.Event(b);a(this).trigger(d,c);return d}});d.EventDispatcher=c;b.WebPro=d})(jQuery,window,document);
(function(a,b){var c=1;b.ImageLoader=function(c){b.EventDispatcher.call();var f=this;this.options=a.extend({},this.defaultOptions,c);this._currentEntry=null;this._queue=[];this._isRunning=this._needsSort=!1;this._loader=new Image;this._loadFunc=function(){f._handleLoad()};this._loadErrorFunc=function(){f._handleError()};this._timeoutFunc=function(){f.trigger("wp-image-loader-timeout",this._currentEntry);f._loadNext()}};b.inherit(b.ImageLoader,b.EventDispatcher);a.extend(b.ImageLoader.prototype,{defaultOptions:{timeoutInterval:1E3},
add:function(d,f){if(d){urls=b.ensureArray(d);for(var g=0;g<urls.length;g++){var k=a.extend({reqId:c++,src:urls[g],width:0,height:0,priority:50,callback:null,data:null},f);this._queue.push(k);this._needsSort=!0;this.trigger("wp-image-loader-add",k)}this._isRunning&&!this._currentEntry&&this._loadNext()}},reprioritize:function(a,b){if(!(this._currentEntry&&this._currentEntry.src==a)){var c;for(c=0;c<this._queue.length;++c)if(this._queue[c].src==a)break;if(c!=0&&c<this._queue.length)this._queue=this._queue.splice(c,
b?this._queue.length-c:1).concat(this._queue)}},start:function(){if(!this._isRunning)this._isRunning=!0,this._loadNext(),this.trigger("wp-image-loader-start")},stop:function(){if(this._isRunning)this._currentEntry&&this._queue.unshift(this._currentEntry),this._resetLoader(),this._isRunning=!1,this.trigger("wp-image-loader-stop")},clearQueue:function(){var a=this._isRunning;this.stop();this._queue.length=0;a&&this.start()},isQueueEmpty:function(){return this._queue.length==0},_loadNext:function(){var d;
this._resetLoader();var a=this._queue;if(a.length){if(this._needsSort)d=this._queue=a.sort(function(a,b){var c=a.priority-b.priority;return c?c:a.reqId-b.reqId}),a=d,this._needsSort=!1;this._currentEntry=a=a.shift();var b=this._loader;b.onload=this._loadFunc;b.onerror=this._loadErrorFunc;b.src=a.src}},_resetLoader:function(){var a=this._loader;a.onload=null;a.onerror=null;this._currentEntry=a.src=null;if(this._timeoutTimerId)clearTimeout(this._timeoutTimerId),this._timeoutTimerId=0},_handleLoad:function(){var a=
this._loader,b=this._currentEntry;b.width=a.width;b.height=a.height;b.callback&&b.callback(b.src,b.width,b.height,b.data);this.trigger("wp-image-loader-load-success",b);this._loadNext()},_handleError:function(){this.trigger("wp-image-loader-load-error",this._currentEntry);this._loadNext()}})})(jQuery,WebPro,window,document);
(function(a,b){function c(){b.EventDispatcher.call(this);this._initialize.apply(this,arguments)}b.inherit(c,b.EventDispatcher);a.extend(c.prototype,{defaultOptions:{},_widgetName:"Widget",_initialize:function(){var b;this.plugins=[];var c=this.trigger("before-setup");c.isDefaultPrevented()||(b=this._setUp.apply(this,arguments),this.trigger("setup"));c=this.trigger("before-init-plugins");c.isDefaultPrevented()||(this._initializePlugins(b),this.trigger("init-plugins"));this.options=a.extend({},this.defaultOptions,
b);c=this.trigger("before-extract-data");c.isDefaultPrevented()||(this._extractData(),this.trigger("extract-data"));c=this.trigger("before-transform-markup");c.isDefaultPrevented()||(this._transformMarkup(),this.trigger("transform-markup"));c=this.trigger("before-attach-behavior");c.isDefaultPrevented()||(this._attachBehavior(),this.trigger("attach-behavior"));c=this.trigger("before-ready");c.isDefaultPrevented()||(this._ready(),this.trigger("ready"))},_setUp:function(b,c){this.$element=a(b);return c},
_initializePlugins:function(a){for(var a=a||{},b=((typeof a.useDefaultPlugins==="undefined"||a.useDefaultPlugins)&&this.defaultPlugins?this.defaultPlugins:[]).concat(a.plugins||[]),b=b.sort(function(a,b){a=typeof a.priority==="number"?a.priority:50;b=typeof b.priority==="number"?b.priority:50;return a-b}),c=0;c<b.length;c++){var k=b[c];k&&k.initialize&&k.initialize(this,a)}this.plugins=b},_extractData:function(){},_transformMarkup:function(){},_attachBehavior:function(){},_ready:function(){}});b.Widget=
c;b.widget=function(c,f,g){var k=g&&f||b.Widget,g=g||f||{},f=function(){k.apply(this,arguments);this._widgetName=c};b.inherit(f,k);a.extend(f.prototype,g);f.prototype.defaultOptions=a.extend({},k.prototype.defaultOptions,g.defaultOptions);var g=c.split("."),h=g.length;namespace=h>1&&g[0]||"Widget";c=g[h-1];b[namespace][c]=f}})(jQuery,WebPro,window,document);
(function(a,b){b.widget("Widget.Button",b.Widget,{defaultOptions:{hoverClass:"wp-button-hover",activeClass:"wp-button-down",disabledClass:"wp-button-disabled",disabled:!1,callback:null},_attachBehavior:function(){var b=this,d=function(f){b.$element.removeClass(b.options.activeClass);!b.options.disabled&&b.options.callback&&b.mouseDown&&b.options.callback.call(this,f);a(b.$element).off("mouseup pointerup",d);b.mouseDown=!1};this.mouseDown=!1;this.$element.on("mouseover",function(){b.options.disabled||
b.$element.addClass(b.options.hoverClass+(b.mouseDown?" "+b.options.activeClass:""))}).on("mouseleave",function(){b.$element.removeClass(b.options.hoverClass+" "+b.options.activeClass);a(b.$element).off("mouseup",d)}).on("mousedown pointerdown",function(){if(!b.options.disabled)b.mouseDown=!0,b.$element.addClass(b.options.activeClass),a(b.$element).on("mouseup pointerup",d)});this.disabled(this.options.disabled)},disabled:function(a){if(typeof a==="boolean")this.options.disabled=a,this.$element[a?
"addClass":"removeClass"](this.options.disabledClass);return this.options.disabled}});a.fn.wpButton=function(a){this.each(function(){new b.Widget.Button(this,a)});return this}})(jQuery,WebPro,window,document);
(function(a,b){b.widget("Widget.RadioGroup",b.Widget,{_widgetName:"radio-group",defaultOptions:{defaultIndex:0,hoverClass:"wp-radio-hover",downClass:"wp-radio-down",disabledClass:"wp-radio-disabled",checkedClass:"wp-radio-checked",disabled:!1,toggleStateEnabled:!1},_attachBehavior:function(){var a=this;this.buttons=[];this.activeElement=null;this.activeIndex=-1;this.$element.each(function(){a.buttons.push(a._addButtonBehavior(this))});this.disabled(this.options.disabled)},_addButtonBehavior:function(a){var d=
this,f=new b.Widget.Button(a,{hoverClass:this.options.hoverClass,downClass:this.options.downClass,disabledClass:this.options.disabledClass,callback:function(b){return d._handleClick(b,f,a)}});return f},_handleClick:function(a,b,f){this.options.disabled||this.checkButton(f)},_getElementIndex:function(b){return b?a.inArray(b,this.$element.get()):-1},_getElementByIndex:function(a){return a>=0?this.$element.eq(a)[0]:null},_getElement:function(a){return typeof a==="number"?this._getElementByIndex(a):a},
checkButton:function(b){var b=this._getElement(b),d=this.activeElement,f=this.options.checkedClass;b!==d?(d&&a(d).removeClass(f),b&&a(b).addClass(f)):this.options.toggleStateEnabled&&b&&(a(b).removeClass(f),b=null);this.activeElement=b;this.activeIndex=this._getElementIndex(b)},disabled:function(b){if(typeof b==="boolean")this.disabled=b,a.each(this.buttons,function(){this.disabled(b)});return this.options.disabled}});a.fn.wpRadioGroup=function(a){new b.Widget.RadioGroup(this,a);return this}})(jQuery,
WebPro,window,document);
(function(a,b){b.widget("Widget.TabGroup",b.Widget.RadioGroup,{defaultOptions:{defaultIndex:0,hoverClass:"wp-tab-hover",downClass:"wp-tab-down",disabledClass:"wp-tab-disabled",checkedClass:"wp-tab-active",disabled:!1,toggleStateEnabled:!1},selectTab:function(a){this.checkButton(a)},checkButton:function(a){var b=this._getElement(a),f=this._getElementIndex(b),b={tab:b,tabIndex:f};this.trigger("wp-tab-before-select",b);this._super.prototype.checkButton.apply(this,arguments);this.trigger("wp-tab-select",b)}});
a.fn.wpTabGroup=function(a){new b.Widget.TabGroup(this,a);return this}})(jQuery,WebPro,window,document);
(function(a,b){b.widget("Widget.PanelGroup",b.Widget,{_widgetName:"panel-group",defaultOptions:{defaultIndex:0,panelClass:"wp-panel",activeClass:"wp-panel-active",toggleStateEnabled:!1,tabGroups:null},_setUp:function(){var a=this;this.tabGroups=[];this._tabCallback=function(b,f){a._handleTabSelect(b,f)};this.showLock=0;this.tabDriver=null;return this._super.prototype._setUp.apply(this,arguments)},_attachBehavior:function(){this.activeElement=null;this.activeIndex=-1;this.$element.addClass(this.options.panelClass);
var a=this.options.defaultIndex;typeof a==="number"&&a>=0&&this.showPanel(a);this.addTabGroup(this.options.tabGroups)},_getElementIndex:function(b){return b?a.inArray(b,this.$element.get()):-1},_getElementByIndex:function(a){return this.$element.eq(a)[0]},_getElement:function(a){return typeof a==="number"?this._getElementByIndex(a):a},showPanel:function(b){if(!this.showLock){++this.showLock;var d=this._getElement(b),f=this.activeElement,g=this.options.activeClass;if(d)if(d!==f){b={panel:d,panelIndex:this._getElementIndex(d)};
this.trigger("wp-panel-before-show",b);f&&this.hidePanel(f);a(d).addClass(g);this.activeElement=d;this.activeIndex=this._getElementIndex(d);d=this.tabGroups;for(f=0;f<d.length;f++)g=d[f],g!==this.tabDriver&&g.selectTab(this.activeIndex);this.trigger("wp-panel-show",b)}else this.options.toggleStateEnabled&&this.hidePanel(d);--this.showLock}},hidePanel:function(b){if(b=typeof b==="number"?this.$element.eq(b)[0]:b){var d={panel:b,panelIndex:this._getElementIndex(b)};this.trigger("wp-panel-before-hide",
d);a(b).removeClass(this.options.activeClass);if(b===this.activeElement)this.activeElement=null,this.activeIndex=-1;this.trigger("wp-panel-hide",d)}},_handleTabSelect:function(a,b){if(!this.showLock)this.tabDriver=a.target,this.showPanel(b.tabIndex),this.tabDriver=null},addTabGroup:function(c){if(c)for(var c=b.ensureArray(c),d=c.length,f=0;f<d;f++){var g=c[f];a.inArray(this.tabGroups,g)===-1&&(this.tabGroups.push(g),g.selectTab(this.activeIndex),g.bind("wp-tab-select",this._tabCallback))}},removeTabGroup:function(c){for(var c=
b.ensureArray(c),d=c.length,f=0;f<d;f++){var g=c[f];sets=this.tabGroups;loc=a.inArray(sets,g);loc!==-1&&sets.splice(loc,1)}}});a.fn.wpPanelGroup=function(a){new b.Widget.PanelGroup(this,a);return this}})(jQuery,WebPro,window,document);
(function(a,b){b.widget("Widget.Disclosure",b.Widget,{defaultOptions:{widgetClassName:"wp-disclosure-panels",tabClassName:"wp-disclosure-panels-tab",tabHoverClassName:"wp-disclosure-panels-tab-hover",tabDownClassName:"wp-disclosure-panels-tab-down",panelClassName:"wp-disclosure-panels-panel",tabActiveClassName:"wp-disclosure-panels-tab-active",panelActiveClassName:"wp-disclosure-panels-panel-active",defaultIndex:0,toggleStateEnabled:!1},_attachBehavior:function(){var a=this.$element[0],d=this.options.widgetClassName,
f=b.scopedFind(a,"."+this.options.tabClassName,d,a),a=b.scopedFind(a,"."+this.options.panelClassName,d,a);this.tabs=new b.Widget.TabGroup(f,{hoverClass:this.options.tabHoverClassName,downClass:this.options.tabDownClassName,checkedClass:this.options.tabActiveClassName,toggleStateEnabled:this.options.toggleStateEnabled});this.panels=new b.Widget.PanelGroup(a,{panelClass:this.options.panelClassName,activeClass:this.options.panelActiveClassName,defaultIndex:this.options.defaultIndex,toggleStateEnabled:this.options.toggleStateEnabled});
this.panels.addTabGroup(this.tabs)}});b.widget("Widget.TabbedPanels",b.Widget.Disclosure,{defaultOptions:{widgetClassName:"wp-tabbed-panels-panels",tabClassName:"wp-tabbed-panels-panels-tab",tabHoverClassName:"wp-tabbed-panels-panels-tab-hover",tabDownClassName:"wp-tabbed-panels-panels-tab-down",tabActiveClassName:"wp-tabbed-panels-panels-tab-active",panelClassName:"wp-tabbed-panels-panels-panel",panelActiveClassName:"wp-tabbed-panels-panels-panel-active",toggleStateEnabled:!1}});b.widget("Widget.Accordion",
b.Widget.Disclosure,{defaultOptions:{widgetClassName:"wp-accordion",tabClassName:"wp-accordion-tab",tabHoverClassName:"wp-accordion-tab-hover",tabDownClassName:"wp-accordion-tab-down",tabActiveClassName:"wp-accordion-tab-active",panelClassName:"wp-accordion-panel",panelActiveClassName:"wp-accordion-panel-active",toggleStateEnabled:!1}})})(jQuery,WebPro,window,document);
(function(a,b){b.Widget.Disclosure.DisplayPropertyTransitionPlugin={defaultOptions:{},initialize:function(b,d){var f=this;a.extend(d,a.extend({},f.defaultOptions,d));b.bind("attach-behavior",function(){f._attachBehavior(b)})},_attachBehavior:function(a){var a=a.panels,b=a.$element,f=a.activeIndex;a.bind("wp-panel-show",function(a,b){b.panel.style.display="block"});a.bind("wp-panel-hide",function(a,b){b.panel.style.display="none"});b.each(function(a){this.style.display=a!==f?"none":"block"})}};b.Widget.Disclosure.AccordionTransitionPlugin=
{defaultOptions:{transitionDirection:"vertical",transitionDuration:500,dispatchTransitionEvents:!0},initialize:function(b,d){var f=this;a.extend(d,a.extend({},f.defaultOptions,d));b.bind("attach-behavior",function(){f._attachBehavior(b)})},_attachBehavior:function(b){var d=this,f=b.panels,g=f.$element,k=f.activeIndex,h=b.options.transitionDirection,l=b.options.widgetClassName==="AccordionWidget"?a(g[0]).closest("*[data-rotate]"):null;if(l&&l.length>0)b.options.marginBottom=Muse.Utils.getCSSIntValue(l,
"margin-bottom"),b.options.originalHeight=l[0].scrollHeight;b.options.rotatedAccordion=l;f.bind("wp-panel-show",function(a,g){d._showPanel(b,g)});f.bind("wp-panel-hide",function(a,g){d._hidePanel(b,g)});g.each(function(b){if(b!==k){a(this).css("overflow","hidden");if(h==="vertical"||h==="both")this.style.height="0";if(h==="horizontal"||h==="both")this.style.width="0"}})},_updateMarginBottomForRotatedAccordion:function(a){a.options.rotatedAccordion.css("margin-bottom",Math.round(a.options.marginBottom-
(a.options.rotatedAccordion[0].scrollHeight-a.options.originalHeight))+"px")},_transitionPanel:function(b,d,f){a("body").trigger("wp-page-height-change",d-b);if((b=f.options.rotatedAccordion)&&b.length>0){if(f.options.originalHeight==0&&"undefined"!==typeof d)f.options.marginBottom=Muse.Utils.getCSSIntValue(b,"margin-bottom"),f.options.originalHeight=b[0].scrollHeight;this._updateMarginBottomForRotatedAccordion(f)}},_showPanel:function(b,d){var f=b.options,g=f.transitionDirection,k=a(d.panel),h={},
l=f.dispatchTransitionEvents,j=this,i=k.height(),n=function(a){a=parseInt(a.elem.style.height);j._transitionPanel(i,a,b);i=a};if(g==="vertical"||g==="both")h.height=k[0].scrollHeight+"px";if(g==="horizontal"||g==="both")h.width=k[0].scrollWidth+"px";k.stop(!0,!0).queue("animationFrameFx",a.animationFrameFx).animate(h,{duration:f.transitionDuration,progress:l?n:null,queue:"animationFrameFx",complete:function(){var a={overflow:""};if(g==="vertical"||g==="both")a.height="auto";if(g==="horizontal"||g===
"both")a.width="auto";k.css(a);(a=b.options.rotatedAccordion)&&a.length>0&&j._updateMarginBottomForRotatedAccordion(b)}}).dequeue("animationFrameFx")},_hidePanel:function(b,d){var f=b.options,g=f.transitionDirection,k=a(d.panel),h={},l=f.dispatchTransitionEvents,j=this,i=k.height(),n=function(a){a=parseInt(a.elem.style.height);j._transitionPanel(i,a,b);i=a};if(g==="vertical"||g==="both")h.height="0";if(g==="horizontal"||g==="both")h.width="0";k.stop(!0,!0).queue("animationFrameFx",a.animationFrameFx).animate(h,
{duration:f.transitionDuration,queue:"animationFrameFx",progress:l?n:null,complete:function(){k.css("overflow","hidden");var a=b.options.rotatedAccordion;a&&a.length>0&&j._updateMarginBottomForRotatedAccordion(b)}}).dequeue("animationFrameFx")}}})(jQuery,WebPro,window,document);
(function(a,b){b.widget("Widget.SlideShowBase",b.Widget,{_widgetName:"slideshow-base",defaultOptions:{displayInterval:6E3,autoPlay:!1,loop:!0,playOnce:!1},_setUp:function(){var a=this;this._ssTimer=0;this._ssTimerTriggered=!1;this._ssTimerCallback=function(){a._ssTimerTriggered=!0;a.next();a._ssTimerTriggered=!1};return b.Widget.prototype._setUp.apply(this,arguments)},_ready:function(){this.options.autoPlay&&this.play()},play:function(a){e=this.trigger("wp-slideshow-before-play");e.isDefaultPrevented()||
(this._startTimer(!1,a),this.trigger("wp-slideshow-play"))},stop:function(){e=this.trigger("wp-slideshow-before-stop");e.isDefaultPrevented()||(this._stopTimer(),this.trigger("wp-slideshow-stop"))},isPlaying:function(){return this._ssTimer!==0},_startTimer:function(a,b){this._stopTimer();var f=b?0:this.options.displayInterval;a&&(f+=this.options.transitionDuration);this._ssTimer=setTimeout(this._ssTimerCallback,f)},_stopTimer:function(){this._ssTimer&&clearTimeout(this._ssTimer);this._ssTimer=0},
_executeCall:function(a,b){e=this.trigger("wp-slideshow-before-"+a);e.isDefaultPrevented()||(this["_"+a].apply(this,b)&&this.stop(),this.isPlaying()&&this._startTimer(!0),this.trigger("wp-slideshow-"+a))},first:function(){return this._executeCall("first",arguments)},last:function(){return this._executeCall("last",arguments)},previous:function(){return this._executeCall("previous",arguments)},next:function(){return this._executeCall("next",arguments)},goTo:function(){return this._executeCall("goTo",
arguments)},close:function(){return this._executeCall("close",arguments)},_first:function(){},_last:function(){},_previous:function(){},_next:function(){},_goTo:function(){},_close:function(){}})})(jQuery,WebPro,window,document);
(function(a,b){b.widget("Widget.ContentSlideShow",b.Widget.SlideShowBase,{_widgetName:"content-slideshow",defaultOptions:{slideshowClassName:"wp-slideshow",clipClassName:"wp-slideshow-clip",viewClassName:"wp-slideshow-view",slideClassName:"wp-slideshow-slide",slideLinkClassName:"wp-slideshow-slide-link",firstBtnClassName:"wp-slideshow-first-btn",lastBtnClassName:"wp-slideshow-last-btn",prevBtnClassName:"wp-slideshow-prev-btn",nextBtnClassName:"wp-slideshow-next-btn",playBtnClassName:"wp-slideshow-play-btn",
stopBtnClassName:"wp-slideshow-stop-btn",closeBtnClassName:"wp-slideshow-close-btn",playingClassName:"wp-slideshow-playing"},_findWidgetElements:function(a){var d=this.$element[0];return b.scopedFind(d,a,this.options.slideshowClassName,d)},_attachBtnHandler:function(a,b){var f=this;this["$"+b+"Btn"]=this._findWidgetElements("."+a).bind("click",function(a){f[b]();a.preventDefault()})},_getAjaxSrcForImage:function(a){return a.data("src")},_reprioritizeImageLoadingIfRequired:function(b){!this._isLoaded(b)&&
this._cssilLoader&&!this._cssilLoader.isQueueEmpty()&&(b=a(this.slides.$element[b]),this._cssilLoader.reprioritize(this._getAjaxSrcForImage(b.is("img")?b:b.find("img")),this.isPlaying()))},_attachBehavior:function(){var a=this,d=this.options;this._super.prototype._attachBehavior.call(this);this._panelShowCallback=function(){a._ssTimerTriggered||a.isPlaying()&&a._startTimer(!1)};this.$element.addClass(d.slideshowClassName);var f=this._findWidgetElements("."+d.slideClassName),g=this._findWidgetElements("."+
d.slideLinkClassName),k=d.event==="click"&&d.deactivationEvent==="mouseout_click";this.slides=new b.Widget.PanelGroup(f,{defaultIndex:d.defaultIndex||0,toggleStateEnabled:k});this.slides.bind("wp-panel-show",this._panelShowCallback);this.tabs=null;if(g.length)this.tabs=new b.Widget.TabGroup(g,{defaultIndex:d.defaultIndex||0,toggleStateEnabled:k}),this.slides.addTabGroup(this.tabs);this.slides.bind("wp-panel-before-show",function(b,g){a._reprioritizeImageLoadingIfRequired(g.panelIndex)});this._attachBtnHandler(d.firstBtnClassName,
"first");this._attachBtnHandler(d.lastBtnClassName,"last");this._attachBtnHandler(d.prevBtnClassName,"previous");this._attachBtnHandler(d.nextBtnClassName,"next");this._attachBtnHandler(d.playBtnClassName,"play");this._attachBtnHandler(d.stopBtnClassName,"stop");this._attachBtnHandler(d.closeBtnClassName,"close");this.bind("wp-slideshow-play",function(){this.$element.addClass(d.playingClassName)});this.bind("wp-slideshow-stop",function(){this.$element.removeClass(d.playingClassName)})},_first:function(){this.slides.showPanel(0)},
_last:function(){var a=this.slides;a.showPanel(a.$element.length-1)},_previous:function(){var a=this.slides,b=a.$element.length,f=a.activeIndex,b=(f<1?b:f)-1;!this.options.loop&&0==f?this.isPlaying()&&this.stop():a.showPanel(b)},_next:function(){var a=this.slides,b=a.activeIndex,f=(b+1)%a.$element.length;!this.options.loop&&0==f?this.isPlaying()&&this.stop():this.options.playOnce&&0==f&&this.isPlaying()?this.stop():(!this.isPlaying()||this._isLoaded(b)&&this._isLoaded(f))&&a.showPanel(f)},_goTo:function(){var a=
this.slides;a.showPanel.apply(a,arguments)},_close:function(){var a=this.slides;a.hidePanel(a.activeElement)},_isLoaded:function(b){if(this._csspIsImageSlideShow&&(b=a(this.slides.$element[b]),b=b.is("img")?b:b.find("img"),b.length>0&&(b.hasClass(this.options.imageIncludeClassName)||!b[0].complete)))return!1;return!0}})})(jQuery,WebPro,window,document);
(function(a,b,c,d,f){b.Widget.ContentSlideShow.fadingTransitionPlugin={defaultOptions:{transitionDuration:500},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){var k=this,h=b.slides,l=h.$element,j=h.activeIndex,i=b._findWidgetElements("."+b.options.viewClassName);h.bind("wp-panel-show",function(c,d){k._showElement(b,a(d.panel));b.options.contentLayout_runtime==="stack"&&k._showElement(b,
b.$closeBtn)}).bind("wp-panel-hide",function(c,d){k._hideElement(b,a(d.panel))});b.options.contentLayout_runtime==="stack"&&b.bind("wp-slideshow-close",function(){k._hideElement(b,b.$closeBtn)});for(var n=0;n<l.length;n++)if(n!==j)l[n].style.display="none";if(b.options.elastic==="fullWidth"){var o=a(c),p=a(d.body),q=function(c){c===f&&(c=Math.max(o.width(),parseInt(p.css("min-width"))));b.options.contentLayout_runtime!=="lightbox"&&i.css("left",i.position().left-i.offset().left);i.width(c);k._showElement(b,
a(h.activeElement))};q();for(n=0;n<l.length;n++){var m=a(l[n]);m.width("100%");m.addClass("borderbox")}if(b.options.contentLayout_runtime==="lightbox")b._fstpPositionSlides=q;else o.on("orientationchange resize",function(){q()})}j===-1&&b.options.contentLayout_runtime==="stack"&&b.$closeBtn.hide();if(Muse.Browser.Features.Touch&&b.options.enableSwipe===!0){var r=b.options.transitionDuration;b._ftpSwipeNoInterrupt=!1;l.each(function(){var c=a(this);c.data("opacity",c.css("opacity"));var d=Muse.Utils.getCanvasDirection(c,
"horizontal"),h=d.dir==="horizontal",f=d.reverse;if(d=c.swipe.defaults.excludedElements){var d=d.split(/\s*,\s*/),j=d.indexOf("a");if(0<=j)d.splice(j,1),c.swipe.defaults.excludedElements=d.join(", ")}c.swipe({triggerOnTouchEnd:!0,allowPageScroll:h?"vertical":"horizontal",threshold:75,swipeStatus:function(a,c,d,j){b.stop();if(c=="move"&&(h&&(d=="left"||d=="right")||!h&&(d=="up"||d=="down")))k._scrollTo(b,-1,j*(!f&&(d=="left"||d=="up")||f&&(d=="right"||d=="down")?1:-1),0);else if(c=="cancel")k._scrollTo(b,
b.slides.activeIndex,0,r);else if(c=="end"){a=b.slides.activeIndex;c=-1;if(h&&(d=="right"&&!f||d=="left"&&f)||!h&&(d=="down"&&!f||d=="up"&&f))c=a-1<0?l.length-1:a-1;else if(h&&(d=="left"&&!f||d=="right"&&f)||!h&&(d=="up"&&!f||d=="down"&&f))c=a+1>l.length-1?0:a+1;c!=-1&&k._scrollTo(b,c,0,r)}}})})}},_showElement:function(a,b){var c=!1,d=function(){c||(c=!0,b.show().css("opacity",""))},f=setTimeout(d,a.options.transitionDuration+10);b.stop(!1,!0).fadeIn(a.options.transitionDuration,function(){clearTimeout(f);
d()})},_hideElement:function(a,b){var c=!1,d=function(){c||(c=!0,b.hide().css("opacity",""))},f=setTimeout(d,a.options.transitionDuration+10);b.stop(!1,!0).fadeOut(a.options.transitionDuration,function(){clearTimeout(f);d()})},_scrollTo:function(b,c,d,f){if(!b._ftpSwipeNoInterrupt){var j=b.slides.$element,i=b.slides.activeIndex,n=c==-1;c==-1&&(c=d<0?i-1<0?j.length-1:i-1:i+1>j.length-1?0:i+1);var o=a(j[i]),p=a(j[c]);if(!n&&d==0||i==c){b._ftpSwipeNoInterrupt=!0;var q=0,m=!1,r=function(){if(!m&&(m=!0,
p.show().css("opacity",""),c!=i&&b.slides.showPanel(c),++q==j.length))b._ftpSwipeNoInterrupt=!1};if(p.css("opacity")!=p.data("opacity")){var t=setTimeout(r,f+10);p.stop(!1,!0).animate({opacity:p.data("opacity")},f,function(){clearTimeout(t);r()})}else r();j.each(function(d){var h=a(this),o=!1,i=function(){if(!o&&(o=!0,h.hide().css("opacity",""),++q==j.length))b._ftpSwipeNoInterrupt=!1},p;d!=c&&(h.css("display")!="none"&&h.css("opacity")!=0?(p=setTimeout(i,f+10),h.stop(!1,!0).animate({opacity:0},f,
function(){clearTimeout(p);i()})):i())})}else d=Math.abs(d),n=o.width(),d>n&&(d=n),d=p.data("opacity")*(d/n),n=o.data("opacity")*(1-d),o.stop(!1,!0).animate({opacity:n},f),p.stop(!1,!0).show().animate({opacity:d},f)}}};b.Widget.ContentSlideShow.filmstripTransitionPlugin={defaultOptions:{transitionDuration:500,transitionStyle:"horizontal"},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){var k=
this,h=a(c),l=a(d.body),j=function(){return i.elastic==="fullWidth"?Math.max(h.width(),parseInt(l.css("min-width"))):q.width()},i=b.options,n=i.transitionStyle==="horizontal",o=b.slides,p=o.$element,q=b._findWidgetElements("."+i.clipClassName),m=b._findWidgetElements("."+i.viewClassName),r=j(),t=q.height(),x={top:"0",left:"0"},y=q.css("position");y!=="absolute"&&y!=="fixed"&&i.elastic!=="fullScreen"&&q.css("position","relative");m.css("position")!=="absolute"&&(x.position="relative");b._fstp$Clip=
q;b._fstp$View=m;b._fstpStyleProp=n?"left":"top";b._fstpStylePropZero=n?"top":"left";o.bind("wp-panel-show",function(a,c){k._goToSlide(b,c.panel,i.transitionDuration);b.options.contentLayout_runtime==="stack"&&b.$closeBtn.stop(!0).fadeIn(i.transitionDuration)});b.options.contentLayout_runtime==="stack"&&b.bind("wp-slideshow-close",function(){q.css({opacity:0.99}).stop(!0).animate({opacity:0},{queue:!1,duration:i.transitionDuration,complete:function(){x[b._fstpStyleProp]=(n?q.width():q.height())+"px";
x[b._fstpStylePropZero]="0";m.css(x);q.css({opacity:""})}});b.$closeBtn.stop(!0).fadeOut(i.transitionDuration)});b._fstpRequestType=null;b.bind("wp-slideshow-before-previous wp-slideshow-before-next",function(a){b._fstpRequestType=a.type.replace(/.*-/,"");b._fstpOldActiveIndex=b.slides.activeIndex}).bind("wp-slideshow-previous wp-slideshow-next",function(){b._fstpRequestType=null;b._fstpOldActiveIndex=-1});var F=function(a,c){if(a===f||c===f)a=j(),c=q.height();i.elastic==="fullWidth"&&(c=q.height(),
q.width(a),i.contentLayout_runtime!=="lightbox"&&q.css("left",q.position().left-q.offset().left),m.width(a));for(var d=0,h=n?a:c,l=b._fstpStyleProp,r=b._fstpStylePropZero,t=0;t<p.length;t++){var v=p[t].style;v[r]="0";v[l]=d+"px";v.margin="0";v.position="absolute";d+=h}k._goToSlide(b,o.activeElement,0);return d},y=F();if(i.elastic==="fullWidth")for(var v=0;v<p.length;v++){var C=a(p[v]);C.width("100%");C.addClass("borderbox")}if(i.elastic!=="off")if(i.contentLayout_runtime==="lightbox")b._fstpPositionSlides=
F;else h.on("orientationchange resize",function(){F()});else x[n?"width":"height"]=y+"px",x[n?"height":"width"]=(n?t:r)+"px";o.activeElement||(x[b._fstpStyleProp]=(n?r:t)+"px",x[b._fstpStylePropZero]="0",b.options.contentLayout_runtime==="stack"&&b.$closeBtn.hide());x.overflow="visible";m.css(x);k._goToSlide(b,o.activeElement,i.transitionDuration)},_goToSlide:function(b,c,d){if(b){var f=a(c),j=b._fstp$View,i=b._fstpStyleProp,n=i==="left"?"offsetLeft":"offsetTop",o=i==="left"?"offsetWidth":"offsetHeight",
p=c?-c[n]:b._fstp$Clip[0][o],q={};q[i]=p+"px";var m=b._fstpRequestType,r=b._fstpOldActiveIndex;if(m&&r!==-1){var t=b.slides.activeIndex,x=b.slides.$element.length-1;if(t!==r){var y=0;m==="previous"&&r===0&&t===x?y=-c[o]:m==="next"&&r===x&&t===0&&(b=b.slides.$element[r],y=b[n]+b[o]);y&&(q[i]=-y+"px",f.css(i,y+"px"))}}j.stop(!1,!0).animate(q,d,function(){y&&(f.css(i,-p+"px"),j.css(i,p+"px"))})}}};b.Widget.ContentSlideShow.alignPartsToPagePlugin={defaultOptions:{alignPartToPageClassName:"wp-slideshow-align-part-to-page"},
initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){if(!("fullWidth"!==b.options.elastic||!b.$element.hasClass("align_parts_to_page")||"fixed"!==b.$element.css("position")||b.options.contentLayout_runtime==="lightbox")){var d=a(c),f=a("#page"),l=b.options,j=function(){var c=f.offset().left+"px";a("."+l.alignPartToPageClassName,b.$element).each(function(){a(this).css("margin-left",c)})};
b.$element.children().each(function(){var b=a(this);0<a("."+l.viewClassName,b).length||b.addClass(l.alignPartToPageClassName)});j();d.on("orientationchange resize",function(){j()})}}};b.Widget.ContentSlideShow.swipeTransitionPlugin={defaultOptions:{transitionDuration:500,transitionStyle:"horizontal"},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){var k=this,h=a(c),l=a(d.body),j=function(){return i.elastic===
"fullWidth"?Math.max(h.width(),parseInt(l.css("min-width"))):q.width()},i=b.options,n=i.transitionStyle==="horizontal",o=b.slides,p=o.$element,q=b._findWidgetElements("."+i.clipClassName),m=b._findWidgetElements("."+i.viewClassName),r=j(),t=q.height(),x=function(a,b){if(a===f||b===f)a=j(),b=q.height();return n?a:b},y=x();viewProps={top:"0",left:"0"};q.css("position")!=="absolute"&&i.elastic!=="fullScreen"&&q.css("position","relative");m.css("position")!=="absolute"&&(viewProps.position="relative");
b._fstp$Clip=q;b._fstp$View=m;b._fstpStyleProp=n?"left":"top";b._fstpStylePropZero=n?"top":"left";o.bind("wp-panel-show",function(){var a=b.slides.activeIndex*x(),c=b.options.transitionDuration;a==0&&b.slides.activeIndex==0&&!i.shuffle&&b.isPlaying()&&(c=0);k._scrollTo(b,a,c);b.options.contentLayout_runtime==="stack"&&b.$closeBtn.stop(!0).fadeIn(c)});b.options.contentLayout_runtime==="stack"&&b.bind("wp-slideshow-close",function(){q.css({opacity:0.99}).stop(!0).animate({opacity:0},{queue:!1,duration:i.transitionDuration,
complete:function(){k._scrollTo(b,-x(),0);q.css({opacity:""})}});b.$closeBtn.stop(!0).fadeOut(b.options.transitionDuration)});b._fstpRequestType=null;b.bind("wp-slideshow-before-previous wp-slideshow-before-next",function(a){b._fstpRequestType=a.type.replace(/.*-/,"");b._fstpOldActiveIndex=b.slides.activeIndex}).bind("wp-slideshow-previous wp-slideshow-next",function(){b._fstpRequestType=null;b._fstpOldActiveIndex=-1});var F=function(a,c){if(a===f||c===f)a=j(),c=q.height();i.elastic==="fullWidth"&&
(c=q.height(),q.width(a),i.contentLayout_runtime!=="lightbox"&&q.css("left",q.position().left-q.offset().left),m.width(a));for(var d=0,h=n?a:c,l=b._fstpStyleProp,r=b._fstpStylePropZero,t=0;t<p.length;t++){var s=p[t].style;s[r]="0";s[l]=d+"px";s.margin="0";s.position="absolute";d+=h}m.css(n?"width":"height",d);k._scrollTo(b,o.activeIndex*h,0);return d},v=F();if(i.elastic==="fullWidth")for(var C=0;C<p.length;C++){var z=a(p[C]);z.width("100%");z.addClass("borderbox")}if(i.elastic!=="off")if(i.lightboxEnabled_runtime)b._fstpPositionSlides=
F;else h.on("orientationchange resize",function(){F()});else viewProps[n?"width":"height"]=v+"px",viewProps[n?"height":"width"]=(n?t:r)+"px";viewProps.overflow="visible";m.css(viewProps);var r=Muse.Utils.getCanvasDirection(m,i.transitionStyle),s=r.dir==="horizontal",E=r.reverse,M=b.options.transitionDuration;if(r=m.swipe.defaults.excludedElements)if(r=r.split(/\s*,\s*/),t=r.indexOf("a"),0<=t)r.splice(t,1),m.swipe.defaults.excludedElements=r.join(", ");m.swipe({triggerOnTouchEnd:!0,allowPageScroll:s?
"vertical":"horizontal",threshold:75,swipeStatus:function(a,c,d,f){b.stop();y=x();if(c=="move"&&(s&&(d=="left"||d=="right")||!s&&(d=="up"||d=="down")))d=y*b.slides.activeIndex+f*(!E&&(d=="left"||d=="up")||E&&(d=="right"||d=="down")?1:-1),k._scrollTo(b,d,0);else if(c=="cancel")d=y*b.slides.activeIndex,k._scrollTo(b,d,M);else if(c=="end"){a=-1;if(s&&(d=="right"&&!E||d=="left"&&E)||!s&&(d=="down"&&!E||d=="up"&&E))a=Math.max(b.slides.activeIndex-1,0);else if(s&&(d=="left"&&!E||d=="right"&&E)||!s&&(d==
"up"&&!E||d=="down"&&E))a=Math.min(b.slides.activeIndex+1,m.children().length-1);a!=-1&&(d=y*a,k._scrollTo(b,d,M),a!=b.slides.activeIndex&&b.slides.showPanel(a))}}});o.activeElement?(r=o.activeIndex*y,k._scrollTo(b,r,0)):(k._scrollTo(b,-y,0),b.options.contentLayout_runtime==="stack"&&b.$closeBtn.hide())},_scrollTo:function(a,b,c){var g;var d=Muse.Browser.Features.checkCSSFeature("transition-duration"),f=Muse.Browser.Features.checkCSSFeature("transform");if(!(d===!1||f===!1)){var i=a._fstp$View.get(0);
i.style[(d===!0?"":"-"+d.toLowerCase()+"-")+"transition-duration"]=(c/1E3).toFixed(1)+"s";b=-b;g=(c=a.options.transitionStyle==="horizontal")?b:0,a=g;b=c?0:b;f=(f===!0?"":"-"+f.toLowerCase()+"-")+"transform";c="translate3d("+a+"px, "+b+"px, 0px)";d=i.style[f];i.style[f]=c;i.style[f]===d&&d!==c&&(i.style[f]="translate("+a+"px, "+b+"px)")}}};b.Widget.ContentSlideShow.slideImageIncludePlugin={defaultOptions:{imageIncludeClassName:"wp-slideshow-slide-image-include",slideLoadingClassName:"wp-slideshow-slide-loading"},
initialize:function(c,d){var f=this;a.extend(d,a.extend({},f.defaultOptions,d));c._cssilLoader=new b.ImageLoader;c.bind("attach-behavior",function(){f._attachBehavior(c)})},_attachBehavior:function(a){for(var b=this,c=a._cssilLoader,d=a._findWidgetElements("."+a.options.slideClassName),f=d.length,i="."+a.options.imageIncludeClassName,n=a.options.slideLoadingClassName,o=function(c,d,f,h){b._handleImageLoad(a,c,d,f,h)},p=0;p<f;p++){var q=d.eq(a._shuffleArray?a._shuffleArray[p]:p),m=q.is("img")?q:q.find(i),
r=m[0];if(r){var t=a._getAjaxSrcForImage(m)||r.href;if(t)m={width:m.data("width"),height:m.data("height"),$ele:m,$slide:q},r.style.visibility="hidden",c.add(t,{callback:o,data:m}),q.addClass(n)}}a._cssilLoader.start()},_handleImageLoad:function(a,b,c,d,f){var i=f.$ele,n=i[0];n.src=b;a.options.elastic!=="off"?(i.data("imageWidth",c),i.data("imageHeight",d),a._csspPositionImage(n,a.options.heroFitting,a.options.elastic,c,d)):(n.width=f.width||c,n.height=f.height||d);n.style.visibility="";i.removeClass(a.options.imageIncludeClassName);
f.$slide.removeClass(a.options.slideLoadingClassName);a.isPlaying()&&a.slides.$element[a.slides.activeIndex]==f.$slide[0]&&a._startTimer(!1)}};b.Widget.ContentSlideShow.shufflePlayPlugin={defaultOptions:{randomDefaultIndex:!0},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b._shuffleArray=[];b._shuffleNextDict={};b._realNext=b._next;b._next=function(){d._handleNext(b)};b._shufflePlayCount=1;b.bind("before-attach-behavior",function(){d._reshuffle(b);if(c.randomDefaultIndex&&
typeof c.defaultIndex==="undefined")b.options.defaultIndex=b._shuffleArray[0]})},_fisherYatesArrayShuffle:function(a){if(a&&a.length)for(var b=a.length;--b;){var c=Math.floor(Math.random()*(b+1)),d=a[c];a[c]=a[b];a[b]=d}},_reshuffle:function(a){var b=a._shuffleArray,c={},d=a.slides?a.slides.$element.length:a._findWidgetElements("."+a.options.slideClassName).length;if(b.length!==d)for(var f=b.length=0;f<d;f++)b[f]=f;this._fisherYatesArrayShuffle(b);for(f=0;f<d;f++)c[b[f]]=b[(f+1)%d];a._shuffleNextDict=
c;a._shufflePlayCount=1},_handleNext:function(a){if(a.isPlaying()){var b=a.slides.activeIndex,c=a._shuffleNextDict[b]||0;a._isLoaded(b)&&a._isLoaded(c)&&(a._goTo(c),++a._shufflePlayCount>=a.slides.$element.length&&(this._reshuffle(a),(!a.options.loop||a.options.playOnce)&&a.stop()))}else a._realNext()}}})(jQuery,WebPro,window,document);
(function(a,b,c){b.widget("Widget.Form",b.Widget,{_widgetName:"form",defaultOptions:{validationEvent:"blur",errorStateSensitivity:"low",ajaxSubmit:!0,fieldWrapperClass:"field",formErrorClass:"form-error",formSubmittedClass:"form-submitted",formDeliveredClass:"form-delivered",focusClass:"focus",notEmptyClass:"not-empty",emptyClass:"empty",validClass:"valid",invalidClass:"invalid",requiredClass:"required"},validationTypes:{"always-valid":/.*/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
alpha:/^[A-z\s]+$/,numeric:/^[0-9]+$/,phone:/^([0-9])?(\s)?(\([0-9]{3}\)|[0-9]{3}(\-)?)(\s)?[0-9]{3}(\s|\-)?[0-9]{4}(\s|\sext|\sx)?(\s)?[0-9]*$/,captcha:function(a){return a.data("captchaValid")},recaptcha:function(){if("undefined"==typeof Recaptcha)return!1;var a=Recaptcha.get_response();return a&&0<a.length},checkbox:function(){return!0},time:function(a){var a=a.find("input, textarea"),b=a.val().replace(/[^0-9:APM]/g,"");if(b.indexOf(":")!=-1&&b.match(/:/).length==1){var c=b.split(":"),k=parseInt(c[0]),
c=parseInt(c[1]);if(k<0||k>24)return!0;if(c<0||c>59)return!0}else return!1;a.val(b);return!0}},_transformMarkup:function(){var b=this;b.hasCAPTCHA=!1;b.hasReCAPTCHA=!1;this.$element.find("."+this.options.fieldWrapperClass).each(function(){var c=a(this);switch(c.attr("data-type")){case "captcha":b.hasCAPTCHA=!0;c.find('input[name="CaptchaV2"]').remove();c.find('input[name="muse_CaptchaV2"]').attr("name","CaptchaV2");break;case "recaptcha":b.hasReCAPTCHA=!0}})},_extractData:function(){this.event=this.options.validationEvent;
this.errorSensitivity=this.options.errorStateSensitivity;this.classNames={focus:this.options.focusClass,blur:this.options.emptyClass,keydown:this.options.notEmptyClass}},_attachBehavior:function(){var b=this;this.$element.find("input, textarea").each(function(){var c=a(this);c.val()!=""&&c.removeClass(b.options.emptyClass)});this.$element.find("."+this.options.fieldWrapperClass).each(function(){var c=a(this);c.attr("data-type")=="captcha"&&(c.data("captchaValid",!1),c.find('input[name="CaptchaV2"]').keyup(function(){var g=
a(this).val(),k=c.find('input[name="CaptchaHV2"]').val();b._validateCaptcha(k,g,function(a){c.data("captchaValid",a);c.data("error-state")&&b.errorSensitivity=="high"&&b._validate(c)})}));c.find("input, textarea").val()!=""&&c.addClass(b.classNames.keydown)});this.$element.find("input, textarea").bind("focus blur keydown change propertychange",function(c){var g=b.classNames[c.type],k=b.classNames.focus,h=b.classNames.keydown,l=b.classNames.blur,j=a(this),i=j.closest("."+b.options.fieldWrapperClass);
switch(c.type){case "focus":i.addClass(g).removeClass(l);break;case "blur":i.removeClass(k);j.val()==""&&i.addClass(g).removeClass(h);break;case "keydown":i.addClass(g).removeClass(l);break;case "change":case "propertychange":j.val()!=""?i.addClass(h).removeClass(l):i.addClass(l).removeClass(h)}});switch(this.event){case "blur":case "keyup":this.$element.find("."+this.options.fieldWrapperClass+" input, ."+this.options.fieldWrapperClass+" textarea").bind(this.event,function(){b._validate(a(this).closest("."+
b.options.fieldWrapperClass))});case "submit":this.$element.submit(function(c){var g=!0,k=b.$element.find("."+b.options.fieldWrapperClass).length-1;b.$element.find("."+b.options.fieldWrapperClass).each(function(h){if((g=b._validate(a(this))?g:!1)&&h==k&&b.options.ajaxSubmit)c.preventDefault(),b._submitForm();g||c.preventDefault()})})}},_validateCaptcha:function(b,c,g){c.length!=6?g(!1):a.get("/ValidateCaptcha.ashx",{key:b,answer:c},function(a){g(a=="true")})},_validateReCaptcha:function(b,c){a.get("/ValidateCaptcha.ashx",
{key:Recaptcha.get_challenge(),answer:Recaptcha.get_response(),imageVerificationType:"recaptcha"},function(a){a=="true"?b():c()})},_submitForm:function(){var b=this,c=a("#ReCaptchaAnswer",b.$element),g=a("#ReCaptchaChallenge",b.$element);b.hasReCAPTCHA&&1==c.length&&1==g.length?(c.val(Recaptcha.get_response()),g.val(Recaptcha.get_challenge()),b._validateReCaptcha(function(){b._submitFormInternal()},function(){a("."+b.options.fieldWrapperClass,b.$element).each(function(){var c=a(this);c.attr("data-type")==
"recaptcha"&&b._switchState("invalid",c)});Recaptcha.reload()})):b._submitFormInternal()},_submitFormInternal:function(){var b=this,f=this.options.formSubmittedClass,g=this.options.formDeliveredClass,k=this.options.formErrorClass,h=f+" "+g+" "+k,l=this.$element.find("input[type=submit], button");a.ajax({url:this.$element.attr("action"),type:"post",data:this.$element.serialize(),beforeSend:function(){b.$element.removeClass(h);b.$element.addClass(f);b.$element.find("."+b.options.fieldWrapperClass).removeClass(b.options.focusClass);
l.attr("disabled","disabled")},complete:function(h){h&&(h.status>=400||h.responseText&&h.responseText.indexOf("<?php")>=0)&&alert("Form PHP script is missing from web server, or PHP is not configured correctly on your web hosting provider. Check if the form PHP script has been uploaded correctly, then contact your hosting provider about PHP configuration.");b.$element.removeClass(f);var i=null;if(h&&h.responseText)try{i=jQuery.parseJSON(h.responseText),i=i.FormProcessV2Response||i.FormResponse||i.MusePHPFormResponse||
i}catch(n){}if(i&&i.success){b.$element.addClass(g);if(i.redirect){c.location.href=i.redirect;return}b.$element[0].reset();b.hasCAPTCHA&&b.$element.find("input:not([type=submit]), textarea").each(function(){a(this).attr("disabled","disabled")})}else if(h=b._getFieldsWithError(i))for(i=0;i<h.length;i++)b._switchState("invalid",h[i]);else b.$element.addClass(k);b.hasCAPTCHA||l.removeAttr("disabled");b.hasReCAPTCHA&&Recaptcha.reload()}})},_getFieldsWithError:function(b){if(!b||!b.error||!b.error.fields||
!b.error.fields.length)return null;for(var c=[],g=0;g<b.error.fields.length;g++){var k=a('[name="'+b.error.fields[g].field+'"]',this.$element).parents("."+this.options.fieldWrapperClass);1==k.length&&c.push(k)}return c},_validate:function(a){var b=a.attr("data-type")||"always-valid",c=a.find("input, textarea"),k=this.validationTypes[b],b=a.attr("data-required")==="true",h="checkbox"==c.attr("type")?typeof c.attr("checked")==="undefined":c.val()=="",c=k instanceof RegExp?Boolean(c.val().match(k)):
k(a);if(b&&h)return this._switchState("required",a);if(!c)return this._switchState("invalid",a);return this._switchState("valid",a)},_switchState:function(a,b){function c(){i._validate(b)}var k=b.attr("data-type"),h=this.options.validClass,l=this.options.invalidClass,j=this.options.requiredClass;b.removeClass(h+" "+l+" "+j);if(a=="required"||a=="invalid"){a=="invalid"?b.addClass(l):b.addClass(j);if("recaptcha"!=k&&this.errorSensitivity!="low"){var i=this,k=this.errorSensitivity=="high"?"keyup":"blur";
b.data("error-state")||(b.data("error-state",!0),b.find("input, textarea").bind(k,c))}return!1}b.data("error-state")&&(this.errorSensitivity=="high"?this.event!="keyup"&&b.data("error-state",!1).find("input, textarea").unbind("keyup",c):this.errorSensitivity=="medium"&&this.event!="blur"&&b.data("error-state",!1).find("input, textarea").unbind("blur",c));b.addClass(h);return!0}});a.fn.wpForm=function(a){new b.Widget.Form(this,a);return this}})(jQuery,WebPro,window,document);
;(function(){if(!("undefined"==typeof Muse||"undefined"==typeof Muse.assets)){var a=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]==b)return c;return-1}(Muse.assets.required,"webpro.js");if(-1!=a){Muse.assets.required.splice(a,1);for(var a=document.getElementsByTagName("meta"),b=0,c=a.length;b<c;b++){var d=a[b];if("generator"==d.getAttribute("name")){"2014.3.2.295"!=d.getAttribute("content")&&Muse.assets.outOfDate.push("webpro.js");break}}}}})();
|
import pt from './pt/pt'
const messages = {
pt
}
export default messages
|
import { validate, URL_REX, TITLE_REX } from '../validator';
import db from '../connection';
import getUserById from '../loaders/get-user-by-id';
import sanitizeHtml from 'sanitize-html';
export default async (userId, rawTitle, rawLink, rawBody) => {
const body = sanitizeHtml(rawBody, {
allowedTags: ['b', 'i', 'em', 'strong', 'a', 'p', 'br', 'div', 'h2', 'h3'],
allowedAttributes: {
a: ['href'],
},
});
const link = (validate(URL_REX, rawLink)) ? rawLink : null;
const title = (validate(TITLE_REX, rawTitle)) ? rawTitle.trim() : null;
const urlStringRoot = title.toLowerCase().replace(/ /g, '-').replace(/[^a-z-1234567890]/g, '');
if (userId && body && body !== '') {
const urlStringLike = `${urlStringRoot}%`;
const countResult = await db.one(
'select count(*) as count from t_post where urlstring like $(urlStringLike)',
{ urlStringLike }
);
const urlString = (Number(countResult.count) === 0) ?
urlStringRoot : `${urlStringRoot}-${countResult.count}`;
const user = await getUserById(userId);
if (user && user.status > 0) {
const insertResult = await db.one(
`insert into t_post (user_id, title, urlstring, body, url)
values ($(userId), $(title), $(urlString), $(body), $(link))
returning id`,
{ userId, title, urlString, body, link }
);
if (insertResult) {
return { success: true, post: { urlstring: urlString } };
}
return { success: false, message: 'Insert failed' };
}
return { success: false, message: 'No permissions' };
}
return { success: false, message: 'Didn\'t validate' };
};
|
'use strict';
//NOTE:Methods used to do HTTP requests. To use an HTTP request listed here just call the method
angular.module('announcements').factory('Announcements', ['$http',
function($http) {
var methods = {
getAllAnnouncements: function(announcements) {
return $http.get('/api/announcements', announcements);
},
getOneAnnouncement: function(id) {
return $http.get('/api/announcements/' + id);
},
createAnnouncement: function(announcement) {
$http.post('/api/announcements', announcement);
},
deleteAnnouncement: function(id) {
return $http.delete('/api/announcements/' + id);
},
updateAnnouncement: function(id, announcement) {
return $http.put('/api/announcements/' + id, announcement);
},
};
return methods;
}]);
|
//document.write("It works.");
document.write(require("./content.js"));
|
/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'find', 'ro', {
find: 'Găseşte',
findOptions: 'Find Options',
findWhat: 'Găseşte:',
matchCase: 'Deosebeşte majuscule de minuscule (Match case)',
matchCyclic: 'Potrivește ciclic',
matchWord: 'Doar cuvintele întregi',
notFoundMsg: 'Textul specificat nu a fost găsit.',
replace: 'Înlocuieşte',
replaceAll: 'Înlocuieşte tot',
replaceSuccessMsg: '%1 căutări înlocuite.',
replaceWith: 'Înlocuieşte cu:',
title: 'Găseşte şi înlocuieşte'
} );
|
/**
* @copyright
* The MIT License (MIT)
*
* Copyright (c) 2014 Cosmic Dynamo LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* @module jazzHands.query.function.boolean
*/
define([
"./_boolean"
], function (_boolean) {
/**
* Returns true if var is bound to a value. Returns false otherwise. Variables with the value NaN or INF are considered bound.
* @see http://www.w3.org/TR/sparql11-query/#func-bound
* @param {Object} execData
* @param {jazzHands.query.DataRow} dataRow
* @param {jazzHands.query.Variable} variable
* @return {RdfJs.node.Literal<Boolean>}
* @throws err:FORG0006, Invalid argument type
*/
function bound(execData, dataRow, variable) {
return _boolean(variable.resolve(execData, dataRow) !== null);
}
return bound;
});
|
import React from 'react';
import { Link } from 'react-router-dom';
export default class Combatant extends React.Component {
render() {
return (
<div key={ this.props.id }
className={this.props.index === 0 ? 'col-xs-6 col-sm-6 col-md-5 col-md-offset-1' : 'col-xs-6 col-sm-6 col-md-5'}>
<div className='thumbnail fadeInUp animated'>
<div className="image-container">
<div className="inner-container">
<img onClick={ this.props.upVote.bind(null, this.props.id) }
src={ this.props.imageUrl }
alt="cats"/>
</div>
</div>
<div className='caption text-center'>
<p>{ this.props.description }</p>
<h4>
<Link to={ `/characters/${ this.props.id }` }>
<strong>{this.props.name}</strong>
</Link>
</h4>
{this.props.isReported?
null
: <span onClick={ this.props.report.bind(null, this.props.id) } className="pull-right report">Report</span>
}
</div>
</div>
</div>
)
}
}
|
/*
* This file is part of the React Redux starter repo.
*
* (c) Magnus Bergman <hello@magnus.sexy>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import React, { PropTypes } from 'react'
import { Provider } from 'react-redux'
import { Router } from 'react-router'
import routes from 'routes/routes'
import DevTools from '../DevTools'
/**
* This is the Root component.
*
* @author Magnus Bergman <hello@magnus.sexy>
*/
const Root = ({ store, history }) =>
<Provider store={store}>
<div>
<Router history={history} routes={routes} />
<DevTools />
</div>
</Provider>
Root.propTypes = {
store: PropTypes.object.isRequired,
history: PropTypes.object.isRequired
}
export default Root
|
var assert = require('chai').assert;
var ss = require('../../../script_sanitize');
var describe = require('mocha/lib/mocha.js').describe;
var it = require('mocha/lib/mocha.js').it;
var script_sanitize = ss.sanitize;
module.exports = function () {
describe("attributes", function () {
it('should replace the attribute specified', function() {
var a = script_sanitize("<h1 onload=''></h1>", { attributes: ["onload"], tags: [] });
assert.isOk(!a.includes("onload"));
});
it('should support multiple attributes', function() {
var a = script_sanitize("<h1 onload='' onmouseover=''></h1>", { attributes: ["onload", "onmouseover"], tags: [] });
assert.isOk(!a.includes("onload"));
assert.isOk(!a.includes("onmouseover"));
});
it('should remove nested attributes', function () {
var a = script_sanitize("<h1 onload='onload='''></h1>", { attributes: ["onload", "onmouseover"], tags: [] });
assert.isOk(!a.includes("onload"));
});
});
};
|
import resource from 'resource-router-middleware';
import model from '../models/users';
export default ({ config, db }) => resource({
/** Property name to store preloaded entity on `request`. */
id : 'user',
mergeParams: true,
/** For requests with an `id`, you can auto-load the entity.
* Errors terminate the request, success sets `req[id] = data`.
*/
load(req, id, callback) {
let query = {
select: '-_id -__v'
};
model.findOne({id: id}, query.select, function(err, record) {
let error = record ? null : 'Not found';
callback(error, record);
});
},
/** GET / - List all entities */
index(params, res) {
let urlQuery = {};
let searchable = ['fullName', 'email', 'workPhone', 'personalPhone'];
params.query.select = {
'_id': 0,
'id': 1,
'fullName': 1,
'email': 1,
'workPhone': 1,
'personalPhone': 1
};
if(!params.query.active || params.query.active === 'false') {
urlQuery.active = false;
} else {
urlQuery.active = true;
}
if(!params.query.limit) {
params.query.limit = config.pagination;
}
if(!params.query.sort) {
params.query.sort = 'id';
}
if(params.query.sort) {
params.query.sort = params.query.sort;
}
for(var key in params.query) {
if(!isNaN(parseFloat((params.query[key])))) {
params.query[key] = parseInt(params.query[key]);
}
}
if(params.query.find) {
let parsed = JSON.parse(params.query.find);
let queryArray = [];
for ( let property in parsed ) {
if( (searchable.indexOf(property) > -1) ) {
let userSearch = new RegExp(parsed[property], 'i');
let tempObj = {};
tempObj[property] = userSearch;
queryArray.push(tempObj);
}
}
//we ensure we only search for proper active/inactive records
let activeQuery = {
'active': urlQuery.active
}
queryArray.push(activeQuery);
urlQuery = {
$and: queryArray,
};
}
model.paginate( urlQuery ,params.query, function(err, result) {
if(err) {
console.log(err);
res.sendStatus(500);
}
res.json(result);
});
},
/** POST / - Create a new entity */
create(req, res) {
console.log(req.body);
let newModel = new model(req.body);
newModel.save((err, user) => {
if(err) {
console.error(err);
if (err.name === 'MongoError' && err.code === 11000) {
// Duplicate username
return res.status(400).send({ success: false, message: 'Email is not unique' });
}
return res.status(400).send({ success: false, message: err });
} else {
return res.status(200).send({success: true});
}
});
},
/** GET /:id - Return a given entity */
read( record , res) {
res.status(200).json(record['user']);
},
/** PUT /:id - Update a given entity */
update({ facet, body }, res) {
for (let key in body) {
if (key!=='id') {
facet[key] = body[key];
}
}
res.sendStatus(204);
},
/** DELETE /:id - Delete a given entity */
delete({ facet }, res) {
facets.splice(facets.indexOf(facet), 1);
res.sendStatus(204);
},
});
|
;(function(dragula){
'use strict';
angular.module('angular-dragula', [])
.factory('ngDragulaFactory', ['$timeout', function($timeout){
function get(name){
return $timeout(function(){
if(name === 'get'){
throw new Error('RESERVE_WORD');
}
if(this[name]){
return this[name]
}else{
throw new Error('NOT_FOUND');
}
}.bind(this), 500)
};
return {
get: get
};
}])
.directive('ngDragula', ['ngDragulaFactory', function(ngDragulaFactory){
return {
restrict: 'A',
scope: {
config: '='
},
link: function(scope, element, attrs){
var drag = scope.config;
ngDragulaFactory[drag.name] = dragula(drag.elements, drag);
};
}
}]);
}(dragula));
|
/*!
*
* Super simple WYSIWYG editor v0.8.19
* https://summernote.org
*
*
* Copyright 2013- Alan Hong and contributors
* Summernote may be freely distributed under the MIT license.
*
* Date: 2021-10-13T19:41Z
*
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(self, function() {
return /******/ (() => { // webpackBootstrap
var __webpack_exports__ = {};
(function ($) {
$.extend($.summernote.lang, {
'cs-CZ': {
font: {
bold: 'Tučné',
italic: 'Kurzíva',
underline: 'Podtržené',
clear: 'Odstranit styl písma',
height: 'Výška řádku',
strikethrough: 'Přeškrtnuté',
size: 'Velikost písma'
},
image: {
image: 'Obrázek',
insert: 'Vložit obrázek',
resizeFull: 'Původní velikost',
resizeHalf: 'Poloviční velikost',
resizeQuarter: 'Čtvrteční velikost',
floatLeft: 'Umístit doleva',
floatRight: 'Umístit doprava',
floatNone: 'Neobtékat textem',
shapeRounded: 'Tvar: zaoblený',
shapeCircle: 'Tvar: kruh',
shapeThumbnail: 'Tvar: náhled',
shapeNone: 'Tvar: žádný',
dragImageHere: 'Přetáhnout sem obrázek',
dropImage: 'Přetáhnout obrázek nebo text',
selectFromFiles: 'Vybrat soubor',
url: 'URL obrázku',
remove: 'Odebrat obrázek',
original: 'Originál'
},
video: {
video: 'Video',
videoLink: 'Odkaz videa',
insert: 'Vložit video',
url: 'URL videa?',
providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion nebo Youku)'
},
link: {
link: 'Odkaz',
insert: 'Vytvořit odkaz',
unlink: 'Zrušit odkaz',
edit: 'Upravit',
textToDisplay: 'Zobrazovaný text',
url: 'Na jaké URL má tento odkaz vést?',
openInNewWindow: 'Otevřít v novém okně'
},
table: {
table: 'Tabulka',
addRowAbove: 'Přidat řádek nad',
addRowBelow: 'Přidat řádek pod',
addColLeft: 'Přidat sloupec vlevo',
addColRight: 'Přidat sloupec vpravo',
delRow: 'Smazat řádek',
delCol: 'Smazat sloupec',
delTable: 'Smazat tabulku'
},
hr: {
insert: 'Vložit vodorovnou čáru'
},
style: {
style: 'Styl',
p: 'Normální',
blockquote: 'Citace',
pre: 'Kód',
h1: 'Nadpis 1',
h2: 'Nadpis 2',
h3: 'Nadpis 3',
h4: 'Nadpis 4',
h5: 'Nadpis 5',
h6: 'Nadpis 6'
},
lists: {
unordered: 'Odrážkový seznam',
ordered: 'Číselný seznam'
},
options: {
help: 'Nápověda',
fullscreen: 'Celá obrazovka',
codeview: 'HTML kód'
},
paragraph: {
paragraph: 'Odstavec',
outdent: 'Zvětšit odsazení',
indent: 'Zmenšit odsazení',
left: 'Zarovnat doleva',
center: 'Zarovnat na střed',
right: 'Zarovnat doprava',
justify: 'Zarovnat oboustranně'
},
color: {
recent: 'Aktuální barva',
more: 'Další barvy',
background: 'Barva pozadí',
foreground: 'Barva písma',
transparent: 'Průhlednost',
setTransparent: 'Nastavit průhlednost',
reset: 'Obnovit',
resetToDefault: 'Obnovit výchozí',
cpSelect: 'Vybrat'
},
shortcut: {
shortcuts: 'Klávesové zkratky',
close: 'Zavřít',
textFormatting: 'Formátování textu',
action: 'Akce',
paragraphFormatting: 'Formátování odstavce',
documentStyle: 'Styl dokumentu'
},
help: {
'insertParagraph': 'Vložit odstavec',
'undo': 'Vrátit poslední příkaz',
'redo': 'Opakovat poslední příkaz',
'tab': 'Tab',
'untab': 'Untab',
'bold': 'Nastavit tučně',
'italic': 'Nastavit kurzívu',
'underline': 'Nastavit podtrhnutí',
'strikethrough': 'Nastavit přeškrtnutí',
'removeFormat': 'Ostranit nastavený styl',
'justifyLeft': 'Nastavit zarovnání vlevo',
'justifyCenter': 'Nastavit zarovnání na střed',
'justifyRight': 'Nastavit zarovnání vpravo',
'justifyFull': 'Nastavit zarovnání do bloku',
'insertUnorderedList': 'Aplikovat odrážkový seznam',
'insertOrderedList': 'Aplikovat číselný seznam',
'outdent': 'Zmenšit odsazení aktuálního odstavec',
'indent': 'Odsadit aktuální odstavec',
'formatPara': 'Změnit formátování aktuálního bloku na odstavec (P tag)',
'formatH1': 'Změnit formátování aktuálního bloku na Nadpis 1',
'formatH2': 'Změnit formátování aktuálního bloku na Nadpis 2',
'formatH3': 'Změnit formátování aktuálního bloku na Nadpis 3',
'formatH4': 'Změnit formátování aktuálního bloku na Nadpis 4',
'formatH5': 'Změnit formátování aktuálního bloku na Nadpis 5',
'formatH6': 'Změnit formátování aktuálního bloku na Nadpis 6',
'insertHorizontalRule': 'Vložit horizontální čáru',
'linkDialog.show': 'Zobrazit dialog pro odkaz'
},
history: {
undo: 'Krok vzad',
redo: 'Krok vpřed'
},
specialChar: {
specialChar: 'SPECIÁLNÍ ZNAKY',
select: 'Vyberte speciální znaky'
}
}
});
})(jQuery);
/******/ return __webpack_exports__;
/******/ })()
;
});
//# sourceMappingURL=summernote-cs-CZ.js.map
|
angular.module('contatooh').factory('Contato',function($resource){
return $resource('/contatos/:id');
});
|
import { MJMLElement } from 'mjml-core'
import React, { Component } from 'react'
const tagName = 'mj-table'
const parentTag = ['mj-column', 'mj-hero-content']
const endingTag = true
const defaultMJMLDefinition = {
content: '',
attributes: {
'align': 'left',
'cellpadding': '0',
'cellspacing': '0',
'color': '#000',
'container-background-color': null,
'font-family': 'Ubuntu, Helvetica, Arial, sans-serif',
'font-size': '13px',
'line-height': '22px',
'padding-bottom': null,
'padding-left': null,
'padding-right': null,
'padding-top': null,
'padding': '10px 25px',
'table-layout': 'auto',
'vertical-align': null,
'width': '100%'
}
}
@MJMLElement
class Table extends Component {
styles = this.getStyles()
getStyles () {
const { mjAttribute, defaultUnit } = this.props
return {
table: {
cellpadding: mjAttribute('cellspadding'),
cellspacing: mjAttribute('cellspacing'),
color: mjAttribute('color'),
fontFamily: mjAttribute('font-family'),
fontSize: defaultUnit(mjAttribute('font-size')),
lineHeight: mjAttribute('line-height'),
tableLayout: mjAttribute('table-layout')
}
}
}
render () {
const { mjAttribute, mjContent } = this.props
return (
<table
cellPadding={mjAttribute('cellpadding')}
cellSpacing={mjAttribute('cellspacing')}
dangerouslySetInnerHTML={{__html: mjContent() }}
data-legacy-border="0"
style={this.styles.table}
width={mjAttribute('width')} />
)
}
}
Table.tagName = tagName
Table.parentTag = parentTag
Table.endingTag = endingTag
Table.defaultMJMLDefinition = defaultMJMLDefinition
export default Table
|
/*
* Guerilla
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the MIT License.
*
* Retrieves the Logcat from an Android device.
*/
var path = require('path');
var fs = require('fs-extra');
function Logcat (context, exec) {
this.context = context;
this.exec = exec;
this.file = path.join(context.output_dir, 'logcat.txt');
}
Logcat.prototype.start = function (callback) {
var self = this;
var cmd = 'adb';
var args = [];
args.push('-s');
args.push(self.context.device.identifier);
args.push('logcat');
args.push('-v');
args.push('time');
var options = { log: [true, false, false, false], file: this.file };
self.process = self.exec(cmd, args, options, function () {});
if (callback) callback();
};
Logcat.prototype.stop = function (callback) {
if (this.process) this.process.kill();
if (callback) callback();
};
module.exports = Logcat;
|
(function () {
define(["jquery", "datatables", "datatables-tabletools", "datatables-colvis"], function ($) {
var achilles_heel = {};
achilles_heel.render = function (datasource) {
$('#reportAchillesHeel svg').remove();
$.ajax({
type: "GET",
url: getUrlFromData(datasource, "achillesheel"),
contentType: "application/json; charset=utf-8",
success: function (data) {
table_data = [];
for (i = 0; i < data.MESSAGES.ATTRIBUTEVALUE.length; i++) {
temp = data.MESSAGES.ATTRIBUTEVALUE[i];
message_type = temp.substring(0, temp.indexOf(':'));
message_content = temp.substring(temp.indexOf(':') + 1);
// RSD - A quick hack to put commas into large numbers.
// Found the regexp at:
// https://stackoverflow.com/questions/23104663/knockoutjs-format-numbers-with-commas
message_content = message_content.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
table_data[i] = {
'type': message_type,
'content': message_content
};
}
datatable = $('#achillesheel_table').DataTable({
dom: 'lfrt<"row"<"col-sm-4" i ><"col-sm-4" T ><"col-sm-4" p >>',
tableTools: {
"sSwfPath": "js/swf/copy_csv_xls_pdf.swf"
},
data: table_data,
columns: [
{
data: 'type',
visible: true,
width:200
},
{
data: 'content',
visible: true
}
],
pageLength: 15,
lengthChange: false,
deferRender: true,
destroy: true
});
$('#reportAchillesHeel').show();
}
});
}
return achilles_heel;
});
})();
|
scouts = new Meteor.Collection('scouts', {
schema: new SimpleSchema({
userId: {
type: String,
index: 1,
unique: true
},
scoutId: {
type: String,
optional: true
},
scoutStatusCode: {
type: String,
optional: true
},
scoutLand: {
type: String,
optional: true
},
scoutName: {
type: String,
optional: true
},
scoutBudget: {
type: Number,
optional: true
},
scoutSpent: {
type: Number,
optional: true
}
})
});
// Collection2 already does schema checking
// Add custom permission rules if needed
scouts.allow({
insert : function () {
return true;
},
update : function () {
return true;
},
remove : function () {
return true;
}
});
|
/* global angular: false */
/**
* WinchJS Factory - Maintain state of winch
*
* Written by Sean Cady
*/
angular.module('winch')
.factory('winchFactory', [function() {
//Basic API structure
var API = {
_img: {}
};
/**
* Register an image
* @param URL
* @param load
* @param validate
* @returns {boolean}
*/
API.registerImg = function(URL, load, validate) {
if (typeof load !== 'function') {
return false;
}
if (typeof validate !== 'function') {
return false;
}
if (typeof URL !== 'string' || URL.length < 1) {
return false;
}
if (API._img.hasOwnProperty(URL)) {
//If already loaded once (cached) trigger load immediately
if (API._img[URL].loaded) {
load();
} else {
API._img[URL].fnLoad.push(load);
API._img[URL].fnValidate.push(validate);
}
} else {
API._img[URL] = {
fnLoad: [load],
fnValidate: [validate],
loaded: false
};
}
return true;
};
/**
* Load all images with the same URL
* @param URL
*/
API.loadImage = function(URL) {
var index = 0, length;
if (API._img.hasOwnProperty(URL)) {
length = API._img[URL].fnLoad.length;
for (index = 0; index < length; index += 1) {
API._img[URL].fnLoad[index]();
}
API._img[URL] = {
loaded: true,
fnValidate: [],
fnLoad: []
};
}
};
/**
* Trigger validation of images
* @param URL - optional
*/
API.triggerValidation = function(URL) {
var imageIndex, imageKeys, validationIndex, validationLength;
if (URL && API._img[URL]) {
for (validationIndex = 0; validationIndex < API._img[URL].fnValidate.length; validationIndex += 1) {
if (API._img[URL].fnValidate[validationIndex]()) {
API.loadImage(URL);
}
}
} else if (!URL) {
imageKeys = Object.keys(API._img);
for (imageIndex = 0; imageIndex < imageKeys.length; imageIndex += 1) {
validationLength = API._img[imageKeys[imageIndex]].fnValidate.length;
for (validationIndex = 0; validationIndex < validationLength; validationIndex += 1) {
if (API._img[imageKeys[imageIndex]].fnValidate[validationIndex] &&
API._img[imageKeys[imageIndex]].fnValidate[validationIndex]()) {
API.loadImage(imageKeys[imageIndex]);
}
}
}
}
};
/**
* Store the current window Height and Width
* @param height
* @param width
*/
API.setWindowView = function(height, width) {
API.windowWidth = width;
API.windowHeight = height;
};
/**
* Return window width
* @returns number
*/
API.getWindowWidth = function() {
return API.windowWidth;
};
/**
* Return window height
* @returns number
*/
API.getWindowHeight = function() {
return API.windowHeight;
};
/**
* Returns an object of window bounding
* @returns {{top: number, bottom: number, left: number, right: number, vOffset: number, hOffset: number}}
*/
API.getMasterBox = function() {
return {
top: 0,
bottom: API.windowHeight,
left: 0,
right: API.windowWidth,
vOffset: 100,
hOffset: 100
};
};
return API;
}]);
|
exports.up = (knex, Promise) => {
return knex.schema.createTable('users', (table) => {
table.increments('id')
table.string('user_id')
// table.string('username')
table.string('server_id')
table.integer('quest_xp')
table.integer('message_xp')
table.dateTime('last_msg')
})
}
exports.down = (knex, Promise) => {
return knex.schema.dropTable('users')
}
|
'use strict';
/**
* Module dependencies.
*/
var coursesPolicy = require('../policies/courses.server.policy'),
courses = require('../controllers/courses.server.controller');
module.exports = function (app) {
// Articles collection routes
app.route('/api/courses').all(coursesPolicy.isAllowed)
.get(courses.list)
.post(courses.create);
// Single article routes
app.route('/api/courses/:articleId').all(coursesPolicy.isAllowed)
.get(courses.read)
.put(courses.update)
.delete(courses.delete);
// Finish by binding the article middleware
app.param('articleId', courses.articleByID);
};
|
/* global Flash */
export default class BlobViewer {
constructor() {
this.switcher = document.querySelector('.js-blob-viewer-switcher');
this.switcherBtns = document.querySelectorAll('.js-blob-viewer-switch-btn');
this.copySourceBtn = document.querySelector('.js-copy-blob-source-btn');
this.simpleViewer = document.querySelector('.blob-viewer[data-type="simple"]');
this.richViewer = document.querySelector('.blob-viewer[data-type="rich"]');
this.$fileHolder = $('.file-holder');
let initialViewerName = document.querySelector('.blob-viewer:not(.hidden)').getAttribute('data-type');
this.initBindings();
if (this.switcher && location.hash.indexOf('#L') === 0) {
initialViewerName = 'simple';
}
this.switchToViewer(initialViewerName);
}
initBindings() {
if (this.switcherBtns.length) {
Array.from(this.switcherBtns)
.forEach((el) => {
el.addEventListener('click', this.switchViewHandler.bind(this));
});
}
if (this.copySourceBtn) {
this.copySourceBtn.addEventListener('click', () => {
if (this.copySourceBtn.classList.contains('disabled')) return this.copySourceBtn.blur();
return this.switchToViewer('simple');
});
}
}
switchViewHandler(e) {
const target = e.currentTarget;
e.preventDefault();
this.switchToViewer(target.getAttribute('data-viewer'));
}
toggleCopyButtonState() {
if (!this.copySourceBtn) return;
if (this.simpleViewer.getAttribute('data-loaded')) {
this.copySourceBtn.setAttribute('title', 'Copy source to clipboard');
this.copySourceBtn.classList.remove('disabled');
} else if (this.activeViewer === this.simpleViewer) {
this.copySourceBtn.setAttribute('title', 'Wait for the source to load to copy it to the clipboard');
this.copySourceBtn.classList.add('disabled');
} else {
this.copySourceBtn.setAttribute('title', 'Switch to the source to copy it to the clipboard');
this.copySourceBtn.classList.add('disabled');
}
$(this.copySourceBtn).tooltip('fixTitle');
}
loadViewer(viewerParam) {
const viewer = viewerParam;
const url = viewer.getAttribute('data-url');
if (!url || viewer.getAttribute('data-loaded') || viewer.getAttribute('data-loading')) {
return;
}
viewer.setAttribute('data-loading', 'true');
$.ajax({
url,
dataType: 'JSON',
})
.fail(() => new Flash('Error loading source view'))
.done((data) => {
viewer.innerHTML = data.html;
$(viewer).syntaxHighlight();
viewer.setAttribute('data-loaded', 'true');
this.$fileHolder.trigger('highlight:line');
gl.utils.handleLocationHash();
this.toggleCopyButtonState();
});
}
switchToViewer(name) {
const newViewer = document.querySelector(`.blob-viewer[data-type='${name}']`);
if (this.activeViewer === newViewer) return;
const oldButton = document.querySelector('.js-blob-viewer-switch-btn.active');
const newButton = document.querySelector(`.js-blob-viewer-switch-btn[data-viewer='${name}']`);
const oldViewer = document.querySelector(`.blob-viewer:not([data-type='${name}'])`);
if (oldButton) {
oldButton.classList.remove('active');
}
if (newButton) {
newButton.classList.add('active');
newButton.blur();
}
if (oldViewer) {
oldViewer.classList.add('hidden');
}
newViewer.classList.remove('hidden');
this.activeViewer = newViewer;
this.toggleCopyButtonState();
this.loadViewer(newViewer);
}
}
|
/**
* Created by khuongdt on 12/07/2015.
* Author : khuongdt
* Copyright @ 2015 by OneSoft.,JSC
*/
goog.provide('com.onesoft.livetube.entity.SCLogout');
goog.require('bigfox.Global');
goog.require('bigfox.core.base.BaseMessage');
goog.require('com.onesoft.livetube.base.LiveTag');
com.onesoft.livetube.entity.SCLogout = function(tag,name,isCore){
goog.base(this,'constructor',tag || com.onesoft.livetube.base.LiveTag.SC_LOGOUT,name || 'SC_LOGOUT', isCore || false);
}
goog.inherits(com.onesoft.livetube.entity.SCLogout, bigfox.core.base.BaseMessage);
|
/* jslint node: true */
'use strict';
var cfg = require('../../../config.json');
exports.validNick = function(nickname) {
var regex = /^\w*$/;
return regex.exec(nickname) !== null;
};
// determine mass from radius of circle
exports.massToRadius = function (mass) {
return 4 + Math.sqrt(mass) * 6;
};
// overwrite Math.log function
exports.log = (function () {
var log = Math.log;
return function (n, base) {
return log(n) / (base ? log(base) : 1);
};
})();
// get the Euclidean distance between the edges of two shapes
exports.getDistance = function (p1, p2) {
return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) - p1.radius - p2.radius;
};
exports.randomInRange = function (from, to) {
return Math.floor(Math.random() * (to - from)) + from;
};
// generate a random position within the field of play
exports.randomPosition = function (radius) {
return {
x: exports.randomInRange(radius, cfg.gameWidth - radius),
y: exports.randomInRange(radius, cfg.gameHeight - radius)
};
};
exports.uniformPosition = function(points, radius) {
var bestCandidate, maxDistance = 0;
var numberOfCandidates = 10;
if (points.length === 0) {
return exports.randomPosition(radius);
}
// Generate the cadidates
for (var ci = 0; ci < numberOfCandidates; ci++) {
var minDistance = Infinity;
var candidate = exports.randomPosition(radius);
candidate.radius = radius;
for (var pi = 0; pi < points.length; pi++) {
var distance = exports.getDistance(candidate, points[pi]);
if (distance < minDistance) {
minDistance = distance;
}
}
if (minDistance > maxDistance) {
bestCandidate = candidate;
maxDistance = minDistance;
} else {
return exports.randomPosition(radius);
}
}
return bestCandidate;
};
exports.findIndex = function(arr, id) {
var len = arr.length;
while (len--) {
if (arr[len].id === id) {
return len;
}
}
return -1;
};
exports.randomColor = function() {
var color = '#' + ('00000' + (Math.random() * (1 << 24) | 0).toString(16)).slice(-6);
var c = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(color);
var r = (parseInt(c[1], 16) - 32) > 0 ? (parseInt(c[1], 16) - 32) : 0;
var g = (parseInt(c[2], 16) - 32) > 0 ? (parseInt(c[2], 16) - 32) : 0;
var b = (parseInt(c[3], 16) - 32) > 0 ? (parseInt(c[3], 16) - 32) : 0;
return {
fill: color,
border: '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)
};
};
|
export const CODE_LENGTH = 12
export const ALL_DIGITS = /^\d+$/
export const normalizedValue = (value) => {
const { length } = value
const systemDigitMissing = !value.startsWith('0')
return length == CODE_LENGTH - 1 && systemDigitMissing ? '0' + value : value
}
export const passesCheckDigitVerification = (value) => {
const digits = value.split('')
const targetCheckDigit = parseInt(digits[CODE_LENGTH - 1], 10)
const targetDigits = digits.slice(0, CODE_LENGTH - 1)
const sum = targetDigits.reduce(function(total, digit, index) {
const isOneBasedOddPositionedNumber = index % 2 === 0
const parsedDigit = parseInt(digit, 10)
return total + (isOneBasedOddPositionedNumber ? parsedDigit * 3 : parsedDigit)
}, 0)
const sumModTen = sum % 10
const checkDigit = sumModTen === 0 ? sumModTen : 10 - sumModTen
return checkDigit === targetCheckDigit
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.