dist/ember.js in ember-source-1.11.0.1 vs dist/ember.js in ember-source-1.11.1

- old
+ new

@@ -3,11 +3,11 @@ * @copyright Copyright 2011-2015 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license * See https://raw.github.com/emberjs/ember.js/master/LICENSE - * @version 1.11.0 + * @version 1.11.1 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; var mainContext = this; @@ -6027,11 +6027,11 @@ @private */ function HandlebarsCompatibleHelper(fn) { this.helperFunction = function helperFunc(params, hash, options, env) { var param, blockResult, fnResult; - var context = this; + var context = env.data.view; var handlebarsOptions = { hash: { }, types: new Array(params.length), hashTypes: { } }; @@ -6043,10 +6043,16 @@ if (options.isBlock) { handlebarsOptions.fn = function() { blockResult = options.template.render(context, env, options.morph.contextualElement); }; + + if (options.inverse) { + handlebarsOptions.inverse = function() { + blockResult = options.inverse.render(context, env, options.morph.contextualElement); + }; + } } for (var prop in hash) { param = hash[prop]; @@ -7816,12 +7822,12 @@ exports['default'] = renderView; function renderHTMLBarsTemplate(view, buffer, template) { Ember['default'].assert( 'The template being rendered by `' + view + '` was compiled with `' + template.revision + - '` which does not match `Ember@1.11.0` (this revision).', - template.revision === 'Ember@1.11.0' + '` which does not match `Ember@1.11.1` (this revision).', + template.revision === 'Ember@1.11.1' ); var contextualElement = buffer.innerContextualElement(); var args = view._blockArguments; var env = { @@ -7857,11 +7863,11 @@ 'use strict'; exports['default'] = template['default']((function() { return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -7904,11 +7910,11 @@ 'use strict'; exports['default'] = template['default']((function() { return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -7944,11 +7950,11 @@ 'use strict'; exports['default'] = template['default']((function() { return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -7991,11 +7997,11 @@ 'use strict'; exports['default'] = template['default']((function() { return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8039,11 +8045,11 @@ exports['default'] = template['default']((function() { var child0 = (function() { return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8082,11 +8088,11 @@ }()); var child1 = (function() { var child0 = (function() { return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8122,11 +8128,11 @@ } }; }()); return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8164,11 +8170,11 @@ }()); var child2 = (function() { var child0 = (function() { return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8204,11 +8210,11 @@ } }; }()); return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8244,11 +8250,11 @@ } }; }()); return { isHTMLBars: true, - revision: "Ember@1.11.0", + revision: "Ember@1.11.1", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8558,11 +8564,11 @@ queue = destroyQueue; } this.beforeRemove(removeQueue[idx]); - childViews = view._childViews; + childViews = this.childViews(view); if (childViews) { for (i=0,l=childViews.length; i<l; i++) { queue.push(childViews[i]); } } @@ -8571,11 +8577,11 @@ for (idx=0; idx<destroyQueue.length; idx++) { view = destroyQueue[idx]; this.beforeRemove(destroyQueue[idx]); - childViews = view._childViews; + childViews = this.childViews(view); if (childViews) { for (i=0,l=childViews.length; i<l; i++) { destroyQueue.push(childViews[i]); } } @@ -11391,11 +11397,11 @@ The core Runtime framework is based on the jQuery API with a number of performance optimizations. @class Ember @static - @version 1.11.0 + @version 1.11.1 */ if ('undefined' === typeof Ember) { // Create core object. Make it act like an instance of Ember.Namespace so that // objects assigned to it are given a sane string representation. @@ -11419,14 +11425,14 @@ /** @property VERSION @type String - @default '1.11.0' + @default '1.11.1' @static */ - Ember.VERSION = '1.11.0'; + Ember.VERSION = '1.11.1'; /** Standard environmental variables. You can define these in a global `EmberENV` variable before loading Ember to control various configuration settings. @@ -16878,11 +16884,11 @@ function isStream(object) { return object && object.isStream; } - /** + /* A method of subscribing to a stream which is safe for use with a non-stream object. If a non-stream object is passed, the function does nothing. @public @for Ember.stream @@ -16896,11 +16902,11 @@ if (object && object.isStream) { object.subscribe(callback, context); } } - /** + /* A method of unsubscribing from a stream which is safe for use with a non-stream object. If a non-stream object is passed, the function does nothing. @public @for Ember.stream @@ -16913,11 +16919,11 @@ if (object && object.isStream) { object.unsubscribe(callback, context); } } - /** + /* Retrieve the value of a stream, or in the case a non-stream object is passed, return the object itself. @public @for Ember.stream @@ -16931,11 +16937,11 @@ } else { return object; } } - /** + /* Map an array, replacing any streams with their values. @public @for Ember.stream @function readArray @@ -16952,11 +16958,11 @@ ret[i] = read(array[i]); } return ret; } - /** + /* Map a hash, replacing any stream property values with the current value of that stream. @public @for Ember.stream @@ -16973,11 +16979,11 @@ ret[key] = read(object[key]); } return ret; } - /** + /* Check whether an array contains any stream values @public @for Ember.stream @function scanArray @@ -16997,11 +17003,11 @@ } return containsStream; } - /** + /* Check whether a hash has any stream property values @public @for Ember.stream @function scanHash @@ -17020,11 +17026,11 @@ } return containsStream; } - /** + /* Join an array, with any streams replaced by their current values @public @for Ember.stream @function concat @@ -17053,11 +17059,11 @@ } else { return array.join(separator); } } - /** + /* Generate a new stream by providing a source stream and a function that can be used to transform the stream's value. In the case of a non-stream object, returns the result of the function. The value to transform would typically be available to the function you pass @@ -18785,11 +18791,11 @@ values: hash }); } }); -enifed('ember-routing-htmlbars/helpers/render', ['exports', 'ember-metal/core', 'ember-metal/error', 'ember-runtime/system/string', 'ember-routing/system/generate_controller', 'ember-metal/streams/utils', 'ember-htmlbars/system/merge-view-bindings', 'ember-htmlbars/system/append-templated-view', 'ember-metal/platform/create'], function (exports, Ember, EmberError, string, generate_controller, utils, mergeViewBindings, appendTemplatedView, create) { +enifed('ember-routing-htmlbars/helpers/render', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/error', 'ember-runtime/system/string', 'ember-routing/system/generate_controller', 'ember-metal/streams/utils', 'ember-htmlbars/system/merge-view-bindings', 'ember-htmlbars/system/append-templated-view', 'ember-metal/platform/create'], function (exports, Ember, property_get, EmberError, string, generate_controller, utils, mergeViewBindings, appendTemplatedView, create) { 'use strict'; exports.renderHelper = renderHelper; @@ -18846,10 +18852,13 @@ var template = options.template; view = container.lookup('view:' + name); if (!view) { view = container.lookup('view:default'); + } + var viewHasTemplateSpecified = !!property_get.get(view, 'template'); + if (!viewHasTemplateSpecified) { template = template || container.lookup(templateName); } // provide controller override var controllerName; @@ -20730,20 +20739,27 @@ implementation: 'history', init: function() { property_set.set(this, 'location', property_get.get(this, 'location') || window.location); property_set.set(this, 'baseURL', jQuery['default']('base').attr('href') || ''); + }, /** Used to set state on first call to setURL @private @method initState */ initState: function() { - property_set.set(this, 'history', property_get.get(this, 'history') || window.history); + var history = property_get.get(this, 'history') || window.history; + property_set.set(this, 'history', history); + + if (history && 'state' in history) { + this.supportsHistory = true; + } + this.replaceState(this.formatURL(this.getURL())); }, /** Will be pre-pended to path upon state change @@ -20784,11 +20800,11 @@ @private @method setURL @param path {String} */ setURL: function(path) { - var state = this._historyState; + var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.pushState(path); } @@ -20801,29 +20817,47 @@ @private @method replaceURL @param path {String} */ replaceURL: function(path) { - var state = this._historyState; + var state = this.getState(); path = this.formatURL(path); if (!state || state.path !== path) { this.replaceState(path); } }, /** + Get the current `history.state`. Checks for if a polyfill is + required and if so fetches this._historyState. The state returned + from getState may be null if an iframe has changed a window's + history. + + @private + @method getState + @return state {Object} + */ + getState: function() { + if (this.supportsHistory) { + return property_get.get(this, 'history').state; + } + + return this._historyState; + }, + + /** Pushes a new state. @private @method pushState @param path {String} */ pushState: function(path) { var state = { path: path }; - property_get.get(this, 'history').pushState(null, null, path); + property_get.get(this, 'history').pushState(state, null, path); this._historyState = state; // used for webkit workaround this._previousURL = this.getURL(); @@ -20836,11 +20870,11 @@ @method replaceState @param path {String} */ replaceState: function(path) { var state = { path: path }; - property_get.get(this, 'history').replaceState(null, null, path); + property_get.get(this, 'history').replaceState(state, null, path); this._historyState = state; // used for webkit workaround this._previousURL = this.getURL(); @@ -26649,11 +26683,11 @@ model: computed.computed(function (key, value) { if (arguments.length > 1) { Ember['default'].assert( 'ArrayController expects `model` to implement the Ember.Array mixin. ' + 'This can often be fixed by wrapping your model with `Ember.A()`.', - EmberArray['default'].detect(value) + EmberArray['default'].detect(value) || !value ); return value; } @@ -34711,11 +34745,11 @@ exports['default'] = function() { var disableComponentGeneration = true; return { - revision: 'Ember@1.11.0', + revision: 'Ember@1.11.1', disableComponentGeneration: disableComponentGeneration, plugins: plugins['default'] }; @@ -36267,10 +36301,12 @@ @property attributeBindings */ attributeBindings: EMPTY_ARRAY, + _attrNodes: EMPTY_ARRAY, + _unspecifiedAttributeBindings: null, /** Iterates through the view's attribute bindings, sets up observers for each, then applies the current value of the attributes to the passed render buffer. @@ -38884,11 +38920,14 @@ view.removedFromDOM = true; view.destroy(); }; EmberRenderer.prototype.childViews = function childViews(view) { - return view._childViews; + if (view._attrNodes && view._childViews) { + return view._attrNodes.concat(view._childViews); + } + return view._attrNodes || view._childViews; }; Renderer['default'].prototype.willCreateElement = function (view) { if (instrumentation.subscribers.length && view.instrumentDetails) { view._instrumentEnd = instrumentation._instrumentStart('render.'+view.instrumentName, function viewInstrumentDetails() { @@ -40457,11 +40496,11 @@ var defaultTemplate = htmlbarsTemplate['default']; var selectOptionDefaultTemplate = { isHTMLBars: true, - revision: 'Ember@1.11.0', + revision: 'Ember@1.11.1', render: function(context, env, contextualElement) { var lazyValue = context.getStream('view.label'); lazyValue.subscribe(context._wrapAsScheduled(function() { run['default'].scheduleOnce('render', context, 'rerender'); @@ -41408,14 +41447,14 @@ return childView; }, appendAttr: function(view, attrNode) { var buffer = view.buffer; - var _childViews = view._childViews; + var _attrNodes = view._attrNodes; - if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); } - _childViews.push(attrNode); + if (!_attrNodes.length) { _attrNodes = view._attrNodes = _attrNodes.slice(); } + _attrNodes.push(attrNode); if (!attrNode._morph) { Ember.assert("bound attributes that do not have a morph must have a buffer", !!buffer); buffer.pushAttrNode(attrNode); } @@ -41466,13 +41505,13 @@ delete View.views[view.elementId]; } }, appendAttr: function(view, attrNode) { - var _childViews = view._childViews; + var _attrNodes = view._attrNodes; - if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); } - _childViews.push(attrNode); + if (!_attrNodes.length) { _attrNodes = view._attrNodes = _attrNodes.slice(); } + _attrNodes.push(attrNode); attrNode._parentView = view; view.renderer.appendAttrTo(attrNode, view.element, attrNode.attrName); view.propertyDidChange('childViews'); \ No newline at end of file