dist/ember.prod.js in ember-source-1.12.0.beta.1 vs dist/ember.prod.js in ember-source-1.12.0.beta.3

- 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.12.0-beta.1 + * @version 1.12.0-beta.3 */ (function() { var enifed, requireModule, eriuqer, requirejs, Ember; var mainContext = this; @@ -1098,25 +1098,13 @@ }); enifed('container', ['exports', 'container/registry', 'container/container'], function (exports, Registry, Container) { 'use strict'; - /* - Public api for the container is still in flux. - The public api, specified on the application namespace should be considered the stable api. - // @module container - @private - */ - - /* - Flag to enable/disable model factory injections (disabled by default) - If model factory injections are enabled, models should not be - accessed globally (only through `container.lookupFactory('model:modelName'))`); - */ Ember.MODEL_FACTORY_INJECTIONS = false; - if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== "undefined") { + if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== 'undefined') { Ember.MODEL_FACTORY_INJECTIONS = !!Ember.ENV.MODEL_FACTORY_INJECTIONS; } exports.Registry = Registry['default']; exports.Container = Container['default']; @@ -1144,11 +1132,11 @@ function Container(registry, options) { this._registry = registry || (function () { // TODO - See note above about transpiler import workaround. if (!Registry) { - Registry = requireModule("container/registry")["default"]; + Registry = requireModule('container/registry')['default']; } return new Registry(); })(); @@ -1256,11 +1244,11 @@ } } }; (function exposeRegistryMethods() { - var methods = ["register", "unregister", "resolve", "normalize", "typeInjection", "injection", "factoryInjection", "factoryTypeInjection", "has", "options", "optionsForType"]; + var methods = ['register', 'unregister', 'resolve', 'normalize', 'typeInjection', 'injection', 'factoryInjection', 'factoryTypeInjection', 'has', 'options', 'optionsForType']; function exposeRegistryMethod(method) { Container.prototype[method] = function () { return this._registry[method].apply(this._registry, arguments); }; @@ -1282,11 +1270,11 @@ if (value === undefined) { return; } - if (container._registry.getOption(fullName, "singleton") !== false && options.singleton !== false) { + if (container._registry.getOption(fullName, 'singleton') !== false && options.singleton !== false) { container.cache[fullName] = value; } return value; } @@ -1325,13 +1313,13 @@ var factory = registry.resolve(fullName); if (factory === undefined) { return; } - var type = fullName.split(":")[0]; - if (!factory || typeof factory.extend !== "function" || !Ember['default'].MODEL_FACTORY_INJECTIONS && type === "model") { - if (factory && typeof factory._onLookup === "function") { + var type = fullName.split(':')[0]; + if (!factory || typeof factory.extend !== 'function' || !Ember['default'].MODEL_FACTORY_INJECTIONS && type === 'model') { + if (factory && typeof factory._onLookup === 'function') { factory._onLookup(fullName); } // TODO: think about a 'safe' merge style extension // for now just fallback to create time injection @@ -1344,11 +1332,11 @@ factoryInjections._toString = registry.makeToString(factory, fullName); var injectedFactory = factory.extend(injections); injectedFactory.reopenClass(factoryInjections); - if (factory && typeof factory._onLookup === "function") { + if (factory && typeof factory._onLookup === 'function') { factory._onLookup(fullName); } cache[fullName] = injectedFactory; @@ -1356,11 +1344,11 @@ } } function injectionsFor(container, fullName) { var registry = container._registry; - var splitName = fullName.split(":"); + var splitName = fullName.split(':'); var type = splitName[0]; var injections = buildInjections(container, registry.getTypeInjections(type), registry.getInjections(fullName)); injections._debugContainerKey = fullName; injections.container = container; @@ -1368,11 +1356,11 @@ return injections; } function factoryInjectionsFor(container, fullName) { var registry = container._registry; - var splitName = fullName.split(":"); + var splitName = fullName.split(':'); var type = splitName[0]; var factoryInjections = buildInjections(container, registry.getFactoryTypeInjections(type), registry.getFactoryInjections(fullName)); factoryInjections._debugContainerKey = fullName; @@ -1381,32 +1369,32 @@ function instantiate(container, fullName) { var factory = factoryFor(container, fullName); var lazyInjections, validationCache; - if (container._registry.getOption(fullName, "instantiate") === false) { + if (container._registry.getOption(fullName, 'instantiate') === false) { return factory; } if (factory) { - if (typeof factory.create !== "function") { - throw new Error("Failed to create an instance of '" + fullName + "'. " + "Most likely an improperly defined class or an invalid module export."); + if (typeof factory.create !== 'function') { + throw new Error('Failed to create an instance of \'' + fullName + '\'. ' + 'Most likely an improperly defined class or an invalid module export.'); } validationCache = container.validationCache; // Ensure that all lazy injections are valid at instantiation time - if (!validationCache[fullName] && typeof factory._lazyInjections === "function") { + if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') { lazyInjections = factory._lazyInjections(); lazyInjections = container._registry.normalizeInjectionsHash(lazyInjections); container._registry.validateInjections(lazyInjections); } validationCache[fullName] = true; - if (typeof factory.extend === "function") { + if (typeof factory.extend === 'function') { // assume the factory was extendable and is already injected return factory.create(); } else { // assume the factory was extendable // to create time injections @@ -1423,11 +1411,11 @@ for (var i = 0, l = keys.length; i < l; i++) { key = keys[i]; value = cache[key]; - if (container._registry.getOption(key, "instantiate") !== false) { + if (container._registry.getOption(key, 'instantiate') !== false) { callback(value); } } } @@ -1651,17 +1639,17 @@ @param {Object} options */ register: function (fullName, factory, options) { if (factory === undefined) { - throw new TypeError("Attempting to register an unknown factory: `" + fullName + "`"); + throw new TypeError('Attempting to register an unknown factory: `' + fullName + '`'); } var normalizedName = this.normalize(fullName); if (this._resolveCache[normalizedName]) { - throw new Error("Cannot re-register: `" + fullName + "`, as it has already been resolved."); + throw new Error('Cannot re-register: `' + fullName + '`, as it has already been resolved.'); } this.registrations[normalizedName] = factory; this._options[normalizedName] = options || {}; }, @@ -1832,11 +1820,11 @@ if (options && options[optionName] !== undefined) { return options[optionName]; } - var type = fullName.split(":")[0]; + var type = fullName.split(':')[0]; options = this._typeOptions[type]; if (options && options[optionName] !== undefined) { return options[optionName]; } else if (this.fallback) { @@ -1875,13 +1863,13 @@ @param {String} property @param {String} fullName */ typeInjection: function (type, property, fullName) { - var fullNameType = fullName.split(":")[0]; + var fullNameType = fullName.split(':')[0]; if (fullNameType === type) { - throw new Error("Cannot inject a `" + fullName + "` on other " + type + "(s)."); + throw new Error('Cannot inject a `' + fullName + '` on other ' + type + '(s).'); } var injections = this._typeInjections[type] || (this._typeInjections[type] = []); injections.push({ @@ -1924,11 +1912,11 @@ */ injection: function (fullName, property, injectionName) { this.validateFullName(injectionName); var normalizedInjectionName = this.normalize(injectionName); - if (fullName.indexOf(":") === -1) { + if (fullName.indexOf(':') === -1) { return this.typeInjection(fullName, property, normalizedInjectionName); } var normalizedName = this.normalize(fullName); @@ -2010,11 +1998,11 @@ var normalizedName = this.normalize(fullName); var normalizedInjectionName = this.normalize(injectionName); this.validateFullName(injectionName); - if (fullName.indexOf(":") === -1) { + if (fullName.indexOf(':') === -1) { return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName); } var injections = this._factoryInjections[normalizedName] || (this._factoryInjections[normalizedName] = []); @@ -2024,11 +2012,11 @@ }); }, validateFullName: function (fullName) { if (!VALID_FULL_NAME_REGEXP.test(fullName)) { - throw new TypeError("Invalid Fullname, expected: `type:name` got: " + fullName); + throw new TypeError('Invalid Fullname, expected: `type:name` got: ' + fullName); } return true; }, validateInjections: function (injections) { @@ -2040,11 +2028,11 @@ for (var i = 0, length = injections.length; i < length; i++) { fullName = injections[i].fullName; if (!this.has(fullName)) { - throw new Error("Attempting to inject an unknown injection: `" + fullName + "`"); + throw new Error('Attempting to inject an unknown injection: `' + fullName + '`'); } } }, normalizeInjectionsHash: function (hash) { @@ -3189,11 +3177,11 @@ Ember['default'].Application = Application['default']; Ember['default'].Resolver = DefaultResolver.Resolver; Ember['default'].DefaultResolver = DefaultResolver['default']; - lazy_load.runLoadHooks("Ember.Application", Application['default']); + lazy_load.runLoadHooks('Ember.Application', Application['default']); }); enifed('ember-application/ext/controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/utils', 'ember-metal/computed', 'ember-runtime/mixins/controller', 'ember-routing/system/controller_for'], function (exports, Ember, property_get, EmberError, utils, computed, ControllerMixin, controllerFor) { 'use strict'; @@ -3694,11 +3682,11 @@ view in your application should be a child of the element you specify here. @property rootElement @type DOMElement @default 'body' */ - rootElement: "body", + rootElement: 'body', /** The `Ember.EventDispatcher` responsible for delegating events to this application's views. The event dispatcher is created by the application at initialization time @@ -3788,22 +3776,22 @@ @method buildInstance @return {Ember.Container} the configured container */ buildInstance: function () { return ApplicationInstance['default'].create({ - customEvents: property_get.get(this, "customEvents"), - rootElement: property_get.get(this, "rootElement"), + customEvents: property_get.get(this, 'customEvents'), + rootElement: property_get.get(this, 'rootElement'), applicationRegistry: this.registry }); }, buildDefaultInstance: function () { var instance = this.buildInstance(); // For the default instance only, set the view registry to the global // Ember.View.views hash for backwards-compatibility. - EmberView['default'].views = instance.container.lookup("-view-registry:main"); + EmberView['default'].views = instance.container.lookup('-view-registry:main'); // TODO2.0: Legacy support for App.__container__ // and global methods on App that rely on a single, // default instance. this.__deprecatedInstance__ = instance; @@ -3825,23 +3813,23 @@ @private @method scheduleInitialize */ waitForDOMReady: function (_instance) { if (!this.$ || this.$.isReady) { - run['default'].schedule("actions", this, "domReady", _instance); + run['default'].schedule('actions', this, 'domReady', _instance); } else { - this.$().ready(run['default'].bind(this, "domReady", _instance)); + this.$().ready(run['default'].bind(this, 'domReady', _instance)); } }, /** Use this to defer readiness until some condition is true. Example: ```javascript var App = Ember.Application.create(); App.deferReadiness(); - // Ember.$ is a reference to the jQuery object/function + // Ember.$ is a reference to the jQuery object/function Ember.$.getJSON('/auth-token', function(token) { App.token = token; App.advanceReadiness(); }); ``` @@ -3898,13 +3886,13 @@ called on them. Additionally they are **singletons**, each time they are looked up they return the same instance. Some examples modifying that default behavior: ```javascript var App = Ember.Application.create(); - App.Person = Ember.Object.extend(); - App.Orange = Ember.Object.extend(); - App.Email = Ember.Object.extend(); + App.Person = Ember.Object.extend(); + App.Orange = Ember.Object.extend(); + App.Email = Ember.Object.extend(); App.session = Ember.Object.create(); App.register('model:user', App.Person, { singleton: false }); App.register('fruit:favorite', App.Orange); App.register('communication:main', App.Email, { singleton: false }); App.register('session', App.session, { instantiate: false }); @@ -3957,13 +3945,13 @@ @param factoryNameOrType {String} @param property {String} @param injectionName {String} **/ inject: function () { - var _registry; + var _registry2; - (_registry = this.registry).injection.apply(_registry, arguments); + (_registry2 = this.registry).injection.apply(_registry2, arguments); }, /** Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and @@ -4005,11 +3993,11 @@ var defer = new Ember['default'].RSVP.defer(); this._bootPromise = defer.promise; this._bootResolver = defer; this.runInitializers(this.registry); - lazy_load.runLoadHooks("application", this); + lazy_load.runLoadHooks('application', this); this.advanceReadiness(); return this._bootPromise; }, @@ -4072,15 +4060,15 @@ this._readinessDeferrals = 1; this._bootPromise = null; this._bootResolver = null; function handleReset() { - run['default'](instance, "destroy"); + run['default'](instance, 'destroy'); this.buildDefaultInstance(); - run['default'].schedule("actions", this, "domReady"); + run['default'].schedule('actions', this, 'domReady'); } run['default'].join(this, handleReset); }, @@ -4088,19 +4076,19 @@ @private @method runInitializers */ runInitializers: function (registry) { var App = this; - this._runInitializer("initializers", function (name, initializer) { + this._runInitializer('initializers', function (name, initializer) { initializer.initialize(registry, App); }); }, runInstanceInitializers: function (instance) { - this._runInitializer("instanceInitializers", function (name, initializer) { + this._runInitializer('instanceInitializers', function (name, initializer) { initializer.initialize(instance); }); }, _runInitializer: function (bucketName, cb) { @@ -4166,10 +4154,11 @@ */ Resolver: null, // This method must be moved to the application instance object willDestroy: function () { + this._super.apply(this, arguments); Ember['default'].BOOTED = false; this._bootPromise = null; this._bootResolver = null; this.__deprecatedInstance__.destroy(); }, @@ -4195,11 +4184,11 @@ this.constructor.instanceInitializer(options); } }); Application.reopenClass({ - instanceInitializer: buildInitializerMethod("instanceInitializers", "instance initializer") + instanceInitializer: buildInitializerMethod('instanceInitializers', 'instance initializer') }); Application.reopenClass({ @@ -4298,11 +4287,11 @@ }); ``` @method initializer @param initializer {Object} */ - initializer: buildInitializerMethod("initializers", "initializer"), + initializer: buildInitializerMethod('initializers', 'initializer'), /** This creates a registry with the default Ember naming conventions. It also configures the registry: * registered views are created every time they are looked up (they are @@ -4331,66 +4320,66 @@ registry.resolver = resolverFor(namespace); registry.normalizeFullName = registry.resolver.normalize; registry.describe = registry.resolver.describe; registry.makeToString = registry.resolver.makeToString; - registry.optionsForType("component", { singleton: false }); - registry.optionsForType("view", { singleton: false }); - registry.optionsForType("template", { instantiate: false }); - registry.optionsForType("helper", { instantiate: false }); + registry.optionsForType('component', { singleton: false }); + registry.optionsForType('view', { singleton: false }); + registry.optionsForType('template', { instantiate: false }); + registry.optionsForType('helper', { instantiate: false }); - registry.register("application:main", namespace, { instantiate: false }); + registry.register('application:main', namespace, { instantiate: false }); - registry.register("controller:basic", Controller['default'], { instantiate: false }); - registry.register("controller:object", ObjectController['default'], { instantiate: false }); - registry.register("controller:array", ArrayController['default'], { instantiate: false }); + registry.register('controller:basic', Controller['default'], { instantiate: false }); + registry.register('controller:object', ObjectController['default'], { instantiate: false }); + registry.register('controller:array', ArrayController['default'], { instantiate: false }); - registry.register("renderer:-dom", { create: function () { + registry.register('renderer:-dom', { create: function () { return new Renderer['default'](new DOMHelper['default']()); } }); - registry.injection("view", "renderer", "renderer:-dom"); - registry.register("view:select", SelectView['default']); - registry.register("view:-outlet", outlet.OutletView); + registry.injection('view', 'renderer', 'renderer:-dom'); + registry.register('view:select', SelectView['default']); + registry.register('view:-outlet', outlet.OutletView); - registry.register("-view-registry:main", { create: function () { + registry.register('-view-registry:main', { create: function () { return {}; } }); - registry.injection("view", "_viewRegistry", "-view-registry:main"); + registry.injection('view', '_viewRegistry', '-view-registry:main'); - registry.register("view:default", _MetamorphView['default']); - registry.register("view:toplevel", EmberView['default'].extend()); + registry.register('view:default', _MetamorphView['default']); + registry.register('view:toplevel', EmberView['default'].extend()); - registry.register("route:basic", Route['default'], { instantiate: false }); - registry.register("event_dispatcher:main", EventDispatcher['default']); + registry.register('route:basic', Route['default'], { instantiate: false }); + registry.register('event_dispatcher:main', EventDispatcher['default']); - registry.injection("router:main", "namespace", "application:main"); - registry.injection("view:-outlet", "namespace", "application:main"); + registry.injection('router:main', 'namespace', 'application:main'); + registry.injection('view:-outlet', 'namespace', 'application:main'); - registry.register("location:auto", AutoLocation['default']); - registry.register("location:hash", HashLocation['default']); - registry.register("location:history", HistoryLocation['default']); - registry.register("location:none", NoneLocation['default']); + registry.register('location:auto', AutoLocation['default']); + registry.register('location:hash', HashLocation['default']); + registry.register('location:history', HistoryLocation['default']); + registry.register('location:none', NoneLocation['default']); - registry.injection("controller", "target", "router:main"); - registry.injection("controller", "namespace", "application:main"); + registry.injection('controller', 'target', 'router:main'); + registry.injection('controller', 'namespace', 'application:main'); - registry.register("-bucket-cache:main", BucketCache['default']); - registry.injection("router", "_bucketCache", "-bucket-cache:main"); - registry.injection("route", "_bucketCache", "-bucket-cache:main"); - registry.injection("controller", "_bucketCache", "-bucket-cache:main"); + registry.register('-bucket-cache:main', BucketCache['default']); + registry.injection('router', '_bucketCache', '-bucket-cache:main'); + registry.injection('route', '_bucketCache', '-bucket-cache:main'); + registry.injection('controller', '_bucketCache', '-bucket-cache:main'); - registry.injection("route", "router", "router:main"); + registry.injection('route', 'router', 'router:main'); // DEBUGGING - registry.register("resolver-for-debugging:main", registry.resolver.__resolver__, { instantiate: false }); - registry.injection("container-debug-adapter:main", "resolver", "resolver-for-debugging:main"); - registry.injection("data-adapter:main", "containerDebugAdapter", "container-debug-adapter:main"); + registry.register('resolver-for-debugging:main', registry.resolver.__resolver__, { instantiate: false }); + registry.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main'); + registry.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main'); // Custom resolver authors may want to register their own ContainerDebugAdapter with this key - registry.register("container-debug-adapter:main", ContainerDebugAdapter['default']); + registry.register('container-debug-adapter:main', ContainerDebugAdapter['default']); return registry; } }); @@ -4410,11 +4399,11 @@ @param {Ember.Namespace} namespace the namespace to look for classes @return {*} the resolved value for a given lookup */ function resolverFor(namespace) { - var ResolverClass = namespace.get("resolver") || namespace.get("Resolver") || DefaultResolver['default']; + var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || DefaultResolver['default']; var resolver = ResolverClass.create({ namespace: namespace }); function resolve(fullName) { @@ -4445,11 +4434,11 @@ function registerLibraries() { if (!librariesRegistered) { librariesRegistered = true; if (environment['default'].hasDOM) { - Ember['default'].libraries.registerCoreLibrary("jQuery", jQuery['default']().jquery); + Ember['default'].libraries.registerCoreLibrary('jQuery', jQuery['default']().jquery); } } } function logLibraryVersions() { @@ -4457,18 +4446,18 @@ // we only need to see this once per Application#init Ember['default'].LOG_VERSION = false; var libs = Ember['default'].libraries._registry; var nameLengths = EnumerableUtils['default'].map(libs, function (item) { - return property_get.get(item, "name.length"); + return property_get.get(item, 'name.length'); }); var maxNameLength = Math.max.apply(this, nameLengths); for (var i = 0, l = libs.length; i < l; i++) { var lib = libs[i]; - var spaces = new Array(maxNameLength - lib.name.length + 1).join(" "); + var spaces = new Array(maxNameLength - lib.name.length + 1).join(' '); } } } function buildInitializerMethod(bucketName, humanName) { @@ -4493,12 +4482,10 @@ }); enifed('ember-application/system/resolver', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/logger', 'ember-runtime/system/string', 'ember-runtime/system/object', 'ember-runtime/system/namespace', 'ember-htmlbars/helpers', 'ember-metal/dictionary'], function (exports, Ember, property_get, Logger, string, EmberObject, Namespace, helpers, dictionary) { 'use strict'; - var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; - /** @module ember @submodule ember-application */ @@ -4514,13 +4501,11 @@ parseName: null, // required lookupDescription: null, // required makeToString: null, // required resolveOther: null, // required _logLookup: null // required - }); - - exports['default'] = EmberObject['default'].extend({ + });exports['default'] = EmberObject['default'].extend({ /** This will be set to the Application instance when it is created. @property namespace */ @@ -4528,34 +4513,32 @@ init: function () { this._parseNameCache = dictionary['default'](null); }, normalize: function (fullName) { - var _fullName$split = fullName.split(":", 2); + var _fullName$split = fullName.split(':', 2); - var _fullName$split2 = _slicedToArray(_fullName$split, 2); + var type = _fullName$split[0]; + var name = _fullName$split[1]; - var type = _fullName$split2[0]; - var name = _fullName$split2[1]; - - if (type !== "template") { + if (type !== 'template') { var result = name; - if (result.indexOf(".") > -1) { + if (result.indexOf('.') > -1) { result = result.replace(/\.(.)/g, function (m) { return m.charAt(1).toUpperCase(); }); } - if (name.indexOf("_") > -1) { + if (name.indexOf('_') > -1) { result = result.replace(/_(.)/g, function (m) { return m.charAt(1).toUpperCase(); }); } - return type + ":" + result; + return type + ':' + result; } else { return fullName; } }, @@ -4597,42 +4580,40 @@ parseName: function (fullName) { return this._parseNameCache[fullName] || (this._parseNameCache[fullName] = this._parseName(fullName)); }, _parseName: function (fullName) { - var _fullName$split = fullName.split(":"); + var _fullName$split2 = fullName.split(':'); - var _fullName$split2 = _slicedToArray(_fullName$split, 2); - var type = _fullName$split2[0]; var fullNameWithoutType = _fullName$split2[1]; var name = fullNameWithoutType; - var namespace = property_get.get(this, "namespace"); + var namespace = property_get.get(this, 'namespace'); var root = namespace; - if (type !== "template" && name.indexOf("/") !== -1) { - var parts = name.split("/"); + if (type !== 'template' && name.indexOf('/') !== -1) { + var parts = name.split('/'); name = parts[parts.length - 1]; - var namespaceName = string.capitalize(parts.slice(0, -1).join(".")); + var namespaceName = string.capitalize(parts.slice(0, -1).join('.')); root = Namespace['default'].byName(namespaceName); } - var resolveMethodName = fullNameWithoutType === "main" ? "Main" : string.classify(type); + var resolveMethodName = fullNameWithoutType === 'main' ? 'Main' : string.classify(type); if (!(name && type)) { - throw new TypeError("Invalid fullName: `" + fullName + "`, must be of the form `type:name` "); + throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` '); } return { fullName: fullName, type: type, fullNameWithoutType: fullNameWithoutType, name: name, root: root, - resolveMethodName: "resolve" + resolveMethodName + resolveMethodName: 'resolve' + resolveMethodName }; }, /** Returns a human-readable description for a fullName. Used by the @@ -4645,17 +4626,17 @@ */ lookupDescription: function (fullName) { var parsedName = this.parseName(fullName); var description; - if (parsedName.type === "template") { - return "template at " + parsedName.fullNameWithoutType.replace(/\./g, "/"); + if (parsedName.type === 'template') { + return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/'); } - description = parsedName.root + "." + string.classify(parsedName.name).replace(/\./g, ""); + description = parsedName.root + '.' + string.classify(parsedName.name).replace(/\./g, ''); - if (parsedName.type !== "model") { + if (parsedName.type !== 'model') { description += string.classify(parsedName.type); } return description; }, @@ -4671,24 +4652,24 @@ @param {Object} parsedName a parseName object with the parsed fullName lookup string @method useRouterNaming */ useRouterNaming: function (parsedName) { - parsedName.name = parsedName.name.replace(/\./g, "_"); - if (parsedName.name === "basic") { - parsedName.name = ""; + parsedName.name = parsedName.name.replace(/\./g, '_'); + if (parsedName.name === 'basic') { + parsedName.name = ''; } }, /** Look up the template in Ember.TEMPLATES @protected @param {Object} parsedName a parseName object with the parsed fullName lookup string @method resolveTemplate */ resolveTemplate: function (parsedName) { - var templateName = parsedName.fullNameWithoutType.replace(/\./g, "/"); + var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'); if (Ember['default'].TEMPLATES[templateName]) { return Ember['default'].TEMPLATES[templateName]; } @@ -4788,19 +4769,19 @@ */ _logLookup: function (found, parsedName) { var symbol, padding; if (found) { - symbol = "[✓]"; + symbol = '[✓]'; } else { - symbol = "[ ]"; + symbol = '[ ]'; } if (parsedName.fullName.length > 60) { - padding = "."; + padding = '.'; } else { - padding = new Array(60 - parsedName.fullName.length).join("."); + padding = new Array(60 - parsedName.fullName.length).join('.'); } Logger['default'].info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName)); } }); @@ -5431,11 +5412,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: {} }; @@ -5447,10 +5428,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]; @@ -5809,16 +5796,10 @@ @for Ember.HTMLBars @param {String} name @param {Object|Function} helperFunc the helper function to add */ var helpers = o_create['default'](null); - - /** - @module ember - @submodule ember-htmlbars - */ - function registerHelper(name, helperFunc) { var helper; if (helperFunc && helperFunc.isHelper) { helper = helperFunc; @@ -6287,18 +6268,18 @@ /* jshint unused: false */ var view = env.data.view; /* jshint unused: false */ - var context = view.get("context"); + var context = view.get('context'); /* jshint unused: false */ function get(path) { return view.getStream(path).value(); } - Logger['default'].info("Use `view`, `context`, and `get(<path>)` to debug this template."); + Logger['default'].info('Use `view`, `context`, and `get(<path>)` to debug this template.'); debugger; } }); @@ -7288,36 +7269,36 @@ for semantic clarity and to retain default scope or to reference from another `{{with}}` block. ```handlebars // posts might not be - {{#with user.posts as blogPosts}} + {{#with user.posts as |blogPosts|}} <div class="notice"> There are {{blogPosts.length}} blog posts written by {{user.name}}. </div> - {{#each post in blogPosts}} + {{#each blogPosts as |post|}} <li>{{post.title}}</li> {{/each}} {{/with}} ``` Without the `as` operator, it would be impossible to reference `user.name` in the example above. NOTE: The alias should not reuse a name from the bound property path. - For example: `{{#with foo.bar as foo}}` is not supported because it attempts to alias using - the first part of the property path, `foo`. Instead, use `{{#with foo.bar as baz}}`. + For example: `{{#with foo as |foo.bar|}}` is not supported because it attempts to alias using + the first part of the property path, `foo`. Instead, use `{{#with foo.bar as |baz|}}`. ### `controller` option Adding `controller='something'` instructs the `{{with}}` helper to create and use an instance of the specified controller wrapping the aliased keyword. This is very similar to using an `itemController` option with the `{{each}}` helper. ```handlebars - {{#with users.posts as posts controller='userBlogPosts'}} + {{#with users.posts controller='userBlogPosts' as |posts|}} {{!- `posts` is wrapped in our controller instance }} {{/with}} ``` In the above example, the `posts` keyword is now wrapped in the `userBlogPost` controller, @@ -8207,11 +8188,11 @@ 'use strict'; exports['default'] = template['default']((function () { return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8255,11 +8236,11 @@ 'use strict'; exports['default'] = template['default']((function () { return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8295,11 +8276,11 @@ 'use strict'; exports['default'] = template['default']((function () { return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8343,11 +8324,11 @@ 'use strict'; exports['default'] = template['default']((function () { return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8384,19 +8365,67 @@ } }; })()); }); +enifed('ember-htmlbars/templates/select-option', ['exports', 'ember-template-compiler/system/template'], function (exports, template) { + + 'use strict'; + + exports['default'] = template['default']((function () { + return { + isHTMLBars: true, + revision: "Ember@1.12.0-beta.3", + blockParams: 0, + cachedFragment: null, + hasRendered: false, + build: function build(dom) { + var el0 = dom.createDocumentFragment(); + var el1 = dom.createComment(""); + dom.appendChild(el0, el1); + return el0; + }, + render: function render(context, env, contextualElement) { + var dom = env.dom; + var hooks = env.hooks, + content = hooks.content; + dom.detectNamespace(contextualElement); + var fragment; + if (env.useFragmentCache && dom.canClone) { + if (this.cachedFragment === null) { + fragment = this.build(dom); + if (this.hasRendered) { + this.cachedFragment = fragment; + } else { + this.hasRendered = true; + } + } + if (this.cachedFragment) { + fragment = dom.cloneNode(this.cachedFragment, true); + } + } else { + fragment = this.build(dom); + } + var morph0 = dom.createMorphAt(fragment, 0, 0, contextualElement); + dom.insertBoundary(fragment, null); + dom.insertBoundary(fragment, 0); + content(env, morph0, context, "view.label"); + return fragment; + } + }; + })()); + +}); enifed('ember-htmlbars/templates/select', ['exports', 'ember-template-compiler/system/template'], function (exports, template) { 'use strict'; exports['default'] = template['default']((function () { var child0 = (function () { return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8436,11 +8465,11 @@ })(); var child1 = (function () { var child0 = (function () { return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8478,11 +8507,11 @@ } }; })(); return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8522,11 +8551,11 @@ })(); var child2 = (function () { var child0 = (function () { return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8564,11 +8593,11 @@ } }; })(); return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8606,11 +8635,11 @@ } }; })(); return { isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", + revision: "Ember@1.12.0-beta.3", blockParams: 0, cachedFragment: null, hasRendered: false, build: function build(dom) { var el0 = dom.createDocumentFragment(); @@ -8876,12 +8905,12 @@ this.scheduleInsert(view, morph); }; Renderer.prototype.replaceIn = function Renderer_replaceIn(view, target) { var morph; - if (target.firstNode) { - morph = this._dom.createMorph(target, target.firstNode, target.lastNode); + if (target.firstChild) { + morph = this._dom.createMorph(target, target.firstChild, target.lastChild); } else { morph = this._dom.appendMorph(target); } this.scheduleInsert(view, morph); }; @@ -8914,11 +8943,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]); } } @@ -8927,11 +8956,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]); } } @@ -9046,12 +9075,13 @@ computed.computed.defaultTo = computed_macros.defaultTo; computed.computed.deprecatingAlias = computed_macros.deprecatingAlias; computed.computed.and = computed_macros.and; computed.computed.or = computed_macros.or; computed.computed.any = computed_macros.any; - computed.computed.collect = computed_macros.collect; + computed.computed.collect = computed_macros.collect; // END IMPORTS + // BEGIN EXPORTS var EmberInstrumentation = Ember['default'].Instrumentation = {}; EmberInstrumentation.instrument = instrumentation.instrument; EmberInstrumentation.subscribe = instrumentation.subscribe; EmberInstrumentation.unsubscribe = instrumentation.unsubscribe; EmberInstrumentation.reset = instrumentation.reset; @@ -10551,10 +10581,11 @@ @return {Ember.ComputedProperty} this @chainable */ ComputedPropertyPrototype.readOnly = function (readOnly) { this._readOnly = readOnly === undefined || !!readOnly; // Force to true once this deprecation is gone + return this; }; /** Sets the dependent keys on this computed property. Pass any number of @@ -11245,14 +11276,14 @@ The core Runtime framework is based on the jQuery API with a number of performance optimizations. @class Ember @static - @version 1.12.0-beta.1 + @version 1.12.0-beta.3 */ - if ("undefined" === typeof Ember) { + 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. Ember = {}; } @@ -11268,20 +11299,20 @@ // Make sure these are set whether Ember was already defined or not Ember.isNamespace = true; Ember.toString = function () { - return "Ember"; + return 'Ember'; }; /** @property VERSION @type String - @default '1.12.0-beta.1' + @default '1.12.0-beta.3' @static */ - Ember.VERSION = "1.12.0-beta.1"; + Ember.VERSION = '1.12.0-beta.3'; /** Standard environmental variables. You can define these in a global `EmberENV` variable before loading Ember to control various configuration settings. @@ -11292,22 +11323,22 @@ @type Hash */ if (Ember.ENV) { // do nothing if Ember.ENV is already setup - } else if ("undefined" !== typeof EmberENV) { + } else if ('undefined' !== typeof EmberENV) { Ember.ENV = EmberENV; - } else if ("undefined" !== typeof ENV) { + } else if ('undefined' !== typeof ENV) { Ember.ENV = ENV; } else { Ember.ENV = {}; } Ember.config = Ember.config || {}; // We disable the RANGE API by default for performance reasons - if ("undefined" === typeof Ember.ENV.DISABLE_RANGE_API) { + if ('undefined' === typeof Ember.ENV.DISABLE_RANGE_API) { Ember.ENV.DISABLE_RANGE_API = true; } /** Hash of enabled Canary features. Add to this before creating your application. @@ -11317,15 +11348,18 @@ @class FEATURES @namespace Ember @static @since 1.1.0 */ + Ember.FEATURES = {"features-stripped-test":false,"ember-routing-named-substates":true,"mandatory-setter":false,"ember-htmlbars-component-generation":false,"ember-htmlbars-component-helper":true,"ember-htmlbars-inline-if-helper":true,"ember-htmlbars-attribute-syntax":true,"ember-routing-transitioning-classes":true,"new-computed-syntax":true,"ember-testing-checkbox-helpers":false,"ember-metal-stream":false,"ember-application-instance-initializers":true,"ember-application-initializer-context":true,"ember-router-willtransition":true,"ember-application-visit":false,"ember-views-component-block-info":false,"ember-routing-core-outlet":false,"ember-libraries-isregistered":false}; //jshint ignore:line - Ember.FEATURES = Ember.ENV.FEATURES; - - if (!Ember.FEATURES) { - Ember.FEATURES = {"features-stripped-test":false,"ember-routing-named-substates":true,"mandatory-setter":false,"ember-htmlbars-component-generation":false,"ember-htmlbars-component-helper":true,"ember-htmlbars-inline-if-helper":true,"ember-htmlbars-attribute-syntax":true,"ember-routing-transitioning-classes":true,"new-computed-syntax":true,"ember-testing-checkbox-helpers":false,"ember-metal-stream":false,"ember-htmlbars-each-with-index":true,"ember-application-instance-initializers":true,"ember-application-initializer-context":true,"ember-router-willtransition":true,"ember-application-visit":false,"ember-views-component-block-info":false,"ember-routing-core-outlet":false,"ember-libraries-isregistered":false}; //jshint ignore:line + if (Ember.ENV.FEATURES) { + for (var feature in Ember.ENV.FEATURES) { + if (Ember.ENV.FEATURES.hasOwnProperty(feature)) { + Ember.FEATURES[feature] = Ember.ENV.FEATURES[feature]; + } + } } /** Test that a feature is enabled. Parsed by Ember's build tools to leave experimental features out of beta/stable builds. @@ -11376,11 +11410,11 @@ @default true @for Ember */ Ember.EXTEND_PROTOTYPES = Ember.ENV.EXTEND_PROTOTYPES; - if (typeof Ember.EXTEND_PROTOTYPES === "undefined") { + if (typeof Ember.EXTEND_PROTOTYPES === 'undefined') { Ember.EXTEND_PROTOTYPES = true; } /** Determines whether Ember logs a full stack trace during deprecation warnings @@ -11422,26 +11456,26 @@ Ember.K = K; //TODO: ES6 GLOBAL TODO // Stub out the methods defined by the ember-debug package in case it's not loaded - if ("undefined" === typeof Ember.assert) { + if ('undefined' === typeof Ember.assert) { Ember.assert = K; } - if ("undefined" === typeof Ember.warn) { + if ('undefined' === typeof Ember.warn) { Ember.warn = K; } - if ("undefined" === typeof Ember.debug) { + if ('undefined' === typeof Ember.debug) { Ember.debug = K; } - if ("undefined" === typeof Ember.runInDebug) { + if ('undefined' === typeof Ember.runInDebug) { Ember.runInDebug = K; } - if ("undefined" === typeof Ember.deprecate) { + if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = K; } - if ("undefined" === typeof Ember.deprecateFunc) { + if ('undefined' === typeof Ember.deprecateFunc) { Ember.deprecateFunc = function (_, func) { return func; }; } @@ -11572,17 +11606,17 @@ // the cost of creation dramatically over a plain Object.create. And as this // only makes sense for long-lived dictionaries that aren't instantiated often. exports['default'] = makeDictionary; function makeDictionary(parent) { var dict = create['default'](parent); - dict["_dict"] = null; - delete dict["_dict"]; + dict['_dict'] = null; + delete dict['_dict']; return dict; } }); -enifed('ember-metal/enumerable_utils', ['exports', 'ember-metal/array'], function (exports, array) { +enifed('ember-metal/enumerable_utils', ['exports', 'ember-metal/array'], function (exports, ember_metal__array) { 'use strict'; exports.map = map; exports.forEach = forEach; @@ -11615,23 +11649,23 @@ * * @return {Array} An array of mapped values. */ var splice = Array.prototype.splice; function map(obj, callback, thisArg) { - return obj.map ? obj.map(callback, thisArg) : array.map.call(obj, callback, thisArg); + return obj.map ? obj.map(callback, thisArg) : ember_metal__array.map.call(obj, callback, thisArg); } function forEach(obj, callback, thisArg) { - return obj.forEach ? obj.forEach(callback, thisArg) : array.forEach.call(obj, callback, thisArg); + return obj.forEach ? obj.forEach(callback, thisArg) : ember_metal__array.forEach.call(obj, callback, thisArg); } function filter(obj, callback, thisArg) { - return obj.filter ? obj.filter(callback, thisArg) : array.filter.call(obj, callback, thisArg); + return obj.filter ? obj.filter(callback, thisArg) : ember_metal__array.filter.call(obj, callback, thisArg); } function indexOf(obj, element, index) { - return obj.indexOf ? obj.indexOf(element, index) : array.indexOf.call(obj, element, index); + return obj.indexOf ? obj.indexOf(element, index) : ember_metal__array.indexOf.call(obj, element, index); } function indexesOf(obj, elements) { return elements === undefined ? [] : map(elements, function (item) { return indexOf(obj, item); @@ -11721,11 +11755,11 @@ // This code attempts to automatically detect an environment with DOM // by searching for window and document.createElement. An environment // with DOM may disable the DOM functionality of Ember explicitly by // defining a `disableBrowserEnvironment` ENV. - var hasDOM = typeof window !== "undefined" && typeof document !== "undefined" && typeof document.createElement !== "undefined" && !Ember['default'].ENV.disableBrowserEnvironment; + var hasDOM = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof document.createElement !== 'undefined' && !Ember['default'].ENV.disableBrowserEnvironment; if (hasDOM) { environment = { hasDOM: true, isChrome: !!window.chrome && !window.opera, @@ -11738,11 +11772,11 @@ environment = { hasDOM: false, isChrome: false, location: null, history: null, - userAgent: "Lynx (textmode)", + userAgent: 'Lynx (textmode)', global: null }; } exports['default'] = environment; @@ -11750,11 +11784,11 @@ }); enifed('ember-metal/error', ['exports', 'ember-metal/platform/create'], function (exports, create) { 'use strict'; - var errorProps = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"]; + var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; /** A subclass of the JavaScript Error object for use in Ember. @class Error @@ -12147,11 +12181,11 @@ function echo(arg){ console.log(arg); } Ember.expandProperties('foo.bar', echo); //=> 'foo.bar' Ember.expandProperties('{foo,bar}', echo); //=> 'foo', 'bar' Ember.expandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz' - Ember.expandProperties('{foo,bar}.baz', echo); //=> '{foo,bar}.baz' + Ember.expandProperties('{foo,bar}.baz', echo); //=> 'foo.baz', 'bar.baz' Ember.expandProperties('foo.{bar,baz}.@each', echo) //=> 'foo.bar.@each', 'foo.baz.@each' Ember.expandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs' Ember.expandProperties('{foo}.bar.{baz}') //=> 'foo.bar.baz' ``` @@ -12163,26 +12197,26 @@ */ exports['default'] = expandProperties; var SPLIT_REGEX = /\{|\}/; function expandProperties(pattern, callback) { - if (pattern.indexOf(" ") > -1) { - throw new EmberError['default']("Brace expanded properties cannot contain spaces, e.g. 'user.{firstName, lastName}' should be 'user.{firstName,lastName}'"); + if (pattern.indexOf(' ') > -1) { + throw new EmberError['default']('Brace expanded properties cannot contain spaces, e.g. \'user.{firstName, lastName}\' should be \'user.{firstName,lastName}\''); } - if ("string" === utils.typeOf(pattern)) { + if ('string' === utils.typeOf(pattern)) { var parts = pattern.split(SPLIT_REGEX); var properties = [parts]; enumerable_utils.forEach(parts, function (part, index) { - if (part.indexOf(",") >= 0) { - properties = duplicateAndReplace(properties, part.split(","), index); + if (part.indexOf(',') >= 0) { + properties = duplicateAndReplace(properties, part.split(','), index); } }); enumerable_utils.forEach(properties, function (property) { - callback(property.join("")); + callback(property.join('')); }); } else { callback(pattern); } } @@ -12478,11 +12512,11 @@ @return {Boolean} @since 1.5.0 */ exports['default'] = isBlank; function isBlank(obj) { - return isEmpty['default'](obj) || typeof obj === "string" && obj.match(/\S/) === null; + return isEmpty['default'](obj) || typeof obj === 'string' && obj.match(/\S/) === null; } }); enifed('ember-metal/is_empty', ['exports', 'ember-metal/property_get', 'ember-metal/is_none'], function (exports, property_get, isNone) { @@ -12492,30 +12526,30 @@ var none = isNone['default'](obj); if (none) { return none; } - if (typeof obj.size === "number") { + if (typeof obj.size === 'number') { return !obj.size; } var objectType = typeof obj; - if (objectType === "object") { - var size = property_get.get(obj, "size"); - if (typeof size === "number") { + if (objectType === 'object') { + var size = property_get.get(obj, 'size'); + if (typeof size === 'number') { return !size; } } - if (typeof obj.length === "number" && objectType !== "function") { + if (typeof obj.length === 'number' && objectType !== 'function') { return !obj.length; } - if (objectType === "object") { - var length = property_get.get(obj, "length"); - if (typeof length === "number") { + if (objectType === 'object') { + var length = property_get.get(obj, 'length'); + if (typeof length === 'number') { return !length; } } return false; @@ -12598,24 +12632,24 @@ if (!keys || !define_property.canDefineNonEnumerableProperties) { // modified from // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys keys = (function () { var hasOwnProperty = Object.prototype.hasOwnProperty; - var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString"); - var dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"]; + var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'); + var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor']; var dontEnumsLength = dontEnums.length; return function keys(obj) { - if (typeof obj !== "object" && (typeof obj !== "function" || obj === null)) { - throw new TypeError("Object.keys called on non-object"); + if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { + throw new TypeError('Object.keys called on non-object'); } var result = []; var prop, i; for (prop in obj) { - if (prop !== "_super" && prop.lastIndexOf("__", 0) !== 0 && hasOwnProperty.call(obj, prop)) { + if (prop !== '_super' && prop.lastIndexOf('__', 0) !== 0 && hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { @@ -13364,11 +13398,11 @@ @param {Object} updates The object to copy properties from @return {Object} */ exports['default'] = merge; function merge(original, updates) { - if (!updates || typeof updates !== "object") { + if (!updates || typeof updates !== 'object') { return original; } var props = keys['default'](updates); var prop; @@ -13381,11 +13415,11 @@ return original; } }); -enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/array', 'ember-metal/platform/create', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events', 'ember-metal/streams/utils'], function (exports, Ember, merge, array, o_create, property_get, property_set, utils, expandProperties, properties, computed, ember_metal__binding, ember_metal__observer, events, streams__utils) { +enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/merge', 'ember-metal/array', 'ember-metal/platform/create', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/utils', 'ember-metal/expand_properties', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/binding', 'ember-metal/observer', 'ember-metal/events', 'ember-metal/streams/utils'], function (exports, Ember, merge, array, o_create, property_get, property_set, utils, expandProperties, ember_metal__properties, computed, ember_metal__binding, ember_metal__observer, events, streams__utils) { exports.mixin = mixin; exports.required = required; exports.aliasMethod = aliasMethod; @@ -13612,11 +13646,11 @@ return newBase; } function addNormalizedProperty(base, key, value, meta, descs, values, concats, mergings) { - if (value instanceof properties.Descriptor) { + if (value instanceof ember_metal__properties.Descriptor) { if (value === REQUIRED && descs[key]) { return CONTINUE; } // Wrap descriptor function to implement @@ -13843,11 +13877,11 @@ continue; } replaceObserversAndListeners(obj, key, value); detectBinding(obj, key, value, m); - properties.defineProperty(obj, key, desc, value, m); + ember_metal__properties.defineProperty(obj, key, desc, value, m); } if (!partial) { // don't apply to prototype finishPartial(obj, m); @@ -13959,12 +13993,12 @@ @method create @static @param arguments* */ Mixin.create = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } // ES6TODO: this relies on a global state? Ember['default'].anyUnprocessedMixins = true; var M = this; @@ -14058,12 +14092,12 @@ } return false; }; MixinPrototype.without = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; } var ret = new Mixin([this]); ret._without = args; return ret; @@ -14123,11 +14157,11 @@ } return ret; }; - exports.REQUIRED = REQUIRED = new properties.Descriptor(); + REQUIRED = new ember_metal__properties.Descriptor(); REQUIRED.toString = function () { return "(Required Property)"; }; function required() { return REQUIRED; @@ -14136,18 +14170,18 @@ function Alias(methodName) { this.isDescriptor = true; this.methodName = methodName; } - Alias.prototype = new properties.Descriptor(); + Alias.prototype = new ember_metal__properties.Descriptor(); function aliasMethod(methodName) { return new Alias(methodName); } function observer() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; } var func = args.slice(-1)[0]; var paths; @@ -14184,12 +14218,12 @@ return observer.apply(this, arguments); } function beforeObserver() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { + args[_key5] = arguments[_key5]; } var func = args.slice(-1)[0]; var paths; @@ -14219,10 +14253,11 @@ func.__ember_observesBefore__ = paths; return func; } exports.IS_BINDING = IS_BINDING; + exports.REQUIRED = REQUIRED; }); enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/array', 'ember-metal/events'], function (exports, watching, array, ember_metal__events) { 'use strict'; @@ -14374,11 +14409,11 @@ exports.getFirstKey = getFirstKey; exports.getTailPath = getTailPath; var IS_GLOBAL = /^[A-Z$]/; var IS_GLOBAL_PATH = /^[A-Z$].*[\.]/; - var HAS_THIS = "this."; + var HAS_THIS = 'this.'; var isGlobalCache = new Cache['default'](1000, function (key) { return IS_GLOBAL.test(key); }); @@ -14389,11 +14424,11 @@ var hasThisCache = new Cache['default'](1000, function (key) { return key.lastIndexOf(HAS_THIS, 0) === 0; }); var firstDotIndexCache = new Cache['default'](1000, function (key) { - return key.indexOf("."); + return key.indexOf('.'); }); var firstKeyCache = new Cache['default'](1000, function (path) { var index = firstDotIndexCache.get(path); if (index === -1) { @@ -14448,39 +14483,39 @@ // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed // - "REMOVE_USE_STRICT: true"; + 'REMOVE_USE_STRICT: true'; var create; // ES5 15.2.3.5 // http://es5.github.com/#x15.2.3.5 if (!(Object.create && !Object.create(null).hasOwnProperty)) { /* jshint scripturl:true, proto:true */ // Contributed by Brandon Benvie, October, 2012 var createEmpty; - var supportsProto = !({ "__proto__": null } instanceof Object); + var supportsProto = !({ '__proto__': null } instanceof Object); // the following produces false positives // in Opera Mini => not a reliable check // Object.prototype.__proto__ === null - if (supportsProto || typeof document === "undefined") { + if (supportsProto || typeof document === 'undefined') { createEmpty = function () { - return { "__proto__": null }; + return { '__proto__': null }; }; } else { // In old IE __proto__ can't be used to manually set `null`, nor does // any other method exist to make an object that inherits from nothing, // aside from Object.prototype itself. Instead, create a new global // object and *steal* its Object.prototype and strip it bare. This is // used as the prototype to create nullary objects. createEmpty = function () { - var iframe = document.createElement("iframe"); + var iframe = document.createElement('iframe'); var parent = document.body || document.documentElement; - iframe.style.display = "none"; + iframe.style.display = 'none'; parent.appendChild(iframe); - iframe.src = "javascript:"; + iframe.src = 'javascript:'; var empty = iframe.contentWindow.Object.prototype; parent.removeChild(iframe); iframe = null; delete empty.constructor; delete empty.hasOwnProperty; @@ -14506,17 +14541,17 @@ function Type() {} // An empty constructor. if (prototype === null) { object = createEmpty(); } else { - if (typeof prototype !== "object" && typeof prototype !== "function") { + if (typeof prototype !== 'object' && typeof prototype !== 'function') { // In the native implementation `parent` can be `null` // OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc) // Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object` // like they are in modern browsers. Using `Object.create` on DOM elements // is...err...probably inappropriate, but the native version allows for it. - throw new TypeError("Object prototype may only be an Object or null"); // same msg as Chrome + throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome } Type.prototype = prototype; object = new Type(); @@ -14594,11 +14629,11 @@ } try { var a = 5; var obj = {}; - defineProperty(obj, "a", { + defineProperty(obj, 'a', { configurable: true, enumerable: true, get: function () { return a; }, @@ -14614,18 +14649,18 @@ if (a !== 10) { return; } // check non-enumerability - defineProperty(obj, "a", { + defineProperty(obj, 'a', { configurable: true, enumerable: false, writable: true, value: true }); for (var key in obj) { - if (key === "a") { + if (key === 'a') { return; } } // Detects a bug in Android <3.2 where you cannot redefine a property using @@ -14634,11 +14669,11 @@ return; } // Detects a bug in Android <3 where redefining a property without a value changes the value // Object.defineProperty once accessors have already been set. - defineProperty(obj, "a", { + defineProperty(obj, 'a', { enumerable: false }); if (obj.a !== true) { return; } @@ -14651,30 +14686,30 @@ } })(Object.defineProperty); var hasES5CompliantDefineProperty = !!defineProperty; - if (hasES5CompliantDefineProperty && typeof document !== "undefined") { + if (hasES5CompliantDefineProperty && typeof document !== 'undefined') { // This is for Safari 5.0, which supports Object.defineProperty, but not // on DOM nodes. var canDefinePropertyOnDOM = (function () { try { - defineProperty(document.createElement("div"), "definePropertyOnDOM", {}); + defineProperty(document.createElement('div'), 'definePropertyOnDOM', {}); return true; } catch (e) {} return false; })(); if (!canDefinePropertyOnDOM) { defineProperty = function (obj, keyName, desc) { var isNode; - if (typeof Node === "object") { + if (typeof Node === 'object') { isNode = obj instanceof Node; } else { - isNode = typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string"; + isNode = typeof obj === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string'; } if (isNode) { // TODO: Should we have a warning here? return obj[keyName] = desc.value; @@ -15365,32 +15400,30 @@ }); enifed('ember-metal/run_loop', ['exports', 'ember-metal/core', 'ember-metal/utils', 'ember-metal/array', 'ember-metal/property_events', 'backburner'], function (exports, Ember, utils, array, property_events, Backburner) { 'use strict'; - var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; - function onBegin(current) { run.currentRunLoop = current; } function onEnd(current, next) { run.currentRunLoop = next; } // ES6TODO: should Backburner become es6? - var backburner = new Backburner['default'](["sync", "actions", "destroy"], { + var backburner = new Backburner['default'](['sync', 'actions', 'destroy'], { GUID_KEY: utils.GUID_KEY, sync: { before: property_events.beginPropertyChanges, after: property_events.endPropertyChanges }, - defaultQueue: "actions", + defaultQueue: 'actions', onBegin: onBegin, onEnd: onEnd, onErrorTarget: Ember['default'], - onErrorMethod: "onerror" + onErrorMethod: 'onerror' }); // .......................................................... // run - this is ideally the only public API the dev sees // @@ -15484,16 +15517,16 @@ We can use that setup option to do some additional setup for our component. The component itself could look something like the following: ```javascript App.RichTextEditorComponent = Ember.Component.extend({ - initializeTinyMCE: function() { + initializeTinyMCE: Ember.on('didInsertElement', function() { tinymce.init({ selector: '#' + this.$().prop('id'), setup: Ember.run.bind(this, this.setupEditor) }); - }.on('didInsertElement'), + }), setupEditor: function(editor) { this.set('editor', editor); editor.on('change', function() { @@ -15525,11 +15558,11 @@ return function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } - return run.join.apply(run, _toConsumableArray(curried.concat(args))); + return run.join.apply(run, curried.concat(args)); }; }; run.backburner = backburner; run.currentRunLoop = null; @@ -15696,16 +15729,16 @@ target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. */ run.once = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; } checkAutoRun(); - args.unshift("actions"); + args.unshift('actions'); return backburner.scheduleOnce.apply(backburner, args); }; /** Schedules a function to run one time in a given queue of the current RunLoop. @@ -15820,12 +15853,12 @@ target at the time the method is invoked. @param {Object} [args*] Optional arguments to pass to the timeout. @return {Object} Timer information for use in cancelling, see `run.cancel`. */ run.next = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; } args.push(1); return backburner.later.apply(backburner, args); }; @@ -16214,11 +16247,11 @@ } else { stream.subscriberTail = prev; } }; - /** + /* @public @class Stream @namespace Ember.stream @constructor */ @@ -16464,11 +16497,11 @@ exports.scanArray = scanArray; exports.scanHash = scanHash; exports.concat = concat; exports.chain = chain; - /** + /* Check whether an object is a stream or not @public @for Ember.stream @function isStream @@ -18138,11 +18171,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, generateController, 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, generateController, utils, mergeViewBindings, appendTemplatedView, create) { 'use strict'; exports.renderHelper = renderHelper; @@ -18245,10 +18278,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; @@ -18310,10 +18346,17 @@ function impersonateAnOutlet(currentView, view, name) { view._childOutlets = Ember['default'].A(); view._isOutlet = true; view._outletName = "__ember_orphans__"; view._matchOutletName = name; + view._parentOutlet = function () { + var parent = this._parentView; + while (parent && !parent._isOutlet) { + parent = parent._parentView; + } + return parent; + }; view.setOutletState = function (state) { var ownState; if (state && (ownState = state.outlets[this._matchOutletName])) { this._outletState = { render: { name: "render helper stub" }, @@ -19468,11 +19511,11 @@ }); enifed('ember-routing/ext/run_loop', ['ember-metal/run_loop'], function (run) { 'use strict'; - run['default']._addQueue("routerTransitions", "actions"); + run['default']._addQueue('routerTransitions', 'actions'); }); enifed('ember-routing/location/api', ['exports', 'ember-metal/core', 'ember-metal/environment', 'ember-routing/location/util'], function (exports, Ember, environment, util) { 'use strict'; @@ -19935,11 +19978,17 @@ 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 @@ -19977,11 +20026,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); } @@ -19993,28 +20042,45 @@ @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(); @@ -20026,11 +20092,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(); @@ -20190,12 +20256,12 @@ Returns the current `location.pathname`, normalized for IE inconsistencies. */ function getPath(location) { var pathname = location.pathname; // Various versions of IE/Opera don't always return a leading slash - if (pathname.charAt(0) !== "/") { - pathname = "/" + pathname; + if (pathname.charAt(0) !== '/') { + pathname = '/' + pathname; } return pathname; } @@ -20203,14 +20269,14 @@ return location.search; } function getHash(location) { var href = location.href; - var hashIndex = href.indexOf("#"); + var hashIndex = href.indexOf('#'); if (hashIndex === -1) { - return ""; + return ''; } else { return href.substr(hashIndex); } } @@ -20221,37 +20287,37 @@ function getOrigin(location) { var origin = location.origin; // Older browsers, especially IE, don't have origin if (!origin) { - origin = location.protocol + "//" + location.hostname; + origin = location.protocol + '//' + location.hostname; if (location.port) { - origin += ":" + location.port; + origin += ':' + location.port; } } return origin; } function supportsHashChange(documentMode, global) { - return "onhashchange" in global && (documentMode === undefined || documentMode > 7); + return 'onhashchange' in global && (documentMode === undefined || documentMode > 7); } function supportsHistory(userAgent, history) { // Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js // The stock browser on Android 2.2 & 2.3 returns positive on history support // Unfortunately support is really buggy and there is no clean way to detect // these bugs, so we fall back to a user agent sniff :( // We only want Android 2, stock browser, and not Chrome which identifies // itself as 'Mobile Safari' as well - if (userAgent.indexOf("Android 2") !== -1 && userAgent.indexOf("Mobile Safari") !== -1 && userAgent.indexOf("Chrome") === -1) { + if (userAgent.indexOf('Android 2') !== -1 && userAgent.indexOf('Mobile Safari') !== -1 && userAgent.indexOf('Chrome') === -1) { return false; } - return !!(history && "pushState" in history); + return !!(history && 'pushState' in history); } function replacePath(location, path) { location.replace(getOrigin(location) + path); } @@ -20309,11 +20375,11 @@ @private */ exports['default'] = controllerFor; function controllerFor(container, controllerName, lookupOptions) { - return container.lookup("controller:" + controllerName, lookupOptions); + return container.lookup('controller:' + controllerName, lookupOptions); } }); enifed('ember-routing/system/dsl', ['exports', 'ember-metal/core', 'ember-metal/array'], function (exports, Ember, array) { @@ -22626,13 +22692,13 @@ replaceWith: function () { return this.transitionTo.apply(this, arguments).method("replace"); }, generate: function () { - var _router; + var _router2; - var url = (_router = this.router).generate.apply(_router, arguments); + var url = (_router2 = this.router).generate.apply(_router2, arguments); return this.location.formatURL(url); }, /** Determines if the supplied route is currently active. @@ -22661,13 +22727,13 @@ isActiveIntent: function (routeName, models, queryParams) { return this.currentState.isActiveIntent(routeName, models, queryParams); }, send: function (name, context) { - var _router; + var _router3; - (_router = this.router).trigger.apply(_router, arguments); + (_router3 = this.router).trigger.apply(_router3, arguments); }, /** Does this router instance have the given route. @method hasRoute @@ -23481,12 +23547,12 @@ exports.getActiveTargetName = getActiveTargetName; exports.stashParamNames = stashParamNames; function routeArgs(targetRouteName, models, queryParams) { var args = []; - if (utils.typeOf(targetRouteName) === "string") { - args.push("" + targetRouteName); + if (utils.typeOf(targetRouteName) === 'string') { + args.push('' + targetRouteName); } args.push.apply(args, models); args.push({ queryParams: queryParams }); return args; } @@ -23655,21 +23721,21 @@ @param {Object} w Second value to compare @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. */ exports['default'] = compare; var TYPE_ORDER = { - "undefined": 0, - "null": 1, - "boolean": 2, - "number": 3, - "string": 4, - "array": 5, - "object": 6, - "instance": 7, - "function": 8, - "class": 9, - "date": 10 + 'undefined': 0, + 'null': 1, + 'boolean': 2, + 'number': 3, + 'string': 4, + 'array': 5, + 'object': 6, + 'instance': 7, + 'function': 8, + 'class': 9, + 'date': 10 }; // // the spaceship operator // @@ -23684,15 +23750,15 @@ var type1 = utils.typeOf(v); var type2 = utils.typeOf(w); if (Comparable['default']) { - if (type1 === "instance" && Comparable['default'].detect(v) && v.constructor.compare) { + if (type1 === 'instance' && Comparable['default'].detect(v) && v.constructor.compare) { return v.constructor.compare(v, w); } - if (type2 === "instance" && Comparable['default'].detect(w) && w.constructor.compare) { + if (type2 === 'instance' && Comparable['default'].detect(w) && w.constructor.compare) { return w.constructor.compare(w, v) * -1; } } var res = spaceship(TYPE_ORDER[type1], TYPE_ORDER[type2]); @@ -23701,18 +23767,18 @@ return res; } // types are equal - so we have to check values now switch (type1) { - case "boolean": - case "number": + case 'boolean': + case 'number': return spaceship(v, w); - case "string": + case 'string': return spaceship(v.localeCompare(w), 0); - case "array": + case 'array': var vLen = v.length; var wLen = w.length; var len = Math.min(vLen, wLen); for (var i = 0; i < len; i++) { @@ -23724,17 +23790,17 @@ // all elements are equal now // shorter array should be ordered first return spaceship(vLen, wLen); - case "instance": + case 'instance': if (Comparable['default'] && Comparable['default'].detect(v)) { return v.compare(v, w); } return 0; - case "date": + case 'date': return spaceship(v.getTime(), w.getTime()); default: return 0; } @@ -23911,12 +23977,12 @@ if (arguments.length > 1) { args = a_slice.call(arguments, 0, -1); options = a_slice.call(arguments, -1)[0]; } - if (typeof options !== "object") { - throw new EmberError['default']("Array Computed Property declared without an options hash"); + if (typeof options !== 'object') { + throw new EmberError['default']('Array Computed Property declared without an options hash'); } var cp = new ArrayComputedProperty(options); if (args) { @@ -24128,11 +24194,11 @@ var eachPropertyPattern = /^(.*)\.@each\.(.*)/; var doubleEachPropertyPattern = /(.*\.@each){2,}/; var arrayBracketPattern = /\.\[\]$/; function get(obj, key) { - if (key === "@this") { + if (key === '@this') { return obj; } return property_get.get(obj, key); } @@ -24200,12 +24266,12 @@ setupObservers: function (dependentArray, dependentKey) { this.dependentKeysByGuid[utils.guidFor(dependentArray)] = dependentKey; dependentArray.addArrayObserver(this, { - willChange: "dependentArrayWillChange", - didChange: "dependentArrayDidChange" + willChange: 'dependentArrayWillChange', + didChange: 'dependentArrayDidChange' }); if (this.cp._itemPropertyKeys[dependentKey]) { this.setupPropertyObservers(dependentKey, this.cp._itemPropertyKeys[dependentKey]); } @@ -24217,12 +24283,12 @@ delete this.dependentKeysByGuid[utils.guidFor(dependentArray)]; this.teardownPropertyObservers(dependentKey, itemPropertyKeys); dependentArray.removeArrayObserver(this, { - willChange: "dependentArrayWillChange", - didChange: "dependentArrayDidChange" + willChange: 'dependentArrayWillChange', + didChange: 'dependentArrayDidChange' }); }, suspendArrayObservers: function (callback, binding) { var oldSuspended = this.suspended; @@ -24231,11 +24297,11 @@ this.suspended = oldSuspended; }, setupPropertyObservers: function (dependentKey, itemPropertyKeys) { var dependentArray = get(this.instanceMeta.context, dependentKey); - var length = get(dependentArray, "length"); + var length = get(dependentArray, 'length'); var observerContexts = new Array(length); this.resetTransformations(dependentKey, observerContexts); enumerable_utils.forEach(dependentArray, function (item, index) { @@ -24318,11 +24384,11 @@ return []; }, updateIndexes: function (trackedArray, array) { - var length = get(array, "length"); + var length = get(array, 'length'); // OPTIMIZE: we could stop updating once we hit the object whose observer // fired; ie partially apply the transformations trackedArray.apply(function (observerContexts, offset, operation, operationIndex) { // we don't even have observer contexts for removed items, even if we did, // they no longer have any index in the array @@ -24349,11 +24415,11 @@ var removedItem = this.callbacks.removedItem; var changeMeta; var guid = utils.guidFor(dependentArray); var dependentKey = this.dependentKeysByGuid[guid]; var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey] || []; - var length = get(dependentArray, "length"); + var length = get(dependentArray, 'length'); var normalizedIndex = normalizeIndex(index, length, 0); var normalizedRemoveCount = normalizeRemoveCount(normalizedIndex, length, removedCount); var item, itemIndex, sliceIndex, observerContexts; observerContexts = this.trackRemove(dependentKey, normalizedIndex, normalizedRemoveCount); @@ -24388,11 +24454,11 @@ var addedItem = this.callbacks.addedItem; var guid = utils.guidFor(dependentArray); var dependentKey = this.dependentKeysByGuid[guid]; var observerContexts = new Array(addedCount); var itemPropertyKeys = this.cp._itemPropertyKeys[dependentKey]; - var length = get(dependentArray, "length"); + var length = get(dependentArray, 'length'); var normalizedIndex = normalizeIndex(index, length, addedCount); var endIndex = normalizedIndex + addedCount; var changeMeta, observerContext; enumerable_utils.forEach(dependentArray.slice(normalizedIndex, endIndex), function (item, sliceIndex) { @@ -24697,11 +24763,11 @@ return meta; }; ReduceComputedProperty.prototype.initialValue = function () { - if (typeof this.options.initialValue === "function") { + if (typeof this.options.initialValue === 'function') { return this.options.initialValue(); } else { return this.options.initialValue; } }; @@ -24728,11 +24794,11 @@ var propertyArgs = {}; var match, dependentArrayKey; enumerable_utils.forEach(args, function (dependentKey) { if (doubleEachPropertyPattern.test(dependentKey)) { - throw new EmberError['default']("Nested @each properties not supported: " + dependentKey); + throw new EmberError['default']('Nested @each properties not supported: ' + dependentKey); } else if (match = eachPropertyPattern.exec(dependentKey)) { dependentArrayKey = match[1]; var itemPropertyKeyPattern = match[2]; var addItemPropertyKey = function (itemPropertyKey) { @@ -24759,16 +24825,16 @@ if (arguments.length > 1) { args = a_slice.call(arguments, 0, -1); options = a_slice.call(arguments, -1)[0]; } - if (typeof options !== "object") { - throw new EmberError['default']("Reduce Computed Property declared without an options hash"); + if (typeof options !== 'object') { + throw new EmberError['default']('Reduce Computed Property declared without an options hash'); } - if (!("initialValue" in options)) { - throw new EmberError['default']("Reduce Computed Property declared without an initial value"); + if (!('initialValue' in options)) { + throw new EmberError['default']('Reduce Computed Property declared without an initial value'); } var cp = new ReduceComputedProperty(options); if (args) { @@ -24871,11 +24937,11 @@ function mapBy(dependentKey, propertyKey) { var callback = function (item) { return property_get.get(item, propertyKey); }; - return map(dependentKey + ".@each." + propertyKey, callback); + return map(dependentKey + '.@each.' + propertyKey, callback); } /** @method mapProperty @for Ember.computed @@ -24925,11 +24991,11 @@ callback = function (item) { return property_get.get(item, propertyKey) === value; }; } - return filter(dependentKey + ".@each." + propertyKey, callback); + return filter(dependentKey + '.@each.' + propertyKey, callback); } /** @method filterProperty @for Ember.computed @@ -25039,11 +25105,11 @@ return array_computed.arrayComputed.apply(null, args); } function setDiff(setAProperty, setBProperty) { if (arguments.length !== 2) { - throw new EmberError['default']("setDiff requires exactly two dependent arrays."); + throw new EmberError['default']('setDiff requires exactly two dependent arrays.'); } return array_computed.arrayComputed(setAProperty, setBProperty, { addedItem: function (array, item, changeMeta, instanceMeta) { var setA = property_get.get(this, setAProperty); @@ -25079,11 +25145,11 @@ function binarySearch(array, item, low, high) { var mid, midItem, res, guidMid, guidItem; if (arguments.length < 4) { - high = property_get.get(array, "length"); + high = property_get.get(array, 'length'); } if (arguments.length < 3) { low = 0; } @@ -25116,11 +25182,11 @@ return mid; } function sort(itemsKey, sortDefinition) { - if (typeof sortDefinition === "function") { + if (typeof sortDefinition === 'function') { return customSort(itemsKey, sortDefinition); } else { return propertySort(itemsKey, sortDefinition); } } @@ -25173,24 +25239,24 @@ changeMeta.property.clearItemPropertyKeys(itemsKey); enumerable_utils.forEach(sortPropertyDefinitions, function (sortPropertyDefinition) { - if ((idx = sortPropertyDefinition.indexOf(":")) !== -1) { + if ((idx = sortPropertyDefinition.indexOf(':')) !== -1) { sortProperty = sortPropertyDefinition.substring(0, idx); - asc = sortPropertyDefinition.substring(idx + 1).toLowerCase() !== "desc"; + asc = sortPropertyDefinition.substring(idx + 1).toLowerCase() !== 'desc'; } else { sortProperty = sortPropertyDefinition; asc = true; } sortProperties.push(sortProperty); sortPropertyAscending[sortProperty] = asc; changeMeta.property.itemPropertyKey(itemsKey, sortProperty); }); - sortPropertyDefinitions.addObserver("@each", this, updateSortPropertiesOnce); + this.addObserver(sortPropertiesKey + '.@each', this, updateSortPropertiesOnce); } function updateSortPropertiesOnce() { run['default'].once(this, updateSortProperties, changeMeta.propertyName); } @@ -25314,16 +25380,16 @@ @method lookupItemController @param {Object} object @return {String} */ lookupItemController: function (object) { - return property_get.get(this, "itemController"); + return property_get.get(this, 'itemController'); }, objectAtContent: function (idx) { - var length = property_get.get(this, "length"); - var arrangedContent = property_get.get(this, "arrangedContent"); + var length = property_get.get(this, 'length'); + var arrangedContent = property_get.get(this, 'arrangedContent'); var object = arrangedContent && arrangedContent.objectAt(idx); var controllerClass; if (idx >= 0 && idx < length) { controllerClass = this.lookupItemController(object); @@ -25392,11 +25458,11 @@ * @type Boolean */ _isVirtual: false, controllerAt: function (idx, object, controllerClass) { - var container = property_get.get(this, "container"); + var container = property_get.get(this, 'container'); var subControllers = this._subControllers; var fullName, subController, parentController; if (subControllers.length > idx) { subController = subControllers[idx]; @@ -25405,19 +25471,19 @@ return subController; } } if (this._isVirtual) { - parentController = property_get.get(this, "parentController"); + parentController = property_get.get(this, 'parentController'); } else { parentController = this; } - fullName = "controller:" + controllerClass; + fullName = 'controller:' + controllerClass; if (!container._registry.has(fullName)) { - throw new EmberError['default']("Could not resolve itemController: \"" + controllerClass + "\""); + throw new EmberError['default']('Could not resolve itemController: "' + controllerClass + '"'); } subController = container.lookupFactory(fullName).create({ target: parentController, parentController: parentController, @@ -25492,20 +25558,20 @@ @for Ember.inject @param {String} name (optional) name of the controller to inject, defaults to the property's name @return {Ember.InjectedProperty} injection descriptor instance */ - inject.createInjectionHelper("controller", controllerInjectionHelper); + inject.createInjectionHelper('controller', controllerInjectionHelper); exports['default'] = Controller; }); enifed('ember-runtime/controllers/object_controller', ['exports', 'ember-metal/core', 'ember-runtime/mixins/controller', 'ember-runtime/system/object_proxy'], function (exports, Ember, ControllerMixin, ObjectProxy) { 'use strict'; - var objectControllerDeprecation = "Ember.ObjectController is deprecated, " + "please use Ember.Controller and use `model.propertyName`."; + var objectControllerDeprecation = 'Ember.ObjectController is deprecated, ' + 'please use Ember.Controller and use `model.propertyName`.'; exports['default'] = ObjectProxy['default'].extend(ControllerMixin['default'], { init: function () { this._super(); } @@ -25538,11 +25604,11 @@ exports['default'] = copy; function _copy(obj, deep, seen, copies) { var ret, loc, key; // primitive data types are immutable, just return them. - if (typeof obj !== "object" || obj === null) { + if (typeof obj !== 'object' || obj === null) { return obj; } // avoid cyclical loops if (deep && (loc = enumerable_utils.indexOf(seen, obj)) >= 0) { @@ -25550,11 +25616,11 @@ } // IMPORTANT: this specific test will detect a native array only. Any other // object will need to implement Copyable. - if (utils.typeOf(obj) === "array") { + if (utils.typeOf(obj) === 'array') { ret = obj.slice(); if (deep) { loc = ret.length; @@ -25575,11 +25641,11 @@ continue; } // Prevents browsers that don't respect non-enumerability from // copying internal Ember properties - if (key.substring(0, 2) === "__") { + if (key.substring(0, 2) === '__') { continue; } ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key]; } @@ -25592,11 +25658,11 @@ return ret; } function copy(obj, deep) { // fast paths - if ("object" !== typeof obj || obj === null) { + if ('object' !== typeof obj || obj === null) { return obj; // can't copy primitives } if (Copyable['default'] && Copyable['default'].detect(obj)) { return obj.copy(deep); @@ -25634,11 +25700,11 @@ @param {Object} a first object to compare @param {Object} b second object to compare @return {Boolean} */ function isEqual(a, b) { - if (a && typeof a.isEqual === "function") { + if (a && typeof a.isEqual === 'function') { return a.isEqual(b); } if (a instanceof Date && b instanceof Date) { return a.getTime() === b.getTime(); @@ -25832,11 +25898,11 @@ 'use strict'; exports.onerrorDefault = onerrorDefault; - var testModuleName = "ember-testing/test"; + var testModuleName = 'ember-testing/test'; var Test; var asyncStart = function () { if (Ember['default'].Test && Ember['default'].Test.adapter) { Ember['default'].Test.adapter.asyncStart(); @@ -25847,47 +25913,47 @@ if (Ember['default'].Test && Ember['default'].Test.adapter) { Ember['default'].Test.adapter.asyncEnd(); } }; - RSVP.configure("async", function (callback, promise) { + RSVP.configure('async', function (callback, promise) { var async = !run['default'].currentRunLoop; if (Ember['default'].testing && async) { asyncStart(); } - run['default'].backburner.schedule("actions", function () { + run['default'].backburner.schedule('actions', function () { if (Ember['default'].testing && async) { asyncEnd(); } callback(promise); }); }); RSVP.Promise.prototype.fail = function (callback, label) { - return this["catch"](callback, label); + return this['catch'](callback, label); }; function onerrorDefault(e) { var error; if (e && e.errorThrown) { // jqXHR provides this error = e.errorThrown; - if (typeof error === "string") { + if (typeof error === 'string') { error = new Error(error); } error.__reason_with_error_thrown__ = e; } else { error = e; } - if (error && error.name !== "TransitionAborted") { + if (error && error.name !== 'TransitionAborted') { if (Ember['default'].testing) { // ES6TODO: remove when possible if (!Test && Ember['default'].__loader.registry[testModuleName]) { - Test = requireModule(testModuleName)["default"]; + Test = requireModule(testModuleName)['default']; } if (Test && Test.adapter) { Test.adapter.exception(error); Logger['default'].error(error.stack); @@ -25900,11 +25966,11 @@ Logger['default'].error(error.stack); } } } - RSVP.on("error", onerrorDefault); + RSVP.on('error', onerrorDefault); exports['default'] = RSVP; }); enifed('ember-runtime/ext/string', ['ember-metal/core', 'ember-runtime/system/string'], function (Ember, string) { @@ -26342,23 +26408,23 @@ // .......................................................... // HELPERS // function arrayObserversHelper(obj, target, opts, operation, notify) { - var willChange = opts && opts.willChange || "arrayWillChange"; - var didChange = opts && opts.didChange || "arrayDidChange"; - var hasObservers = property_get.get(obj, "hasArrayObservers"); + var willChange = opts && opts.willChange || 'arrayWillChange'; + var didChange = opts && opts.didChange || 'arrayDidChange'; + var hasObservers = property_get.get(obj, 'hasArrayObservers'); if (hasObservers === notify) { - property_events.propertyWillChange(obj, "hasArrayObservers"); + property_events.propertyWillChange(obj, 'hasArrayObservers'); } - operation(obj, "@array:before", target, willChange); - operation(obj, "@array:change", target, didChange); + operation(obj, '@array:before', target, willChange); + operation(obj, '@array:change', target, didChange); if (hasObservers === notify) { - property_events.propertyDidChange(obj, "hasArrayObservers"); + property_events.propertyDidChange(obj, 'hasArrayObservers'); } return obj; } @@ -26429,11 +26495,11 @@ @method objectAt @param {Number} idx The index of the item to return. @return {*} item at index or undefined */ objectAt: function (idx) { - if (idx < 0 || idx >= property_get.get(this, "length")) { + if (idx < 0 || idx >= property_get.get(this, 'length')) { return undefined; } return property_get.get(this, idx); }, @@ -26468,26 +26534,26 @@ array, it will replace the current content. This property overrides the default property defined in `Ember.Enumerable`. @property [] @return this */ - "[]": computed.computed({ + '[]': computed.computed({ get: function (key) { return this; }, set: function (key, value) { - this.replace(0, property_get.get(this, "length"), value); + this.replace(0, property_get.get(this, 'length'), value); return this; } }), firstObject: computed.computed(function () { return this.objectAt(0); }), lastObject: computed.computed(function () { - return this.objectAt(property_get.get(this, "length") - 1); + return this.objectAt(property_get.get(this, 'length') - 1); }), // optimized version from Enumerable contains: function (obj) { return this.indexOf(obj) >= 0; @@ -26509,11 +26575,11 @@ @param {Integer} endIndex (Optional) index to end the slice at (but not included). @return {Array} New array with specified slice */ slice: function (beginIndex, endIndex) { var ret = Ember['default'].A(); - var length = property_get.get(this, "length"); + var length = property_get.get(this, 'length'); if (isNone['default'](beginIndex)) { beginIndex = 0; } @@ -26554,11 +26620,11 @@ @param {Object} object the item to search for @param {Number} startAt optional starting location to search, default 0 @return {Number} index or -1 if not found */ indexOf: function (object, startAt) { - var len = property_get.get(this, "length"); + var len = property_get.get(this, 'length'); var idx; if (startAt === undefined) { startAt = 0; } @@ -26594,11 +26660,11 @@ @param {Object} object the item to search for @param {Number} startAt optional starting location to search, default 0 @return {Number} index or -1 if not found */ lastIndexOf: function (object, startAt) { - var len = property_get.get(this, "length"); + var len = property_get.get(this, 'length'); var idx; if (startAt === undefined || startAt >= len) { startAt = len - 1; } @@ -26663,11 +26729,11 @@ Becomes true whenever the array currently has observers watching changes on the array. @property {Boolean} hasArrayObservers */ hasArrayObservers: computed.computed(function () { - return events.hasListeners(this, "@array:change") || events.hasListeners(this, "@array:before"); + return events.hasListeners(this, '@array:change') || events.hasListeners(this, '@array:before'); }), /** If you are implementing an object that supports `Ember.Array`, call this method just before the array content changes to notify any observers and @@ -26697,17 +26763,17 @@ addAmt = -1; } } // Make sure the @each proxy is set up if anyone is observing @each - if (watching.isWatching(this, "@each")) { - property_get.get(this, "@each"); + if (watching.isWatching(this, '@each')) { + property_get.get(this, '@each'); } - events.sendEvent(this, "@array:before", [this, startIdx, removeAmt, addAmt]); + events.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]); - if (startIdx >= 0 && removeAmt >= 0 && property_get.get(this, "hasEnumerableObservers")) { + if (startIdx >= 0 && removeAmt >= 0 && property_get.get(this, 'hasEnumerableObservers')) { removing = []; lim = startIdx + removeAmt; for (var idx = startIdx; idx < lim; idx++) { removing.push(this.objectAt(idx)); @@ -26749,11 +26815,11 @@ if (addAmt === undefined) { addAmt = -1; } } - if (startIdx >= 0 && addAmt >= 0 && property_get.get(this, "hasEnumerableObservers")) { + if (startIdx >= 0 && addAmt >= 0 && property_get.get(this, 'hasEnumerableObservers')) { adding = []; lim = startIdx + addAmt; for (var idx = startIdx; idx < lim; idx++) { adding.push(this.objectAt(idx)); @@ -26761,24 +26827,24 @@ } else { adding = addAmt; } this.enumerableContentDidChange(removeAmt, adding); - events.sendEvent(this, "@array:change", [this, startIdx, removeAmt, addAmt]); + events.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]); - var length = property_get.get(this, "length"); - var cachedFirst = computed.cacheFor(this, "firstObject"); - var cachedLast = computed.cacheFor(this, "lastObject"); + var length = property_get.get(this, 'length'); + var cachedFirst = computed.cacheFor(this, 'firstObject'); + var cachedLast = computed.cacheFor(this, 'lastObject'); if (this.objectAt(0) !== cachedFirst) { - property_events.propertyWillChange(this, "firstObject"); - property_events.propertyDidChange(this, "firstObject"); + property_events.propertyWillChange(this, 'firstObject'); + property_events.propertyDidChange(this, 'firstObject'); } if (this.objectAt(length - 1) !== cachedLast) { - property_events.propertyWillChange(this, "lastObject"); - property_events.propertyDidChange(this, "lastObject"); + property_events.propertyWillChange(this, 'lastObject'); + property_events.propertyDidChange(this, 'lastObject'); } return this; }, @@ -26793,14 +26859,14 @@ member objects. If you merely want to watch for any items being added or removed to the array, use the `[]` property instead of `@each`. @property @each */ - "@each": computed.computed(function () { + '@each': computed.computed(function () { if (!this.__each) { // ES6TODO: GRRRRR - var EachProxy = requireModule("ember-runtime/system/each_proxy")["EachProxy"]; + var EachProxy = requireModule('ember-runtime/system/each_proxy')['EachProxy']; this.__each = new EachProxy(this); } return this.__each; @@ -26899,11 +26965,11 @@ var modelSpecified = !!props.model; if (props.content && !modelSpecified) { props.model = props.content; - delete props["content"]; + delete props['content']; } } }); @@ -27129,12 +27195,12 @@ arr.get('firstObject'); // undefined ``` @property firstObject @return {Object} the object or undefined */ - firstObject: computed.computed("[]", function () { - if (property_get.get(this, "length") === 0) { + firstObject: computed.computed('[]', function () { + if (property_get.get(this, 'length') === 0) { return undefined; } // handle generic enumerables var context = popCtx(); @@ -27156,12 +27222,12 @@ arr.get('lastObject'); // undefined ``` @property lastObject @return {Object} the last object or undefined */ - lastObject: computed.computed("[]", function () { - var len = property_get.get(this, "length"); + lastObject: computed.computed('[]', function () { + var len = property_get.get(this, 'length'); if (len === 0) { return undefined; } @@ -27220,16 +27286,16 @@ @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Object} receiver */ forEach: function (callback, target) { - if (typeof callback !== "function") { + if (typeof callback !== 'function') { throw new TypeError(); } var context = popCtx(); - var len = property_get.get(this, "length"); + var len = property_get.get(this, 'length'); var last = null; if (target === undefined) { target = null; } @@ -27250,11 +27316,11 @@ Alias for `mapBy` @method getEach @param {String} key name of the property @return {Array} The mapped array. */ - getEach: mixin.aliasMethod("mapBy"), + getEach: mixin.aliasMethod('mapBy'), /** Sets the value on the named property for each member. This is more efficient than using other methods defined on this helper. If the object implements Ember.Observable, the value will be changed to `set(),` otherwise @@ -27320,11 +27386,11 @@ @param {String} key name of the property @return {Array} The mapped array. @deprecated Use `mapBy` instead */ - mapProperty: mixin.aliasMethod("mapBy"), + mapProperty: mixin.aliasMethod('mapBy'), /** Returns an array with all of the items in the enumeration that the passed function returns true for. This method corresponds to `filter()` defined in JavaScript 1.6. @@ -27405,11 +27471,11 @@ @param {String} key the property to test @param {String} [value] optional value to test against. @return {Array} filtered array @deprecated Use `filterBy` instead */ - filterProperty: mixin.aliasMethod("filterBy"), + filterProperty: mixin.aliasMethod('filterBy'), /** Returns an array with the items that do not have truthy values for key. You can pass an optional second argument with the target value. Otherwise this will match any property that evaluates to false. @@ -27440,11 +27506,11 @@ @param {String} key the property to test @param {String} [value] optional value to test against. @return {Array} rejected array @deprecated Use `rejectBy` instead */ - rejectProperty: mixin.aliasMethod("rejectBy"), + rejectProperty: mixin.aliasMethod('rejectBy'), /** Returns the first item in the array for which the callback returns true. This method works similar to the `filter()` method defined in JavaScript 1.6 except that it will stop working on the array once a match is found. @@ -27465,11 +27531,11 @@ @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Object} Found item or `undefined`. */ find: function (callback, target) { - var len = property_get.get(this, "length"); + var len = property_get.get(this, 'length'); if (target === undefined) { target = null; } @@ -27517,11 +27583,11 @@ @param {String} key the property to test @param {String} [value] optional value to test against. @return {Object} found item or `undefined` @deprecated Use `findBy` instead */ - findProperty: mixin.aliasMethod("findBy"), + findProperty: mixin.aliasMethod('findBy'), /** Returns `true` if the passed function returns true for every item in the enumeration. This corresponds with the `every()` method in JavaScript 1.6. The callback method you provide should have the following signature (all @@ -27558,20 +27624,20 @@ @param {String} key the property to test @param {String} [value] optional value to test against. @deprecated Use `isEvery` instead @return {Boolean} */ - everyBy: mixin.aliasMethod("isEvery"), + everyBy: mixin.aliasMethod('isEvery'), /** @method everyProperty @param {String} key the property to test @param {String} [value] optional value to test against. @deprecated Use `isEvery` instead @return {Boolean} */ - everyProperty: mixin.aliasMethod("isEvery"), + everyProperty: mixin.aliasMethod('isEvery'), /** Returns `true` if the passed property resolves to `true` for all items in the enumerable. This method is often simpler/faster than using a callback. @method isEvery @@ -27610,11 +27676,11 @@ @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Boolean} `true` if the passed function returns `true` for any item */ any: function (callback, target) { - var len = property_get.get(this, "length"); + var len = property_get.get(this, 'length'); var context = popCtx(); var found = false; var last = null; var next, idx; @@ -27659,11 +27725,11 @@ @param {Function} callback The callback to execute @param {Object} [target] The target object to use @return {Boolean} `true` if the passed function returns `true` for any item @deprecated Use `any` instead */ - some: mixin.aliasMethod("any"), + some: mixin.aliasMethod('any'), /** Returns `true` if the passed property resolves to `true` for any item in the enumerable. This method is often simpler/faster than using a callback. @method isAny @@ -27681,20 +27747,20 @@ @param {String} key the property to test @param {String} [value] optional value to test against. @return {Boolean} @deprecated Use `isAny` instead */ - anyBy: mixin.aliasMethod("isAny"), + anyBy: mixin.aliasMethod('isAny'), /** @method someProperty @param {String} key the property to test @param {String} [value] optional value to test against. @return {Boolean} @deprecated Use `isAny` instead */ - someProperty: mixin.aliasMethod("isAny"), + someProperty: mixin.aliasMethod('isAny'), /** This will combine the values of the enumerator into a single value. It is a useful way to collect a summary value from an enumeration. This corresponds to the `reduce()` method defined in JavaScript 1.8. @@ -27719,11 +27785,11 @@ @param {Object} initialValue Initial value for the reduce @param {String} reducerProperty internal use only. @return {Object} The reduced value. */ reduce: function (callback, initialValue, reducerProperty) { - if (typeof callback !== "function") { + if (typeof callback !== 'function') { throw new TypeError(); } var ret = initialValue; @@ -27751,11 +27817,11 @@ var ret = Ember['default'].A(); this.forEach(function (x, idx) { var method = x && x[methodName]; - if ("function" === typeof method) { + if ('function' === typeof method) { ret[idx] = args ? method.apply(x, args) : x[methodName](); } }, this); return ret; @@ -27851,11 +27917,11 @@ this method. @property [] @type Array @return this */ - "[]": computed.computed({ + '[]': computed.computed({ get: function (key) { return this; } }), @@ -27870,23 +27936,23 @@ @param {Object} target @param {Hash} [opts] @return this */ addEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || "enumerableWillChange"; - var didChange = opts && opts.didChange || "enumerableDidChange"; - var hasObservers = property_get.get(this, "hasEnumerableObservers"); + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = property_get.get(this, 'hasEnumerableObservers'); if (!hasObservers) { - property_events.propertyWillChange(this, "hasEnumerableObservers"); + property_events.propertyWillChange(this, 'hasEnumerableObservers'); } - events.addListener(this, "@enumerable:before", target, willChange); - events.addListener(this, "@enumerable:change", target, didChange); + events.addListener(this, '@enumerable:before', target, willChange); + events.addListener(this, '@enumerable:change', target, didChange); if (!hasObservers) { - property_events.propertyDidChange(this, "hasEnumerableObservers"); + property_events.propertyDidChange(this, 'hasEnumerableObservers'); } return this; }, @@ -27896,23 +27962,23 @@ @param {Object} target @param {Hash} [opts] @return this */ removeEnumerableObserver: function (target, opts) { - var willChange = opts && opts.willChange || "enumerableWillChange"; - var didChange = opts && opts.didChange || "enumerableDidChange"; - var hasObservers = property_get.get(this, "hasEnumerableObservers"); + var willChange = opts && opts.willChange || 'enumerableWillChange'; + var didChange = opts && opts.didChange || 'enumerableDidChange'; + var hasObservers = property_get.get(this, 'hasEnumerableObservers'); if (hasObservers) { - property_events.propertyWillChange(this, "hasEnumerableObservers"); + property_events.propertyWillChange(this, 'hasEnumerableObservers'); } - events.removeListener(this, "@enumerable:before", target, willChange); - events.removeListener(this, "@enumerable:change", target, didChange); + events.removeListener(this, '@enumerable:before', target, willChange); + events.removeListener(this, '@enumerable:change', target, didChange); if (hasObservers) { - property_events.propertyDidChange(this, "hasEnumerableObservers"); + property_events.propertyDidChange(this, 'hasEnumerableObservers'); } return this; }, @@ -27921,11 +27987,11 @@ on the array. @property hasEnumerableObservers @type Boolean */ hasEnumerableObservers: computed.computed(function () { - return events.hasListeners(this, "@enumerable:change") || events.hasListeners(this, "@enumerable:before"); + return events.hasListeners(this, '@enumerable:change') || events.hasListeners(this, '@enumerable:before'); }), /** Invoke this method just before the contents of your enumerable will change. You can either omit the parameters completely or pass the objects @@ -27938,22 +28004,22 @@ @chainable */ enumerableContentWillChange: function (removing, adding) { var removeCnt, addCnt, hasDelta; - if ("number" === typeof removing) { + if ('number' === typeof removing) { removeCnt = removing; } else if (removing) { - removeCnt = property_get.get(removing, "length"); + removeCnt = property_get.get(removing, 'length'); } else { removeCnt = removing = -1; } - if ("number" === typeof adding) { + if ('number' === typeof adding) { addCnt = adding; } else if (adding) { - addCnt = property_get.get(adding, "length"); + addCnt = property_get.get(adding, 'length'); } else { addCnt = adding = -1; } hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; @@ -27964,17 +28030,17 @@ if (adding === -1) { adding = null; } - property_events.propertyWillChange(this, "[]"); + property_events.propertyWillChange(this, '[]'); if (hasDelta) { - property_events.propertyWillChange(this, "length"); + property_events.propertyWillChange(this, 'length'); } - events.sendEvent(this, "@enumerable:before", [this, removing, adding]); + events.sendEvent(this, '@enumerable:before', [this, removing, adding]); return this; }, /** @@ -27991,22 +28057,22 @@ @chainable */ enumerableContentDidChange: function (removing, adding) { var removeCnt, addCnt, hasDelta; - if ("number" === typeof removing) { + if ('number' === typeof removing) { removeCnt = removing; } else if (removing) { - removeCnt = property_get.get(removing, "length"); + removeCnt = property_get.get(removing, 'length'); } else { removeCnt = removing = -1; } - if ("number" === typeof adding) { + if ('number' === typeof adding) { addCnt = adding; } else if (adding) { - addCnt = property_get.get(adding, "length"); + addCnt = property_get.get(adding, 'length'); } else { addCnt = adding = -1; } hasDelta = addCnt < 0 || removeCnt < 0 || addCnt - removeCnt !== 0; @@ -28017,17 +28083,17 @@ if (adding === -1) { adding = null; } - events.sendEvent(this, "@enumerable:change", [this, removing, adding]); + events.sendEvent(this, '@enumerable:change', [this, removing, adding]); if (hasDelta) { - property_events.propertyDidChange(this, "length"); + property_events.propertyDidChange(this, 'length'); } - property_events.propertyDidChange(this, "[]"); + property_events.propertyDidChange(this, '[]'); return this; }, /** @@ -28203,29 +28269,37 @@ }); enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/error', 'ember-metal/mixin', 'ember-runtime/mixins/array', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/enumerable'], function (exports, property_get, utils, EmberError, mixin, EmberArray, MutableEnumerable, Enumerable) { 'use strict'; - /** - @module ember - @submodule ember-runtime - */ - // require('ember-runtime/mixins/array'); - // require('ember-runtime/mixins/mutable_enumerable'); // .......................................................... - // CONSTANTS - // - - var OUT_OF_RANGE_EXCEPTION = "Index out of range"; - var EMPTY = []; - - // .......................................................... // HELPERS // + var OUT_OF_RANGE_EXCEPTION = "Index out of range"; + var EMPTY = []; /** + This mixin defines the API for modifying array-like objects. These methods + can be applied only to a collection that keeps its items in an ordered set. + It builds upon the Array mixin and adds methods to modify the array. + Concrete implementations of this class include ArrayProxy and ArrayController. + + It is important to use the methods in this class to modify arrays so that + changes are observable. This allows the binding system in Ember to function + correctly. + + + Note that an Array can change even if it does not implement this mixin. + For example, one might implement a SparseArray that cannot be directly + modified, but if its underlying enumerable changes, it will change also. + + @class MutableArray + @namespace Ember + @uses Ember.Array + @uses Ember.MutableEnumerable + */ exports['default'] = mixin.Mixin.create(EmberArray['default'], MutableEnumerable['default'], { /** __Required.__ You must implement this method to apply this mixin. This is one of the primitives you must implement to support `Ember.Array`. @@ -28986,11 +29060,11 @@ throw reason; }, "Ember: PromiseProxy"); } /** - A low level mixin making ObjectProxy, ObjectController or ArrayController's promise aware. + A low level mixin making ObjectProxy, ObjectController or ArrayControllers promise-aware. ```javascript var ObjectPromiseController = Ember.ObjectController.extend(Ember.PromiseProxyMixin); var controller = ObjectPromiseController.create({ @@ -29877,11 +29951,11 @@ exports.Registry = Registry['default']; exports.Container = Container['default']; }); -enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/platform/create', 'ember-metal/chains', 'ember-metal/events', 'ember-metal/mixin', 'ember-metal/enumerable_utils', 'ember-metal/error', 'ember-metal/platform/define_property', 'ember-metal/keys', 'ember-runtime/mixins/action_handler', 'ember-metal/properties', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/injected_property', 'ember-metal/run_loop', 'ember-metal/watching', 'ember-metal/core', 'ember-runtime/inject'], function (exports, Ember, merge, property_get, utils, o_create, chains, events, mixin, enumerable_utils, EmberError, define_property, keys, ActionHandler, ember_metal__properties, binding, computed, InjectedProperty, run, watching, core, inject) { +enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-metal/merge', 'ember-metal/property_get', 'ember-metal/utils', 'ember-metal/platform/create', 'ember-metal/chains', 'ember-metal/events', 'ember-metal/mixin', 'ember-metal/enumerable_utils', 'ember-metal/error', 'ember-metal/platform/define_property', 'ember-metal/keys', 'ember-runtime/mixins/action_handler', 'ember-metal/properties', 'ember-metal/binding', 'ember-metal/computed', 'ember-metal/injected_property', 'ember-metal/run_loop', 'ember-metal/watching', 'ember-metal/core', 'ember-runtime/inject'], function (exports, Ember, merge, property_get, utils, o_create, chains, events, mixin, enumerable_utils, EmberError, define_property, keys, ActionHandler, ember_metal__properties, ember_metal__binding, computed, InjectedProperty, run, watching, core, inject) { // Remove "use strict"; from transpiled module until // https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed // @@ -30214,12 +30288,12 @@ watching.destroy(this); this.isDestroyed = true; }, bind: function (to, from) { - if (!(from instanceof binding.Binding)) { - from = binding.Binding.from(from); + if (!(from instanceof ember_metal__binding.Binding)) { + from = ember_metal__binding.Binding.from(from); } from.to(to).connect(this); return from; }, @@ -30375,12 +30449,12 @@ @method createWithMixins @static @param [arguments]* */ createWithMixins: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; } var C = this; if (args.length > 0) { this._initMixins(args); @@ -30416,12 +30490,12 @@ @method create @static @param [arguments]* */ create: function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; } var C = this; if (args.length > 0) { this._initProperties(args); @@ -30940,11 +31014,11 @@ }); } } }); -enifed('ember-runtime/system/namespace', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/array', 'ember-metal/utils', 'ember-metal/mixin', 'ember-runtime/system/object'], function (exports, Ember, property_get, array, utils, mixin, EmberObject) { +enifed('ember-runtime/system/namespace', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/array', 'ember-metal/utils', 'ember-metal/mixin', 'ember-runtime/system/object'], function (exports, Ember, property_get, array, utils, ember_metal__mixin, EmberObject) { 'use strict'; /** @module ember @@ -31149,11 +31223,11 @@ return function () { return ret; }; } - mixin.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. + ember_metal__mixin.Mixin.prototype.toString = classToString; // ES6TODO: altering imported objects. SBB. exports['default'] = Namespace; // continue @@ -31298,11 +31372,11 @@ @return {void} */ NativeArray.activate = function () { NativeArray.apply(Array.prototype); - A = function (arr) { + exports.A = A = function (arr) { return arr || []; }; }; if (Ember['default'].EXTEND_PROTOTYPES === true || Ember['default'].EXTEND_PROTOTYPES.Array) { @@ -31342,11 +31416,11 @@ }); enifed('ember-runtime/system/service', ['exports', 'ember-runtime/system/object', 'ember-runtime/inject'], function (exports, Object, inject) { 'use strict'; - inject.createInjectionHelper("service"); + inject.createInjectionHelper('service'); /** @class Service @namespace Ember @extends Ember.Object @@ -32544,26 +32618,26 @@ @submodule ember-template-compiler */ var compile, compileSpec; exports['default'] = function (string) { - if ((!compile || !compileSpec) && Ember.__loader.registry["htmlbars-compiler/compiler"]) { - var Compiler = requireModule("htmlbars-compiler/compiler"); + if ((!compile || !compileSpec) && Ember.__loader.registry['htmlbars-compiler/compiler']) { + var Compiler = requireModule('htmlbars-compiler/compiler'); compile = Compiler.compile; compileSpec = Compiler.compileSpec; } if (!compile || !compileSpec) { - throw new Error("Cannot call `precompile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `precompile`."); + throw new Error('Cannot call `precompile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `precompile`.'); } var asObject = arguments[1] === undefined ? true : arguments[1]; var compileFunc = asObject ? compile : compileSpec; return compileFunc(string, compileOptions['default']()); - }; + } }); enifed('ember-template-compiler/plugins', ['exports'], function (exports) { 'use strict'; @@ -32579,11 +32653,11 @@ var plugins = { ast: [] }; function registerPlugin(type, Plugin) { if (!plugins[type]) { - throw new Error("Attempting to register \"" + Plugin + "\" as \"" + type + "\" which is not a valid HTMLBars plugin type."); + throw new Error('Attempting to register "' + Plugin + '" as "' + type + '" which is not a valid HTMLBars plugin type.'); } plugins[type].push(Plugin); } @@ -32615,13 +32689,14 @@ ``` @class TransformEachInToHash @private */ - function TransformEachInToHash() { + function TransformEachInToHash(options) { // set later within HTMLBars to the syntax package this.syntax = null; + this.options = options || {}; } /** @private @method transform @@ -32634,30 +32709,30 @@ walker.visit(ast, function (node) { if (pluginContext.validate(node)) { if (node.program && node.program.blockParams.length) { - throw new Error("You cannot use keyword (`{{each foo in bar}}`) and block params (`{{each bar as |foo|}}`) at the same time."); + throw new Error('You cannot use keyword (`{{each foo in bar}}`) and block params (`{{each bar as |foo|}}`) at the same time.'); } var removedParams = node.sexpr.params.splice(0, 2); var keyword = removedParams[0].original; // TODO: This may not be necessary. if (!node.sexpr.hash) { node.sexpr.hash = b.hash(); } - node.sexpr.hash.pairs.push(b.pair("keyword", b.string(keyword))); + node.sexpr.hash.pairs.push(b.pair('keyword', b.string(keyword))); } }); return ast; }; TransformEachInToHash.prototype.validate = function TransformEachInToHash_validate(node) { - return (node.type === "BlockStatement" || node.type === "MustacheStatement") && node.sexpr.path.original === "each" && node.sexpr.params.length === 3 && node.sexpr.params[1].type === "PathExpression" && node.sexpr.params[1].original === "in"; + return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.sexpr.path.original === 'each' && node.sexpr.params.length === 3 && node.sexpr.params[1].type === 'PathExpression' && node.sexpr.params[1].original === 'in'; }; exports['default'] = TransformEachInToHash; }); @@ -32686,31 +32761,34 @@ ``` @private @class TransformWithAsToHash */ - function TransformWithAsToHash() { + function TransformWithAsToHash(options) { // set later within HTMLBars to the syntax package this.syntax = null; + this.options = options; } /** @private @method transform @param {AST} The AST to be transformed. */ TransformWithAsToHash.prototype.transform = function TransformWithAsToHash_transform(ast) { var pluginContext = this; var walker = new pluginContext.syntax.Walker(); + var moduleName = this.options.moduleName; walker.visit(ast, function (node) { if (pluginContext.validate(node)) { if (node.program && node.program.blockParams.length) { throw new Error("You cannot use keyword (`{{with foo as bar}}`) and block params (`{{with foo as |bar|}}`) at the same time."); } + var removedParams = node.sexpr.params.splice(1, 2); var keyword = removedParams[1].original; node.program.blockParams = [keyword]; } }); @@ -32727,29 +32805,34 @@ }); enifed('ember-template-compiler/system/compile', ['exports', 'ember-template-compiler/system/compile_options', 'ember-template-compiler/system/template'], function (exports, compileOptions, template) { 'use strict'; - /** - @module ember - @submodule ember-template-compiler - */ - var compile; - exports['default'] = function (templateString) { + var compile; /** + Uses HTMLBars `compile` function to process a string into a compiled template. + + This is not present in production builds. + + @private + @method compile + @param {String} templateString This is the string to be compiled by HTMLBars. + @param {Object} options This is an options hash to augment the compiler options. + */ + exports['default'] = function (templateString, options) { if (!compile && Ember.__loader.registry["htmlbars-compiler/compiler"]) { compile = requireModule("htmlbars-compiler/compiler").compile; } if (!compile) { throw new Error("Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`."); } - var templateSpec = compile(templateString, compileOptions['default']()); + var templateSpec = compile(templateString, compileOptions['default'](options)); return template['default'](templateSpec); - }; + } }); enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-metal/core', 'ember-template-compiler/plugins'], function (exports, Ember, plugins) { 'use strict'; @@ -32757,21 +32840,27 @@ /** @module ember @submodule ember-template-compiler */ - exports['default'] = function () { + exports['default'] = function (_options) { var disableComponentGeneration = true; - return { - revision: "Ember@1.12.0-beta.1", + var options = _options || {}; + // When calling `Ember.Handlebars.compile()` a second argument of `true` + // had a special meaning (long since lost), this just gaurds against + // `options` being true, and causing an error during compilation. + if (options === true) { + options = {}; + } - disableComponentGeneration: disableComponentGeneration, + options.revision = "Ember@1.12.0-beta.3"; + options.disableComponentGeneration = disableComponentGeneration; + options.plugins = plugins['default']; - plugins: plugins['default'] - }; - }; + return options; + } }); enifed('ember-template-compiler/system/precompile', ['exports', 'ember-template-compiler/system/compile_options'], function (exports, compileOptions) { 'use strict'; @@ -32791,21 +32880,21 @@ @private @method precompile @param {String} templateString This is the string to be compiled by HTMLBars. */ - exports['default'] = function (templateString) { - if (!compileSpec && Ember.__loader.registry["htmlbars-compiler/compiler"]) { - compileSpec = requireModule("htmlbars-compiler/compiler").compileSpec; + exports['default'] = function (templateString, options) { + if (!compileSpec && Ember.__loader.registry['htmlbars-compiler/compiler']) { + compileSpec = requireModule('htmlbars-compiler/compiler').compileSpec; } if (!compileSpec) { - throw new Error("Cannot call `compileSpec` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compileSpec`."); + throw new Error('Cannot call `compileSpec` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compileSpec`.'); } - return compileSpec(templateString, compileOptions['default']()); - }; + return compileSpec(templateString, compileOptions['default'](options)); + } }); enifed('ember-template-compiler/system/template', ['exports'], function (exports) { 'use strict'; @@ -32827,11 +32916,11 @@ exports['default'] = function (templateSpec) { templateSpec.isTop = true; templateSpec.isMethod = false; return templateSpec; - }; + } }); enifed('ember-views', ['exports', 'ember-runtime', 'ember-views/system/jquery', 'ember-views/system/utils', 'ember-views/system/render_buffer', 'ember-views/system/renderer', 'dom-helper', 'ember-views/system/ext', 'ember-views/views/states', 'ember-views/views/core_view', 'ember-views/views/view', 'ember-views/views/container_view', 'ember-views/views/collection_view', 'ember-views/views/component', 'ember-views/system/event_dispatcher', 'ember-views/mixins/view_target_action_support', 'ember-views/component_lookup', 'ember-views/views/checkbox', 'ember-views/mixins/text_support', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/simple_bound_view', 'ember-views/views/metamorph_view', 'ember-views/views/select'], function (exports, Ember, jQuery, utils, RenderBuffer, Renderer, DOMHelper, __dep6__, states, core_view, View, ContainerView, CollectionView, Component, EventDispatcher, ViewTargetActionSupport, ComponentLookup, Checkbox, TextSupport, TextField, TextArea, SimpleBoundView, _MetamorphView, select) { 'use strict'; @@ -32897,11 +32986,11 @@ function AttrNode(attrName, attrValue) { this.init(attrName, attrValue); } - var styleWarning = "Binding style attributes may introduce cross-site scripting vulnerabilities; " + "please ensure that values being bound are properly escaped. For more information, " + "including how to disable this warning, see " + "http://emberjs.com/deprecations/v1.x/#toc_warning-when-binding-style-attributes."; + var styleWarning = "Binding style attributes may introduce cross-site scripting vulnerabilities; " + "please ensure that values being bound are properly escaped. For more information, " + "including how to disable this warning, see " + "http://emberjs.com/deprecations/v1.x/#toc_binding-style-attributes."; AttrNode.prototype.init = function init(attrName, simpleAttrValue) { this.isAttrNode = true; this.isView = true; @@ -33035,16 +33124,16 @@ exports['default'] = EmberObject['default'].extend({ lookupFactory: function (name, container) { container = container || this.container; - var fullName = "component:" + name; - var templateFullName = "template:components/" + name; + var fullName = 'component:' + name; + var templateFullName = 'template:components/' + name; var templateRegistered = container && container._registry.has(templateFullName); if (templateRegistered) { - container._registry.injection(fullName, "layout", templateFullName); + container._registry.injection(fullName, 'layout', templateFullName); } var Component = container.lookupFactory(fullName); // Only treat as a component if either the component @@ -33062,12 +33151,20 @@ }); enifed('ember-views/mixins/attribute_bindings_support', ['exports', 'ember-metal/mixin', 'ember-views/attr_nodes/attr_node', 'ember-metal/properties', 'ember-views/system/platform', 'ember-metal/streams/utils', 'ember-metal/property_set'], function (exports, mixin, AttrNode, properties, platform, utils, property_set) { 'use strict'; + /** + @module ember + @submodule ember-views + */ var EMPTY_ARRAY = []; + /** + @class AttributeBindingsSupport + @namespace Ember + */ var AttributeBindingsSupport = mixin.Mixin.create({ concatenatedProperties: ["attributeBindings"], /** A list of properties of the view to apply as attributes. If the property is @@ -33091,10 +33188,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. @@ -33172,12 +33271,20 @@ }); enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-runtime/system/native_array', 'ember-metal/enumerable_utils', 'ember-metal/streams/utils', 'ember-views/streams/class_name_binding', 'ember-metal/utils'], function (exports, Ember, mixin, native_array, enumerable_utils, utils, class_name_binding, ember_metal__utils) { 'use strict'; + /** + @module ember + @submodule ember-views + */ var EMPTY_ARRAY = []; + /** + @class ClassNamesSupport + @namespace Ember + */ var ClassNamesSupport = mixin.Mixin.create({ concatenatedProperties: ["classNames", "classNameBindings"], init: function () { this._super.apply(this, arguments); @@ -33345,36 +33452,40 @@ // Calling super is only OK here since we KNOW that // there is another Mixin loaded first. this._super.apply(this, arguments); var deprecatedProperty, replacementProperty; - var layoutSpecified = props.layoutName || props.layout || property_get.get(this, "layoutName"); + var layoutSpecified = props.layoutName || props.layout || property_get.get(this, 'layoutName'); if (props.templateName && !layoutSpecified) { - deprecatedProperty = "templateName"; - replacementProperty = "layoutName"; + deprecatedProperty = 'templateName'; + replacementProperty = 'layoutName'; props.layoutName = props.templateName; - delete props["templateName"]; + delete props['templateName']; } if (props.template && !layoutSpecified) { - deprecatedProperty = "template"; - replacementProperty = "layout"; + deprecatedProperty = 'template'; + replacementProperty = 'layout'; props.layout = props.template; - delete props["template"]; + delete props['template']; } } }); }); enifed('ember-views/mixins/instrumentation_support', ['exports', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_get'], function (exports, mixin, computed, property_get) { 'use strict'; + /** + @module ember + @submodule ember-views + */ var InstrumentationSupport = mixin.Mixin.create({ /** Used to identify this view during debugging @property instrumentDisplay @type String @@ -33398,10 +33509,14 @@ }); enifed('ember-views/mixins/legacy_view_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, Ember, mixin, property_get) { 'use strict'; + /** + @module ember + @submodule ember-views + */ var LegacyViewSupport = mixin.Mixin.create({ beforeRender: function (buffer) {}, afterRender: function (buffer) {}, @@ -33520,18 +33635,26 @@ }); enifed('ember-views/mixins/template_rendering_support', ['exports', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, mixin, property_get) { 'use strict'; + /** + @module ember + @submodule ember-views + */ var _renderView; function renderView(view, buffer, template) { if (_renderView === undefined) { _renderView = eriuqer("ember-htmlbars/system/render-view")["default"]; } _renderView(view, buffer, template); } + /** + @class TemplateRenderingSupport + @namespace Ember + */ var TemplateRenderingSupport = mixin.Mixin.create({ /** Called on your view when it should push strings of HTML into a `Ember.RenderBuffer`. Most users will want to override the `template` or `templateName` properties instead of this method. @@ -33769,10 +33892,14 @@ }); enifed('ember-views/mixins/view_child_views_support', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/set_properties', 'ember-metal/error', 'ember-metal/enumerable_utils', 'ember-runtime/system/native_array'], function (exports, Ember, mixin, computed, property_get, property_set, setProperties, EmberError, enumerable_utils, native_array) { 'use strict'; + /** + @module ember + @submodule ember-views + */ var childViewsProperty = computed.computed(function () { var childViews = this._childViews; var ret = native_array.A(); enumerable_utils.forEach(childViews, function (view) { @@ -33905,10 +34032,14 @@ }); enifed('ember-views/mixins/view_context_support', ['exports', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, mixin, computed, property_get, property_set) { 'use strict'; + /** + @module ember + @submodule ember-views + */ var ViewContextSupport = mixin.Mixin.create({ /** The object from which templates should access properties. This object will be passed to the template function each time the render method is called, but it is up to the individual function to decide what @@ -34166,14 +34297,22 @@ }); enifed('ember-views/mixins/visibility_support', ['exports', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/run_loop'], function (exports, mixin, property_get, run) { 'use strict'; + /** + @module ember + @submodule ember-views + */ function K() { return this; } + /** + @class VisibilitySupport + @namespace Ember + */ var VisibilitySupport = mixin.Mixin.create({ /** If `false`, the view will appear hidden in DOM. @property isVisible @type Boolean @@ -34388,11 +34527,11 @@ value: function () {}, _makeChildStream: function (key, _fullPath) { var stream; - if (key === "" || key === "this") { + if (key === '' || key === 'this') { stream = this.view._baseContext; } else if (path_cache.isGlobal(key) && Ember['default'].lookup[key]) { stream = new SimpleStream['default'](Ember['default'].lookup[key]); stream._isGlobal = true; } else if (key in this.view._keywords) { @@ -34401,11 +34540,11 @@ stream = new SimpleStream['default'](this.view._baseContext.get(key)); } stream._isRoot = true; - if (key === "controller") { + if (key === 'controller') { stream._isController = true; } return stream; } @@ -34436,15 +34575,15 @@ valueFn: function () { var prevObj = this.obj; var nextObj = utils.read(this.source); if (nextObj !== prevObj) { - if (prevObj && typeof prevObj === "object") { + if (prevObj && typeof prevObj === 'object') { observer.removeObserver(prevObj, this.key, this, this._didChange); } - if (nextObj && typeof nextObj === "object") { + if (nextObj && typeof nextObj === 'object') { observer.addObserver(nextObj, this.key, this, this._didChange); } this.obj = nextObj; } @@ -34488,11 +34627,11 @@ if (this._super$destroy()) { if (utils.isStream(this.source)) { this.source.unsubscribe(this._didChange, this); } - if (this.obj && typeof this.obj === "object") { + if (this.obj && typeof this.obj === 'object') { observer.removeObserver(this.obj, this.key, this, this._didChange); } this.source = undefined; this.obj = undefined; @@ -34872,12 +35011,12 @@ /** @module ember @submodule ember-views */ - run['default']._addQueue("render", "actions"); - run['default']._addQueue("afterRender", "render"); + run['default']._addQueue('render', 'actions'); + run['default']._addQueue('afterRender', 'render'); }); enifed('ember-views/system/jquery', ['exports', 'ember-metal/core', 'ember-metal/enumerable_utils', 'ember-metal/environment'], function (exports, Ember, enumerable_utils, environment) { 'use strict'; @@ -34885,28 +35024,28 @@ var jQuery; if (environment['default'].hasDOM) { // mainContext is set in `package/loader/lib/main.js` to the `this` context before entering strict mode jQuery = Ember['default'].imports && Ember['default'].imports.jQuery || mainContext && mainContext.jQuery; //jshint ignore:line - if (!jQuery && typeof eriuqer === "function") { - jQuery = eriuqer("jquery"); + if (!jQuery && typeof eriuqer === 'function') { + jQuery = eriuqer('jquery'); } /** @module ember @submodule ember-views */ if (jQuery) { // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents - var dragEvents = ["dragstart", "drag", "dragenter", "dragleave", "dragover", "drop", "dragend"]; + var dragEvents = ['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend']; // Copies the `dataTransfer` property from a browser event object onto the // jQuery event object for the specified events enumerable_utils.forEach(dragEvents, function (eventName) { jQuery.event.fixHooks[eventName] = { - props: ["dataTransfer"] + props: ['dataTransfer'] }; }); } } @@ -34940,17 +35079,17 @@ enifed('ember-views/system/platform', ['exports', 'ember-metal/environment'], function (exports, environment) { 'use strict'; var canSetNameOnInputs = environment['default'].hasDOM && (function () { - var div = document.createElement("div"); - var el = document.createElement("input"); + var div = document.createElement('div'); + var el = document.createElement('input'); - el.setAttribute("name", "foo"); + el.setAttribute('name', 'foo'); div.appendChild(el); - return !!div.innerHTML.match("foo"); + return !!div.innerHTML.match('foo'); })(); exports.canSetNameOnInputs = canSetNameOnInputs; }); @@ -35508,11 +35647,11 @@ EmberRenderer.prototype = create['default'](Renderer['default'].prototype); EmberRenderer.prototype.constructor = EmberRenderer; EmberRenderer.prototype._super$constructor = Renderer['default']; EmberRenderer.prototype.scheduleRender = function EmberRenderer_scheduleRender(ctx, fn) { - return run['default'].scheduleOnce("render", ctx, fn); + return run['default'].scheduleOnce('render', ctx, fn); }; EmberRenderer.prototype.cancelRender = function EmberRenderer_cancelRender(id) { run['default'].cancel(id); }; @@ -35521,29 +35660,29 @@ // If this is the top-most view, start a new buffer. Otherwise, // create a new buffer relative to the original using the // provided buffer operation (for example, `insertAfter` will // insert a new buffer after the "parent buffer"). var tagName = view.tagName; - if (tagName !== null && typeof tagName === "object" && tagName.isDescriptor) { - tagName = property_get.get(view, "tagName"); + if (tagName !== null && typeof tagName === 'object' && tagName.isDescriptor) { + tagName = property_get.get(view, 'tagName'); } var classNameBindings = view.classNameBindings; - var taglessViewWithClassBindings = tagName === "" && (classNameBindings && classNameBindings.length > 0); + var taglessViewWithClassBindings = tagName === '' && (classNameBindings && classNameBindings.length > 0); if (tagName === null || tagName === undefined) { - tagName = "div"; + tagName = 'div'; } var buffer = view.buffer = this.buffer; buffer.reset(tagName, contextualElement); if (view.beforeRender) { view.beforeRender(buffer); } - if (tagName !== "") { + if (tagName !== '') { if (view.applyAttributesToBuffer) { view.applyAttributesToBuffer(buffer); } buffer.generateElement(); } @@ -35569,48 +35708,51 @@ 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() { + view._instrumentEnd = instrumentation._instrumentStart('render.' + view.instrumentName, function viewInstrumentDetails() { var details = {}; view.instrumentDetails(details); return details; }); } if (view._transitionTo) { - view._transitionTo("inBuffer"); + view._transitionTo('inBuffer'); } }; // inBuffer Renderer['default'].prototype.didCreateElement = function (view) { if (view._transitionTo) { - view._transitionTo("hasElement"); + view._transitionTo('hasElement'); } if (view._instrumentEnd) { view._instrumentEnd(); } }; // hasElement Renderer['default'].prototype.willInsertElement = function (view) { if (this._destinedForDOM) { if (view.trigger) { - view.trigger("willInsertElement"); + view.trigger('willInsertElement'); } } }; // will place into DOM Renderer['default'].prototype.didInsertElement = function (view) { if (view._transitionTo) { - view._transitionTo("inDOM"); + view._transitionTo('inDOM'); } if (this._destinedForDOM) { if (view.trigger) { - view.trigger("didInsertElement"); + view.trigger('didInsertElement'); } } }; // inDOM // placed into DOM Renderer['default'].prototype.willRemoveElement = function (view) {}; @@ -35619,20 +35761,20 @@ if (this._destinedForDOM) { if (view._willDestroyElement) { view._willDestroyElement(); } if (view.trigger) { - view.trigger("willDestroyElement"); - view.trigger("willClearRender"); + view.trigger('willDestroyElement'); + view.trigger('willClearRender'); } } }; Renderer['default'].prototype.didDestroyElement = function (view) { view.element = null; if (view._transitionTo) { - view._transitionTo("preRender"); + view._transitionTo('preRender'); } }; // element destroyed so view.destroy shouldn't try to remove it removedFromDOM exports['default'] = EmberRenderer; @@ -35677,11 +35819,11 @@ var range = getViewRange(view); return range.getBoundingClientRect(); } }); -enifed('ember-views/views/bound_component_view', ['exports', 'ember-views/views/metamorph_view', 'ember-metal/streams/utils', 'ember-views/streams/utils', 'ember-htmlbars/system/merge-view-bindings', 'ember-metal/error', 'ember-views/views/container_view'], function (exports, metamorph_view, utils, streams__utils, mergeViewBindings, EmberError, ContainerView) { +enifed('ember-views/views/bound_component_view', ['exports', 'ember-views/views/metamorph_view', 'ember-metal/streams/utils', 'ember-views/streams/utils', 'ember-htmlbars/system/merge-view-bindings', 'ember-metal/error', 'ember-views/views/container_view', 'ember-views/views/view'], function (exports, metamorph_view, utils, streams__utils, mergeViewBindings, EmberError, ContainerView, View) { 'use strict'; /** @module ember @@ -35689,37 +35831,38 @@ */ exports['default'] = ContainerView['default'].extend(metamorph_view._Metamorph, { init: function () { this._super.apply(this, arguments); - var componentNameStream = this._boundComponentOptions.componentNameStream; - var container = this.container; - this.componentClassStream = utils.chain(componentNameStream, function () { - return streams__utils.readComponentFactory(componentNameStream, container); - }); + this.componentNameStream = this._boundComponentOptions.componentNameStream; - utils.subscribe(this.componentClassStream, this._updateBoundChildComponent, this); + utils.subscribe(this.componentNameStream, this._updateBoundChildComponent, this); this._updateBoundChildComponent(); }, willDestroy: function () { - utils.unsubscribe(this.componentClassStream, this._updateBoundChildComponent, this); + utils.unsubscribe(this.componentNameStream, this._updateBoundChildComponent, this); this._super.apply(this, arguments); }, _updateBoundChildComponent: function () { this.replace(0, 1, [this._createNewComponent()]); }, _createNewComponent: function () { - var componentClass = utils.read(this.componentClassStream); + var componentName = utils.read(this.componentNameStream); + if (!componentName) { + return this.createChildView(View['default']); + } + + var componentClass = streams__utils.readComponentFactory(componentName, this.container); if (!componentClass) { throw new EmberError['default']("HTMLBars error: Could not find component named \"" + utils.read(this._boundComponentOptions.componentNameStream) + "\"."); } var hash = this._boundComponentOptions; var hashForComponent = {}; var prop; for (prop in hash) { - if (prop === "_boundComponentOptions" || prop === "componentClassStream") { + if (prop === "_boundComponentOptions" || prop === "componentNameStream") { continue; } hashForComponent[prop] = hash[prop]; } @@ -36009,31 +36152,29 @@ itemViewProps.content = item; itemViewProps.contentIndex = idx; view = this.createChildView(itemViewClass, itemViewProps); - - if (this.blockParams > 1) { - view._blockArguments = [item, view.getStream("_view.contentIndex")]; - } else if (this.blockParams === 1) { - view._blockArguments = [item]; - } - + if (this.blockParams > 0) { + view._blockArguments = [item]; + } + if (this.blockParams > 1) { + view._blockArguments.push(view.getStream("_view.contentIndex")); + } + addedViews.push(view); } this.replace(start, 0, addedViews); - - if (this.blockParams > 1) { - var childViews = this._childViews; - for (idx = start + added; idx < len; idx++) { - view = childViews[idx]; - property_set.set(view, "contentIndex", idx); - } + if (this.blockParams > 1) { + var childViews = this._childViews; + for (idx = start + added; idx < len; idx++) { + view = childViews[idx]; + property_set.set(view, "contentIndex", idx); } - + } } else { emptyView = property_get.get(this, "emptyView"); if (!emptyView) { return; @@ -36148,22 +36289,21 @@ Specifying a template directly to a component is deprecated without also specifying the layout property. @deprecated @property template */ - template: computed.computed({ + template: computed.computed("templateName", { get: function () { var templateName = property_get.get(this, "templateName"); var template = this.templateForName(templateName, "template"); - - return template || property_get.get(this, "defaultTemplate"); + return template || property_get.get(this, "defaultTemplate"); }, set: function (key, value) { return value; } - }).property("templateName"), + }), /** Specifying a components `templateName` is deprecated without also providing the `layout` or `layoutName` properties. @deprecated @@ -36198,14 +36338,14 @@ property will point to the controller of the parent view. @property targetObject @type Ember.Controller @default null */ - targetObject: computed.computed(function (key) { + targetObject: computed.computed("_parentView", function (key) { var parentView = this._parentView; return parentView ? property_get.get(parentView, "controller") : null; - }).property("_parentView"), + }), /** Triggers a named action on the controller context where the component is used if this controller has registered for notifications of the action. For example a component for playing or pausing music may translate click events @@ -36296,12 +36436,12 @@ actionContext: contexts }); }, send: function (actionName) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; } var target; var hasAction = this._actions && this._actions[actionName]; @@ -36970,42 +37110,28 @@ exports['default'] = View['default'].extend(_Metamorph); exports._Metamorph = _Metamorph; }); -enifed('ember-views/views/select', ['exports', 'ember-metal/enumerable_utils', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/views/view', 'ember-views/views/collection_view', 'ember-metal/utils', 'ember-metal/is_none', 'ember-metal/computed', 'ember-runtime/system/native_array', 'ember-metal/mixin', 'ember-metal/properties', 'ember-metal/run_loop', 'ember-htmlbars/templates/select'], function (exports, enumerable_utils, property_get, property_set, View, CollectionView, utils, isNone, computed, native_array, mixin, properties, run, htmlbarsTemplate) { +enifed('ember-views/views/select', ['exports', 'ember-metal/enumerable_utils', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-views/views/view', 'ember-views/views/collection_view', 'ember-metal/utils', 'ember-metal/is_none', 'ember-metal/computed', 'ember-runtime/system/native_array', 'ember-metal/mixin', 'ember-metal/properties', 'ember-htmlbars/templates/select', 'ember-htmlbars/templates/select-option'], function (exports, enumerable_utils, property_get, property_set, View, CollectionView, utils, isNone, computed, native_array, mixin, properties, htmlbarsTemplate, selectOptionDefaultTemplate) { 'use strict'; /** @module ember @submodule ember-views */ var defaultTemplate = htmlbarsTemplate['default']; - var selectOptionDefaultTemplate = { - isHTMLBars: true, - revision: "Ember@1.12.0-beta.1", - render: function (context, env, contextualElement) { - var lazyValue = context.getStream("view.label"); - - lazyValue.subscribe(context._wrapAsScheduled(function () { - run['default'].scheduleOnce("render", context, "rerender"); - })); - - return lazyValue.value(); - } - }; - var SelectOption = View['default'].extend({ instrumentDisplay: "Ember.SelectOption", tagName: "option", attributeBindings: ["value", "selected"], - defaultTemplate: selectOptionDefaultTemplate, + defaultTemplate: selectOptionDefaultTemplate['default'], init: function () { this.labelPathDidChange(); this.valuePathDidChange(); @@ -37066,11 +37192,11 @@ the inner text of each `<option>` element inside the rendered `<select>`. Example: ```javascript - App.ApplicationController = Ember.ObjectController.extend({ + App.ApplicationController = Ember.Controller.extend({ names: ["Yehuda", "Tom"] }); ``` ```handlebars @@ -37088,11 +37214,11 @@ You can control which `<option>` is selected through the `Ember.Select`'s `value` property: ```javascript - App.ApplicationController = Ember.ObjectController.extend({ + App.ApplicationController = Ember.Controller.extend({ selectedName: 'Tom', names: ["Yehuda", "Tom"] }); ``` @@ -37125,11 +37251,11 @@ the desired property for the `value` attribute. The `optionLabelPath` specifies the path on each object to the desired property for the element's text. Both paths must reference each object itself as `content`: ```javascript - App.ApplicationController = Ember.ObjectController.extend({ + App.ApplicationController = Ember.Controller.extend({ programmers: [ {firstName: "Yehuda", id: 1}, {firstName: "Tom", id: 2} ] }); @@ -37153,11 +37279,11 @@ The `value` attribute of the selected `<option>` within an `Ember.Select` can be bound to a property on another object: ```javascript - App.ApplicationController = Ember.ObjectController.extend({ + App.ApplicationController = Ember.Controller.extend({ programmers: [ {firstName: "Yehuda", id: 1}, {firstName: "Tom", id: 2} ], currentProgrammer: { @@ -37196,11 +37322,11 @@ ```javascript var yehuda = {firstName: "Yehuda", id: 1, bff4eva: 'tom'} var tom = {firstName: "Tom", id: 2, bff4eva: 'yehuda'}; - App.ApplicationController = Ember.ObjectController.extend({ + App.ApplicationController = Ember.Controller.extend({ selectedPerson: tom, programmers: [ yehuda, tom ] }); ``` @@ -37230,11 +37356,11 @@ A `null` value for the `Ember.Select`'s `value` or `selection` property results in there being no `<option>` with a `selected` attribute: ```javascript - App.ApplicationController = Ember.ObjectController.extend({ + App.ApplicationController = Ember.Controller.extend({ selectedProgrammer: null, programmers: ["Yehuda", "Tom"] }); ``` @@ -37259,11 +37385,11 @@ first item as though it were selected. You can supply a string value for the `Ember.Select` to display when there is no selection with the `prompt` option: ```javascript - App.ApplicationController = Ember.ObjectController.extend({ + App.ApplicationController = Ember.Controller.extend({ selectedProgrammer: null, programmers: [ "Yehuda", "Tom" ] }); ``` @@ -37862,18 +37988,12 @@ // deferred to allow bindings to synchronize. rerender: function (view) { if (view._root._morph && !view._elementInserted) { throw new EmberError['default']("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM."); } - // TODO: should be scheduled with renderer - run['default'].scheduleOnce("render", function () { - if (view.isDestroying) { - return; - } - view._renderer.renderTree(view, view._parentView); - }); + run['default'].scheduleOnce("render", view, "_rerender"); }, // once the view is already in the DOM, destroying it removes it // from the DOM, nukes its element, and puts it back into the // preRender state if inDOM. @@ -37946,16 +38066,16 @@ 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(); + if (!_attrNodes.length) { + _attrNodes = view._attrNodes = _attrNodes.slice(); } - _childViews.push(attrNode); + _attrNodes.push(attrNode); if (!attrNode._morph) { buffer.pushAttrNode(attrNode); } @@ -37993,16 +38113,16 @@ view._unregister(); } }, appendAttr: function (view, attrNode) { - var _childViews = view._childViews; + var _attrNodes = view._attrNodes; - if (!_childViews.length) { - _childViews = view._childViews = _childViews.slice(); + if (!_attrNodes.length) { + _attrNodes = view._attrNodes = _attrNodes.slice(); } - _childViews.push(attrNode); + _attrNodes.push(attrNode); attrNode._parentView = view; view.renderer.appendAttrTo(attrNode, view.element, attrNode.attrName); view.propertyDidChange("childViews"); @@ -38190,11 +38310,11 @@ */ max: null }); }); -enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-runtime/mixins/evented', 'ember-runtime/system/object', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/deprecate_property', 'ember-metal/property_events', 'ember-views/system/jquery', 'ember-views/system/ext', 'ember-views/views/core_view', 'ember-views/mixins/view_stream_support', 'ember-views/mixins/view_keyword_support', 'ember-views/mixins/view_context_support', 'ember-views/mixins/view_child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/template_rendering_support', 'ember-views/mixins/class_names_support', 'ember-views/mixins/attribute_bindings_support', 'ember-views/mixins/legacy_view_support', 'ember-views/mixins/instrumentation_support', 'ember-views/mixins/visibility_support'], function (exports, Ember, Evented, EmberObject, EmberError, property_get, run, observer, utils, computed, mixin, deprecate_property, property_events, jQuery, __dep13__, CoreView, ViewStreamSupport, ViewKeywordSupport, ViewContextSupport, ViewChildViewsSupport, ViewStateSupport, TemplateRenderingSupport, ClassNamesSupport, AttributeBindingsSupport, LegacyViewSupport, InstrumentationSupport, VisibilitySupport) { +enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-runtime/mixins/evented', 'ember-runtime/system/object', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-metal/deprecate_property', 'ember-metal/property_events', 'ember-views/system/jquery', 'ember-views/system/ext', 'ember-views/views/core_view', 'ember-views/mixins/view_stream_support', 'ember-views/mixins/view_keyword_support', 'ember-views/mixins/view_context_support', 'ember-views/mixins/view_child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/template_rendering_support', 'ember-views/mixins/class_names_support', 'ember-views/mixins/attribute_bindings_support', 'ember-views/mixins/legacy_view_support', 'ember-views/mixins/instrumentation_support', 'ember-views/mixins/visibility_support'], function (exports, Ember, Evented, EmberObject, EmberError, property_get, run, ember_metal__observer, utils, computed, mixin, deprecate_property, property_events, jQuery, __dep13__, CoreView, ViewStreamSupport, ViewKeywordSupport, ViewContextSupport, ViewChildViewsSupport, ViewStateSupport, TemplateRenderingSupport, ClassNamesSupport, AttributeBindingsSupport, LegacyViewSupport, InstrumentationSupport, VisibilitySupport) { 'use strict'; // Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES, // jQuery, Ember.lookup, @@ -38823,10 +38943,18 @@ for additional information. @class View @namespace Ember @extends Ember.CoreView + @uses Ember.ViewContextSupport + @uses Ember.ViewChildViewsSupport + @uses Ember.TemplateRenderingSupport + @uses Ember.ClassNamesSupport + @uses Ember.AttributeBindingsSupport + @uses Ember.LegacyViewSupport + @uses Ember.InstrumentationSupport + @uses Ember.VisibilitySupport */ // jscs:disable validateIndentation var View = CoreView['default'].extend(ViewStreamSupport['default'], ViewKeywordSupport['default'], ViewContextSupport['default'], ViewChildViewsSupport['default'], ViewStateSupport['default'], TemplateRenderingSupport['default'], ClassNamesSupport['default'], AttributeBindingsSupport['default'], LegacyViewSupport['default'], InstrumentationSupport['default'], VisibilitySupport['default'], { /** @@ -38894,19 +39022,25 @@ This is useful for a view that has a shared wrapper, but which delegates the rendering of the contents of the wrapper to the `template` property on a subclass. @property layout @type Function - */ - layout: computed.computed(function (key) { - var layoutName = property_get.get(this, "layoutName"); - var layout = this.templateForName(layoutName, "layout"); + */ + layout: computed.computed("layoutName", { + get: function (key) { + var layoutName = property_get.get(this, "layoutName"); + var layout = this.templateForName(layoutName, "layout"); - - return layout || property_get.get(this, "defaultLayout"); - }).property("layoutName"), + + return layout || property_get.get(this, "defaultLayout"); + }, + set: function (key, value) { + return value; + } + }), + _yield: function (context, options, morph) { var template = property_get.get(this, "template"); if (template) { if (template.isHTMLBars) { @@ -39049,10 +39183,23 @@ */ rerender: function () { return this.currentState.rerender(this); }, + /* + * @private + * + * @method _rerender + */ + _rerender: function () { + if (this.isDestroying || this.isDestroyed) { + return; + } + + this._renderer.renderTree(this, this._parentView); + }, + /** Given a property name, returns a dasherized version of that property name if the property evaluates to a non-falsy value. For example, if the view has property `isUrgent` that evaluates to true, passing `isUrgent` to this method will return `"is-urgent"`. @@ -39234,11 +39381,21 @@ ```handlebars {{my-component elementId="a-really-cool-id"}} ``` If not manually set a default value will be provided by the framework. Once rendered an element's `elementId` is considered immutable and you - should never change it. + should never change it. If you need to compute a dynamic value for the + `elementId`, you should do this when the component or element is being + instantiated: + ```javascript + export default Ember.Component.extend({ + setElementId: function() { + var index = this.get('index'); + this.set('elementId', 'component-id' + index); + }.on('init') + }); + ``` @property elementId @type String */ elementId: null, @@ -39512,14 +39669,14 @@ return; } var scheduledObserver = this._wrapAsScheduled(observer); - observer.addObserver(root, path, target, scheduledObserver); + ember_metal__observer.addObserver(root, path, target, scheduledObserver); this.one("willClearRender", function () { - observer.removeObserver(root, path, target, scheduledObserver); + ember_metal__observer.removeObserver(root, path, target, scheduledObserver); }); }, _wrapAsScheduled: function (fn) { var view = this; @@ -45900,6 +46057,6 @@ }); __exports__.o_create = o_create; }); requireModule("ember"); -})();//# sourceMappingURL=ember.prod.map +})(); \ No newline at end of file