ember-rails 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -11
- data/lib/ember-rails/version.rb +1 -1
- data/vendor/assets/javascripts/ember-dev.js +837 -248
- data/vendor/assets/javascripts/ember-precompiler.js +3 -8
- data/vendor/assets/javascripts/ember.js +7 -5
- metadata +10 -12
- data/vendor/assets/javascripts/ember-datetime-dev.js +0 -1187
- data/vendor/assets/javascripts/ember-datetime.js +0 -8
@@ -1,8 +0,0 @@
|
|
1
|
-
// ==========================================================================
|
2
|
-
// Project: Ember - JavaScript Application Framework
|
3
|
-
// Copyright: ©2006-2011 Strobe Inc. and contributors.
|
4
|
-
// Portions ©2008-2011 Apple Inc. All rights reserved.
|
5
|
-
// License: Licensed under MIT license (see license.js)
|
6
|
-
// ==========================================================================
|
7
|
-
|
8
|
-
(function(a){function d(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}var b=Ember.get,c=Ember.set;Ember.SCANNER_OUT_OF_BOUNDS_ERROR="Out of bounds.",Ember.SCANNER_INT_ERROR="Not an int.",Ember.SCANNER_SKIP_ERROR="Did not find the string to skip.",Ember.SCANNER_SCAN_ARRAY_ERROR="Did not find any string of the given array to scan.",Ember.DATETIME_COMPAREDATE_TIMEZONE_ERROR="Can't compare the dates of two DateTimes that don't have the same timezone.",Ember.DATETIME_ISO8601="%Y-%m-%dT%H:%M:%S%Z";var e=Ember.Object.extend({string:null,scanLocation:0,scan:function(a){if(this.scanLocation+a>this.length)throw new Error(Ember.SCANNER_OUT_OF_BOUNDS_ERROR);var b=this.string.substr(this.scanLocation,a);return this.scanLocation+=a,b},scanInt:function(a,b){b===undefined&&(b=a);var c=this.scan(b),d=new RegExp("^\\d{"+a+","+b+"}"),e=c.match(d);if(!e)throw new Error(Ember.SCANNER_INT_ERROR);return e[0].length<b&&(this.scanLocation+=e[0].length-b),parseInt(e[0],10)},skipString:function(a){if(this.scan(a.length)!==a)throw new Error(Ember.SCANNER_SKIP_ERROR);return YES},scanArray:function(a){for(var b=0,c=a.length;b<c;b++){if(this.scan(a[b].length)===a[b])return b;this.scanLocation-=a[b].length}throw new Error(Ember.SCANNER_SCAN_ARRAY_ERROR)}});Ember.DateTime=Ember.Object.extend(Ember.Freezable,Ember.Copyable,{_ms:0,timezone:0,isFrozen:YES,adjust:function(a,b){var c;return a=a?d(a):{},c=a.timezone!==undefined?a.timezone:this.timezone!==undefined?this.timezone:0,this.constructor._adjust(a,this._ms,c,b)._createFromCurrentState()},advance:function(a){return this.constructor._advance(a,this._ms,this.timezone)._createFromCurrentState()},unknownProperty:function(a){return this.constructor._get(a,this._ms,this.timezone)},toFormattedString:function(a){return this.constructor._toFormattedString(a,this._ms,this.timezone)},toISO8601:function(){return this.constructor._toFormattedString(Ember.DATETIME_ISO8601,this._ms,this.timezone)},toString:function(){return"UTC: "+(new Date(this._ms)).toUTCString()+", timezone: "+this.timezone},isEqual:function(a){return this.constructor.compare(this,a)===0},copy:function(){return this},toTimezone:function(a){return a===undefined&&(a=0),this.advance({timezone:a-this.timezone})}}),Ember.DateTime.reopenClass(Ember.Comparable,{recordFormat:Ember.DATETIME_ISO8601,dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_englishDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_date:new Date,_tz:0,timezone:(new Date).getTimezoneOffset(),_dt_cache:{},_dt_cache_index:-1,_DT_CACHE_MAX_LENGTH:1e3,_setCalcState:function(a,b){var c={milliseconds:this._date.getTime(),timezone:this._tz};return a!==undefined&&this._date.setTime(a),b!==undefined&&(this._tz=b),c},_setCalcStateFromHash:function(a,b){var c=b!==undefined?b:this._tz,d=this._toMilliseconds(a,this._ms,c);return this._setCalcState(d,c)},_get:function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p=this._date,q,r=null;q=this._setCalcState(b,c),a==="milliseconds"?r=p.getTime():a==="timezone"&&(r=this._tz);if(r===null){l=a.slice(0,4),m=a.slice(4);if(l==="last"||l==="next"){n=this._get("dayOfWeek",b,c),o=this._englishDayNames.indexOf(m);if(o>=0){var s=o-n;l==="last"&&s>=0&&(s-=7),l==="next"&&s<0&&(s+=7),this._advance({day:s},b,c),r=this._createFromCurrentState()}}}if(r===null){c!==undefined&&this._setCalcState(p.getTime()-c*6e4,0);switch(a){case"year":r=p.getUTCFullYear();break;case"month":r=p.getUTCMonth()+1;break;case"day":r=p.getUTCDate();break;case"dayOfWeek":r=p.getUTCDay();break;case"hour":r=p.getUTCHours();break;case"minute":r=p.getUTCMinutes();break;case"second":r=p.getUTCSeconds();break;case"millisecond":r=p.getUTCMilliseconds()}r===null&&a==="isLeapYear"&&(h=this._get("year"),r=h%4===0&&h%100!==0||h%400===0);if(r===null&&a==="daysInMonth")switch(this._get("month")){case 4:case 6:case 9:case 11:r=30;break;case 2:r=this._get("isLeapYear")?29:28;break;default:r=31}if(r===null&&a==="dayOfYear"){d=p.getTime(),f=this._get("day"),this._setCalcStateFromHash({day:1});for(g=this._get("month")-1;g>0;g--)this._setCalcStateFromHash({month:g}),f+=this._get("daysInMonth");p.setTime(d),r=f}r===null&&a.slice(0,4)==="week"&&(i=a.length===4?1:parseInt(a.slice("4"),10),j=this._get("dayOfWeek"),k=this._get("dayOfYear")-1,i===0?r=parseInt((k-j+7)/7,10):r=parseInt((k-(j-1+7)%7+7)/7,10))}return this._setCalcState(q.milliseconds,q.timezone),r},_adjust:function(a,b,c,e){var f=a?d(a):{},g=this._toMilliseconds(a,b,c,e);return this._setCalcState(g,c),this},_advance:function(a,b,c){var e=a?d(a):{},f;for(var g in e)e[g]+=this._get(g,b,c);return f=e.timezone!==undefined?e.timezone:c,this._adjust(e,b,f,NO)},_toMilliseconds:function(a,b,c,e){var f=a?d(a):{},g=this._date,h=g.getTime(),i,j;Ember.none(b)||g.setTime(b),j=c!==undefined?c:this.timezone!==undefined?this.timezone:0,g.setTime(g.getTime()-j*6e4);if(e===undefined||e===YES)!Ember.none(f.hour)&&Ember.none(f.minute)&&(f.minute=0),(!Ember.none(f.hour)||!Ember.none(f.minute))&&Ember.none(f.second)&&(f.second=0),!(Ember.none(f.hour)&&Ember.none(f.minute)&&Ember.none(f.second))&&Ember.none(f.millisecond)&&(f.millisecond=0);return Ember.none(f.year)&&(f.year=g.getUTCFullYear()),Ember.none(f.month)&&(f.month=g.getUTCMonth()+1),Ember.none(f.day)&&(f.day=g.getUTCDate()),Ember.none(f.hour)&&(f.hour=g.getUTCHours()),Ember.none(f.minute)&&(f.minute=g.getUTCMinutes()),Ember.none(f.second)&&(f.second=g.getUTCSeconds()),Ember.none(f.millisecond)&&(f.millisecond=g.getUTCMilliseconds()),i=Date.UTC(f.year,f.month-1,f.day,f.hour,f.minute,f.second,f.millisecond),g.setTime(i+j*6e4),i=g.getTime(),g.setTime(h),i},create:function(){var a=arguments.length===0?{}:arguments[0],b;Ember.typeOf(a)==="number"&&(a={milliseconds:a}),b=a.timezone!==undefined?a.timezone:this.timezone,b===undefined&&(b=0);if(!Ember.none(a.milliseconds)){var c="nu"+a.milliseconds+b,d=this._dt_cache,e=d[c];if(!e){var f,g=this._dt_cache_index;e=d[c]=this._super({_ms:a.milliseconds,timezone:b}),g=this._dt_cache_index=(g+1)%this._DT_CACHE_MAX_LENGTH,f=d[g],f!==undefined&&d[f]&&delete d[f],d[g]=c}return e}var h=new Date;return this.create({milliseconds:this._toMilliseconds(a,h.getTime(),b,a.resetCascadingly),timezone:b})},_createFromCurrentState:function(){return this.create({milliseconds:this._date.getTime(),timezone:this._tz})},parse:function(a,c){var d=new RegExp("(?:%([aAbBcdDhHiIjmMpsSUWwxXyYZ%])|(.))","g"),f,g,h={},i={},j=e.create({string:a});Ember.none(c)&&(c=Ember.DATETIME_ISO8601);try{while((g=d.exec(c))!==null)switch(g[1]){case"a":i.dayOfWeek=j.scanArray(this.abbreviatedDayNames);break;case"A":i.dayOfWeek=j.scanArray(this.dayNames);break;case"b":h.month=j.scanArray(this.abbreviatedMonthNames)+1;break;case"B":h.month=j.scanArray(this.monthNames)+1;break;case"c":throw new Error("%c is not implemented");case"d":case"D":h.day=j.scanInt(1,2);break;case"h":case"H":h.hour=j.scanInt(1,2);break;case"i":case"I":h.hour=j.scanInt(1,2);break;case"j":throw new Error("%j is not implemented");case"m":h.month=j.scanInt(1,2);break;case"M":h.minute=j.scanInt(1,2);break;case"p":h.meridian=j.scanArray(["AM","PM"]);break;case"S":h.second=j.scanInt(1,2);break;case"s":h.millisecond=j.scanInt(1,3);break;case"U":throw new Error("%U is not implemented");case"W":throw new Error("%W is not implemented");case"w":throw new Error("%w is not implemented");case"x":throw new Error("%x is not implemented");case"X":throw new Error("%X is not implemented");case"y":h.year=j.scanInt(2),h.year+=h.year>70?1900:2e3;break;case"Y":h.year=j.scanInt(4);break;case"Z":var k=j.scan(1);if(k==="Z")h.timezone=0;else if(k==="+"||k==="-"){var l=j.scanInt(2);j.scan(1)!==":"&&j.scan(-1);var m=j.scanInt(2);h.timezone=(k==="+"?-1:1)*(l*60+m)}break;case"%":j.skipString("%");break;default:j.skipString(g[0])}}catch(n){return Ember.Logger.log("Ember.DateTime.createFromString "+n.toString()),null}!Ember.none(h.meridian)&&!Ember.none(h.hour)&&(h.meridian===1&&(h.hour=(h.hour+12)%24),delete h.meridian);if(!Ember.none(h.day)&&(h.day<1||h.day>31))return null;if(!Ember.none(h.month)){if(h.month<1||h.month>12)return null;if(!Ember.none(h.day)){if(h.month===2&&h.day>29)return null;if(jQuery.inArray(h.month,[4,6,9,11])>-1&&h.day>30)return null}}return f=this.create(h),!Ember.none(i.dayOfWeek)&&b(f,"dayOfWeek")!==i.dayOfWeek?null:f},_pad:function(a,b){var c=""+a;b===undefined&&(b=2);while(c.length<b)c="0"+c;return c},__toFormattedString:function(a,b,c){var d,e;switch(a[1]){case"a":return this.abbreviatedDayNames[this._get("dayOfWeek")];case"A":return this.dayNames[this._get("dayOfWeek")];case"b":return this.abbreviatedMonthNames[this._get("month")-1];case"B":return this.monthNames[this._get("month")-1];case"c":return this._date.toString();case"d":return this._pad(this._get("day"));case"D":return this._get("day");case"h":return this._get("hour");case"H":return this._pad(this._get("hour"));case"i":return d=this._get("hour"),d===12||d===0?12:(d+12)%12;case"I":return d=this._get("hour"),this._pad(d===12||d===0?12:(d+12)%12);case"j":return this._pad(this._get("dayOfYear"),3);case"m":return this._pad(this._get("month"));case"M":return this._pad(this._get("minute"));case"p":return this._get("hour")>11?"PM":"AM";case"S":return this._pad(this._get("second"));case"s":return this._pad(this._get("millisecond"),3);case"u":return this._pad(this._get("utc"));case"U":return this._pad(this._get("week0"));case"W":return this._pad(this._get("week1"));case"w":return this._get("dayOfWeek");case"x":return this._date.toDateString();case"X":return this._date.toTimeString();case"y":return this._pad(this._get("year")%100);case"Y":return this._get("year");case"Z":return e=-1*c,(e>=0?"+":"-")+this._pad(parseInt(Math.abs(e)/60,10))+":"+this._pad(Math.abs(e)%60);case"%":return"%"}},_toFormattedString:function(a,b,c){var d=this,e=c!==undefined?c:this.timezone!==undefined?this.timezone:0;return this._setCalcState(b-c*6e4,0),a.replace(/\%([aAbBcdDhHiIjmMpsSUWwxXyYZ\%])/g,function(){var a=d.__toFormattedString.call(d,arguments,b,c);return a})},compare:function(a,c){var d=b(a,"milliseconds"),e=b(c,"milliseconds");return d<e?-1:d===e?0:1},compareDate:function(a,c){if(b(a,"timezone")!==b(c,"timezone"))throw new Error(Ember.DATETIME_COMPAREDATE_TIMEZONE_ERROR);var d=b(a.adjust({hour:0}),"milliseconds"),e=b(c.adjust({hour:0}),"milliseconds");return d<e?-1:d===e?0:1}}),Ember.Binding.dateTime=function(a){return this.transform(function(b,c){return b?b.toFormattedString(a):null})}})({}),function(a){}({})
|