mustachejs-rails 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mustachejs/rails/version.rb +1 -1
- data/vendor/assets/javascripts/mustache.js +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02f645acd9966c5432eba7efb6e0ac2415e29be0
|
4
|
+
data.tar.gz: 78901aa49bb587a8a0e8a3e01e5efb65d31bd919
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7e580edf9cfa4f8b617c32044a1b4e6deca73a59e47256ea4271fbc0b72743352498c4c5dc86723172b52fdd83d056709a4aa3023b48bfc9f5c777dfadb2534
|
7
|
+
data.tar.gz: 7d3a048851d255a4f0295feecfe12029db5413778b963fc0e1a49a7b2d1cf9c35a7250712075172f85a8425178944d1fa6d34dde23f0452bb46e40d40ae30daa
|
@@ -2,4 +2,4 @@
|
|
2
2
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
3
3
|
* http://github.com/janl/mustache.js
|
4
4
|
*/
|
5
|
-
(function(a,b){if(typeof exports==="object"&&exports){b(exports)}else{var c={};b(c);if(typeof define==="function"&&define.amd){define(c)}else{a.Mustache=c}}}(this,function(a){var f=/\s*/;var m=/\s+/;var k=/\S/;var i=/\s*=/;var o=/\s*\}/;var t=/#|\^|\/|>|\{|&|=|!/;var g=RegExp.prototype.test;function s(z,y){return g.call(z,y)}function h(y){return !s(k,y)}var v=Object.prototype.toString;var l=Array.isArray||function(y){return v.call(y)==="[object Array]"};function b(y){return typeof y==="function"}function e(y){return y.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function n(y){return String(y).replace(/[&<>"'\/]/g,function(z){return d[z]})}function r(y){if(!l(y)||y.length!==2){throw new Error("Invalid tags: "+y)}return[new RegExp(e(y[0])+"\\s*"),new RegExp("\\s*"+e(y[1]))]}function x(O,E){E=E||a.tags;O=O||"";if(typeof E==="string"){E=E.split(m)}var I=r(E);var A=new u(O);var G=[];var F=[];var D=[];var P=false;var N=false;function M(){if(P&&!N){while(D.length){delete F[D.pop()]}}else{D=[]}P=false;N=false}var B,z,H,J,C,y;while(!A.eos()){B=A.pos;H=A.scanUntil(I[0]);if(H){for(var K=0,L=H.length;K<L;++K){J=H.charAt(K);if(h(J)){D.push(F.length)}else{N=true}F.push(["text",J,B,B+1]);B+=1;if(J==="\n"){M()}}}if(!A.scan(I[0])){break}P=true;z=A.scan(t)||"name";A.scan(f);if(z==="="){H=A.scanUntil(i);A.scan(i);A.scanUntil(I[1])}else{if(z==="{"){H=A.scanUntil(new RegExp("\\s*"+e("}"+E[1])));A.scan(o);A.scanUntil(I[1]);z="&"}else{H=A.scanUntil(I[1])}}if(!A.scan(I[1])){throw new Error("Unclosed tag at "+A.pos)}C=[z,H,B,A.pos];F.push(C);if(z==="#"||z==="^"){G.push(C)}else{if(z==="/"){y=G.pop();if(!y){throw new Error('Unopened section "'+H+'" at '+B)}if(y[1]!==H){throw new Error('Unclosed section "'+y[1]+'" at '+B)}}else{if(z==="name"||z==="{"||z==="&"){N=true}else{if(z==="="){I=r(E=H.split(m))}}}}}y=G.pop();if(y){throw new Error('Unclosed section "'+y[1]+'" at '+A.pos)}return w(c(F))}function c(D){var A=[];var C,z;for(var B=0,y=D.length;B<y;++B){C=D[B];if(C){if(C[0]==="text"&&z&&z[0]==="text"){z[1]+=C[1];z[3]=C[3]}else{A.push(C);z=C}}}return A}function w(D){var F=[];var C=F;var E=[];var A,B;for(var z=0,y=D.length;z<y;++z){A=D[z];switch(A[0]){case"#":case"^":C.push(A);E.push(A);C=A[4]=[];break;case"/":B=E.pop();B[5]=A[2];C=E.length>0?E[E.length-1][4]:F;break;default:C.push(A)}}return F}function u(y){this.string=y;this.tail=y;this.pos=0}u.prototype.eos=function(){return this.tail===""};u.prototype.scan=function(A){var z=this.tail.match(A);if(z&&z.index===0){var y=z[0];this.tail=this.tail.substring(y.length);this.pos+=y.length;return y}return""};u.prototype.scanUntil=function(A){var z=this.tail.search(A),y;switch(z){case -1:y=this.tail;this.tail="";break;case 0:y="";break;default:y=this.tail.substring(0,z);this.tail=this.tail.substring(z)}this.pos+=y.length;return y};function q(z,y){this.view=z==null?{}:z;this.cache={".":this.view};this.parent=y}q.prototype.push=function(y){return new q(y,this)};q.prototype.lookup=function(y){var B;if(y in this.cache){B=this.cache[y]}else{var A=this;while(A){if(y.indexOf(".")>0){B=A.view;var C=y.split("."),z=0;while(B!=null&&z<C.length){B=B[C[z++]]}}else{B=A.view[y]}if(B!=null){break}A=A.parent}this.cache[y]=B}if(b(B)){B=B.call(this.view)}return B};function p(){this.cache={}}p.prototype.clearCache=function(){this.cache={}};p.prototype.parse=function(z
|
5
|
+
(function(a,b){if(typeof exports==="object"&&exports){b(exports)}else{var c={};b(c);if(typeof define==="function"&&define.amd){define(c)}else{a.Mustache=c}}}(this,function(a){var f=/\s*/;var m=/\s+/;var k=/\S/;var i=/\s*=/;var o=/\s*\}/;var t=/#|\^|\/|>|\{|&|=|!/;var g=RegExp.prototype.test;function s(z,y){return g.call(z,y)}function h(y){return !s(k,y)}var v=Object.prototype.toString;var l=Array.isArray||function(y){return v.call(y)==="[object Array]"};function b(y){return typeof y==="function"}function e(y){return y.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function n(y){return String(y).replace(/[&<>"'\/]/g,function(z){return d[z]})}function r(y){if(!l(y)||y.length!==2){throw new Error("Invalid tags: "+y)}return[new RegExp(e(y[0])+"\\s*"),new RegExp("\\s*"+e(y[1]))]}function x(O,E){E=E||a.tags;O=O||"";if(typeof E==="string"){E=E.split(m)}var I=r(E);var A=new u(O);var G=[];var F=[];var D=[];var P=false;var N=false;function M(){if(P&&!N){while(D.length){delete F[D.pop()]}}else{D=[]}P=false;N=false}var B,z,H,J,C,y;while(!A.eos()){B=A.pos;H=A.scanUntil(I[0]);if(H){for(var K=0,L=H.length;K<L;++K){J=H.charAt(K);if(h(J)){D.push(F.length)}else{N=true}F.push(["text",J,B,B+1]);B+=1;if(J==="\n"){M()}}}if(!A.scan(I[0])){break}P=true;z=A.scan(t)||"name";A.scan(f);if(z==="="){H=A.scanUntil(i);A.scan(i);A.scanUntil(I[1])}else{if(z==="{"){H=A.scanUntil(new RegExp("\\s*"+e("}"+E[1])));A.scan(o);A.scanUntil(I[1]);z="&"}else{H=A.scanUntil(I[1])}}if(!A.scan(I[1])){throw new Error("Unclosed tag at "+A.pos)}C=[z,H,B,A.pos];F.push(C);if(z==="#"||z==="^"){G.push(C)}else{if(z==="/"){y=G.pop();if(!y){throw new Error('Unopened section "'+H+'" at '+B)}if(y[1]!==H){throw new Error('Unclosed section "'+y[1]+'" at '+B)}}else{if(z==="name"||z==="{"||z==="&"){N=true}else{if(z==="="){I=r(E=H.split(m))}}}}}y=G.pop();if(y){throw new Error('Unclosed section "'+y[1]+'" at '+A.pos)}return w(c(F))}function c(D){var A=[];var C,z;for(var B=0,y=D.length;B<y;++B){C=D[B];if(C){if(C[0]==="text"&&z&&z[0]==="text"){z[1]+=C[1];z[3]=C[3]}else{A.push(C);z=C}}}return A}function w(D){var F=[];var C=F;var E=[];var A,B;for(var z=0,y=D.length;z<y;++z){A=D[z];switch(A[0]){case"#":case"^":C.push(A);E.push(A);C=A[4]=[];break;case"/":B=E.pop();B[5]=A[2];C=E.length>0?E[E.length-1][4]:F;break;default:C.push(A)}}return F}function u(y){this.string=y;this.tail=y;this.pos=0}u.prototype.eos=function(){return this.tail===""};u.prototype.scan=function(A){var z=this.tail.match(A);if(z&&z.index===0){var y=z[0];this.tail=this.tail.substring(y.length);this.pos+=y.length;return y}return""};u.prototype.scanUntil=function(A){var z=this.tail.search(A),y;switch(z){case -1:y=this.tail;this.tail="";break;case 0:y="";break;default:y=this.tail.substring(0,z);this.tail=this.tail.substring(z)}this.pos+=y.length;return y};function q(z,y){this.view=z==null?{}:z;this.cache={".":this.view};this.parent=y}q.prototype.push=function(y){return new q(y,this)};q.prototype.lookup=function(y){var B;if(y in this.cache){B=this.cache[y]}else{var A=this;while(A){if(y.indexOf(".")>0){B=A.view;var C=y.split("."),z=0;while(B!=null&&z<C.length){B=B[C[z++]]}}else{B=A.view[y]}if(B!=null){break}A=A.parent}this.cache[y]=B}if(b(B)){B=B.call(this.view)}return B};function p(){this.cache={}}p.prototype.clearCache=function(){this.cache={}};p.prototype.parse=function(A,z){var y=this.cache;var B=y[A];if(B==null){B=y[A]=x(A,z)}return B};p.prototype.render=function(B,y,A){var C=this.parse(B);var z=(y instanceof q)?y:new q(y);return this.renderTokens(C,z,A,B)};p.prototype.renderTokens=function(G,y,E,I){var C="";var K=this;function z(L){return K.render(L,y,E)}var A,H;for(var D=0,F=G.length;D<F;++D){A=G[D];switch(A[0]){case"#":H=y.lookup(A[1]);if(!H){continue}if(l(H)){for(var B=0,J=H.length;B<J;++B){C+=this.renderTokens(A[4],y.push(H[B]),E,I)}}else{if(typeof H==="object"||typeof H==="string"){C+=this.renderTokens(A[4],y.push(H),E,I)}else{if(b(H)){if(typeof I!=="string"){throw new Error("Cannot use higher-order sections without the original template")}H=H.call(y.view,I.slice(A[3],A[5]),z);if(H!=null){C+=H}}else{C+=this.renderTokens(A[4],y,E,I)}}}break;case"^":H=y.lookup(A[1]);if(!H||(l(H)&&H.length===0)){C+=this.renderTokens(A[4],y,E,I)}break;case">":if(!E){continue}H=b(E)?E(A[1]):E[A[1]];if(H!=null){C+=this.renderTokens(this.parse(H),y,E,H)}break;case"&":H=y.lookup(A[1]);if(H!=null){C+=H}break;case"name":H=y.lookup(A[1]);if(H!=null){C+=a.escape(H)}break;case"text":C+=A[1];break}}return C};a.name="mustache.js";a.version="0.8.1";a.tags=["{{","}}"];var j=new p();a.clearCache=function(){return j.clearCache()};a.parse=function(z,y){return j.parse(z,y)};a.render=function(A,y,z){return j.render(A,y,z)};a.to_html=function(B,z,A,C){var y=a.render(B,z,A);if(b(C)){C(y)}else{return y}};a.escape=n;a.Scanner=u;a.Context=q;a.Writer=p}));
|