Skip to content
Browse files

fix direct node assignment with (node)

  • Loading branch information...
1 parent 74364ee commit 6cfd32ccd8faf0279553405b92f56037f41ff88b @pure committed Jan 16, 2011
Showing with 29 additions and 27 deletions.
  1. +1 −1 README.md
  2. +1 −1 index.html
  3. 0 index.js
  4. +1 −1 js/demo.js
  5. +3 −1 libs/pure.js
  6. +23 −23 libs/pure_min.js
View
2 README.md
@@ -9,5 +9,5 @@
<p>&nbsp;</p>
-Copyright (c) 2010 Michael Cvilic - BeeBole. All Rights Reserved
+&copy; 2011 Michael Cvilic - BeeBole. All Rights Reserved
PURE is an Open Source Software. You can use, redistribute and/or modify it under the terms of the MIT Licence.
View
2 index.html
@@ -8,7 +8,7 @@
<!--JSON needed to show the source code only -->
<script src="libs/json2.js"></script>
- <script src="libs/pure_min.js"></script>
+ <script src="libs/pure.js"></script>
<!-- Example page files -->
<script src="js/demo.js"></script>
View
0 index.js
No changes.
View
2 js/demo.js
@@ -2,7 +2,7 @@
var loadLib, runAll, run, transform;
(function(){
-
+ //java -jar compiler.jar --js libs/pure.js --js_output_file libs/pure_min.js
var currLib = 'jquery'; //default lib
loadLib = function(lib){
View
4 libs/pure.js
@@ -7,7 +7,7 @@
Copyright (c) 2010 Michael Cvilic - BeeBole.com
Thanks to Rog Peppe for the functional JS jump
- revision: 2.63
+ revision: 2.64
*/
var $p, pure = $p = function(){
@@ -16,6 +16,8 @@ var $p, pure = $p = function(){
if(typeof sel === 'string'){
ctxt = arguments[1] || false;
+ }else if(sel && !sel[0] && !sel.length){
+ sel = [sel];
}
return $p.core(sel, ctxt);
};
View
46 libs/pure_min.js
@@ -7,27 +7,27 @@
Copyright (c) 2010 Michael Cvilic - BeeBole.com
Thanks to Rog Peppe for the functional JS jump
- revision: 2.63
+ revision: 2.64
*/
-var $p,pure=$p=function(d,k){var r=false;if(typeof d==="string")r=k||false;return $p.core(d,r)};
-$p.core=function(d,k,r){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 e=document.createElement("div");e.appendChild(b.cloneNode(true));return e.innerHTML}(a)}
-function C(a,b){return function(e){return a(""+b.call(this,e))}}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(e){for(var c=[a[0]],g=a.length,h,j,l,f,m=1;m<g;m++){h=b[m].call(this,e);j=a[m];if(h===""){l=c[c.length-
-1];if((f=l.search(/[^\s]+=\"?$/))>-1){c[c.length-1]=l.substring(0,f);j=j.substr(1)}}c[c.length]=h;c[c.length]=j}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(e){return e.context};return{name:b[1],sel:b[2]}}function y(a){if(typeof a==="function")return a;
-var b=a.match(/^[a-zA-Z\$_\@][\w\$:-]*(\.[\w\$:-]*[^\.])*$/);if(b===null){var e=false,c=a,g=[],h=[],j=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;){e=true;g[j++]=c.slice(0,b.index);h[j]=y(b[1]);c=c.slice(b.index+b[0].length,c.length)}if(!e)return function(){return a};g[j]=c;return H(g,h)}b=a.split(".");return function(f){var m=f.context||f,n=f[b[0]];f=0;if(n&&n.item){f+=
-1;if(b[f]==="pos")return n.pos;else m=n.item}for(n=b.length;f<n;f++){if(!m)break;m=m[b[f]]}return!m&&m!==0?"":m}}function D(a,b,e){var c,g,h,j,l,f=[];if(typeof b==="string"){c=b;(l=b.match(I))||t("bad selector syntax: "+b);g=l[1];h=l[2];j=l[3];l=l[4];if(h==="."||!h&&j)f[0]=a;else f=r.find(a,h);if(!f||f.length===0)return t('The node "'+b+'" was not found in the template:\n'+G(a).replace(/\t/g," "))}else{g=b.prepend;j=b.attr;l=b.append;f=[a]}if(g||l)if(g&&l)t("append/prepend cannot take place at the same time");
-else if(e)t("no append/prepend/replace modifiers allowed for loop target");else l&&e&&t("cannot append with loop (sel: "+c+")");var m,n,u,s,p;if(j){u=/^style$/i.test(j);p=(s=/^class$/i.test(j))?"className":j;m=function(i,q){i.setAttribute(J+j,q);if(p in i&&!u)i[p]="";if(i.nodeType===1){i.removeAttribute(j);s&&i.removeAttribute(p)}};n=u||s?u?function(i){return i.style.cssText}:function(i){return i.className}:function(i){return i.getAttribute(j)};a=function(i){return i.replace(/\"/g,"&quot;")};g=g?
-function(i,q){m(i,q+n(i))}:l?function(i,q){m(i,n(i)+q)}:function(i,q){m(i,q)}}else{g=e?function(i,q){var o=i.parentNode;if(o){o.insertBefore(document.createTextNode(q),i.nextSibling);o.removeChild(i)}}:g?function(i,q){i.insertBefore(document.createTextNode(q),i.firstChild)}:l?function(i,q){i.appendChild(document.createTextNode(q))}:function(i,q){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(document.createTextNode(q))};a=function(i){return i}}return{attr:j,nodes:f,set:g,sel:c,quotefn:a}}
-function E(a,b){for(var e=K+b+":",c=0;c<a.nodes.length;c++)a.set(a.nodes[c],e)}function L(a,b,e,c,g){return function(h){var j=b(h),l=h[a],f={items:j},m=0,n,u=[],s=function(i,q,o,x){var z=h.pos,v=h.item,U=h.items;h.pos=q.pos=i;h.item=q.item=j[i];h.items=j;typeof x!=="undefined"&&(h.length=x);if(typeof o==="function"&&o.call(h.item,h)===false)m++;else{u.push(e.call(h.item,h));h.pos=z;h.item=v;h.items=U}};h[a]=f;if(F(j)){n=j.length||0;typeof c==="function"&&j.sort(c);for(var p=0;p<n;p++)s(p,f,g,n-m)}else{j&&
-typeof c!=="undefined"&&t("sort is only available on arrays, not objects");for(n in j)j.hasOwnProperty(n)&&s(n,f,g)}typeof l!=="undefined"?h[a]=l:delete h[a];return u.join("")}}function M(a,b,e,c){var g=false,h,j,l,f;for(f in e)if(e.hasOwnProperty(f))if(f==="sort")j=e.sort;else if(f==="filter")l=e.filter;else{g&&t("cannot have more than one loop on a target");h=f;g=true}h||t("Error in the selector: "+b+"\nA directive action must be a string, a function or a loop(<-)");g=e[h];if(typeof g==="string"||
-typeof g==="function"){e={};e[h]={root:g};return M(a,b,e,c)}e=T(h);h=y(e.sel);a=D(a,b,true);b=a.nodes;for(w=0;w<b.length;w++){f=b[w];var m=B(f,g);c[c.length]=C(a.quotefn,L(e.name,h,m,j,l));a.nodes=[f];E(a,c.length-1)}return a}function V(a,b){function e(i,q){var o=i.match(I);o={prepend:!!o[1],prop:o[2],attr:o[3]||W[q],append:!!o[4],sel:i};var x,z,v;for(x=h.a.length-1;x>=0;x--){z=h.a[x];v=(v=z.l[0])&&v[o.prop];if(typeof v!=="undefined"){o.prop=z.p+"."+o.prop;if(h.l[o.prop]===true)v=v[0];break}}if(typeof v===
-"undefined"){v=y(o.prop)(F(b)?b[0]:b);if(v==="")return false}if(F(v)){h.a.push({l:v,p:o.prop});h.l[o.prop]=true;o.t="loop"}else o.t="str";return o}var c=a.getElementsByTagName("*"),g=[],h={a:[],l:{}},j,l,f,m,n,u,s,p;f=-1;for(m=c.length;f<m;f++){s=f>-1?c[f]:a;if(s.nodeType===1&&s.className!==""){p=s.className.split(" ");n=0;for(u=p.length;n<u;n++){j=p[n];j=e(j,s.tagName);if(j!==false){l=/nodevalue/i.test(j.attr);if(j.sel.indexOf("@")>-1||l){s.className=s.className.replace("@"+j.attr,"");if(l)j.attr=
-false}g.push({n:s,cspec:j})}}}}return g}function B(a,b,e,c){var g=[],h,j,l,f,m,n,u,s,p,i=[];c=c||e&&V(a,e);if(e)for(;c.length>0;){l=c[0].cspec;f=c[0].n;c.splice(0,1);if(l.t==="str"){f=D(f,l,false);E(f,g.length);g[g.length]=C(f.quotefn,y(l.prop))}else{n=y(l.sel);f=D(f,l,true);m=f.nodes;h=0;for(j=m.length;h<j;h++){u=m[h];s=B(u,false,e,c);g[g.length]=C(f.quotefn,L(l.sel,n,s));f.nodes=[u];E(f,g.length-1)}}}for(p in b)if(b.hasOwnProperty(p)){e=0;c=b[p];l=p.split(/\s*,\s*/);n=l.length;do if(typeof c===
-"function"||typeof c==="string"){p=l[e];f=D(a,p,false);E(f,g.length);g[g.length]=C(f.quotefn,y(c))}else M(a,p,c,g);while(++e<n)}a=G(a);a=a.replace(/<([^>]+)\s(value\=""|selected)\s?([^>]*)>/ig,"<$1 $3>");a=a.split(J).join("");a=a.split(K);for(e=1;e<a.length;e++){b=a[e];i[e]=g[parseInt(b,10)];a[e]=b.substring(b.indexOf(":")+1)}return H(a,i)}function P(a,b,e){var c=B((e||this[0]).cloneNode(true),a,b);return function(g){return c({context:g})}}function Q(a,b){for(var e=typeof b==="function"&&b,c=0,g=
-this.length;c<g;c++)this[c]=N(this[c],(e||r.compile(b,false,this[c]))(a,false));context=null;return this}function R(a,b){for(var e=r.compile(b,a,this[0]),c=0,g=this.length;c<g;c++)this[c]=N(this[c],e(a,false));context=null;return this}function N(a,b){var e,c=a.parentNode,g=0;switch(a.tagName){case "TBODY":case "THEAD":case "TFOOT":b="<TABLE>"+b+"</TABLE>";g=1;break;case "TR":b="<TABLE><TBODY>"+b+"</TBODY></TABLE>";g=2;break;case "TD":case "TH":b="<TABLE><TBODY><TR>"+b+"</TR></TBODY></TABLE>";g=3}tmp=
-document.createElement("SPAN");tmp.style.display="none";document.body.appendChild(tmp);tmp.innerHTML=b;for(e=tmp.firstChild;g--;)e=e.firstChild;c.insertBefore(e,a);c.removeChild(a);document.body.removeChild(tmp);return a=e}var A=[];r=r||O();switch(typeof d){case "string":A=r.find(k||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<d;w++)r[w]=A[w];r.length=
-d;var K="_s"+Math.floor(Math.random()*1E6)+"_",J="_a"+Math.floor(Math.random()*1E6)+"_",I=/^(\+)?([^\@\+]+)?\@?([^\+]+)?(\+)?$/,W={IMG:"src",INPUT:"value"},F=Array.isArray?function(a){return Array.isArray(a)}:function(a){return Object.prototype.toString.call(a)==="[object Array]"};return r};$p.plugins={};
-$p.libs={dojo:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(d,k){return dojo.query(k,d)}},domassistant:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(d,k){return $(d).cssSelect(k)};DOMAssistant.attach({publicMethods:["compile","render","autoRender"],compile:function(d,k){return $p([this]).compile(d,k)},render:function(d,k){return $($p([this]).render(d,k))[0]},autoRender:function(d,k){return $($p([this]).autoRender(d,k))[0]}})},
-jquery:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(d,k){return jQuery(d).find(k)};jQuery.fn.extend({directives:function(d){this._pure_d=d;return this},compile:function(d,k){return $p(this).compile(this._pure_d||d,k)},render:function(d,k){return jQuery($p(this).render(d,this._pure_d||k))},autoRender:function(d,k){return jQuery($p(this).autoRender(d,this._pure_d||k))}})},mootools:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(d,
-k){return $(d).getElements(k)};Element.implement({compile:function(d,k){return $p(this).compile(d,k)},render:function(d,k){return $p([this]).render(d,k)},autoRender:function(d,k){return $p([this]).autoRender(d,k)}})},prototype:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(d,k){d=d===document?d.body:d;return typeof d==="string"?$$(d):$(d).select(k)};Element.addMethods({compile:function(d,k,r){return $p([d]).compile(k,r)},render:function(d,k,r){return $p([d]).render(k,
-r)},autoRender:function(d,k,r){return $p([d]).autoRender(k,r)}})},sizzle:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(d,k){return Sizzle(k,d)}},sly:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(d,k){return Sly(k,d)}}};
-(function(){var d=typeof dojo!=="undefined"&&"dojo"||typeof DOMAssistant!=="undefined"&&"domassistant"||typeof jQuery!=="undefined"&&"jquery"||typeof MooTools!=="undefined"&&"mootools"||typeof Prototype!=="undefined"&&"prototype"||typeof Sizzle!=="undefined"&&"sizzle"||typeof Sly!=="undefined"&&"sly";d&&$p.libs[d]();if(typeof exports!=="undefined")exports.$p=$p})();
+var $p,pure=$p=function(e,k){var o=e,t=false;if(typeof o==="string")t=k||false;else if(o&&!o[0]&&!o.length)o=[o];return $p.core(o,t)};
+$p.core=function(e,k,o){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 d=document.createElement("div");d.appendChild(b.cloneNode(true));return d.innerHTML}(a)}
+function C(a,b){return function(d){return a(""+b.call(this,d))}}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(d){for(var c=[a[0]],g=a.length,h,j,l,f,m=1;m<g;m++){h=b[m].call(this,d);j=a[m];if(h===""){l=c[c.length-
+1];if((f=l.search(/[^\s]+=\"?$/))>-1){c[c.length-1]=l.substring(0,f);j=j.substr(1)}}c[c.length]=h;c[c.length]=j}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(d){return d.context};return{name:b[1],sel:b[2]}}function y(a){if(typeof a==="function")return a;
+var b=a.match(/^[a-zA-Z\$_\@][\w\$:-]*(\.[\w\$:-]*[^\.])*$/);if(b===null){var d=false,c=a,g=[],h=[],j=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;){d=true;g[j++]=c.slice(0,b.index);h[j]=y(b[1]);c=c.slice(b.index+b[0].length,c.length)}if(!d)return function(){return a};g[j]=c;return H(g,h)}b=a.split(".");return function(f){var m=f.context||f,n=f[b[0]];f=0;if(n&&n.item){f+=
+1;if(b[f]==="pos")return n.pos;else m=n.item}for(n=b.length;f<n;f++){if(!m)break;m=m[b[f]]}return!m&&m!==0?"":m}}function D(a,b,d){var c,g,h,j,l,f=[];if(typeof b==="string"){c=b;(l=b.match(I))||t("bad selector syntax: "+b);g=l[1];h=l[2];j=l[3];l=l[4];if(h==="."||!h&&j)f[0]=a;else f=o.find(a,h);if(!f||f.length===0)return t('The node "'+b+'" was not found in the template:\n'+G(a).replace(/\t/g," "))}else{g=b.prepend;j=b.attr;l=b.append;f=[a]}if(g||l)if(g&&l)t("append/prepend cannot take place at the same time");
+else if(d)t("no append/prepend/replace modifiers allowed for loop target");else l&&d&&t("cannot append with loop (sel: "+c+")");var m,n,u,s,q;if(j){u=/^style$/i.test(j);q=(s=/^class$/i.test(j))?"className":j;m=function(i,r){i.setAttribute(J+j,r);if(q in i&&!u)i[q]="";if(i.nodeType===1){i.removeAttribute(j);s&&i.removeAttribute(q)}};n=u||s?u?function(i){return i.style.cssText}:function(i){return i.className}:function(i){return i.getAttribute(j)};a=function(i){return i.replace(/\"/g,"&quot;")};g=g?
+function(i,r){m(i,r+n(i))}:l?function(i,r){m(i,n(i)+r)}:function(i,r){m(i,r)}}else{g=d?function(i,r){var p=i.parentNode;if(p){p.insertBefore(document.createTextNode(r),i.nextSibling);p.removeChild(i)}}:g?function(i,r){i.insertBefore(document.createTextNode(r),i.firstChild)}:l?function(i,r){i.appendChild(document.createTextNode(r))}:function(i,r){for(;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(document.createTextNode(r))};a=function(i){return i}}return{attr:j,nodes:f,set:g,sel:c,quotefn:a}}
+function E(a,b){for(var d=K+b+":",c=0;c<a.nodes.length;c++)a.set(a.nodes[c],d)}function L(a,b,d,c,g){return function(h){var j=b(h),l=h[a],f={items:j},m=0,n,u=[],s=function(i,r,p,x){var z=h.pos,v=h.item,U=h.items;h.pos=r.pos=i;h.item=r.item=j[i];h.items=j;typeof x!=="undefined"&&(h.length=x);if(typeof p==="function"&&p.call(h.item,h)===false)m++;else{u.push(d.call(h.item,h));h.pos=z;h.item=v;h.items=U}};h[a]=f;if(F(j)){n=j.length||0;typeof c==="function"&&j.sort(c);for(var q=0;q<n;q++)s(q,f,g,n-m)}else{j&&
+typeof c!=="undefined"&&t("sort is only available on arrays, not objects");for(n in j)j.hasOwnProperty(n)&&s(n,f,g)}typeof l!=="undefined"?h[a]=l:delete h[a];return u.join("")}}function M(a,b,d,c){var g=false,h,j,l,f;for(f in d)if(d.hasOwnProperty(f))if(f==="sort")j=d.sort;else if(f==="filter")l=d.filter;else{g&&t("cannot have more than one loop on a target");h=f;g=true}h||t("Error in the selector: "+b+"\nA directive action must be a string, a function or a loop(<-)");g=d[h];if(typeof g==="string"||
+typeof g==="function"){d={};d[h]={root:g};return M(a,b,d,c)}d=T(h);h=y(d.sel);a=D(a,b,true);b=a.nodes;for(w=0;w<b.length;w++){f=b[w];var m=B(f,g);c[c.length]=C(a.quotefn,L(d.name,h,m,j,l));a.nodes=[f];E(a,c.length-1)}return a}function V(a,b){function d(i,r){var p=i.match(I);p={prepend:!!p[1],prop:p[2],attr:p[3]||W[r],append:!!p[4],sel:i};var x,z,v;for(x=h.a.length-1;x>=0;x--){z=h.a[x];v=(v=z.l[0])&&v[p.prop];if(typeof v!=="undefined"){p.prop=z.p+"."+p.prop;if(h.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)){h.a.push({l:v,p:p.prop});h.l[p.prop]=true;p.t="loop"}else p.t="str";return p}var c=a.getElementsByTagName("*"),g=[],h={a:[],l:{}},j,l,f,m,n,u,s,q;f=-1;for(m=c.length;f<m;f++){s=f>-1?c[f]:a;if(s.nodeType===1&&s.className!==""){q=s.className.split(" ");n=0;for(u=q.length;n<u;n++){j=q[n];j=d(j,s.tagName);if(j!==false){l=/nodevalue/i.test(j.attr);if(j.sel.indexOf("@")>-1||l){s.className=s.className.replace("@"+j.attr,"");if(l)j.attr=
+false}g.push({n:s,cspec:j})}}}}return g}function B(a,b,d,c){var g=[],h,j,l,f,m,n,u,s,q,i=[];c=c||d&&V(a,d);if(d)for(;c.length>0;){l=c[0].cspec;f=c[0].n;c.splice(0,1);if(l.t==="str"){f=D(f,l,false);E(f,g.length);g[g.length]=C(f.quotefn,y(l.prop))}else{n=y(l.sel);f=D(f,l,true);m=f.nodes;h=0;for(j=m.length;h<j;h++){u=m[h];s=B(u,false,d,c);g[g.length]=C(f.quotefn,L(l.sel,n,s));f.nodes=[u];E(f,g.length-1)}}}for(q in b)if(b.hasOwnProperty(q)){d=0;c=b[q];l=q.split(/\s*,\s*/);n=l.length;do if(typeof c===
+"function"||typeof c==="string"){q=l[d];f=D(a,q,false);E(f,g.length);g[g.length]=C(f.quotefn,y(c))}else M(a,q,c,g);while(++d<n)}a=G(a);a=a.replace(/<([^>]+)\s(value\=""|selected)\s?([^>]*)>/ig,"<$1 $3>");a=a.split(J).join("");a=a.split(K);for(d=1;d<a.length;d++){b=a[d];i[d]=g[parseInt(b,10)];a[d]=b.substring(b.indexOf(":")+1)}return H(a,i)}function P(a,b,d){var c=B((d||this[0]).cloneNode(true),a,b);return function(g){return c({context:g})}}function Q(a,b){for(var d=typeof b==="function"&&b,c=0,g=
+this.length;c<g;c++)this[c]=N(this[c],(d||o.compile(b,false,this[c]))(a,false));context=null;return this}function R(a,b){for(var d=o.compile(b,a,this[0]),c=0,g=this.length;c<g;c++)this[c]=N(this[c],d(a,false));context=null;return this}function N(a,b){var d,c=a.parentNode,g=0;switch(a.tagName){case "TBODY":case "THEAD":case "TFOOT":b="<TABLE>"+b+"</TABLE>";g=1;break;case "TR":b="<TABLE><TBODY>"+b+"</TBODY></TABLE>";g=2;break;case "TD":case "TH":b="<TABLE><TBODY><TR>"+b+"</TR></TBODY></TABLE>";g=3;
+break}tmp=document.createElement("SPAN");tmp.style.display="none";document.body.appendChild(tmp);tmp.innerHTML=b;for(d=tmp.firstChild;g--;)d=d.firstChild;c.insertBefore(d,a);c.removeChild(a);document.body.removeChild(tmp);return a=d}var A=[];o=o||O();switch(typeof e){case "string":A=o.find(k||document,e);A.length===0&&t('The template "'+e+'" was not found');break;case "undefined":t("The root of the template is undefined, check your selector");break;default:A=e}var w=0;for(e=A.length;w<e;w++)o[w]=
+A[w];o.length=e;var K="_s"+Math.floor(Math.random()*1E6)+"_",J="_a"+Math.floor(Math.random()*1E6)+"_",I=/^(\+)?([^\@\+]+)?\@?([^\+]+)?(\+)?$/,W={IMG:"src",INPUT:"value"},F=Array.isArray?function(a){return Array.isArray(a)}:function(a){return Object.prototype.toString.call(a)==="[object Array]"};return o};$p.plugins={};
+$p.libs={dojo:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(e,k){return dojo.query(k,e)}},domassistant:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(e,k){return $(e).cssSelect(k)};DOMAssistant.attach({publicMethods:["compile","render","autoRender"],compile:function(e,k){return $p([this]).compile(e,k)},render:function(e,k){return $($p([this]).render(e,k))[0]},autoRender:function(e,k){return $($p([this]).autoRender(e,k))[0]}})},
+jquery:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(e,k){return jQuery(e).find(k)};jQuery.fn.extend({directives:function(e){this._pure_d=e;return this},compile:function(e,k){return $p(this).compile(this._pure_d||e,k)},render:function(e,k){return jQuery($p(this).render(e,this._pure_d||k))},autoRender:function(e,k){return jQuery($p(this).autoRender(e,this._pure_d||k))}})},mootools:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(e,
+k){return $(e).getElements(k)};Element.implement({compile:function(e,k){return $p(this).compile(e,k)},render:function(e,k){return $p([this]).render(e,k)},autoRender:function(e,k){return $p([this]).autoRender(e,k)}})},prototype:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(e,k){e=e===document?e.body:e;return typeof e==="string"?$$(e):$(e).select(k)};Element.addMethods({compile:function(e,k,o){return $p([e]).compile(k,o)},render:function(e,k,o){return $p([e]).render(k,
+o)},autoRender:function(e,k,o){return $p([e]).autoRender(k,o)}})},sizzle:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(e,k){return Sizzle(k,e)}},sly:function(){if(typeof document.querySelector==="undefined")$p.plugins.find=function(e,k){return Sly(k,e)}}};
+(function(){var e=typeof dojo!=="undefined"&&"dojo"||typeof DOMAssistant!=="undefined"&&"domassistant"||typeof jQuery!=="undefined"&&"jquery"||typeof MooTools!=="undefined"&&"mootools"||typeof Prototype!=="undefined"&&"prototype"||typeof Sizzle!=="undefined"&&"sizzle"||typeof Sly!=="undefined"&&"sly";e&&$p.libs[e]();if(typeof exports!=="undefined")exports.$p=$p})();

0 comments on commit 6cfd32c

Please sign in to comment.
Something went wrong with that request. Please try again.