diff --git a/Rakefile b/Rakefile index 93fc1a9..f546b74 100644 --- a/Rakefile +++ b/Rakefile @@ -56,7 +56,7 @@ templated_build "qooxdoo" task :minify do # npm install uglify-js mmjs = "mustache.min.js" - `echo "/*! Version: 0.4.2-dev */" > #{mmjs}` + `echo "/*! Version: 0.4.2 */" > #{mmjs}` `uglifyjs mustache.js >> #{mmjs}` puts "Created #{mmjs}" end diff --git a/mustache.js b/mustache.js index 8944620..4ac3fae 100644 --- a/mustache.js +++ b/mustache.js @@ -417,7 +417,7 @@ var Mustache = function () { return({ name: "mustache.js", - version: "0.4.2-dev", + version: "0.4.2", /* Turns a template and view into HTML diff --git a/mustache.js.nuspec b/mustache.js.nuspec index a6b5a1a..5ca1bb5 100644 --- a/mustache.js.nuspec +++ b/mustache.js.nuspec @@ -2,7 +2,7 @@ mustache.js - 0.4.2-dev + 0.4.2 mustache.js Authors https://github.com/janl/mustache.js/blob/master/LICENSE http://mustache.github.com/ diff --git a/mustache.min.js b/mustache.min.js new file mode 100644 index 0000000..8014bcf --- /dev/null +++ b/mustache.min.js @@ -0,0 +1,6 @@ +/*! Version: 0.4.2 */ +/* + mustache.js — Logic-less templates in JavaScript + + See http://mustache.github.com/ for more info. +*/var Mustache=function(){function g(a){return String(a).replace(/&(?!#?\w+;)|[<>"']/g,function(a){return f[a]||a})}var a=Object.prototype.toString;Array.isArray=Array.isArray||function(b){return a.call(b)=="[object Array]"};var b=String.prototype.trim,c;if(b)c=function(a){return a==null?"":b.call(a)};else{var d,e;/\S/.test(" ")?(d=/^[\s\xA0]+/,e=/[\s\xA0]+$/):(d=/^\s+/,e=/\s+$/),c=function(a){return a==null?"":a.toString().replace(d,"").replace(e,"")}}var f={"&":"&","<":"<",">":">",'"':""","'":"'"},h={},i=function(){};return i.prototype={otag:"{{",ctag:"}}",pragmas:{},buffer:[],pragmas_implemented:{"IMPLICIT-ITERATOR":!0},context:{},render:function(a,b,c,d){d||(this.context=b,this.buffer=[]);if(!this.includes("",a)){if(d)return a;this.send(a);return}a=this.render_pragmas(a);var e=this.render_section(a,b,c);e===!1&&(e=this.render_tags(a,b,c,d));if(d)return e;this.sendLines(e)},send:function(a){a!==""&&this.buffer.push(a)},sendLines:function(a){if(a){var b=a.split("\n");for(var c=0;c|&|\\{|%)?([^#\\^]+?)\\1?"+b+"+","g")})},h=f(),i=function(a,d,i){switch(d){case"!":return"";case"=":return e.set_delimiters(i),h=f(),"";case">":return e.render_partial(i,b,c);case"{":case"&":return e.find(i,b);default:return g(e.find(i,b))}},j=a.split("\n");for(var k=0;k0)d=e,e=e[c.shift()];return typeof e=="function"?e.apply(d):e},includes:function(a,b){return b.indexOf(this.otag+a)!=-1},create_context:function(a){if(this.is_object(a))return a;var b=".";this.pragmas["IMPLICIT-ITERATOR"]&&(b=this.pragmas["IMPLICIT-ITERATOR"].iterator);var c={};return c[b]=a,c},is_object:function(a){return a&&typeof a=="object"},map:function(a,b){if(typeof a.map=="function")return a.map(b);var c=[],d=a.length;for(var e=0;e