Update Ember
This commit is contained in:
parent
b1edd8e510
commit
ab97ca0e78
313
assets/scripts/vendor/ember.js
vendored
313
assets/scripts/vendor/ember.js
vendored
|
@ -1,5 +1,5 @@
|
||||||
// Version: v1.0.0-rc.1-134-gf13ef4c
|
// Version: v1.0.0-rc.1-178-g7fdc957
|
||||||
// Last commit: f13ef4c (2013-03-08 16:46:38 +0100)
|
// Last commit: 7fdc957 (2013-03-12 23:56:02 +0100)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -150,8 +150,8 @@ Ember.deprecateFunc = function(message, func) {
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Version: v1.0.0-rc.1-134-gf13ef4c
|
// Version: v1.0.0-rc.1-178-g7fdc957
|
||||||
// Last commit: f13ef4c (2013-03-08 16:46:38 +0100)
|
// Last commit: 7fdc957 (2013-03-12 23:56:02 +0100)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -1876,7 +1876,7 @@ var FIRST_KEY = /^([^\.\*]+)/;
|
||||||
// ..........................................................
|
// ..........................................................
|
||||||
// GET AND SET
|
// GET AND SET
|
||||||
//
|
//
|
||||||
// If we are on a platform that supports accessors we can get use those.
|
// If we are on a platform that supports accessors we can use those.
|
||||||
// Otherwise simulate accessors by looking up the property directly on the
|
// Otherwise simulate accessors by looking up the property directly on the
|
||||||
// object.
|
// object.
|
||||||
|
|
||||||
|
@ -2180,11 +2180,8 @@ Ember.isGlobalPath = function(path) {
|
||||||
@module ember-metal
|
@module ember-metal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var GUID_KEY = Ember.GUID_KEY,
|
var META_KEY = Ember.META_KEY,
|
||||||
META_KEY = Ember.META_KEY,
|
|
||||||
EMPTY_META = Ember.EMPTY_META,
|
|
||||||
metaFor = Ember.meta,
|
metaFor = Ember.meta,
|
||||||
o_create = Ember.create,
|
|
||||||
objectDefineProperty = Ember.platform.defineProperty;
|
objectDefineProperty = Ember.platform.defineProperty;
|
||||||
|
|
||||||
var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
|
var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
|
||||||
|
@ -2604,7 +2601,6 @@ var guidFor = Ember.guidFor, // utils.js
|
||||||
META_KEY = Ember.META_KEY, // utils.js
|
META_KEY = Ember.META_KEY, // utils.js
|
||||||
// circular reference observer depends on Ember.watch
|
// circular reference observer depends on Ember.watch
|
||||||
// we should move change events to this file or its own property_events.js
|
// we should move change events to this file or its own property_events.js
|
||||||
notifyObservers = Ember.notifyObservers, // observer.js
|
|
||||||
forEach = Ember.ArrayPolyfills.forEach, // array.js
|
forEach = Ember.ArrayPolyfills.forEach, // array.js
|
||||||
FIRST_KEY = /^([^\.\*]+)/,
|
FIRST_KEY = /^([^\.\*]+)/,
|
||||||
IS_PATH = /[\.\*]/;
|
IS_PATH = /[\.\*]/;
|
||||||
|
@ -3144,7 +3140,7 @@ Ember.finishChains = function(obj) {
|
||||||
@param {String} keyName The property key (or path) that will change.
|
@param {String} keyName The property key (or path) that will change.
|
||||||
@return {void}
|
@return {void}
|
||||||
*/
|
*/
|
||||||
function propertyWillChange(obj, keyName, value) {
|
function propertyWillChange(obj, keyName) {
|
||||||
var m = metaFor(obj, false),
|
var m = metaFor(obj, false),
|
||||||
watching = m.watching[keyName] > 0 || keyName === 'length',
|
watching = m.watching[keyName] > 0 || keyName === 'length',
|
||||||
proto = m.proto,
|
proto = m.proto,
|
||||||
|
@ -3252,7 +3248,6 @@ Ember.warn("The CP_DEFAULT_CACHEABLE flag has been removed and computed properti
|
||||||
var get = Ember.get,
|
var get = Ember.get,
|
||||||
set = Ember.set,
|
set = Ember.set,
|
||||||
metaFor = Ember.meta,
|
metaFor = Ember.meta,
|
||||||
guidFor = Ember.guidFor,
|
|
||||||
a_slice = [].slice,
|
a_slice = [].slice,
|
||||||
o_create = Ember.create,
|
o_create = Ember.create,
|
||||||
META_KEY = Ember.META_KEY,
|
META_KEY = Ember.META_KEY,
|
||||||
|
@ -3288,20 +3283,8 @@ function keysForDep(obj, depsMeta, depKey) {
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return obj[META_KEY].deps */
|
|
||||||
function metaForDeps(obj, meta) {
|
function metaForDeps(obj, meta) {
|
||||||
var deps = meta.deps;
|
return keysForDep(obj, meta, 'deps');
|
||||||
// If the current object has no dependencies...
|
|
||||||
if (!deps) {
|
|
||||||
// initialize the dependencies with a pointer back to
|
|
||||||
// the current object
|
|
||||||
deps = meta.deps = {};
|
|
||||||
} else if (!meta.hasOwnProperty('deps')) {
|
|
||||||
// otherwise if the dependencies are inherited from the
|
|
||||||
// object's superclass, clone the deps
|
|
||||||
deps = meta.deps = o_create(deps);
|
|
||||||
}
|
|
||||||
return deps;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addDependentKeys(desc, obj, keyName, meta) {
|
function addDependentKeys(desc, obj, keyName, meta) {
|
||||||
|
@ -3729,7 +3712,6 @@ Ember.computed.alias = function(dependentKey) {
|
||||||
|
|
||||||
var o_create = Ember.create,
|
var o_create = Ember.create,
|
||||||
metaFor = Ember.meta,
|
metaFor = Ember.meta,
|
||||||
metaPath = Ember.metaPath,
|
|
||||||
META_KEY = Ember.META_KEY;
|
META_KEY = Ember.META_KEY;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4318,8 +4300,7 @@ Ember.RunLoop = RunLoop;
|
||||||
@return {Object} return value from invoking the passed function.
|
@return {Object} return value from invoking the passed function.
|
||||||
*/
|
*/
|
||||||
Ember.run = function(target, method) {
|
Ember.run = function(target, method) {
|
||||||
var loop,
|
var args = arguments;
|
||||||
args = arguments;
|
|
||||||
run.begin();
|
run.begin();
|
||||||
|
|
||||||
function tryable() {
|
function tryable() {
|
||||||
|
@ -5200,7 +5181,6 @@ var Mixin, REQUIRED, Alias,
|
||||||
a_indexOf = Ember.ArrayPolyfills.indexOf,
|
a_indexOf = Ember.ArrayPolyfills.indexOf,
|
||||||
a_forEach = Ember.ArrayPolyfills.forEach,
|
a_forEach = Ember.ArrayPolyfills.forEach,
|
||||||
a_slice = [].slice,
|
a_slice = [].slice,
|
||||||
EMPTY_META = {}, // dummy for non-writable meta
|
|
||||||
o_create = Ember.create,
|
o_create = Ember.create,
|
||||||
defineProperty = Ember.defineProperty,
|
defineProperty = Ember.defineProperty,
|
||||||
guidFor = Ember.guidFor;
|
guidFor = Ember.guidFor;
|
||||||
|
@ -7407,8 +7387,7 @@ function iter(key, value) {
|
||||||
@extends Ember.Mixin
|
@extends Ember.Mixin
|
||||||
@since Ember 0.9
|
@since Ember 0.9
|
||||||
*/
|
*/
|
||||||
Ember.Enumerable = Ember.Mixin.create(
|
Ember.Enumerable = Ember.Mixin.create({
|
||||||
/** @scope Ember.Enumerable.prototype */ {
|
|
||||||
|
|
||||||
// compatibility
|
// compatibility
|
||||||
isEnumerable: true,
|
isEnumerable: true,
|
||||||
|
@ -8355,6 +8334,10 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
||||||
var length = get(this, 'length') ;
|
var length = get(this, 'length') ;
|
||||||
if (none(beginIndex)) beginIndex = 0 ;
|
if (none(beginIndex)) beginIndex = 0 ;
|
||||||
if (none(endIndex) || (endIndex > length)) endIndex = length ;
|
if (none(endIndex) || (endIndex > length)) endIndex = length ;
|
||||||
|
|
||||||
|
if (beginIndex < 0) beginIndex = length + beginIndex;
|
||||||
|
if (endIndex < 0) endIndex = length + endIndex;
|
||||||
|
|
||||||
while(beginIndex < endIndex) {
|
while(beginIndex < endIndex) {
|
||||||
ret[ret.length] = this.objectAt(beginIndex++) ;
|
ret[ret.length] = this.objectAt(beginIndex++) ;
|
||||||
}
|
}
|
||||||
|
@ -8871,8 +8854,7 @@ var forEach = Ember.EnumerableUtils.forEach;
|
||||||
@extends Ember.Mixin
|
@extends Ember.Mixin
|
||||||
@uses Ember.Enumerable
|
@uses Ember.Enumerable
|
||||||
*/
|
*/
|
||||||
Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable,
|
Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable, {
|
||||||
/** @scope Ember.MutableEnumerable.prototype */ {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
__Required.__ You must implement this method to apply this mixin.
|
__Required.__ You must implement this method to apply this mixin.
|
||||||
|
@ -9851,6 +9833,16 @@ Ember.TargetActionSupport = Ember.Mixin.create({
|
||||||
// outputs: 'Our person has greeted'
|
// outputs: 'Our person has greeted'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also chain multiple event subscriptions:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
person.on('greet', function() {
|
||||||
|
console.log('Our person has greeted');
|
||||||
|
}).one('greet', function() {
|
||||||
|
console.log('Offer one-time special');
|
||||||
|
}).off('event', this, forgetThis);
|
||||||
|
```
|
||||||
|
|
||||||
@class Evented
|
@class Evented
|
||||||
@namespace Ember
|
@namespace Ember
|
||||||
@extends Ember.Mixin
|
@extends Ember.Mixin
|
||||||
|
@ -9878,6 +9870,7 @@ Ember.Evented = Ember.Mixin.create({
|
||||||
*/
|
*/
|
||||||
on: function(name, target, method) {
|
on: function(name, target, method) {
|
||||||
Ember.addListener(this, name, target, method);
|
Ember.addListener(this, name, target, method);
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9901,6 +9894,7 @@ Ember.Evented = Ember.Mixin.create({
|
||||||
}
|
}
|
||||||
|
|
||||||
Ember.addListener(this, name, target, method, true);
|
Ember.addListener(this, name, target, method, true);
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9944,6 +9938,7 @@ Ember.Evented = Ember.Mixin.create({
|
||||||
*/
|
*/
|
||||||
off: function(name, target, method) {
|
off: function(name, target, method) {
|
||||||
Ember.removeListener(this, name, target, method);
|
Ember.removeListener(this, name, target, method);
|
||||||
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11251,6 +11246,8 @@ Ember.Application = Ember.Namespace.extend();
|
||||||
@submodule ember-runtime
|
@submodule ember-runtime
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var OUT_OF_RANGE_EXCEPTION = "Index out of range";
|
||||||
|
var EMPTY = [];
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set;
|
var get = Ember.get, set = Ember.set;
|
||||||
|
|
||||||
|
@ -11456,12 +11453,100 @@ Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
|
||||||
// No dependencies since Enumerable notifies length of change
|
// No dependencies since Enumerable notifies length of change
|
||||||
}),
|
}),
|
||||||
|
|
||||||
replace: function(idx, amt, objects) {
|
_replace: function(idx, amt, objects) {
|
||||||
Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', this.get('content'));
|
var content = get(this, 'content');
|
||||||
if (get(this, 'content')) this.replaceContent(idx, amt, objects);
|
Ember.assert('The content property of '+ this.constructor + ' should be set before modifying it', content);
|
||||||
|
if (content) this.replaceContent(idx, amt, objects);
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
replace: function() {
|
||||||
|
if (get(this, 'arrangedContent') === get(this, 'content')) {
|
||||||
|
this._replace.apply(this, arguments);
|
||||||
|
} else {
|
||||||
|
throw new Ember.Error("Using replace on an arranged ArrayProxy is not allowed.");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_insertAt: function(idx, object) {
|
||||||
|
var content = this.get('content');
|
||||||
|
if (idx > get(this, 'content.length')) throw new Error(OUT_OF_RANGE_EXCEPTION);
|
||||||
|
this._replace(idx, 0, [object]);
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
insertAt: function(idx, object) {
|
||||||
|
if (get(this, 'arrangedContent') === get(this, 'content')) {
|
||||||
|
return this._insertAt(idx, object);
|
||||||
|
} else {
|
||||||
|
throw new Ember.Error("Using insertAt on an arranged ArrayProxy is not allowed.");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
removeAt: function(start, len) {
|
||||||
|
if ('number' === typeof start) {
|
||||||
|
var content = get(this, 'content'),
|
||||||
|
arrangedContent = get(this, 'arrangedContent'),
|
||||||
|
indices = [], i;
|
||||||
|
|
||||||
|
if ((start < 0) || (start >= get(this, 'length'))) {
|
||||||
|
throw new Error(OUT_OF_RANGE_EXCEPTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len === undefined) len = 1;
|
||||||
|
|
||||||
|
// Get a list of indices in original content to remove
|
||||||
|
for (i=start; i<start+len; i++) {
|
||||||
|
// Use arrangedContent here so we avoid confusion with objects transformed by objectAtContent
|
||||||
|
indices.push(content.indexOf(arrangedContent.objectAt(i)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace in reverse order since indices will change
|
||||||
|
indices.sort(function(a,b) { return b - a; });
|
||||||
|
|
||||||
|
Ember.beginPropertyChanges();
|
||||||
|
for (i=0; i<indices.length; i++) {
|
||||||
|
this._replace(indices[i], 1, EMPTY);
|
||||||
|
}
|
||||||
|
Ember.endPropertyChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
return this ;
|
||||||
|
},
|
||||||
|
|
||||||
|
pushObject: function(obj) {
|
||||||
|
this._insertAt(get(this, 'content.length'), obj) ;
|
||||||
|
return obj ;
|
||||||
|
},
|
||||||
|
|
||||||
|
pushObjects: function(objects) {
|
||||||
|
this._replace(get(this, 'length'), 0, objects);
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
setObjects: function(objects) {
|
||||||
|
if (objects.length === 0) return this.clear();
|
||||||
|
|
||||||
|
var len = get(this, 'length');
|
||||||
|
this._replace(0, len, objects);
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
unshiftObject: function(obj) {
|
||||||
|
this._insertAt(0, obj) ;
|
||||||
|
return obj ;
|
||||||
|
},
|
||||||
|
|
||||||
|
unshiftObjects: function(objects) {
|
||||||
|
this._replace(0, 0, objects);
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
slice: function() {
|
||||||
|
var arr = this.toArray();
|
||||||
|
return arr.slice.apply(arr, arguments);
|
||||||
|
},
|
||||||
|
|
||||||
arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {
|
arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {
|
||||||
this.arrayContentWillChange(idx, removedCnt, addedCnt);
|
this.arrayContentWillChange(idx, removedCnt, addedCnt);
|
||||||
},
|
},
|
||||||
|
@ -12855,11 +12940,6 @@ Ember.ViewUtils = {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set;
|
var get = Ember.get, set = Ember.set;
|
||||||
var indexOf = Ember.ArrayPolyfills.indexOf;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var ClassSet = function() {
|
var ClassSet = function() {
|
||||||
this.seen = {};
|
this.seen = {};
|
||||||
|
@ -13630,9 +13710,8 @@ var states = {};
|
||||||
@submodule ember-views
|
@submodule ember-views
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set, addObserver = Ember.addObserver, removeObserver = Ember.removeObserver;
|
var get = Ember.get, set = Ember.set;
|
||||||
var meta = Ember.meta, guidFor = Ember.guidFor, fmt = Ember.String.fmt;
|
var guidFor = Ember.guidFor;
|
||||||
var a_slice = [].slice;
|
|
||||||
var a_forEach = Ember.EnumerableUtils.forEach;
|
var a_forEach = Ember.EnumerableUtils.forEach;
|
||||||
var a_addObject = Ember.EnumerableUtils.addObject;
|
var a_addObject = Ember.EnumerableUtils.addObject;
|
||||||
|
|
||||||
|
@ -16123,7 +16202,7 @@ Ember.merge(preRender, {
|
||||||
@submodule ember-views
|
@submodule ember-views
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set, meta = Ember.meta;
|
var get = Ember.get, set = Ember.set;
|
||||||
|
|
||||||
var inBuffer = Ember.View.states.inBuffer = Ember.create(Ember.View.states._default);
|
var inBuffer = Ember.View.states.inBuffer = Ember.create(Ember.View.states._default);
|
||||||
|
|
||||||
|
@ -16211,7 +16290,7 @@ Ember.merge(inBuffer, {
|
||||||
@submodule ember-views
|
@submodule ember-views
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set, meta = Ember.meta;
|
var get = Ember.get, set = Ember.set;
|
||||||
|
|
||||||
var hasElement = Ember.View.states.hasElement = Ember.create(Ember.View.states._default);
|
var hasElement = Ember.View.states.hasElement = Ember.create(Ember.View.states._default);
|
||||||
|
|
||||||
|
@ -16378,7 +16457,7 @@ var states = Ember.View.cloneStates(Ember.View.states);
|
||||||
@submodule ember-views
|
@submodule ember-views
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set, meta = Ember.meta;
|
var get = Ember.get, set = Ember.set;
|
||||||
var forEach = Ember.EnumerableUtils.forEach;
|
var forEach = Ember.EnumerableUtils.forEach;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17612,7 +17691,7 @@ define("metamorph",
|
||||||
(function() {
|
(function() {
|
||||||
/**
|
/**
|
||||||
@module ember
|
@module ember
|
||||||
@submodule ember-handlebars
|
@submodule ember-handlebars-compiler
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Eliminate dependency on any Ember to simplify precompilation workflow
|
// Eliminate dependency on any Ember to simplify precompilation workflow
|
||||||
|
@ -18360,6 +18439,7 @@ Ember._Metamorph = Ember.Mixin.create({
|
||||||
init: function() {
|
init: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.morph = Metamorph();
|
this.morph = Metamorph();
|
||||||
|
Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated. You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeRender: function(buffer) {
|
beforeRender: function(buffer) {
|
||||||
|
@ -20405,6 +20485,41 @@ Ember.Handlebars.registerHelper('template', function(name, options) {
|
||||||
Ember.TEMPLATES[name](this, { data: options.data });
|
Ember.TEMPLATES[name](this, { data: options.data });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
/**
|
||||||
|
@module ember
|
||||||
|
@submodule ember-handlebars
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
`partial` renders a template directly using the current context.
|
||||||
|
If needed the context can be set using the `{{#with foo}}` helper.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="text/x-handlebars" data-template-name="header_bar">
|
||||||
|
{{#with currentUser}}
|
||||||
|
{{partial user_info}}
|
||||||
|
{{/with}}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
The `data-template-name` attribute of a partial template
|
||||||
|
is prefixed with an underscore.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script type="text/x-handlebars" data-template-name="_user_info">
|
||||||
|
<span>Hello {{username}}!</span>
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
@method partial
|
||||||
|
@for Ember.Handlebars.helpers
|
||||||
|
@param {String} partialName the name of the template to render minus the leading underscore
|
||||||
|
*/
|
||||||
|
|
||||||
Ember.Handlebars.registerHelper('partial', function(name, options) {
|
Ember.Handlebars.registerHelper('partial', function(name, options) {
|
||||||
var nameParts = name.split("/"),
|
var nameParts = name.split("/"),
|
||||||
lastPart = nameParts[nameParts.length - 1];
|
lastPart = nameParts[nameParts.length - 1];
|
||||||
|
@ -22911,7 +23026,7 @@ Ember.generateController = function(container, controllerName, context) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var Router = requireModule("router");
|
var Router = requireModule("router");
|
||||||
var get = Ember.get, set = Ember.set, classify = Ember.String.classify;
|
var get = Ember.get, set = Ember.set;
|
||||||
|
|
||||||
var DefaultView = Ember._MetamorphView;
|
var DefaultView = Ember._MetamorphView;
|
||||||
function setupLocation(router) {
|
function setupLocation(router) {
|
||||||
|
@ -23171,8 +23286,7 @@ Ember.Router.reopenClass({
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set,
|
var get = Ember.get, set = Ember.set,
|
||||||
classify = Ember.String.classify,
|
classify = Ember.String.classify;
|
||||||
decamelize = Ember.String.decamelize;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The `Ember.Route` class is used to define individual routes. Refer to
|
The `Ember.Route` class is used to define individual routes. Refer to
|
||||||
|
@ -23921,42 +24035,52 @@ var get = Ember.get, set = Ember.set;
|
||||||
Ember.onLoad('Ember.Handlebars', function(Handlebars) {
|
Ember.onLoad('Ember.Handlebars', function(Handlebars) {
|
||||||
/**
|
/**
|
||||||
@module ember
|
@module ember
|
||||||
@submodule ember-handlebars
|
@submodule ember-routing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);
|
Handlebars.OutletView = Ember.ContainerView.extend(Ember._Metamorph);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The `outlet` helper allows you to specify that the current
|
The `outlet` helper is a placeholder that the router will fill in with
|
||||||
view's controller will fill in the view for a given area.
|
the appropriate template based on the current state of the application.
|
||||||
|
|
||||||
``` handlebars
|
``` handlebars
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, when the the current controller's `view` property changes, the
|
By default, a template based on Ember's naming conventions will be rendered
|
||||||
outlet will replace its current view with the new view. You can set the
|
into the `outlet` (e.g. `App.PostsRoute` will render the `posts` template).
|
||||||
`view` property directly, but it's normally best to use `connectOutlet`.
|
|
||||||
|
You can render a different template by using the `render()` method in the
|
||||||
|
route's `renderTemplate` hook. The following will render the `favoritePost`
|
||||||
|
template into the `outlet`.
|
||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
# Instantiate App.PostsView and assign to `view`, so as to render into outlet.
|
App.PostsRoute = Ember.Route.extend({
|
||||||
controller.connectOutlet('posts');
|
renderTemplate: function() {
|
||||||
|
this.render('favoritePost');
|
||||||
|
}
|
||||||
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also specify a particular name other than `view`:
|
You can create custom named outlets for more control.
|
||||||
|
|
||||||
``` handlebars
|
``` handlebars
|
||||||
{{outlet masterView}}
|
{{outlet favoritePost}}
|
||||||
{{outlet detailView}}
|
{{outlet posts}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, you can control several outlets from a single controller.
|
Then you can define what template is rendered into each outlet in your
|
||||||
|
route.
|
||||||
|
|
||||||
|
|
||||||
``` javascript
|
``` javascript
|
||||||
# Instantiate App.PostsView and assign to controller.masterView.
|
App.PostsRoute = Ember.Route.extend({
|
||||||
controller.connectOutlet('masterView', 'posts');
|
renderTemplate: function() {
|
||||||
# Also, instantiate App.PostInfoView and assign to controller.detailView.
|
this.render('favoritePost', { outlet: 'favoritePost' });
|
||||||
controller.connectOutlet('detailView', 'postInfo');
|
this.render('posts', { outlet: 'posts' });
|
||||||
|
}
|
||||||
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@method outlet
|
@method outlet
|
||||||
|
@ -24103,13 +24227,32 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
|
||||||
registeredActions: {}
|
registeredActions: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
ActionHelper.registerAction = function(actionName, options) {
|
var keys = ["alt", "shift", "meta", "ctrl"];
|
||||||
|
|
||||||
|
var isAllowedClick = function(event, allowedKeys) {
|
||||||
|
if (typeof allowedKeys === "undefined") {
|
||||||
|
return isSimpleClick(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
var allowed = true;
|
||||||
|
|
||||||
|
keys.forEach(function(key) {
|
||||||
|
if (event[key + "Key"] && allowedKeys.indexOf(key) === -1) {
|
||||||
|
allowed = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return allowed;
|
||||||
|
};
|
||||||
|
|
||||||
|
ActionHelper.registerAction = function(actionName, options, allowedKeys) {
|
||||||
var actionId = (++Ember.uuid).toString();
|
var actionId = (++Ember.uuid).toString();
|
||||||
|
|
||||||
ActionHelper.registeredActions[actionId] = {
|
ActionHelper.registeredActions[actionId] = {
|
||||||
eventName: options.eventName,
|
eventName: options.eventName,
|
||||||
handler: function(event) {
|
handler: function(event) {
|
||||||
if (!isSimpleClick(event)) { return true; }
|
if (!isAllowedClick(event, allowedKeys)) { return true; }
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
if (options.bubbles === false) {
|
if (options.bubbles === false) {
|
||||||
|
@ -24241,6 +24384,21 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
|
||||||
is created. Having an instance of `Ember.Application` will satisfy this
|
is created. Having an instance of `Ember.Application` will satisfy this
|
||||||
requirement.
|
requirement.
|
||||||
|
|
||||||
|
### Specifying whitelisted modifier keys
|
||||||
|
|
||||||
|
By default the `{{action}}` helper will ignore click event with pressed modifier
|
||||||
|
keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.
|
||||||
|
|
||||||
|
```handlebars
|
||||||
|
<script type="text/x-handlebars" data-template-name='a-template'>
|
||||||
|
<div {{action anActionName allowedKeys="alt"}}>
|
||||||
|
click me
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
This way the `{{action}}` will fire when clicking with the alt key pressed down.
|
||||||
|
|
||||||
### Specifying a Target
|
### Specifying a Target
|
||||||
|
|
||||||
There are several possible target objects for `{{action}}` helpers:
|
There are several possible target objects for `{{action}}` helpers:
|
||||||
|
@ -24349,7 +24507,7 @@ Ember.onLoad('Ember.Handlebars', function(Handlebars) {
|
||||||
action.target = { root: root, target: target, options: options };
|
action.target = { root: root, target: target, options: options };
|
||||||
action.bubbles = hash.bubbles;
|
action.bubbles = hash.bubbles;
|
||||||
|
|
||||||
var actionId = ActionHelper.registerAction(actionName, action);
|
var actionId = ActionHelper.registerAction(actionName, action, hash.allowedKeys);
|
||||||
return new SafeString('data-ember-action="' + actionId + '"');
|
return new SafeString('data-ember-action="' + actionId + '"');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25349,7 +25507,7 @@ var Application = Ember.Application = Ember.Namespace.extend({
|
||||||
Automatically initialize the application once the DOM has
|
Automatically initialize the application once the DOM has
|
||||||
become ready.
|
become ready.
|
||||||
|
|
||||||
The initialization itself is deferred using Ember.run.once,
|
The initialization itself is scheduled on the actions queue
|
||||||
which ensures that application loading finishes before
|
which ensures that application loading finishes before
|
||||||
booting.
|
booting.
|
||||||
|
|
||||||
|
@ -25363,8 +25521,8 @@ var Application = Ember.Application = Ember.Namespace.extend({
|
||||||
scheduleInitialize: function() {
|
scheduleInitialize: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.$().ready(function() {
|
this.$().ready(function() {
|
||||||
if (self.isDestroyed || self.isInitialized) return;
|
if (self.isDestroyed || self.isInitialized) { return; }
|
||||||
Ember.run(self, 'initialize');
|
Ember.run.schedule('actions', self, 'initialize');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -25473,7 +25631,7 @@ var Application = Ember.Application = Ember.Namespace.extend({
|
||||||
this.isInitialized = true;
|
this.isInitialized = true;
|
||||||
|
|
||||||
// At this point, the App.Router must already be assigned
|
// At this point, the App.Router must already be assigned
|
||||||
this.__container__.register('router', 'main', this.Router);
|
this.register('router', 'main', this.Router);
|
||||||
|
|
||||||
this.runInitializers();
|
this.runInitializers();
|
||||||
Ember.runLoadHooks('application', this);
|
Ember.runLoadHooks('application', this);
|
||||||
|
@ -25513,6 +25671,7 @@ var Application = Ember.Application = Ember.Namespace.extend({
|
||||||
|
|
||||||
graph.topsort(function (vertex) {
|
graph.topsort(function (vertex) {
|
||||||
var initializer = vertex.value;
|
var initializer = vertex.value;
|
||||||
|
Ember.assert("No application initializer named '"+vertex.name+"'", initializer);
|
||||||
initializer(container, namespace);
|
initializer(container, namespace);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -25763,7 +25922,7 @@ Ember.runLoadHooks('Ember.Application', Ember.Application);
|
||||||
(function() {
|
(function() {
|
||||||
/**
|
/**
|
||||||
@module ember
|
@module ember
|
||||||
@submodule ember-routing
|
@submodule ember-application
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var get = Ember.get, set = Ember.set;
|
var get = Ember.get, set = Ember.set;
|
||||||
|
@ -27095,8 +27254,8 @@ Ember States
|
||||||
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
// Version: v1.0.0-rc.1-134-gf13ef4c
|
// Version: v1.0.0-rc.1-178-g7fdc957
|
||||||
// Last commit: f13ef4c (2013-03-08 16:46:38 +0100)
|
// Last commit: 7fdc957 (2013-03-12 23:56:02 +0100)
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user