sugar-rails 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- data/copy_release.sh +28 -0
- data/lib/sugar/rails/version.rb +2 -2
- data/vendor/assets/javascripts/precompiled/development/array.js +6 -4
- data/vendor/assets/javascripts/precompiled/development/date.js +45 -31
- data/vendor/assets/javascripts/precompiled/development/date_locales.js +274 -47
- data/vendor/assets/javascripts/precompiled/development/number.js +2 -2
- data/vendor/assets/javascripts/precompiled/development/object.js +2 -2
- data/vendor/assets/javascripts/precompiled/minified/array.js +15 -15
- data/vendor/assets/javascripts/precompiled/minified/core.js +9 -9
- data/vendor/assets/javascripts/precompiled/minified/date.js +40 -40
- data/vendor/assets/javascripts/precompiled/minified/date_locales.js +33 -22
- data/vendor/assets/javascripts/precompiled/minified/date_ranges.js +2 -2
- data/vendor/assets/javascripts/precompiled/minified/es5.js +8 -8
- data/vendor/assets/javascripts/precompiled/minified/function.js +4 -4
- data/vendor/assets/javascripts/precompiled/minified/inflections.js +5 -5
- data/vendor/assets/javascripts/precompiled/minified/language.js +5 -5
- data/vendor/assets/javascripts/precompiled/minified/number.js +5 -5
- data/vendor/assets/javascripts/precompiled/minified/object.js +5 -5
- data/vendor/assets/javascripts/precompiled/minified/regexp.js +2 -2
- data/vendor/assets/javascripts/precompiled/minified/string.js +11 -11
- data/vendor/assets/javascripts/sugar-development.js +330 -87
- data/vendor/assets/javascripts/sugar-full.js +145 -134
- data/vendor/assets/javascripts/sugar.js +102 -102
- metadata +5 -4
@@ -1,6 +1,6 @@
|
|
1
1
|
var Bb="isObject,isNaN".split(","),Cb="keys,values,each,merge,clone,equal,watch,tap,has".split(",");
|
2
|
-
function Db(a,b,c,d){var e=/^(.+?)(\[.*\])$/,f,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
a);return a},has:function(a,b){return
|
2
|
+
function Db(a,b,c,d){var e=/^(.+?)(\[.*\])$/,g,f,i;if(d!==n&&(f=b.match(e))){i=f[1];b=f[2].replace(/^\[|\]$/g,"").split("][");b.forEach(function(j){g=!j||j.match(/^\d+$/);if(!i&&da(a))i=a.length;a[i]||(a[i]=g?[]:{});a=a[i];i=j});if(!i&&g)i=a.length.toString();Db(a,i,c)}else a[b]=c.match(/^[\d.]+$/)?parseFloat(c):c==="true"?k:c==="false"?n:c}E(p,n,k,{watch:function(a,b,c){if(ca){var d=a[b];p.defineProperty(a,b,{enumerable:k,configurable:k,get:function(){return d},set:function(e){d=c.call(a,b,d,e)}})}}});
|
3
|
+
E(p,n,function(a,b){return z(b)},{keys:function(a,b){var c=p.keys(a);c.forEach(function(d){b.call(a,d,a[d])});return c}});
|
4
|
+
E(p,n,n,{isObject:function(a){return L(a)},isNaN:function(a){return A(a)&&a.valueOf()!==a.valueOf()},equal:function(a,b){return ua(a)&&ua(b)?ta(a)===ta(b):a===b},extended:function(a){return new na(a)},merge:function(a,b,c,d){var e,g;if(a&&typeof b!="string")for(e in b)if(la(b,e)&&a){g=b[e];if(I(a[e])){if(d===n)continue;if(z(d))g=d.call(b,e,a[e],b[e])}if(c===k&&g&&ka(g))if(ga(g))g=new s(g.getTime());else if(D(g))g=new r(g.source,sa(g));else{a[e]||(a[e]=q.isArray(g)?[]:{});p.merge(a[e],b[e],c,d);continue}a[e]=
|
5
|
+
g}return a},values:function(a,b){var c=[];G(a,function(d,e){c.push(e);b&&b.call(a,e)});return c},clone:function(a,b){if(!ka(a))return a;if(q.isArray(a))return a.concat();var c=a instanceof na?new na:{};return p.merge(c,a,b)},fromQueryString:function(a,b){var c=p.extended();a=a&&a.toString?a.toString():"";a.replace(/^.*?\?/,"").split("&").forEach(function(d){d=d.split("=");d.length===2&&Db(c,d[0],decodeURIComponent(d[1]),b)});return c},tap:function(a,b){var c=b;z(b)||(c=function(){b&&a[b]()});c.call(a,
|
6
|
+
a);return a},has:function(a,b){return la(a,b)}});H(p,n,n,x,function(a,b){var c="is"+b;Bb.push(c);a[c]=function(d){return p.prototype.toString.call(d)==="[object "+b+"]"}});(function(){E(p,n,function(){return arguments.length===0},{extend:function(){wa(Bb.concat(Cb),p)}})})();wa(Cb,na);
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
E(r,n,n,{escape:function(a){return Q(a)}});
|
2
|
+
E(r,k,n,{getFlags:function(){return sa(this)},setFlags:function(a){return r(this.source,a)},addFlag:function(a){return this.setFlags(sa(this,a))},removeFlag:function(a){return this.setFlags(sa(this).replace(a,""))}});
|
@@ -1,12 +1,12 @@
|
|
1
1
|
var Eb,Fb;
|
2
|
-
|
3
|
-
d;if(
|
4
|
-
a)},lines:function(a){return this.trim().each(/^.*$/gm,a)},paragraphs:function(a){var b=this.trim().split(/[\r\n]{2,}/);return b=b.map(function(c){if(a)var d=a.call(c);return d?d:c})},startsWith:function(a,b){if(K(b))b=k;var c=
|
5
|
-
a:
|
6
|
-
"-")},underscore:function(){return this.replace(/[-\s]+/g,"_").replace(t.Inflector&&t.Inflector.acronymRegExp,function(a,b){return(b>0?"_":"")+a.toLowerCase()}).replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()},camelize:function(a){return this.underscore().replace(/(^|_)([^_]+)/g,function(b,c,d,e){b=d;b=(c=t.Inflector)&&c.acronyms[b];b=
|
7
|
-
" ")},stripTags:function(){var a=this;
|
8
|
-
h=
|
9
|
-
|
10
|
-
|
11
|
-
(function(a){if(this.btoa){Eb=this.btoa;Fb=this.atob}else{var b=/[^A-Za-z0-9\+\/\=]/g;Eb=function(c){var d="",e,f,
|
12
|
-
do{e=a.indexOf(c.charAt(h++));
|
2
|
+
E(t,k,n,{escapeRegExp:function(){return Q(this)},escapeURL:function(a){return a?encodeURIComponent(this):encodeURI(this)},unescapeURL:function(a){return a?decodeURI(this):decodeURIComponent(this)},escapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},unescapeHTML:function(){return this.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},encodeBase64:function(){return Eb(this)},decodeBase64:function(){return Fb(this)},each:function(a,b){var c,
|
3
|
+
d;if(z(a)){b=a;a=/[\s\S]/g}else if(a)if(C(a))a=r(Q(a),"gi");else{if(D(a))a=r(a.source,sa(a,"g"))}else a=/[\s\S]/g;c=this.match(a)||[];if(b)for(d=0;d<c.length;d++)c[d]=b.call(this,c[d],d,c)||c[d];return c},shift:function(a){var b="";a=a||0;this.codes(function(c){b+=t.fromCharCode(c+a)});return b},codes:function(a){for(var b=[],c=0;c<this.length;c++){var d=this.charCodeAt(c);b.push(d);a&&a.call(this,d,c)}return b},chars:function(a){return this.each(a)},words:function(a){return this.trim().each(/\S+/g,
|
4
|
+
a)},lines:function(a){return this.trim().each(/^.*$/gm,a)},paragraphs:function(a){var b=this.trim().split(/[\r\n]{2,}/);return b=b.map(function(c){if(a)var d=a.call(c);return d?d:c})},startsWith:function(a,b){if(K(b))b=k;var c=D(a)?a.source.replace("^",""):Q(a);return r("^"+c,b?"":"i").test(this)},endsWith:function(a,b){if(K(b))b=k;var c=D(a)?a.source.replace("$",""):Q(a);return r(c+"$",b?"":"i").test(this)},isBlank:function(){return this.trim().length===0},has:function(a){return this.search(D(a)?
|
5
|
+
a:Q(a))!==-1},add:function(a,b){b=K(b)?this.length:b;return this.slice(0,b)+a+this.slice(b)},remove:function(a){return this.replace(a,"")},reverse:function(){return this.split("").reverse().join("")},compact:function(){return this.trim().replace(/([\r\n\s\u3000])+/g,function(a,b){return b==="\u3000"?b:" "})},at:function(){return va(this,arguments,k)},from:function(a){return this.slice(a)},to:function(a){if(K(a))a=this.length;return this.slice(0,a)},dasherize:function(){return this.underscore().replace(/_/g,
|
6
|
+
"-")},underscore:function(){return this.replace(/[-\s]+/g,"_").replace(t.Inflector&&t.Inflector.acronymRegExp,function(a,b){return(b>0?"_":"")+a.toLowerCase()}).replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()},camelize:function(a){return this.underscore().replace(/(^|_)([^_]+)/g,function(b,c,d,e){b=d;b=(c=t.Inflector)&&c.acronyms[b];b=C(b)?b:void 0;e=a!==n||e>0;if(b)return e?b:b.toLowerCase();return e?d.capitalize():d})},spacify:function(){return this.underscore().replace(/_/g,
|
7
|
+
" ")},stripTags:function(){var a=this;F(arguments.length>0?arguments:[""],function(b){a=a.replace(r("</?"+Q(b)+"[^<>]*>","gi"),"")});return a},removeTags:function(){var a=this;F(arguments.length>0?arguments:["\\S+"],function(b){b=r("<("+b+")[^<>]*(?:\\/>|>.*?<\\/\\1>)","gi");a=a.replace(b,"")});return a},truncate:function(a,b,c,d){var e="",g="",f=this.toString(),i="["+ra()+"]+",j="[^"+ra()+"]*",h=r(i+j+"$");d=K(d)?"...":t(d);if(f.length<=a)return f;switch(c){case "left":a=f.length-a;e=d;f=f.slice(a);
|
8
|
+
h=r("^"+j+i);break;case "middle":a=N(a/2);g=d+f.slice(f.length-a).trimLeft();f=f.slice(0,a);break;default:a=a;g=d;f=f.slice(0,a)}if(b===n&&this.slice(a,a+1).match(/\S/))f=f.remove(h);return e+f+g},pad:function(a,b){return pa(b,a)+this+pa(b,a)},padLeft:function(a,b){return pa(b,a)+this},padRight:function(a,b){return this+pa(b,a)},first:function(a){if(K(a))a=1;return this.substr(0,a)},last:function(a){if(K(a))a=1;return this.substr(this.length-a<0?0:this.length-a)},repeat:function(a){var b="",c=0;if(A(a)&&
|
9
|
+
a>0)for(;c<a;){b+=this;c++}return b},toNumber:function(a){var b=this.replace(/,/g,"");return b.match(/\./)?parseFloat(b):parseInt(b,a||10)},capitalize:function(a){var b;return this.toLowerCase().replace(a?/[\s\S]/g:/^\S/,function(c){var d=c.toUpperCase(),e;e=b?c:d;b=d!==c;return e})},assign:function(){var a={};F(arguments,function(b,c){if(L(b))ma(a,b);else a[c+1]=b});return this.replace(/\{([^{]+?)\}/g,function(b,c){return la(a,c)?a[c]:b})},namespace:function(a){a=a||ba;G(this.split("."),function(b,
|
10
|
+
c){return!!(a=a[c])});return a}});E(t,k,n,{insert:t.prototype.add});
|
11
|
+
(function(a){if(this.btoa){Eb=this.btoa;Fb=this.atob}else{var b=/[^A-Za-z0-9\+\/\=]/g;Eb=function(c){var d="",e,g,f,i,j,h,m=0;do{e=c.charCodeAt(m++);g=c.charCodeAt(m++);f=c.charCodeAt(m++);i=e>>2;e=(e&3)<<4|g>>4;j=(g&15)<<2|f>>6;h=f&63;if(isNaN(g))j=h=64;else if(isNaN(f))h=64;d=d+a.charAt(i)+a.charAt(e)+a.charAt(j)+a.charAt(h)}while(m<c.length);return d};Fb=function(c){var d="",e,g,f,i,j,h=0;if(c.match(b))throw Error("String contains invalid base64 characters");c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");
|
12
|
+
do{e=a.indexOf(c.charAt(h++));g=a.indexOf(c.charAt(h++));i=a.indexOf(c.charAt(h++));j=a.indexOf(c.charAt(h++));e=e<<2|g>>4;g=(g&15)<<4|i>>2;f=(i&3)<<6|j;d+=t.fromCharCode(e);if(i!=64)d+=t.fromCharCode(g);if(j!=64)d+=t.fromCharCode(f)}while(h<c.length);return d}}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");
|