dist/ember.js in ember-source-1.9.0.beta.3 vs dist/ember.js in ember-source-1.9.0.beta.4
- old
+ new
@@ -3,11 +3,11 @@
* @copyright Copyright 2011-2014 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.9.0-beta.3
+ * @version 1.9.0-beta.4
*/
(function() {
var enifed, requireModule, eriuqer, requirejs, Ember;
@@ -5252,14 +5252,16 @@
The helper can send multiple actions based on user events.
The action property defines the action which is sent when
the user presses the return key.
+
```handlebars
{{input action="submit"}}
```
+
The helper allows some user events to send actions.
* `enter`
* `insert-newline`
* `escape-press`
@@ -5269,14 +5271,16 @@
For example, if you desire an action to be sent when the input is blurred,
you only need to setup the action name to the event name property.
+
```handlebars
{{input focus-in="alertMessage"}}
```
+
See more about [Text Support Actions](/api/classes/Ember.TextField.html)
## Extension
Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing
@@ -7725,12 +7729,12 @@
__exports__._triageMustacheHelper = _triageMustacheHelper;
__exports__.resolveHelper = resolveHelper;
__exports__.bindHelper = bindHelper;
});
enifed("ember-handlebars/helpers/collection",
- ["ember-metal/core","ember-handlebars-compiler","ember-metal/mixin","ember-runtime/system/string","ember-metal/property_get","ember-metal/streams/simple","ember-handlebars/ext","ember-handlebars/helpers/view","ember-metal/alias","ember-views/views/view","ember-views/views/collection_view","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __exports__) {
+ ["ember-metal/core","ember-handlebars-compiler","ember-metal/mixin","ember-runtime/system/string","ember-metal/property_get","ember-metal/streams/simple","ember-handlebars/ext","ember-handlebars/helpers/view","ember-views/views/view","ember-views/views/collection_view","exports"],
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __exports__) {
"use strict";
/**
@module ember
@submodule ember-handlebars
*/
@@ -7747,13 +7751,12 @@
var fmt = __dependency4__.fmt;
var get = __dependency5__.get;
var SimpleStream = __dependency6__["default"];
var handlebarsGetView = __dependency7__.handlebarsGetView;
var ViewHelper = __dependency8__.ViewHelper;
- var alias = __dependency9__["default"];
- var View = __dependency10__["default"];
- var CollectionView = __dependency11__["default"];
+ var View = __dependency9__["default"];
+ var CollectionView = __dependency10__["default"];
/**
`{{collection}}` is a `Ember.Handlebars` helper for adding instances of
`Ember.CollectionView` to a template. See [Ember.CollectionView](/api/classes/Ember.CollectionView.html)
for additional information on how a `CollectionView` functions.
@@ -7982,13 +7985,13 @@
emptyViewClass = handlebarsGetView(this, hash.emptyViewClass, container, options.data);
}
if (emptyViewClass) { hash.emptyView = emptyViewClass; }
if (hash.keyword) {
- itemHash._context = this;
+ itemHash._contextBinding = '_parentView.context';
} else {
- itemHash._context = alias('content');
+ itemHash._contextBinding = 'content';
}
var viewOptions = ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);
if (hash.itemClassBinding) {
@@ -8005,11 +8008,12 @@
}
viewOptions.classNameBindings = itemClassBindings;
}
- hash.itemViewClass = itemViewClass.extend(viewOptions);
+ hash.itemViewClass = itemViewClass;
+ hash._itemViewProps = viewOptions;
options.helperName = options.helperName || 'collection';
return EmberHandlebars.helpers.view.call(this, collectionClass, options);
}
@@ -13116,11 +13120,11 @@
The core Runtime framework is based on the jQuery API with a number of
performance optimizations.
@class Ember
@static
- @version 1.9.0-beta.3
+ @version 1.9.0-beta.4
*/
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.
@@ -13143,14 +13147,14 @@
/**
@property VERSION
@type String
- @default '1.9.0-beta.3'
+ @default '1.9.0-beta.4'
@static
*/
- Ember.VERSION = '1.9.0-beta.3';
+ Ember.VERSION = '1.9.0-beta.4';
/**
Standard environmental variables. You can define these in a global `EmberENV`
variable before loading Ember to control various configuration settings.
@@ -13870,11 +13874,11 @@
@method addListener
@for Ember
@param obj
@param {String} eventName
- @param {Object|Function} targetOrMethod A target object or a function
+ @param {Object|Function} target A target object or a function
@param {Function|String} method A function or the name of a function to be called on `target`
@param {Boolean} once A flag whether a function should only be called once
*/
function addListener(obj, eventName, target, method, once) {
Ember.assert("You must pass at least an object and event name to Ember.addListener", !!obj && !!eventName);
@@ -13906,11 +13910,11 @@
@method removeListener
@for Ember
@param obj
@param {String} eventName
- @param {Object|Function} targetOrMethod A target object or a function
+ @param {Object|Function} target A target object or a function
@param {Function|String} method A function or the name of a function to be called on `target`
*/
function removeListener(obj, eventName, target, method) {
Ember.assert("You must pass at least an object and event name to Ember.removeListener", !!obj && !!eventName);
@@ -13958,11 +13962,11 @@
@for Ember
@private
@param obj
@param {String} eventName
- @param {Object|Function} targetOrMethod A target object or a function
+ @param {Object|Function} target A target object or a function
@param {Function|String} method A function or the name of a function to be called on `target`
@param {Function} callback
*/
function suspendListener(obj, eventName, target, method, callback) {
if (!method && 'function' === typeof target) {
@@ -13989,12 +13993,12 @@
@method suspendListeners
@for Ember
@private
@param obj
- @param {Array} eventName Array of event names
- @param {Object|Function} targetOrMethod A target object or a function
+ @param {Array} eventNames Array of event names
+ @param {Object|Function} target A target object or a function
@param {Function|String} method A function or the name of a function to be called on `target`
@param {Function} callback
*/
function suspendListeners(obj, eventNames, target, method, callback) {
if (!method && 'function' === typeof target) {
@@ -14643,10 +14647,11 @@
Ember.isEmpty(); // true
Ember.isEmpty(null); // true
Ember.isEmpty(undefined); // true
Ember.isEmpty(''); // true
Ember.isEmpty([]); // true
+ Ember.isEmpty({}); // false
Ember.isEmpty('Adam Hawkins'); // false
Ember.isEmpty([0,1,2]); // false
```
@method isEmpty
@@ -15404,11 +15409,12 @@
return this.keys.has(key);
},
/**
Iterate over all the keys and values. Calls the function once
- for each key, passing in the key and value, in that order.
+ for each key, passing in value, key, and the map being iterated over,
+ in that order.
The keys are guaranteed to be iterated over in insertion order.
@method forEach
@param {Function} callback
@@ -15427,15 +15433,15 @@
var cb, thisArg;
if (length === 2) {
thisArg = arguments[1];
cb = function(key) {
- callback.call(thisArg, map.get(key), key);
+ callback.call(thisArg, map.get(key), key, map);
};
} else {
cb = function(key) {
- callback(map.get(key), key);
+ callback(map.get(key), key, map);
};
}
this.keys.forEach(cb);
},
@@ -16527,31 +16533,31 @@
__exports__.observersFor = observersFor;/**
@method removeObserver
@for Ember
@param obj
@param {String} path
- @param {Object|Function} targetOrMethod
+ @param {Object|Function} target
@param {Function|String} [method]
*/
- function removeObserver(obj, _path, target, method) {
- unwatch(obj, _path);
- removeListener(obj, changeEvent(_path), target, method);
+ function removeObserver(obj, path, target, method) {
+ unwatch(obj, path);
+ removeListener(obj, changeEvent(path), target, method);
return this;
}
__exports__.removeObserver = removeObserver;/**
@method addBeforeObserver
@for Ember
@param obj
@param {String} path
- @param {Object|Function} targetOrMethod
+ @param {Object|Function} target
@param {Function|String} [method]
*/
- function addBeforeObserver(obj, _path, target, method) {
- addListener(obj, beforeEvent(_path), target, method);
- watch(obj, _path);
+ function addBeforeObserver(obj, path, target, method) {
+ addListener(obj, beforeEvent(path), target, method);
+ watch(obj, path);
return this;
}
__exports__.addBeforeObserver = addBeforeObserver;// Suspend observer during callback.
@@ -16583,16 +16589,16 @@
__exports__.beforeObserversFor = beforeObserversFor;/**
@method removeBeforeObserver
@for Ember
@param obj
@param {String} path
- @param {Object|Function} targetOrMethod
+ @param {Object|Function} target
@param {Function|String} [method]
*/
- function removeBeforeObserver(obj, _path, target, method) {
- unwatch(obj, _path);
- removeListener(obj, beforeEvent(_path), target, method);
+ function removeBeforeObserver(obj, path, target, method) {
+ unwatch(obj, path);
+ removeListener(obj, beforeEvent(path), target, method);
return this;
}
__exports__.removeBeforeObserver = removeBeforeObserver;
@@ -19015,26 +19021,21 @@
this.descs = {};
this.watching = {};
this.cache = {};
this.cacheMeta = {};
this.source = obj;
+ this.deps = undefined;
+ this.listeners = undefined;
+ this.mixins = undefined;
+ this.bindings = undefined;
+ this.chains = undefined;
+ this.values = undefined;
+ this.proto = undefined;
}
Meta.prototype = {
- descs: null,
- deps: null,
- watching: null,
- listeners: null,
- cache: null,
- cacheMeta: null,
- source: null,
- mixins: null,
- bindings: null,
- chains: null,
- chainWatchers: null,
- values: null,
- proto: null
+ chainWatchers: null
};
if (!canDefineNonEnumerableProperties) {
// on platforms that don't support enumerable false
// make meta fail jQuery.isPlainObject() to hide from
@@ -21405,10 +21406,16 @@
if (property && property.data && property.data.isRenderData) {
options = property;
property = 'main';
}
+ Ember.deprecate(
+ "Using {{outlet}} with an unquoted name is not supported. " +
+ "Please update to quoted usage '{{outlet \"" + property + "\"}}'.",
+ arguments.length === 1 || options.types[0] === 'STRING'
+ );
+
var view = options.data.view;
var container = view.container;
outletSource = view;
while (!outletSource.get('template.isTop')) {
@@ -21419,13 +21426,19 @@
// provide controller override
viewName = options.hash.view;
if (viewName) {
viewFullName = 'view:' + viewName;
- Ember.assert("Using a quoteless view parameter with {{outlet}} is not supported." +
- " Please update to quoted usage '{{outlet \"" + viewName + "\"}}.", options.hashTypes.view !== 'ID');
- Ember.assert("The view name you supplied '" + viewName + "' did not resolve to a view.", container.has(viewFullName));
+ Ember.assert(
+ "Using a quoteless view parameter with {{outlet}} is not supported." +
+ " Please update to quoted usage '{{outlet ... view=\"" + viewName + "\"}}.",
+ options.hashTypes.view !== 'ID'
+ );
+ Ember.assert(
+ "The view name you supplied '" + viewName + "' did not resolve to a view.",
+ container.has(viewFullName)
+ );
}
viewClass = viewName ? container.lookupFactory(viewFullName) : options.hash.viewClass || OutletView;
options.types = [ 'ID' ];
@@ -22035,11 +22048,11 @@
Sets the private `_outlets` object on the view.
@method init
*/
init: function() {
- set(this, '_outlets', {});
+ this._outlets = {};
this._super();
},
/**
Manually fill any of a view's `{{outlet}}` areas with the
@@ -29081,12 +29094,13 @@
/**
Creates a clone of the passed object. This function can take just about
any type of object and create a clone of it, including primitive values
(which are not actually cloned because they are immutable).
- If the passed object implements the `clone()` method, then this function
- will simply call that method and return the result.
+ If the passed object implements the `copy()` method, then this function
+ will simply call that method and return the result. Please see
+ `Ember.Copyable` for further details.
@method copy
@for Ember
@param {Object} obj The object to clone
@param {Boolean} deep If true, a deep copy of the object is made
@@ -32544,11 +32558,11 @@
// ..........................................................
// IMPLEMENT Ember.MutableEnumerable
//
/**
- Remove all occurances of an object in the array.
+ Remove all occurrences of an object in the array.
```javascript
var cities = ["Chicago", "Berlin", "Lima", "Chicago"];
cities.removeObject("Chicago"); // ["Berlin", "Lima"]
cities.removeObject("Lima"); // ["Berlin"]
@@ -36129,10 +36143,11 @@
@extends Ember.CoreObject
@uses Ember.MutableEnumerable
@uses Ember.Copyable
@uses Ember.Freezable
@since Ember 0.9
+ @deprecated
*/
__exports__["default"] = CoreObject.extend(MutableEnumerable, Copyable, Freezable, {
// ..........................................................
// IMPLEMENT ENUMERABLE APIS
@@ -37754,11 +37769,11 @@
```javascript
Ember.Test.registerAsyncHelper('loginUser', function(app, username, password) {
visit('secured/path/here')
.fillIn('#username', username)
- .fillIn('#password', username)
+ .fillIn('#password', password)
.click('.submit')
return app.testHelpers.wait();
});
@@ -40416,26 +40431,28 @@
@param {Number} removed number of object removed from content
@param {Number} added number of object added to content
*/
arrayDidChange: function(content, start, removed, added) {
var addedViews = [];
- var view, item, idx, len, itemViewClass, emptyView;
+ var view, item, idx, len, itemViewClass, emptyView, itemViewProps;
len = content ? get(content, 'length') : 0;
if (len) {
+ itemViewProps = this._itemViewProps || {};
itemViewClass = get(this, 'itemViewClass');
+
itemViewClass = readViewFactory(itemViewClass, this.container);
for (idx = start; idx < start+added; idx++) {
item = content.objectAt(idx);
- view = this.createChildView(itemViewClass, {
- content: item,
- contentIndex: idx
- });
+ itemViewProps.content = item;
+ itemViewProps.contentIndex = idx;
+ view = this.createChildView(itemViewClass, itemViewProps);
+
addedViews.push(view);
}
} else {
emptyView = get(this, 'emptyView');
@@ -40444,10 +40461,11 @@
if ('string' === typeof emptyView && isGlobalPath(emptyView)) {
emptyView = get(emptyView) || emptyView;
}
emptyView = this.createChildView(emptyView);
+
addedViews.push(emptyView);
set(this, 'emptyView', emptyView);
if (CoreView.detect(emptyView)) {
this._createdEmptyView = emptyView;
@@ -41113,15 +41131,12 @@
render: function(buffer) {
var element = buffer.element();
var dom = buffer.dom;
if (this.tagName === '') {
- if (this._morph) {
- this._childViewsMorph = this._morph;
- } else {
- element = dom.createDocumentFragment();
- this._childViewsMorph = dom.appendMorph(element);
- }
+ element = dom.createDocumentFragment();
+ buffer._element = element;
+ this._childViewsMorph = dom.appendMorph(element, this._morph.contextualElement);
} else {
this._childViewsMorph = dom.createMorph(element, element.lastChild, null);
}
return element;
\ No newline at end of file