Commit c5ddf214 authored by Arthur Verschaeve's avatar Arthur Verschaeve

Drop `plastronjs` app

Fix #1219
parent c83a47f3
...@@ -27,7 +27,6 @@ module.exports = [ ...@@ -27,7 +27,6 @@ module.exports = [
// https://github.com/tastejs/todomvc/issues/828 // https://github.com/tastejs/todomvc/issues/828
// routing should default to all // routing should default to all
'TodoMVC - batman, Routing, should highlight the currently applied filter', 'TodoMVC - batman, Routing, should highlight the currently applied filter',
'TodoMVC - plastronjs, Routing, should highlight the currently applied filter',
'TodoMVC - sammyjs, Routing, should highlight the currently applied filter', 'TodoMVC - sammyjs, Routing, should highlight the currently applied filter',
// https://github.com/tastejs/todomvc/issues/824 // https://github.com/tastejs/todomvc/issues/824
...@@ -60,7 +59,6 @@ module.exports = [ ...@@ -60,7 +59,6 @@ module.exports = [
'TodoMVC - epitome, Editing, should cancel edits on escape', 'TodoMVC - epitome, Editing, should cancel edits on escape',
'TodoMVC - extjs_deftjs, Editing, should cancel edits on escape', 'TodoMVC - extjs_deftjs, Editing, should cancel edits on escape',
'TodoMVC - olives, Editing, should cancel edits on escape', 'TodoMVC - olives, Editing, should cancel edits on escape',
'TodoMVC - plastronjs, Editing, should cancel edits on escape',
'TodoMVC - rappidjs, Editing, should cancel edits on escape', 'TodoMVC - rappidjs, Editing, should cancel edits on escape',
'TodoMVC - serenadejs, Editing, should cancel edits on escape', 'TodoMVC - serenadejs, Editing, should cancel edits on escape',
'TodoMVC - thorax, Editing, should cancel edits on escape', 'TodoMVC - thorax, Editing, should cancel edits on escape',
......
node_modules/todomvc-app-css
!node_modules/todomvc-app-css/index.css
node_modules/todomvc-common
!node_modules/todomvc-common/base.js
!node_modules/todomvc-common/base.css
<!doctype html>
<html lang="en" data-framework="plastronjs">
<head>
<meta charset="utf-8">
<title>PlastronJS • TodoMVC</title>
<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
<style>
#filters.none li.none,
#filters.active li.active,
#filters.completed li.completed {
font-weight: bold;
}
</style>
</head>
<body>
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input id="new-todo" class="todo-entry" placeholder="What needs to be done?" autofocus>
</header>
<section id="main">
<input id="toggle-all" class="toggle-all" type="checkbox">
<label for="toggle-all">Mark all as complete</label>
<ul id="todo-list"></ul>
</section>
<footer id="footer">
<span id="todo-count"><strong>0</strong> item left</span>
<ul id="filters" class="none">
<li class="none">
<a href="#/">All</a>
</li>
<li class="active">
<a href="#/active">Active</a>
</li>
<li class="completed">
<a href="#/completed">Completed</a>
</li>
</ul>
<button id="clear-completed" class="clear-completed">Clear completed</button>
</footer>
</section>
<footer id="info">
<p>Double-click to edit a todo</p>
<p>Created by <a href="http://rhysbrettbowen.com">Rhys Brett-Bowen</a> (<a href="https://twitter.com/RhysBB">RhysBB</a>)</p>
<p>Using <a href="https://github.com/rhysbrettbowen/PlastronJS">PlastronJS</a> and <a href="https://developers.google.com/closure/">Closure Tools</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script src="node_modules/todomvc-common/base.js"></script>
<!-- <script src="http://localhost:9810/compile?id=todomvc&mode=raw"></script> -->
<script src="js/compiled.js"></script>
</body>
</html>
goog.require('mvc.Router');
goog.require('todomvc.listcontrol');
goog.require('todomvc.listmodel');
var todolist = new todomvc.listmodel();
// Create the control for the collection.
var todolistControl = new todomvc.listcontrol( todolist );
// HTML already there so use decorate.
todolistControl.decorate( goog.dom.getElement('todoapp') );
// Setup router
var router = new mvc.Router();
router.route( '{/}', function() {
todolist.set( 'filter', 'none' );
});
router.route( '/active', function() {
todolist.set( 'filter', 'active' );
});
router.route( '/completed', function() {
todolist.set( 'filter', 'completed' );
});
(function(){function g(a){throw a;}var i=void 0,j=!0,k=null,m=!1,n,r=this;function aa(){}
function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function s(a){return a!==i}function u(a){return"array"==ba(a)}function ca(a){var b=ba(a);return"array"==b||"object"==b&&"number"==typeof a.length}function v(a){return"string"==typeof a}function da(a){return"number"==typeof a}function w(a){return"function"==ba(a)}function x(a){var b=typeof a;return"object"==b&&a!=k||"function"==b}function z(a){return a[ea]||(a[ea]=++fa)}
var ea="closure_uid_"+Math.floor(2147483648*Math.random()).toString(36),fa=0;function ga(a,b,c){return a.call.apply(a.bind,arguments)}function ha(a,b,c){a||g(Error());if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
function A(a,b,c){A=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ga:ha;return A.apply(k,arguments)}var ia=Date.now||function(){return+new Date};function B(a,b){function c(){}c.prototype=b.prototype;a.d=b.prototype;a.prototype=new c;a.prototype.constructor=a};function C(){0!=ja&&(this.uc=Error().stack,ka[z(this)]=this)}var ja=0,ka={};C.prototype.rb=m;C.prototype.o=function(){if(!this.rb&&(this.rb=j,this.m(),0!=ja)){var a=z(this);delete ka[a]}};C.prototype.m=function(){this.Xb&&la.apply(k,this.Xb);if(this.yb)for(;this.yb.length;)this.yb.shift()()};function la(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];ca(d)?la.apply(k,d):d&&"function"==typeof d.o&&d.o()}};function ma(a,b){for(var c=1;c<arguments.length;c++)var d=String(arguments[c]).replace(/\$/g,"$$$$"),a=a.replace(/\%s/,d);return a}function na(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}function pa(a){if(!qa.test(a))return a;-1!=a.indexOf("&")&&(a=a.replace(ra,"&amp;"));-1!=a.indexOf("<")&&(a=a.replace(sa,"&lt;"));-1!=a.indexOf(">")&&(a=a.replace(ta,"&gt;"));-1!=a.indexOf('"')&&(a=a.replace(ua,"&quot;"));return a}var ra=/&/g,sa=/</g,ta=/>/g,ua=/\"/g,qa=/[&<>\"]/;var E=Array.prototype,va=E.indexOf?function(a,b,c){return E.indexOf.call(a,b,c)}:function(a,b,c){c=c==k?0:0>c?Math.max(0,a.length+c):c;if(v(a))return!v(b)||1!=b.length?-1:a.indexOf(b,c);for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},F=E.forEach?function(a,b,c){E.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=v(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},wa=E.filter?function(a,b,c){return E.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,h=v(a)?a.split(""):
a,l=0;l<d;l++)if(l in h){var p=h[l];b.call(c,p,l,a)&&(e[f++]=p)}return e},G=E.map?function(a,b,c){return E.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=v(a)?a.split(""):a,h=0;h<d;h++)h in f&&(e[h]=b.call(c,f[h],h,a));return e};function xa(a,b,c,d){if(a.reduce)return d?a.reduce(A(b,d),c):a.reduce(b,c);var e=c;F(a,function(c,h){e=b.call(d,e,c,h,a)});return e}
var ya=E.some?function(a,b,c){return E.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=v(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return j;return m};function za(a,b,c){b=Aa(a,b,c);return 0>b?k:v(a)?a.charAt(b):a[b]}function Aa(a,b,c){for(var d=a.length,e=v(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1}function H(a,b){return 0<=va(a,b)}function Ba(a){if(!u(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}
function Ca(a,b){var c=va(a,b);0<=c&&E.splice.call(a,c,1)}function I(a,b){var c=Aa(a,b,i);return 0<=c?(E.splice.call(a,c,1),j):m}function J(a){return E.concat.apply(E,arguments)}function K(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}function Da(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],e;if(u(d)||(e=ca(d))&&d.hasOwnProperty("callee"))a.push.apply(a,d);else if(e)for(var f=a.length,h=d.length,l=0;l<h;l++)a[f+l]=d[l];else a.push(d)}}
function Ea(a,b,c,d){E.splice.apply(a,L(arguments,1))}function L(a,b,c){return 2>=arguments.length?E.slice.call(a,b):E.slice.call(a,b,c)}function Fa(a){for(var b={},c=0,d=0;d<a.length;){var e=a[d++],f=x(e)?"o"+z(e):(typeof e).charAt(0)+e;Object.prototype.hasOwnProperty.call(b,f)||(b[f]=j,a[c++]=e)}a.length=c}function Ga(a){for(var b=[],c=0;c<arguments.length;c++){var d=arguments[c];u(d)?b.push.apply(b,Ga.apply(k,d)):b.push(d)}return b};var Ha,Ia,Ja,Ka,La;function Ma(){return r.navigator?r.navigator.userAgent:k}function Na(){return r.navigator}Ka=Ja=Ia=Ha=m;var Oa;if(Oa=Ma()){var Pa=Na();Ha=0==Oa.indexOf("Opera");Ia=!Ha&&-1!=Oa.indexOf("MSIE");(Ja=!Ha&&-1!=Oa.indexOf("WebKit"))&&Oa.indexOf("Mobile");Ka=!Ha&&!Ja&&"Gecko"==Pa.product}var Qa=Ha,M=Ia,N=Ka,Ra=Ja,Sa,Ta=Na();Sa=Ta&&Ta.platform||"";La=-1!=Sa.indexOf("Mac");Sa.indexOf("Win");Sa.indexOf("Linux");Na()&&(Na().appVersion||"").indexOf("X11");var Ua;
a:{var Va="",Wa;if(Qa&&r.opera)var Xa=r.opera.version,Va="function"==typeof Xa?Xa():Xa;else if(N?Wa=/rv\:([^\);]+)(\)|;)/:M?Wa=/MSIE\s+([^\);]+)(\)|;)/:Ra&&(Wa=/WebKit\/(\S+)/),Wa)var Ya=Wa.exec(Ma()),Va=Ya?Ya[1]:"";if(M){var Za,$a=r.document;Za=$a?$a.documentMode:i;if(Za>parseFloat(Va)){Ua=String(Za);break a}}Ua=Va}var cb={};
function O(a){var b;if(!(b=cb[a])){b=0;for(var c=na(String(Ua)).split("."),d=na(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var h=c[f]||"",l=d[f]||"",p=RegExp("(\\d*)(\\D*)","g"),t=RegExp("(\\d*)(\\D*)","g");do{var q=p.exec(h)||["","",""],y=t.exec(l)||["","",""];if(0==q[0].length&&0==y[0].length)break;b=((0==q[1].length?0:parseInt(q[1],10))<(0==y[1].length?0:parseInt(y[1],10))?-1:(0==q[1].length?0:parseInt(q[1],10))>(0==y[1].length?0:parseInt(y[1],10))?1:0)||((0==q[2].length)<
(0==y[2].length)?-1:(0==q[2].length)>(0==y[2].length)?1:0)||(q[2]<y[2]?-1:q[2]>y[2]?1:0)}while(0==b)}b=cb[a]=0<=b}return b}var db={};function eb(a){return db[a]||(db[a]=M&&!!document.documentMode&&document.documentMode>=a)};!M||eb(9);var fb=!M||eb(9),gb=M&&!O("9");!Ra||O("528");N&&O("1.9b")||M&&O("8")||Qa&&O("9.5")||Ra&&O("528");N&&!O("8")||M&&O("9");function P(a,b){this.type=a;this.currentTarget=this.target=b}n=P.prototype;n.m=function(){};n.o=function(){};n.H=m;n.defaultPrevented=m;n.Ba=j;n.stopPropagation=function(){this.H=j};n.preventDefault=function(){this.defaultPrevented=j;this.Ba=m};function hb(a){hb[" "](a);return a}hb[" "]=aa;function ib(a,b){a&&this.ta(a,b)}B(ib,P);n=ib.prototype;n.target=k;n.relatedTarget=k;n.offsetX=0;n.offsetY=0;n.clientX=0;n.clientY=0;n.screenX=0;n.screenY=0;n.button=0;n.keyCode=0;n.charCode=0;n.ctrlKey=m;n.altKey=m;n.shiftKey=m;n.metaKey=m;n.kc=m;n.P=k;
n.ta=function(a,b){var c=this.type=a.type;P.call(this,c);this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(N){var e;a:{try{hb(d.nodeName);e=j;break a}catch(f){}e=m}e||(d=k)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.offsetX=Ra||a.offsetX!==i?a.offsetX:a.layerX;this.offsetY=Ra||a.offsetY!==i?a.offsetY:a.layerY;this.clientX=a.clientX!==i?a.clientX:a.pageX;this.clientY=a.clientY!==i?a.clientY:a.pageY;this.screenX=
a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.kc=La?a.metaKey:a.ctrlKey;this.state=a.state;this.P=a;a.defaultPrevented&&this.preventDefault();delete this.H};n.stopPropagation=function(){ib.d.stopPropagation.call(this);this.P.stopPropagation?this.P.stopPropagation():this.P.cancelBubble=j};
n.preventDefault=function(){ib.d.preventDefault.call(this);var a=this.P;if(a.preventDefault)a.preventDefault();else if(a.returnValue=m,gb)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};n.m=function(){};function jb(){}var kb=0;n=jb.prototype;n.key=0;n.V=m;n.nb=m;n.ta=function(a,b,c,d,e,f){w(a)?this.wb=j:a&&a.handleEvent&&w(a.handleEvent)?this.wb=m:g(Error("Invalid listener argument"));this.fa=a;this.Ab=b;this.src=c;this.type=d;this.capture=!!e;this.ba=f;this.nb=m;this.key=++kb;this.V=m};n.handleEvent=function(a){return this.wb?this.fa.call(this.ba||this.src,a):this.fa.handleEvent.call(this.fa,a)};function Q(a,b,c){for(var d in a)b.call(c,a[d],d,a)}function R(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function lb(a,b){var c;(c=b in a)&&delete a[b];return c}function mb(a,b,c){b in a&&g(Error('The object already contains the key "'+b+'"'));a[b]=c}function nb(a){var b={},c;for(c in a)b[c]=a[c];return b}function ob(a){var b=ba(a);if("object"==b||"array"==b){if(a.Vb)return a.Vb();var b="array"==b?[]:{},c;for(c in a)b[c]=ob(a[c]);return b}return a}var pb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
function qb(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<pb.length;f++)c=pb[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};var rb={},S={},T={},sb={};
function U(a,b,c,d,e){if(b){if(u(b)){for(var f=0;f<b.length;f++)U(a,b[f],c,d,e);return k}var d=!!d,h=S;b in h||(h[b]={u:0,s:0});h=h[b];d in h||(h[d]={u:0,s:0},h.u++);var h=h[d],l=z(a),p;h.s++;if(h[l]){p=h[l];for(f=0;f<p.length;f++)if(h=p[f],h.fa==c&&h.ba==e){if(h.V)break;return p[f].key}}else p=h[l]=[],h.u++;var t=tb,q=fb?function(a){return t.call(q.src,q.key,a)}:function(a){a=t.call(q.src,q.key,a);if(!a)return a},f=q;f.src=a;h=new jb;h.ta(c,f,a,b,d,e);c=h.key;f.key=c;p.push(h);rb[c]=h;T[l]||(T[l]=
[]);T[l].push(h);a.addEventListener?(a==r||!a.qb)&&a.addEventListener(b,f,d):a.attachEvent(b in sb?sb[b]:sb[b]="on"+b,f);return c}g(Error("Invalid event type"))}function ub(a,b,c,d,e){if(u(b))for(var f=0;f<b.length;f++)ub(a,b[f],c,d,e);else{d=!!d;a:{f=S;if(b in f&&(f=f[b],d in f&&(f=f[d],a=z(a),f[a]))){a=f[a];break a}a=k}if(a)for(f=0;f<a.length;f++)if(a[f].fa==c&&a[f].capture==d&&a[f].ba==e){vb(a[f].key);break}}}
function vb(a){if(!rb[a])return m;var b=rb[a];if(b.V)return m;var c=b.src,d=b.type,e=b.Ab,f=b.capture;c.removeEventListener?(c==r||!c.qb)&&c.removeEventListener(d,e,f):c.detachEvent&&c.detachEvent(d in sb?sb[d]:sb[d]="on"+d,e);c=z(c);T[c]&&(e=T[c],Ca(e,b),0==e.length&&delete T[c]);b.V=j;if(b=S[d][f][c])b.xb=j,wb(d,f,c,b);delete rb[a];return j}
function wb(a,b,c,d){if(!d.ua&&d.xb){for(var e=0,f=0;e<d.length;e++)d[e].V?d[e].Ab.src=k:(e!=f&&(d[f]=d[e]),f++);d.length=f;d.xb=m;0==f&&(delete S[a][b][c],S[a][b].u--,0==S[a][b].u&&(delete S[a][b],S[a].u--),0==S[a].u&&delete S[a])}}function xb(a,b,c,d,e){var f=1,b=z(b);if(a[b]){a.s--;a=a[b];a.ua?a.ua++:a.ua=1;try{for(var h=a.length,l=0;l<h;l++){var p=a[l];p&&!p.V&&(f&=yb(p,e)!==m)}}finally{a.ua--,wb(c,d,b,a)}}return Boolean(f)}function yb(a,b){a.nb&&vb(a.key);return a.handleEvent(b)}
function tb(a,b){if(!rb[a])return j;var c=rb[a],d=c.type,e=S;if(!(d in e))return j;var e=e[d],f,h;if(!fb){var l;if(!(l=b))a:{l=["window","event"];for(var p=r;f=l.shift();)if(p[f]!=k)p=p[f];else{l=k;break a}l=p}f=l;l=j in e;p=m in e;if(l){if(0>f.keyCode||f.returnValue!=i)return j;a:{var t=m;if(0==f.keyCode)try{f.keyCode=-1;break a}catch(q){t=j}if(t||f.returnValue==i)f.returnValue=j}}t=new ib;t.ta(f,this);f=j;try{if(l){for(var y=[],oa=t.currentTarget;oa;oa=oa.parentNode)y.push(oa);h=e[j];h.s=h.u;for(var D=
y.length-1;!t.H&&0<=D&&h.s;D--)t.currentTarget=y[D],f&=xb(h,y[D],d,j,t);if(p){h=e[m];h.s=h.u;for(D=0;!t.H&&D<y.length&&h.s;D++)t.currentTarget=y[D],f&=xb(h,y[D],d,m,t)}}else f=yb(c,t)}finally{y&&(y.length=0)}return f}d=new ib(b,this);return f=yb(c,d)};function V(){C.call(this)}B(V,C);n=V.prototype;n.qb=j;n.xa=k;n.gb=function(a){this.xa=a};n.addEventListener=function(a,b,c,d){U(this,a,b,c,d)};n.removeEventListener=function(a,b,c,d){ub(this,a,b,c,d)};
n.dispatchEvent=function(a){var b=a.type||a,c=S;if(b in c){if(v(a))a=new P(a,this);else if(a instanceof P)a.target=a.target||this;else{var d=a,a=new P(b,this);qb(a,d)}var d=1,e,c=c[b],b=j in c,f;if(b){e=[];for(f=this;f;f=f.xa)e.push(f);f=c[j];f.s=f.u;for(var h=e.length-1;!a.H&&0<=h&&f.s;h--)a.currentTarget=e[h],d&=xb(f,e[h],a.type,j,a)&&a.Ba!=m}if(m in c)if(f=c[m],f.s=f.u,b)for(h=0;!a.H&&h<e.length&&f.s;h++)a.currentTarget=e[h],d&=xb(f,e[h],a.type,m,a)&&a.Ba!=m;else for(e=this;!a.H&&e&&f.s;e=e.xa)a.currentTarget=
e,d&=xb(f,e,a.type,m,a)&&a.Ba!=m;a=Boolean(d)}else a=j;return a};n.m=function(){V.d.m.call(this);var a,b=0,c=a==k;a=!!a;if(this==k)Q(T,function(d){for(var f=d.length-1;0<=f;f--){var e=d[f];if(c||a==e.capture)vb(e.key),b++}});else{var d=z(this);if(T[d])for(var d=T[d],e=d.length-1;0<=e;e--){var f=d[e];if(c||a==f.capture)vb(f.key),b++}}this.xa=k};function zb(a,b){C.call(this);this.da=a||1;this.la=b||Ab;this.Ma=A(this.pc,this);this.Ua=ia()}B(zb,V);zb.prototype.enabled=m;var Ab=r.window;n=zb.prototype;n.k=k;n.setInterval=function(a){this.da=a;this.k&&this.enabled?(this.stop(),this.start()):this.k&&this.stop()};n.pc=function(){if(this.enabled){var a=ia()-this.Ua;0<a&&a<0.8*this.da?this.k=this.la.setTimeout(this.Ma,this.da-a):(this.dispatchEvent(Bb),this.enabled&&(this.k=this.la.setTimeout(this.Ma,this.da),this.Ua=ia()))}};
n.start=function(){this.enabled=j;this.k||(this.k=this.la.setTimeout(this.Ma,this.da),this.Ua=ia())};n.stop=function(){this.enabled=m;this.k&&(this.la.clearTimeout(this.k),this.k=k)};n.m=function(){zb.d.m.call(this);this.stop();delete this.la};var Bb="tick";var Cb,Db=!M||eb(9);!N&&!M||M&&eb(9)||N&&O("1.9.1");M&&O("9");function Eb(a){a=a.className;return v(a)&&a.match(/\S+/g)||[]}function Fb(a,b){for(var c=Eb(a),d=L(arguments,1),e=c.length+d.length,f=c,h=0;h<d.length;h++)H(f,d[h])||f.push(d[h]);a.className=c.join(" ");return c.length==e}function Gb(a,b){var c=Eb(a),d=L(arguments,1),c=wa(c,function(a){return!H(d,a)});a.className=c.join(" ")};function Jb(a){return a?new Lb(Mb(a)):Cb||(Cb=new Lb)}function Nb(a){return v(a)?document.getElementById(a):a}
function Ob(a,b,c){var d=document,c=c||d,a=a&&"*"!=a?a.toUpperCase():"";if(c.querySelectorAll&&c.querySelector&&(a||b))return c.querySelectorAll(a+(b?"."+b:""));if(b&&c.getElementsByClassName){c=c.getElementsByClassName(b);if(a){for(var d={},e=0,f=0,h;h=c[f];f++)a==h.nodeName&&(d[e++]=h);d.length=e;return d}return c}c=c.getElementsByTagName(a||"*");if(b){d={};for(f=e=0;h=c[f];f++)a=h.className,"function"==typeof a.split&&H(a.split(/\s+/),b)&&(d[e++]=h);d.length=e;return d}return c}
function Pb(a,b){Q(b,function(b,d){"style"==d?a.style.cssText=b:"class"==d?a.className=b:"for"==d?a.htmlFor=b:d in Qb?a.setAttribute(Qb[d],b):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,b):a[d]=b})}var Qb={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};
function Rb(a,b,c,d){function e(c){c&&b.appendChild(v(c)?a.createTextNode(c):c)}for(;d<c.length;d++){var f=c[d];if(ca(f)&&!(x(f)&&0<f.nodeType)){var h;a:{if(f&&"number"==typeof f.length){if(x(f)){h="function"==typeof f.item||"string"==typeof f.item;break a}if(w(f)){h="function"==typeof f.item;break a}}h=m}F(h?K(f):f,e)}else e(f)}}function Sb(a,b){Rb(Mb(a),a,arguments,1)}function Tb(a){a&&a.parentNode&&a.parentNode.removeChild(a)}
function Ub(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}function Mb(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Lb(a){this.O=a||r.document||document}n=Lb.prototype;n.v=function(a){return v(a)?this.O.getElementById(a):a};
n.N=function(a,b,c){var d=this.O,e=arguments,f=e[0],h=e[1];if(!Db&&h&&(h.name||h.type)){f=["<",f];h.name&&f.push(' name="',pa(h.name),'"');if(h.type){f.push(' type="',pa(h.type),'"');var l={};qb(l,h);delete l.type;h=l}f.push(">");f=f.join("")}f=d.createElement(f);h&&(v(h)?f.className=h:u(h)?Fb.apply(k,[f].concat(h)):Pb(f,h));2<e.length&&Rb(d,f,e,2);return f};n.createElement=function(a){return this.O.createElement(a)};n.createTextNode=function(a){return this.O.createTextNode(a)};
n.appendChild=function(a,b){a.appendChild(b)};n.contains=Ub;function Vb(a){C.call(this);this.$b=a;this.Ta=[]}B(Vb,C);var Wb=[];function Xb(a,b,c,d,e){u(c)||(Wb[0]=c,c=Wb);for(var f=0;f<c.length;f++){var h=U(b,c[f],d||a,e||m,a.$b||a);a.Ta.push(h)}return a}function Yb(a){F(a.Ta,vb);a.Ta.length=0}Vb.prototype.m=function(){Vb.d.m.call(this);Yb(this)};Vb.prototype.handleEvent=function(){g(Error("EventHandler.handleEvent not implemented"))};function Zb(a,b){P.call(this,"navigate");this.Cc=a;this.xc=b}B(Zb,P);function $b(a,b,c,d){C.call(this);a&&!b&&g(Error("Can't use invisible history without providing a blank page."));var e;c?e=c:(e="history_state"+ac,document.write(ma(bc,e,e)),e=Nb(e));this.ra=e;this.h=c?Mb(c)?Mb(c).parentWindow||Mb(c).defaultView:window:window;this.Ob=this.h.location.href.split("#")[0];this.sa=b;M&&!b&&(this.sa="https"==window.location.protocol?"https:///":'javascript:""');this.k=new zb(cc);this.X=!a;this.L=new Vb(this);if(a||dc)d?a=d:(a="history_iframe"+ac,b=this.sa?'src="'+pa(this.sa)+
'"':"",document.write(ma(ec,a,b)),a=Nb(a)),this.S=a,this.Jb=j;dc&&(Xb(this.L,this.h,"load",this.gc),this.Gb=this.Sa=m);this.X?fc(this,this.z(),j):gc(this,this.ra.value);ac++}B($b,V);$b.prototype.B=m;$b.prototype.T=m;$b.prototype.ea=k;var hc=M&&eb(8)||N&&O("1.9.2")||Ra&&O("532.1"),dc=M&&!eb(8),ic=dc;n=$b.prototype;n.ga=k;n.m=function(){$b.d.m.call(this);this.L.o();this.W(m)};
n.W=function(a){if(a!=this.B)if(dc&&!this.Sa)this.Gb=a;else if(a)if(Qa?Xb(this.L,this.h.document,jc,this.jc):N&&Xb(this.L,this.h,"pageshow",this.ic),hc&&this.X)Xb(this.L,this.h,"hashchange",this.hc),this.B=j,this.dispatchEvent(new Zb(this.z(),m));else{if(!M||this.Sa)Xb(this.L,this.k,Bb,A(this.Tb,this,j)),this.B=j,dc||(this.ea=this.z(),this.dispatchEvent(new Zb(this.z(),m))),this.k.start()}else this.B=m,Yb(this.L),this.k.stop()};n.gc=function(){this.Sa=j;this.ra.value&&gc(this,this.ra.value,j);this.W(this.Gb)};
n.ic=function(a){a.P.persisted&&(this.W(m),this.W(j))};n.hc=function(){var a=kc(this.h);a!=this.ea&&lc(this,a,j)};n.z=function(){return this.ga!=k?this.ga:this.X?kc(this.h):mc(this)||""};function kc(a){var a=a.location.href,b=a.indexOf("#");return 0>b?"":a.substring(b+1)}function fc(a,b,c){var d=a.h.location,a=a.Ob,e=-1!=d.href.indexOf("#");if(ic||e||b)a+="#"+b;a!=d.href&&(c?d.replace(a):d.href=a)}
function gc(a,b,c){if(a.Jb||b!=mc(a))if(a.Jb=m,b=encodeURIComponent(String(b)),M){var d=a.S.contentDocument||a.S.contentWindow.document;d.open("text/html",c?"replace":i);d.write(ma(nc,pa(a.h.document.title),b));d.close()}else if(b=a.sa+"#"+b,a=a.S.contentWindow)c?a.location.replace(b):a.location.href=b}
function mc(a){if(M)return a=a.S.contentDocument||a.S.contentWindow.document,a.body?decodeURIComponent(a.body.innerHTML.replace(/\+/g," ")):k;var b=a.S.contentWindow;if(b){var c;try{var d=kc(b);c=decodeURIComponent(d.replace(/\+/g," "))}catch(e){return a.T||(a.T!=j&&a.k.setInterval(oc),a.T=j),k}a.T&&(a.T!=m&&a.k.setInterval(cc),a.T=m);return c||k}return k}
n.Tb=function(a){if(this.X){var b=kc(this.h);b!=this.ea&&lc(this,b,a)}if(!this.X||dc)if(b=mc(this)||"",this.ga==k||b==this.ga)this.ga=k,b!=this.ea&&lc(this,b,a)};function lc(a,b,c){a.ea=a.ra.value=b;a.X?(dc&&gc(a,b),fc(a,b)):gc(a,b);a.dispatchEvent(new Zb(a.z(),c))}n.jc=function(){this.k.stop();this.k.start()};
var jc=["mousedown","keydown","mousemove"],nc="<title>%s</title><body>%s</body>",ec='<iframe id="%s" style="display:none" %s></iframe>',bc='<input type="text" name="%s" id="%s" style="display:none">',ac=0,cc=150,oc=1E4;function pc(a,b){C.call(this);this.h=a||window;this.Hb=b||k;U(this.h,"popstate",this.U,m,this);U(this.h,"hashchange",this.U,m,this)}B(pc,V);n=pc.prototype;n.B=m;n.Ea=j;n.zb="/";n.W=function(a){a!=this.B&&(this.B=a)&&this.dispatchEvent(new Zb(this.z(),m))};n.z=function(){if(this.Ea){var a=this.h.location.href,b=a.indexOf("#");return 0>b?"":a.substring(b+1)}return this.Hb?this.Hb.Bc(this.zb,this.h.location):this.h.location.pathname.substr(this.zb.length)};
n.m=function(){ub(this.h,"popstate",this.U,m,this);this.Ea&&ub(this.h,"hashchange",this.U,m,this)};n.Fb=function(a){this.Ea!=a&&(a?U(this.h,"hashchange",this.U,m,this):ub(this.h,"hashchange",this.U,m,this),this.Ea=a)};n.U=function(){this.B&&this.dispatchEvent(new Zb(this.z(),j))};function qc(a,b,c,d){var e=window;this.ca=e.history&&e.history.pushState?new pc:new $b(!(!b||!a),b,c,d);this.ca.Fb&&this.ca.Fb(!a);U(this.ca,"navigate",this.fc,m,this);this.Cb=[];this.Ra="";this.ca.W(j)}B(qc,V);
qc.prototype.ja=function(a,b,c){v(a)&&(a=RegExp("^"+String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08").replace(/\\:\w+/g,"(\\w+)").replace(/\\\*/g,"(.*)").replace(/\\\[/g,"(").replace(/\\\]/g,")?").replace(/\\\{/g,"(?:").replace(/\\\}/g,")?")+"$"));this.Cb.push({ja:a,Sb:b,Wb:c})};
qc.prototype.fc=function(){var a=this.ca.z();a!=this.Ra&&(this.dispatchEvent({type:"routeExpired",Ac:this.Ra,vc:a}),this.Ra=a,za(this.Cb||[],function(b){var c=b.ja.exec(a);c?(b.Sb.apply(b.Wb,c),b=j):b=m;return b},this))};function W(){}W.sb=function(){return W.vb?W.vb:W.vb=new W};W.prototype.dc=0;W.sb();function rc(a){C.call(this);this.aa=a||Jb();this.nc=sc}B(rc,V);rc.prototype.ac=W.sb();var sc=k;n=rc.prototype;n.R=k;n.g=m;n.f=k;n.nc=k;n.c=k;n.r=k;n.b=k;n.l=k;n.Kb=m;function tc(a){return a.R||(a.R=":"+(a.ac.dc++).toString(36))}n.v=function(){return this.f};n.eb=function(a){this.f=a};function uc(a,b){a==b&&g(Error("Unable to set parent component"));b&&(a.r&&a.R&&a.r.l&&a.R&&(a.R in a.r.l&&a.r.l[a.R])&&a.r!=b)&&g(Error("Unable to set parent component"));a.r=b;rc.d.gb.call(a,b)}n.getParent=function(){return this.r};
n.gb=function(a){this.r&&this.r!=a&&g(Error("Method not supported"));rc.d.gb.call(this,a)};n.N=function(){this.f=this.aa.createElement("div")};function vc(a,b,c){a.g&&g(Error("Component already rendered"));a.f||a.N();b?b.insertBefore(a.f,c||k):a.aa.O.body.appendChild(a.f);(!a.r||a.r.g)&&a.C()}n.C=function(){this.g=j;xc(this,function(a){!a.g&&a.v()&&a.C()})};function yc(a){xc(a,function(a){a.g&&yc(a)});a.Q&&Yb(a.Q);a.g=m}
n.m=function(){rc.d.m.call(this);this.g&&yc(this);this.Q&&(this.Q.o(),delete this.Q);xc(this,function(a){a.o()});!this.Kb&&this.f&&Tb(this.f);this.r=this.c=this.f=this.l=this.b=k};n.fb=function(a){this.c=a};
n.Z=function(a,b,c){a.g&&(c||!this.g)&&g(Error("Component already rendered"));(0>b||b>(this.b?this.b.length:0))&&g(Error("Child component index out of bounds"));if(!this.l||!this.b)this.l={},this.b=[];if(a.getParent()==this){var d=tc(a);this.l[d]=a;Ca(this.b,a)}else mb(this.l,tc(a),a);uc(a,this);Ea(this.b,b,0,a);a.g&&this.g&&a.getParent()==this?(c=this.D(),c.insertBefore(a.v(),c.childNodes[b]||k)):c?(this.f||this.N(),b=this.b?this.b[b+1]||k:k,vc(a,this.D(),b?b.f:k)):this.g&&(!a.g&&a.f&&a.f.parentNode)&&
a.C()};n.D=function(){return this.f};function xc(a,b){a.b&&F(a.b,b,i)}n.removeChild=function(a,b){if(a){var c=v(a)?a:tc(a),a=this.l&&c?(c in this.l?this.l[c]:i)||k:k;c&&a&&(lb(this.l,c),Ca(this.b,a),b&&(yc(a),a.f&&Tb(a.f)),uc(a,k))}a||g(Error("Child is not in parent component"));return a};function zc(){zc.d.constructor.apply(this,L(arguments,0));this.q={Va:{},F:{}}}B(zc,rc);n=zc.prototype;n.remove=function(){Tb(this.v());this.o()};n.Yb=function(a,b){if(this.q.F[a]){var c=b.target;F(this.q.F[a],function(a){b.target=c;if(!b.H&&(!a.Db.length||ya(a.Db,function(a){if(w(a))return a(b);if(a=za(X(this,a),function(a){return Ub(a,b.target)}))b.target=a;return a},this)))a.M.call(a.ba,b),a.stop&&b.stopPropagation()},this)}};
function Ac(a,b,c,d,e,f,h){var l=["blur","focus"];a.q||(a.q={Va:{},F:{}});a.q.F[b]||(a.q.F[b]=[]);a.q.Va[b]||(a.q.Va[b]=Xb(a.Q||(a.Q=new Vb(a)),a.v(),b,A(a.Yb,a,b),H(l,b)));s(d)||(d=[]);d={Db:u(d)?d:[d],M:c,uid:k,ba:e||a,lc:f||50,stop:h};d.uid=z(d);h=a.q.F[b];a:{for(var p=a.q.F[b],l=function(a){return a.lc<=(f||50)},t=v(p)?p.split(""):p,p=p.length-1;0<=p;p--)if(p in t&&l.call(i,t[p])){l=p;break a}l=-1}Ea(h,l+1,0,d);var q={j:A(function(a){var d=this.v();a&&(d=a);c.call(e||this,new P(b,d));return q},
a),id:d.uid,$a:A(a.$a,a,d.uid)};return q}n.click=function(a,b,c,d,e){return Ac(this,"click",a,b,c,d,e)};n.$a=function(a){x(a)&&a.id&&(a=a.id);Q(this.q.F,function(b){I(b,function(b){return b.uid==a})})};
function X(a,b){var c;c=c||a.v();if(!b)return[c];if(u(b))return c=Ga(G(b,function(a){return X(this,a)},a)),Fa(c),c;"-"==b.charAt(0)&&(b="."+b.substring(1));if("."==b.charAt(0)){var d=b.substring(1),e=c||document;c=(e.querySelectorAll&&e.querySelector?e.querySelectorAll("."+d):e.getElementsByClassName?e.getElementsByClassName(d):Ob("*",d,c))||[]}else"#"==b.charAt(0)?c=[Nb(b.substring(1))]:(d=na(b.replace(/\..*/,"")),e=0<b.indexOf(".")?b.replace(/.*\./,""):k,c=Ob(d,e,c),c=K(c));return c}
n.Z=function(a,b,c){if(M&&!O(9))zc.d.Z.call(this,a,b,c);else{a.g&&(c||!this.g)&&g(Error("Component already rendered"));(0>b||b>(this.b?this.b.length:0))&&g(Error("Child component index out of bounds"));if(!this.l||!this.b)this.l={},this.b=[];if(a.getParent()==this){var d=tc(a);this.l[d]=a;Ca(this.b,a)}else mb(this.l,tc(a),a);uc(a,this);Ea(this.b,b,0,a);if(c&&(!a.bc||!this.bc||a.getParent!=this))this.f||this.N(),d=this.b?this.b[b+1]||k:k,vc(a,this.D(),d?d.f:k);if(a.g&&this.g&&a.getParent()==this){var e=
this.D();this.ya?F(this.b,function(a,b){this.ya(e,a,b)},this):e.insertBefore(a.v(),e.childNodes[b]||k)}else!c&&(this.g&&!a.g&&a.f&&a.f.parentNode)&&a.C()}};n.removeChild=function(a,b){var c=zc.d.removeChild.call(this,a,b);this.ya&&F(this.b,function(a,b){this.ya(this.D(),a,b)},this);return c};n.ya=k;function Y(a){Y.d.constructor.apply(this,L(arguments,1));this.ia=[];this.na=[];this.fb(a);this.qa=k}B(Y,zc);n=Y.prototype;n.eb=function(a){Y.d.eb.call(this,a);this.qa||(this.qa=a)};n.D=function(){return this.qa||Y.d.D.call(this)};n.fb=function(a,b){this.c&&F(G(this.ia,function(a){return a.id}),this.Ib,this);Y.d.fb.call(this,a);F(this.ia,function(a){var d=a.M.apply(this,a.Lb);a.bound=d;a.j=d.j;a.a=A(this.a,this,d.id);a.id=d.id;!b&&!H([this.jb,this.lb,this.mb],a.M)&&a.j()},this)};
n.Nb=function(a,b){var c=this.c.p(),d=this.b||[],e=G(d,function(a){return a.c}),f=wa(d,function(a){return!H(c,a.c)});0===d.length?F(c,function(b){b=new a(b);this.Z(b,this.b?this.b.length:0,j)},this):(F(f,function(a){this.removeChild(a,j);a.o()},this),F(c,function(b,c){var f;H(e,b)?(f=za(d,function(a){return a.c==b}),(this.b?this.b[c]||k:k)!=f&&this.Z(f,c)):(f=new a(b),f.N(),this.Z(f,c,j))},this));b&&b.call(this,this.D())};
n.Mb=function(a,b){var c=L(arguments,2)[0];if(a.J){var d={};a.data&&Q(a.data,function(a,b){d[b]=w(a)?a(this):a},this);d.n=this.c.get(a.e);var e=a.J(d);F(X(this,b),function(a){if("INPUT"==a.tagName&&"checkbox"!=a.getAttribute("type"))a.value!=e&&(a.value=e);else if("SELECT"==a.tagName)F(a.options,function(a){a.selected=a.value==e});else{for(var b;b=a.firstChild;)a.removeChild(b);var c=e,d=document;b=d.createElement("div");M?(b.innerHTML="<br>"+c,b.removeChild(b.firstChild)):b.innerHTML=c;if(1==b.childNodes.length)b=
b.removeChild(b.firstChild);else{for(c=d.createDocumentFragment();b.firstChild;)c.appendChild(b.firstChild);b=c}Sb(a,b)}},this)}s(a.zc)||F(X(this,b),function(b){"INPUT"==b.tagName&&"checkbox"==b.getAttribute("type")&&(b.checked=!!this.c.get(a.e[0]))},this);if(s(a.wa)){var f=a.wa;F(X(this,b),function(b){var d=f;c&&0!==c.length?Fb(b,d):Gb(b,d);a.ec&&(d=a.ec,!c||0===c.length?Fb(b,d):Gb(b,d))})}a.I&&(u(a.I)?F(X(this,b),function(b){F(a.I,function(d){d==a.Pa(c)?Fb(b,d):Gb(b,d)},this)},this):F(X(this,b),
function(b){Q(a.I,function(d,f){f==a.Pa(c)?Fb(b,d):Gb(b,d)},this)},this));a.show&&F(X(this,b),function(b){var d=a.show(c);b.style.display=d?"":"none"});if(a.A){var h={};h[a.A]=this.c.get(a.e[0]);F(X(this,b),function(b){s(h[a.A])?Pb(b,h):b.removeAttribute(a.A)})}a.oc&&a.oc.apply(this,G(a.e,function(){return this.c.get("key")},this))};
function Z(a,b,c){v(c)&&(c={J:c});if(v(c.J)){var d=c.J,e=d.match(/\{\$([^}]*)\}/g)||[],e=G(e,function(a){return a.substring(2,a.length-1)});c.J=function(a){var b=d;Q(a.n,function(a,c){b=b.replace(RegExp("\\{\\$"+c+"\\}","g"),a)});return b};c.e=c.e||[];Da(c.e,e);Fa(c.e)}c.I&&(c.Pa||(c.Pa=function(a){return a}),v(c.I)&&(c.I=[c.I]));c.show&&(c.e||(c.e=[]),v(c.show)&&Ea(c.e,0,0,c.show),w(c.show)||(c.show=function(a){return a}));u(c.e)||(c.e=[c.e]);var f=[];s(c.yc)||f.push(Ac(a,"blur",function(a){"INPUT"==
a.target.tagName&&"text"==a.target.getAttribute("type")?this.c.set(c.e[0],a.target.value):"SELECT"==a.target.tagName&&this.c.set(c.e[0],a.target.options[a.target.selectedIndex].value)},b));s(c.Za)||f.push(a.click(function(a){c.wa?(this.c.set(c.e[0],!H(Eb(a.target),c.wa)),c.stop&&a.stopPropagation()):"INPUT"==a.target.tagName&&"checkbox"==a.target.getAttribute("type")&&(this.c.set(c.e[0],a.target.checked),c.stop&&a.stopPropagation())},b,a,30));e=a.bind(c.e,function(){this.Mb.apply(this,J([c,b],K(arguments)))}).j();
e={id:z(f),Rb:f,bound:e,j:e.j,a:A(function(){this.a(z(f))},a)};a.na.push(e)}n.bind=function(a,b,c){return Bc(this,this.Qb,L(arguments,0))};n.Qb=function(a,b,c){return this.c.bind(a,b,c||this)};n.Ja=function(a,b){return Bc(this,this.Pb,L(arguments,0))};n.Pb=function(a,b){return this.c.Ja(a,b||this)};n.ib=function(a,b){return Bc(this,this.jb,L(arguments,0))};n.jb=function(a,b){return this.c.ib(a,b||this)};n.kb=function(a,b){return Bc(this,this.lb,L(arguments,0))};
n.lb=function(a,b){return this.c.kb(a,b||this)};n.Ka=function(a,b){return Bc(this,this.mb,L(arguments,0))};n.mb=function(a,b){return this.c.Ka(a,b||this)};function Bc(a,b,c){var d=b.apply(a,c||[]),b={id:d.id,bound:d,j:d.j,a:A(a.a,a,d.id),M:b,Lb:c||[]};a.ia.push(b);return b}n.ma=function(a,b){return Bc(this,this.K,L(arguments,0))};n.K=function(a,b){return this.c.ma(a,b||this)};n.Wa=function(a,b){return Bc(this,this.G,L(arguments,0))};n.G=function(a,b){return this.c.Wa(a,b||this)};
n.a=function(a){I(this.ia,function(b){x(b)&&(b=b.id);return b==(a.id||a)});var b=za(this.na,function(b){return b.id==(a.id||a)});b&&(F(b.Rb,function(a){this.$a(a)},this),a=b.bound);Ca(this.na,b);return this.Ib(a)};n.Ib=function(a){return this.c.a(a)};n.m=function(){F(K(this.ia),function(a){a.a()},this);F(K(this.na),function(a){a.a()});Y.d.m.call(this);this.q=k};M&&O(8);var Cc={"\x00":"&#0;",'"':"&quot;","&":"&amp;","'":"&#39;","<":"&lt;",">":"&gt;","\t":"&#9;","\n":"&#10;","\x0B":"&#11;","\f":"&#12;","\r":"&#13;"," ":"&#32;","-":"&#45;","/":"&#47;","=":"&#61;","`":"&#96;","\u0085":"&#133;","\u00a0":"&#160;","\u2028":"&#8232;","\u2029":"&#8233;"};function Dc(a){return Cc[a]}var Ec=/[\x00\x22\x26\x27\x3c\x3e]/g;function Fc(a){return"<strong>"+("object"===typeof a.n.active&&a.n.active&&0===a.n.active.tc?a.n.active.content:String(a.n.active).replace(Ec,Dc))+"</strong> item"+(1!=a.n.active?"s":"")+" left"};function Gc(a){Y.call(this,a)}B(Gc,Y);Gc.prototype.N=function(){var a;a:if(a=(new Lb(k)||Jb()).createElement("DIV"),a.innerHTML='<li><div class="view"><input class="toggle" type="checkbox"><label></label><button class="destroy"></button></div><input class="edit" type="text"></li>',1==a.childNodes.length){var b=a.firstChild;if(1==b.nodeType){a=b;break a}}this.eb(a)};
Gc.prototype.C=function(){var a=this.c;Z(this,".toggle","{$completed}");Z(this,"",{e:["completed"],wa:"completed",Za:j});this.click(function(){a.o()},".destroy");Z(this,"label",{e:["title"],J:function(a){return a.title},data:{title:function(a){a=a.c.get("title");return pa(a)}}});var b=X(this,".edit")[0];Ac(this,"dblclick",function(){Fb(this.v(),"editing");b.focus()},".view");Ac(this,"keyup",function(a){13===a.keyCode&&a.target.blur()});Ac(this,"blur",function(){Gb(this.v(),"editing")});Z(this,".edit",
"{$title}")};function Hc(a){Y.call(this,a)}B(Hc,Y);
Hc.prototype.C=function(){Hc.d.C.call(this);var a=this.c;Ac(this,"keyup",this.Zb,".todo-entry");Z(this,"#clear-completed",{J:"Clear completed ({$completed})",Za:j,show:j});this.click(function(){F(a.p("completed"),function(a){a.o()})},".clear-completed");Z(this,".toggle-all",{e:"allDone"});Z(this,"ul",{e:"filter",I:["active","completed","none"]});Z(this,"#todo-count",{J:Fc,e:"active"});Z(this,["#main","footer"],{show:"total",Za:j});var b=Nb("todo-list");b&&(this.qa=b);b=this.Wa(A(this.Nb,this,Gc,i)).j().j;
this.bind("filter",b);this.ma(b)};Hc.prototype.Zb=function(a){var b=a.target;if(13===a.keyCode){var c=na(b.value);c&&(a=this.c,c=new a.Ya({title:c}),a.add(c,i,i),b.value="")}};function Ic(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}g(Error("Invalid JSON string: "+a))}function Jc(){this.Aa=i}function Kc(a,b){var c=[];Lc(a,b,c);return c.join("")}
function Lc(a,b,c){switch(typeof b){case "string":Mc(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(b==k){c.push("null");break}if(u(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],Lc(a,a.Aa?a.Aa.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),Mc(f,c),c.push(":"),
Lc(a,a.Aa?a.Aa.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:g(Error("Unknown type: "+typeof b))}}var Nc={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Oc=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function Mc(a,b){b.push('"',a.replace(Oc,function(a){if(a in Nc)return Nc[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Nc[a]=e+b.toString(16)}),'"')};function $(a){var b={schema:{},sync:k,attr:{}};a||(a={});a.attr=a.attr||{};Q(a,function(c,d){s(b[d])||(a.attr[d]=c)});Q(b,function(c,d){b[d]=a[d]||b[d]});this.t={};this.wc={};this.za={};this.i=b.schema||{};this.ka=b.sync;this.oa=[];this.La={};this.ab=[];this.rc=k;this.tb=aa;this.sc=U(this,"change",this.Na,m,this);this.Ub=""+z(this);this.Oa=[m];this.Fa={};this.Y=[j];this.set(b.attr);this.dispatchEvent("load")}B($,V);
function Pc(a,b){if(x(a)){if(x(b)){var c=R(a),d=R(b),e;a:if(!ca(c)||!ca(d)||c.length!=d.length)e=m;else{e=c.length;for(var f=0;f<e;f++)if(c[f]!==d[f]){e=m;break a}e=j}if(!e)return m;for(e=0;e<c.length;e++)if(!Pc(a[c[e]],b[d[e]]))return m;return j}return m}return x(b)?m:a===b}n=$.prototype;n.hb=function(){function a(b){x(b)&&F(R(b),function(d){s(b[d])?x(b[d])&&a(b[d]):delete b[d]})}var b=nb(this.t);a(b);return b};
n.get=function(a,b){if(u(a))return xa(a,function(a,c){a[c]=this.get(c,b);return a},{},this);if(this.i[a]&&this.i[a].get){var c=this.i[a].get.apply(this,G(this.i[a].mc||[],function(c){if(c===a)return this.t[a];c=this.get(c);return s(c)?c:b},this));return s(c)?c:b}if(0>a.indexOf("."))return s(this.t[a])?this.t[a]:b;for(var c=a.split(".").reverse(),d=this.get(c.pop());c.length&&s(d);)d=d[c.pop()];return s(d)?d:b};
n.set=function(a,b,c){if(this.Oa[0])return v(a)?(this.Fa[a]=b,this.Y[0]=this.Y[0]&&c):(qb(this.Fa,a),this.Y[0]=this.Y[0]&&b),m;var d=m;if(v(a)){var e={};e[a]=b;a=e}else c=b;Q(a,function(a,b){try{if(this.i[b]&&this.i[b].set){var f;var e=this.i[b].set,q=e;if(v(e)){var y={number:da,string:v,array:ca};f=function(a){y[e.toLowerCase()](a)||g(new Qc);return a}}else q.exec?f=A(function(a,b){a.exec(b)===k&&g(new Qc);return b},this,e):(w(q)&&R(q.prototype).length&&(q=function(a){x(a)||g(new Qc);var b=Object.getPrototypeOf(a).constructor;
if(Object.getPrototypeOf(a).constructor==e)return a;for(;b.d;)if(b=b.d.constructor,b==e)return a;g(new Qc)}),f=q);var oa=f.call(this,a,c);this.t[b]=oa}else{for(var q=b.split(".").reverse(),D=this.t;1<q.length;){var Hb=q.pop();D[Hb]=D[Hb]||{};D=D[Hb]}D[q.pop()]=a}var Ib=this.i[b],ab=this.get(b),bb=Rc(this,b);if(s(Ib)&&w(Ib.pa)){var wc=Ib.pa;w(wc)&&!wc(ab,bb)&&(d=j)}else x(ab)||x(bb)?Pc(ab,bb)||(d=j):ab!==bb&&(d=j)}catch(Kb){Kb.cc?this.tb(Kb):g(Kb)}},this);if(d){if(!c){this.dispatchEvent("change");
this.za=ob(this.t);var a=this.t,b=function(a){return s(a)},e={},f;for(f in a)b.call(i,a[f])&&(e[f]=a[f]);this.t=e}return j}return m};n.$=function(){this.dispatchEvent("change")};function Rc(a,b){return a.i[b]&&a.i[b].get?a.i[b].get.apply(a,G(a.i[b].mc||[],function(a){return a===b?this.za[b]:Rc(this,a)},a)):a.za[b]}
function Sc(a,b,c,d){if(!x(b)&&!x(c))return b===c?[]:[d];var e=J(R(b),R(c));Fa(e);a=xa(e,function(a,e){return!x(b)?J(a,Sc(this,i,c[e],d+"."+e)):!x(c)?J(a,Sc(this,b[e],i,d+"."+e)):J(a,Sc(this,b[e],c[e],d+"."+e))},[],a);a.length&&a.push(d);return a}n.o=function(a,b){a&&(this.ka.Da.remove(this.get("id")),w(b)&&b.call(this,this));this.dispatchEvent("unload");F(K(this.ab),function(a){a(this)},this);$.d.o.call(this)};
n.save=function(a){this.ka&&(!s(this.get("id"))?this.ka.create(this,a):this.ka.update(this,a))};
n.Na=function(){this.Oa[0]=j;var a,b=this.i,c=J(R(b),R(this.t));Fa(c);a=xa(c,function(a,c){var d=Rc(this,c),e=this.get(c),t=b[c];return t&&s(t.pa)?(s(t.pa)&&!t.pa(d,e)&&a.push(c),a):J(a,Sc(this,e,d,c))},[],this);F(this.oa,function(b){ya(b.A,function(b){return H(a,b)})&&b.M.apply(b.ub,J(G(b.A,function(a){return this.get(a)},this)))},this);a.length&&Q(this.La,function(a){a(this)},this);this.za=ob(this.t);this.Oa[0]=m;var c=nb(this.Fa),d=this.Fa,e;for(e in d)delete d[e];e=this.Y[0];this.Y[0]=j;this.set(c,
e)};n.Ka=function(a,b){var a=A(a,b||this),c=z(a);this.ab.push(a);var d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.bind=function(a,b,c){v(a)&&(a=[a]);var d={A:a,M:b,ub:c||this};d.Qa=z(d);this.oa.push(d);var e={j:A(function(){var d=G(a,function(a){return this.get(a)},this);d.push(this);b.apply(c||this,d);return e},this),id:d.Qa,a:A(this.a,this,d.Qa)};return e};
n.a=function(a){x(a)&&a.id&&(a=a.id);return I(this.oa,function(b){return b.Qa==a})||lb(this.La,a)||I(this.ab,function(b){return z(b)==a})};n.Ja=function(a,b){var c=A(a,b||this),d=z(c);this.La[""+d]=c;var a=A(a,b||this,this),e={j:function(){a();return e},id:d,a:A(this.a,this,d)};return e};function Qc(){this.cc=j}B(Qc,Error);function Tc(a){var a=a||{},b={comparator:a.comparator||k,modelType:a.modelType||$,models:a.models||[]};lb(a,"comparator");lb(a,"modelType");lb(a,"models");this.w=[];this.ob=[b.comparator&&A(b.comparator,this)];this.Xa=[];this.Ia=[];this.Ha=[];this.Ga=[];this.cb=[];this.bb=[];this.G=[m];this.K=[m];this.Ya=b.modelType;$.call(this,a);F(b.models,function(a){this.add(a,i,j)},this)}B(Tc,$);n=Tc.prototype;
n.sort=function(a){var b=m;if(this.ob[0]){var c=this.ob[0];this.w.sort(function(a,e){var f=c(a.n,e.n);0<f&&(b=j);return f});this.G[0]=this.G[0]||b}a||this.dispatchEvent("change")};
n.add=function(a,b,c){da(b)&&0>b&&(b=this.w.length+b);var d=0,e=m;u(a)||(a=[a]);F(a,function(c){c instanceof $||(c=new this.Ya(c));if(!za(this.w,function(a){return a.n==c})){e=j;this.G[0]=j;this.K[0]=j;var h=c.Ja(A(function(){this.K[0]=j;this.sort()},this)),l=c.Ka(function(){this.remove(a)},this);Ea(this.w,da(b)?b+d:this.w.length,0,{n:c,qc:l,$:h});d+=1;h=this.Ha;l=c;H(h,l)||h.push(l)}},this);this.length=this.w.length;this.sort(j);e&&!c&&this.$();return e};
n.remove=function(a,b){u(a)||(a=[a]);var c=m;F(a,function(a){var b=za(this.w,function(b){return b.n==a});if(b){this.G[0]=j;this.K[0]=j;a.a(b.qc);a.a(b.$);Ca(this.w,b);c=j;var b=this.cb,f={n:a,id:a.get("id")||a.Ub};H(b,f)||b.push(f)}},this);this.length=this.w.length;c&&this.sort(j);c&&!b&&this.$();return c};n.p=function(a){if(v(a))var b=a,a=function(a){return a.get(b)};var c=G(this.w,function(a){return a.n});return a?wa(c,a):c};n.indexOf=function(a){return va(this.p(),a)};
n.Wa=function(a,b){var c=A(a,b||this);this.Xa.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.ma=function(a,b){var c=A(a,b||this);this.Ia.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.ib=function(a,b){var c=A(a,b||this);this.Ga.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};
n.kb=function(a,b){var c=A(a,b||this);this.bb.push(c);var c=z(c),a=A(a,b||this,this),d={j:function(){a();return d},id:c,a:A(this.a,this,c)};return d};n.a=function(a){x(a)&&a.id&&(a=a.id);return I(this.Xa,function(b){return z(b)==a})||I(this.Ia,function(b){return z(b)==a})||I(this.bb,function(b){return z(b)==a})||I(this.Ga,function(b){return z(b)==a})||Tc.d.a.call(this,a)};
n.Na=function(){Tc.d.Na.call(this);this.G[0]&&(F(K(this.Xa),function(a){a(this)},this),this.G[0]=m);this.K[0]&&(F(K(this.Ia),function(a){a(this)},this),this.i&&Q(this.i,function(a,b){a.va&&F(this.oa,function(a){H(a.A,b)&&a.M.apply(a.ub,J(G(a.A,function(a){return this.get(a)},this)))},this)},this),this.K[0]=m);F(this.bb,function(a){F(this.cb,function(b){a(b.n,b.id)})},this);Ba(this.cb);F(this.Ga,function(a){F(this.Ha,function(b){a(b)})},this);Ba(this.Ha)};function Uc(){};function Vc(a){this.ha=a;this.Eb=new Jc}n=Vc.prototype;n.ha=k;n.Eb=k;n.set=function(a,b){s(b)?this.ha.set(a,Kc(this.Eb,b)):this.ha.remove(a)};n.get=function(a){a=this.ha.get(a);if(a!==k)try{return Ic(a)}catch(b){g("Storage: Invalid value was encountered")}};n.remove=function(a){this.ha.remove(a)};function Wc(){}B(Wc,Uc);function Xc(a){this.Ca=a}B(Xc,Wc);Xc.prototype.set=function(a,b){try{this.Ca.setItem(a,b)}catch(c){g("Storage mechanism: Quota exceeded")}};Xc.prototype.get=function(a){a=this.Ca.getItem(a);!v(a)&&a!==k&&g("Storage mechanism: Invalid value was encountered");return a};Xc.prototype.remove=function(a){this.Ca.removeItem(a)};function Yc(){var a=k;try{a=window.localStorage||k}catch(b){}this.Ca=a}B(Yc,Xc);function Zc(){this.Da=new Vc(new Yc)}Zc.prototype.create=function(a,b){var c;this.pb=this.pb||0;c=this.pb++ +"|"+parseInt((new Date).getTime(),36);a.set("id",c);w(b)&&b.call(a,a)};Zc.prototype.Bb=function(a,b){a.set(this.Da.get(a.get("id")));w(b)&&b.call(a,a)};Zc.prototype.update=function(a,b){this.Da.set(a.get("id"),a.hb());w(b)&&b.call(a,a)};function $c(){Zc.call(this)}B($c,Zc);$c.prototype.Bb=function(a){var b=a.get("id"),b=this.Da.get(b)||[];F(b,function(b){b=new a.Ya(b);a.add(b,i,j)});a.$()};function ad(a){$.call(this,a);this.i.title=this.i.title||{};this.i.title.set=A(function(a){a=na(a);a.length||g(new Qc);return a},this);this.tb=function(){this.o()}}B(ad,$);function bd(){Tc.call(this,{id:"todos-plastronjs",sync:new $c,schema:{completed:{get:function(){return this.p("completed").length},va:j},allDone:{get:function(){return this.p().length===this.p("completed").length},set:function(a){F(this.p("none"),function(b){b.set("completed",a)})},va:j},active:{get:function(){return this.p().length-this.p("completed").length},va:j},total:{get:function(){return this.p().length},va:j}},modelType:ad});this.ka.Bb(this,i);this.ma(this.save)}B(bd,Tc);
var cd={none:function(){return j},active:function(a){return!a.get("completed")},completed:function(a){return a.get("completed")}};bd.prototype.p=function(a){return bd.d.p.call(this,cd[a||this.get("filter")])};bd.prototype.hb=function(){return G(this.p("none"),function(a){return a.hb()})};var dd=new bd,ed=new Hc(dd),fd=Nb("todoapp");ed.g&&g(Error("Component already rendered"));if(fd){ed.Kb=j;var gd;if(!(gd=!ed.aa))gd=ed.aa.O!=Mb(fd);gd&&(ed.aa=Jb(fd));ed.f=fd;ed.C()}else g(Error("Invalid element to decorate"));var hd=new qc;hd.ja("{/}",function(){dd.set("filter","none")});hd.ja("/active",function(){dd.set("filter","active")});hd.ja("/completed",function(){dd.set("filter","completed")});})();
\ No newline at end of file
/*global goog, mvc, todomvc */
goog.provide('todomvc.listcontrol');
goog.require('goog.events.KeyCodes');
goog.require('goog.string');
goog.require('mvc.Control');
goog.require('todomvc.templates');
goog.require('todomvc.todocontrol');
/**
* the control for the todo list, handles the page as well
*
* @constructor
* @param {mvc.Collection} list model for todo items.
* @extends {mvc.Control}
*/
todomvc.listcontrol = function( list ) {
goog.base( this, list );
};
goog.inherits( todomvc.listcontrol, mvc.Control );
/**
* setup for event listeners.
*
* @inheritDoc
*/
todomvc.listcontrol.prototype.enterDocument = function() {
goog.base( this, 'enterDocument' );
var list = /** @type {Object} */(this.getModel());
// handle new note entry
this.on( goog.events.EventType.KEYUP, this.handleNewInput, '.todo-entry' );
// update complete button based on completed
this.autobind('#clear-completed', {
template: 'Clear completed ({$completed})',
noClick: true, // click should not set completed
show: true // hide when completed == false
});
// Clear completed
this.click( function() {
goog.array.forEach( list.getModels( 'completed' ),
function( model ) {
model.dispose();
});
}, '.clear-completed' );
// when to check the check all
this.autobind('.toggle-all', {
reqs: 'allDone'
});
// change classes of ULs based on filter
this.autobind( 'ul', {
reqs: 'filter',
reqClass: ['active', 'completed', 'none']
} );
// update the count based on active
this.autobind('#todo-count', {
template: todomvc.templates.itemsLeft,
reqs: 'active'
});
// show or hide based on the totals
this.autobind(['#main', 'footer'], {
show: 'total',
noClick: true
});
// autolists on modelChange and return refresh function
var refresh = this.autolist( todomvc.todocontrol,
goog.dom.getElement('todo-list') ).fire;
// if filter changes refresh view
this.bind( 'filter', refresh );
// if anything changes save models and refresh view
this.anyModelChange( refresh );
};
/**
* adds the input as a new item
*/
todomvc.listcontrol.prototype.handleNewInput = function( e ) {
var input = e.target;
// On return get trimmed text
if ( e.keyCode !== goog.events.KeyCodes.ENTER ) {
return;
}
var text = goog.string.trim( input.value );
if ( !text ) {
return;
}
// Create new model
this.getModel().newModel({
'title': text
});
input.value = '';
};
/*global goog, mvc, soy, todomvc */
goog.provide('todomvc.todocontrol');
goog.require('goog.dom');
goog.require('goog.string');
goog.require('goog.events.KeyCodes');
goog.require('mvc.Control');
goog.require('todomvc.templates');
/**
* this is the control for a todo item.
*
* @constructor
* @param {mvc.Model} model for the control.
* @extends {mvc.Control}
*/
todomvc.todocontrol = function( model ) {
goog.base( this, model );
};
goog.inherits( todomvc.todocontrol, mvc.Control );
/**
* overrides goog.ui.Component#createDom with the todo template.
*
* @inheritDoc
*/
todomvc.todocontrol.prototype.createDom = function() {
var el = soy.renderAsElement( todomvc.templates.todoItem, null, null );
this.setElementInternal(/** @type {Element} */(el));
};
/**
* setup for event listeners.
*
* @inheritDoc
*/
todomvc.todocontrol.prototype.enterDocument = function() {
var model = this.getModel();
// Toggle complete
this.autobind('.toggle', '{$completed}');
// Change li class on completion
this.autobind('', {
reqs: ['completed'],
onClass: 'completed',
noClick: true
});
// Delete the model
this.click(function() {
model.dispose();
}, '.destroy');
// keep label inline with title
this.autobind( 'label', {
reqs: ['title'],
template: function (data) { return data.title; },
data: {
title: function (control) {
var value = control.getModel().get('title');
return goog.string.htmlEscape(value);
}
}
});
var inputEl = this.getEls('.edit')[0];
// Dblclick to edit
this.on( goog.events.EventType.DBLCLICK, function() {
goog.dom.classes.add( this.getElement(), 'editing' );
inputEl.focus();
}, '.view');
// blur on enter
this.on( goog.events.EventType.KEYUP, function( e ) {
if ( e.keyCode === goog.events.KeyCodes.ENTER ) {
e.target.blur();
}
});
// finish editing on blur
this.on( goog.events.EventType.BLUR, function() {
goog.dom.classes.remove( this.getElement(), 'editing' );
});
// bind the title and the edit input
this.autobind( '.edit', '{$title}' );
};
/*global goog, mvc, todomvc */
goog.provide('todomvc.listmodel');
goog.require('mvc.Collection');
goog.require('todomvc.listsync');
goog.require('todomvc.todomodel');
/**
* @constructor
* @extends {mvc.Collection}
*/
todomvc.listmodel = function () {
var todosSchema = {
// number of completed
'completed': {
get: function () {
return this.getModels('completed').length;
},
models: true
},
'allDone': {
get: function () {
return this.getLength() === this.getModels('completed').length;
},
set: function (done) {
goog.array.forEach(this.getModels('none'), function (model) {
model.set('completed', done);
});
},
models: true
},
// number of active models
'active': {
get: function () {
return this.getLength() - this.getModels('completed').length;
},
models: true
},
// the total
'total': {
get: function () {
return this.getLength();
},
models: true
}
};
goog.base(this, {
'id': 'todos-plastronjs',
'sync': new todomvc.listsync(),
'schema': todosSchema,
'modelType': todomvc.todomodel
});
// fetch from localstorage
this.fetch();
// save on any changes
this.anyModelChange(this.save);
};
goog.inherits(todomvc.listmodel, mvc.Collection);
todomvc.listmodel.Filter = {
'none': function () {
return true;
},
'active': function (model) {
return !model.get('completed');
},
'completed': function (model) {
return model.get('completed');
}
};
/**
* return models based on current filter or filter given
*
* @inheritDoc
*/
todomvc.listmodel.prototype.getModels = function (opt_filter) {
return goog.base(this, 'getModels',
todomvc.listmodel.Filter[opt_filter || this.get('filter')]);
};
/**
* @return {Object} todos as json.
*/
todomvc.listmodel.prototype.toJson = function () {
return goog.array.map(this.getModels('none'), function (mod) {
return mod.toJson();
});
};
goog.provide('todomvc.todomodel');
goog.require('goog.string');
goog.require('mvc.Model');
goog.require('mvc.Model.ValidateError');
/**
* @constructor
* @param {Object=} opt_options to be put on the model.
* @extends {mvc.Model}
*/
todomvc.todomodel = function (opt_options) {
goog.base(this, opt_options);
// title must have a length, also format to remove spaces
this.setter('title', function (title) {
var updated = goog.string.trim(title);
if (!updated.length) {
throw new mvc.Model.ValidateError('null string');
}
return updated;
});
// when a note title is no longer valid then remove it
this.errorHandler(function () {
this.dispose();
});
};
goog.inherits(todomvc.todomodel, mvc.Model);
This source diff could not be displayed because it is too large. You can view the blob instead.
/*global goog, mvc, todomvc */
goog.provide('todomvc.listsync');
goog.require('mvc.LocalSync');
/**
* @constructor
* @extends {mvc.LocalSync}
*/
todomvc.listsync = function() {
goog.base( this );
};
goog.inherits( todomvc.listsync, mvc.LocalSync );
/**
* @inheritDoc
*/
todomvc.listsync.prototype.read = function( model, opt_callback ) {
var id = /** @type {string} */(model.get('id'));
var todos = this.store_.get(id) || [];
goog.array.forEach(/** @type {Array} */(todos),
function( todo ) {
model.newModel( todo, true );
});
model.change();
};
html,
body {
margin: 0;
padding: 0;
}
button {
margin: 0;
padding: 0;
border: 0;
background: none;
font-size: 100%;
vertical-align: baseline;
font-family: inherit;
font-weight: inherit;
color: inherit;
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
font-smoothing: antialiased;
}
body {
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.4em;
background: #f5f5f5;
color: #4d4d4d;
min-width: 230px;
max-width: 550px;
margin: 0 auto;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
font-smoothing: antialiased;
font-weight: 300;
}
button,
input[type="checkbox"] {
outline: none;
}
.hidden {
display: none;
}
#todoapp {
background: #fff;
margin: 130px 0 40px 0;
position: relative;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
0 25px 50px 0 rgba(0, 0, 0, 0.1);
}
#todoapp input::-webkit-input-placeholder {
font-style: italic;
font-weight: 300;
color: #e6e6e6;
}
#todoapp input::-moz-placeholder {
font-style: italic;
font-weight: 300;
color: #e6e6e6;
}
#todoapp input::input-placeholder {
font-style: italic;
font-weight: 300;
color: #e6e6e6;
}
#todoapp h1 {
position: absolute;
top: -155px;
width: 100%;
font-size: 100px;
font-weight: 100;
text-align: center;
color: rgba(175, 47, 47, 0.15);
-webkit-text-rendering: optimizeLegibility;
-moz-text-rendering: optimizeLegibility;
-ms-text-rendering: optimizeLegibility;
text-rendering: optimizeLegibility;
}
#new-todo,
.edit {
position: relative;
margin: 0;
width: 100%;
font-size: 24px;
font-family: inherit;
font-weight: inherit;
line-height: 1.4em;
border: 0;
outline: none;
color: inherit;
padding: 6px;
border: 1px solid #999;
box-shadow: inset 0 -1px 5px 0 rgba(0, 0, 0, 0.2);
-ms-box-sizing: border-box;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-ms-font-smoothing: antialiased;
font-smoothing: antialiased;
}
#new-todo {
padding: 16px 16px 16px 60px;
border: none;
background: rgba(0, 0, 0, 0.003);
box-shadow: inset 0 -2px 1px rgba(0,0,0,0.03);
}
#main {
position: relative;
z-index: 2;
border-top: 1px solid #e6e6e6;
}
label[for='toggle-all'] {
display: none;
}
#toggle-all {
position: absolute;
top: -55px;
left: -12px;
width: 60px;
height: 34px;
text-align: center;
border: none; /* Mobile Safari */
}
#toggle-all:before {
content: '❯';
font-size: 22px;
color: #e6e6e6;
padding: 10px 27px 10px 27px;
}
#toggle-all:checked:before {
color: #737373;
}
#todo-list {
margin: 0;
padding: 0;
list-style: none;
}
#todo-list li {
position: relative;
font-size: 24px;
border-bottom: 1px solid #ededed;
}
#todo-list li:last-child {
border-bottom: none;
}
#todo-list li.editing {
border-bottom: none;
padding: 0;
}
#todo-list li.editing .edit {
display: block;
width: 506px;
padding: 13px 17px 12px 17px;
margin: 0 0 0 43px;
}
#todo-list li.editing .view {
display: none;
}
#todo-list li .toggle {
text-align: center;
width: 40px;
/* auto, since non-WebKit browsers doesn't support input styling */
height: auto;
position: absolute;
top: 0;
bottom: 0;
margin: auto 0;
border: none; /* Mobile Safari */
-webkit-appearance: none;
-ms-appearance: none;
appearance: none;
}
#todo-list li .toggle:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>');
}
#todo-list li .toggle:checked:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>');
}
#todo-list li label {
white-space: pre;
word-break: break-word;
padding: 15px 60px 15px 15px;
margin-left: 45px;
display: block;
line-height: 1.2;
transition: color 0.4s;
}
#todo-list li.completed label {
color: #d9d9d9;
text-decoration: line-through;
}
#todo-list li .destroy {
display: none;
position: absolute;
top: 0;
right: 10px;
bottom: 0;
width: 40px;
height: 40px;
margin: auto 0;
font-size: 30px;
color: #cc9a9a;
margin-bottom: 11px;
transition: color 0.2s ease-out;
}
#todo-list li .destroy:hover {
color: #af5b5e;
}
#todo-list li .destroy:after {
content: '×';
}
#todo-list li:hover .destroy {
display: block;
}
#todo-list li .edit {
display: none;
}
#todo-list li.editing:last-child {
margin-bottom: -1px;
}
#footer {
color: #777;
padding: 10px 15px;
height: 20px;
text-align: center;
border-top: 1px solid #e6e6e6;
}
#footer:before {
content: '';
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 50px;
overflow: hidden;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
0 8px 0 -3px #f6f6f6,
0 9px 1px -3px rgba(0, 0, 0, 0.2),
0 16px 0 -6px #f6f6f6,
0 17px 2px -6px rgba(0, 0, 0, 0.2);
}
#todo-count {
float: left;
text-align: left;
}
#todo-count strong {
font-weight: 300;
}
#filters {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
right: 0;
left: 0;
}
#filters li {
display: inline;
}
#filters li a {
color: inherit;
margin: 3px;
padding: 3px 7px;
text-decoration: none;
border: 1px solid transparent;
border-radius: 3px;
}
#filters li a.selected,
#filters li a:hover {
border-color: rgba(175, 47, 47, 0.1);
}
#filters li a.selected {
border-color: rgba(175, 47, 47, 0.2);
}
#clear-completed,
html #clear-completed:active {
float: right;
position: relative;
line-height: 20px;
text-decoration: none;
cursor: pointer;
visibility: hidden;
position: relative;
}
#clear-completed::after {
visibility: visible;
content: 'Clear completed';
position: absolute;
right: 0;
white-space: nowrap;
}
#clear-completed:hover::after {
text-decoration: underline;
}
#info {
margin: 65px auto 0;
color: #bfbfbf;
font-size: 10px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
text-align: center;
}
#info p {
line-height: 1;
}
#info a {
color: inherit;
text-decoration: none;
font-weight: 400;
}
#info a:hover {
text-decoration: underline;
}
/*
Hack to remove background from Mobile Safari.
Can't use it globally since it destroys checkboxes in Firefox
*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
#toggle-all,
#todo-list li .toggle {
background: none;
}
#todo-list li .toggle {
height: 40px;
}
#toggle-all {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
-webkit-appearance: none;
appearance: none;
}
}
@media (max-width: 430px) {
#footer {
height: 50px;
}
#filters {
bottom: 10px;
}
}
hr {
margin: 20px 0;
border: 0;
border-top: 1px dashed #c5c5c5;
border-bottom: 1px dashed #f7f7f7;
}
.learn a {
font-weight: normal;
text-decoration: none;
color: #b83f45;
}
.learn a:hover {
text-decoration: underline;
color: #787e7e;
}
.learn h3,
.learn h4,
.learn h5 {
margin: 10px 0;
font-weight: 500;
line-height: 1.2;
color: #000;
}
.learn h3 {
font-size: 24px;
}
.learn h4 {
font-size: 18px;
}
.learn h5 {
margin-bottom: 0;
font-size: 14px;
}
.learn ul {
padding: 0;
margin: 0 0 30px 25px;
}
.learn li {
line-height: 20px;
}
.learn p {
font-size: 15px;
font-weight: 300;
line-height: 1.3;
margin-top: 0;
margin-bottom: 0;
}
#issue-count {
display: none;
}
.quote {
border: none;
margin: 20px 0 60px 0;
}
.quote p {
font-style: italic;
}
.quote p:before {
content: '“';
font-size: 50px;
opacity: .15;
position: absolute;
top: -20px;
left: 3px;
}
.quote p:after {
content: '”';
font-size: 50px;
opacity: .15;
position: absolute;
bottom: -42px;
right: 3px;
}
.quote footer {
position: absolute;
bottom: -40px;
right: 0;
}
.quote footer img {
border-radius: 3px;
}
.quote footer a {
margin-left: 5px;
vertical-align: middle;
}
.speech-bubble {
position: relative;
padding: 10px;
background: rgba(0, 0, 0, .04);
border-radius: 5px;
}
.speech-bubble:after {
content: '';
position: absolute;
top: 100%;
right: 30px;
border: 13px solid transparent;
border-top-color: rgba(0, 0, 0, .04);
}
.learn-bar > .learn {
position: absolute;
width: 272px;
top: 8px;
left: -300px;
padding: 10px;
border-radius: 5px;
background-color: rgba(255, 255, 255, .6);
transition-property: left;
transition-duration: 500ms;
}
@media (min-width: 899px) {
.learn-bar {
width: auto;
padding-left: 300px;
}
.learn-bar > .learn {
left: 8px;
}
}
/* global _ */
(function () {
'use strict';
/* jshint ignore:start */
// Underscore's Template Module
// Courtesy of underscorejs.org
var _ = (function (_) {
_.defaults = function (object) {
if (!object) {
return object;
}
for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {
var iterable = arguments[argsIndex];
if (iterable) {
for (var key in iterable) {
if (object[key] == null) {
object[key] = iterable[key];
}
}
}
}
return object;
}
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /(.)^/;
// Certain characters need to be escaped so that they can be put into a
// string literal.
var escapes = {
"'": "'",
'\\': '\\',
'\r': 'r',
'\n': 'n',
'\t': 't',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
_.template = function(text, data, settings) {
var render;
settings = _.defaults({}, settings, _.templateSettings);
// Combine delimiters into one regular expression via alternation.
var matcher = new RegExp([
(settings.escape || noMatch).source,
(settings.interpolate || noMatch).source,
(settings.evaluate || noMatch).source
].join('|') + '|$', 'g');
// Compile the template source, escaping string literals appropriately.
var index = 0;
var source = "__p+='";
text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
source += text.slice(index, offset)
.replace(escaper, function(match) { return '\\' + escapes[match]; });
if (escape) {
source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
}
if (interpolate) {
source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
}
if (evaluate) {
source += "';\n" + evaluate + "\n__p+='";
}
index = offset + match.length;
return match;
});
source += "';\n";
// If a variable is not specified, place data values in local scope.
if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
source = "var __t,__p='',__j=Array.prototype.join," +
"print=function(){__p+=__j.call(arguments,'');};\n" +
source + "return __p;\n";
try {
render = new Function(settings.variable || 'obj', '_', source);
} catch (e) {
e.source = source;
throw e;
}
if (data) return render(data, _);
var template = function(data) {
return render.call(this, data, _);
};
// Provide the compiled function source as a convenience for precompilation.
template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
return template;
};
return _;
})({});
if (location.hostname === 'todomvc.com') {
window._gaq = [['_setAccount','UA-31081062-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'));
}
/* jshint ignore:end */
function redirect() {
if (location.hostname === 'tastejs.github.io') {
location.href = location.href.replace('tastejs.github.io/todomvc', 'todomvc.com');
}
}
function findRoot() {
var base = location.href.indexOf('examples/');
return location.href.substr(0, base);
}
function getFile(file, callback) {
if (!location.host) {
return console.info('Miss the info bar? Run TodoMVC from a server to avoid a cross-origin error.');
}
var xhr = new XMLHttpRequest();
xhr.open('GET', findRoot() + file, true);
xhr.send();
xhr.onload = function () {
if (xhr.status === 200 && callback) {
callback(xhr.responseText);
}
};
}
function Learn(learnJSON, config) {
if (!(this instanceof Learn)) {
return new Learn(learnJSON, config);
}
var template, framework;
if (typeof learnJSON !== 'object') {
try {
learnJSON = JSON.parse(learnJSON);
} catch (e) {
return;
}
}
if (config) {
template = config.template;
framework = config.framework;
}
if (!template && learnJSON.templates) {
template = learnJSON.templates.todomvc;
}
if (!framework && document.querySelector('[data-framework]')) {
framework = document.querySelector('[data-framework]').dataset.framework;
}
this.template = template;
if (learnJSON.backend) {
this.frameworkJSON = learnJSON.backend;
this.frameworkJSON.issueLabel = framework;
this.append({
backend: true
});
} else if (learnJSON[framework]) {
this.frameworkJSON = learnJSON[framework];
this.frameworkJSON.issueLabel = framework;
this.append();
}
this.fetchIssueCount();
}
Learn.prototype.append = function (opts) {
var aside = document.createElement('aside');
aside.innerHTML = _.template(this.template, this.frameworkJSON);
aside.className = 'learn';
if (opts && opts.backend) {
// Remove demo link
var sourceLinks = aside.querySelector('.source-links');
var heading = sourceLinks.firstElementChild;
var sourceLink = sourceLinks.lastElementChild;
// Correct link path
var href = sourceLink.getAttribute('href');
sourceLink.setAttribute('href', href.substr(href.lastIndexOf('http')));
sourceLinks.innerHTML = heading.outerHTML + sourceLink.outerHTML;
} else {
// Localize demo links
var demoLinks = aside.querySelectorAll('.demo-link');
Array.prototype.forEach.call(demoLinks, function (demoLink) {
if (demoLink.getAttribute('href').substr(0, 4) !== 'http') {
demoLink.setAttribute('href', findRoot() + demoLink.getAttribute('href'));
}
});
}
document.body.className = (document.body.className + ' learn-bar').trim();
document.body.insertAdjacentHTML('afterBegin', aside.outerHTML);
};
Learn.prototype.fetchIssueCount = function () {
var issueLink = document.getElementById('issue-count-link');
if (issueLink) {
var url = issueLink.href.replace('https://github.com', 'https://api.github.com/repos');
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onload = function (e) {
var parsedResponse = JSON.parse(e.target.responseText);
if (parsedResponse instanceof Array) {
var count = parsedResponse.length
if (count !== 0) {
issueLink.innerHTML = 'This app has ' + count + ' open issues';
document.getElementById('issue-count').style.display = 'inline';
}
}
};
xhr.send();
}
};
redirect();
getFile('learn.json', Learn);
})();
{
"private": true,
"dependencies": {
"todomvc-common": "^1.0.1",
"todomvc-app-css": "^1.0.1"
}
}
{
"id": "todomvc",
"inputs": "js/app.js",
"paths": ["js/", "template/"],
"output-wrapper": "(function(){%output%})();",
"mode": "ADVANCED",
"level": "VERBOSE",
"output-file": "js/compiled.js"
}
# PlastronJS TodoMVC Example
> PlastronJS is an MVC library which uses the Google Closure library for use with the Closure Compiler.
> _[PlastronJS - rhysbrettbowen.github.io/PlastronJS](http://rhysbrettbowen.github.io/PlastronJS)_
## Learning PlastronJS
The [PlastronJS website](http://rhysbrettbowen.github.io/PlastronJS) is a great resource for getting started.
Here are some links you may find helpful:
* [PlastronJS on GitHub](https://github.com/rhysbrettbowen/PlastronJS)
Articles and guides from the community:
* [The Future of PlastronJS](http://modernjavascript.blogspot.com/2012/11/the-future-of-plastronjs.html)
* [Krisztian Toth's JavaScript Games, XRegExp, PlastronJS](http://dailyjs.com/2012/04/06/toth-xregexp-plastron)
_If you have other helpful links to share, or find any of the links above no longer work, please [let us know](https://github.com/tastejs/todomvc/issues)._
## Running
The app is built with [Plovr](http://plovr.com). To run the unminified version you need to:
1. [Download Plovr](http://plovr.com/download.html)
2. Create a directory called `build`
3. Put the jar file in the build folder
4. Create a folder, `js/lib`
5. Download and move the contents of [PlastronJS](https://github.com/rhysbrettbowen/PlastronJS) to `js/lib`
Then run the following command in your terminal:
java -jar build/plovr.jar serve plovr.json
Change the script src at the bottom of `index.html` from:
js/compiled.js
to
http://localhost:9810/compile?id=todomvc&mode=raw
You can now view the uncompiled example and play around with it!
## Compiling
Once you have done the steps above, you can compile any changes you make by running the below command:
java -jar build/plovr.jar build plovr.json
View the compiled version for the page by changing the bottom script `src` back to `js/compiled`.
## Credit
This TodoMVC application was created by [Rhys Brett-Bowen](http://rhysbrettbowen.com).
{namespace todomvc.templates}
/**
*/
{template .todoItem}
<li>
<div class="view">
<input class="toggle" type="checkbox">
<label></label>
<button class="destroy"></button>
</div>
<input class="edit" type="text">
</li>
{/template}
/**
* use template for the 's' logic.
* Used in autobind so gets data under model namespace.
*
* @param model
*/
{template .itemsLeft}
<strong>{$model['active']}</strong> item{if $model['active'] != 1}s{/if} left
{/template}
...@@ -233,9 +233,6 @@ ...@@ -233,9 +233,6 @@
<li> <li>
<a href="examples/olives/" data-source="https://github.com/flams/olives" data-content="Olives is a JS MVC framework that helps you create realtime UIs. It includes a set of AMD/CommonJS modules that are easily extensive, a high level of abstraction to reduce boilerplate and is based on socket.io, to provide a powerful means to communicate with node.js.">Olives</a> <a href="examples/olives/" data-source="https://github.com/flams/olives" data-content="Olives is a JS MVC framework that helps you create realtime UIs. It includes a set of AMD/CommonJS modules that are easily extensive, a high level of abstraction to reduce boilerplate and is based on socket.io, to provide a powerful means to communicate with node.js.">Olives</a>
</li> </li>
<li class="routing">
<a href="examples/plastronjs/" data-source="https://github.com/rhysbrettbowen/PlastronJS" data-content="PlastronJS is an mvc framework built on top of the Closure Library and built to compile with projects that use the Closure Compiler.">PlastronJS</a>
</li>
<li> <li>
<a href="examples/dijon/" data-source="https://github.com/creynders/dijon-framework" data-content="Dijon is an IOC and DI micro-framework for Javascript. Originally it was meant to be a port of Robotlegs, but deviated to something quite different. It remains however heavily inspired by Robotlegs, and more specifically Swiftsuspenders.">Dijon</a> <a href="examples/dijon/" data-source="https://github.com/creynders/dijon-framework" data-content="Dijon is an IOC and DI micro-framework for Javascript. Originally it was meant to be a port of Robotlegs, but deviated to something quite different. It remains however heavily inspired by Robotlegs, and more specifically Swiftsuspenders.">Dijon</a>
</li> </li>
......
...@@ -1631,31 +1631,6 @@ ...@@ -1631,31 +1631,6 @@
}] }]
}] }]
}, },
"plastronjs": {
"name": "PlastronJS",
"description": "PlastronJS is an MVC library which uses the Google Closure library for use with the Closure Compiler.",
"homepage": "rhysbrettbowen.github.io/PlastronJS",
"examples": [{
"name": "Example",
"url": "examples/plastronjs"
}],
"link_groups": [{
"heading": "Official Resources",
"links": [{
"name": "PlastronJS on GitHub",
"url": "https://github.com/rhysbrettbowen/PlastronJS"
}]
}, {
"heading": "Articles and Guides",
"links": [{
"name": "The Future of PlastronJS",
"url": "http://modernjavascript.blogspot.com/2012/11/the-future-of-plastronjs.html"
}, {
"name": "Krisztian Toth's JavaScript Games, XRegExp, PlastronJS",
"url": "http://dailyjs.com/2012/04/06/toth-xregexp-plastron"
}]
}]
},
"polymer": { "polymer": {
"name": "Polymer", "name": "Polymer",
"description": "Polymer is a new type of library for the web, built on top of Web Components, and designed to leverage the evolving web platform on modern browsers. It is comprised of core platform features (e.g Shadow DOM, Custom Elements, MDV) enabled with polyfills and a next generation web application framework built on these technologies.", "description": "Polymer is a new type of library for the web, built on top of Web Components, and designed to leverage the evolving web platform on modern browsers. It is comprised of core platform features (e.g Shadow DOM, Custom Elements, MDV) enabled with polyfills and a next generation web application framework built on these technologies.",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment