Comparing version 0.0.23 to 0.0.24
@@ -5,4 +5,4 @@ | ||
/* | ||
* @version 0.0.23 | ||
* @date 2014-09-13 | ||
* @version 0.0.24 | ||
* @date 2014-09-19 | ||
* @stability 1 - Experimental | ||
@@ -9,0 +9,0 @@ * @author Lauri Rooden <lauri@rooden.ee> |
@@ -130,2 +130,22 @@ /*! litejs.com/MIT-LICENSE.txt */ | ||
/* | ||
Object.values = function(obj) { | ||
return Object.keys(obj).map(function(e) { | ||
return obj[e] | ||
}) | ||
} | ||
Object.values({a:1, b:2, c:3}); //[1, 2, 3] | ||
Array.prototype.flatten = function(){ | ||
var arr = this, i = arr.length; | ||
while (i--) if (arr[i] instanceof Array) | ||
arr[i].unshift(i,1) && arr.splice.apply(arr,arr[i].flatten() ) | ||
return arr | ||
} | ||
function argsToArray(){ | ||
return Array.apply(null, arguments).flatten() | ||
} | ||
argsToArray([[1],3,[4,5]],2) | ||
*/ | ||
// Note: use for Object literals only, | ||
@@ -247,4 +267,4 @@ // as it returns false for custom objects, | ||
/** | ||
* @version 0.3.3 | ||
* @date 2014-09-13 | ||
* @version 0.3.8 | ||
* @date 2014-09-19 | ||
* @stability 1 - Experimental | ||
@@ -257,13 +277,11 @@ * @author Lauri Rooden <lauri@rooden.ee> | ||
// TODO: find ways for automated testing | ||
// http://www.browserscope.org/user/tests/howto | ||
!function(window, document, protoStr) { | ||
var elCache = {} | ||
var currentLang | ||
, elCache = {} | ||
, fnCache = {} | ||
, createElement = document.createElement | ||
, proto = (window.HTMLElement || window.Element || El)[protoStr] | ||
, elRe = /([.#:[])([-\w]+)(?:=((["'\/])(?:\\.|.)*?\4|[-\w]+)])?]?/g | ||
, tplRe = /^([ \t]*)(\:?)((?:(["'\/])(?:\\.|.)*?\4|[-\w\:.#\[\]=])+)[ \t]*(.*)$/gm | ||
, renderRe = /[;\s]*(\w+)(?:\s*\:((?:(["'\/])(?:\\.|.)*?\3|[-,\s\w])*))?/g | ||
, elRe = /([.#:[])([-\w]+)(?:=((["'\/])(?:\\?.)*?\4|[-\w]+)])?]?/g | ||
, tplRe = /^([ \t]*)(\:?)((?:(["'\/])(?:\\?.)*?\4|[-\w\:.#\[\]=])+)[ \t]*(.*)$/gm | ||
, renderRe = /[;\s]*(\w+)(?:\s*\:((?:(["'\/])(?:\\?.)*?\3|[-,\s\w])*))?/g | ||
, bindings = El.bindings = { | ||
@@ -279,11 +297,2 @@ "txt": function(node, data, text) { | ||
}, | ||
/** | ||
"with": function(node, data, scope) { | ||
render.call(node, scope, true) | ||
}, | ||
"if": function(node, data, fn) { | ||
var childs = getChilds(node) | ||
node.empty().append( fn.fn("_")(data) && childs ) | ||
}, | ||
//*/ | ||
"each": function(node, data, arr) { | ||
@@ -313,3 +322,3 @@ var childs = getChilds(node) | ||
pre[ | ||
op == "." ? (op = "class", (pre[op] && (key = pre[op]+" "+key)), op) : | ||
op == "." ? (op = "class", (pre[op] && (key = pre[op] + " " + key)), op) : | ||
op == "#" ? "id" : | ||
@@ -331,28 +340,2 @@ key | ||
// TODO: Extend El api | ||
// add El.siblings( [selector ] ) | ||
// add El.children( [selector ] ) | ||
// add El.invoke | ||
// https://github.com/WebReflection/dom4#dom4 | ||
// | ||
// How elements.js extends the DOM | ||
// ------------------------------- | ||
// | ||
// All DOM extensions on the element are available by default. | ||
// | ||
// In browsers that does not support adding methods to prototype of native objects | ||
// such as HTMLElement or Element, document.createElement will be overrided | ||
// to extend created elements. El.get() and element.find will extend | ||
// returned elements. | ||
// ### element.append( content, [ before ] ) -> element | ||
// | ||
// - **content** `element || Array || String || Number` | ||
// - **before** `optional` | ||
// - true - Insert content to the beginning of element | ||
// - element - Insert content before specified element | ||
// - Number - Insert content before nth child | ||
function append(child, before) { | ||
@@ -399,4 +382,3 @@ var el = this | ||
// http://jsperf.com/regexp-indexof-perf/32 | ||
// return (" "+this.className+" ").indexOf(" "+name+" ") > -1 | ||
return RegExp("\\b" + name + "\\b").test(this.className) | ||
return (" " + this.className + " ").indexOf(" " + name + " ") > -1 | ||
} | ||
@@ -414,3 +396,3 @@ proto.hasClass = hasClass | ||
var el = this | ||
el.className = (" "+el.className+" ").replace(" "+name+" "," ").trim() | ||
el.className = (" "+el.className+" ").replace(" "+name+" ", " ").trim() | ||
return el | ||
@@ -480,3 +462,3 @@ } | ||
if ((key == "id" || key == "name") && "\v" == "v") { | ||
el.mergeAttributes(document.createElement('<INPUT '+key+'="' + val + '"/>'), false) | ||
el.mergeAttributes(createElement('<INPUT '+key+'="' + val + '"/>'), false) | ||
} | ||
@@ -537,4 +519,3 @@ } else el[key] = val | ||
// textContent is suported from IE9 | ||
// | ||
// Opera 9-10 have Node.text, Node.textContent | ||
// Opera 9-10 have Node.text so we use Node.txt | ||
@@ -547,5 +528,2 @@ proto.txt = function(newText) { | ||
// NOTE: fast selectors for IE | ||
// http://ajaxian.com/archives/creating-a-queryselector-for-ie-that-runs-at-native-speed | ||
function findEl(node, sel, first) { | ||
@@ -581,17 +559,16 @@ var el | ||
function(sel) { | ||
return new ElAll(this.querySelectorAll(sel)) | ||
return new ElWrap(this.querySelectorAll(sel)) | ||
} : | ||
function(sel) { | ||
return new ElAll(findEl(this, sel)) | ||
return new ElWrap(findEl(this, sel)) | ||
} | ||
// TODO:2014-09-13:lauri:Expose ElAll | ||
function ElAll(nodes) { | ||
function ElWrap(nodes) { | ||
this._nodes = nodes | ||
} | ||
El.wrap = ElWrap | ||
ElAll.prototype = Object.keys(proto).reduce(function(memo, key) { | ||
ElWrap.prototype = Object.keys(proto).reduce(function(memo, key) { | ||
memo[key] = function() { | ||
var elAll = this | ||
, nodes = elAll._nodes | ||
var nodes = this._nodes | ||
, i = 0 | ||
@@ -602,3 +579,3 @@ , len = nodes.length | ||
} | ||
return elAll | ||
return this | ||
} | ||
@@ -608,3 +585,2 @@ return memo | ||
function extend(node, key) { | ||
@@ -615,7 +591,5 @@ if (node) for (key in proto) node[key] = proto[key] | ||
// IE 6-7 | ||
if (proto === El[protoStr]) { | ||
var create = document.createElement | ||
document.createElement = function(name) {return extend(create(name))} | ||
document.createElement = function(name) {return extend(createElement(name))} | ||
@@ -654,2 +628,3 @@ // NOTE: document.body will not get extended with later added extensions | ||
//** templates | ||
@@ -692,7 +667,7 @@ function tpl(str) { | ||
str.replace(tplRe, work) | ||
stack = root.childNodes | ||
if (stack.length == 1) return stack[0] | ||
root = root.childNodes | ||
if (root.length == 1) return root[0] | ||
for (var arr = [], i = stack.length; i--;) arr[i] = stack[i] | ||
return arr | ||
for (stack = [], parent = root.length; parent--;) stack[parent] = root[parent] | ||
return stack | ||
} | ||
@@ -711,7 +686,4 @@ | ||
var t = this | ||
El.cache(t.name, t.el.removeChild(t.el.firstChild), render) | ||
t.el.plugin = null | ||
return t.parent | ||
@@ -721,19 +693,6 @@ } | ||
tpl.plugins = { | ||
/* | ||
* - Declaration | ||
* mixin list | ||
* | ||
* mixin link(href, name) | ||
* a(class!=attributes.class, href=href)= name | ||
* | ||
* +link('/foo', 'foo')(class="btn") | ||
* | ||
* :include | ||
* :doctype | ||
* - http://stackoverflow.com/questions/8227612/how-to-create-document-objects-with-javascript | ||
*/ | ||
"template": template | ||
} | ||
El.tpl = function(str) { | ||
El.create = El.tpl = function(str) { | ||
return tpl(str).render() | ||
@@ -746,89 +705,49 @@ } | ||
} | ||
}(window, document, "prototype") | ||
//*/ | ||
/* | ||
* @version 0.2.2 | ||
* @date 2014-05-24 | ||
* @stability 1 - Experimental | ||
* @author Lauri Rooden <lauri@rooden.ee> | ||
* @license MIT License | ||
*/ | ||
/* | ||
* In IE6, most of the choices in the Language Preference list specified a locale-neutral two letter code. | ||
* For instance fr was sent for French (France), and ja sent for Japanese. | ||
* Longer codes were only used when a language is commonly spoken in another country or locale-- for instance fr-CA was available for French-speaking Canadians. | ||
* | ||
* For Internet Explorer 7, a change was made such that Internet Explorer will send the full language/locale pair for each locale. | ||
* IE7 will send fr-FR for French (France) and de-DE for German (Germany). | ||
* This change enables web servers to more easily target content for a specific language and locale. | ||
* If a given server is only interested in the user’s language and not the locale, it can ignore the locale portion by simply truncating the code at the first dash. | ||
* | ||
* Anyway, it's always more user-friendly to use Accept-Language than IP-address-based Geo-Location. | ||
* | ||
* Accept-Language: eo;q=0 | ||
* the q stands for "quality" and denotes a preference where 1 is highest and 0 means "not acceptable". | ||
* means "I can't read or understand Esperanto and no, please do not provide any content in that language." | ||
*/ | ||
!function(root) { | ||
var current; | ||
//** i18n | ||
function i18n(text, lang) { | ||
return (i18n[lang ? getLang(lang) : current][text] || text) | ||
return i18n[ lang ? getLang(lang) : currentLang ][text] || text | ||
} | ||
El.i18n = i18n | ||
function getLang(lang) { | ||
if (!lang) return current | ||
lang = (lang||"").toLowerCase() | ||
return i18n[lang] ? lang : (lang = lang.split("-")[0]), i18n[lang] ? lang : current | ||
if (!lang) return currentLang | ||
lang = (lang || "").toLowerCase() | ||
return i18n[lang] ? lang : ((lang = lang.split("-")[0]), i18n[lang]) ? lang : currentLang | ||
} | ||
function setLang(lang) { | ||
lang = i18n.getLang(lang) | ||
if (current != (current = lang)) { | ||
lang = getLang(lang) | ||
if (currentLang != (currentLang = lang)) { | ||
i18n[lang] = i18n[lang] || {} | ||
} | ||
// Use setAttribute | ||
document.documentElement.lang = lang | ||
return lang | ||
} | ||
i18n.getLang = getLang | ||
i18n.setLang = setLang | ||
function addLang(lang, texts) { | ||
Object.merge(i18n[lang] || (i18n[lang] = {}), texts) | ||
} | ||
//i18n.main = i18n.current = "en" | ||
i18n.get = getLang | ||
i18n.use = setLang | ||
i18n.add = addLang | ||
i18n.def = function(map) { | ||
Object.each(map, function(name, tag) { | ||
addLang(tag, map) | ||
}) | ||
} | ||
// setLang("en") | ||
//*/ | ||
i18n.en = { | ||
date: "%a, %d %b %Y %H:%M:%S %z", | ||
name: "Name {date|lang}" | ||
} | ||
}(window, document, "prototype") | ||
i18n.et = { | ||
date: "%Y %H:%M:%S %z", | ||
name: "Nimi {date|lang:'et'}" | ||
} | ||
//i18n.setLang(navigator.language || navigator.userLanguage) | ||
Date.prototype.lang = function(lang) { | ||
return this.format( i18n("date", lang) ) | ||
} | ||
String.prototype.lang = function(lang) { | ||
return i18n(this, lang) | ||
} | ||
root.i18n = i18n | ||
}(this) | ||
/* | ||
@@ -964,3 +883,3 @@ * @version 0.1.4 | ||
* @version 0.1.1 | ||
* @date 2014-09-02 | ||
* @date 2014-09-16 | ||
* @stability 2 - Unstable | ||
@@ -975,22 +894,21 @@ * @author Lauri Rooden <lauri@rooden.ee> | ||
!function(win, doc, his) { | ||
!function(window, document, history) { | ||
var cb, base, last_route, iframe, tick, last | ||
, loc = location | ||
, clean_route = /^[#\/\!]+|[\s\/]+$/g | ||
/* | ||
* The JScript engine used in IE doesn't recognize vertical tabulation character | ||
* http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html | ||
* oldIE = "\v" == "v" | ||
* | ||
* The documentMode is an IE only property, supported in IE8+. | ||
* | ||
* Starting in Internet Explorer 9 standards mode, Internet Explorer 10 standards mode, | ||
* and win8_appname_long apps, you cannot identify the browser as Internet Explorer | ||
* by testing for the equivalence of the vertical tab (\v) and the "v". | ||
* In earlier versions, the expression "\v" === "v" returns true. | ||
* In Internet Explorer 9 standards mode, Internet Explorer 10 standards mode, | ||
* and win8_appname_long apps, the expression returns false. | ||
*/ | ||
, ie6_7 = !+"\v1" && (doc.documentMode||1) < 8 | ||
// The JScript engine used in IE doesn't recognize vertical tabulation character | ||
// http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html | ||
// oldIE = "\v" == "v" | ||
// | ||
// The documentMode is an IE only property, supported in IE8+. | ||
// | ||
// Starting in Internet Explorer 9 standards mode, Internet Explorer 10 standards mode, | ||
// and win8_appname_long apps, you cannot identify the browser as Internet Explorer | ||
// by testing for the equivalence of the vertical tab (\v) and the "v". | ||
// In earlier versions, the expression "\v" === "v" returns true. | ||
// In Internet Explorer 9 standards mode, Internet Explorer 10 standards mode, | ||
// and win8_appname_long apps, the expression returns false. | ||
, ie6_7 = !+"\v1" && (document.documentMode||1) < 8 | ||
function getUrl(_loc) { | ||
@@ -1023,7 +941,7 @@ var url | ||
if (base) { | ||
his[replace ? "replaceState" : "pushState"](null, null, base + url) | ||
history[replace ? "replaceState" : "pushState"](null, null, base + url) | ||
} else { | ||
//*/ | ||
loc[replace ? "replace" : "assign"]("#" + url) | ||
// Opening and closing the iframe tricks IE7 and earlier | ||
// Opening and closing the iframe tricks IE7 and earlier | ||
// to push a history entry on hash-tag change. | ||
@@ -1043,9 +961,9 @@ if (iframe && getUrl() !== getUrl(iframe.location) ) { | ||
his.getUrl = getUrl | ||
his.setUrl = setUrl | ||
history.getUrl = getUrl | ||
history.setUrl = setUrl | ||
his.start = function(_cb, _base) { | ||
history.start = function(_cb, _base) { | ||
if (!cb) { | ||
/*** PUSH | ||
if (_base && his.pushState) { | ||
if (_base && history.pushState) { | ||
base = _base | ||
@@ -1055,10 +973,10 @@ // Chrome and Safari emit a popstate event on page load, Firefox doesn't. | ||
// | ||
// See the discussion on https://bugs.webkit.org/show_bug.cgi?id=41372, | ||
// See the discussion on https://bugs.webkit.org/show_bug.cgi?id=41372, | ||
// https://code.google.com/p/chromium/issues/detail?id=63040 | ||
// and the change to the HTML5 spec that was made: | ||
// http://html5.org/tools/web-apps-tracker?from=5345&to=5346. | ||
win.onpopstate = checkUrl | ||
// and the change to the HTML5 spec that was made: | ||
// http://html5.org/tools/web-apps-tracker?from=5345&to=5346. | ||
window.onpopstate = checkUrl | ||
} else | ||
//*/ | ||
if ("onhashchange" in win && !ie6_7) { | ||
if ("onhashchange" in window && !ie6_7) { | ||
// There are onhashchange in IE7 but its not get emitted | ||
@@ -1068,3 +986,3 @@ // | ||
// Chrome 5.0, Firefox (Gecko) 3.6 (1.9.2), IE 8.0, Opera 10.6, Safari 5.0 | ||
win.onhashchange = checkUrl | ||
window.onhashchange = checkUrl | ||
} else { | ||
@@ -1074,3 +992,3 @@ if (ie6_7) { | ||
// IE5/6 additionally encounters the Mixed Content warning when the URI about:blank is used. | ||
iframe = doc.body.appendChild(doc.createElement('<iframe class="hide" src="//:" tabindex="-1">')).contentWindow | ||
iframe = document.body.appendChild(document.createElement('<iframe class="hide" src="//:" tabindex="-1">')).contentWindow | ||
} | ||
@@ -1100,4 +1018,4 @@ last = getUrl() | ||
/** | ||
* @version 0.3.1 | ||
* @date 2014-09-12 | ||
* @version 0.3.2 | ||
* @date 2014-09-16 | ||
* @stability 1 - Experimental | ||
@@ -1229,3 +1147,3 @@ * @author Lauri Rooden <lauri@rooden.ee> | ||
View.main || View["default"] | ||
).show(match) | ||
).show(match || {}) | ||
} | ||
@@ -1232,0 +1150,0 @@ |
/*! litejs.com/MIT-LICENSE.txt */ | ||
!function(n){function e(a,b){for(var c="_",g=a,t=a.split("->");1<t.length;)g=t.pop(),c=t.pop().match(/\w+/g)||"",t.length&&t.push("(function("+c+"){return("+g+")})");return new Function(c,(b&&(a=a.replace(d,"").match(/\b[a-z]\w*|\b_\w+/g))?"var "+a.uniq().join("='',")+"='';with("+b+"||{})":"")+"return("+g+")")}var k=Array.prototype,f=Function.prototype,h=String.prototype,l=Object,p=l.prototype.hasOwnProperty,r=f.call.bind(k.slice),q=[],d=/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|this|arguments|\.\w+|\w+:/g; | ||
f.construct=function(a){var b=a.length;return b?(q[b]||(q[b]=e("t a->new t(a["+l.keys(r(a)).join("],a[")+"])")))(this,a):new this};f.partial=function(){var a=this,b=r(arguments);return function(){return a.apply(this,b.concat.apply(b,arguments))}};f.byWords=function(a,b){var c=this;return function(){var g=this,d=g,e=arguments;(e[a|=0]||"").replace(b||/\S+/g,function(b){e[a]=b;d=c.apply(g,e)});return d}};f.byKeyVal=function(){var a=this;return function(b){var c,g=r(arguments);if("object"==typeof b)for(c in b)g[0]= | ||
c,g[1]=b[c],c=a.apply(this,g);else c=a.apply(this,g);return c}};f.cache=function(a,b,c){var g=this,d=c||{},e=function(){var c=arguments,f=!!a||this instanceof e,h=b?b.apply(g,c):f+":"+c.length+":"+r(c);return h in d?d[h]:d[h]=f?g.construct(c):g.apply(this,c)};e.origin=g;e.cached=d;e.extend=function(){return g.extend.apply(g,arguments).cache(a,b,c)};e.prototype=g.prototype;return e};f.extend=function(){function a(){return c.apply(this,arguments)}var b,c=this,g=0;for(a.prototype=l.create(c.prototype);b= | ||
arguments[g++];)l.merge(a.prototype,b);return a.prototype.constructor=a};l.each=function(a,b,c,g){if(a)for(g in a)p.call(a,g)&&b.call(c,a[g],g,a)};l.merge=function(a,b){for(var c,g=1;b=arguments[g++];)for(c in b)p.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)p.call(a,c)&&(b[c]=l.clone(a[c]));a=b}return a};l.deepMerge=l.deepCopy=function(a,b,c,g,e,d){c=c||"";g=g||[];for(e in b)if(p.call(b,e)&&a[e]!==b[e])if(d=b[e],g.push(c+e),null===d)delete a[e]; | ||
else if(d&&d.constructor===l){var f=a[e];f&&f.constructor===l||(a[e]={});l.deepMerge(a[e],d,c+e+".",g)}else a[e]=d;return g};l.zip=function(a,b){return a.fold(function(a,e,d){a[e]=b[d];return a},{})};k.remove=function(){for(var a=this.length,b=r(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){f[a]=h[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");f.fn=function(){return this};h.fn=function(a){return e(this,a)};n.Fn=e.cache()}(this); | ||
!function(n,e,k){function f(a,b,c){var d,g={};a=a.replace(y,function(a,b,s,c,e){g["."==b?(b="class",g[b]&&(s=g[b]+" "+s),b):"#"==b?"id":s]=(e?c.slice(1,-1):c)||s;return""})||"div";d=(w[a]||(w[a]=e.createElement(a))).cloneNode(!0).set(g);return c?(u[a]&&d.setAttribute("data-call",a),d):u[a]&&u[a].call(d,b)||d.set(b)}function h(a,b){if(a){if("string"==typeof a||"number"==typeof a)a=f.text(a);else if(!("nodeType"in a)&&"length"in a){for(var c=a.length,d=0,g=e.createDocumentFragment();d<c;)h.call(g,a[d++]); | ||
a=g}a.nodeType&&this.insertBefore(a,(!0===b?this.firstChild:"number"==typeof b?this.childNodes[0>b?this.childNodes.length-b-2:b]:b)||null);a.appendHook&&a.appendHook()}return this}function l(a){return RegExp("\\b"+a+"\\b").test(this.className)}function p(a){this.className+=this.className?l.call(this,a)?"":" "+a:a;return this}function r(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(b,c){var e,d=this;if(e=!c&&d.getAttribute("data-call"))d.removeAttribute("data-call"),u[e].call(d);if(e=!c&&d.getAttribute("data-bind"))if(d.getAttribute("lang"),"{"==e.charAt(0)&&(e='txt:"'+e.replace(/"/g,'\\"')+'"'),e="n d p r->d&&("+e.replace(A,"(p['$1']?(r=p['$1'](n,d,$2)||r):(n['$1']=$2.format(d))),")+ | ||
"r)",e.fn()(d,b,B))return d;for(d=d.firstChild;d;d=d.nextSibling)1==d.nodeType&&a.call(d,b);return this}function b(a,b,c){var d=0,e=[],g=["_"];b=b.replace(y,function(a,b,c,d){g.push("."==b?"(' '+_.className+' ').indexOf(' "+c+" ')>-1":"#"==b?"_.id=='"+c+"'":"_.getAttribute('"+c+"')"+(d?"=='"+d+"'":""));return""})||"*";b=a.getElementsByTagName(b);for(var f=Fn(g.join("&&"));a=b[d++];)if(f(a)){if(c)return a;e.push(a)}return c?null:e}function c(a){this._nodes=a}function g(a,b){if(a)for(b in m)a[b]=m[b]; | ||
return a}function t(a,b,c){w[a]="string"==typeof b?f(b):b;c&&(u[a]=c)}function v(a){function b(a,c,e,s,h,k){for(h=c.length;h<=g[0];)g.shift(),d=d.plugin?d.plugin.done():d.parentNode;e?v.plugins[s]?(d=(new v.plugins[s](d,k)).el,g.unshift(h)):d.append(f.text("text"==s?k:a)):(s&&(d=f(s,0,1).to(d),g.unshift(h)),k&&(h=k.charAt(0),">"==h?(c+" "+k.slice(1)).replace(z,b):"="==h?d.set({"data-bind":k.slice(1)}):d.append(k.replace(/\\([=>:])/g,"$1"))))}var c=e.createDocumentFragment(),d=c,g=[-1];a.replace(z, | ||
b);g=c.childNodes;if(1==g.length)return g[0];a=[];for(c=g.length;c--;)a[c]=g[c];return a}function x(a,b){this.name=b;this.parent=a;this.el=f("div");this.el.plugin=this;return this}var w={},u={},m=(n.HTMLElement||n.Element||f)[k],y=/([.#:[])([-\w]+)(?:=((["'\/])(?:\\.|.)*?\4|[-\w]+)])?]?/g,z=/^([ \t]*)(\:?)((?:(["'\/])(?:\\.|.)*?\4|[-\w\:.#\[\]=])+)[ \t]*(.*)$/gm,A=/[;\s]*(\w+)(?:\s*\:((?:(["'\/])(?:\\.|.)*?\3|[-,\s\w])*))?/g,B=f.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,e){var g=d(b);e&&b.empty().append(e.map(function(b){return g.map(function(c){return a.call(c.cloneNode(!0),b)})}));return b}};n.El=f;m.append=h;m.after=function(a,b){h.call(a.parentNode,this,b?a:a.nextSibling);return this};m.to=function(a,b){h.call(a,this,b);return this};m.hasClass=l;m.addClass=p;m.rmClass=r;m.toggleClass=function(a,b){1==arguments.length&&(b=!l.call(this,a));return(b?p:r).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)h.call(this,a);else for(c in a)b=a[c],"class"==c?p.call(this,b):b?"string"==typeof b?(this.setAttribute(c,b),"id"!=c&&"name"!=c||"\v"!="v"||this.mergeAttributes(e.createElement("<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))};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},{});if(m===f[k]){var C=e.createElement;e.createElement=function(a){return g(C(a))};g(e.body)}f[k]=m;f.get=function(a){"string"==typeof a&&(a=e.getElementById(a));return a&&a.to?a:g(a)};t._el=w;t._fn=u;f.cache=t;f.text=function(a){return e.createTextNode(a)};x.prototype.done=function(){f.cache(this.name,this.el.removeChild(this.el.firstChild),a);this.el.plugin=null;return this.parent};v.plugins={template:x};f.tpl=function(a){return v(a).render()};f.include=function(a,b,c){b=f.get(a);(new x(null, | ||
a)).el.append(f.tpl(b.innerHTML)).plugin.done();b.kill()}}(window,document,"prototype"); | ||
!function(n){function e(h,l){return e[l?k(l):f][h]||h}function k(h){if(!h)return f;h=(h||"").toLowerCase();return e[h]?h:h=h.split("-")[0],e[h]?h:f}var f;e.getLang=k;e.setLang=function(h){h=e.getLang(h);f!=(f=h)&&(e[h]=e[h]||{});return h};e.en={date:"%a, %d %b %Y %H:%M:%S %z",name:"Name {date|lang}"};e.et={date:"%Y %H:%M:%S %z",name:"Nimi {date|lang:'et'}"};Date.prototype.lang=function(f){return this.format(e("date",f))};String.prototype.lang=function(f){return e(this,f)};n.i18n=e}(this); | ||
!function(n){var e=document,k=n.Event||(n.Event={}),f=120,h="addEventListener",l="removeEventListener",p=n[h]?"":(h="attachEvent",l="detachEvent","on"),r="onwheel"in e?"wheel":"onmousewheel"in e?"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=n.event);var c=(a.wheelDelta||-a.detail||-a.deltaY)/f;if(0!=c){if(1>c&&-1<c){var e=(0>c?-1:1)/c,c=c*e;f/=e}b.call(d,a,c)}}:p?function(){b.call(d,n.event)}:b;c!=b&&(c.origin=b);q.on.call(d,a,c,d);d[h](p+("wheel"==a?r:a),c,!1);return k}; | ||
k.remove=function(d,a,b){if(b&&d._e&&d._e[a])for(var c,e=d._e[a],f=0;c=e[f];f++)if(c=c[0],c==b||c.origin==b)e.splice(f,1),b=c;d[l](p+("wheel"==a?r: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(n,e,k){function f(c){c=(c||a).href.split("#")[1]||"";c=decodeURIComponent(c.replace(/\+/g," "));return c.replace(b,"")}function h(b,c){b=encodeURIComponent(b).replace(/%20/g,"+").replace(/%2F/gi,"/");a[c?"replace":"assign"]("#"+b);if(q&&f()!==f(q.location))q.location[c?"replace":q.document.open().close(),"assign"]("#"+b);l()}function l(){r!=(r=f())&&p&&p(r)}var p,r,q,d,a=location,b=/^[#\/\!]+|[\s\/]+$/g,c=!+"\v1"&&8>(e.documentMode||1);k.getUrl=f;k.setUrl=h;k.start=function(a,b){p||("onhashchange"in | ||
n&&!c?n.onhashchange=l:(c&&(q=e.body.appendChild(e.createElement('<iframe class="hide" src="//:" tabindex="-1">')).contentWindow),d=f(),setInterval(function(){var a=f();q&&d===a&&(a=f(q.location));d!==a&&(d=a,q?h(a):l())},50)));p=a;l()}}(this,document,history); | ||
!function(n){function e(a,b,c,g){if(p[a])return p[a];if(!(this instanceof e))return new e(a,b,c,g);p[this.route=a]=this;this.el=b;this.parent="string"==typeof c?e(c):c;this.selector=g;if("#"!=a.charAt(0)){b=r++;var n=["a._r='"+a+"'"];c=a.replace(/:(\w+)/g,"{$1}").replace(d,function(a,b){return b?n.push("a['"+b+"']=a["+r++ +"]")&&"([^/]+?)":a.replace(q,"\\$&")});h+=(h?"||":"")+"a["+b+"]&&("+n+")";l+=(l?"|":"")+"("+c+")";k=new Function("a","return "+h+",a");f=new RegExp("^\\/?(?:"+l+")[\\/\\s]*$")}e.active== | ||
a&&this.show()}var k,f,h="",l="",p={},r=1,q=/[.*+?^=!:${}()|\[\]\/\\]/g,d=/\{([\w%.]+?)\}|.[^{\\]*?/g;e.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((e.base||"")+(b.file||b.route+".js"),function(){if(b.el)b.show(a);else throw Error("No View "+b.route);})},show:function(a){e.active=this.route; | ||
this.el?(this.active&&this.close(),this.ping(a),e.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(e.prototype,Event.Emitter);e.show= | ||
function(a){var b=f.exec(a);e(b&&(b=k(b))._r||a&&e["404"]||e.main||e["default"]).show(b)};n.View=e}(this); | ||
/* | ||
MIT License | ||
MIT License | ||
MIT License | ||
MIT License | ||
*/ | ||
!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, | ||
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"== | ||
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= | ||
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); |
{ | ||
"name": "litejs", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"stability": 1, | ||
@@ -44,3 +44,2 @@ "license": "MIT", | ||
"elements-lite", | ||
"node_modules/elements-lite/lib/i18n.js", | ||
"browser-event-lite", | ||
@@ -47,0 +46,0 @@ "node_modules/browser-history-lite/dist/hash-only-src.js", |
[npm-package]: https://npmjs.org/package/litejs | ||
@version 0.0.23 | ||
@date 2014-09-13 | ||
@version 0.0.24 | ||
@date 2014-09-19 | ||
@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
58736
1366