From e16ee1cab26773b3e0ee13adf04091d8daba9f83 Mon Sep 17 00:00:00 2001 From: Steven Vergenz Date: Tue, 10 Jun 2014 12:29:19 -0400 Subject: [PATCH] Changed default collection from Async to Sync --- dist/xapicollection.min.js | 2 +- src/xapicollection.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/xapicollection.min.js b/dist/xapicollection.min.js index 0539d6d..10ad3a8 100644 --- a/dist/xapicollection.min.js +++ b/dist/xapicollection.min.js @@ -1,2 +1,2 @@ /*! xAPI-Dashboard v1.0.0 | Built on 06-10-2014 */ -"use strict";try{window.ADL=window.ADL||{}}catch(e){var window={ADL:{}}}try{var workerScript=document.querySelector('script[src*="xapicollection"]').src}catch(e){}Array.isArray||(Array.isArray=function(a){return a.length>=0&&!a.length}),function(a){function b(a,c){if(void 0===c)return null;if(0===a.length)return c;var d;if(Array.isArray(a))d=a;else{d=a.split(".");for(var e=0;e0&&console.log("Warning: Your browser does not support WebWorker transfers. Performance of this site may suffer as a result.")}function e(a){return function(){var b=Array.prototype.slice.call(arguments);return this._worker.postMessage(d.serialize([a].concat(b))),this}}c.prototype.exec=function(a){return a(this.contents),this.parent},c.prototype.save=function(){return new c(this)},c.prototype.append=function(a){return this.contents=this.contents.concat(a),this},c.prototype.where=function(a){function c(a){function b(a){var c=/^\s*\((.*)\)\s*$/.exec(a);return c?b(c[1]):d(a)}function c(a){for(var b=0,c=0;c=|<=|=|>|<)\s*(.*)\s*$/.exec(a);if(!b)return e;var c=h(b[1]),d=i(b[3]);if(!c)return e;if(d instanceof RegExp)return"="===b[2]?{op:"re",xpath:c,value:d}:"!="===b[2]?{op:"nre",xpath:c,value:d}:(console.error("Regex comparison only supports = and !="),e);switch(b[2]){case"=":return{op:"eq",xpath:c,value:d};case"!=":return{op:"neq",xpath:c,value:d};case"<":return{op:"lt",xpath:c,value:d};case"<=":return{op:"leq",xpath:c,value:d};case">":return{op:"gt",xpath:c,value:d};case">=":return{op:"geq",xpath:c,value:d};default:return e}}function h(a){var b=/^\s*([^\.]+(?:\.[^\.]+)*)\s*$/.exec(a);return b?b[1]:e}function i(a){var b=null;a=a.trim();var c=Number.isNaN||isNaN;return c(b=parseFloat(a))?(b=/^\s*"(.*)"\s*$/.exec(a))?b[1]:(b=/^\s*\/(.*)\/(i?)\s*$/.exec(a))?new RegExp(b[1],b[2]):"null"===a?null:"true"===a||"false"===a?"true"===a:e:b}var j=b(a);return j!=e?j:null}function d(a,c){if(Array.isArray(a.and)&&0===a.and.length)return!0;if(Array.isArray(a.or)&&0===a.or.length)return!1;if(!a.op)return a.and?d(a.and[0],c)?d({and:a.and.slice(1)},c):!1:a.or?d(a.or[0],c)?!0:d({or:a.or.slice(1)},c):!1;switch(a.op){case"eq":return b(a.xpath,c)===a.value;case"neq":return b(a.xpath,c)!==a.value;case"geq":return b(a.xpath,c)>=a.value;case"leq":return b(a.xpath,c)<=a.value;case"lt":return b(a.xpath,c)a.value;case"re":return a.value.test(b(a.xpath,c));case"nre":return!a.value.test(b(a.xpath,c));default:return!1}}var e=0/0;if(!a)return this;var f=c(a);if(!f)return void console.error("Invalid where expression: "+a);for(var g=0;g0)for(var e=this.contents,f=0;f0)for(var g=0;gf?-1:1)*c}),this},c.prototype._groupByRange=function(a,c){if(!Array.isArray(c)||3!==c.length||c[2]%1!==0)return this.groupBy(a);var d,e,f=c[0],g=c[1],h=c[2];"string"==typeof f&&"string"==typeof g&&Date.parse(f)&&Date.parse(g)?(d=function(a){return Date.parse(a)},e=function(a,b){var c=new Date(Date.parse(a)+b);return c.toISOString()}):"string"==typeof f&&"string"==typeof g?(d=function(a){return a.charAt(0).toLowerCase().charCodeAt(0)-"a".charCodeAt(0)},e=function(a,b){return String.fromCharCode(a.charAt(0).toLowerCase().charCodeAt(0)+b)}):(d=function(a){return a},e=function(a,b){return a+b});var i=[];if((d(g)-d(f))*h<=0)console.error("Group range is open, cannot generate groups!"),console.log(JSON.stringify(c)),i=[f,g];else{if(d(f)>d(g))return groupByRange(a,[g,f,-h]),void dataStack.push(dataStack.pop().reverse());for(var j=f;d(j)0){for(var d=0;d0){for(var f=0;f0){for(var f=0;f0?h/j.data.length:0,j.sample=j.data[0],g.push(j)}return this.contents=g,this},c.prototype.min=function(a,d){if(!a)return this;var e=this.contents,f=[];if(e[0]&&e[0].group&&e[0].data){if(d&&d>0){for(var g=0;g0){for(var f=0;f=0&&!a.length}),function(a){function b(a,c){if(void 0===c)return null;if(0===a.length)return c;var d;if(Array.isArray(a))d=a;else{d=a.split(".");for(var e=0;e0&&console.log("Warning: Your browser does not support WebWorker transfers. Performance of this site may suffer as a result.")}function e(a){return function(){var b=Array.prototype.slice.call(arguments);return this._worker.postMessage(d.serialize([a].concat(b))),this}}c.prototype.exec=function(a){return a(this.contents),this.parent},c.prototype.save=function(){return new c(this)},c.prototype.append=function(a){return this.contents=this.contents.concat(a),this},c.prototype.where=function(a){function c(a){function b(a){var c=/^\s*\((.*)\)\s*$/.exec(a);return c?b(c[1]):d(a)}function c(a){for(var b=0,c=0;c=|<=|=|>|<)\s*(.*)\s*$/.exec(a);if(!b)return e;var c=h(b[1]),d=i(b[3]);if(!c)return e;if(d instanceof RegExp)return"="===b[2]?{op:"re",xpath:c,value:d}:"!="===b[2]?{op:"nre",xpath:c,value:d}:(console.error("Regex comparison only supports = and !="),e);switch(b[2]){case"=":return{op:"eq",xpath:c,value:d};case"!=":return{op:"neq",xpath:c,value:d};case"<":return{op:"lt",xpath:c,value:d};case"<=":return{op:"leq",xpath:c,value:d};case">":return{op:"gt",xpath:c,value:d};case">=":return{op:"geq",xpath:c,value:d};default:return e}}function h(a){var b=/^\s*([^\.]+(?:\.[^\.]+)*)\s*$/.exec(a);return b?b[1]:e}function i(a){var b=null;a=a.trim();var c=Number.isNaN||isNaN;return c(b=parseFloat(a))?(b=/^\s*"(.*)"\s*$/.exec(a))?b[1]:(b=/^\s*\/(.*)\/(i?)\s*$/.exec(a))?new RegExp(b[1],b[2]):"null"===a?null:"true"===a||"false"===a?"true"===a:e:b}var j=b(a);return j!=e?j:null}function d(a,c){if(Array.isArray(a.and)&&0===a.and.length)return!0;if(Array.isArray(a.or)&&0===a.or.length)return!1;if(!a.op)return a.and?d(a.and[0],c)?d({and:a.and.slice(1)},c):!1:a.or?d(a.or[0],c)?!0:d({or:a.or.slice(1)},c):!1;switch(a.op){case"eq":return b(a.xpath,c)===a.value;case"neq":return b(a.xpath,c)!==a.value;case"geq":return b(a.xpath,c)>=a.value;case"leq":return b(a.xpath,c)<=a.value;case"lt":return b(a.xpath,c)a.value;case"re":return a.value.test(b(a.xpath,c));case"nre":return!a.value.test(b(a.xpath,c));default:return!1}}var e=0/0;if(!a)return this;var f=c(a);if(!f)return void console.error("Invalid where expression: "+a);for(var g=0;g0)for(var e=this.contents,f=0;f0)for(var g=0;gf?-1:1)*c}),this},c.prototype._groupByRange=function(a,c){if(!Array.isArray(c)||3!==c.length||c[2]%1!==0)return this.groupBy(a);var d,e,f=c[0],g=c[1],h=c[2];"string"==typeof f&&"string"==typeof g&&Date.parse(f)&&Date.parse(g)?(d=function(a){return Date.parse(a)},e=function(a,b){var c=new Date(Date.parse(a)+b);return c.toISOString()}):"string"==typeof f&&"string"==typeof g?(d=function(a){return a.charAt(0).toLowerCase().charCodeAt(0)-"a".charCodeAt(0)},e=function(a,b){return String.fromCharCode(a.charAt(0).toLowerCase().charCodeAt(0)+b)}):(d=function(a){return a},e=function(a,b){return a+b});var i=[];if((d(g)-d(f))*h<=0)console.error("Group range is open, cannot generate groups!"),console.log(JSON.stringify(c)),i=[f,g];else{if(d(f)>d(g))return groupByRange(a,[g,f,-h]),void dataStack.push(dataStack.pop().reverse());for(var j=f;d(j)0){for(var d=0;d0){for(var f=0;f0){for(var f=0;f0?h/j.data.length:0,j.sample=j.data[0],g.push(j)}return this.contents=g,this},c.prototype.min=function(a,d){if(!a)return this;var e=this.contents,f=[];if(e[0]&&e[0].group&&e[0].data){if(d&&d>0){for(var g=0;g0){for(var f=0;f