Created
June 19, 2012 12:51
-
-
Save mrloop/2953982 to your computer and use it in GitHub Desktop.
ember data for jsfiddle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ========================================================================== | |
// Project: Ember Data | |
// Copyright: ©2011 Living Social Inc. and contributors. | |
// License: Licensed under MIT license (see license.js) | |
// ========================================================================== | |
(function(a){window.DS=Ember.Namespace.create()})({}),function(a){DS.Adapter=Ember.Object.extend({commit:function(a,b){b.updated.eachType(function(b,c){this.updateRecords(a,b,c.slice())},this),b.created.eachType(function(b,c){this.createRecords(a,b,c.slice())},this),b.deleted.eachType(function(b,c){this.deleteRecords(a,b,c.slice())},this)},createRecords:function(a,b,c){c.forEach(function(c){this.createRecord(a,b,c)},this)},updateRecords:function(a,b,c){c.forEach(function(c){this.updateRecord(a,b,c)},this)},deleteRecords:function(a,b,c){c.forEach(function(c){this.deleteRecord(a,b,c)},this)},findMany:function(a,b,c){c.forEach(function(c){this.find(a,b,c)},this)}})}({}),function(a){DS.fixtureAdapter=DS.Adapter.create({find:function(a,b,c){var d=b.FIXTURES;if(d.hasLoaded)return;setTimeout(function(){a.loadMany(b,d),d.hasLoaded=!0},300)},findMany:function(){this.find.apply(this,arguments)},findAll:function(a,b){var c=b.FIXTURES,d=c.map(function(a,b,c){return a.id});a.loadMany(b,d,c)}})}({}),function(a){var b=Ember.get,c=Ember.set,d=Ember.getPath;DS.RESTAdapter=DS.Adapter.extend({createRecord:function(a,c,d){var e=this.rootForType(c),f={};f[e]=b(d,"data"),this.ajax("/"+this.pluralize(e),"POST",{data:f,success:function(b){a.didCreateRecord(d,b[e])}})},createRecords:function(a,c,d){if(b(this,"bulkCommit")===!1)return this._super(a,c,d);var e=this.rootForType(c),f=this.pluralize(e),g={};g[f]=d.map(function(a){return b(a,"data")}),this.ajax("/"+this.pluralize(e),"POST",{data:g,success:function(b){a.didCreateRecords(c,d,b[f])}})},updateRecord:function(a,c,e){var f=d(c,"proto.primaryKey"),g=b(e,f),h=this.rootForType(c),i={};i[h]=b(e,"data");var j=["",this.pluralize(h),g].join("/");this.ajax(j,"PUT",{data:i,success:function(b){a.didUpdateRecord(e,b[h])}})},updateRecords:function(a,c,d){if(b(this,"bulkCommit")===!1)return this._super(a,c,d);var e=this.rootForType(c),f=this.pluralize(e),g={};g[f]=d.map(function(a){return b(a,"data")}),this.ajax("/"+this.pluralize(e),"POST",{data:g,success:function(b){a.didUpdateRecords(d,b[f])}})},deleteRecord:function(a,c,e){var f=d(c,"proto.primaryKey"),g=b(e,f),h=this.rootForType(c),i=["",this.pluralize(h),g].join("/");this.ajax(i,"DELETE",{success:function(b){a.didDeleteRecord(e)}})},deleteRecords:function(a,c,e){if(b(this,"bulkCommit")===!1)return this._super(a,c,e);var f=this.rootForType(c),g=this.pluralize(f),h=d(c,"proto.primaryKey"),i={};i[g]=e.map(function(a){return b(a,h)}),this.ajax("/"+this.pluralize(f)+"/delete","POST",{data:i,success:function(b){a.didDeleteRecords(e)}})},find:function(a,b,c){var d=this.rootForType(b),e=["",this.pluralize(d),c].join("/");this.ajax(e,"GET",{success:function(c){a.load(b,c[d])}})},findMany:function(a,b,c){var d=this.rootForType(b),e=this.pluralize(d);this.ajax("/"+e,"GET",{data:{ids:c},success:function(d){a.loadMany(b,c,d[e])}});var f="/"+e},findAll:function(a,b){var c=this.rootForType(b),d=this.pluralize(c);this.ajax("/"+d,"GET",{success:function(c){a.loadMany(b,c[d])}})},findQuery:function(a,b,c,d){var e=this.rootForType(b),f=this.pluralize(e);this.ajax("/"+f,"GET",{data:c,success:function(a){d.load(a[f])}})},plurals:{},pluralize:function(a){return this.plurals[a]||a+"s"},rootForType:function(a){if(a.url)return a.url;var b=a.toString().split("."),c=b[b.length-1];return c.replace(/([A-Z])/g,"_$1").toLowerCase().slice(1)},ajax:function(a,b,c){c.url=a,c.type=b,c.dataType="json",jQuery.ajax(c)}})}({}),function(a){var b=Ember.get,c=Ember.set;DS.ModelArray=Ember.ArrayProxy.extend({type:null,content:null,store:null,init:function(){c(this,"modelCache",Ember.A([])),this._super()},arrayDidChange:function(a,c,d,e){var f=b(this,"modelCache");f.replace(c,0,Array(e)),this._super(a,c,d,e)},arrayWillChange:function(a,c,d,e){this._super(a,c,d,e);var f=b(this,"modelCache");f.replace(c,d)},objectAtContent:function(a){var c=b(this,"modelCache"),d=c.objectAt(a);if(!d){var e=b(this,"store"),f=b(this,"content"),g=f.objectAt(a);g!==undefined&&(d=e.findByClientId(b(this,"type"),g),c.replace(a,1,[d]))}return d}}),DS.FilteredModelArray=DS.ModelArray.extend({filterFunction:null,updateFilter:Ember.observer(function(){var a=b(this,"store");a.updateModelArrayFilter(this,b(this,"type"),b(this,"filterFunction"))},"filterFunction")}),DS.AdapterPopulatedModelArray=DS.ModelArray.extend({query:null,isLoaded:!1,load:function(a){var d=b(this,"store"),e=b(this,"type"),f=d.loadMany(e,a).clientIds;this.beginPropertyChanges(),c(this,"content",Ember.A(f)),c(this,"isLoaded",!0),this.endPropertyChanges()}})}({}),function(a){var b=Ember.get,c=Ember.set,d=Ember.getPath,e=Ember.String.fmt,f=Ember.Object.extend({init:function(){this.clear()},clear:function(){this.set("presenceSet",{}),this.set("list",Ember.NativeArray.apply([]))},add:function(a){var c=Ember.guidFor(a),d=b(this,"presenceSet"),e=b(this,"list");if(c in d)return;d[c]=!0,e.pushObject(a)},remove:function(a){var c=Ember.guidFor(a),d=b(this,"presenceSet"),e=b(this,"list");delete d[c],e.removeObject(a)},isEmpty:function(){return d(this,"list.length")===0},forEach:function(a,c){b(this,"list").forEach(function(b){a.call(c,b)})},toArray:function(){return b(this,"list").slice()}}),g=Ember.Object.extend({init:function(){c(this,"keys",f.create()),c(this,"values",{})},add:function(a,c){var d=b(this,"keys"),e=b(this,"values"),f=Ember.guidFor(a);return d.add(a),e[f]=c,c},remove:function(a){var c=b(this,"keys"),d=b(this,"values"),e=Ember.guidFor(a),f;return c.remove(a),f=d[e],delete d[e],f},fetch:function(a){var c=b(this,"values"),d=Ember.guidFor(a);return c[d]},forEach:function(a,c){var d=b(this,"keys"),e=b(this,"values");d.forEach(function(b){var d=Ember.guidFor(b);a.call(c,b,e[d])})}});DS.Transaction=Ember.Object.extend({init:function(){c(this,"dirty",{created:g.create(),updated:g.create(),deleted:g.create()})},createRecord:function(a,c){var d=b(this,"store");return d.createRecord(a,c,this)},add:function(a){var d=b(a,"transaction");c(a,"transaction",this)},modelBecameDirty:function(a,c){var d=b(b(this,"dirty"),a),e=c.constructor,g=d.fetch(e);g=g||d.add(e,f.create()),g.add(c)},modelBecameClean:function(a,d){var e=b(b(this,"dirty"),a),f=d.constructor,g=e.fetch(f);g.remove(d),c(d,"transaction",null)},commit:function(){var a=b(this,"dirty"),c=function(c,d,e){var f=b(a,c);f.forEach(function(a,b){if(b.isEmpty())return;b.forEach(function(a){a.willCommit()}),d.call(e,a,b.toArray())})},d={updated:{eachType:function(a,b){c("updated",a,b)}},created:{eachType:function(a,b){c("created",a,b)}},deleted:{eachType:function(a,b){c("deleted",a,b)}}},f=b(this,"store"),g=b(f,"_adapter");if(g&&g.commit)g.commit(f,d);else throw e("Adapter is either null or do not implement `commit` method",this)}})}({}),function(a){var b=Ember.get,c=Ember.set,d=Ember.getPath,e=Ember.String.fmt,f=Ember.Object.extend({init:function(){this.clear()},clear:function(){this.set("presenceSet",{}),this.set("list",Ember.NativeArray.apply([]))},add:function(a){var c=Ember.guidFor(a),d=b(this,"presenceSet"),e=b(this,"list");if(c in d)return;d[c]=!0,e.pushObject(a)},remove:function(a){var c=Ember.guidFor(a),d=b(this,"presenceSet"),e=b(this,"list");delete d[c],e.removeObject(a)},isEmpty:function(){return d(this,"list.length")===0},forEach:function(a,c){b(this,"list").forEach(function(b){a.call(c,b)})}});DS.Store=Ember.Object.extend({init:function(){return(!b(DS,"defaultStore")||b(this,"isDefaultStore"))&&c(DS,"defaultStore",this),c(this,"data",[]),c(this,"_typeMap",{}),c(this,"models",[]),c(this,"modelArrays",[]),c(this,"modelArraysByClientId",{}),c(this,"defaultTransaction",DS.Transaction.create({store:this})),this._super()},transaction:function(){return DS.Transaction.create({store:this})},modelArraysForClientId:function(a){var c=b(this,"modelArraysByClientId"),d=c[a];return d||(d=c[a]=f.create()),d},adapter:null,_adapter:Ember.computed(function(){var a=b(this,"adapter");return typeof a=="string"?d(this,a,!1)||d(window,a):a}).property("adapter").cacheable(),clientIdCounter:-1,createRecord:function(a,e,f){e=e||{};var g=e[d(a,"proto.primaryKey")]||null,h=a.create({data:e||{},store:this,transaction:f});h.adapterDidCreate();var i=this.clientIdToHashMap(a),j=b(this,"models"),k=this.pushHash(e,g,a);return c(h,"clientId",k),j[k]=h,this.updateModelArrays(a,k,e),h},deleteRecord:function(a){a.deleteRecord()},find:function(a,b,c){if(b===undefined)return this.findMany(a,null,null);if(c!==undefined)return this.findMany(a,b,c);if(Ember.typeOf(b)==="object")return this.findQuery(a,b);if(Ember.isArray(b))return this.findMany(a,b);var d=this.clientIdForId(a,b);return this.findByClientId(a,d,b)},findByClientId:function(a,c,d){var f,g=b(this,"models"),h=this.clientIdToHashMap(a);if(c!==undefined)f=g[c],f||(f=this.createModel(a,c),f.setData(h[c]||null));else{c=this.pushHash(null,d,a),f=this.createModel(a,c);var i=b(this,"_adapter");if(i&&i.find)i.find(this,a,d);else throw e("Adapter is either null or do not implement `find` method",this)}return f},findMany:function(a,c,d){var f=this.idToClientIdMap(a),g=this.clientIdToHashMap(a),h,i=Ember.A([]);c?(h=[],c.forEach(function(b){var c=f[b];if(c===undefined||g[c]===undefined)c=this.pushHash(null,b,a),h.push(b);i.push(c)},this)):h=null;if(h&&b(h,"length")>0||d){var j=b(this,"_adapter");if(j&&j.findMany)j.findMany(this,a,h,d);else throw e("Adapter is either null or do not implement `findMany` method",this)}return this.createModelArray(a,i)},findQuery:function(a,c){var d=DS.AdapterPopulatedModelArray.create({type:a,content:Ember.A([]),store:this}),f=b(this,"_adapter");if(f&&f.findQuery)f.findQuery(this,a,c,d);else throw e("Adapter is either null or do not implement `findQuery` method",this);return d},findAll:function(a){var c=this.typeMapFor(a),d=c.findAllCache;if(d)return d;var e=DS.ModelArray.create({type:a,content:Ember.A([]),store:this});this.registerModelArray(e,a);var f=b(this,"_adapter");return f&&f.findAll&&f.findAll(this,a),c.findAllCache=e,e},filter:function(a,b){var c=DS.FilteredModelArray.create({type:a,content:Ember.A([]),store:this,filterFunction:b});return this.registerModelArray(c,a,b),c},hashWasUpdated:function(a,b){var c=this.clientIdToHashMap(a),d=c[b];this.updateModelArrays(a,b,d)},commit:function(){b(this,"defaultTransaction").commit()},didUpdateRecords:function(a,b){arguments.length===2?a.forEach(function(a,c){this.didUpdateRecord(a,b[c])},this):a.forEach(function(a){this.didUpdateRecord(a)},this)},didUpdateRecord:function(a,c){if(arguments.length===2){var d=b(a,"clientId"),e=this.clientIdToHashMap(a.constructor);e[d]=c,a.set("data",c)}a.adapterDidUpdate()},didDeleteRecords:function(a){a.forEach(function(a){a.adapterDidDelete()})},didDeleteRecord:function(a){a.adapterDidDelete()},didCreateRecords:function(a,e,f){var g,h,i=d(a,"proto.primaryKey"),j=this.idToClientIdMap(a),k=this.clientIdToHashMap(a),l=this.idList(a);for(var m=0,n=b(e,"length");m<n;m++){var o=e[m],p=f[m];g=p[i],h=b(o,"clientId"),k[h]=p,c(o,"data",p),j[g]=h,l.push(g),o.adapterDidUpdate()}},didCreateRecord:function(a,e){var f=a.constructor,g,h,i=d(f,"proto.primaryKey"),j=this.idToClientIdMap(f),k=this.clientIdToHashMap(f),l=this.idList(f);g=e[i],h=b(a,"clientId"),k[h]=e,c(a,"data",e),j[g]=h,l.push(g),a.adapterDidUpdate()},recordWasInvalid:function(a,b){a.wasInvalid(b)},registerModelArray:function(a,c,d){var e=b(this,"modelArrays"),f=this.idToClientIdMap(c);e.push(a),this.updateModelArrayFilter(a,c,d)},createModelArray:function(a,b){var c=DS.ModelArray.create({type:a,content:b,store:this});return b.forEach(function(a){var b=this.modelArraysForClientId(a);b.add(c)},this),c},updateModelArrayFilter:function(a,b,c){var d=this.clientIdToHashMap(b),e=this.clientIdList(b);for(var f=0,g=e.length;f<g;f++)clientId=e[f],hash=d[clientId],hash&&this.updateModelArray(a,c,b,clientId,hash)},updateModelArrays:function(a,c,d){var e=b(this,"modelArrays");e.forEach(function(e){modelArrayType=b(e,"type"),filter=b(e,"filterFunction");if(a!==modelArrayType)return;this.updateModelArray(e,filter,a,c,d)},this)},updateModelArray:function(a,c,d,e,f){var g;c?g=c(f):g=!0;var h=b(a,"content"),i=h.indexOf(e)!==-1,j=this.modelArraysForClientId(e);g&&!i?(j.add(a),h.pushObject(e)):!g&&i&&(j.remove(a),h.removeObject(e))},removeFromModelArrays:function(a){var c=b(a,"clientId"),d=this.modelArraysForClientId(c);d.forEach(function(a){var d=b(a,"content");d.removeObject(c)})},typeMapFor:function(a){var c=b(this,"_typeMap"),d=Ember.guidFor(a),e=c[d];return e?e:c[d]={idToCid:{},idList:[],cidList:[],cidToHash:{}}},idToClientIdMap:function(a){return this.typeMapFor(a).idToCid},idList:function(a){return this.typeMapFor(a).idList},clientIdList:function(a){return this.typeMapFor(a).cidList},clientIdToHashMap:function(a){return this.typeMapFor(a).cidToHash},clientIdForId:function(a,b){return this.typeMapFor(a).idToCid[b]},idForHash:function(a,b){var c=d(a,"proto.primaryKey");return b[c]},load:function(a,c,e){if(e===undefined){e=c;var f=d(a,"proto.primaryKey");c=e[f]}var g=this.clientIdToHashMap(a),h=b(this,"models"),i=this.clientIdForId(a,c);if(i!==undefined){g[i]=e;var j=h[i];j&&(j.willLoadData(),j.setData(e))}else i=this.pushHash(e,c,a);return this.updateModelArrays(a,i,e),{id:c,clientId:i}},loadMany:function(a,c,e){var f=Ember.A([]);if(e===undefined){e=c,c=[];var g=d(a,"proto.primaryKey");c=e.map(function(a){return a[g]})}for(var h=0,i=b(c,"length");h<i;h++){var j=this.load(a,c[h],e[h]);f.pushObject(j.clientId)}return{clientIds:f,ids:c}},pushHash:function(a,b,c){var d=this.idToClientIdMap(c),e=this.clientIdList(c),f=this.idList(c),g=this.clientIdToHashMap(c),h=this.incrementProperty("clientIdCounter");return g[h]=a,b&&(d[b]=h,f.push(b)),e.push(h),h},createModel:function(a,d){var e;return b(this,"models")[d]=e=a.create({store:this,clientId:d}),c(e,"clientId",d),e.loadingData(),e}})}({}),function(a){var b=Ember.get,c=Ember.set,d=Ember.getPath,e=Ember.computed(function(a){var c=b(this,"parentState");if(c)return b(c,a)}).property();DS.State=Ember.State.extend({isLoaded:e,isDirty:e,isSaving:e,isDeleted:e,isError:e,isNew:e,isValid:e});var f=function(){throw"You cannot load data into the store when its associated model is in its current state"},g=function(a){for(var b in a){if(!a.hasOwnProperty(b))continue;return!1}return!0},h=function(a,c){var d=c.key,e=c.value,f=b(a,"model"),g=f.constructor,h=b(f,"store"),i=b(f,"data");i[d]=e,h&&h.hashWasUpdated(g,b(f,"clientId"))},i=DS.State.extend({stateName:null,isDirty:!0,willLoadData:f,enter:function(a){var c=b(this,"stateName"),d=b(a,"model");d.withTransaction(function(a){a.modelBecameDirty(c,d)})},exit:function(a){var c=b(this,"stateName"),d=b(a,"model");this.notifyModel(d),d.withTransaction(function(a){a.modelBecameClean(c,d)})},setProperty:h,willCommit:function(a){a.goToState("saving")},saving:DS.State.extend({isSaving:!0,didUpdate:function(a){a.goToState("loaded")},wasInvalid:function(a,d){var e=b(a,"model");c(e,"errors",d),a.goToState("invalid")}}),invalid:DS.State.extend({isValid:!1,setProperty:function(a,c){h(a,c);var e=d(this,"parentState.stateName"),f=b(a,"model"),i=b(f,"errors"),j=c.key;delete i[j],g(i)&&a.goToState(e)}})}),j={rootState:Ember.State.create({isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isError:!1,isNew:!1,isValid:!0,willLoadData:f,didCreate:function(a){a.goToState("loaded.created")},empty:DS.State.create({loadingData:function(a){a.goToState("loading")}}),loading:DS.State.create({willLoadData:Ember.K,exit:function(a){var c=b(a,"model");c.didLoad()},setData:function(a,c){var d=b(a,"model");d.beginPropertyChanges(),d.set("data",c),c!==null&&a.goToState("loaded"),d.endPropertyChanges()}}),loaded:DS.State.create({isLoaded:!0,willLoadData:Ember.K,setProperty:function(a,b){h(a,b),a.goToState("updated")},"delete":function(a){a.goToState("deleted")},created:i.create({stateName:"created",isNew:!0,notifyModel:function(a){a.didCreate()}}),updated:i.create({stateName:"updated",notifyModel:function(a){a.didUpdate()}})}),deleted:DS.State.create({isDeleted:!0,isLoaded:!0,isDirty:!0,willLoadData:f,enter:function(a){var c=b(a,"model"),d=b(c,"store");d&&d.removeFromModelArrays(c),c.withTransaction(function(a){a.modelBecameDirty("deleted",c)})},willCommit:function(a){a.goToState("saving")},saving:DS.State.create({isSaving:!0,didDelete:function(a){a.goToState("saved")},exit:function(a){var c=b(a,"model");c.withTransaction(function(a){a.modelBecameClean("deleted",c)})}}),saved:DS.State.create({isDirty:!1})}),error:DS.State.create({isError:!0})})};DS.StateManager=Ember.StateManager.extend({model:null,initialState:"rootState",states:j});var k=Ember.computed(function(a){return b(d(this,"stateManager.currentState"),a)}).property("stateManager.currentState").cacheable();DS.Model=Ember.Object.extend({isLoaded:k,isDirty:k,isSaving:k,isDeleted:k,isError:k,isNew:k,isValid:k,clientId:null,primaryKey:"id",data:null,transaction:null,didLoad:Ember.K,didUpdate:Ember.K,didCreate:Ember.K,init:function(){var a=DS.StateManager.create({model:this});c(this,"stateManager",a),a.goToState("empty")},withTransaction:function(a){var c=b(this,"transaction")||d(this,"store.defaultTransaction");c&&a(c)},setData:function(a){var c=b(this,"stateManager");c.send("setData",a)},setProperty:function(a,c){var d=b(this,"stateManager");d.send("setProperty",{key:a,value:c})},deleteRecord:function(){var a=b(this,"stateManager");a.send("delete")},destroy:function(){this.deleteRecord(),this._super()},loadingData:function(){var a=b(this,"stateManager");a.send("loadingData")},willLoadData:function(){var a=b(this,"stateManager");a.send("willLoadData")},willCommit:function(){var a=b(this,"stateManager");a.send("willCommit")},adapterDidUpdate:function(){var a=b(this,"stateManager");a.send("didUpdate")},adapterDidCreate:function(){var a=b(this,"stateManager");a.send("didCreate")},adapterDidDelete:function(){var a=b(this,"stateManager");a.send("didDelete")},wasInvalid:function(a){var c=b(this,"stateManager");c.send("wasInvalid",a)},unknownProperty:function(a){var c=b(this,"data");if(c)return b(c,a)},setUnknownProperty:function(a,c){var d=b(this,"data");return this.setProperty(a,c),c}}),DS.Model.reopenClass({typeForAssociation:function(a){var b=this.metaForProperty(a).type;return typeof b=="string"&&(b=d(this,b,!1)||d(window,b)),b}}),DS.attr=function(a,c){var d=DS.attr.transforms[a],e=d.from,f=d.to;return Ember.computed(function(a,d){var g=b(this,"data");a=c&&c.key?c.key:a;if(d===undefined){if(!g)return;return e(g[a])}return d=f(d),this.setProperty(a,d),d}).property("data")};var l=function(a,c,d,e,f){var g=d?b(d,e):f?null:[];return f?g?a.load(c,g).id:null:g?a.loadMany(c,g).ids:[]},m=function(a,c,d,e,f){return d?b(d,e):f?null:[]},n=function(a,c,e){var f=c&&c.embedded,g=f?l:m;return Ember.computed(function(f){var h=b(this,"data"),i,j,k,l=b(this,"store");return typeof a=="string"&&(a=d(this,a,!1)||d(window,a)),f=c&&c.key?c.key:f,e?(j=g(l,a,h,f,!0),k=j?l.find(a,j):null):(i=g(l,a,h,f),k=l.findMany(a,i)),k}).property("data").cacheable().meta({type:a})};DS.hasMany=function(a,b){return n(a,b)},DS.hasOne=function(a,b){return n(a,b,!0)},DS.attr.transforms={string:{from:function(a){return Em.none(a)?null:String(a)},to:function(a){return Em.none(a)?null:String(a)}},integer:{from:function(a){return Em.none(a)?null:Number(a)},to:function(a){return Em.none(a)?null:Number(a)}},"boolean":{from:function(a){return Boolean(a)},to:function(a){return Boolean(a)}},date:{from:function(a){var b=typeof a;return b==="string"||b==="number"?new Date(a):a===null||a===undefined?a:null},to:function(a){if(a instanceof Date){var b=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],d=function(a){return a<10?"0"+a:""+a},e=a.getUTCFullYear(),f=a.getUTCMonth(),g=a.getUTCDate(),h=a.getUTCDay(),i=a.getUTCHours(),j=a.getUTCMinutes(),k=a.getUTCSeconds(),l=b[h],m=d(g),n=c[f];return l+", "+m+" "+n+" "+e+" "+d(i)+":"+d(j)+":"+d(k)+" GMT"}return a===undefined?undefined:null}}}}({}),function(a){}({}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment