All Downloads are FREE. Search and download functionalities are using the official Maven repository.

default.assets.wondergem.mustache.mustache.min.js Maven / Gradle / Ivy

/*!
 * mustache.js - Logic-less {{mustache}} templates with JavaScript
 * http://github.com/janl/mustache.js
 */
(function(a,b){if(typeof exports==="object"&&exports){module.exports=b}else{if(typeof define==="function"&&define.amd){define(b)}else{a.Mustache=b}}}(this,(function(){var t={};t.name="mustache.js";t.version="0.7.2";t.tags=["{{","}}"];t.Scanner=s;t.Context=q;t.Writer=n;var d=/\s*/;var j=/\s+/;var h=/\S/;var g=/\s*=/;var l=/\s*\}/;var r=/#|\^|\/|>|\{|&|=|!/;function m(w,v){return RegExp.prototype.test.call(w,v)}function f(v){return !m(h,v)}var i=Array.isArray||function(v){return Object.prototype.toString.call(v)==="[object Array]"};function e(v){return v.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function k(v){return String(v).replace(/[&<>"'\/]/g,function(w){return c[w]})}t.escape=k;function s(v){this.string=v;this.tail=v;this.pos=0}s.prototype.eos=function(){return this.tail===""};s.prototype.scan=function(w){var v=this.tail.match(w);if(v&&v.index===0){this.tail=this.tail.substring(v[0].length);this.pos+=v[0].length;return v[0]}return""};s.prototype.scanUntil=function(w){var v,x=this.tail.search(w);switch(x){case -1:v=this.tail;this.pos+=this.tail.length;this.tail="";break;case 0:v="";break;default:v=this.tail.substring(0,x);this.tail=this.tail.substring(x);this.pos+=x}return v};function q(v,w){this.view=v;this.parent=w;this._cache={}}q.make=function(v){return(v instanceof q)?v:new q(v)};q.prototype.push=function(v){return new q(v,this)};q.prototype.lookup=function(v){var y=this._cache[v];if(!y){if(v=="."){y=this.view}else{var x=this;while(x){if(v.indexOf(".")>0){y=x.view;var z=v.split("."),w=0;while(y&&w":E=w.getPartial(D);if(typeof E==="function"){z+=E(v)}break;case"&":E=v.lookup(D);if(E!=null){z+=E}break;case"name":E=v.lookup(D);if(E!=null){z+=t.escape(E)}break;case"text":z+=D;break}}return z}function u(B){var w=[];var A=w;var C=[];var y;for(var x=0,v=B.length;x0?C[C.length-1][4]:w;break;default:A.push(y)}}return w}function a(A){var x=[];var z,w;for(var y=0,v=A.length;y




© 2015 - 2025 Weber Informatics LLC | Privacy Policy