Comparing version 0.0.24 to 0.0.25
@@ -5,4 +5,4 @@ | ||
/* | ||
* @version 0.0.24 | ||
* @date 2014-09-19 | ||
* @version 0.0.25 | ||
* @date 2014-10-04 | ||
* @stability 1 - Experimental | ||
@@ -32,3 +32,2 @@ * @author Lauri Rooden <lauri@rooden.ee> | ||
, unsentErrors = [] | ||
, esc = escape | ||
, oldOnError = window.onerror | ||
@@ -51,6 +50,6 @@ | ||
if (lastError === (lastError = | ||
[ esc(file) | ||
[ file | ||
, line | ||
, _col || (window.event || args).errorCharacter || "?" | ||
, esc(message) | ||
, message | ||
].join(":") | ||
@@ -65,3 +64,5 @@ )) return | ||
for (args = args.callee; args = args && args.caller; ) { | ||
stack += args.toString().split(/[ {]+/)[1] + "\n" | ||
//stack += args.toString().split(/[ {]+/)[1] + "\n" | ||
// TODO:2014-09-26:lauri:test with IE | ||
stack += ("" + args).split(/ |{/)[1] + "\n" | ||
} | ||
@@ -71,8 +72,7 @@ } | ||
unsentErrors.push( | ||
[ 1 // format version | ||
[ lastError | ||
, stack | ||
, +new Date() | ||
, lastError | ||
, esc(stack) | ||
, esc(window.location) | ||
].join(":") | ||
, window.location | ||
].join("\n") | ||
) | ||
@@ -79,0 +79,0 @@ } |
@@ -1,3 +0,3 @@ | ||
!function(b,n,t){function u(){}function p(a,b,d){a[b]||(a[b]=new Function("a,b,c,d",d))}function e(a,b,d){var c=q.shift()||new XMLHttpRequest;c.open(a,b,!0!==d);!0!==d&&(c.onreadystatechange=function(){4==c.readyState&&(a=c.status,d&&d.call(c,(200>a||299<a)&&304!==a&&1223!==a&&a,c.responseText),c.onreadystatechange=d=u,q.push(c))});return c}function r(a,b){"string"==typeof a&&(a=[a]);for(var d=a.length,c=d,h=[];c--;)!function(c){e("GET",a[c],function(a,e){h[c]=a?"":e;--d||(execScript(h.join("/**/;")), | ||
b&&b(),h=null)}).send()}(c)}var q=[],m,k=[],l=escape,s=b.onerror;b.onerror=function(a,e,d,c,h){var f=arguments,g=h||Error(a),g=g.stack||g.backtrace||g.stacktrace||"";s&&s.apply(this,f);if(m!==(m=[l(e),d,c||(b.event||f).errorCharacter||"?",l(a)].join(":"))){if(!g)for(f=f.callee;f=f&&f.caller;)g+=f.toString().split(/[ {]+/)[1]+"\n";k.push([1,+new Date,m,l(g),l(b.location)].join(":"))}};setInterval(function(){k.length&&e.logErrors&&(e.logErrors(k),k.length=0)},307);p(b,"XMLHttpRequest","return new ActiveXObject('MSXML2.XMLHTTP')"); | ||
!b.execScript&&Function("d,Date","return(1,eval)('(Date)')===d")(Date,1)&&(b.execScript=eval);p(b,"execScript","d=document;b=d.body;c=d.createElement('script');c.text=a;b.insertBefore(c,b.firstChild)");b.xhr=e;Function.prototype.bind||n.unshift("up.js");r(n,t);e.load=r}(this,[]); | ||
!function(b,m,s){function t(){}function n(a,b,d){a[b]||(a[b]=new Function("a,b,c,d",d))}function e(a,b,d){var c=p.shift()||new XMLHttpRequest;c.open(a,b,!0!==d);!0!==d&&(c.onreadystatechange=function(){4==c.readyState&&(a=c.status,d&&d.call(c,(200>a||299<a)&&304!==a&&1223!==a&&a,c.responseText),c.onreadystatechange=d=t,p.push(c))});return c}function q(a,b){"string"==typeof a&&(a=[a]);for(var d=a.length,c=d,h=[];c--;)!function(c){e("GET",a[c],function(a,e){h[c]=a?"":e;--d||(execScript(h.join("/**/;")), | ||
b&&b(),h=null)}).send()}(c)}var p=[],l,k=[],r=b.onerror;b.onerror=function(a,e,d,c,h){var f=arguments,g=h||Error(a),g=g.stack||g.backtrace||g.stacktrace||"";r&&r.apply(this,f);if(l!==(l=[e,d,c||(b.event||f).errorCharacter||"?",a].join(":"))){if(!g)for(f=f.callee;f=f&&f.caller;)g+=(""+f).split(/ |{/)[1]+"\n";k.push([l,g,+new Date,b.location].join("\n"))}};setInterval(function(){k.length&&e.logErrors&&(e.logErrors(k),k.length=0)},307);n(b,"XMLHttpRequest","return new ActiveXObject('MSXML2.XMLHTTP')"); | ||
!b.execScript&&Function("d,Date","return(1,eval)('(Date)')===d")(Date,1)&&(b.execScript=eval);n(b,"execScript","d=document;b=d.body;c=d.createElement('script');c.text=a;b.insertBefore(c,b.firstChild)");b.xhr=e;Function.prototype.bind||m.unshift("up.js");q(m,s);e.load=q}(this,[]); |
@@ -991,4 +991,4 @@ /*! litejs.com/MIT-LICENSE.txt */ | ||
/** | ||
* @version 0.3.2 | ||
* @date 2014-09-16 | ||
* @version 0.3.4 | ||
* @date 2014-10-01 | ||
* @stability 1 - Experimental | ||
@@ -1018,15 +1018,16 @@ * @author Lauri Rooden <lauri@rooden.ee> | ||
var view = this | ||
if (views[route]) return views[route] | ||
if (views[route]) { | ||
if (el) views[route].init(el, parent, selector) | ||
return views[route] | ||
} | ||
if (!(view instanceof View)) return new View(route, el, parent, selector) | ||
views[view.route = route] = view | ||
view.el = el | ||
view.parent = typeof parent == "string" ? View(parent) : parent | ||
view.selector = selector | ||
view.init(el, parent, selector) | ||
if (route.charAt(0) != "#") { | ||
var startLen = groupsCount++ | ||
, a = ["a._r='" + route + "'"] | ||
, a = ["o._r='" + route + "'"] | ||
, _re = route.replace(/:(\w+)/g, "{$1}").replace(parseRe, function(_, key) { | ||
return key ? | ||
a.push("a['" + key + "']=a[" + (groupsCount++) + "]") && "([^/]+?)" : | ||
a.push("o['" + key + "']=a[" + (groupsCount++) + "]") && "([^/]+?)" : | ||
escapeRegExp(_) | ||
@@ -1038,3 +1039,3 @@ }) | ||
fn = new Function("a", "return " + fnStr + ",a") | ||
fn = new Function("a", "var o={};return " + fnStr + ",o") | ||
re = new RegExp("^\\/?(?:" + reStr + ")[\\/\\s]*$") | ||
@@ -1047,2 +1048,8 @@ } | ||
View.prototype = { | ||
init: function(el, parent, selector) { | ||
var view = this | ||
view.el = el | ||
view.parent = typeof parent == "string" ? View(parent) : parent | ||
view.selector = selector | ||
}, | ||
getEl: function() { | ||
@@ -1126,4 +1133,12 @@ var view = this | ||
View.define = function(str) { | ||
for (var match, re = /(\S+)\?(\S+)/g; match = re.exec(str);) { | ||
match[2].split(",").map(function(route) { | ||
View(route).file = match[1] | ||
}) | ||
} | ||
} | ||
exports.View = View | ||
}(this) | ||
@@ -8,27 +8,27 @@ /*! litejs.com/MIT-LICENSE.txt */ | ||
*/ | ||
!function(r){function g(a,b){for(var c="_",f=a,u=a.split("->");1<u.length;)f=u.pop(),c=u.pop().match(/\w+/g)||"",u.length&&u.push("(function("+c+"){return("+f+")})");return new Function(c,(b&&(a=a.replace(d,"").match(/\b[a-z]\w*|\b_\w+/g))?"var "+a.uniq().join("='',")+"='';with("+b+"||{})":"")+"return("+f+")")}var k=Array.prototype,e=Function.prototype,p=String.prototype,l=Object,n=l.prototype.hasOwnProperty,s=e.call.bind(k.slice),q=[],d=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|this|arguments|\.\w+|\w+:/g; | ||
e.construct=function(a){var b=a.length;return b?(q[b]||(q[b]=g("t a->new t(a["+l.keys(s(a)).join("],a[")+"])")))(this,a):new this};e.partial=function(){var a=this,b=s(arguments);return function(){return a.apply(this,b.concat.apply(b,arguments))}};e.byWords=function(a,b){var c=this;return function(){var f=this,d=f,e=arguments;(e[a|=0]||"").replace(b||/\S+/g,function(b){e[a]=b;d=c.apply(f,e)});return d}};e.byKeyVal=function(){var a=this;return function(b){var c,f=s(arguments);if("object"==typeof b)for(c in b)f[0]= | ||
c,f[1]=b[c],c=a.apply(this,f);else c=a.apply(this,f);return c}};e.cache=function(a,b,c){var f=this,d=c||{},e=function(){var c=arguments,g=!!a||this instanceof e,k=b?b.apply(f,c):g+":"+c.length+":"+s(c);return k in d?d[k]:d[k]=g?f.construct(c):f.apply(this,c)};e.origin=f;e.cached=d;e.extend=function(){return f.extend.apply(f,arguments).cache(a,b,c)};e.prototype=f.prototype;return e};e.extend=function(){function a(){return c.apply(this,arguments)}var b,c=this,f=0;for(a.prototype=l.create(c.prototype);b= | ||
arguments[f++];)l.merge(a.prototype,b);return a.prototype.constructor=a};l.each=function(a,b,c,f){if(a)for(f in a)n.call(a,f)&&b.call(c,a[f],f,a)};l.merge=function(a,b){for(var c,f=1;b=arguments[f++];)for(c in b)n.call(b,c)&&(a[c]=b[c]);return a};l.clone=function(a,b,c){if(a&&a.constructor===l){b={};for(c in a)n.call(a,c)&&(b[c]=l.clone(a[c]));a=b}return a};l.deepMerge=l.deepCopy=function(a,b,c,f,d,e){c=c||"";f=f||[];for(d in b)if(n.call(b,d)&&a[d]!==b[d])if(e=b[d],f.push(c+d),null===e)delete a[d]; | ||
else if(e&&e.constructor===l){var g=a[d];g&&g.constructor===l||(a[d]={});l.deepMerge(a[d],e,c+d+".",f)}else a[d]=e;return f};l.zip=function(a,b){return a.fold(function(a,d,e){a[d]=b[e];return a},{})};k.remove=function(){for(var a=this.length,b=s(arguments),c=-1;a--;)~b.indexOf(this[a])&&this.splice(c=a,1);return c};k.each=k.forEach;k.fold=k.reduce;k.foldr=k.reduceRight;k.uniq=k.filter.partial(function(a,b,c){return b==c.lastIndexOf(a)});k.pushUniq=function(a){return-1==this.indexOf(a)?this.push(a): | ||
!1};!function(a){e[a]=p[a]=function(){var b=arguments,c=b[0];b[0]=this.fn();return k[a].apply(c,b)}}.byWords()("every filter each map fold foldr some");e.fn=function(){return this};p.fn=function(a){return g(this,a)};r.Fn=g.cache()}(this); | ||
!function(r,g,k){function e(h,a,b){var c,d={};h=h.replace(B,function(h,a,b,c,F){d["."==a?(a="class",d[a]&&(b=d[a]+" "+b),a):"#"==a?"id":b]=(F?c.slice(1,-1):c)||b;return""})||"div";c=(y[h]||(y[h]=g.createElement(h))).cloneNode(!0).set(d);return b?(v[h]&&c.setAttribute("data-call",h),c):v[h]&&v[h].call(c,a)||c.set(a)}function p(h,a){if(h){if("string"==typeof h||"number"==typeof h)h=e.text(h);else if(!("nodeType"in h)&&"length"in h){for(var b=h.length,c=0,d=g.createDocumentFragment();c<b;)p.call(d,h[c++]); | ||
h=d}h.nodeType&&this.insertBefore(h,(!0===a?this.firstChild:"number"==typeof a?this.childNodes[0>a?this.childNodes.length-a-2:a]:a)||null);h.appendHook&&h.appendHook()}return this}function l(h){return-1<(" "+this.className+" ").indexOf(" "+h+" ")}function n(h){this.className+=this.className?l.call(this,h)?"":" "+h:h;return this}function s(h){this.className=(" "+this.className+" ").replace(" "+h+" "," ").trim();return this}function q(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll&& | ||
Event.removeAll(this);this.killHook&&this.killHook();this.empty&&this.empty();return this}function d(h){var a,b=h._childs;if(!b)for(h._childs=b=[];a=h.firstChild;)b.push(a),h.removeChild(a);return b}function a(h,b){var c,d=this;if(c=!b&&d.getAttribute("data-call"))d.removeAttribute("data-call"),v[c].call(d);if(c=!b&&d.getAttribute("data-bind"))if(d.getAttribute("lang"),"{"==c.charAt(0)&&(c='txt:"'+c.replace(/"/g,'\\"')+'"'),c="n d p r->d&&("+c.replace(G,"(p['$1']?(r=p['$1'](n,d,$2)||r):(n['$1']=$2.format(d))),")+ | ||
"r)",c.fn()(d,h,H))return d;for(d=d.firstChild;d;d=d.nextSibling)1==d.nodeType&&a.call(d,h);return this}function b(a,b,c){var d=0,f=[],e=["_"];b=b.replace(B,function(a,h,b,c){e.push("."==h?"(' '+_.className+' ').indexOf(' "+b+" ')>-1":"#"==h?"_.id=='"+b+"'":"_.getAttribute('"+b+"')"+(c?"=='"+c+"'":""));return""})||"*";b=a.getElementsByTagName(b);for(var g=Fn(e.join("&&"));a=b[d++];)if(g(a)){if(c)return a;f.push(a)}return c?null:f}function c(a){this._nodes=a}function f(a,b){if(a)for(b in m)a[b]=m[b]; | ||
return a}function u(a,b,c){y[a]="string"==typeof b?e(b):b;c&&(v[a]=c)}function x(a){function b(a,h,c,g,k,l){for(k=h.length;k<=f[0];)f.shift(),d=d.plugin?d.plugin.done():d.parentNode;c?x.plugins[g]?(d=(new x.plugins[g](d,l)).el,f.unshift(k)):d.append(e.text("text"==g?l:a)):(g&&(d=e(g,0,1).to(d),f.unshift(k)),l&&(k=l.charAt(0),">"==k?(h+" "+l.slice(1)).replace(C,b):"="==k?d.set({"data-bind":l.slice(1)}):d.append(l.replace(/\\([=>:])/g,"$1"))))}var c=g.createDocumentFragment(),d=c,f=[-1];a.replace(C, | ||
b);c=c.childNodes;if(1==c.length)return c[0];f=[];for(d=c.length;d--;)f[d]=c[d];return f}function z(a,b){this.name=b;this.parent=a;this.el=e("div");this.el.plugin=this;return this}function t(a,b){return t[b?A(b):w][a]||a}function A(a){if(!a)return w;a=(a||"").toLowerCase();return t[a]?a:(a=a.split("-")[0],t[a])?a:w}function D(a,b){Object.merge(t[a]||(t[a]={}),b)}var w,y={},v={},E=g.createElement,m=(r.HTMLElement||r.Element||e)[k],B=/([.#:[])([-\w]+)(?:=((["'\/])(?:\\?.)*?\4|[-\w]+)])?]?/g,C=/^([ \t]*)(\:?)((?:(["'\/])(?:\\?.)*?\4|[-\w\:.#\[\]=])+)[ \t]*(.*)$/gm, | ||
!function(r){function g(a,b){for(var c="_",f=a,u=a.split("->");1<u.length;)f=u.pop(),c=u.pop().match(/\w+/g)||"",u.length&&u.push("(function("+c+"){return("+f+")})");return new Function(c,(b&&(a=a.replace(d,"").match(/\b[a-z]\w*|\b_\w+/g))?"var "+a.uniq().join("='',")+"='';with("+b+"||{})":"")+"return("+f+")")}var h=Array.prototype,e=Function.prototype,p=String.prototype,k=Object,n=k.prototype.hasOwnProperty,s=e.call.bind(h.slice),q=[],d=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|this|arguments|\.\w+|\w+:/g; | ||
e.construct=function(a){var b=a.length;return b?(q[b]||(q[b]=g("t a->new t(a["+k.keys(s(a)).join("],a[")+"])")))(this,a):new this};e.partial=function(){var a=this,b=s(arguments);return function(){return a.apply(this,b.concat.apply(b,arguments))}};e.byWords=function(a,b){var c=this;return function(){var f=this,d=f,e=arguments;(e[a|=0]||"").replace(b||/\S+/g,function(b){e[a]=b;d=c.apply(f,e)});return d}};e.byKeyVal=function(){var a=this;return function(b){var c,f=s(arguments);if("object"==typeof b)for(c in b)f[0]= | ||
c,f[1]=b[c],c=a.apply(this,f);else c=a.apply(this,f);return c}};e.cache=function(a,b,c){var f=this,d=c||{},e=function(){var c=arguments,g=!!a||this instanceof e,h=b?b.apply(f,c):g+":"+c.length+":"+s(c);return h in d?d[h]:d[h]=g?f.construct(c):f.apply(this,c)};e.origin=f;e.cached=d;e.extend=function(){return f.extend.apply(f,arguments).cache(a,b,c)};e.prototype=f.prototype;return e};e.extend=function(){function a(){return c.apply(this,arguments)}var b,c=this,f=0;for(a.prototype=k.create(c.prototype);b= | ||
arguments[f++];)k.merge(a.prototype,b);return a.prototype.constructor=a};k.each=function(a,b,c,f){if(a)for(f in a)n.call(a,f)&&b.call(c,a[f],f,a)};k.merge=function(a,b){for(var c,f=1;b=arguments[f++];)for(c in b)n.call(b,c)&&(a[c]=b[c]);return a};k.clone=function(a,b,c){if(a&&a.constructor===k){b={};for(c in a)n.call(a,c)&&(b[c]=k.clone(a[c]));a=b}return a};k.deepMerge=k.deepCopy=function(a,b,c,f,d,e){c=c||"";f=f||[];for(d in b)if(n.call(b,d)&&a[d]!==b[d])if(e=b[d],f.push(c+d),null===e)delete a[d]; | ||
else if(e&&e.constructor===k){var g=a[d];g&&g.constructor===k||(a[d]={});k.deepMerge(a[d],e,c+d+".",f)}else a[d]=e;return f};k.zip=function(a,b){return a.fold(function(a,d,e){a[d]=b[e];return a},{})};h.remove=function(){for(var a=this.length,b=s(arguments),c=-1;a--;)~b.indexOf(this[a])&&this.splice(c=a,1);return c};h.each=h.forEach;h.fold=h.reduce;h.foldr=h.reduceRight;h.uniq=h.filter.partial(function(a,b,c){return b==c.lastIndexOf(a)});h.pushUniq=function(a){return-1==this.indexOf(a)?this.push(a): | ||
!1};!function(a){e[a]=p[a]=function(){var b=arguments,c=b[0];b[0]=this.fn();return h[a].apply(c,b)}}.byWords()("every filter each map fold foldr some");e.fn=function(){return this};p.fn=function(a){return g(this,a)};r.Fn=g.cache()}(this); | ||
!function(r,g,h){function e(l,a,b){var c,d={};l=l.replace(B,function(l,a,b,c,F){d["."==a?(a="class",d[a]&&(b=d[a]+" "+b),a):"#"==a?"id":b]=(F?c.slice(1,-1):c)||b;return""})||"div";c=(y[l]||(y[l]=g.createElement(l))).cloneNode(!0).set(d);return b?(v[l]&&c.setAttribute("data-call",l),c):v[l]&&v[l].call(c,a)||c.set(a)}function p(l,a){if(l){if("string"==typeof l||"number"==typeof l)l=e.text(l);else if(!("nodeType"in l)&&"length"in l){for(var b=l.length,c=0,d=g.createDocumentFragment();c<b;)p.call(d,l[c++]); | ||
l=d}l.nodeType&&this.insertBefore(l,(!0===a?this.firstChild:"number"==typeof a?this.childNodes[0>a?this.childNodes.length-a-2:a]:a)||null);l.appendHook&&l.appendHook()}return this}function k(a){return-1<(" "+this.className+" ").indexOf(" "+a+" ")}function n(a){this.className+=this.className?k.call(this,a)?"":" "+a:a;return this}function s(a){this.className=(" "+this.className+" ").replace(" "+a+" "," ").trim();return this}function q(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll&& | ||
Event.removeAll(this);this.killHook&&this.killHook();this.empty&&this.empty();return this}function d(a){var b,c=a._childs;if(!c)for(a._childs=c=[];b=a.firstChild;)c.push(b),a.removeChild(b);return c}function a(l,b){var c,d=this;if(c=!b&&d.getAttribute("data-call"))d.removeAttribute("data-call"),v[c].call(d);if(c=!b&&d.getAttribute("data-bind"))if(d.getAttribute("lang"),"{"==c.charAt(0)&&(c='txt:"'+c.replace(/"/g,'\\"')+'"'),c="n d p r->d&&("+c.replace(G,"(p['$1']?(r=p['$1'](n,d,$2)||r):(n['$1']=$2.format(d))),")+ | ||
"r)",c.fn()(d,l,H))return d;for(d=d.firstChild;d;d=d.nextSibling)1==d.nodeType&&a.call(d,l);return this}function b(a,b,c){var d=0,f=[],e=["_"];b=b.replace(B,function(a,b,l,c){e.push("."==b?"(' '+_.className+' ').indexOf(' "+l+" ')>-1":"#"==b?"_.id=='"+l+"'":"_.getAttribute('"+l+"')"+(c?"=='"+c+"'":""));return""})||"*";b=a.getElementsByTagName(b);for(var g=Fn(e.join("&&"));a=b[d++];)if(g(a)){if(c)return a;f.push(a)}return c?null:f}function c(a){this._nodes=a}function f(a,b){if(a)for(b in m)a[b]=m[b]; | ||
return a}function u(a,b,c){y[a]="string"==typeof b?e(b):b;c&&(v[a]=c)}function x(a){function b(a,c,l,g,h,k){for(h=c.length;h<=f[0];)f.shift(),d=d.plugin?d.plugin.done():d.parentNode;l?x.plugins[g]?(d=(new x.plugins[g](d,k)).el,f.unshift(h)):d.append(e.text("text"==g?k:a)):(g&&(d=e(g,0,1).to(d),f.unshift(h)),k&&(h=k.charAt(0),">"==h?(c+" "+k.slice(1)).replace(C,b):"="==h?d.set({"data-bind":k.slice(1)}):d.append(k.replace(/\\([=>:])/g,"$1"))))}var c=g.createDocumentFragment(),d=c,f=[-1];a.replace(C, | ||
b);c=c.childNodes;if(1==c.length)return c[0];f=[];for(d=c.length;d--;)f[d]=c[d];return f}function z(a,b){this.name=b;this.parent=a;this.el=e("div");this.el.plugin=this;return this}function t(a,b){return t[b?A(b):w][a]||a}function A(a){if(!a)return w;a=(a||"").toLowerCase();return t[a]?a:(a=a.split("-")[0],t[a])?a:w}function D(a,b){Object.merge(t[a]||(t[a]={}),b)}var w,y={},v={},E=g.createElement,m=(r.HTMLElement||r.Element||e)[h],B=/([.#:[])([-\w]+)(?:=((["'\/])(?:\\?.)*?\4|[-\w]+)])?]?/g,C=/^([ \t]*)(\:?)((?:(["'\/])(?:\\?.)*?\4|[-\w\:.#\[\]=])+)[ \t]*(.*)$/gm, | ||
G=/[;\s]*(\w+)(?:\s*\:((?:(["'\/])(?:\\?.)*?\3|[-,\s\w])*))?/g,H=e.bindings={txt:function(a,b,c){a.txt(c.format(b))},"class":function(a,b,c,d){a.toggleClass(c,d.fn("_")(b))},html:function(a,b,c){a.innerHTML=c.format(b)},each:function(b,c,f){var e=d(b);f&&b.empty().append(f.map(function(b){return e.map(function(c){return a.call(c.cloneNode(!0),b)})}));return b}};r.El=e;m.append=p;m.after=function(a,b){p.call(a.parentNode,this,b?a:a.nextSibling);return this};m.to=function(a,b){p.call(a,this,b);return this}; | ||
m.hasClass=l;m.addClass=n;m.rmClass=s;m.toggleClass=function(a,b){1==arguments.length&&(b=!l.call(this,a));return(b?n:s).call(this,a),b};m.empty=function(){for(var a;a=this.firstChild;)q.call(a);return this};m.kill=q;m.on=function(a,b){Event.add(this,a,b);return this};m.non=function(a,b){Event.remove(this,a,b);return this};m.set=function(a){var b,c=typeof a;if(!a)return this;if("string"==c||"number"==c||a.nodeType||"length"in a)p.call(this,a);else for(c in a)b=a[c],"class"==c?n.call(this,b):b?"string"== | ||
m.hasClass=k;m.addClass=n;m.rmClass=s;m.toggleClass=function(a,b){1==arguments.length&&(b=!k.call(this,a));return(b?n:s).call(this,a),b};m.empty=function(){for(var a;a=this.firstChild;)q.call(a);return this};m.kill=q;m.on=function(a,b){Event.add(this,a,b);return this};m.non=function(a,b){Event.remove(this,a,b);return this};m.set=function(a){var b,c=typeof a;if(!a)return this;if("string"==c||"number"==c||a.nodeType||"length"in a)p.call(this,a);else for(c in a)b=a[c],"class"==c?n.call(this,b):b?"string"== | ||
typeof b?(this.setAttribute(c,b),"id"!=c&&"name"!=c||"\v"!="v"||this.mergeAttributes(E("<INPUT "+c+'="'+b+'"/>'),!1)):this[c]=b:this.removeAttribute(c);return this};m.render=a;m.txt=function(a){var b="textContent"in this?"textContent":"innerText";return arguments.length?this[b]=a:this[b]};m.find="\v"!=="v"&&m.querySelector||function(a){return b(this,a,!0)};m.findAll=m.querySelectorAll?function(a){return new c(this.querySelectorAll(a))}:function(a){return new c(b(this,a))};e.wrap=c;c.prototype=Object.keys(m).reduce(function(a, | ||
b){a[b]=function(){for(var a=this._nodes,c=0,d=a.length;c<d;)m[b].apply(a[c++],arguments);return this};return a},{});m===e[k]&&(g.createElement=function(a){return f(E(a))},f(g.body));e[k]=m;e.get=function(a){"string"==typeof a&&(a=g.getElementById(a));return a&&a.to?a:f(a)};u._el=y;u._fn=v;e.cache=u;e.text=function(a){return g.createTextNode(a)};z.prototype.done=function(){e.cache(this.name,this.el.removeChild(this.el.firstChild),a);this.el.plugin=null;return this.parent};x.plugins={template:z};e.create= | ||
b){a[b]=function(){for(var a=this._nodes,c=0,d=a.length;c<d;)m[b].apply(a[c++],arguments);return this};return a},{});m===e[h]&&(g.createElement=function(a){return f(E(a))},f(g.body));e[h]=m;e.get=function(a){"string"==typeof a&&(a=g.getElementById(a));return a&&a.to?a:f(a)};u._el=y;u._fn=v;e.cache=u;e.text=function(a){return g.createTextNode(a)};z.prototype.done=function(){e.cache(this.name,this.el.removeChild(this.el.firstChild),a);this.el.plugin=null;return this.parent};x.plugins={template:z};e.create= | ||
e.tpl=function(a){return x(a).render()};e.include=function(a,b,c){b=e.get(a);(new z(null,a)).el.append(e.tpl(b.innerHTML)).plugin.done();b.kill()};e.i18n=t;t.get=A;t.use=function(a){a=A(a);w!=(w=a)&&(t[a]=t[a]||{});return g.documentElement.lang=a};t.add=D;t.def=function(a){Object.each(a,function(b,c){D(c,a)})}}(window,document,"prototype"); | ||
!function(r){var g=document,k=r.Event||(r.Event={}),e=120,p="addEventListener",l="removeEventListener",n=r[p]?"":(p="attachEvent",l="detachEvent","on"),s="onwheel"in g?"wheel":"onmousewheel"in g?"mousewheel":"DOMMouseScroll",q=k.Emitter={on:function(d,a,b){var c=this._e||(this._e={});(c[d]||(c[d]=[])).push([a,b]);return this},non:function(d,a){if(d){if(this._e&&this._e[d]&&a)for(var b=this._e[d],c=b.length;c--;)b[c][0]==a?b.splice(c,1):delete this._e[d]}else delete this._e;return this},once:function(d, | ||
a,b){return this.on(d,a,b).on(d,this.non.bind(this,d,a))},emit:function(d){if(this._e&&this._e[d])for(var a=0,b=this._e[d],c=b.slice.call(arguments,1);d=b[a++];)d[0].apply(d[1]||this,c);return this}};q.off=q.non;k.add=function(d,a,b){var c="wheel"==a?function(a){a||(a=r.event);var c=(a.wheelDelta||-a.detail||-a.deltaY)/e;if(0!=c){if(1>c&&-1<c){var g=(0>c?-1:1)/c,c=c*g;e/=g}b.call(d,a,c)}}:n?function(){b.call(d,r.event)}:b;c!=b&&(c.origin=b);q.on.call(d,a,c,d);d[p](n+("wheel"==a?s:a),c,!1);return k}; | ||
k.remove=function(d,a,b){if(b&&d._e&&d._e[a])for(var c,f=d._e[a],e=0;c=f[e];e++)if(c=c[0],c==b||c.origin==b)f.splice(e,1),b=c;d[l](n+("wheel"==a?s:a),b,!1);return k};k.stop=function(d){d.stopPropagation&&d.stopPropagation();d.preventDefault&&d.preventDefault();d.cancelBubble=d.cancel=!0;return d.returnValue=!1};k.removeAll=function(d,a,b,c,e){if(d._e)for(b in d._e)if(!a||b==a)for(c=d._e[b],e=c.length;e--;)k.remove(d,b,c[0])}}(this); | ||
!function(r,g,k){function e(c){c=(c||a).href.split("#")[1]||"";c=decodeURIComponent(c.replace(/\+/g," "));return c.replace(b,"")}function p(b,c){b=encodeURIComponent(b).replace(/%20/g,"+").replace(/%2F/gi,"/");a[c?"replace":"assign"]("#"+b);if(q&&e()!==e(q.location))q.location[c?"replace":q.document.open().close(),"assign"]("#"+b);l()}function l(){s!=(s=e())&&n&&n(s)}var n,s,q,d,a=location,b=/^[#\/\!]+|[\s\/]+$/g,c=!+"\v1"&&8>(g.documentMode||1);k.getUrl=e;k.setUrl=p;k.start=function(a,b){n||("onhashchange"in | ||
r&&!c?r.onhashchange=l:(c&&(q=g.body.appendChild(g.createElement('<iframe class="hide" src="//:" tabindex="-1">')).contentWindow),d=e(),setInterval(function(){var a=e();q&&d===a&&(a=e(q.location));d!==a&&(d=a,q?p(a):l())},50)));n=a;l()}}(this,document,history); | ||
!function(r){function g(a,b,c,f){if(n[a])return n[a];if(!(this instanceof g))return new g(a,b,c,f);n[this.route=a]=this;this.el=b;this.parent="string"==typeof c?g(c):c;this.selector=f;if("#"!=a.charAt(0)){b=s++;var r=["a._r='"+a+"'"];c=a.replace(/:(\w+)/g,"{$1}").replace(d,function(a,b){return b?r.push("a['"+b+"']=a["+s++ +"]")&&"([^/]+?)":a.replace(q,"\\$&")});p+=(p?"||":"")+"a["+b+"]&&("+r+")";l+=(l?"|":"")+"("+c+")";k=new Function("a","return "+p+",a");e=new RegExp("^\\/?(?:"+l+")[\\/\\s]*$")}g.active== | ||
a&&this.show()}var k,e,p="",l="",n={},s=1,q=/[.*+?^=!:${}()|\[\]\/\\]/g,d=/\{([\w%.]+?)\}|.[^{\\]*?/g;g.prototype={getEl:function(){var a=typeof this.el;"function"==a?this.el=this.el():"string"==a&&(this.el=El(this.el));return this.el},getContentEl:function(){return this.selector&&this.getEl().find(this.selector)||this.getEl()},load:function(a){var b=this;xhr.load((g.base||"")+(b.file||b.route+".js"),function(){if(b.el)b.show(a);else throw Error("No View "+b.route);})},show:function(a){g.active=this.route; | ||
this.el?(this.active&&this.close(),this.ping(a),g.active==this.route&&this.emit("show",a)):this.load(a)},close:function(a){var b=this.parent;this.active=!1;b&&(b.getContentEl().removeChild(this.getEl()),b.child=null);this.emit("close",a);this.child&&this.child.close()},ping:function(a){var b=this.parent;this.active=!0;b&&(b.child!=this&&(b.child&&b.child.close(),b.child=this,b.getContentEl().appendChild(this.getEl())),b.ping(a));this.emit("ping",a)}};Object.merge(g.prototype,Event.Emitter);g.show= | ||
function(a){var b=e.exec(a);g(b&&(b=k(b))._r||a&&g["404"]||g.main||g["default"]).show(b||{})};r.View=g}(this); | ||
!function(r){var g=document,h=r.Event||(r.Event={}),e=120,p="addEventListener",k="removeEventListener",n=r[p]?"":(p="attachEvent",k="detachEvent","on"),s="onwheel"in g?"wheel":"onmousewheel"in g?"mousewheel":"DOMMouseScroll",q=h.Emitter={on:function(d,a,b){var c=this._e||(this._e={});(c[d]||(c[d]=[])).push([a,b]);return this},non:function(d,a){if(d){if(this._e&&this._e[d]&&a)for(var b=this._e[d],c=b.length;c--;)b[c][0]==a?b.splice(c,1):delete this._e[d]}else delete this._e;return this},once:function(d, | ||
a,b){return this.on(d,a,b).on(d,this.non.bind(this,d,a))},emit:function(d){if(this._e&&this._e[d])for(var a=0,b=this._e[d],c=b.slice.call(arguments,1);d=b[a++];)d[0].apply(d[1]||this,c);return this}};q.off=q.non;h.add=function(d,a,b){var c="wheel"==a?function(a){a||(a=r.event);var c=(a.wheelDelta||-a.detail||-a.deltaY)/e;if(0!=c){if(1>c&&-1<c){var g=(0>c?-1:1)/c,c=c*g;e/=g}b.call(d,a,c)}}:n?function(){b.call(d,r.event)}:b;c!=b&&(c.origin=b);q.on.call(d,a,c,d);d[p](n+("wheel"==a?s:a),c,!1);return h}; | ||
h.remove=function(d,a,b){if(b&&d._e&&d._e[a])for(var c,f=d._e[a],e=0;c=f[e];e++)if(c=c[0],c==b||c.origin==b)f.splice(e,1),b=c;d[k](n+("wheel"==a?s:a),b,!1);return h};h.stop=function(d){d.stopPropagation&&d.stopPropagation();d.preventDefault&&d.preventDefault();d.cancelBubble=d.cancel=!0;return d.returnValue=!1};h.removeAll=function(d,a,b,c,f){if(d._e)for(b in d._e)if(!a||b==a)for(c=d._e[b],f=c.length;f--;)h.remove(d,b,c[0])}}(this); | ||
!function(r,g,h){function e(c){c=(c||a).href.split("#")[1]||"";c=decodeURIComponent(c.replace(/\+/g," "));return c.replace(b,"")}function p(b,c){b=encodeURIComponent(b).replace(/%20/g,"+").replace(/%2F/gi,"/");a[c?"replace":"assign"]("#"+b);if(q&&e()!==e(q.location))q.location[c?"replace":q.document.open().close(),"assign"]("#"+b);k()}function k(){s!=(s=e())&&n&&n(s)}var n,s,q,d,a=location,b=/^[#\/\!]+|[\s\/]+$/g,c=!+"\v1"&&8>(g.documentMode||1);h.getUrl=e;h.setUrl=p;h.start=function(a,b){n||("onhashchange"in | ||
r&&!c?r.onhashchange=k:(c&&(q=g.body.appendChild(g.createElement('<iframe class="hide" src="//:" tabindex="-1">')).contentWindow),d=e(),setInterval(function(){var a=e();q&&d===a&&(a=e(q.location));d!==a&&(d=a,q?p(a):k())},50)));n=a;k()}}(this,document,history); | ||
!function(r){function g(a,b,c,f){if(n[a])return b&&n[a].init(b,c,f),n[a];if(!(this instanceof g))return new g(a,b,c,f);n[this.route=a]=this;this.init(b,c,f);if("#"!=a.charAt(0)){b=s++;var r=["o._r='"+a+"'"];c=a.replace(/:(\w+)/g,"{$1}").replace(d,function(a,b){return b?r.push("o['"+b+"']=a["+s++ +"]")&&"([^/]+?)":a.replace(q,"\\$&")});p+=(p?"||":"")+"a["+b+"]&&("+r+")";k+=(k?"|":"")+"("+c+")";h=new Function("a","var o={};return "+p+",o");e=new RegExp("^\\/?(?:"+k+")[\\/\\s]*$")}g.active==a&&this.show()} | ||
var h,e,p="",k="",n={},s=1,q=/[.*+?^=!:${}()|\[\]\/\\]/g,d=/\{([\w%.]+?)\}|.[^{\\]*?/g;g.prototype={init:function(a,b,c){this.el=a;this.parent="string"==typeof b?g(b):b;this.selector=c},getEl:function(){var a=typeof this.el;"function"==a?this.el=this.el():"string"==a&&(this.el=El(this.el));return this.el},getContentEl:function(){return this.selector&&this.getEl().find(this.selector)||this.getEl()},load:function(a){var b=this;xhr.load((g.base||"")+(b.file||b.route+".js"),function(){if(b.el)b.show(a); | ||
else throw Error("No View "+b.route);})},show:function(a){g.active=this.route;this.el?(this.active&&this.close(),this.ping(a),g.active==this.route&&this.emit("show",a)):this.load(a)},close:function(a){var b=this.parent;this.active=!1;b&&(b.getContentEl().removeChild(this.getEl()),b.child=null);this.emit("close",a);this.child&&this.child.close()},ping:function(a){var b=this.parent;this.active=!0;b&&(b.child!=this&&(b.child&&b.child.close(),b.child=this,b.getContentEl().appendChild(this.getEl())),b.ping(a)); | ||
this.emit("ping",a)}};Object.merge(g.prototype,Event.Emitter);g.show=function(a){var b=e.exec(a);g(b&&(b=h(b))._r||a&&g["404"]||g.main||g["default"]).show(b||{})};g.define=function(a){for(var b,c=/(\S+)\?(\S+)/g;b=c.exec(a);)b[2].split(",").map(function(a){g(a).file=b[1]})};r.View=g}(this); |
{ | ||
"name": "litejs", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"stability": 1, | ||
@@ -28,5 +28,5 @@ "license": "MIT", | ||
"date-format-lite": "*", | ||
"elements-lite": "*", | ||
"functional-lite": "*", | ||
"view-lite": "*" | ||
"elements-lite": "0.3.8", | ||
"view-lite": "0.3.4" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
[npm-package]: https://npmjs.org/package/litejs | ||
@version 0.0.24 | ||
@date 2014-09-19 | ||
@version 0.0.25 | ||
@date 2014-10-04 | ||
@stability 1 - Experimental | ||
@@ -7,0 +7,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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 2 instances in 1 package
59284
1380
5
+ Addedelements-lite@0.3.8(transitive)
- Removedelements-lite@2.0.0(transitive)
Updatedelements-lite@0.3.8
Updatedview-lite@0.3.4