Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,1 @@ | ||
"use strict";!function a(b){function c(a){if(!a)return[];for(var b=[],d=0;d<a.length;d++){var f=a[d];if("string"==typeof f)b.push(f);else if("function"==typeof f)b.push(f);else if(Array.isArray(f))b=b.concat(c(f));else{if("object"!=typeof f||"number"!=typeof f.length)throw new e("Invalid dependency: "+JSON.stringify(f));b=b.concat(c(f))}}return b}function d(){var a=c(arguments),b={arguments:[],"function":null};if(!a.length)return b;"function"==typeof a[a.length-1]&&(b.function=a.splice(-1)[0]);for(var d in a){var f=a[d];if("string"!=typeof f)throw new e("Found "+typeof f+" but needed string: "+f);b.arguments.push(f)}return b}function e(a,b){a="Esquire: "+(a||"Unknown error");var c="";if(b&&b.length)for(var d=1;d<b.length;d++)b[d]&&(c+=" -> "+b[d]);if(c&&(a+=" resolving"+c),Error.call(this,a),this.message=a,this.stack){var e=this.stack;e=e.replace(new RegExp("^"+this.name+"\n"),""),this.stack=this.name+": "+this.message+"\n"+e}}function f(a,b){e.call(this,"Module '"+a+"' not found",b)}function g(a,b){e.call(this,"Module '"+a+"' has circular dependencies",b)}function h(a,b,c){a=j(a);for(var d in b)b[d]=j(b[d]);Object.defineProperty(this,"name",{enumerable:!0,configurable:!1,value:a}),Object.defineProperty(this,"dependencies",{enumerable:!0,configurable:!1,value:b}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!1,value:c});var e=this.$$dynamic?this.$$dynamic:!1;Object.defineProperty(this,"$$dynamic",{enumerable:!1,configurable:!1,value:e}),Object.defineProperty(this,"$$script",{enumerable:!1,configurable:!1,get:function(){return"Esquire.define("+JSON.stringify(this.name)+","+JSON.stringify(this.dependencies)+","+c.toString()+");"}}),Object.freeze(this)}function i(a){return/^\$global[\/\.].+/.test(a)}function j(a){return i(a)?"$global/"+a.substring(8):a}function k(a){this.$$dynamic=!0,h.call(this,a,["$global"],function(a){function b(a,c,d){if(!d&&a in c)return c[a];var e=["Ms","ms","Moz","moz","WebKit","webkit"];for(var f in e){var g=e[f]+a;if(g in c)return c[g]}return a[0]!==a[0].toUpperCase()?b(a[0].toUpperCase()+a.substring(1),c,!0):void 0}function c(a,d){if(!d)return void 0;if(!a)return void 0;switch(a.length){case 0:return void 0;case 1:return b(a[0],d);default:return c(a.slice(1),b(a[0],d))}}return c(this.name.substring(8).split("."),a)})}function l(){if(1==arguments.length&&arguments[0].name&&arguments[0].constructor){var a=arguments[0];return l(a.name,a.dependencies||[],a.constructor)}var b,c,f=d(arguments),g=[];if(!f.arguments.length)throw new e("No module name specified");if(b=j(f.arguments.splice(0,1)[0]),g=f.arguments,o[b])throw new e("Module '"+b+"' already defined");if(!f.function)throw new e("No constructor function specified for module '"+b+"'");return c=f.function,o[b]=new h(b,g,c),o[b]}function m(a,b,c){if(c||(c=[]),!a)throw new e("No module or module name specified");if("string"==typeof a){if(!o[a])throw new f(p,c);a=o[a]}if(c.indexOf(a.name)>=0)throw new g(a.name,c);var d=[];c.push(a.name);for(var h in a.dependencies){var j=a.dependencies[h],l=o[j];if(l){if(d.push(l),b){var n=m(l,c);for(var p in n)d.push(n[p])}}else{if(!i(j))throw new f(a.dependencies[h],c);d.push(new k(j))}}return c.pop(),d}function n(){function a(b,c){if(g[b.name])return g[b.name];var d=m(b,!1,c),e=[];for(var f in d){var h=d[f];g[h.name]?e.push(g[h.name]):(c.push(b.name),e.push(a(h,c)),c.pop())}var i=b.constructor.apply(b,e);return b.name&&!b.$$dynamic&&(g[b.name]=i),i}function c(){return 1==arguments.length&&"string"==typeof arguments[0]?f([arguments[0]],function(a){return a}):f(arguments,function(){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b]);return a})}function f(){var b=d(arguments);if(!b.function)throw new e("Callback for injection unspecified");var c=new h(null,b.arguments,b.function);return a(c,[])}if(!(this instanceof n))return new Deferred;var g={$global:b,$esquire:this};Object.defineProperties(this,{inject:{enumerable:!0,configurable:!1,value:f},require:{enumerable:!0,configurable:!1,value:c}})}e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.name="EsquireError",f.prototype=Object.create(e.prototype),f.prototype.constructor=f,f.prototype.name="NoModuleError",g.prototype=Object.create(e.prototype),g.prototype.constructor=g,g.prototype.name="CircularDependencyError";var o={$global:new h("$global",[],function(){throw new e("The constructor for '$global' should not be called'")}),$esquire:new h("$esquire",[],function(){throw new e("The constructor for '$esquire' should not be called'")})};if(Object.defineProperties(n,{define:{enumerable:!0,configurable:!1,value:l},resolve:{enumerable:!0,configurable:!1,value:m},$$normalize:{enumerable:!1,configurable:!1,value:d},$$script:{enumerable:!1,configurable:!1,value:a.toString()},modules:{enumerable:!0,configurable:!1,get:function(){var a={};for(var b in o)a[b]=o[b];return Object.freeze(a)}},module:{enumerable:!0,configurable:!1,value:function(a){return a=j(a),a in o?o[a]:i(a)?new k(a):null}}}),b.Esquire)for(var p in b.Esquire)Object.defineProperty(n,p,{enumerable:!0,configurable:!1,value:b.Esquire[p]});b.Esquire=n;var q=new n;b.esquire=function(){if(0==arguments.length)throw new e("No dependencies/callback specified");var a=d(arguments);return a.function?q.inject(a.arguments,a.function):q.require(1==arguments.length&&"string"==typeof arguments[0]?arguments[0]:a.arguments)}}(function(){try{return window}catch(a){return global}}()); | ||
"use strict";!function a(b){function c(a){if(!a)return[];for(var b=[],d=0;d<a.length;d++){var f=a[d];if("string"==typeof f)b.push(f);else if("function"==typeof f)b.push(f);else if(Array.isArray(f))b=b.concat(c(f));else{if("object"!=typeof f||"number"!=typeof f.length)throw new e("Invalid dependency: "+JSON.stringify(f));b=b.concat(c(f))}}return b}function d(){var a=c(arguments),b={arguments:[],"function":null};if(!a.length)return b;"function"==typeof a[a.length-1]&&(b.function=a.splice(-1)[0]);for(var d in a){var f=a[d];if("string"!=typeof f)throw new e("Found "+typeof f+" but needed string: "+f);b.arguments.push(f)}return b}function e(a,b){a="Esquire: "+(a||"Unknown error");var c="";if(b&&b.length)for(var d=1;d<b.length;d++)b[d]&&(c+=" -> "+b[d]);if(c&&(a+=" resolving"+c),Error.call(this,a),this.message=a,this.stack){var e=this.stack;e=e.replace(new RegExp("^"+this.name+"\n"),""),this.stack=this.name+": "+this.message+"\n"+e}}function f(a,b){e.call(this,"Module '"+a+"' not found",b)}function g(a,b){e.call(this,"Module '"+a+"' has circular dependencies",b)}function h(a,b,c,d){a=j(a);for(var e in b)b[e]=j(b[e]);Object.defineProperty(this,"name",{enumerable:!0,configurable:!1,value:a}),Object.defineProperty(this,"dependencies",{enumerable:!0,configurable:!1,value:b}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!1,value:c}),Object.defineProperty(this,"$$dynamic",{enumerable:!1,configurable:!1,value:d||!1}),Object.defineProperty(this,"$$script",{enumerable:!1,configurable:!1,get:function(){return"Esquire.define("+JSON.stringify(this.name)+","+JSON.stringify(this.dependencies)+","+c.toString()+");"}}),Object.freeze(this)}function i(a){return/^\$global[\/\.].+/.test(a)}function j(a){return i(a)?"$global/"+a.substring(8):a}function k(a){h.call(this,a,["$global"],function(a){function b(a,c,d){if(!d&&a in c)return c[a];var e=["Ms","ms","Moz","moz","WebKit","webkit"];for(var f in e){var g=e[f]+a;if(g in c)return c[g]}return a[0]!==a[0].toUpperCase()?b(a[0].toUpperCase()+a.substring(1),c,!0):void 0}function c(a,d){if(!d)return void 0;if(!a)return void 0;switch(a.length){case 0:return void 0;case 1:return b(a[0],d);default:return c(a.slice(1),b(a[0],d))}}return c(this.name.substring(8).split("."),a)},!0)}function l(){if(1==arguments.length&&arguments[0].name&&arguments[0].constructor){var a=arguments[0];return l(a.name,a.dependencies||[],a.constructor)}var b,c,f=d(arguments),g=[];if(!f.arguments.length)throw new e("No module name specified");if(b=j(f.arguments.splice(0,1)[0]),g=f.arguments,o[b])throw new e("Module '"+b+"' already defined");if(!f.function)throw new e("No constructor function specified for module '"+b+"'");return c=f.function,o[b]=new h(b,g,c),o[b]}function m(a,b,c){if(c||(c=[]),!a)throw new e("No module or module name specified");if("string"==typeof a){if(!o[a])throw new f(p,c);a=o[a]}if(c.indexOf(a.name)>=0)throw new g(a.name,c);var d=[];c.push(a.name);for(var h in a.dependencies){var j=a.dependencies[h],l=o[j];if(l){if(d.push(l),b){var n=m(l,c);for(var p in n)d.push(n[p])}}else{if(!i(j))throw new f(a.dependencies[h],c);d.push(new k(j))}}return c.pop(),d}function n(){function a(b,c){if(g[b.name])return g[b.name];var d=m(b,!1,c),e=[];for(var f in d){var h=d[f];g[h.name]?e.push(g[h.name]):(c.push(b.name),e.push(a(h,c)),c.pop())}var i=b.constructor.apply(b,e);return b.name&&!b.$$dynamic&&(g[b.name]=i),i}function c(){return 1==arguments.length&&"string"==typeof arguments[0]?f([arguments[0]],function(a){return a}):f(arguments,function(){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b]);return a})}function f(){var b=d(arguments);if(!b.function)throw new e("Callback for injection unspecified");var c=new h(null,b.arguments,b.function);return a(c,[])}if(!(this instanceof n))return new Deferred;var g={$global:b,$esquire:this};Object.defineProperties(this,{inject:{enumerable:!0,configurable:!1,value:f},require:{enumerable:!0,configurable:!1,value:c}})}e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.name="EsquireError",f.prototype=Object.create(e.prototype),f.prototype.constructor=f,f.prototype.name="NoModuleError",g.prototype=Object.create(e.prototype),g.prototype.constructor=g,g.prototype.name="CircularDependencyError",k.prototype=Object.create(h.prototype),k.prototype.constructor=k,k.prototype.name="GlobalModule";var o={$global:new h("$global",[],function(){throw new e("The constructor for '$global' should not be called'")},!0),$esquire:new h("$esquire",[],function(){throw new e("The constructor for '$esquire' should not be called'")},!0)};if(Object.defineProperties(n,{define:{enumerable:!0,configurable:!1,value:l},resolve:{enumerable:!0,configurable:!1,value:m},$$normalize:{enumerable:!1,configurable:!1,value:d},$$script:{enumerable:!1,configurable:!1,value:a.toString()},modules:{enumerable:!0,configurable:!1,get:function(){var a={};for(var b in o)a[b]=o[b];return Object.freeze(a)}},module:{enumerable:!0,configurable:!1,value:function(a){return a=j(a),a in o?o[a]:i(a)?new k(a):null}}}),b.Esquire)for(var p in b.Esquire)Object.defineProperty(n,p,{enumerable:!0,configurable:!1,value:b.Esquire[p]});b.Esquire=n;var q=new n;b.esquire=function(){if(0==arguments.length)throw new e("No dependencies/callback specified");var a=d(arguments);return a.function?q.inject(a.arguments,a.function):q.require(1==arguments.length&&"string"==typeof arguments[0]?arguments[0]:a.arguments)}}(function(){try{return window}catch(a){return global}}()); |
@@ -1,1 +0,1 @@ | ||
"use strict";!function a(b){function c(a){if(!a)return[];for(var b=[],d=0;d<a.length;d++){var f=a[d];if("string"==typeof f)b.push(f);else if("function"==typeof f)b.push(f);else if(Array.isArray(f))b=b.concat(c(f));else{if("object"!=typeof f||"number"!=typeof f.length)throw new e("Invalid dependency: "+JSON.stringify(f));b=b.concat(c(f))}}return b}function d(){var a=c(arguments),b={arguments:[],"function":null};if(!a.length)return b;"function"==typeof a[a.length-1]&&(b.function=a.splice(-1)[0]);for(var d in a){var f=a[d];if("string"!=typeof f)throw new e("Found "+typeof f+" but needed string: "+f);b.arguments.push(f)}return b}function e(a,b){a="Esquire: "+(a||"Unknown error");var c="";if(b&&b.length)for(var d=1;d<b.length;d++)b[d]&&(c+=" -> "+b[d]);if(c&&(a+=" resolving"+c),Error.call(this,a),this.message=a,this.stack){var e=this.stack;e=e.replace(new RegExp("^"+this.name+"\n"),""),this.stack=this.name+": "+this.message+"\n"+e}}function f(a,b){e.call(this,"Module '"+a+"' not found",b)}function g(a,b){e.call(this,"Module '"+a+"' has circular dependencies",b)}function h(a,b,c){a=j(a);for(var d in b)b[d]=j(b[d]);Object.defineProperty(this,"name",{enumerable:!0,configurable:!1,value:a}),Object.defineProperty(this,"dependencies",{enumerable:!0,configurable:!1,value:b}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!1,value:c});var e=this.$$dynamic?this.$$dynamic:!1;Object.defineProperty(this,"$$dynamic",{enumerable:!1,configurable:!1,value:e}),Object.defineProperty(this,"$$script",{enumerable:!1,configurable:!1,get:function(){return"Esquire.define("+JSON.stringify(this.name)+","+JSON.stringify(this.dependencies)+","+c.toString()+");"}}),Object.freeze(this)}function i(a){return/^\$global[\/\.].+/.test(a)}function j(a){return i(a)?"$global/"+a.substring(8):a}function k(a){this.$$dynamic=!0,h.call(this,a,["$global"],function(a){function b(a,c,d){if(!d&&a in c)return c[a];var e=["Ms","ms","Moz","moz","WebKit","webkit"];for(var f in e){var g=e[f]+a;if(g in c)return c[g]}return a[0]!==a[0].toUpperCase()?b(a[0].toUpperCase()+a.substring(1),c,!0):void 0}function c(a,d){if(!d)return void 0;if(!a)return void 0;switch(a.length){case 0:return void 0;case 1:return b(a[0],d);default:return c(a.slice(1),b(a[0],d))}}return c(this.name.substring(8).split("."),a)})}function l(){if(1==arguments.length&&arguments[0].name&&arguments[0].constructor){var a=arguments[0];return l(a.name,a.dependencies||[],a.constructor)}var b,c,f=d(arguments),g=[];if(!f.arguments.length)throw new e("No module name specified");if(b=j(f.arguments.splice(0,1)[0]),g=f.arguments,o[b])throw new e("Module '"+b+"' already defined");if(!f.function)throw new e("No constructor function specified for module '"+b+"'");return c=f.function,o[b]=new h(b,g,c),o[b]}function m(a,b,c){if(c||(c=[]),!a)throw new e("No module or module name specified");if("string"==typeof a){if(!o[a])throw new f(p,c);a=o[a]}if(c.indexOf(a.name)>=0)throw new g(a.name,c);var d=[];c.push(a.name);for(var h in a.dependencies){var j=a.dependencies[h],l=o[j];if(l){if(d.push(l),b){var n=m(l,c);for(var p in n)d.push(n[p])}}else{if(!i(j))throw new f(a.dependencies[h],c);d.push(new k(j))}}return c.pop(),d}function n(){function a(b,c){if(g[b.name])return g[b.name];var d=m(b,!1,c),e=[];for(var f in d){var h=d[f];g[h.name]?e.push(g[h.name]):(c.push(b.name),e.push(a(h,c)),c.pop())}var i=b.constructor.apply(b,e);return b.name&&!b.$$dynamic&&(g[b.name]=i),i}function c(){return 1==arguments.length&&"string"==typeof arguments[0]?f([arguments[0]],function(a){return a}):f(arguments,function(){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b]);return a})}function f(){var b=d(arguments);if(!b.function)throw new e("Callback for injection unspecified");var c=new h(null,b.arguments,b.function);return a(c,[])}if(!(this instanceof n))return new Deferred;var g={$global:b,$esquire:this};Object.defineProperties(this,{inject:{enumerable:!0,configurable:!1,value:f},require:{enumerable:!0,configurable:!1,value:c}})}e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.name="EsquireError",f.prototype=Object.create(e.prototype),f.prototype.constructor=f,f.prototype.name="NoModuleError",g.prototype=Object.create(e.prototype),g.prototype.constructor=g,g.prototype.name="CircularDependencyError";var o={$global:new h("$global",[],function(){throw new e("The constructor for '$global' should not be called'")}),$esquire:new h("$esquire",[],function(){throw new e("The constructor for '$esquire' should not be called'")})};if(Object.defineProperties(n,{define:{enumerable:!0,configurable:!1,value:l},resolve:{enumerable:!0,configurable:!1,value:m},$$normalize:{enumerable:!1,configurable:!1,value:d},$$script:{enumerable:!1,configurable:!1,value:a.toString()},modules:{enumerable:!0,configurable:!1,get:function(){var a={};for(var b in o)a[b]=o[b];return Object.freeze(a)}},module:{enumerable:!0,configurable:!1,value:function(a){return a=j(a),a in o?o[a]:i(a)?new k(a):null}}}),b.Esquire)for(var p in b.Esquire)Object.defineProperty(n,p,{enumerable:!0,configurable:!1,value:b.Esquire[p]});b.Esquire=n;var q=new n;b.esquire=function(){if(0==arguments.length)throw new e("No dependencies/callback specified");var a=d(arguments);return a.function?q.inject(a.arguments,a.function):q.require(1==arguments.length&&"string"==typeof arguments[0]?arguments[0]:a.arguments)}}(function(){try{return window}catch(a){return global}}()),function(a){function b(a,c){var d=0,e=null,f=[],g=function(b){if(b&&"function"==typeof b.then)b.then(function(a){g(a)},function(a){h(a)});else if(0==d){if(e=b,d=1,a)try{e=a(e)}catch(c){e=c,d=-1}j(f)}},h=function(a){if(0==d){if(e=a,d=-1,c)try{e=c(e),d=1}catch(b){e=b}j(f)}},i=function(a,c){var e=new b(a,c);return 0==d?f.push(e):j([e]),e.promise},j=function(a){var b=d>0?"resolve":0>d?"reject":null;if(b)for(var c in a)a[c][b](e)},k=Object.defineProperties(new Object,{then:{enumerable:!0,configurable:!1,value:i},"catch":{enumerable:!0,configurable:!1,value:function(a){return i(null,a)}}});return Object.defineProperties(this,{promise:{enumerable:!0,configurable:!1,value:k},resolve:{enumerable:!0,configurable:!1,value:g},reject:{enumerable:!0,configurable:!1,value:h}})}function c(a){if(!a)return[];for(var b=[],d=0;d<a.length;d++){var e=a[d];if("string"==typeof e)b.push(e);else{if(!Array.isArray(e))throw new Error("Esquire: Invalid dependency: "+e);b=b.concat(c(e))}}return b}function d(a){var b=a.filename||a.target&&a.target.src;if(i[b]){if(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),a.target&&a.target.parentNode)try{a.target.parentNode.removeChild(a.target)}catch(c){}var d=i[b];return delete i[b],d.remaining-=1,{script:b,promise:d}}}function e(a){var b=d(a);b&&(console.debug("Esquire: Successfully loaded script '",b.script,"'"),0==b.promise.remaining&&b.promise.resolve(Esquire.modules))}function f(a){var b=d(a);if(b){console.warn("Esquire: Unable to load script '",b.script,"'");var c=a.error||new Error("Unable to load script '"+b.script+"'");b.promise.reject(c)}}function g(){if(!j)throw new Error("Esquire: Document not available");var a=j.getElementsByTagName("script")[0],d=a.parentNode,g=new b(function(a){return a},function(a){throw a});g.remaining=0;var k=c(arguments),l=[];for(var m in k)!function(a){var b=j.createElement("script");b.async=!0,b.defer=!0,b.src=a,a=b.src,h[a]?console.debug("Esquire: Script '"+a+"' already loaded"):i[a]?console.debug("Esquire: Script '"+a+"' already being loaded"):(b.addEventListener("load",e,!1),b.addEventListener("error",f,!1),i[a]=g,g.remaining+=1,l.push(b))}(k[m]);if(0==l.length)g.resolve(Esquire.modules);else for(var m in l)console.debug("Esquire: About to load '"+l[m].src+"'"),d.insertBefore(l[m],a);return g.promise}var h={},i={};a.addEventListener("error",f,!0);var j=a.document;a.Esquire||(a.Esquire={}),a.Esquire.load=g}(window); | ||
"use strict";!function a(b){function c(a){if(!a)return[];for(var b=[],d=0;d<a.length;d++){var f=a[d];if("string"==typeof f)b.push(f);else if("function"==typeof f)b.push(f);else if(Array.isArray(f))b=b.concat(c(f));else{if("object"!=typeof f||"number"!=typeof f.length)throw new e("Invalid dependency: "+JSON.stringify(f));b=b.concat(c(f))}}return b}function d(){var a=c(arguments),b={arguments:[],"function":null};if(!a.length)return b;"function"==typeof a[a.length-1]&&(b.function=a.splice(-1)[0]);for(var d in a){var f=a[d];if("string"!=typeof f)throw new e("Found "+typeof f+" but needed string: "+f);b.arguments.push(f)}return b}function e(a,b){a="Esquire: "+(a||"Unknown error");var c="";if(b&&b.length)for(var d=1;d<b.length;d++)b[d]&&(c+=" -> "+b[d]);if(c&&(a+=" resolving"+c),Error.call(this,a),this.message=a,this.stack){var e=this.stack;e=e.replace(new RegExp("^"+this.name+"\n"),""),this.stack=this.name+": "+this.message+"\n"+e}}function f(a,b){e.call(this,"Module '"+a+"' not found",b)}function g(a,b){e.call(this,"Module '"+a+"' has circular dependencies",b)}function h(a,b,c,d){a=j(a);for(var e in b)b[e]=j(b[e]);Object.defineProperty(this,"name",{enumerable:!0,configurable:!1,value:a}),Object.defineProperty(this,"dependencies",{enumerable:!0,configurable:!1,value:b}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!1,value:c}),Object.defineProperty(this,"$$dynamic",{enumerable:!1,configurable:!1,value:d||!1}),Object.defineProperty(this,"$$script",{enumerable:!1,configurable:!1,get:function(){return"Esquire.define("+JSON.stringify(this.name)+","+JSON.stringify(this.dependencies)+","+c.toString()+");"}}),Object.freeze(this)}function i(a){return/^\$global[\/\.].+/.test(a)}function j(a){return i(a)?"$global/"+a.substring(8):a}function k(a){h.call(this,a,["$global"],function(a){function b(a,c,d){if(!d&&a in c)return c[a];var e=["Ms","ms","Moz","moz","WebKit","webkit"];for(var f in e){var g=e[f]+a;if(g in c)return c[g]}return a[0]!==a[0].toUpperCase()?b(a[0].toUpperCase()+a.substring(1),c,!0):void 0}function c(a,d){if(!d)return void 0;if(!a)return void 0;switch(a.length){case 0:return void 0;case 1:return b(a[0],d);default:return c(a.slice(1),b(a[0],d))}}return c(this.name.substring(8).split("."),a)},!0)}function l(){if(1==arguments.length&&arguments[0].name&&arguments[0].constructor){var a=arguments[0];return l(a.name,a.dependencies||[],a.constructor)}var b,c,f=d(arguments),g=[];if(!f.arguments.length)throw new e("No module name specified");if(b=j(f.arguments.splice(0,1)[0]),g=f.arguments,o[b])throw new e("Module '"+b+"' already defined");if(!f.function)throw new e("No constructor function specified for module '"+b+"'");return c=f.function,o[b]=new h(b,g,c),o[b]}function m(a,b,c){if(c||(c=[]),!a)throw new e("No module or module name specified");if("string"==typeof a){if(!o[a])throw new f(p,c);a=o[a]}if(c.indexOf(a.name)>=0)throw new g(a.name,c);var d=[];c.push(a.name);for(var h in a.dependencies){var j=a.dependencies[h],l=o[j];if(l){if(d.push(l),b){var n=m(l,c);for(var p in n)d.push(n[p])}}else{if(!i(j))throw new f(a.dependencies[h],c);d.push(new k(j))}}return c.pop(),d}function n(){function a(b,c){if(g[b.name])return g[b.name];var d=m(b,!1,c),e=[];for(var f in d){var h=d[f];g[h.name]?e.push(g[h.name]):(c.push(b.name),e.push(a(h,c)),c.pop())}var i=b.constructor.apply(b,e);return b.name&&!b.$$dynamic&&(g[b.name]=i),i}function c(){return 1==arguments.length&&"string"==typeof arguments[0]?f([arguments[0]],function(a){return a}):f(arguments,function(){for(var a=[],b=0;b<arguments.length;b++)a.push(arguments[b]);return a})}function f(){var b=d(arguments);if(!b.function)throw new e("Callback for injection unspecified");var c=new h(null,b.arguments,b.function);return a(c,[])}if(!(this instanceof n))return new Deferred;var g={$global:b,$esquire:this};Object.defineProperties(this,{inject:{enumerable:!0,configurable:!1,value:f},require:{enumerable:!0,configurable:!1,value:c}})}e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.name="EsquireError",f.prototype=Object.create(e.prototype),f.prototype.constructor=f,f.prototype.name="NoModuleError",g.prototype=Object.create(e.prototype),g.prototype.constructor=g,g.prototype.name="CircularDependencyError",k.prototype=Object.create(h.prototype),k.prototype.constructor=k,k.prototype.name="GlobalModule";var o={$global:new h("$global",[],function(){throw new e("The constructor for '$global' should not be called'")},!0),$esquire:new h("$esquire",[],function(){throw new e("The constructor for '$esquire' should not be called'")},!0)};if(Object.defineProperties(n,{define:{enumerable:!0,configurable:!1,value:l},resolve:{enumerable:!0,configurable:!1,value:m},$$normalize:{enumerable:!1,configurable:!1,value:d},$$script:{enumerable:!1,configurable:!1,value:a.toString()},modules:{enumerable:!0,configurable:!1,get:function(){var a={};for(var b in o)a[b]=o[b];return Object.freeze(a)}},module:{enumerable:!0,configurable:!1,value:function(a){return a=j(a),a in o?o[a]:i(a)?new k(a):null}}}),b.Esquire)for(var p in b.Esquire)Object.defineProperty(n,p,{enumerable:!0,configurable:!1,value:b.Esquire[p]});b.Esquire=n;var q=new n;b.esquire=function(){if(0==arguments.length)throw new e("No dependencies/callback specified");var a=d(arguments);return a.function?q.inject(a.arguments,a.function):q.require(1==arguments.length&&"string"==typeof arguments[0]?arguments[0]:a.arguments)}}(function(){try{return window}catch(a){return global}}()),function(a){function b(a,c){var d=0,e=null,f=[],g=function(b){if(b&&"function"==typeof b.then)b.then(function(a){g(a)},function(a){h(a)});else if(0==d){if(e=b,d=1,a)try{e=a(e)}catch(c){e=c,d=-1}j(f)}},h=function(a){if(0==d){if(e=a,d=-1,c)try{e=c(e),d=1}catch(b){e=b}j(f)}},i=function(a,c){var e=new b(a,c);return 0==d?f.push(e):j([e]),e.promise},j=function(a){var b=d>0?"resolve":0>d?"reject":null;if(b)for(var c in a)a[c][b](e)},k=Object.defineProperties(new Object,{then:{enumerable:!0,configurable:!1,value:i},"catch":{enumerable:!0,configurable:!1,value:function(a){return i(null,a)}}});return Object.defineProperties(this,{promise:{enumerable:!0,configurable:!1,value:k},resolve:{enumerable:!0,configurable:!1,value:g},reject:{enumerable:!0,configurable:!1,value:h}})}function c(a){if(!a)return[];for(var b=[],d=0;d<a.length;d++){var e=a[d];if("string"==typeof e)b.push(e);else{if(!Array.isArray(e))throw new Error("Esquire: Invalid dependency: "+e);b=b.concat(c(e))}}return b}function d(a){var b=a.filename||a.target&&a.target.src;if(i[b]){if(a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault(),a.target&&a.target.parentNode)try{a.target.parentNode.removeChild(a.target)}catch(c){}var d=i[b];return delete i[b],d.remaining-=1,{script:b,promise:d}}}function e(a){var b=d(a);b&&(console.debug("Esquire: Successfully loaded script '",b.script,"'"),0==b.promise.remaining&&b.promise.resolve(Esquire.modules))}function f(a){var b=d(a);if(b){console.warn("Esquire: Unable to load script '",b.script,"'");var c=a.error||new Error("Unable to load script '"+b.script+"'");b.promise.reject(c)}}function g(){if(!j)throw new Error("Esquire: Document not available");var a=j.getElementsByTagName("script")[0],d=a.parentNode,g=new b(function(a){return a},function(a){throw a});g.remaining=0;var k=c(arguments),l=[];for(var m in k)!function(a){var b=j.createElement("script");b.async=!0,b.defer=!0,b.src=a,a=b.src,h[a]?console.debug("Esquire: Script '"+a+"' already loaded"):i[a]?console.debug("Esquire: Script '"+a+"' already being loaded"):(b.addEventListener("load",e,!1),b.addEventListener("error",f,!1),i[a]=g,g.remaining+=1,l.push(b))}(k[m]);if(0==l.length)g.resolve(Esquire.modules);else for(var m in l)console.debug("Esquire: About to load '"+l[m].src+"'"),d.insertBefore(l[m],a);return g.promise}var h={},i={};a.addEventListener("error",f,!0);var j=a.document;a.Esquire||(a.Esquire={}),a.Esquire.load=g}(window); |
{ | ||
"name": "esquire", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "node-adapter.js", | ||
@@ -5,0 +5,0 @@ "description": "USRZ Esquire API", |
@@ -116,3 +116,3 @@ 'use strict'; | ||
*/ | ||
function Module(name, dependencies, constructor) { | ||
function Module(name, dependencies, constructor, dynamic) { | ||
@@ -147,4 +147,3 @@ /* Normalize names to "$global/..." */ | ||
/* Hidden $$script for injection and $$dynamic flag */ | ||
var dynamic = this.$$dynamic ? this.$$dynamic : false; | ||
Object.defineProperty(this, "$$dynamic", { enumerable: false, configurable: false, value: dynamic }); | ||
Object.defineProperty(this, "$$dynamic", { enumerable: false, configurable: false, value: dynamic || false }); | ||
Object.defineProperty(this, '$$script', { enumerable: false, configurable: false, get: function() { | ||
@@ -178,3 +177,2 @@ return 'Esquire.define(' + JSON.stringify(this.name) | ||
function GlobalModule(name) { | ||
this.$$dynamic = true; | ||
Module.call(this, name, ['$global'], function($global) { | ||
@@ -215,5 +213,10 @@ | ||
return find(this.name.substring(8).split('.'), $global); | ||
}); | ||
}, true); | ||
} | ||
GlobalModule.prototype = Object.create(Module.prototype); | ||
GlobalModule.prototype.constructor = GlobalModule; | ||
GlobalModule.prototype.name = "GlobalModule"; | ||
/* ======================================================================== */ | ||
@@ -227,6 +230,6 @@ /* Stuff exposed statically on the Exquire class */ | ||
throw new EsquireError("The constructor for '$global' should not be called'") | ||
}), | ||
}, true), | ||
"$esquire": new Module("$esquire", [], function() { | ||
throw new EsquireError("The constructor for '$esquire' should not be called'") | ||
}) | ||
}, true) | ||
}; | ||
@@ -233,0 +236,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97842
1858