diff --git a/underscore-min.js b/underscore-min.js index da7d4a39c..2fcd2eb12 100644 --- a/underscore-min.js +++ b/underscore-min.js @@ -1,14 +1,2 @@ -(function(){var j=this,m=j._,i=function(a){this._wrapped=a},l=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;b.VERSION="0.4.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(a.length)for(var e=0,f=a.length;e=e.computed&&(e={value:f,computed:g})}); -return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;gf?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.zip=function(){for(var a=b.toArray(arguments),c= -b.max(b.pluck(a,"length")),d=new Array(c),e=0;e=0;c--)arguments=[a[c].apply(this,arguments)];return arguments[0]}};b.keys=function(a){return b.map(a, -function(c,d){return d})};b.values=function(a){return b.map(a,b.identity)};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a,e=typeof c;if(d!=e)return false;if(a==c)return true;if(a.isEqual)return a.isEqual(c);if(b.isNumber(a)&&b.isNumber(c)&&isNaN(a)&&isNaN(c))return true;if(d!=="object")return false;d=b.keys(a);e=b.keys(c);if(d.length!=e.length)return false; -for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return(b.isArray(a)?a:b.values(a)).length==0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return Object.prototype.toString.call(a)=="[object Array]"};b.isFunction=function(a){return Object.prototype.toString.call(a)=="[object Function]"};b.isString=function(a){return Object.prototype.toString.call(a)=="[object String]"};b.isNumber=function(a){return Object.prototype.toString.call(a)== -"[object Number]"};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=m;return this};b.identity=function(a){return a};b.breakLoop=function(){throw l;};var n=0;b.uniqueId=function(a){var c=n++;return a?a+c:c};b.functions=function(){var a=[];for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&a.push(c);return b.without(a,"VERSION","prototype","noConflict").sort()};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+ -a.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var k=function(a,c){return c?b(a).chain():a};b.each(b.functions(),function(a){i.prototype[a]=function(){Array.prototype.unshift.call(arguments, -this._wrapped);return k(b[a].apply(b,arguments),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){i.prototype[a]=function(){Array.prototype[a].apply(this._wrapped,arguments);return k(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){i.prototype[a]=function(){return k(Array.prototype[a].apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})(); +(function(){var j=this;var k=j._;var m=function(a){this._wrapped=a};var o=typeof StopIteration!=='undefined'?StopIteration:'__break__';var _=j._=function(a){return new m(a)};if(typeof exports!=='undefined')exports._=_;_.VERSION='0.4.5';_.range=function(a,b,c){if(!b){var b=a;a=0}if(!c)var c=1;var d=Math.ceil((b-a)/c);if(d<0){return[]}var e=new Array(d);var f=0;for(var i=a;(a<=b?b-i>0:i-b>0);i+=c){e[f++]=i}return e};_.each=function(a,b,c){var d=0;try{if(a.forEach){a.forEach(b,c)}else if(a.length){for(var i=0,l=a.length;i=h.computed&&(h={value:a,computed:d})});return h.value};_.min=function(e,f,g){if(!f&&_.isArray(e))return Math.min.apply(Math,e);var h={computed:Infinity};_.each(e,function(a,b,c){var d=f?f.call(g,a,b,c):a;db?1:0}),'value')};_.sortedIndex=function(a,b,c){c=c||_.identity;var d=0,high=a.length;while(d>1;c(a[e])=0})})};_.zip=function(){var a=_.toArray(arguments);var b=_.max(_.pluck(a,'length'));var c=new Array(b);for(var i=0;i=0;i--){arguments=[a[i].apply(this,arguments)]}return arguments[0]}};_.keys=function(c){return _.map(c,function(a,b){return b})};_.values=function(a){return _.map(a,_.identity)};_.extend=function(a,b){for(var c in b)a[c]=b[c];return a};_.clone=function(a){if(_.isArray(a))return a.slice(0);return _.extend({},a)};_.isEqual=function(a,b){if(a===b)return true;var c=typeof(a),btype=typeof(b);if(c!=btype)return false;if(a==b)return true;if(a.isEqual)return a.isEqual(b);if(_.isNumber(a)&&_.isNumber(b)&&isNaN(a)&&isNaN(b))return true;if(c!=='object')return false;var d=_.keys(a),bKeys=_.keys(b);if(d.length!=bKeys.length)return false;for(var e in a)if(!_.isEqual(a[e],b[e]))return false;return true};_.isEmpty=function(a){return(_.isArray(a)?a:_.values(a)).length==0};_.isElement=function(a){return!!(a&&a.nodeType==1)};_.isArray=function(a){return Object.prototype.toString.call(a)=='[object Array]'};_.isFunction=function(a){return Object.prototype.toString.call(a)=='[object Function]'};_.isString=function(a){return Object.prototype.toString.call(a)=='[object String]'};_.isNumber=function(a){return Object.prototype.toString.call(a)=='[object Number]'};_.isUndefined=function(a){return typeof a=='undefined'};_.noConflict=function(){j._=k;return this};_.identity=function(a){return a};_.breakLoop=function(){throw o;};var p=0;_.uniqueId=function(a){var b=p++;return a?a+b:b};_.functions=function(){var a=[];for(var b in _)if(Object.prototype.hasOwnProperty.call(_,b))a.push(b);return _.without(a,'VERSION','prototype','noConflict').sort()};_.template=function(a,b){var c=new Function('obj','var p=[],print=function(){p.push.apply(p,arguments);};'+'with(obj){p.push(\''+a.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return b?c(b):c};_.forEach=_.each;_.foldl=_.inject=_.reduce;_.foldr=_.reduceRight;_.filter=_.select;_.every=_.all;_.some=_.any;_.head=_.first;_.tail=_.rest;_.methods=_.functions;var q=function(a,b){return b?_(a).chain():a};_.each(_.functions(),function(a){m.prototype[a]=function(){Array.prototype.unshift.call(arguments,this._wrapped);return q(_[a].apply(_,arguments),this._chain)}});_.each(['pop','push','reverse','shift','sort','splice','unshift'],function(a){m.prototype[a]=function(){Array.prototype[a].apply(this._wrapped,arguments);return q(this._wrapped,this._chain)}});_.each(['concat','join','slice'],function(a){m.prototype[a]=function(){return q(Array.prototype[a].apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=true;return this};m.prototype.value=function(){return this._wrapped}})(); +