diff -r efd9c589177a -r c0b4a8b5a012 toolkit/exemples/tapisserie/scripts/pure_min.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/toolkit/exemples/tapisserie/scripts/pure_min.js Thu Apr 10 14:20:23 2014 +0200 @@ -0,0 +1,34 @@ +/*! + PURE Unobtrusive Rendering Engine for HTML + + Licensed under the MIT licenses. + More information at: http://www.opensource.org + + Copyright (c) 2011 Michael Cvilic - BeeBole.com + + Thanks to Rog Peppe for the functional JS jump + revision: 2.72 +*/ +var $p,pure=$p=function(d,h){var m=d,t=false;if(typeof m==="string")t=h||false;else if(m&&!m[0]&&!m.length)m=[m];return $p.core(m,t)}; +$p.core=function(d,h,m){function t(a){if(typeof console!=="undefined"){console.log(a);debugger}throw"pure error: "+a;}function O(){var a=$p.plugins,b=function(){};b.prototype=a;b.prototype.compile=a.compile||P;b.prototype.render=a.render||Q;b.prototype.autoRender=a.autoRender||R;b.prototype.find=a.find||S;b.prototype._compiler=B;b.prototype._error=t;return new b}function G(a){return a.outerHTML||function(b){var f=document.createElement("div");f.appendChild(b.cloneNode(true));return f.innerHTML}(a)} +function C(a,b){return function(f){return a(""+b.call(f.item||f.context,f))}}function S(a,b){if(typeof a==="string"){b=a;a=false}return typeof document.querySelectorAll!=="undefined"?(a||document).querySelectorAll(b):t("You can test PURE standalone with: iPhone, FF3.5+, Safari4+ and IE8+\n\nTo run PURE on your browser, you need a JS library/framework with a CSS selector engine")}function H(a,b){return function(f){for(var c=[a[0]],g=a.length,i,k,l,e,n=1;n-1){c[c.length-1]=l.substring(0,e);k=k.substr(1)}}c[c.length]=i;c[c.length]=k}return c.join("")}}function T(a){var b=a.match(/^(\w+)\s*<-\s*(\S+)?$/);b===null&&t('bad loop spec: "'+a+'"');b[1]==="item"&&t('"item<-..." is a reserved word for the current running iteration.\n\nPlease choose another name for your loop.');if(!b[2]||b[2]&&/context/i.test(b[2]))b[2]=function(f){return f.context};return{name:b[1],sel:b[2]}}function y(a){if(typeof a==="function")return function(e){e= +a.call(e.item||e.context||e,e);return!e&&e!==0?"":e};var b=a.match(/^[a-zA-Z\$_\@][\w\$:-]*(\.[\w\$:-]*[^\.])*$/);if(b===null){var f=false,c=a,g=[],i=[],k=0,l;if(/\'|\"/.test(c.charAt(0))){if(/\'|\"/.test(c.charAt(c.length-1))){l=c.substring(1,c.length-1);return function(){return l}}}else for(;(b=c.match(/#\{([^{}]+)\}/))!==null;){f=true;g[k++]=c.slice(0,b.index);i[k]=y(b[1]);c=c.slice(b.index+b[0].length,c.length)}if(!f)return function(){return a};g[k]=c;return H(g,i)}b=a.split(".");return function(e){var n= +e.context||e,o=e[b[0]];e=0;if(o&&o.item){e+=1;if(b[e]==="pos")return o.pos;else n=o.item}for(o=b.length;e=0;x--){z=i.a[x];v=(v=z.l[0])&&v[p.prop];if(typeof v!=="undefined"){p.prop=z.p+"."+p.prop;if(i.l[p.prop]=== +true)v=v[0];break}}if(typeof v==="undefined"){v=y(p.prop)(F(b)?b[0]:b);if(v==="")return false}if(F(v)){i.a.push({l:v,p:p.prop});i.l[p.prop]=true;p.t="loop"}else p.t="str";return p}var c=a.getElementsByTagName("*"),g=[],i={a:[],l:{}},k,l,e,n,o,u,s,q;e=-1;for(n=c.length;e-1?c[e]:a;if(s.nodeType===1&&s.className!==""){q=s.className.split(" ");o=0;for(u=q.length;o-1||l){s.className=s.className.replace("@"+ +k.attr,"");if(l)k.attr=false}g.push({n:s,cspec:k})}}}}return g}function B(a,b,f,c){var g=[],i,k,l,e,n,o,u,s,q,j=[];c=c||f&&V(a,f);if(f)for(;c.length>0;){l=c[0].cspec;e=c[0].n;c.splice(0,1);if(l.t==="str"){e=D(e,l,false);E(e,g.length);g[g.length]=C(e.quotefn,y(l.prop))}else{o=y(l.sel);e=D(e,l,true);n=e.nodes;i=0;for(k=n.length;i]+)\s(value\=""|selected)\s?([^>]*)>/ig,"<$1 $3>");a=a.split(J).join("");a=a.split(K);for(f=1;f";g=1;break;case "TR":b=""+b+"
";g=2;break;case "TD":case "TH":b= +""+b+"
";g=3;break}tmp=document.createElement("SPAN");tmp.style.display="none";document.body.appendChild(tmp);tmp.innerHTML=b;for(f=tmp.firstChild;g--;)f=f.firstChild;c.insertBefore(f,a);c.removeChild(a);document.body.removeChild(tmp);return a=f}var A=[];m=m||O();switch(typeof d){case "string":A=m.find(h||document,d);A.length===0&&t('The template "'+d+'" was not found');break;case "undefined":t("The root of the template is undefined, check your selector");break; +default:A=d}var w=0;for(d=A.length;w