removed vestigial vendor javascript
- not using ember model or ember data - all that other stuff is installed with bower Change-Id: Id8190bf413f07a11aa0b5a1bf1fa194c65969eef Reviewed-on: https://gerrit.instructure.com/27763 Reviewed-by: Simon Williams <simon@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Ryan Florence <ryanf@instructure.com> Product-Review: Ryan Florence <ryanf@instructure.com>
This commit is contained in:
parent
808aec9b05
commit
779c4d38d4
|
@ -3,6 +3,8 @@
|
|||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"ember": "1.2.0",
|
||||
"handlebars": "1.1.2",
|
||||
"ic-ajax": "~0.2.0",
|
||||
"ic-menu": "~0.1.0",
|
||||
"ic-styled": "~1.1.3"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,979 +0,0 @@
|
|||
// Last commit: 0ee61ba (2013-06-27 11:08:18 -0700)
|
||||
|
||||
define(['Ember'], function(Ember) {
|
||||
|
||||
(function() {
|
||||
Ember.Adapter = Ember.Object.extend({
|
||||
find: function(record, id) {
|
||||
throw new Error('Ember.Adapter subclasses must implement find');
|
||||
},
|
||||
|
||||
findQuery: function(klass, records, params) {
|
||||
throw new Error('Ember.Adapter subclasses must implement findQuery');
|
||||
},
|
||||
|
||||
findMany: function(klass, records, ids) {
|
||||
throw new Error('Ember.Adapter subclasses must implement findMany');
|
||||
},
|
||||
|
||||
findAll: function(klass, records) {
|
||||
throw new Error('Ember.Adapter subclasses must implement findAll');
|
||||
},
|
||||
|
||||
load: function(record, id, data) {
|
||||
record.load(id, data);
|
||||
},
|
||||
|
||||
createRecord: function(record) {
|
||||
throw new Error('Ember.Adapter subclasses must implement createRecord');
|
||||
},
|
||||
|
||||
saveRecord: function(record) {
|
||||
throw new Error('Ember.Adapter subclasses must implement saveRecord');
|
||||
},
|
||||
|
||||
deleteRecord: function(record) {
|
||||
throw new Error('Ember.Adapter subclasses must implement deleteRecord');
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get;
|
||||
|
||||
Ember.FixtureAdapter = Ember.Adapter.extend({
|
||||
find: function(record, id) {
|
||||
var fixtures = record.constructor.FIXTURES,
|
||||
primaryKey = get(record.constructor, 'primaryKey'),
|
||||
data = Ember.A(fixtures).find(function(el) { return el[primaryKey] === id; });
|
||||
|
||||
if (!record.get('isLoaded')) {
|
||||
setTimeout(function() {
|
||||
Ember.run(record, record.load, id, data);
|
||||
});
|
||||
}
|
||||
|
||||
return record;
|
||||
},
|
||||
|
||||
findMany: function(klass, records, ids) {
|
||||
var fixtures = klass.FIXTURES,
|
||||
requestedData = [];
|
||||
|
||||
for (var i = 0, l = ids.length; i < l; i++) {
|
||||
requestedData.push(fixtures[i]);
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
Ember.run(records, records.load, klass, requestedData);
|
||||
});
|
||||
|
||||
return records;
|
||||
},
|
||||
|
||||
findAll: function(klass, records) {
|
||||
var fixtures = klass.FIXTURES;
|
||||
|
||||
setTimeout(function() {
|
||||
Ember.run(records, records.load, klass, fixtures);
|
||||
});
|
||||
|
||||
return records;
|
||||
},
|
||||
|
||||
createRecord: function(record) {
|
||||
var klass = record.constructor,
|
||||
fixtures = klass.FIXTURES;
|
||||
|
||||
setTimeout(function() {
|
||||
Ember.run(function() {
|
||||
fixtures.push(klass.findFromCacheOrLoad(record.toJSON()));
|
||||
record.didCreateRecord();
|
||||
});
|
||||
});
|
||||
|
||||
return record;
|
||||
},
|
||||
|
||||
saveRecord: function(record) {
|
||||
var deferred = Ember.Deferred.create();
|
||||
deferred.then(function() {
|
||||
record.didSaveRecord();
|
||||
});
|
||||
setTimeout(function() {
|
||||
Ember.run(deferred, deferred.resolve, record);
|
||||
});
|
||||
return deferred;
|
||||
},
|
||||
|
||||
deleteRecord: function(record) {
|
||||
var deferred = Ember.Deferred.create();
|
||||
deferred.then(function() {
|
||||
record.didDeleteRecord();
|
||||
});
|
||||
setTimeout(function() {
|
||||
Ember.run(deferred, deferred.resolve, record);
|
||||
});
|
||||
return deferred;
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get,
|
||||
set = Ember.set;
|
||||
|
||||
Ember.RecordArray = Ember.ArrayProxy.extend(Ember.Evented, Ember.DeferredMixin, {
|
||||
isLoaded: false,
|
||||
isLoading: Ember.computed.not('isLoaded'),
|
||||
|
||||
load: function(klass, data) {
|
||||
set(this, 'content', this.materializeData(klass, data));
|
||||
this.notifyLoaded();
|
||||
},
|
||||
|
||||
loadForFindMany: function(klass) {
|
||||
var content = get(this, '_ids').map(function(id) { return klass.cachedRecordForId(id); });
|
||||
set(this, 'content', Ember.A(content));
|
||||
this.notifyLoaded();
|
||||
},
|
||||
|
||||
notifyLoaded: function() {
|
||||
set(this, 'isLoaded', true);
|
||||
this.trigger('didLoad');
|
||||
this.resolve(this);
|
||||
},
|
||||
|
||||
materializeData: function(klass, data) {
|
||||
return Ember.A(data.map(function(el) {
|
||||
return klass.findFromCacheOrLoad(el); // FIXME
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get;
|
||||
|
||||
Ember.FilteredRecordArray = Ember.RecordArray.extend({
|
||||
init: function() {
|
||||
if (!get(this, 'modelClass')) {
|
||||
throw new Error('FilteredRecordArrays must be created with a modelClass');
|
||||
}
|
||||
if (!get(this, 'filterFunction')) {
|
||||
throw new Error('FilteredRecordArrays must be created with a filterFunction');
|
||||
}
|
||||
if (!get(this, 'filterProperties')) {
|
||||
throw new Error('FilteredRecordArrays must be created with filterProperties');
|
||||
}
|
||||
|
||||
var modelClass = get(this, 'modelClass');
|
||||
modelClass.registerRecordArray(this);
|
||||
|
||||
this.registerObservers();
|
||||
this.updateFilter();
|
||||
},
|
||||
|
||||
updateFilter: function() {
|
||||
var self = this,
|
||||
results = [];
|
||||
get(this, 'modelClass').forEachCachedRecord(function(record) {
|
||||
if (self.filterFunction(record)) {
|
||||
results.push(record);
|
||||
}
|
||||
});
|
||||
this.set('content', Ember.A(results));
|
||||
},
|
||||
|
||||
updateFilterForRecord: function(record) {
|
||||
var results = get(this, 'content');
|
||||
if (this.filterFunction(record)) {
|
||||
results.pushObject(record);
|
||||
}
|
||||
},
|
||||
|
||||
registerObservers: function() {
|
||||
var self = this;
|
||||
get(this, 'modelClass').forEachCachedRecord(function(record) {
|
||||
self.registerObserversOnRecord(record);
|
||||
});
|
||||
},
|
||||
|
||||
registerObserversOnRecord: function(record) {
|
||||
var self = this,
|
||||
filterProperties = get(this, 'filterProperties');
|
||||
|
||||
for (var i = 0, l = get(filterProperties, 'length'); i < l; i++) {
|
||||
record.addObserver(filterProperties[i], self, 'updateFilterForRecord');
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get;
|
||||
|
||||
Ember.HasManyArray = Ember.RecordArray.extend({
|
||||
_records: null,
|
||||
|
||||
objectAtContent: function(idx) {
|
||||
var klass = get(this, 'modelClass'),
|
||||
content = get(this, 'content');
|
||||
|
||||
if (!content.length) { return; }
|
||||
|
||||
var attrs = content.objectAt(idx);
|
||||
|
||||
// TODO: Create a LazilyMaterializedRecordArray class and test it
|
||||
if (this._records && this._records[idx]) { return this._records[idx]; }
|
||||
|
||||
var record = klass.create();
|
||||
|
||||
if (!this._records) { this._records = {}; }
|
||||
this._records[idx] = record;
|
||||
|
||||
var primaryKey = get(klass, 'primaryKey');
|
||||
record.load(attrs[primaryKey], attrs);
|
||||
|
||||
return record;
|
||||
},
|
||||
|
||||
create: function(attrs) {
|
||||
var klass = get(this, 'modelClass'),
|
||||
record = klass.create(attrs);
|
||||
|
||||
this.pushObject(attrs);
|
||||
|
||||
// TODO: Create a LazilyMaterializedRecordArray class and test it
|
||||
if (!this._records) { this._records = {}; }
|
||||
this._records[get(this, 'length') - 1] = record;
|
||||
|
||||
return record; // FIXME: inject parent's id
|
||||
},
|
||||
|
||||
save: function() {
|
||||
// TODO: loop over dirty records only
|
||||
return Ember.RSVP.all(this.map(function(record) {
|
||||
return record.save();
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get,
|
||||
set = Ember.set,
|
||||
setProperties = Ember.setProperties,
|
||||
meta = Ember.meta,
|
||||
underscore = Ember.String.underscore;
|
||||
|
||||
function contains(array, element) {
|
||||
for (var i = 0, l = array.length; i < l; i++) {
|
||||
if (array[i] === element) { return true; }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function concatUnique(toArray, fromArray) {
|
||||
var e;
|
||||
for (var i = 0, l = fromArray.length; i < l; i++) {
|
||||
e = fromArray[i];
|
||||
if (!contains(toArray, e)) { toArray.push(e); }
|
||||
}
|
||||
return toArray;
|
||||
}
|
||||
|
||||
function hasCachedValue(object, key) {
|
||||
var objectMeta = meta(object, false);
|
||||
if (objectMeta) {
|
||||
return key in objectMeta.cache;
|
||||
}
|
||||
}
|
||||
|
||||
Ember.run.queues.push('data');
|
||||
|
||||
Ember.Model = Ember.Object.extend(Ember.Evented, Ember.DeferredMixin, {
|
||||
isLoaded: true,
|
||||
isLoading: Ember.computed.not('isLoaded'),
|
||||
isNew: true,
|
||||
isDeleted: false,
|
||||
_dirtyAttributes: null,
|
||||
|
||||
/**
|
||||
Called when attribute is accessed.
|
||||
|
||||
@method getAttr
|
||||
@param key {String} key which is being accessed
|
||||
@param value {Object} value, which will be returned from getter by default
|
||||
*/
|
||||
getAttr: function(key, value) {
|
||||
return value;
|
||||
},
|
||||
|
||||
isDirty: Ember.computed(function() {
|
||||
var attributes = this.attributes,
|
||||
dirtyAttributes = Ember.A(), // just for removeObject
|
||||
key, cachedValue, dataValue, desc, descMeta, type, isDirty;
|
||||
|
||||
for (var i = 0, l = attributes.length; i < l; i++) {
|
||||
key = attributes[i];
|
||||
if (!hasCachedValue(this, key)) { continue; }
|
||||
cachedValue = this.cacheFor(key);
|
||||
dataValue = get(this, 'data.'+this.dataKey(key));
|
||||
desc = meta(this).descs[key];
|
||||
descMeta = desc && desc.meta();
|
||||
type = descMeta.type;
|
||||
|
||||
if (type && type.isEqual) {
|
||||
isDirty = !type.isEqual(dataValue, cachedValue);
|
||||
} else if (dataValue !== cachedValue) {
|
||||
isDirty = true;
|
||||
} else {
|
||||
isDirty = false;
|
||||
}
|
||||
|
||||
if (isDirty) {
|
||||
dirtyAttributes.push(key);
|
||||
}
|
||||
}
|
||||
|
||||
if (dirtyAttributes.length) {
|
||||
this._dirtyAttributes = dirtyAttributes;
|
||||
return true;
|
||||
} else {
|
||||
this._dirtyAttributes = [];
|
||||
return false;
|
||||
}
|
||||
}).property().volatile(),
|
||||
|
||||
dataKey: function(key) {
|
||||
var camelizeKeys = get(this.constructor, 'camelizeKeys');
|
||||
return camelizeKeys ? underscore(key) : key;
|
||||
},
|
||||
|
||||
init: function() {
|
||||
if (!get(this, 'isNew')) { this.resolve(this); }
|
||||
this._super();
|
||||
},
|
||||
|
||||
load: function(id, hash) {
|
||||
var data = {};
|
||||
data[get(this.constructor, 'primaryKey')] = id;
|
||||
set(this, 'data', Ember.merge(data, hash));
|
||||
set(this, 'isLoaded', true);
|
||||
set(this, 'isNew', false);
|
||||
this.trigger('didLoad');
|
||||
this.resolve(this);
|
||||
},
|
||||
|
||||
didDefineProperty: function(proto, key, value) {
|
||||
if (value instanceof Ember.Descriptor) {
|
||||
var meta = value.meta();
|
||||
|
||||
if (meta.isAttribute) {
|
||||
if (!proto.attributes) { proto.attributes = []; }
|
||||
proto.attributes.push(key);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
toJSON: function() {
|
||||
var key, meta,
|
||||
properties = this.getProperties(this.attributes);
|
||||
|
||||
for (key in properties) {
|
||||
meta = this.constructor.metaForProperty(key);
|
||||
if (meta.type && meta.type.serialize) {
|
||||
properties[key] = meta.type.serialize(properties[key]);
|
||||
} else if (meta.type && Ember.Model.dataTypes[meta.type]) {
|
||||
properties[key] = Ember.Model.dataTypes[meta.type].serialize(properties[key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.constructor.rootKey) {
|
||||
var json = {};
|
||||
json[this.constructor.rootKey] = properties;
|
||||
|
||||
return json;
|
||||
} else {
|
||||
return properties;
|
||||
}
|
||||
},
|
||||
|
||||
save: function() {
|
||||
var adapter = this.constructor.adapter;
|
||||
set(this, 'isSaving', true);
|
||||
if (get(this, 'isNew')) {
|
||||
return adapter.createRecord(this);
|
||||
} else if (get(this, 'isDirty')) {
|
||||
return adapter.saveRecord(this);
|
||||
} else {
|
||||
var deferred = Ember.Deferred.create();
|
||||
deferred.resolve(this);
|
||||
set(this, 'isSaving', false);
|
||||
return deferred;
|
||||
}
|
||||
},
|
||||
|
||||
reload: function() {
|
||||
return this.constructor.reload(this.get(get(this.constructor, 'primaryKey')));
|
||||
},
|
||||
|
||||
revert: function() {
|
||||
if (this.get('isDirty')) {
|
||||
var data = get(this, 'data'),
|
||||
reverts = {};
|
||||
for (var i = 0; i < this._dirtyAttributes.length; i++) {
|
||||
var attr = this._dirtyAttributes[i];
|
||||
reverts[attr] = data[attr];
|
||||
}
|
||||
setProperties(this, reverts);
|
||||
}
|
||||
},
|
||||
|
||||
didCreateRecord: function() {
|
||||
var primaryKey = get(this.constructor, 'primaryKey'),
|
||||
id = get(this, primaryKey);
|
||||
|
||||
set(this, 'isNew', false);
|
||||
|
||||
if (!this.constructor.recordCache) this.constructor.recordCache = {};
|
||||
this.constructor.recordCache[id] = this;
|
||||
|
||||
this.load(id, this.getProperties(this.attributes));
|
||||
this.constructor.addToRecordArrays(this);
|
||||
this.trigger('didCreateRecord');
|
||||
this.didSaveRecord();
|
||||
},
|
||||
|
||||
didSaveRecord: function() {
|
||||
set(this, 'isSaving', false);
|
||||
this.trigger('didSaveRecord');
|
||||
if (this.get('isDirty')) { this._copyDirtyAttributesToData(); }
|
||||
},
|
||||
|
||||
deleteRecord: function() {
|
||||
return this.constructor.adapter.deleteRecord(this);
|
||||
},
|
||||
|
||||
didDeleteRecord: function() {
|
||||
this.constructor.removeFromRecordArrays(this);
|
||||
set(this, 'isDeleted', true);
|
||||
this.trigger('didDeleteRecord');
|
||||
},
|
||||
|
||||
_copyDirtyAttributesToData: function() {
|
||||
if (!this._dirtyAttributes) { return; }
|
||||
var dirtyAttributes = this._dirtyAttributes,
|
||||
data = get(this, 'data'),
|
||||
key;
|
||||
|
||||
if (!data) {
|
||||
data = {};
|
||||
set(this, 'data', data);
|
||||
}
|
||||
for (var i = 0, l = dirtyAttributes.length; i < l; i++) {
|
||||
// TODO: merge Object.create'd object into prototype
|
||||
key = dirtyAttributes[i];
|
||||
data[this.dataKey(key)] = this.cacheFor(key);
|
||||
}
|
||||
this._dirtyAttributes = [];
|
||||
}
|
||||
});
|
||||
|
||||
Ember.Model.reopenClass({
|
||||
primaryKey: 'id',
|
||||
|
||||
adapter: Ember.Adapter.create(),
|
||||
|
||||
find: function(id) {
|
||||
if (!arguments.length) {
|
||||
return this.findAll();
|
||||
} else if (Ember.isArray(id)) {
|
||||
return this.findMany(id);
|
||||
} else if (typeof id === 'object') {
|
||||
return this.findQuery(id);
|
||||
} else {
|
||||
return this.findById(id);
|
||||
}
|
||||
},
|
||||
|
||||
findMany: function(ids) {
|
||||
Ember.assert("findMany requires an array", Ember.isArray(ids));
|
||||
|
||||
var records = Ember.RecordArray.create({_ids: ids});
|
||||
|
||||
if (!this.recordArrays) { this.recordArrays = []; }
|
||||
this.recordArrays.push(records);
|
||||
|
||||
if (this._currentBatchIds) {
|
||||
concatUnique(this._currentBatchIds, ids);
|
||||
this._currentBatchRecordArrays.push(records);
|
||||
} else {
|
||||
this._currentBatchIds = concatUnique([], ids);
|
||||
this._currentBatchRecordArrays = [records];
|
||||
}
|
||||
|
||||
Ember.run.scheduleOnce('data', this, this._executeBatch);
|
||||
|
||||
return records;
|
||||
},
|
||||
|
||||
findAll: function() {
|
||||
if (this._findAllRecordArray) { return this._findAllRecordArray; }
|
||||
|
||||
var records = this._findAllRecordArray = Ember.RecordArray.create();
|
||||
|
||||
this.adapter.findAll(this, records);
|
||||
|
||||
return records;
|
||||
},
|
||||
|
||||
_currentBatchIds: null,
|
||||
_currentBatchRecordArrays: null,
|
||||
|
||||
findById: function(id) {
|
||||
var record = this.cachedRecordForId(id);
|
||||
|
||||
if (!get(record, 'isLoaded')) {
|
||||
this._fetchById(record, id);
|
||||
}
|
||||
return record;
|
||||
},
|
||||
|
||||
reload: function(id) {
|
||||
var record = this.cachedRecordForId(id);
|
||||
|
||||
this._fetchById(record, id);
|
||||
|
||||
return record;
|
||||
},
|
||||
|
||||
_fetchById: function(record, id) {
|
||||
var adapter = get(this, 'adapter');
|
||||
|
||||
if (adapter.findMany) {
|
||||
if (this._currentBatchIds) {
|
||||
if (!contains(this._currentBatchIds, id)) { this._currentBatchIds.push(id); }
|
||||
} else {
|
||||
this._currentBatchIds = [id];
|
||||
this._currentBatchRecordArrays = [];
|
||||
}
|
||||
|
||||
Ember.run.scheduleOnce('data', this, this._executeBatch);
|
||||
} else {
|
||||
adapter.find(record, id);
|
||||
}
|
||||
},
|
||||
|
||||
_executeBatch: function() {
|
||||
var batchIds = this._currentBatchIds,
|
||||
batchRecordArrays = this._currentBatchRecordArrays,
|
||||
self = this,
|
||||
requestIds = [],
|
||||
recordOrRecordArray,
|
||||
i;
|
||||
|
||||
this._currentBatchIds = null;
|
||||
this._currentBatchRecordArrays = null;
|
||||
|
||||
for (i = 0; i < batchIds.length; i++) {
|
||||
if (!this.cachedRecordForId(batchIds[i]).get('isLoaded')) {
|
||||
requestIds.push(batchIds[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (batchIds.length === 1) {
|
||||
recordOrRecordArray = get(this, 'adapter').find(this.cachedRecordForId(batchIds[0]), batchIds[0]);
|
||||
} else {
|
||||
recordOrRecordArray = Ember.RecordArray.create({_ids: batchIds});
|
||||
|
||||
if (requestIds.length === 0) {
|
||||
recordOrRecordArray.notifyLoaded();
|
||||
} else {
|
||||
get(this, 'adapter').findMany(this, recordOrRecordArray, requestIds);
|
||||
}
|
||||
}
|
||||
|
||||
recordOrRecordArray.then(function() {
|
||||
for (var i = 0, l = batchRecordArrays.length; i < l; i++) {
|
||||
batchRecordArrays[i].loadForFindMany(self);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
findQuery: function(params) {
|
||||
var records = Ember.RecordArray.create();
|
||||
|
||||
this.adapter.findQuery(this, records, params);
|
||||
|
||||
return records;
|
||||
},
|
||||
|
||||
cachedRecordForId: function(id) {
|
||||
if (!this.recordCache) { this.recordCache = {}; }
|
||||
var record;
|
||||
|
||||
if (this.recordCache[id]) {
|
||||
record = this.recordCache[id];
|
||||
} else {
|
||||
record = this.create({isLoaded: false});
|
||||
var sideloadedData = this.sideloadedData && this.sideloadedData[id];
|
||||
if (sideloadedData) {
|
||||
record.load(id, sideloadedData);
|
||||
}
|
||||
this.recordCache[id] = record;
|
||||
}
|
||||
|
||||
return record;
|
||||
},
|
||||
|
||||
addToRecordArrays: function(record) {
|
||||
if (this._findAllRecordArray) {
|
||||
this._findAllRecordArray.pushObject(record);
|
||||
}
|
||||
if (this.recordArrays) {
|
||||
this.recordArrays.forEach(function(recordArray) {
|
||||
if (recordArray instanceof Ember.FilteredRecordArray) {
|
||||
recordArray.registerObserversOnRecord(record);
|
||||
recordArray.updateFilter();
|
||||
} else {
|
||||
recordArray.pushObject(record);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
removeFromRecordArrays: function(record) {
|
||||
if (this._findAllRecordArray) {
|
||||
this._findAllRecordArray.removeObject(record);
|
||||
}
|
||||
if (this.recordArrays) {
|
||||
this.recordArrays.forEach(function(recordArray) {
|
||||
recordArray.removeObject(record);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// FIXME
|
||||
findFromCacheOrLoad: function(data) {
|
||||
var record;
|
||||
if (!data[get(this, 'primaryKey')]) {
|
||||
record = this.create({isLoaded: false});
|
||||
} else {
|
||||
record = this.cachedRecordForId(data[get(this, 'primaryKey')]);
|
||||
}
|
||||
// set(record, 'data', data);
|
||||
record.load(data[get(this, 'primaryKey')], data);
|
||||
return record;
|
||||
},
|
||||
|
||||
registerRecordArray: function(recordArray) {
|
||||
if (!this.recordArrays) { this.recordArrays = []; }
|
||||
this.recordArrays.push(recordArray);
|
||||
},
|
||||
|
||||
unregisterRecordArray: function(recordArray) {
|
||||
if (!this.recordArrays) { return; }
|
||||
Ember.A(this.recordArrays).removeObject(recordArray);
|
||||
},
|
||||
|
||||
forEachCachedRecord: function(callback) {
|
||||
if (!this.recordCache) { return Ember.A([]); }
|
||||
var ids = Object.keys(this.recordCache);
|
||||
ids.map(function(id) {
|
||||
return this.recordCache[id];
|
||||
}, this).forEach(callback);
|
||||
},
|
||||
|
||||
load: function(hashes) {
|
||||
if (!this.sideloadedData) { this.sideloadedData = {}; }
|
||||
for (var i = 0, l = hashes.length; i < l; i++) {
|
||||
var hash = hashes[i];
|
||||
this.sideloadedData[hash[get(this, 'primaryKey')]] = hash;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get;
|
||||
|
||||
Ember.hasMany = function(klassOrString, key) {
|
||||
return Ember.computed(function() {
|
||||
var klass;
|
||||
|
||||
if (typeof klassOrString === "string") {
|
||||
klass = Ember.get(Ember.lookup, klassOrString);
|
||||
} else {
|
||||
klass = klassOrString;
|
||||
}
|
||||
|
||||
return Ember.HasManyArray.create({
|
||||
parent: this,
|
||||
modelClass: klass,
|
||||
content: get(this, 'data.' + key)
|
||||
});
|
||||
}).property();
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get,
|
||||
set = Ember.set,
|
||||
meta = Ember.meta;
|
||||
|
||||
function wrapObject(value) {
|
||||
if (Ember.isArray(value)) {
|
||||
var clonedArray = value.slice();
|
||||
|
||||
// TODO: write test for recursive cloning
|
||||
for (var i = 0, l = clonedArray.length; i < l; i++) {
|
||||
clonedArray[i] = wrapObject(clonedArray[i]);
|
||||
}
|
||||
|
||||
return Ember.A(clonedArray);
|
||||
} else if (value && value.constructor === Date) {
|
||||
return new Date(value.toISOString());
|
||||
} else if (value && typeof value === "object") {
|
||||
var clone = Ember.create(value), property;
|
||||
|
||||
for (property in value) {
|
||||
if (value.hasOwnProperty(property) && typeof value[property] === "object") {
|
||||
clone[property] = wrapObject(value[property]);
|
||||
}
|
||||
}
|
||||
return clone;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
Ember.Model.dataTypes = {};
|
||||
|
||||
Ember.Model.dataTypes[Date] = {
|
||||
deserialize: function(string) {
|
||||
if(!string) { return null; }
|
||||
return new Date(string);
|
||||
},
|
||||
serialize: function (date) {
|
||||
if(!date) { return null; }
|
||||
return date.toISOString();
|
||||
}
|
||||
};
|
||||
|
||||
Ember.Model.dataTypes[Number] = {
|
||||
deserialize: function(string) {
|
||||
if (!string && string !== 0) { return null; }
|
||||
return Number(string);
|
||||
},
|
||||
serialize: function (number) {
|
||||
if (!number && number !== 0) { return null; }
|
||||
return Number(number);
|
||||
}
|
||||
};
|
||||
|
||||
function deserialize(value, type) {
|
||||
if (type && type.deserialize) {
|
||||
return type.deserialize(value);
|
||||
} else if (type && Ember.Model.dataTypes[type]) {
|
||||
return Ember.Model.dataTypes[type].deserialize(value);
|
||||
} else {
|
||||
return wrapObject(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ember.attr = function(type) {
|
||||
return Ember.computed(function(key, value) {
|
||||
var data = get(this, 'data'),
|
||||
dataKey = this.dataKey(key),
|
||||
dataValue = data && get(data, dataKey),
|
||||
beingCreated = meta(this).proto === this;
|
||||
|
||||
if (arguments.length === 2) {
|
||||
if (beingCreated && !data) {
|
||||
data = {};
|
||||
set(this, 'data', data);
|
||||
data[dataKey] = value;
|
||||
}
|
||||
return wrapObject(value);
|
||||
}
|
||||
|
||||
return this.getAttr(key, deserialize(dataValue, type));
|
||||
}).property('data').meta({isAttribute: true, type: type});
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
|
||||
|
||||
(function() {
|
||||
var get = Ember.get;
|
||||
|
||||
Ember.RESTAdapter = Ember.Adapter.extend({
|
||||
find: function(record, id) {
|
||||
var url = this.buildURL(record.constructor, id),
|
||||
self = this;
|
||||
|
||||
return this.ajax(url).then(function(data) {
|
||||
self.didFind(record, id, data);
|
||||
});
|
||||
},
|
||||
|
||||
didFind: function(record, id, data) {
|
||||
var rootKey = get(record.constructor, 'rootKey'),
|
||||
dataToLoad = rootKey ? data[rootKey] : data;
|
||||
|
||||
record.load(id, dataToLoad);
|
||||
},
|
||||
|
||||
findAll: function(klass, records) {
|
||||
var url = this.buildURL(klass),
|
||||
self = this;
|
||||
|
||||
return this.ajax(url).then(function(data) {
|
||||
self.didFindAll(klass, records, data);
|
||||
});
|
||||
},
|
||||
|
||||
didFindAll: function(klass, records, data) {
|
||||
var collectionKey = get(klass, 'collectionKey'),
|
||||
dataToLoad = collectionKey ? data[collectionKey] : data;
|
||||
|
||||
records.load(klass, dataToLoad);
|
||||
},
|
||||
|
||||
findQuery: function(klass, records, params) {
|
||||
var url = this.buildURL(klass),
|
||||
self = this;
|
||||
|
||||
return this.ajax(url, params).then(function(data) {
|
||||
self.didFindQuery(klass, records, params, data);
|
||||
});
|
||||
},
|
||||
|
||||
didFindQuery: function(klass, records, params, data) {
|
||||
var collectionKey = get(klass, 'collectionKey'),
|
||||
dataToLoad = collectionKey ? data[collectionKey] : data;
|
||||
|
||||
records.load(klass, dataToLoad);
|
||||
},
|
||||
|
||||
createRecord: function(record) {
|
||||
var url = this.buildURL(record.constructor),
|
||||
self = this;
|
||||
|
||||
return this.ajax(url, record.toJSON(), "POST").then(function(data) {
|
||||
self.didCreateRecord(record, data);
|
||||
});
|
||||
},
|
||||
|
||||
didCreateRecord: function(record, data) {
|
||||
var rootKey = get(record.constructor, 'rootKey'),
|
||||
primaryKey = get(record.constructor, 'primaryKey'),
|
||||
dataToLoad = rootKey ? data[rootKey] : data;
|
||||
|
||||
record.load(dataToLoad[primaryKey], dataToLoad);
|
||||
record.didCreateRecord();
|
||||
},
|
||||
|
||||
saveRecord: function(record) {
|
||||
var primaryKey = get(record.constructor, 'primaryKey'),
|
||||
url = this.buildURL(record.constructor, get(record, primaryKey)),
|
||||
self = this;
|
||||
|
||||
return this.ajax(url, record.toJSON(), "PUT").then(function(data) { // TODO: Some APIs may or may not return data
|
||||
self.didSaveRecord(record, data);
|
||||
});
|
||||
},
|
||||
|
||||
didSaveRecord: function(record, data) {
|
||||
record.didSaveRecord();
|
||||
},
|
||||
|
||||
deleteRecord: function(record) {
|
||||
var primaryKey = get(record.constructor, 'primaryKey'),
|
||||
url = this.buildURL(record.constructor, get(record, primaryKey)),
|
||||
self = this;
|
||||
|
||||
return this.ajax(url, record.toJSON(), "DELETE").then(function(data) { // TODO: Some APIs may or may not return data
|
||||
self.didDeleteRecord(record, data);
|
||||
});
|
||||
},
|
||||
|
||||
didDeleteRecord: function(record, data) {
|
||||
record.didDeleteRecord();
|
||||
},
|
||||
|
||||
ajax: function(url, params, method) {
|
||||
return this._ajax(url, params, method || "GET");
|
||||
},
|
||||
|
||||
buildURL: function(klass, id) {
|
||||
var urlRoot = get(klass, 'url');
|
||||
if (!urlRoot) { throw new Error('Ember.RESTAdapter requires a `url` property to be specified'); }
|
||||
|
||||
if (id) {
|
||||
return urlRoot + "/" + id + ".json";
|
||||
} else {
|
||||
return urlRoot + ".json";
|
||||
}
|
||||
},
|
||||
|
||||
_ajax: function(url, params, method) {
|
||||
var settings = {
|
||||
url: url,
|
||||
type: method,
|
||||
dataType: "json"
|
||||
};
|
||||
|
||||
return new Ember.RSVP.Promise(function(resolve, reject) {
|
||||
if (params) {
|
||||
if (method === "GET") {
|
||||
settings.data = params;
|
||||
} else {
|
||||
settings.contentType = "application/json; charset=utf-8";
|
||||
settings.data = JSON.stringify(params);
|
||||
}
|
||||
}
|
||||
|
||||
settings.success = function(json) {
|
||||
Ember.run(null, resolve, json);
|
||||
};
|
||||
|
||||
settings.error = function(jqXHR, textStatus, errorThrown) {
|
||||
Ember.run(null, reject, jqXHR);
|
||||
};
|
||||
|
||||
|
||||
Ember.$.ajax(settings);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
return Ember;
|
||||
|
||||
});
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,368 +0,0 @@
|
|||
/*
|
||||
|
||||
Copyright (C) 2011 by Yehuda Katz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
define(function() {
|
||||
|
||||
// lib/handlebars/browser-prefix.js
|
||||
var Handlebars = {};
|
||||
window.Handlebars = Handlebars;
|
||||
(function(Handlebars, undefined) {
|
||||
;
|
||||
// lib/handlebars/base.js
|
||||
|
||||
Handlebars.VERSION = "1.0.0";
|
||||
Handlebars.COMPILER_REVISION = 4;
|
||||
|
||||
Handlebars.REVISION_CHANGES = {
|
||||
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
|
||||
2: '== 1.0.0-rc.3',
|
||||
3: '== 1.0.0-rc.4',
|
||||
4: '>= 1.0.0'
|
||||
};
|
||||
|
||||
Handlebars.helpers = {};
|
||||
Handlebars.partials = {};
|
||||
|
||||
var toString = Object.prototype.toString,
|
||||
functionType = '[object Function]',
|
||||
objectType = '[object Object]';
|
||||
|
||||
Handlebars.registerHelper = function(name, fn, inverse) {
|
||||
if (toString.call(name) === objectType) {
|
||||
if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
|
||||
Handlebars.Utils.extend(this.helpers, name);
|
||||
} else {
|
||||
if (inverse) { fn.not = inverse; }
|
||||
this.helpers[name] = fn;
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.registerPartial = function(name, str) {
|
||||
if (toString.call(name) === objectType) {
|
||||
Handlebars.Utils.extend(this.partials, name);
|
||||
} else {
|
||||
this.partials[name] = str;
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('helperMissing', function(arg) {
|
||||
if(arguments.length === 2) {
|
||||
return undefined;
|
||||
} else {
|
||||
throw new Error("Missing helper: '" + arg + "'");
|
||||
}
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('blockHelperMissing', function(context, options) {
|
||||
var inverse = options.inverse || function() {}, fn = options.fn;
|
||||
|
||||
var type = toString.call(context);
|
||||
|
||||
if(type === functionType) { context = context.call(this); }
|
||||
|
||||
if(context === true) {
|
||||
return fn(this);
|
||||
} else if(context === false || context == null) {
|
||||
return inverse(this);
|
||||
} else if(type === "[object Array]") {
|
||||
if(context.length > 0) {
|
||||
return Handlebars.helpers.each(context, options);
|
||||
} else {
|
||||
return inverse(this);
|
||||
}
|
||||
} else {
|
||||
return fn(context);
|
||||
}
|
||||
});
|
||||
|
||||
Handlebars.K = function() {};
|
||||
|
||||
Handlebars.createFrame = Object.create || function(object) {
|
||||
Handlebars.K.prototype = object;
|
||||
var obj = new Handlebars.K();
|
||||
Handlebars.K.prototype = null;
|
||||
return obj;
|
||||
};
|
||||
|
||||
Handlebars.logger = {
|
||||
DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
|
||||
|
||||
methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'},
|
||||
|
||||
// can be overridden in the host environment
|
||||
log: function(level, obj) {
|
||||
if (Handlebars.logger.level <= level) {
|
||||
var method = Handlebars.logger.methodMap[level];
|
||||
if (typeof console !== 'undefined' && console[method]) {
|
||||
console[method].call(console, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); };
|
||||
|
||||
Handlebars.registerHelper('each', function(context, options) {
|
||||
var fn = options.fn, inverse = options.inverse;
|
||||
var i = 0, ret = "", data;
|
||||
|
||||
var type = toString.call(context);
|
||||
if(type === functionType) { context = context.call(this); }
|
||||
|
||||
if (options.data) {
|
||||
data = Handlebars.createFrame(options.data);
|
||||
}
|
||||
|
||||
if(context && typeof context === 'object') {
|
||||
if(context instanceof Array){
|
||||
for(var j = context.length; i<j; i++) {
|
||||
if (data) { data.index = i; }
|
||||
ret = ret + fn(context[i], { data: data });
|
||||
}
|
||||
} else {
|
||||
for(var key in context) {
|
||||
if(context.hasOwnProperty(key)) {
|
||||
if(data) { data.key = key; }
|
||||
ret = ret + fn(context[key], {data: data});
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(i === 0){
|
||||
ret = inverse(this);
|
||||
}
|
||||
|
||||
return ret;
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('if', function(conditional, options) {
|
||||
var type = toString.call(conditional);
|
||||
if(type === functionType) { conditional = conditional.call(this); }
|
||||
|
||||
if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
|
||||
return options.inverse(this);
|
||||
} else {
|
||||
return options.fn(this);
|
||||
}
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('unless', function(conditional, options) {
|
||||
return Handlebars.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn});
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('with', function(context, options) {
|
||||
var type = toString.call(context);
|
||||
if(type === functionType) { context = context.call(this); }
|
||||
|
||||
if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('log', function(context, options) {
|
||||
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
|
||||
Handlebars.log(level, context);
|
||||
});
|
||||
;
|
||||
// lib/handlebars/utils.js
|
||||
|
||||
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
|
||||
|
||||
Handlebars.Exception = function(message) {
|
||||
var tmp = Error.prototype.constructor.apply(this, arguments);
|
||||
|
||||
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
|
||||
for (var idx = 0; idx < errorProps.length; idx++) {
|
||||
this[errorProps[idx]] = tmp[errorProps[idx]];
|
||||
}
|
||||
};
|
||||
Handlebars.Exception.prototype = new Error();
|
||||
|
||||
// Build out our basic SafeString type
|
||||
Handlebars.SafeString = function(string) {
|
||||
this.string = string;
|
||||
};
|
||||
Handlebars.SafeString.prototype.toString = function() {
|
||||
return this.string.toString();
|
||||
};
|
||||
|
||||
var escape = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
"`": "`"
|
||||
};
|
||||
|
||||
var badChars = /[&<>"'`]/g;
|
||||
var possible = /[&<>"'`]/;
|
||||
|
||||
var escapeChar = function(chr) {
|
||||
return escape[chr] || "&";
|
||||
};
|
||||
|
||||
Handlebars.Utils = {
|
||||
extend: function(obj, value) {
|
||||
for(var key in value) {
|
||||
if(value.hasOwnProperty(key)) {
|
||||
obj[key] = value[key];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
escapeExpression: function(string) {
|
||||
// don't escape SafeStrings, since they're already safe
|
||||
if (string instanceof Handlebars.SafeString) {
|
||||
return string.toString();
|
||||
} else if (string == null || string === false) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// Force a string conversion as this will be done by the append regardless and
|
||||
// the regex test will do this transparently behind the scenes, causing issues if
|
||||
// an object's to string has escaped characters in it.
|
||||
string = string.toString();
|
||||
|
||||
if(!possible.test(string)) { return string; }
|
||||
return string.replace(badChars, escapeChar);
|
||||
},
|
||||
|
||||
isEmpty: function(value) {
|
||||
if (!value && value !== 0) {
|
||||
return true;
|
||||
} else if(toString.call(value) === "[object Array]" && value.length === 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
;
|
||||
// lib/handlebars/runtime.js
|
||||
|
||||
Handlebars.VM = {
|
||||
template: function(templateSpec) {
|
||||
// Just add water
|
||||
var container = {
|
||||
escapeExpression: Handlebars.Utils.escapeExpression,
|
||||
invokePartial: Handlebars.VM.invokePartial,
|
||||
programs: [],
|
||||
program: function(i, fn, data) {
|
||||
var programWrapper = this.programs[i];
|
||||
if(data) {
|
||||
programWrapper = Handlebars.VM.program(i, fn, data);
|
||||
} else if (!programWrapper) {
|
||||
programWrapper = this.programs[i] = Handlebars.VM.program(i, fn);
|
||||
}
|
||||
return programWrapper;
|
||||
},
|
||||
merge: function(param, common) {
|
||||
var ret = param || common;
|
||||
|
||||
if (param && common) {
|
||||
ret = {};
|
||||
Handlebars.Utils.extend(ret, common);
|
||||
Handlebars.Utils.extend(ret, param);
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
programWithDepth: Handlebars.VM.programWithDepth,
|
||||
noop: Handlebars.VM.noop,
|
||||
compilerInfo: null
|
||||
};
|
||||
|
||||
return function(context, options) {
|
||||
options = options || {};
|
||||
var result = templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
|
||||
|
||||
var compilerInfo = container.compilerInfo || [],
|
||||
compilerRevision = compilerInfo[0] || 1,
|
||||
currentRevision = Handlebars.COMPILER_REVISION;
|
||||
|
||||
if (compilerRevision !== currentRevision) {
|
||||
if (compilerRevision < currentRevision) {
|
||||
var runtimeVersions = Handlebars.REVISION_CHANGES[currentRevision],
|
||||
compilerVersions = Handlebars.REVISION_CHANGES[compilerRevision];
|
||||
throw "Template was precompiled with an older version of Handlebars than the current runtime. "+
|
||||
"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").";
|
||||
} else {
|
||||
// Use the embedded version info since the runtime doesn't know about this revision yet
|
||||
throw "Template was precompiled with a newer version of Handlebars than the current runtime. "+
|
||||
"Please update your runtime to a newer version ("+compilerInfo[1]+").";
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
},
|
||||
|
||||
programWithDepth: function(i, fn, data /*, $depth */) {
|
||||
var args = Array.prototype.slice.call(arguments, 3);
|
||||
|
||||
var program = function(context, options) {
|
||||
options = options || {};
|
||||
|
||||
return fn.apply(this, [context, options.data || data].concat(args));
|
||||
};
|
||||
program.program = i;
|
||||
program.depth = args.length;
|
||||
return program;
|
||||
},
|
||||
program: function(i, fn, data) {
|
||||
var program = function(context, options) {
|
||||
options = options || {};
|
||||
|
||||
return fn(context, options.data || data);
|
||||
};
|
||||
program.program = i;
|
||||
program.depth = 0;
|
||||
return program;
|
||||
},
|
||||
noop: function() { return ""; },
|
||||
invokePartial: function(partial, name, context, helpers, partials, data) {
|
||||
var options = { helpers: helpers, partials: partials, data: data };
|
||||
|
||||
if(partial === undefined) {
|
||||
throw new Handlebars.Exception("The partial " + name + " could not be found");
|
||||
} else if(partial instanceof Function) {
|
||||
return partial(context, options);
|
||||
} else if (!Handlebars.compile) {
|
||||
throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
|
||||
} else {
|
||||
partials[name] = Handlebars.compile(partial, {data: data !== undefined});
|
||||
return partials[name](context, options);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.template = Handlebars.VM.template;
|
||||
;
|
||||
// lib/handlebars/browser-suffix.js
|
||||
})(Handlebars);
|
||||
;
|
||||
|
||||
return Handlebars;
|
||||
});
|
||||
|
|
@ -1,114 +0,0 @@
|
|||
/*!
|
||||
* ic-ajax
|
||||
*
|
||||
* - please see license at https://github.com/instructure/ember-ajax
|
||||
* - inspired by discourse ajax: https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/mixins/ajax.js#L19
|
||||
*/
|
||||
|
||||
;(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['ember'], function(Ember) { return factory(Ember); });
|
||||
} else if (typeof exports === 'object') {
|
||||
module.exports = factory(require('ember'));
|
||||
} else {
|
||||
root.ic = root.ic || {};
|
||||
root.ic.ajax = factory(Ember);
|
||||
}
|
||||
}(this, function(Ember) {
|
||||
|
||||
/*
|
||||
* jQuery.ajax wrapper, supports the same signature except providing
|
||||
* `success` and `error` handlers will throw an error (use promises
|
||||
* instead).
|
||||
*/
|
||||
|
||||
var ajax = function() {
|
||||
return makePromise(parseArgs.apply(null, arguments));
|
||||
};
|
||||
|
||||
/*
|
||||
* Defines a fixture that will be used instead of an actual ajax
|
||||
* request to a given url. This is useful for testing, allowing you to
|
||||
* stub out responses your application will send without requiring
|
||||
* libraries like sinon or mockjax, etc.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* ajax.defineFixture('/self', {
|
||||
* response: { firstName: 'Ryan', lastName: 'Florence' },
|
||||
* textStatus: 'success'
|
||||
* jqXHR: {}
|
||||
* });
|
||||
*
|
||||
* @param {String} url
|
||||
* @param {Object} fixture
|
||||
*/
|
||||
ajax.defineFixture = function(url, fixture) {
|
||||
ajax.FIXTURES = ajax.FIXTURES || {};
|
||||
ajax.FIXTURES[url] = fixture;
|
||||
};
|
||||
|
||||
/*
|
||||
* Looks up a fixture by url.
|
||||
*
|
||||
* @param {String} url
|
||||
*/
|
||||
|
||||
ajax.lookupFixture = function(url) {
|
||||
return ajax.FIXTURES && ajax.FIXTURES[url];
|
||||
};
|
||||
|
||||
function makePromise(settings) {
|
||||
return new Ember.RSVP.Promise(function(resolve, reject) {
|
||||
var fixture = ajax.lookupFixture(settings.url);
|
||||
if (fixture) {
|
||||
return resolve(fixture);
|
||||
}
|
||||
settings.success = makeSuccess(resolve, reject);
|
||||
settings.error = makeError(resolve, reject);
|
||||
Ember.$.ajax(settings);
|
||||
});
|
||||
};
|
||||
|
||||
function parseArgs() {
|
||||
var settings = {};
|
||||
if (arguments.length === 1) {
|
||||
if (typeof arguments[0] === "string") {
|
||||
settings.url = arguments[0];
|
||||
} else {
|
||||
settings = arguments[0];
|
||||
}
|
||||
} else if (arguments.length === 2) {
|
||||
settings = arguments[1];
|
||||
settings.url = arguments[0];
|
||||
}
|
||||
if (settings.success || settings.error) {
|
||||
throw new Error("ajax should use promises, received 'success' or 'error' callback");
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
function makeSuccess(resolve, reject) {
|
||||
return function(response, textStatus, jqXHR) {
|
||||
Ember.run(null, resolve, {
|
||||
response: response,
|
||||
textStatus: textStatus,
|
||||
jqXHR: jqXHR
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function makeError(resolve, reject) {
|
||||
return function(jqXHR, textStatus, errorThrown) {
|
||||
Ember.run(null, reject, {
|
||||
jqXHR: jqXHR,
|
||||
textStatus: textStatus,
|
||||
errorThrown: errorThrown
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return ajax;
|
||||
|
||||
}));
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
define(['ember'], function(Ember) {
|
||||
window.ic = window.ic || {};
|
||||
|
||||
ic.IcDialogTriggerComponent = Ember.Component.extend({
|
||||
|
||||
classNames: ['ic-dialog-trigger'],
|
||||
|
||||
click: Ember.aliasMethod('toggleDialog'),
|
||||
|
||||
toggleDialog: function() {
|
||||
var view;
|
||||
if (this.get('controls')) {
|
||||
view = Ember.View.views[this.get('controls')];
|
||||
} else {
|
||||
view = this.get('parentView');
|
||||
}
|
||||
view.toggleVisiblity(this.get('action'));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
window.ic = window.ic || {};
|
||||
|
||||
ic.IcDialogComponent = Ember.Component.extend({
|
||||
|
||||
classNames: ['ic-dialog'],
|
||||
|
||||
classNameBindings: [
|
||||
'is-open',
|
||||
'modal:ic-modal'
|
||||
],
|
||||
|
||||
modal: false,
|
||||
|
||||
click: function(event) {
|
||||
if (event.target === this.$('.ic-dialog-wrapper')[0]) {
|
||||
this.toggleVisiblity();
|
||||
}
|
||||
},
|
||||
|
||||
toggleVisiblity: function(action) {
|
||||
this.toggleProperty('is-open');
|
||||
if (this.get('is-open')) {
|
||||
this.sendAction('on-open');
|
||||
} else {
|
||||
this.sendAction('on-close', action);
|
||||
}
|
||||
},
|
||||
|
||||
position: function() {
|
||||
if (!this.get('is-open')) { return; }
|
||||
this.$('.ic-dialog-content').css({
|
||||
left: parseInt(this.calculateCenter('width'), 10),
|
||||
top: parseInt(this.calculateCenter('height'), 10)
|
||||
});
|
||||
}.observes('is-open').on('didInsertElement'),
|
||||
|
||||
calculateCenter: function(axis) {
|
||||
var capitalize = Ember.String.capitalize;
|
||||
var divisors = { height: 2.5, width: 2};
|
||||
var windowSize = window['inner'+capitalize(axis)] / divisors[axis];
|
||||
var elementSize = this.$('.ic-dialog-content')[axis]() / divisors[axis];
|
||||
return windowSize - elementSize;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Ember.Application.initializer({
|
||||
|
||||
name: 'ic-dialog',
|
||||
|
||||
initialize: function(container, application) {
|
||||
container.register('component:ic-dialog', ic.IcDialogComponent);
|
||||
container.register('component:ic-dialog-trigger', ic.IcDialogTriggerComponent);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Ember.TEMPLATES["components/ic-dialog-css"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
|
||||
|
||||
|
||||
data.buffer.push("<style>\n\n .ic-dialog {\n display: none;\n }\n\n .ic-dialog.is-open {\n display: block;\n }\n\n .ic-dialog-wrapper {\n position: fixed;\n z-index: 10000; /* yeah, 10,000 */\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n }\n\n .ic-modal > .ic-dialog-wrapper {\n background: rgba(0, 0, 0, 0.5);\n }\n\n .ic-dialog-content {\n background: #fff;\n position: absolute;\n width: 500px;\n }\n\n .ic-dialog-handle {\n position: absolute;\n bottom: 0;\n right: 0;\n }\n\n .ic-dialog-handle {\n width: 16px;\n height: 16px;\n border: 1px solid;\n border-bottom: none;\n border-right: none;\n background: #efefef;\n cursor: nwse-resize;\n }\n\n</style>\n");
|
||||
|
||||
});
|
||||
|
||||
Ember.TEMPLATES["components/ic-dialog-trigger"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
var buffer = '', hashTypes, hashContexts, escapeExpression=this.escapeExpression;
|
||||
|
||||
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "yield", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
||||
data.buffer.push("\n\n");
|
||||
return buffer;
|
||||
|
||||
});
|
||||
|
||||
Ember.TEMPLATES["components/ic-dialog"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
var buffer = '', stack1, hashTypes, hashContexts, escapeExpression=this.escapeExpression, self=this;
|
||||
|
||||
function program1(depth0,data) {
|
||||
|
||||
var buffer = '', hashTypes, hashContexts;
|
||||
data.buffer.push("\n ");
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "ic-dialog-drag-handle", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
||||
data.buffer.push("\n ");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
data.buffer.push("<div class=\"ic-dialog-wrapper\">\n <div class=\"ic-dialog-content\">\n ");
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "yield", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
||||
data.buffer.push("\n ");
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
stack1 = helpers['if'].call(depth0, "draggable", {hash:{},inverse:self.noop,fn:self.program(1, program1, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
||||
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
||||
data.buffer.push("\n </div>\n</div>\n\n");
|
||||
return buffer;
|
||||
|
||||
});
|
||||
return ic;
|
||||
});
|
|
@ -1,361 +0,0 @@
|
|||
define(['ember'], function(Ember) {
|
||||
window.ic = window.ic || {};
|
||||
|
||||
ic.MenuItemComponent = Ember.Component.extend({
|
||||
|
||||
tagName: 'ic-menu-item',
|
||||
|
||||
// classNames: 'ic-menu-item',
|
||||
|
||||
role: 'menuitem',
|
||||
|
||||
attributeBindings: ['tabindex'],
|
||||
|
||||
tabindex: -1,
|
||||
|
||||
focused: false,
|
||||
|
||||
click: function() {
|
||||
this.get('parentView').close();
|
||||
Ember.run.next(this, function() {
|
||||
this.get('parentView').focusTrigger();
|
||||
this.sendAction('on-select', this);
|
||||
});
|
||||
},
|
||||
|
||||
keyDown: function(event) {
|
||||
if (event.keyCode == 13 || event.keyCode == 32) {
|
||||
this.click();
|
||||
}
|
||||
},
|
||||
|
||||
register: function() {
|
||||
this.get('parentView').registerItem(this);
|
||||
}.on('didInsertElement'),
|
||||
|
||||
deregister: function() {
|
||||
this.get('parentView').deregisterItem(this);
|
||||
}.on('willDestroyElement'),
|
||||
|
||||
focus: function() {
|
||||
this.set('focused', true);
|
||||
this.$().focus();
|
||||
},
|
||||
|
||||
mouseEnter: function() {
|
||||
this.get('parentView').focusItem(this);
|
||||
},
|
||||
|
||||
blur: function() {
|
||||
this.set('focused', false);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
// See http://www.w3.org/WAI/GL/wiki/Using_ARIA_menus
|
||||
|
||||
window.ic = window.ic || {};
|
||||
|
||||
ic.MenuListComponent = Ember.Component.extend({
|
||||
|
||||
tagName: 'ul',
|
||||
|
||||
role: 'menu',
|
||||
|
||||
classNames: ['ic-menu-list'],
|
||||
|
||||
attributeBindings: [
|
||||
'ariaExpanded:aria-expanded',
|
||||
'tabindex'
|
||||
],
|
||||
|
||||
// so we can focus the menu manually and get "focusOut" to trigger without
|
||||
// putting the menu in the tab-o-sphere
|
||||
tabindex: -1,
|
||||
|
||||
isOpen: false,
|
||||
|
||||
ariaExpanded: function() {
|
||||
return this.get('isOpen')+''; // aria wants "true" and "false" as strings
|
||||
}.property('isOpen'),
|
||||
|
||||
focusedItem: null,
|
||||
|
||||
createItems: function() {
|
||||
this.set('items', Ember.ArrayProxy.create({content: []}));
|
||||
}.on('init'),
|
||||
|
||||
keyDown: function(event) {
|
||||
// TODO: refactor this, every time I use switch I regret it, and now the
|
||||
// preventDefaults are making me sad
|
||||
switch (event.keyCode) {
|
||||
case /*down*/ 40: event.preventDefault(); this.focusNext(); break;
|
||||
case /*up*/ 38: event.preventDefault(); this.focusPrevious(); break;
|
||||
case /*escape*/ 27: event.preventDefault(); this.focusTrigger(); break;
|
||||
}
|
||||
},
|
||||
|
||||
focusTrigger: function() {
|
||||
this.get('parentView.listTrigger').focus();
|
||||
},
|
||||
|
||||
focusNext: function() {
|
||||
var index = 0;
|
||||
var items = this.get('items');
|
||||
var focusedItem = this.get('focusedItem');
|
||||
if (focusedItem) {
|
||||
index = items.indexOf(focusedItem) + 1;
|
||||
}
|
||||
if (index === items.get('length')) {
|
||||
index = 0; // loop it
|
||||
}
|
||||
this.focusItemAtIndex(index);
|
||||
},
|
||||
|
||||
focusPrevious: function() {
|
||||
var items = this.get('items');
|
||||
var index = items.get('length') - 1;
|
||||
var focusedItem = this.get('focusedItem');
|
||||
if (focusedItem) {
|
||||
index = items.indexOf(focusedItem) - 1;
|
||||
}
|
||||
if (index == -1) {
|
||||
index = items.get('length') - 1; // loop it
|
||||
}
|
||||
this.focusItemAtIndex(index);
|
||||
},
|
||||
|
||||
focusItemAtIndex: function(index) {
|
||||
var item = this.get('items').objectAt(index);
|
||||
this.focusItem(item);
|
||||
},
|
||||
|
||||
focusItem: function(item) {
|
||||
var focusedItem = this.get('focusedItem');
|
||||
if (focusedItem) focusedItem.blur();
|
||||
this.set('focusedItem', item);
|
||||
item.focus();
|
||||
},
|
||||
|
||||
registerItem: function(item) {
|
||||
this.get('items').addObject(item);
|
||||
},
|
||||
|
||||
deregisterItem: function(item) {
|
||||
this.get('items').removeObject(item);
|
||||
},
|
||||
|
||||
open: function() {
|
||||
this.set('isOpen', true);
|
||||
},
|
||||
|
||||
close: function() {
|
||||
this.set('isOpen', false);
|
||||
this.set('focusedItem', null);
|
||||
},
|
||||
|
||||
focusFirstItemOnOpen: function() {
|
||||
if (!this.get('isOpen')) return;
|
||||
// wait for dom repaint so we can actually focus items
|
||||
Ember.run.next(this, function() {
|
||||
if (this.get('parentView.listTrigger.lastClickEventWasMouse')) {
|
||||
// focus the list then keyboard navigation still works, but the first
|
||||
// item isn't strangely selected
|
||||
this.$().focus();
|
||||
} else {
|
||||
// select first item for keyboard navigation
|
||||
this.focusItemAtIndex(0);
|
||||
}
|
||||
});
|
||||
}.observes('isOpen'),
|
||||
|
||||
registerWithParent: function() {
|
||||
this.get('parentView').registerList(this);
|
||||
}.on('didInsertElement'),
|
||||
|
||||
focusOut: function(event) {
|
||||
// wait for activeElement to get set (I think?)
|
||||
Ember.run.next(this, function() {
|
||||
if (!this.$().has(document.activeElement).length) {
|
||||
this.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
window.ic = window.ic || {};
|
||||
|
||||
ic.MenuTriggerComponent = Ember.Component.extend({
|
||||
|
||||
tagName: 'button',
|
||||
|
||||
classNames: 'ic-menu-trigger',
|
||||
|
||||
attributeBindings: [
|
||||
'ariaOwns:aria-owns',
|
||||
'ariaHaspopup:aria-haspopup'
|
||||
],
|
||||
|
||||
ariaHaspopup: 'true',
|
||||
|
||||
ariaOwns: function() {
|
||||
return this.get('parentView.list.elementId');
|
||||
}.property('parentView.list'),
|
||||
|
||||
mouseDown: function() {
|
||||
if (!this.get('parentView.list.isOpen')) return;
|
||||
// MenuList::focusOut handles outerclick/outerfocus, mousedown on the
|
||||
// trigger will close an already open list, then the click finishes after
|
||||
// and would reopen the list, so we have this temporary property to deal
|
||||
// with it.
|
||||
this.closingClickStarted = true;
|
||||
},
|
||||
|
||||
keyDown: function(event) {
|
||||
switch (event.keyCode) {
|
||||
case 40 /*down*/:
|
||||
case 38 /*up*/: this.openList(event); break;
|
||||
}
|
||||
},
|
||||
|
||||
openList: function(event) {
|
||||
event.preventDefault();
|
||||
// I have no idea how reliable this is, but it seems good enough
|
||||
this.set('lastClickEventWasMouse', event.clientX > 0 && event.clientY > 0);
|
||||
if (this.closingClickStarted) {
|
||||
return this.closingClickStarted = false;
|
||||
}
|
||||
this.get('parentView').openList();
|
||||
},
|
||||
|
||||
click: Ember.aliasMethod('openList'),
|
||||
|
||||
registerWithParent: function() {
|
||||
this.get('parentView').registerTrigger(this);
|
||||
}.on('didInsertElement'),
|
||||
|
||||
focus: function() {
|
||||
this.$().focus();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
window.ic = window.ic || {};
|
||||
|
||||
ic.MenuComponent = Ember.Component.extend({
|
||||
|
||||
tagName: 'ic-menu',
|
||||
|
||||
classNames: 'ic-menu',
|
||||
|
||||
classNameBindings: ['isOpen:is-open:is-closed'],
|
||||
|
||||
list: null,
|
||||
|
||||
listTrigger: null,
|
||||
|
||||
isOpen: function() {
|
||||
return this.get('list.isOpen');
|
||||
}.property('list.isOpen'),
|
||||
|
||||
registerList: function(list) {
|
||||
this.set('list', list);
|
||||
},
|
||||
|
||||
registerTrigger: function(trigger) {
|
||||
this.set('listTrigger', trigger);
|
||||
},
|
||||
|
||||
openList: function() {
|
||||
this.get('list').open();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Ember.Application.initializer({
|
||||
|
||||
name: 'ic-menu',
|
||||
|
||||
initialize: function(container, application) {
|
||||
application.IcMenuItemComponent = ic.MenuItemComponent;
|
||||
application.IcMenuListComponent = ic.MenuListComponent;
|
||||
application.IcMenuTriggerComponent = ic.MenuTriggerComponent;
|
||||
application.IcMenuComponent = ic.MenuComponent;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Ember.TEMPLATES["components/ic-menu-css"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
|
||||
|
||||
|
||||
data.buffer.push("<style>\n.ic-menu-list {\n position: absolute;\n display: none;\n}\n\n.ic-menu-list[aria-expanded=\"true\"] {\n display: block;\n}\n\n.ic-menu-list {\n outline: none;\n background: #fff;\n border: 1px solid #aaa;\n border-radius: 3px;\n box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.25);\n list-style-type: none;\n padding: 2px 0px;\n font-family: \"Lucida Grande\", \"Arial\", sans-serif;\n font-size: 12px;\n}\n\n.ic-menu-item {\n padding: 4px 20px;\n cursor: default;\n white-space: nowrap;\n}\n\n.ic-menu-item:focus {\n background: #3879D9;\n color: #fff;\n outline: none;\n}\n</style>\n\n");
|
||||
|
||||
});
|
||||
|
||||
Ember.TEMPLATES["components/ic-menu-item"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
var buffer = '', hashTypes, hashContexts, escapeExpression=this.escapeExpression;
|
||||
|
||||
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "yield", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
||||
data.buffer.push("\n");
|
||||
return buffer;
|
||||
|
||||
});
|
||||
|
||||
Ember.TEMPLATES["components/ic-menu-list"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
var buffer = '', hashTypes, hashContexts, escapeExpression=this.escapeExpression;
|
||||
|
||||
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "yield", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
||||
data.buffer.push("\n");
|
||||
return buffer;
|
||||
|
||||
});
|
||||
|
||||
Ember.TEMPLATES["components/ic-menu-trigger"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
var buffer = '', hashTypes, hashContexts, escapeExpression=this.escapeExpression;
|
||||
|
||||
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "yield", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
||||
data.buffer.push("\n\n");
|
||||
return buffer;
|
||||
|
||||
});
|
||||
|
||||
Ember.TEMPLATES["components/ic-menu"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
||||
this.compilerInfo = [4,'>= 1.0.0'];
|
||||
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
||||
var buffer = '', hashTypes, hashContexts, escapeExpression=this.escapeExpression;
|
||||
|
||||
|
||||
hashTypes = {};
|
||||
hashContexts = {};
|
||||
data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0, "yield", {hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
||||
data.buffer.push("\n");
|
||||
return buffer;
|
||||
|
||||
});
|
||||
return ic;
|
||||
});
|
||||
|
Loading…
Reference in New Issue