ember-source 2.0.0.beta.2 → 2.0.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ember-source might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-template-compiler.js +44 -309
- data/dist/ember-testing.js +2 -2
- data/dist/ember.debug.js +459 -1507
- data/dist/ember.js +459 -1507
- data/dist/ember.min.js +13 -14
- data/dist/ember.prod.js +446 -1483
- metadata +2 -2
data/dist/ember.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
6
6
|
* @license Licensed under MIT license
|
7
7
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
8
|
-
* @version 2.0.0-beta.
|
8
|
+
* @version 2.0.0-beta.3
|
9
9
|
*/
|
10
10
|
|
11
11
|
(function() {
|
@@ -3398,56 +3398,7 @@ enifed('ember-application', ['exports', 'ember-metal/core', 'ember-runtime/syste
|
|
3398
3398
|
@module ember
|
3399
3399
|
@submodule ember-application
|
3400
3400
|
*/
|
3401
|
-
enifed('ember-application/ext/controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-
|
3402
|
-
|
3403
|
-
function verifyNeedsDependencies(controller, container, needs) {
|
3404
|
-
var dependency, i, l;
|
3405
|
-
var missing = [];
|
3406
|
-
|
3407
|
-
for (i = 0, l = needs.length; i < l; i++) {
|
3408
|
-
dependency = needs[i];
|
3409
|
-
|
3410
|
-
_emberMetalCore.default.assert(_emberMetalUtils.inspect(controller) + '#needs must not specify dependencies with periods in their names (' + dependency + ')', dependency.indexOf('.') === -1);
|
3411
|
-
|
3412
|
-
if (dependency.indexOf(':') === -1) {
|
3413
|
-
dependency = 'controller:' + dependency;
|
3414
|
-
}
|
3415
|
-
|
3416
|
-
// Structure assert to still do verification but not string concat in production
|
3417
|
-
if (!container._registry.has(dependency)) {
|
3418
|
-
missing.push(dependency);
|
3419
|
-
}
|
3420
|
-
}
|
3421
|
-
if (missing.length) {
|
3422
|
-
throw new _emberMetalError.default(_emberMetalUtils.inspect(controller) + ' needs [ ' + missing.join(', ') + ' ] but ' + (missing.length > 1 ? 'they' : 'it') + ' could not be found');
|
3423
|
-
}
|
3424
|
-
}
|
3425
|
-
|
3426
|
-
var defaultControllersComputedProperty = _emberMetalComputed.computed(function () {
|
3427
|
-
var controller = this;
|
3428
|
-
|
3429
|
-
return {
|
3430
|
-
needs: _emberMetalProperty_get.get(controller, 'needs'),
|
3431
|
-
container: _emberMetalProperty_get.get(controller, 'container'),
|
3432
|
-
unknownProperty: function (controllerName) {
|
3433
|
-
var needs = this.needs;
|
3434
|
-
var dependency, i, l;
|
3435
|
-
|
3436
|
-
for (i = 0, l = needs.length; i < l; i++) {
|
3437
|
-
dependency = needs[i];
|
3438
|
-
if (dependency === controllerName) {
|
3439
|
-
return this.container.lookup('controller:' + controllerName);
|
3440
|
-
}
|
3441
|
-
}
|
3442
|
-
|
3443
|
-
var errorMessage = _emberMetalUtils.inspect(controller) + '#needs does not include `' + controllerName + '`. To access the ' + controllerName + ' controller from ' + _emberMetalUtils.inspect(controller) + ', ' + _emberMetalUtils.inspect(controller) + ' should have a `needs` property that is an array of the controllers it has access to.';
|
3444
|
-
throw new ReferenceError(errorMessage);
|
3445
|
-
},
|
3446
|
-
setUnknownProperty: function (key, value) {
|
3447
|
-
throw new Error('You cannot overwrite the value of `controllers.' + key + '` of ' + _emberMetalUtils.inspect(controller));
|
3448
|
-
}
|
3449
|
-
};
|
3450
|
-
});
|
3401
|
+
enifed('ember-application/ext/controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/mixins/controller', 'ember-routing/system/controller_for'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeMixinsController, _emberRoutingSystemController_for) {
|
3451
3402
|
|
3452
3403
|
/**
|
3453
3404
|
@class ControllerMixin
|
@@ -3455,95 +3406,16 @@ enifed('ember-application/ext/controller', ['exports', 'ember-metal/core', 'embe
|
|
3455
3406
|
@public
|
3456
3407
|
*/
|
3457
3408
|
_emberRuntimeMixinsController.default.reopen({
|
3458
|
-
concatenatedProperties: ['needs'],
|
3459
|
-
|
3460
|
-
/**
|
3461
|
-
An array of other controller objects available inside
|
3462
|
-
instances of this controller via the `controllers`
|
3463
|
-
property:
|
3464
|
-
For example, when you define a controller:
|
3465
|
-
```javascript
|
3466
|
-
App.CommentsController = Ember.ArrayController.extend({
|
3467
|
-
needs: ['post']
|
3468
|
-
});
|
3469
|
-
```
|
3470
|
-
The application's single instance of these other
|
3471
|
-
controllers are accessible by name through the
|
3472
|
-
`controllers` property:
|
3473
|
-
```javascript
|
3474
|
-
this.get('controllers.post'); // instance of App.PostController
|
3475
|
-
```
|
3476
|
-
Given that you have a nested controller (nested routes):
|
3477
|
-
```javascript
|
3478
|
-
App.CommentsNewController = Ember.Controller.extend({
|
3479
|
-
});
|
3480
|
-
```
|
3481
|
-
When you define a controller that requires access to a nested one:
|
3482
|
-
```javascript
|
3483
|
-
App.IndexController = Ember.Controller.extend({
|
3484
|
-
needs: ['commentsNew']
|
3485
|
-
});
|
3486
|
-
```
|
3487
|
-
You will be able to get access to it:
|
3488
|
-
```javascript
|
3489
|
-
this.get('controllers.commentsNew'); // instance of App.CommentsNewController
|
3490
|
-
```
|
3491
|
-
This is only available for singleton controllers.
|
3492
|
-
@deprecated Use `Ember.inject.controller()` instead.
|
3493
|
-
@property {Array} needs
|
3494
|
-
@default []
|
3495
|
-
@public
|
3496
|
-
*/
|
3497
|
-
needs: [],
|
3498
|
-
|
3499
|
-
init: function () {
|
3500
|
-
var needs = _emberMetalProperty_get.get(this, 'needs');
|
3501
|
-
var length = _emberMetalProperty_get.get(needs, 'length');
|
3502
|
-
|
3503
|
-
if (length > 0) {
|
3504
|
-
_emberMetalCore.default.assert(' `' + _emberMetalUtils.inspect(this) + ' specifies `needs`, but does ' + 'not have a container. Please ensure this controller was ' + 'instantiated with a container.', this.container || this.controllers !== defaultControllersComputedProperty);
|
3505
|
-
|
3506
|
-
if (this.container) {
|
3507
|
-
verifyNeedsDependencies(this, this.container, needs);
|
3508
|
-
}
|
3509
|
-
|
3510
|
-
// if needs then initialize controllers proxy
|
3511
|
-
_emberMetalProperty_get.get(this, 'controllers');
|
3512
|
-
}
|
3513
|
-
|
3514
|
-
this._super.apply(this, arguments);
|
3515
|
-
},
|
3516
|
-
|
3517
3409
|
/**
|
3518
3410
|
@method controllerFor
|
3519
3411
|
@see {Ember.Route#controllerFor}
|
3520
|
-
@deprecated Use `
|
3412
|
+
@deprecated Use `Ember.inject.controller()` instead.
|
3521
3413
|
@public
|
3522
3414
|
*/
|
3523
3415
|
controllerFor: function (controllerName) {
|
3524
|
-
_emberMetalCore.default.deprecate('Controller#controllerFor is deprecated, please use
|
3416
|
+
_emberMetalCore.default.deprecate('Controller#controllerFor is deprecated, please use Ember.inject.controller() instead');
|
3525
3417
|
return _emberRoutingSystemController_for.default(_emberMetalProperty_get.get(this, 'container'), controllerName);
|
3526
|
-
}
|
3527
|
-
|
3528
|
-
/**
|
3529
|
-
Stores the instances of other controllers available from within
|
3530
|
-
this controller. Any controller listed by name in the `needs`
|
3531
|
-
property will be accessible by name through this property.
|
3532
|
-
```javascript
|
3533
|
-
App.CommentsController = Ember.ArrayController.extend({
|
3534
|
-
needs: ['post'],
|
3535
|
-
postTitle: function() {
|
3536
|
-
var currentPost = this.get('controllers.post'); // instance of App.PostController
|
3537
|
-
return currentPost.get('title');
|
3538
|
-
}.property('controllers.post.title')
|
3539
|
-
});
|
3540
|
-
```
|
3541
|
-
@see {Ember.ControllerMixin#needs}
|
3542
|
-
@property {Object} controllers
|
3543
|
-
@default null
|
3544
|
-
@public
|
3545
|
-
*/
|
3546
|
-
controllers: defaultControllersComputedProperty
|
3418
|
+
}
|
3547
3419
|
});
|
3548
3420
|
|
3549
3421
|
exports.default = _emberRuntimeMixinsController.default;
|
@@ -3755,7 +3627,7 @@ enifed('ember-application/system/application-instance', ['exports', 'ember-metal
|
|
3755
3627
|
@submodule ember-application
|
3756
3628
|
@private
|
3757
3629
|
*/
|
3758
|
-
enifed('ember-application/system/application', ['exports', 'dag-map', 'container/registry', 'ember-metal', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/lazy_load', 'ember-runtime/system/namespace', 'ember-application/system/resolver', 'ember-metal/run_loop', 'ember-metal/utils', 'ember-runtime/controllers/controller', 'ember-
|
3630
|
+
enifed('ember-application/system/application', ['exports', 'dag-map', 'container/registry', 'ember-metal', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-runtime/system/lazy_load', 'ember-runtime/system/namespace', 'ember-application/system/resolver', 'ember-metal/run_loop', 'ember-metal/utils', 'ember-runtime/controllers/controller', 'ember-metal-views/renderer', 'ember-htmlbars/system/dom-helper', 'ember-views/views/select', 'ember-routing-views/views/outlet', 'ember-views/views/view', 'ember-views/system/event_dispatcher', 'ember-views/system/jquery', 'ember-routing/system/route', 'ember-routing/system/router', 'ember-routing/location/hash_location', 'ember-routing/location/history_location', 'ember-routing/location/auto_location', 'ember-routing/location/none_location', 'ember-routing/system/cache', 'ember-application/system/application-instance', 'ember-views/views/text_field', 'ember-views/views/text_area', 'ember-views/views/checkbox', 'ember-views/views/legacy_each_view', 'ember-routing-views/views/link', 'ember-routing/services/routing', 'ember-extension-support/container_debug_adapter', 'ember-metal/environment'], function (exports, _dagMap, _containerRegistry, _emberMetal, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberRuntimeSystemLazy_load, _emberRuntimeSystemNamespace, _emberApplicationSystemResolver, _emberMetalRun_loop, _emberMetalUtils, _emberRuntimeControllersController, _emberMetalViewsRenderer, _emberHtmlbarsSystemDomHelper, _emberViewsViewsSelect, _emberRoutingViewsViewsOutlet, _emberViewsViewsView, _emberViewsSystemEvent_dispatcher, _emberViewsSystemJquery, _emberRoutingSystemRoute, _emberRoutingSystemRouter, _emberRoutingLocationHash_location, _emberRoutingLocationHistory_location, _emberRoutingLocationAuto_location, _emberRoutingLocationNone_location, _emberRoutingSystemCache, _emberApplicationSystemApplicationInstance, _emberViewsViewsText_field, _emberViewsViewsText_area, _emberViewsViewsCheckbox, _emberViewsViewsLegacy_each_view, _emberRoutingViewsViewsLink, _emberRoutingServicesRouting, _emberExtensionSupportContainer_debug_adapter, _emberMetalEnvironment) {
|
3759
3631
|
|
3760
3632
|
function props(obj) {
|
3761
3633
|
var properties = [];
|
@@ -4417,17 +4289,6 @@ enifed('ember-application/system/application', ['exports', 'dag-map', 'container
|
|
4417
4289
|
|
4418
4290
|
initializer: function (options) {
|
4419
4291
|
this.constructor.initializer(options);
|
4420
|
-
},
|
4421
|
-
|
4422
|
-
/**
|
4423
|
-
@method then
|
4424
|
-
@private
|
4425
|
-
@deprecated
|
4426
|
-
*/
|
4427
|
-
then: function () {
|
4428
|
-
_emberMetal.default.deprecate('Do not use `.then` on an instance of Ember.Application. Please use the `.ready` hook instead.', false, { url: 'http://emberjs.com/guides/deprecations/#toc_deprecate-code-then-code-on-ember-application' });
|
4429
|
-
|
4430
|
-
this._super.apply(this, arguments);
|
4431
4292
|
}
|
4432
4293
|
});
|
4433
4294
|
|
@@ -4581,7 +4442,6 @@ enifed('ember-application/system/application', ['exports', 'dag-map', 'container
|
|
4581
4442
|
registry.register('application:main', namespace, { instantiate: false });
|
4582
4443
|
|
4583
4444
|
registry.register('controller:basic', _emberRuntimeControllersController.default, { instantiate: false });
|
4584
|
-
registry.register('controller:array', _emberRuntimeControllersArray_controller.default, { instantiate: false });
|
4585
4445
|
|
4586
4446
|
registry.register('renderer:-dom', { create: function () {
|
4587
4447
|
return new _emberMetalViewsRenderer.default(new _emberHtmlbarsSystemDomHelper.default());
|
@@ -6214,7 +6074,7 @@ enifed('ember-extension-support/data_adapter', ['exports', 'ember-metal/property
|
|
6214
6074
|
}
|
6215
6075
|
});
|
6216
6076
|
});
|
6217
|
-
enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-template-compiler', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/system/make_bound_helper', 'ember-htmlbars/helpers', 'ember-htmlbars/helpers/if_unless', 'ember-htmlbars/helpers/with', 'ember-htmlbars/helpers/loc', 'ember-htmlbars/helpers/log', 'ember-htmlbars/helpers/each', 'ember-htmlbars/helpers/each-in', 'ember-htmlbars/helpers/-normalize-class', 'ember-htmlbars/helpers/-concat', 'ember-htmlbars/helpers/-join-classes', 'ember-htmlbars/helpers/-legacy-each-with-controller', 'ember-htmlbars/helpers/-legacy-each-with-keyword', 'ember-htmlbars/helpers/-
|
6077
|
+
enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-template-compiler', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/system/make_bound_helper', 'ember-htmlbars/helpers', 'ember-htmlbars/helpers/if_unless', 'ember-htmlbars/helpers/with', 'ember-htmlbars/helpers/loc', 'ember-htmlbars/helpers/log', 'ember-htmlbars/helpers/each', 'ember-htmlbars/helpers/each-in', 'ember-htmlbars/helpers/-normalize-class', 'ember-htmlbars/helpers/-concat', 'ember-htmlbars/helpers/-join-classes', 'ember-htmlbars/helpers/-legacy-each-with-controller', 'ember-htmlbars/helpers/-legacy-each-with-keyword', 'ember-htmlbars/helpers/-html-safe', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/helper', 'ember-htmlbars/system/bootstrap', 'ember-htmlbars/compat'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberTemplateCompiler, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsSystemMake_bound_helper, _emberHtmlbarsHelpers, _emberHtmlbarsHelpersIf_unless, _emberHtmlbarsHelpersWith, _emberHtmlbarsHelpersLoc, _emberHtmlbarsHelpersLog, _emberHtmlbarsHelpersEach, _emberHtmlbarsHelpersEachIn, _emberHtmlbarsHelpersNormalizeClass, _emberHtmlbarsHelpersConcat, _emberHtmlbarsHelpersJoinClasses, _emberHtmlbarsHelpersLegacyEachWithController, _emberHtmlbarsHelpersLegacyEachWithKeyword, _emberHtmlbarsHelpersHtmlSafe, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsHelper, _emberHtmlbarsSystemBootstrap, _emberHtmlbarsCompat) {
|
6218
6078
|
|
6219
6079
|
_emberHtmlbarsHelpers.registerHelper('if', _emberHtmlbarsHelpersIf_unless.ifHelper);
|
6220
6080
|
_emberHtmlbarsHelpers.registerHelper('unless', _emberHtmlbarsHelpersIf_unless.unlessHelper);
|
@@ -6228,13 +6088,13 @@ enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features',
|
|
6228
6088
|
_emberHtmlbarsHelpers.registerHelper('-normalize-class', _emberHtmlbarsHelpersNormalizeClass.default);
|
6229
6089
|
_emberHtmlbarsHelpers.registerHelper('concat', _emberHtmlbarsHelpersConcat.default);
|
6230
6090
|
_emberHtmlbarsHelpers.registerHelper('-join-classes', _emberHtmlbarsHelpersJoinClasses.default);
|
6231
|
-
_emberHtmlbarsHelpers.registerHelper('-legacy-each-with-controller', _emberHtmlbarsHelpersLegacyEachWithController.default);
|
6232
|
-
_emberHtmlbarsHelpers.registerHelper('-legacy-each-with-keyword', _emberHtmlbarsHelpersLegacyEachWithKeyword.default);
|
6233
|
-
|
6234
|
-
_emberHtmlbarsHelpers.registerHelper('-get', _emberHtmlbarsHelpersGet.default);
|
6235
|
-
|
6236
6091
|
_emberHtmlbarsHelpers.registerHelper('-html-safe', _emberHtmlbarsHelpersHtmlSafe.default);
|
6237
6092
|
|
6093
|
+
if (_emberMetalCore.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
6094
|
+
_emberHtmlbarsHelpers.registerHelper('-legacy-each-with-controller', _emberHtmlbarsHelpersLegacyEachWithController.default);
|
6095
|
+
_emberHtmlbarsHelpers.registerHelper('-legacy-each-with-keyword', _emberHtmlbarsHelpersLegacyEachWithKeyword.default);
|
6096
|
+
}
|
6097
|
+
|
6238
6098
|
_emberMetalCore.default.HTMLBars = {
|
6239
6099
|
_registerHelper: _emberHtmlbarsHelpers.registerHelper,
|
6240
6100
|
template: _emberTemplateCompiler.template,
|
@@ -6253,9 +6113,10 @@ enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features',
|
|
6253
6113
|
|
6254
6114
|
|
6255
6115
|
|
6256
|
-
@module ember
|
6257
|
-
@submodule ember-templates
|
6258
|
-
@main ember-templates
|
6116
|
+
@module ember
|
6117
|
+
@submodule ember-templates
|
6118
|
+
@main ember-templates
|
6119
|
+
@public
|
6259
6120
|
*/
|
6260
6121
|
|
6261
6122
|
/**
|
@@ -6267,9 +6128,10 @@ enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features',
|
|
6267
6128
|
helpers, please see the [ember-templates](/api/modules/ember-templates.html)
|
6268
6129
|
package.
|
6269
6130
|
|
6270
|
-
@module ember
|
6271
|
-
@submodule ember-htmlbars
|
6272
|
-
@main ember-htmlbars
|
6131
|
+
@module ember
|
6132
|
+
@submodule ember-htmlbars
|
6133
|
+
@main ember-htmlbars
|
6134
|
+
@public
|
6273
6135
|
*/
|
6274
6136
|
|
6275
6137
|
// importing adds template bootstrapping
|
@@ -6277,7 +6139,7 @@ enifed('ember-htmlbars', ['exports', 'ember-metal/core', 'ember-metal/features',
|
|
6277
6139
|
|
6278
6140
|
// importing ember-htmlbars/compat updates the
|
6279
6141
|
// Ember.Handlebars global if htmlbars is enabled
|
6280
|
-
enifed('ember-htmlbars/compat', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-htmlbars/compat/helper', 'ember-htmlbars/compat/
|
6142
|
+
enifed('ember-htmlbars/compat', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-htmlbars/compat/helper', 'ember-htmlbars/compat/make-bound-helper', 'ember-htmlbars/compat/register-bound-helper', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/utils/string'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberHtmlbarsCompatHelper, _emberHtmlbarsCompatMakeBoundHelper, _emberHtmlbarsCompatRegisterBoundHelper, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsUtilsString) {
|
6281
6143
|
|
6282
6144
|
var EmberHandlebars = _emberMetalCore.default.Handlebars = _emberMetalCore.default.Handlebars || {};
|
6283
6145
|
EmberHandlebars.helpers = _emberHtmlbarsHelpers.default;
|
@@ -6285,7 +6147,6 @@ enifed('ember-htmlbars/compat', ['exports', 'ember-metal/core', 'ember-htmlbars/
|
|
6285
6147
|
EmberHandlebars.registerHelper = _emberHtmlbarsCompatHelper.registerHandlebarsCompatibleHelper;
|
6286
6148
|
EmberHandlebars.registerBoundHelper = _emberHtmlbarsCompatRegisterBoundHelper.default;
|
6287
6149
|
EmberHandlebars.makeBoundHelper = _emberHtmlbarsCompatMakeBoundHelper.default;
|
6288
|
-
EmberHandlebars.get = _emberHtmlbarsCompatHandlebarsGet.default;
|
6289
6150
|
EmberHandlebars.makeViewHelper = _emberHtmlbarsSystemMakeViewHelper.default;
|
6290
6151
|
|
6291
6152
|
EmberHandlebars.SafeString = _emberHtmlbarsUtilsString.SafeString;
|
@@ -6295,33 +6156,6 @@ enifed('ember-htmlbars/compat', ['exports', 'ember-metal/core', 'ember-htmlbars/
|
|
6295
6156
|
|
6296
6157
|
exports.default = EmberHandlebars;
|
6297
6158
|
});
|
6298
|
-
enifed('ember-htmlbars/compat/handlebars-get', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) {
|
6299
|
-
exports.default = handlebarsGet;
|
6300
|
-
|
6301
|
-
/**
|
6302
|
-
Lookup both on root and on window. If the path starts with
|
6303
|
-
a keyword, the corresponding object will be looked up in the
|
6304
|
-
template's data hash and used to resolve the path.
|
6305
|
-
|
6306
|
-
@method get
|
6307
|
-
@for Ember.Handlebars
|
6308
|
-
@param {Object} root The object to look up the property on
|
6309
|
-
@param {String} path The path to be lookedup
|
6310
|
-
@param {Object} options The template's option hash
|
6311
|
-
@deprecated
|
6312
|
-
@public
|
6313
|
-
*/
|
6314
|
-
|
6315
|
-
function handlebarsGet(root, path, options) {
|
6316
|
-
_emberMetalCore.default.deprecate('Usage of Ember.Handlebars.get is deprecated, use a Component or Ember.Handlebars.makeBoundHelper instead.');
|
6317
|
-
|
6318
|
-
return options.legacyGetPath(path);
|
6319
|
-
}
|
6320
|
-
});
|
6321
|
-
/**
|
6322
|
-
@module ember
|
6323
|
-
@submodule ember-htmlbars
|
6324
|
-
*/
|
6325
6159
|
enifed('ember-htmlbars/compat/helper', ['exports', 'ember-metal/core', 'ember-htmlbars/helpers', 'ember-views/views/view', 'ember-views/views/component', 'ember-htmlbars/system/make-view-helper', 'ember-htmlbars/compat/make-bound-helper', 'ember-metal/streams/utils', 'ember-htmlbars/keywords'], function (exports, _emberMetalCore, _emberHtmlbarsHelpers, _emberViewsViewsView, _emberViewsViewsComponent, _emberHtmlbarsSystemMakeViewHelper, _emberHtmlbarsCompatMakeBoundHelper, _emberMetalStreamsUtils, _emberHtmlbarsKeywords) {
|
6326
6160
|
exports.registerHandlebarsCompatibleHelper = registerHandlebarsCompatibleHelper;
|
6327
6161
|
exports.handlebarsHelper = handlebarsHelper;
|
@@ -6673,7 +6507,7 @@ enifed('ember-htmlbars/compat/register-bound-helper', ['exports', 'ember-htmlbar
|
|
6673
6507
|
@module ember
|
6674
6508
|
@submodule ember-htmlbars
|
6675
6509
|
*/
|
6676
|
-
enifed('ember-htmlbars/env', ['exports', 'ember-metal/features', 'ember-metal/environment', 'htmlbars-runtime', 'ember-metal/merge', 'ember-htmlbars/hooks/subexpr', 'ember-htmlbars/hooks/concat', 'ember-htmlbars/hooks/link-render-node', 'ember-htmlbars/hooks/create-fresh-scope', 'ember-htmlbars/hooks/bind-shadow-scope', 'ember-htmlbars/hooks/bind-self', 'ember-htmlbars/hooks/bind-scope', 'ember-htmlbars/hooks/bind-local', 'ember-htmlbars/hooks/update-self', 'ember-htmlbars/hooks/get-root', 'ember-htmlbars/hooks/get-child', 'ember-htmlbars/hooks/get-value', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/hooks/cleanup-render-node', 'ember-htmlbars/hooks/destroy-render-node', 'ember-htmlbars/hooks/did-render-node', 'ember-htmlbars/hooks/will-cleanup-tree', 'ember-htmlbars/hooks/did-cleanup-tree', 'ember-htmlbars/hooks/classify', 'ember-htmlbars/hooks/component', 'ember-htmlbars/hooks/lookup-helper', 'ember-htmlbars/hooks/has-helper', 'ember-htmlbars/hooks/invoke-helper', 'ember-htmlbars/hooks/element', 'ember-htmlbars/helpers', 'ember-htmlbars/keywords', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/keywords/debugger', 'ember-htmlbars/keywords/with', 'ember-htmlbars/keywords/outlet', 'ember-htmlbars/keywords/real_outlet', 'ember-htmlbars/keywords/customized_outlet', 'ember-htmlbars/keywords/unbound', 'ember-htmlbars/keywords/view', 'ember-htmlbars/keywords/component', 'ember-htmlbars/keywords/partial', 'ember-htmlbars/keywords/input', 'ember-htmlbars/keywords/textarea', 'ember-htmlbars/keywords/collection', 'ember-htmlbars/keywords/template', 'ember-htmlbars/keywords/legacy-yield', 'ember-htmlbars/keywords/mut', 'ember-htmlbars/keywords/each', 'ember-htmlbars/keywords/readonly', 'ember-htmlbars/keywords/get'], function (exports, _emberMetalFeatures, _emberMetalEnvironment, _htmlbarsRuntime, _emberMetalMerge, _emberHtmlbarsHooksSubexpr, _emberHtmlbarsHooksConcat, _emberHtmlbarsHooksLinkRenderNode, _emberHtmlbarsHooksCreateFreshScope, _emberHtmlbarsHooksBindShadowScope, _emberHtmlbarsHooksBindSelf, _emberHtmlbarsHooksBindScope, _emberHtmlbarsHooksBindLocal, _emberHtmlbarsHooksUpdateSelf, _emberHtmlbarsHooksGetRoot, _emberHtmlbarsHooksGetChild, _emberHtmlbarsHooksGetValue, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsHooksCleanupRenderNode, _emberHtmlbarsHooksDestroyRenderNode, _emberHtmlbarsHooksDidRenderNode, _emberHtmlbarsHooksWillCleanupTree, _emberHtmlbarsHooksDidCleanupTree, _emberHtmlbarsHooksClassify, _emberHtmlbarsHooksComponent, _emberHtmlbarsHooksLookupHelper, _emberHtmlbarsHooksHasHelper, _emberHtmlbarsHooksInvokeHelper, _emberHtmlbarsHooksElement, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsKeywordsDebugger, _emberHtmlbarsKeywordsWith, _emberHtmlbarsKeywordsOutlet, _emberHtmlbarsKeywordsReal_outlet, _emberHtmlbarsKeywordsCustomized_outlet, _emberHtmlbarsKeywordsUnbound, _emberHtmlbarsKeywordsView, _emberHtmlbarsKeywordsComponent, _emberHtmlbarsKeywordsPartial, _emberHtmlbarsKeywordsInput, _emberHtmlbarsKeywordsTextarea, _emberHtmlbarsKeywordsCollection, _emberHtmlbarsKeywordsTemplate, _emberHtmlbarsKeywordsLegacyYield, _emberHtmlbarsKeywordsMut, _emberHtmlbarsKeywordsEach, _emberHtmlbarsKeywordsReadonly, _emberHtmlbarsKeywordsGet) {
|
6510
|
+
enifed('ember-htmlbars/env', ['exports', 'ember-metal', 'ember-metal/features', 'ember-metal/environment', 'htmlbars-runtime', 'ember-metal/merge', 'ember-htmlbars/hooks/subexpr', 'ember-htmlbars/hooks/concat', 'ember-htmlbars/hooks/link-render-node', 'ember-htmlbars/hooks/create-fresh-scope', 'ember-htmlbars/hooks/bind-shadow-scope', 'ember-htmlbars/hooks/bind-self', 'ember-htmlbars/hooks/bind-scope', 'ember-htmlbars/hooks/bind-local', 'ember-htmlbars/hooks/update-self', 'ember-htmlbars/hooks/get-root', 'ember-htmlbars/hooks/get-child', 'ember-htmlbars/hooks/get-value', 'ember-htmlbars/hooks/get-cell-or-value', 'ember-htmlbars/hooks/cleanup-render-node', 'ember-htmlbars/hooks/destroy-render-node', 'ember-htmlbars/hooks/did-render-node', 'ember-htmlbars/hooks/will-cleanup-tree', 'ember-htmlbars/hooks/did-cleanup-tree', 'ember-htmlbars/hooks/classify', 'ember-htmlbars/hooks/component', 'ember-htmlbars/hooks/lookup-helper', 'ember-htmlbars/hooks/has-helper', 'ember-htmlbars/hooks/invoke-helper', 'ember-htmlbars/hooks/element', 'ember-htmlbars/helpers', 'ember-htmlbars/keywords', 'ember-htmlbars/system/dom-helper', 'ember-htmlbars/keywords/debugger', 'ember-htmlbars/keywords/with', 'ember-htmlbars/keywords/outlet', 'ember-htmlbars/keywords/real_outlet', 'ember-htmlbars/keywords/customized_outlet', 'ember-htmlbars/keywords/unbound', 'ember-htmlbars/keywords/view', 'ember-htmlbars/keywords/component', 'ember-htmlbars/keywords/partial', 'ember-htmlbars/keywords/input', 'ember-htmlbars/keywords/textarea', 'ember-htmlbars/keywords/collection', 'ember-htmlbars/keywords/template', 'ember-htmlbars/keywords/legacy-yield', 'ember-htmlbars/keywords/mut', 'ember-htmlbars/keywords/each', 'ember-htmlbars/keywords/readonly', 'ember-htmlbars/keywords/get'], function (exports, _emberMetal, _emberMetalFeatures, _emberMetalEnvironment, _htmlbarsRuntime, _emberMetalMerge, _emberHtmlbarsHooksSubexpr, _emberHtmlbarsHooksConcat, _emberHtmlbarsHooksLinkRenderNode, _emberHtmlbarsHooksCreateFreshScope, _emberHtmlbarsHooksBindShadowScope, _emberHtmlbarsHooksBindSelf, _emberHtmlbarsHooksBindScope, _emberHtmlbarsHooksBindLocal, _emberHtmlbarsHooksUpdateSelf, _emberHtmlbarsHooksGetRoot, _emberHtmlbarsHooksGetChild, _emberHtmlbarsHooksGetValue, _emberHtmlbarsHooksGetCellOrValue, _emberHtmlbarsHooksCleanupRenderNode, _emberHtmlbarsHooksDestroyRenderNode, _emberHtmlbarsHooksDidRenderNode, _emberHtmlbarsHooksWillCleanupTree, _emberHtmlbarsHooksDidCleanupTree, _emberHtmlbarsHooksClassify, _emberHtmlbarsHooksComponent, _emberHtmlbarsHooksLookupHelper, _emberHtmlbarsHooksHasHelper, _emberHtmlbarsHooksInvokeHelper, _emberHtmlbarsHooksElement, _emberHtmlbarsHelpers, _emberHtmlbarsKeywords, _emberHtmlbarsSystemDomHelper, _emberHtmlbarsKeywordsDebugger, _emberHtmlbarsKeywordsWith, _emberHtmlbarsKeywordsOutlet, _emberHtmlbarsKeywordsReal_outlet, _emberHtmlbarsKeywordsCustomized_outlet, _emberHtmlbarsKeywordsUnbound, _emberHtmlbarsKeywordsView, _emberHtmlbarsKeywordsComponent, _emberHtmlbarsKeywordsPartial, _emberHtmlbarsKeywordsInput, _emberHtmlbarsKeywordsTextarea, _emberHtmlbarsKeywordsCollection, _emberHtmlbarsKeywordsTemplate, _emberHtmlbarsKeywordsLegacyYield, _emberHtmlbarsKeywordsMut, _emberHtmlbarsKeywordsEach, _emberHtmlbarsKeywordsReadonly, _emberHtmlbarsKeywordsGet) {
|
6677
6511
|
|
6678
6512
|
var emberHooks = _emberMetalMerge.default({}, _htmlbarsRuntime.hooks);
|
6679
6513
|
emberHooks.keywords = _emberHtmlbarsKeywords.default;
|
@@ -6711,7 +6545,6 @@ enifed('ember-htmlbars/env', ['exports', 'ember-metal/features', 'ember-metal/en
|
|
6711
6545
|
_emberHtmlbarsKeywords.registerKeyword('@real_outlet', _emberHtmlbarsKeywordsReal_outlet.default);
|
6712
6546
|
_emberHtmlbarsKeywords.registerKeyword('@customized_outlet', _emberHtmlbarsKeywordsCustomized_outlet.default);
|
6713
6547
|
_emberHtmlbarsKeywords.registerKeyword('unbound', _emberHtmlbarsKeywordsUnbound.default);
|
6714
|
-
_emberHtmlbarsKeywords.registerKeyword('view', _emberHtmlbarsKeywordsView.default);
|
6715
6548
|
_emberHtmlbarsKeywords.registerKeyword('component', _emberHtmlbarsKeywordsComponent.default);
|
6716
6549
|
_emberHtmlbarsKeywords.registerKeyword('partial', _emberHtmlbarsKeywordsPartial.default);
|
6717
6550
|
_emberHtmlbarsKeywords.registerKeyword('template', _emberHtmlbarsKeywordsTemplate.default);
|
@@ -6724,6 +6557,10 @@ enifed('ember-htmlbars/env', ['exports', 'ember-metal/features', 'ember-metal/en
|
|
6724
6557
|
_emberHtmlbarsKeywords.registerKeyword('each', _emberHtmlbarsKeywordsEach.default);
|
6725
6558
|
_emberHtmlbarsKeywords.registerKeyword('readonly', _emberHtmlbarsKeywordsReadonly.default);
|
6726
6559
|
|
6560
|
+
if (_emberMetal.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
6561
|
+
_emberHtmlbarsKeywords.registerKeyword('view', _emberHtmlbarsKeywordsView.default);
|
6562
|
+
}
|
6563
|
+
|
6727
6564
|
_emberHtmlbarsKeywords.registerKeyword('get', _emberHtmlbarsKeywordsGet.default);
|
6728
6565
|
exports.default = {
|
6729
6566
|
hooks: emberHooks,
|
@@ -6904,21 +6741,6 @@ enifed('ember-htmlbars/helpers/-concat', ['exports'], function (exports) {
|
|
6904
6741
|
return params.join('');
|
6905
6742
|
}
|
6906
6743
|
});
|
6907
|
-
enifed('ember-htmlbars/helpers/-get', ['exports', 'ember-metal/features'], function (exports, _emberMetalFeatures) {
|
6908
|
-
|
6909
|
-
/*
|
6910
|
-
This private helper is used in conjuntion with the get keyword
|
6911
|
-
@private
|
6912
|
-
*/
|
6913
|
-
|
6914
|
-
var getHelper = function getHelper(_ref) {
|
6915
|
-
var value = _ref[0];
|
6916
|
-
|
6917
|
-
return value;
|
6918
|
-
};
|
6919
|
-
|
6920
|
-
exports.default = getHelper;
|
6921
|
-
});
|
6922
6744
|
enifed('ember-htmlbars/helpers/-html-safe', ['exports', 'htmlbars-util/safe-string'], function (exports, _htmlbarsUtilSafeString) {
|
6923
6745
|
exports.default = htmlSafeHelper;
|
6924
6746
|
|
@@ -7381,7 +7203,7 @@ enifed('ember-htmlbars/helpers/log', ['exports', 'ember-metal/logger'], function
|
|
7381
7203
|
@module ember
|
7382
7204
|
@submodule ember-templates
|
7383
7205
|
*/
|
7384
|
-
enifed('ember-htmlbars/helpers/with', ['exports', 'ember-
|
7206
|
+
enifed('ember-htmlbars/helpers/with', ['exports', 'ember-views/streams/should_display'], function (exports, _emberViewsStreamsShould_display) {
|
7385
7207
|
exports.default = withHelper;
|
7386
7208
|
|
7387
7209
|
/**
|
@@ -7419,26 +7241,7 @@ enifed('ember-htmlbars/helpers/with', ['exports', 'ember-htmlbars/utils/normaliz
|
|
7419
7241
|
|
7420
7242
|
function withHelper(params, hash, options) {
|
7421
7243
|
if (_emberViewsStreamsShould_display.default(params[0])) {
|
7422
|
-
|
7423
|
-
|
7424
|
-
if (options.template.arity !== 0) {
|
7425
|
-
preserveContext = true;
|
7426
|
-
}
|
7427
|
-
|
7428
|
-
if (preserveContext) {
|
7429
|
-
this.yield([params[0]]);
|
7430
|
-
} else {
|
7431
|
-
var _self = _emberHtmlbarsUtilsNormalizeSelf.default(params[0]);
|
7432
|
-
if (hash.controller) {
|
7433
|
-
_self = {
|
7434
|
-
hasBoundController: true,
|
7435
|
-
controller: hash.controller,
|
7436
|
-
self: _self
|
7437
|
-
};
|
7438
|
-
}
|
7439
|
-
|
7440
|
-
this.yield([], _self);
|
7441
|
-
}
|
7244
|
+
this.yield([params[0]]);
|
7442
7245
|
} else if (options.inverse && options.inverse.yield) {
|
7443
7246
|
options.inverse.yield([]);
|
7444
7247
|
}
|
@@ -8294,6 +8097,54 @@ enifed('ember-htmlbars/keywords/collection', ['exports', 'ember-views/streams/ut
|
|
8294
8097
|
@submodule ember-htmlbars
|
8295
8098
|
*/
|
8296
8099
|
enifed('ember-htmlbars/keywords/component', ['exports', 'ember-metal/merge'], function (exports, _emberMetalMerge) {
|
8100
|
+
|
8101
|
+
/**
|
8102
|
+
The `{{component}}` helper lets you add instances of `Ember.Component` to a
|
8103
|
+
template. See [Ember.Component](/api/classes/Ember.Component.html) for
|
8104
|
+
additional information on how a `Component` functions.
|
8105
|
+
`{{component}}`'s primary use is for cases where you want to dynamically
|
8106
|
+
change which type of component is rendered as the state of your application
|
8107
|
+
changes. The provided block will be applied as the template for the component.
|
8108
|
+
Given an empty `<body>` the following template:
|
8109
|
+
|
8110
|
+
```handlebars
|
8111
|
+
{{! application.hbs }}
|
8112
|
+
{{component infographicComponentName}}
|
8113
|
+
```
|
8114
|
+
|
8115
|
+
And the following application code:
|
8116
|
+
|
8117
|
+
```javascript
|
8118
|
+
export default Ember.Controller.extend({
|
8119
|
+
infographicComponentName: computed('isMarketOpen', {
|
8120
|
+
get() {
|
8121
|
+
if (this.get('isMarketOpen')) {
|
8122
|
+
return 'live-updating-chart';
|
8123
|
+
} else {
|
8124
|
+
return 'market-close-summary';
|
8125
|
+
}
|
8126
|
+
}
|
8127
|
+
})
|
8128
|
+
});
|
8129
|
+
```
|
8130
|
+
|
8131
|
+
The `live-updating-chart` component will be appended when `isMarketOpen` is
|
8132
|
+
`true`, and the `market-close-summary` component will be appended when
|
8133
|
+
`isMarketOpen` is `false`. If the value changes while the app is running,
|
8134
|
+
the component will be automatically swapped out accordingly.
|
8135
|
+
Note: You should not use this helper when you are consistently rendering the same
|
8136
|
+
component. In that case, use standard component syntax, for example:
|
8137
|
+
|
8138
|
+
```handlebars
|
8139
|
+
{{! application.hbs }}
|
8140
|
+
{{live-updating-chart}}
|
8141
|
+
```
|
8142
|
+
|
8143
|
+
@method component
|
8144
|
+
@since 1.11.0
|
8145
|
+
@for Ember.Templates.helpers
|
8146
|
+
@public
|
8147
|
+
*/
|
8297
8148
|
exports.default = {
|
8298
8149
|
setupState: function (lastState, env, scope, params, hash) {
|
8299
8150
|
var componentPath = env.hooks.getValue(params[0]);
|
@@ -8332,6 +8183,11 @@ enifed('ember-htmlbars/keywords/component', ['exports', 'ember-metal/merge'], fu
|
|
8332
8183
|
env.hooks.component(morph, env, scope, componentPath, params, hash, { default: template, inverse: inverse }, visitor);
|
8333
8184
|
}
|
8334
8185
|
});
|
8186
|
+
/**
|
8187
|
+
@module ember
|
8188
|
+
@submodule ember-templates
|
8189
|
+
@public
|
8190
|
+
*/
|
8335
8191
|
enifed('ember-htmlbars/keywords/customized_outlet', ['exports', 'ember-metal/core', 'ember-htmlbars/node-managers/view-node-manager', 'ember-views/streams/utils', 'ember-metal/streams/utils'], function (exports, _emberMetalCore, _emberHtmlbarsNodeManagersViewNodeManager, _emberViewsStreamsUtils, _emberMetalStreamsUtils) {
|
8336
8192
|
exports.default = {
|
8337
8193
|
setupState: function (state, env, scope, params, hash) {
|
@@ -8426,18 +8282,24 @@ enifed('ember-htmlbars/keywords/debugger', ['exports', 'ember-metal/logger'], fu
|
|
8426
8282
|
@module ember
|
8427
8283
|
@submodule ember-htmlbars
|
8428
8284
|
*/
|
8429
|
-
enifed('ember-htmlbars/keywords/each', ['exports'
|
8285
|
+
enifed('ember-htmlbars/keywords/each', ['exports'], function (exports) {
|
8430
8286
|
exports.default = each;
|
8287
|
+
/**
|
8288
|
+
@module ember
|
8289
|
+
@submodule ember-htmlbars
|
8290
|
+
*/
|
8431
8291
|
|
8432
8292
|
function each(morph, env, scope, params, hash, template, inverse, visitor) {
|
8433
8293
|
var getValue = env.hooks.getValue;
|
8434
|
-
var firstParam = params[0] && getValue(params[0]);
|
8435
8294
|
var keyword = hash['-legacy-keyword'] && getValue(hash['-legacy-keyword']);
|
8436
8295
|
|
8437
|
-
|
8296
|
+
/* START: Support of legacy ArrayController. TODO: Remove after 1st 2.0 TLS release */
|
8297
|
+
var firstParam = params[0] && getValue(params[0]);
|
8298
|
+
if (firstParam && firstParam._isArrayController) {
|
8438
8299
|
env.hooks.block(morph, env, scope, '-legacy-each-with-controller', params, hash, template, inverse, visitor);
|
8439
8300
|
return true;
|
8440
8301
|
}
|
8302
|
+
/* END: Support of legacy ArrayController */
|
8441
8303
|
|
8442
8304
|
if (keyword) {
|
8443
8305
|
env.hooks.block(morph, env, scope, '-legacy-each-with-keyword', params, hash, template, inverse, visitor);
|
@@ -8447,73 +8309,116 @@ enifed('ember-htmlbars/keywords/each', ['exports', 'ember-runtime/controllers/ar
|
|
8447
8309
|
return false;
|
8448
8310
|
}
|
8449
8311
|
});
|
8450
|
-
|
8451
|
-
@module ember
|
8452
|
-
@submodule ember-htmlbars
|
8453
|
-
*/
|
8454
|
-
enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/streams/stream', 'ember-metal/streams/utils', 'ember-metal/merge'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalMerge) {
|
8312
|
+
enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/streams/stream', 'ember-metal/streams/key-stream', 'ember-metal/streams/utils', 'ember-metal/merge', 'ember-htmlbars/utils/subscribe', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/observer'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalStreamsStream, _emberMetalStreamsKeyStream, _emberMetalStreamsUtils, _emberMetalMerge, _emberHtmlbarsUtilsSubscribe, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalObserver) {
|
8455
8313
|
|
8456
|
-
|
8457
|
-
var
|
8458
|
-
var
|
8314
|
+
function labelFor(source, key) {
|
8315
|
+
var sourceLabel = source.label ? source.label : '';
|
8316
|
+
var keyLabel = key.label ? key.label : '';
|
8317
|
+
return '(get ' + sourceLabel + ' ' + keyLabel + ')';
|
8318
|
+
}
|
8459
8319
|
|
8460
|
-
|
8320
|
+
var buildStream = function buildStream(params) {
|
8321
|
+
var objRef = params[0];
|
8322
|
+
var pathRef = params[1];
|
8323
|
+
|
8324
|
+
_emberMetalCore.default.assert('The first argument to {{get}} must be a stream', _emberMetalStreamsUtils.isStream(objRef));
|
8461
8325
|
_emberMetalCore.default.assert('{{get}} requires at least two arguments', params.length > 1);
|
8462
8326
|
|
8463
|
-
var
|
8327
|
+
var stream = new DynamicKeyStream(objRef, pathRef);
|
8464
8328
|
|
8465
|
-
|
8466
|
-
|
8329
|
+
return stream;
|
8330
|
+
};
|
8331
|
+
|
8332
|
+
var getKeyword = function getKeyword(morph, env, scope, params, hash, template, inverse, visitor) {
|
8333
|
+
if (!morph) {
|
8334
|
+
return buildStream(params);
|
8467
8335
|
} else {
|
8468
|
-
|
8336
|
+
var stream = undefined;
|
8337
|
+
if (morph.linkedResult) {
|
8338
|
+
stream = morph.linkedResult;
|
8339
|
+
} else {
|
8340
|
+
stream = buildStream(params);
|
8341
|
+
|
8342
|
+
_emberHtmlbarsUtilsSubscribe.default(morph, env, scope, stream);
|
8343
|
+
env.hooks.linkRenderNode(morph, env, scope, null, params, hash);
|
8344
|
+
|
8345
|
+
morph.linkedResult = stream;
|
8346
|
+
}
|
8347
|
+
env.hooks.range(morph, env, scope, null, stream, visitor);
|
8469
8348
|
}
|
8470
8349
|
|
8471
8350
|
return true;
|
8472
8351
|
};
|
8473
8352
|
|
8474
|
-
var
|
8475
|
-
|
8476
|
-
|
8477
|
-
|
8478
|
-
|
8479
|
-
this.lastPathValue = undefined;
|
8480
|
-
this.valueDep = this.addMutableDependency();
|
8353
|
+
var DynamicKeyStream = function DynamicKeyStream(source, keySource) {
|
8354
|
+
if (!_emberMetalStreamsUtils.isStream(keySource)) {
|
8355
|
+
return new _emberMetalStreamsKeyStream.default(source, keySource);
|
8356
|
+
}
|
8357
|
+
_emberMetalCore.default.assert('DynamicKeyStream error: source must be a stream', _emberMetalStreamsUtils.isStream(source)); // TODO: This isn't necessary.
|
8481
8358
|
|
8482
|
-
|
8359
|
+
// used to get the original path for debugging and legacy purposes
|
8360
|
+
var label = labelFor(source, keySource);
|
8483
8361
|
|
8484
|
-
|
8485
|
-
|
8486
|
-
|
8487
|
-
this.
|
8362
|
+
this.init(label);
|
8363
|
+
this.path = label;
|
8364
|
+
this.sourceDep = this.addMutableDependency(source);
|
8365
|
+
this.keyDep = this.addMutableDependency(keySource);
|
8366
|
+
this.observedObject = null;
|
8367
|
+
this.observedKey = null;
|
8488
8368
|
};
|
8489
8369
|
|
8490
|
-
|
8491
|
-
|
8492
|
-
_emberMetalMerge.default(GetStream.prototype, {
|
8493
|
-
updateValueDependency: function () {
|
8494
|
-
var pathValue = _emberMetalStreamsUtils.read(this.pathParam);
|
8495
|
-
|
8496
|
-
if (this.lastPathValue !== pathValue) {
|
8497
|
-
if (typeof pathValue === 'string') {
|
8498
|
-
this.valueDep.replace(this.objectParam.get(pathValue));
|
8499
|
-
} else {
|
8500
|
-
this.valueDep.replace();
|
8501
|
-
}
|
8370
|
+
DynamicKeyStream.prototype = Object.create(_emberMetalStreamsKeyStream.default.prototype);
|
8502
8371
|
|
8503
|
-
|
8372
|
+
_emberMetalMerge.default(DynamicKeyStream.prototype, {
|
8373
|
+
key: function () {
|
8374
|
+
var key = this.keyDep.getValue();
|
8375
|
+
if (typeof key === 'string') {
|
8376
|
+
_emberMetalCore.default.assert('DynamicKeyStream error: key must not have a \'.\'', key.indexOf('.') === -1);
|
8377
|
+
return key;
|
8504
8378
|
}
|
8505
8379
|
},
|
8506
8380
|
|
8507
8381
|
compute: function () {
|
8508
|
-
this.
|
8509
|
-
|
8382
|
+
var object = this.sourceDep.getValue();
|
8383
|
+
var key = this.key();
|
8384
|
+
if (object && key) {
|
8385
|
+
return _emberMetalProperty_get.get(object, key);
|
8386
|
+
}
|
8510
8387
|
},
|
8511
8388
|
|
8512
8389
|
setValue: function (value) {
|
8513
|
-
this.
|
8514
|
-
this.
|
8515
|
-
|
8390
|
+
var object = this.sourceDep.getValue();
|
8391
|
+
var key = this.key();
|
8392
|
+
if (object) {
|
8393
|
+
_emberMetalProperty_set.set(object, key, value);
|
8394
|
+
}
|
8395
|
+
},
|
8396
|
+
|
8397
|
+
_super$revalidate: _emberMetalStreamsStream.default.prototype.revalidate,
|
8398
|
+
|
8399
|
+
revalidate: function (value) {
|
8400
|
+
this._super$revalidate(value);
|
8401
|
+
|
8402
|
+
var object = this.sourceDep.getValue();
|
8403
|
+
var key = this.key();
|
8404
|
+
if (object !== this.observedObject || key !== this.observedKey) {
|
8405
|
+
this._clearObservedObject();
|
8406
|
+
|
8407
|
+
if (object && typeof object === 'object' && key) {
|
8408
|
+
_emberMetalObserver.addObserver(object, key, this, this.notify);
|
8409
|
+
this.observedObject = object;
|
8410
|
+
this.observedKey = key;
|
8411
|
+
}
|
8412
|
+
}
|
8413
|
+
},
|
8516
8414
|
|
8415
|
+
_clearObservedObject: function () {
|
8416
|
+
if (this.observedObject) {
|
8417
|
+
_emberMetalObserver.removeObserver(this.observedObject, this.observedKey, this, this.notify);
|
8418
|
+
this.observedObject = null;
|
8419
|
+
this.observedKey = null;
|
8420
|
+
}
|
8421
|
+
}
|
8517
8422
|
});
|
8518
8423
|
|
8519
8424
|
exports.default = getKeyword;
|
@@ -8721,7 +8626,7 @@ enifed('ember-htmlbars/keywords/readonly', ['exports', 'ember-htmlbars/keywords/
|
|
8721
8626
|
}
|
8722
8627
|
});
|
8723
8628
|
enifed('ember-htmlbars/keywords/real_outlet', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-htmlbars/node-managers/view-node-manager', 'ember-htmlbars/templates/top-level-view'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberHtmlbarsNodeManagersViewNodeManager, _emberHtmlbarsTemplatesTopLevelView) {
|
8724
|
-
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.
|
8629
|
+
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.3';
|
8725
8630
|
|
8726
8631
|
exports.default = {
|
8727
8632
|
willRender: function (renderNode, env) {
|
@@ -9058,14 +8963,10 @@ enifed('ember-htmlbars/keywords/with', ['exports', 'ember-metal/core', 'ember-me
|
|
9058
8963
|
hash.controller = morph.state.controller;
|
9059
8964
|
}
|
9060
8965
|
|
9061
|
-
_emberMetalCore.default.assert('{{#with foo}} must be called with a single argument or the use the ' + '{{#with foo as bar}} syntax', params.length === 1);
|
8966
|
+
_emberMetalCore.default.assert('{{#with foo}} must be called with a single argument or the use the ' + '{{#with foo as |bar|}} syntax', params.length === 1);
|
9062
8967
|
|
9063
8968
|
_emberMetalCore.default.assert('The {{#with}} helper must be called with a block', !!template);
|
9064
8969
|
|
9065
|
-
if (template && template.arity === 0) {
|
9066
|
-
_emberMetalCore.default.deprecate('Using the context switching form of `{{with}}` is deprecated. ' + 'Please use the block param form (`{{#with bar as |foo|}}`) instead.', false, { url: 'http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope' });
|
9067
|
-
}
|
9068
|
-
|
9069
8970
|
_htmlbarsRuntime.internal.continueBlock(morph, env, scope, 'with', params, hash, template, inverse, visitor);
|
9070
8971
|
},
|
9071
8972
|
|
@@ -11828,20 +11729,14 @@ enifed('ember-metal', ['exports', 'ember-metal/core', 'ember-metal/features', 'e
|
|
11828
11729
|
_emberMetalCore.default.addObserver = _emberMetalObserver.addObserver;
|
11829
11730
|
_emberMetalCore.default.observersFor = _emberMetalObserver.observersFor;
|
11830
11731
|
_emberMetalCore.default.removeObserver = _emberMetalObserver.removeObserver;
|
11831
|
-
_emberMetalCore.default.addBeforeObserver = _emberMetalCore.default.deprecateFunc('Ember.addBeforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._addBeforeObserver);
|
11832
|
-
_emberMetalCore.default._suspendBeforeObserver = _emberMetalObserver._suspendBeforeObserver;
|
11833
|
-
_emberMetalCore.default._suspendBeforeObservers = _emberMetalObserver._suspendBeforeObservers;
|
11834
11732
|
_emberMetalCore.default._suspendObserver = _emberMetalObserver._suspendObserver;
|
11835
11733
|
_emberMetalCore.default._suspendObservers = _emberMetalObserver._suspendObservers;
|
11836
|
-
_emberMetalCore.default.beforeObserversFor = _emberMetalCore.default.deprecateFunc('Ember.beforeObserversFor is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._beforeObserversFor);
|
11837
|
-
_emberMetalCore.default.removeBeforeObserver = _emberMetalCore.default.deprecateFunc('Ember.removeBeforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalObserver._removeBeforeObserver);
|
11838
11734
|
|
11839
11735
|
_emberMetalCore.default.IS_BINDING = _emberMetalMixin.IS_BINDING;
|
11840
11736
|
_emberMetalCore.default.required = _emberMetalMixin.required;
|
11841
11737
|
_emberMetalCore.default.aliasMethod = _emberMetalMixin.aliasMethod;
|
11842
11738
|
_emberMetalCore.default.observer = _emberMetalMixin.observer;
|
11843
11739
|
_emberMetalCore.default.immediateObserver = _emberMetalMixin._immediateObserver;
|
11844
|
-
_emberMetalCore.default.beforeObserver = _emberMetalCore.default.deprecateFunc('Ember.beforeObserver is deprecated and will be removed in the near future.', { url: 'http://emberjs.com/deprecations/v1.x/#toc_beforeobserver' }, _emberMetalMixin._beforeObserver);
|
11845
11740
|
_emberMetalCore.default.mixin = _emberMetalMixin.mixin;
|
11846
11741
|
_emberMetalCore.default.Mixin = _emberMetalMixin.Mixin;
|
11847
11742
|
|
@@ -11901,6 +11796,7 @@ enifed('ember-metal', ['exports', 'ember-metal/core', 'ember-metal/features', 'e
|
|
11901
11796
|
|
11902
11797
|
// do this for side-effects of updating Ember.assert, warn, etc when
|
11903
11798
|
// ember-debug is present
|
11799
|
+
// This needs to be called before any deprecateFunc
|
11904
11800
|
if (_emberMetalCore.default.__loader.registry['ember-debug']) {
|
11905
11801
|
requireModule('ember-debug');
|
11906
11802
|
}
|
@@ -12285,29 +12181,7 @@ enifed('ember-metal/binding', ['exports', 'ember-metal/core', 'ember-metal/prope
|
|
12285
12181
|
to: function (to) {
|
12286
12182
|
var C = this;
|
12287
12183
|
return new C(to, undefined);
|
12288
|
-
},
|
12289
|
-
|
12290
|
-
/**
|
12291
|
-
Creates a new Binding instance and makes it apply in a single direction.
|
12292
|
-
A one-way binding will relay changes on the `from` side object (supplied
|
12293
|
-
as the `from` argument) the `to` side, but not the other way around.
|
12294
|
-
This means that if you change the "to" side directly, the "from" side may have
|
12295
|
-
a different value.
|
12296
|
-
See `Binding.oneWay`.
|
12297
|
-
@method oneWay
|
12298
|
-
@param {String} from from path.
|
12299
|
-
@param {Boolean} [flag] (Optional) passing nothing here will make the
|
12300
|
-
binding `oneWay`. You can instead pass `false` to disable `oneWay`, making the
|
12301
|
-
binding two way again.
|
12302
|
-
@return {Ember.Binding} `this`
|
12303
|
-
@public
|
12304
|
-
*/
|
12305
|
-
oneWay: function (from, flag) {
|
12306
|
-
_emberMetalCore.default.deprecate('Ember.oneWay has been deprecated. Please use Ember.computed.oneWay instead.', false);
|
12307
|
-
var C = this;
|
12308
|
-
return new C(undefined, from).oneWay(flag);
|
12309
12184
|
}
|
12310
|
-
|
12311
12185
|
});
|
12312
12186
|
/**
|
12313
12187
|
An `Ember.Binding` connects the properties of two objects so that whenever
|
@@ -14251,7 +14125,7 @@ enifed('ember-metal/core', ['exports'], function (exports) {
|
|
14251
14125
|
|
14252
14126
|
@class Ember
|
14253
14127
|
@static
|
14254
|
-
@version 2.0.0-beta.
|
14128
|
+
@version 2.0.0-beta.3
|
14255
14129
|
@public
|
14256
14130
|
*/
|
14257
14131
|
|
@@ -14283,11 +14157,11 @@ enifed('ember-metal/core', ['exports'], function (exports) {
|
|
14283
14157
|
|
14284
14158
|
@property VERSION
|
14285
14159
|
@type String
|
14286
|
-
@default '2.0.0-beta.
|
14160
|
+
@default '2.0.0-beta.3'
|
14287
14161
|
@static
|
14288
14162
|
@public
|
14289
14163
|
*/
|
14290
|
-
Ember.VERSION = '2.0.0-beta.
|
14164
|
+
Ember.VERSION = '2.0.0-beta.3';
|
14291
14165
|
|
14292
14166
|
/**
|
14293
14167
|
The hash of environment variables used to control various configuration
|
@@ -14415,8 +14289,12 @@ enifed('ember-metal/core', ['exports'], function (exports) {
|
|
14415
14289
|
Ember.deprecate = K;
|
14416
14290
|
}
|
14417
14291
|
if ('undefined' === typeof Ember.deprecateFunc) {
|
14418
|
-
Ember.deprecateFunc = function (
|
14419
|
-
|
14292
|
+
Ember.deprecateFunc = function () {
|
14293
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
14294
|
+
args[_key] = arguments[_key];
|
14295
|
+
}
|
14296
|
+
|
14297
|
+
return args[args.length - 1];
|
14420
14298
|
};
|
14421
14299
|
}
|
14422
14300
|
|
@@ -15249,7 +15127,7 @@ enifed('ember-metal/get_properties', ['exports', 'ember-metal/property_get'], fu
|
|
15249
15127
|
@param {Object} obj
|
15250
15128
|
@param {String...|Array} list of keys to get
|
15251
15129
|
@return {Object}
|
15252
|
-
@
|
15130
|
+
@public
|
15253
15131
|
*/
|
15254
15132
|
|
15255
15133
|
function getProperties(obj) {
|
@@ -15289,9 +15167,9 @@ enifed('ember-metal/injected_property', ['exports', 'ember-metal/core', 'ember-m
|
|
15289
15167
|
}
|
15290
15168
|
|
15291
15169
|
function injectedPropertyGet(keyName) {
|
15292
|
-
var
|
15293
|
-
var desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
|
15170
|
+
var desc = this[keyName];
|
15294
15171
|
|
15172
|
+
_emberMetalCore.default.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type);
|
15295
15173
|
_emberMetalCore.default.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', this.container);
|
15296
15174
|
|
15297
15175
|
return this.container.lookup(desc.type + ':' + (desc.name || keyName));
|
@@ -16077,20 +15955,6 @@ enifed('ember-metal/map', ['exports', 'ember-metal/core', 'ember-metal/utils', '
|
|
16077
15955
|
return this;
|
16078
15956
|
},
|
16079
15957
|
|
16080
|
-
/**
|
16081
|
-
@deprecated
|
16082
|
-
@method remove
|
16083
|
-
@param obj
|
16084
|
-
@param _guid (optional and for internal use only)
|
16085
|
-
@return {Boolean}
|
16086
|
-
@private
|
16087
|
-
*/
|
16088
|
-
remove: function (obj, _guid) {
|
16089
|
-
_emberMetalCore.default.deprecate('Calling `OrderedSet.prototype.remove` has been deprecated, please use `OrderedSet.prototype.delete` instead.', this._silenceRemoveDeprecation);
|
16090
|
-
|
16091
|
-
return this.delete(obj, _guid);
|
16092
|
-
},
|
16093
|
-
|
16094
15958
|
/**
|
16095
15959
|
@since 1.8.0
|
16096
15960
|
@method delete
|
@@ -16302,20 +16166,6 @@ enifed('ember-metal/map', ['exports', 'ember-metal/core', 'ember-metal/utils', '
|
|
16302
16166
|
return this;
|
16303
16167
|
},
|
16304
16168
|
|
16305
|
-
/**
|
16306
|
-
@deprecated see delete
|
16307
|
-
Removes a value from the map for an associated key.
|
16308
|
-
@method remove
|
16309
|
-
@param {*} key
|
16310
|
-
@return {Boolean} true if an item was removed, false otherwise
|
16311
|
-
@private
|
16312
|
-
*/
|
16313
|
-
remove: function (key) {
|
16314
|
-
_emberMetalCore.default.deprecate('Calling `Map.prototype.remove` has been deprecated, please use `Map.prototype.delete` instead.');
|
16315
|
-
|
16316
|
-
return this.delete(key);
|
16317
|
-
},
|
16318
|
-
|
16319
16169
|
/**
|
16320
16170
|
Removes a value from the map for an associated key.
|
16321
16171
|
@since 1.8.0
|
@@ -17400,36 +17250,25 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/merge',
|
|
17400
17250
|
*/
|
17401
17251
|
|
17402
17252
|
function observer() {
|
17403
|
-
for (var _len4 = arguments.length,
|
17404
|
-
|
17253
|
+
for (var _len4 = arguments.length, paths = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
17254
|
+
paths[_key4] = arguments[_key4];
|
17405
17255
|
}
|
17406
17256
|
|
17407
|
-
var func =
|
17408
|
-
var
|
17409
|
-
|
17257
|
+
var func = paths.pop();
|
17258
|
+
var expandedPaths = [];
|
17410
17259
|
var addWatchedProperty = function (path) {
|
17411
|
-
|
17260
|
+
expandedPaths.push(path);
|
17412
17261
|
};
|
17413
|
-
var _paths = args.slice(0, -1);
|
17414
|
-
|
17415
|
-
if (typeof func !== 'function') {
|
17416
|
-
// revert to old, soft-deprecated argument ordering
|
17417
17262
|
|
17418
|
-
|
17419
|
-
|
17420
|
-
}
|
17421
|
-
|
17422
|
-
paths = [];
|
17423
|
-
|
17424
|
-
for (var i = 0; i < _paths.length; ++i) {
|
17425
|
-
_emberMetalExpand_properties.default(_paths[i], addWatchedProperty);
|
17263
|
+
for (var i = 0; i < paths.length; ++i) {
|
17264
|
+
_emberMetalExpand_properties.default(paths[i], addWatchedProperty);
|
17426
17265
|
}
|
17427
17266
|
|
17428
17267
|
if (typeof func !== 'function') {
|
17429
17268
|
throw new _emberMetalCore.default.Error('Ember.observer called without a function');
|
17430
17269
|
}
|
17431
17270
|
|
17432
|
-
func.__ember_observes__ =
|
17271
|
+
func.__ember_observes__ = expandedPaths;
|
17433
17272
|
return func;
|
17434
17273
|
}
|
17435
17274
|
|
@@ -17484,10 +17323,6 @@ enifed('ember-metal/mixin', ['exports', 'ember-metal/core', 'ember-metal/merge',
|
|
17484
17323
|
App.PersonView = Ember.View.extend({
|
17485
17324
|
friends: [{ name: 'Tom' }, { name: 'Stefan' }, { name: 'Kris' }],
|
17486
17325
|
|
17487
|
-
valueWillChange: Ember.beforeObserver('content.value', function(obj, keyName) {
|
17488
|
-
this.changingFrom = obj.get(keyName);
|
17489
|
-
}),
|
17490
|
-
|
17491
17326
|
valueDidChange: Ember.observer('content.value', function(obj, keyName) {
|
17492
17327
|
// only run if updating a value already in the DOM
|
17493
17328
|
if (this.get('state') === 'inDOM') {
|
@@ -17566,11 +17401,8 @@ enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/
|
|
17566
17401
|
exports.observersFor = observersFor;
|
17567
17402
|
exports.removeObserver = removeObserver;
|
17568
17403
|
exports._addBeforeObserver = _addBeforeObserver;
|
17569
|
-
exports._suspendBeforeObserver = _suspendBeforeObserver;
|
17570
17404
|
exports._suspendObserver = _suspendObserver;
|
17571
|
-
exports._suspendBeforeObservers = _suspendBeforeObservers;
|
17572
17405
|
exports._suspendObservers = _suspendObservers;
|
17573
|
-
exports._beforeObserversFor = _beforeObserversFor;
|
17574
17406
|
exports._removeBeforeObserver = _removeBeforeObserver;
|
17575
17407
|
|
17576
17408
|
/**
|
@@ -17649,28 +17481,15 @@ enifed('ember-metal/observer', ['exports', 'ember-metal/watching', 'ember-metal/
|
|
17649
17481
|
// This should only be used by the target of the observer
|
17650
17482
|
// while it is setting the observed path.
|
17651
17483
|
|
17652
|
-
function _suspendBeforeObserver(obj, path, target, method, callback) {
|
17653
|
-
return _emberMetalEvents.suspendListener(obj, beforeEvent(path), target, method, callback);
|
17654
|
-
}
|
17655
|
-
|
17656
17484
|
function _suspendObserver(obj, path, target, method, callback) {
|
17657
17485
|
return _emberMetalEvents.suspendListener(obj, changeEvent(path), target, method, callback);
|
17658
17486
|
}
|
17659
17487
|
|
17660
|
-
function _suspendBeforeObservers(obj, paths, target, method, callback) {
|
17661
|
-
var events = paths.map(beforeEvent);
|
17662
|
-
return _emberMetalEvents.suspendListeners(obj, events, target, method, callback);
|
17663
|
-
}
|
17664
|
-
|
17665
17488
|
function _suspendObservers(obj, paths, target, method, callback) {
|
17666
17489
|
var events = paths.map(changeEvent);
|
17667
17490
|
return _emberMetalEvents.suspendListeners(obj, events, target, method, callback);
|
17668
17491
|
}
|
17669
17492
|
|
17670
|
-
function _beforeObserversFor(obj, path) {
|
17671
|
-
return _emberMetalEvents.listenersFor(obj, beforeEvent(path));
|
17672
|
-
}
|
17673
|
-
|
17674
17493
|
/**
|
17675
17494
|
@method removeBeforeObserver
|
17676
17495
|
@for Ember
|
@@ -18311,7 +18130,7 @@ enifed('ember-metal/property_events', ['exports', 'ember-metal/utils', 'ember-me
|
|
18311
18130
|
exports.endPropertyChanges = endPropertyChanges;
|
18312
18131
|
exports.changeProperties = changeProperties;
|
18313
18132
|
});
|
18314
|
-
enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/utils'
|
18133
|
+
enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/utils'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalError, _emberMetalPath_cache, _emberMetalUtils) {
|
18315
18134
|
exports.get = get;
|
18316
18135
|
exports.normalizeTuple = normalizeTuple;
|
18317
18136
|
exports._getPath = _getPath;
|
@@ -18358,24 +18177,17 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
|
|
18358
18177
|
*/
|
18359
18178
|
|
18360
18179
|
function get(obj, keyName) {
|
18180
|
+
_emberMetalCore.default.assert('Get must be called with two arguments; an object and a property key', arguments.length === 2);
|
18181
|
+
_emberMetalCore.default.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null);
|
18182
|
+
_emberMetalCore.default.assert('The key provided to get must be a string, you passed ' + keyName, typeof keyName === 'string');
|
18183
|
+
_emberMetalCore.default.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName));
|
18184
|
+
|
18361
18185
|
// Helpers that operate with 'this' within an #each
|
18362
18186
|
if (keyName === '') {
|
18363
18187
|
return obj;
|
18364
18188
|
}
|
18365
18189
|
|
18366
|
-
if (
|
18367
|
-
keyName = obj;
|
18368
|
-
obj = _emberMetalCore.default.lookup;
|
18369
|
-
}
|
18370
|
-
|
18371
|
-
_emberMetalCore.default.assert('Cannot call get with ' + keyName + ' key.', !!keyName);
|
18372
|
-
_emberMetalCore.default.assert('Cannot call get with \'' + keyName + '\' on an undefined object.', obj !== undefined);
|
18373
|
-
|
18374
|
-
if (_emberMetalIs_none.default(obj)) {
|
18375
|
-
return _getPath(obj, keyName);
|
18376
|
-
}
|
18377
|
-
|
18378
|
-
if (obj && typeof obj[INTERCEPT_GET] === 'function') {
|
18190
|
+
if (typeof obj[INTERCEPT_GET] === 'function') {
|
18379
18191
|
var result = obj[INTERCEPT_GET](obj, keyName);
|
18380
18192
|
if (result !== UNHANDLED_GET) {
|
18381
18193
|
return result;
|
@@ -18473,7 +18285,7 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/core', 'ember-metal/
|
|
18473
18285
|
parts = path.split('.');
|
18474
18286
|
len = parts.length;
|
18475
18287
|
for (idx = 0; root != null && idx < len; idx++) {
|
18476
|
-
root = get(root, parts[idx]
|
18288
|
+
root = get(root, parts[idx]);
|
18477
18289
|
if (root && root.isDestroyed) {
|
18478
18290
|
return undefined;
|
18479
18291
|
}
|
@@ -18519,18 +18331,10 @@ enifed('ember-metal/property_set', ['exports', 'ember-metal/core', 'ember-metal/
|
|
18519
18331
|
*/
|
18520
18332
|
|
18521
18333
|
function set(obj, keyName, value, tolerant) {
|
18522
|
-
|
18523
|
-
|
18524
|
-
|
18525
|
-
|
18526
|
-
obj = _emberMetalCore.default.lookup;
|
18527
|
-
}
|
18528
|
-
|
18529
|
-
_emberMetalCore.default.assert('Cannot call set with \'' + keyName + '\' key.', !!keyName);
|
18530
|
-
|
18531
|
-
if (obj === _emberMetalCore.default.lookup) {
|
18532
|
-
return setPath(obj, keyName, value, tolerant);
|
18533
|
-
}
|
18334
|
+
_emberMetalCore.default.assert('Set must be called with tree or four arguments; an object, a property key, a value and tolerant true/false', arguments.length === 3 || arguments.length === 4);
|
18335
|
+
_emberMetalCore.default.assert('Cannot call set with \'' + keyName + '\' on an undefined object.', obj !== undefined && obj !== null);
|
18336
|
+
_emberMetalCore.default.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string');
|
18337
|
+
_emberMetalCore.default.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName));
|
18534
18338
|
|
18535
18339
|
// This path exists purely to implement backwards-compatible
|
18536
18340
|
// effects (specifically, setting a property on a view may
|
@@ -18550,18 +18354,16 @@ enifed('ember-metal/property_set', ['exports', 'ember-metal/core', 'ember-metal/
|
|
18550
18354
|
}
|
18551
18355
|
|
18552
18356
|
var isUnknown, currentValue;
|
18553
|
-
if (
|
18357
|
+
if (desc === undefined && _emberMetalPath_cache.isPath(keyName)) {
|
18554
18358
|
return setPath(obj, keyName, value, tolerant);
|
18555
18359
|
}
|
18556
18360
|
|
18557
|
-
_emberMetalCore.default.assert('You need to provide an object and key to `set`.', !!obj && keyName !== undefined);
|
18558
18361
|
_emberMetalCore.default.assert('calling set on destroyed object', !obj.isDestroyed);
|
18559
18362
|
|
18560
18363
|
if (desc) {
|
18561
18364
|
desc.set(obj, keyName, value);
|
18562
18365
|
} else {
|
18563
|
-
|
18564
|
-
if (obj !== null && value !== undefined && typeof obj === 'object' && obj[keyName] === value) {
|
18366
|
+
if (value !== undefined && typeof obj === 'object' && obj[keyName] === value) {
|
18565
18367
|
return value;
|
18566
18368
|
}
|
18567
18369
|
|
@@ -21412,60 +21214,151 @@ enifed('ember-routing-htmlbars/helpers/query-params', ['exports', 'ember-metal/c
|
|
21412
21214
|
enifed('ember-routing-htmlbars/keywords/action', ['exports', 'ember-metal/features', 'htmlbars-runtime/hooks', 'ember-routing-htmlbars/keywords/closure-action'], function (exports, _emberMetalFeatures, _htmlbarsRuntimeHooks, _emberRoutingHtmlbarsKeywordsClosureAction) {
|
21413
21215
|
|
21414
21216
|
/**
|
21415
|
-
The `{{action}}` helper provides a
|
21416
|
-
|
21417
|
-
|
21217
|
+
The `{{action}}` helper provides a way to pass triggers for behavior (usually
|
21218
|
+
just a function) between components, and into components from controllers.
|
21219
|
+
|
21220
|
+
### Passing functions with the action helper
|
21418
21221
|
|
21419
|
-
|
21420
|
-
to
|
21222
|
+
There are three contexts an action helper can be used in. The first two
|
21223
|
+
contexts to discuss are attribute context, and Handlebars value context.
|
21421
21224
|
|
21422
|
-
|
21225
|
+
```handlebars
|
21226
|
+
{{! An example of attribute context }}
|
21227
|
+
<div onclick={{action "save"}}></div>
|
21228
|
+
{{! Examples of Handlebars value context }}
|
21229
|
+
{{input on-input=(action "save")}}
|
21230
|
+
{{yield (action "refreshData") andAnotherParam}}
|
21231
|
+
```
|
21423
21232
|
|
21233
|
+
In these contexts,
|
21234
|
+
the helper is called a "closure action" helper. It's behavior is simple:
|
21235
|
+
If passed a function name, read that function off the `actions` property
|
21236
|
+
of the current context. Once that function is read (or if a function was
|
21237
|
+
passed), create a closure over that function and any arguments.
|
21424
21238
|
|
21425
|
-
|
21426
|
-
|
21239
|
+
The resulting value of an action helper used this way is simply a function.
|
21240
|
+
For example with this attribute context example:
|
21427
21241
|
|
21428
21242
|
```handlebars
|
21429
|
-
|
21430
|
-
|
21431
|
-
</div>
|
21243
|
+
{{! An example of attribute context }}
|
21244
|
+
<div onclick={{action "save"}}></div>
|
21432
21245
|
```
|
21433
21246
|
|
21434
|
-
|
21247
|
+
The resulting template render logic would be:
|
21435
21248
|
|
21436
|
-
```
|
21437
|
-
|
21249
|
+
```js
|
21250
|
+
var div = document.createElement('div');
|
21251
|
+
var actionFunction = (function(context){
|
21252
|
+
return function() {
|
21253
|
+
return context.actions.save.apply(context, arguments);
|
21254
|
+
};
|
21255
|
+
})(context);
|
21256
|
+
div.onclick = actionFunction;
|
21257
|
+
```
|
21258
|
+
|
21259
|
+
Thus when the div is clicked, the action on that context is called.
|
21260
|
+
Because the `actionFunction` is just a function, closure actions can be
|
21261
|
+
passed between components the still execute in the correct context.
|
21262
|
+
|
21263
|
+
Here is an example action handler on a component:
|
21264
|
+
|
21265
|
+
```js
|
21266
|
+
export default Ember.Component.extend({
|
21438
21267
|
actions: {
|
21439
|
-
|
21268
|
+
save(/* event *\/) {
|
21269
|
+
this.get('model').save();
|
21440
21270
|
}
|
21441
21271
|
}
|
21442
21272
|
});
|
21443
21273
|
```
|
21444
21274
|
|
21445
|
-
|
21275
|
+
Actions are always looked up on the `actions` property of the current context.
|
21276
|
+
This avoids collisions in the naming of common actions, such as `destroy`.
|
21446
21277
|
|
21447
|
-
|
21448
|
-
|
21449
|
-
|
21450
|
-
|
21451
|
-
|
21452
|
-
|
21278
|
+
Two options can be passed to the `action` helper when it is used in this way.
|
21279
|
+
|
21280
|
+
* `target=someProperty` will look to `someProperty` instead of the current
|
21281
|
+
context for the `actions` hash. This can be useful when targetting a
|
21282
|
+
service for actions.
|
21283
|
+
* `value="target.value"` will read the path `target.value` off the first
|
21284
|
+
argument to the action when it is called and rewrite the first argument
|
21285
|
+
to be that value. This is useful when attaching actions to event listeners.
|
21286
|
+
|
21287
|
+
### Invoking an action
|
21288
|
+
|
21289
|
+
Closure actions curry both their scope and any arguments. When invoked, any
|
21290
|
+
additional arguments are added to the already curried list.
|
21291
|
+
|
21292
|
+
Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction)
|
21293
|
+
method. The first argument to `sendAction` is the action to be called, and
|
21294
|
+
additional arguments are passed to the action function. This has interesting
|
21295
|
+
properties combined with currying of arguments. For example:
|
21296
|
+
|
21297
|
+
```js
|
21298
|
+
export default Ember.Component.extend({
|
21299
|
+
actions: {
|
21300
|
+
// Usage {{input on-input=(action (action 'setName' model) value="target.value")}}
|
21301
|
+
setName(model, name) {
|
21302
|
+
model.set('name', name);
|
21303
|
+
}
|
21304
|
+
}
|
21305
|
+
});
|
21306
|
+
```
|
21307
|
+
|
21308
|
+
The first argument (`model`) was curried over, and the run-time argument (`event`)
|
21309
|
+
becomes a second argument. Action calls be nested this way because each simply
|
21310
|
+
returns a function. Any function can be passed to the `{{action` helper, including
|
21311
|
+
other actions.
|
21312
|
+
|
21313
|
+
Actions invoked with `sendAction` have the same currying behavior as demonstrated
|
21314
|
+
with `on-input` above. For example:
|
21315
|
+
|
21316
|
+
```js
|
21317
|
+
export default Ember.Component.extend({
|
21318
|
+
actions: {
|
21319
|
+
setName(model, name) {
|
21320
|
+
model.set('name', name);
|
21321
|
+
}
|
21322
|
+
}
|
21323
|
+
});
|
21324
|
+
```
|
21325
|
+
|
21326
|
+
```handlebars
|
21327
|
+
{{my-input submit=(action 'setName' model)}}
|
21328
|
+
```
|
21329
|
+
|
21330
|
+
```js
|
21331
|
+
// app/components/my-component.js
|
21332
|
+
export default Ember.Component.extend({
|
21333
|
+
click() {
|
21334
|
+
// Note that model is not passed, it was curried in the template
|
21335
|
+
this.sendAction('submit', 'bob');
|
21336
|
+
}
|
21337
|
+
});
|
21453
21338
|
```
|
21454
21339
|
|
21455
|
-
|
21456
|
-
`App.ApplicationController`. In this case, no additional parameters will be passed.
|
21340
|
+
### Attaching actions to DOM
|
21457
21341
|
|
21458
|
-
|
21342
|
+
The third context the `{{action` helper can be used in we call "element space".
|
21343
|
+
For example:
|
21459
21344
|
|
21460
21345
|
```handlebars
|
21461
|
-
|
21346
|
+
{{! An example of element space }}
|
21347
|
+
<div {{action "save"}}></div>
|
21462
21348
|
```
|
21463
21349
|
|
21464
|
-
|
21465
|
-
|
21350
|
+
Used this way, the `{{action}}` helper provides a useful shortcut for
|
21351
|
+
registering an HTML element within a template for a single DOM event and
|
21352
|
+
forwarding that interaction to the template's context (controller or component).
|
21353
|
+
|
21354
|
+
If the context of a template is a controller, actions used this way will
|
21355
|
+
bubble to routes when the controller does not implement the specified action.
|
21356
|
+
Once an action hits a route, it will bubble through the route hierarchy.
|
21466
21357
|
|
21467
21358
|
### Event Propagation
|
21468
21359
|
|
21360
|
+
`{{action` helpers called in element space can control event bubbling.
|
21361
|
+
|
21469
21362
|
Events triggered through the action helper will automatically have
|
21470
21363
|
`.preventDefault()` called on them. You do not need to do so in your event
|
21471
21364
|
handlers. If you need to allow event propagation (to handle file inputs for
|
@@ -21490,6 +21383,8 @@ enifed('ember-routing-htmlbars/keywords/action', ['exports', 'ember-metal/featur
|
|
21490
21383
|
|
21491
21384
|
### Specifying DOM event type
|
21492
21385
|
|
21386
|
+
`{{action` helpers called in element space can specify an event type.
|
21387
|
+
|
21493
21388
|
By default the `{{action}}` helper registers for DOM `click` events. You can
|
21494
21389
|
supply an `on` option to the helper to specify a different DOM event name:
|
21495
21390
|
|
@@ -21499,11 +21394,13 @@ enifed('ember-routing-htmlbars/keywords/action', ['exports', 'ember-metal/featur
|
|
21499
21394
|
</div>
|
21500
21395
|
```
|
21501
21396
|
|
21502
|
-
See
|
21397
|
+
See [Event Names](/api/classes/Ember.View.html#toc_event-names) for a list of
|
21503
21398
|
acceptable DOM event names.
|
21504
21399
|
|
21505
21400
|
### Specifying whitelisted modifier keys
|
21506
21401
|
|
21402
|
+
`{{action` helpers called in element space can specify modifier keys.
|
21403
|
+
|
21507
21404
|
By default the `{{action}}` helper will ignore click event with pressed modifier
|
21508
21405
|
keys. You can supply an `allowedKeys` option to specify which keys should not be ignored.
|
21509
21406
|
|
@@ -21525,49 +21422,24 @@ enifed('ember-routing-htmlbars/keywords/action', ['exports', 'ember-metal/featur
|
|
21525
21422
|
|
21526
21423
|
### Specifying a Target
|
21527
21424
|
|
21528
|
-
|
21529
|
-
|
21530
|
-
In a typical Ember application, where templates are managed through use of the
|
21531
|
-
`{{outlet}}` helper, actions will bubble to the current controller, then
|
21532
|
-
to the current route, and then up the route hierarchy.
|
21533
|
-
|
21534
|
-
Alternatively, a `target` option can be provided to the helper to change
|
21425
|
+
A `target` option can be provided to the helper to change
|
21535
21426
|
which object will receive the method call. This option must be a path
|
21536
21427
|
to an object, accessible in the current context:
|
21537
21428
|
|
21538
21429
|
```handlebars
|
21539
|
-
{{!
|
21540
|
-
<div {{action "anActionName" target=
|
21430
|
+
{{! app/templates/application.hbs }}
|
21431
|
+
<div {{action "anActionName" target=someService}}>
|
21541
21432
|
click me
|
21542
21433
|
</div>
|
21543
21434
|
```
|
21544
21435
|
|
21545
21436
|
```javascript
|
21546
|
-
|
21547
|
-
|
21548
|
-
|
21549
|
-
}
|
21437
|
+
// app/controllers/application.js
|
21438
|
+
export default Ember.Controller.extend({
|
21439
|
+
someService: Ember.inject.service()
|
21550
21440
|
});
|
21551
|
-
|
21552
|
-
```
|
21553
|
-
|
21554
|
-
### Additional Parameters
|
21555
|
-
|
21556
|
-
You may specify additional parameters to the `{{action}}` helper. These
|
21557
|
-
parameters are passed along as the arguments to the JavaScript function
|
21558
|
-
implementing the action.
|
21559
|
-
|
21560
|
-
```handlebars
|
21561
|
-
{{#each people as |person|}}
|
21562
|
-
<div {{action "edit" person}}>
|
21563
|
-
click me
|
21564
|
-
</div>
|
21565
|
-
{{/each}}
|
21566
21441
|
```
|
21567
21442
|
|
21568
|
-
Clicking "click me" will trigger the `edit` method on the current controller
|
21569
|
-
with the value of `person` as a parameter.
|
21570
|
-
|
21571
21443
|
@method action
|
21572
21444
|
@for Ember.Templates.helpers
|
21573
21445
|
@public
|
@@ -22193,10 +22065,6 @@ enifed('ember-routing-htmlbars/keywords/render', ['exports', 'ember-metal/core',
|
|
22193
22065
|
throw new _emberMetalError.default('You must pass a templateName to render');
|
22194
22066
|
}
|
22195
22067
|
|
22196
|
-
// # legacy namespace
|
22197
|
-
name = name.replace(/\//g, '.');
|
22198
|
-
// \ legacy slash as namespace support
|
22199
|
-
|
22200
22068
|
var templateName = 'template:' + name;
|
22201
22069
|
_emberMetalCore.default.assert('You used `{{render \'' + name + '\'}}`, but \'' + name + '\' can not be ' + 'found as either a template or a view.', container._registry.has('view:' + name) || container._registry.has(templateName) || !!template);
|
22202
22070
|
|
@@ -22362,7 +22230,7 @@ enifed('ember-routing-views', ['exports', 'ember-metal/core', 'ember-metal/featu
|
|
22362
22230
|
@submodule ember-routing-views
|
22363
22231
|
*/
|
22364
22232
|
enifed('ember-routing-views/views/link', ['exports', 'ember-metal/core', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-views/system/utils', 'ember-views/views/component', 'ember-runtime/inject', 'ember-runtime/mixins/controller', 'ember-htmlbars/templates/link-to'], function (exports, _emberMetalCore, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberViewsSystemUtils, _emberViewsViewsComponent, _emberRuntimeInject, _emberRuntimeMixinsController, _emberHtmlbarsTemplatesLinkTo) {
|
22365
|
-
_emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.0.0-beta.
|
22233
|
+
_emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.0.0-beta.3';
|
22366
22234
|
|
22367
22235
|
var linkComponentClassNameBindings = ['active', 'loading', 'disabled'];
|
22368
22236
|
|
@@ -22533,8 +22401,8 @@ enifed('ember-routing-views/views/link', ['exports', 'ember-metal/core', 'ember-
|
|
22533
22401
|
}
|
22534
22402
|
});
|
22535
22403
|
```
|
22536
|
-
NOTE: If you do override `init` for a framework class like `Ember.View
|
22537
|
-
|
22404
|
+
NOTE: If you do override `init` for a framework class like `Ember.View`,
|
22405
|
+
be sure to call `this._super.apply(this, arguments)` in your
|
22538
22406
|
`init` declaration! If you don't, Ember may not have an opportunity to
|
22539
22407
|
do important setup work, and you'll see strange behavior in your
|
22540
22408
|
application.
|
@@ -22874,7 +22742,7 @@ enifed('ember-routing-views/views/link', ['exports', 'ember-metal/core', 'ember-
|
|
22874
22742
|
|
22875
22743
|
// FEATURES, Logger, assert
|
22876
22744
|
enifed('ember-routing-views/views/outlet', ['exports', 'ember-views/views/view', 'ember-htmlbars/templates/top-level-view'], function (exports, _emberViewsViewsView, _emberHtmlbarsTemplatesTopLevelView) {
|
22877
|
-
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.
|
22745
|
+
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.0.0-beta.3';
|
22878
22746
|
|
22879
22747
|
var CoreOutletView = _emberViewsViewsView.default.extend({
|
22880
22748
|
defaultTemplate: _emberHtmlbarsTemplatesTopLevelView.default,
|
@@ -22938,7 +22806,7 @@ enifed('ember-routing', ['exports', 'ember-metal/core', 'ember-routing/ext/run_l
|
|
22938
22806
|
*/
|
22939
22807
|
|
22940
22808
|
// ES6TODO: Cleanup modules with side-effects below
|
22941
|
-
enifed('ember-routing/ext/controller', ['exports', 'ember-metal/
|
22809
|
+
enifed('ember-routing/ext/controller', ['exports', 'ember-metal/property_get', 'ember-runtime/mixins/controller'], function (exports, _emberMetalProperty_get, _emberRuntimeMixinsController) {
|
22942
22810
|
|
22943
22811
|
/**
|
22944
22812
|
@module ember
|
@@ -23040,17 +22908,6 @@ enifed('ember-routing/ext/controller', ['exports', 'ember-metal/core', 'ember-me
|
|
23040
22908
|
return method.apply(target, arguments);
|
23041
22909
|
},
|
23042
22910
|
|
23043
|
-
/**
|
23044
|
-
@deprecated
|
23045
|
-
@for Ember.ControllerMixin
|
23046
|
-
@method transitionTo
|
23047
|
-
@private
|
23048
|
-
*/
|
23049
|
-
transitionTo: function () {
|
23050
|
-
_emberMetalCore.default.deprecate('transitionTo is deprecated. Please use transitionToRoute.');
|
23051
|
-
return this.transitionToRoute.apply(this, arguments);
|
23052
|
-
},
|
23053
|
-
|
23054
22911
|
/**
|
23055
22912
|
Transition into another route while replacing the current URL, if possible.
|
23056
22913
|
This will replace the current history entry instead of adding a new one.
|
@@ -23101,23 +22958,11 @@ enifed('ember-routing/ext/controller', ['exports', 'ember-metal/core', 'ember-me
|
|
23101
22958
|
var target = _emberMetalProperty_get.get(this, 'target');
|
23102
22959
|
var method = target.replaceRoute || target.replaceWith;
|
23103
22960
|
return method.apply(target, arguments);
|
23104
|
-
},
|
23105
|
-
|
23106
|
-
/**
|
23107
|
-
@deprecated
|
23108
|
-
@for Ember.ControllerMixin
|
23109
|
-
@method replaceWith
|
23110
|
-
@private
|
23111
|
-
*/
|
23112
|
-
replaceWith: function () {
|
23113
|
-
_emberMetalCore.default.deprecate('replaceWith is deprecated. Please use replaceRoute.');
|
23114
|
-
return this.replaceRoute.apply(this, arguments);
|
23115
22961
|
}
|
23116
22962
|
});
|
23117
22963
|
|
23118
22964
|
exports.default = _emberRuntimeMixinsController.default;
|
23119
22965
|
});
|
23120
|
-
// FEATURES, deprecate
|
23121
22966
|
enifed('ember-routing/ext/run_loop', ['exports', 'ember-metal/run_loop'], function (exports, _emberMetalRun_loop) {
|
23122
22967
|
|
23123
22968
|
/**
|
@@ -24459,7 +24304,7 @@ enifed('ember-routing/system/dsl', ['exports', 'ember-metal/core', 'ember-metal/
|
|
24459
24304
|
};
|
24460
24305
|
});
|
24461
24306
|
// FEATURES, assert
|
24462
|
-
enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal/core', 'ember-metal/property_get'
|
24307
|
+
enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal/core', 'ember-metal/property_get'], function (exports, _emberMetalCore, _emberMetalProperty_get) {
|
24463
24308
|
exports.generateControllerFactory = generateControllerFactory;
|
24464
24309
|
exports.default = generateController;
|
24465
24310
|
|
@@ -24471,29 +24316,15 @@ enifed('ember-routing/system/generate_controller', ['exports', 'ember-metal/core
|
|
24471
24316
|
/**
|
24472
24317
|
Generates a controller factory
|
24473
24318
|
|
24474
|
-
The type of the generated controller factory is derived
|
24475
|
-
from the context. If the context is an array an array controller
|
24476
|
-
is generated, otherwise, a basic controller is generated.
|
24477
|
-
|
24478
|
-
You can customize your generated controllers by defining `App.ArrayController`.
|
24479
|
-
|
24480
24319
|
@for Ember
|
24481
24320
|
@method generateControllerFactory
|
24482
24321
|
@private
|
24483
24322
|
*/
|
24484
24323
|
|
24485
24324
|
function generateControllerFactory(container, controllerName, context) {
|
24486
|
-
var Factory, fullName
|
24487
|
-
|
24488
|
-
if (context && _emberRuntimeUtils.isArray(context)) {
|
24489
|
-
controllerType = 'array';
|
24490
|
-
} else {
|
24491
|
-
controllerType = 'basic';
|
24492
|
-
}
|
24325
|
+
var Factory, fullName;
|
24493
24326
|
|
24494
|
-
|
24495
|
-
|
24496
|
-
Factory = container.lookupFactory(factoryName).extend({
|
24327
|
+
Factory = container.lookupFactory('controller:basic').extend({
|
24497
24328
|
isGenerated: true,
|
24498
24329
|
toString: function () {
|
24499
24330
|
return '(generated ' + controllerName + ' controller)';
|
@@ -26004,11 +25835,7 @@ enifed('ember-routing/system/route', ['exports', 'ember-metal/core', 'ember-meta
|
|
26004
25835
|
```
|
26005
25836
|
The provided controller will be one resolved based on the name
|
26006
25837
|
of this route.
|
26007
|
-
If no explicit controller is defined, Ember will automatically create
|
26008
|
-
an appropriate controller for the model.
|
26009
|
-
* if the model is an `Ember.Array` (including record arrays from Ember
|
26010
|
-
Data), the controller is an `Ember.ArrayController`.
|
26011
|
-
* otherwise, the controller is basic `Ember.Controller`.
|
25838
|
+
If no explicit controller is defined, Ember will automatically create one.
|
26012
25839
|
As an example, consider the router:
|
26013
25840
|
```javascript
|
26014
25841
|
App.Router.map(function() {
|
@@ -26075,8 +25902,6 @@ enifed('ember-routing/system/route', ['exports', 'ember-metal/core', 'ember-meta
|
|
26075
25902
|
|
26076
25903
|
/**
|
26077
25904
|
Generates a controller for a route.
|
26078
|
-
If the optional model is passed then the controller type is determined automatically,
|
26079
|
-
e.g., an ArrayController for arrays.
|
26080
25905
|
Example
|
26081
25906
|
```javascript
|
26082
25907
|
App.PostRoute = Ember.Route.extend({
|
@@ -27915,7 +27740,7 @@ enifed('ember-routing/utils', ['exports', 'ember-metal/merge', 'ember-metal/prop
|
|
27915
27740
|
}
|
27916
27741
|
}
|
27917
27742
|
});
|
27918
|
-
enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/tracked_array', 'ember-runtime/system/subarray', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/system/string', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/target_action_support', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/
|
27743
|
+
enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/tracked_array', 'ember-runtime/system/subarray', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/system/string', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/target_action_support', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/utils'], function (exports, _emberMetal, _emberRuntimeCore, _emberRuntimeCompare, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemTracked_array, _emberRuntimeSystemSubarray, _emberRuntimeSystemContainer, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeSystemString, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeMixinsObservable, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeUtils) {
|
27919
27744
|
// END IMPORTS
|
27920
27745
|
|
27921
27746
|
// BEGIN EXPORTS
|
@@ -27930,8 +27755,6 @@ enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-
|
|
27930
27755
|
_emberMetal.default.Comparable = _emberRuntimeMixinsComparable.default;
|
27931
27756
|
_emberMetal.default.Copyable = _emberRuntimeMixinsCopyable.default;
|
27932
27757
|
|
27933
|
-
_emberMetal.default.SortableMixin = _emberRuntimeMixinsSortable.default;
|
27934
|
-
|
27935
27758
|
_emberMetal.default.Freezable = _emberRuntimeMixinsFreezable.Freezable;
|
27936
27759
|
_emberMetal.default.FROZEN_ERROR = _emberRuntimeMixinsFreezable.FROZEN_ERROR;
|
27937
27760
|
|
@@ -27982,7 +27805,6 @@ enifed('ember-runtime', ['exports', 'ember-metal', 'ember-runtime/core', 'ember-
|
|
27982
27805
|
_emberMetal.default.onLoad = _emberRuntimeSystemLazy_load.onLoad;
|
27983
27806
|
_emberMetal.default.runLoadHooks = _emberRuntimeSystemLazy_load.runLoadHooks;
|
27984
27807
|
|
27985
|
-
_emberMetal.default.ArrayController = _emberRuntimeControllersArray_controller.default;
|
27986
27808
|
_emberMetal.default.Controller = _emberRuntimeControllersController.default;
|
27987
27809
|
_emberMetal.default.ControllerMixin = _emberRuntimeMixinsController.default;
|
27988
27810
|
|
@@ -28132,7 +27954,11 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28132
27954
|
|
28133
27955
|
function reduceMacro(dependentKey, callback, initialValue) {
|
28134
27956
|
return _emberMetalComputed.computed(dependentKey + '.[]', function () {
|
28135
|
-
|
27957
|
+
var _this = this;
|
27958
|
+
|
27959
|
+
return _emberMetalProperty_get.get(this, dependentKey).reduce(function (previousValue, currentValue, index, array) {
|
27960
|
+
return callback.call(_this, previousValue, currentValue, index, array);
|
27961
|
+
}, initialValue);
|
28136
27962
|
}).readOnly();
|
28137
27963
|
}
|
28138
27964
|
|
@@ -28149,7 +27975,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28149
27975
|
return _emberMetalComputed.computed(dependentKey, function () {
|
28150
27976
|
var value = _emberMetalProperty_get.get(this, propertyName);
|
28151
27977
|
if (_emberRuntimeUtils.isArray(value)) {
|
28152
|
-
return _emberMetalCore.default.A(callback(value));
|
27978
|
+
return _emberMetalCore.default.A(callback.call(this, value));
|
28153
27979
|
} else {
|
28154
27980
|
return _emberMetalCore.default.A();
|
28155
27981
|
}
|
@@ -28305,7 +28131,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28305
28131
|
|
28306
28132
|
function map(dependentKey, callback) {
|
28307
28133
|
return arrayMacro(dependentKey, function (value) {
|
28308
|
-
return value.map(callback);
|
28134
|
+
return value.map(callback, this);
|
28309
28135
|
});
|
28310
28136
|
}
|
28311
28137
|
|
@@ -28388,7 +28214,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28388
28214
|
|
28389
28215
|
function filter(dependentKey, callback) {
|
28390
28216
|
return arrayMacro(dependentKey, function (value) {
|
28391
|
-
return value.filter(callback);
|
28217
|
+
return value.filter(callback, this);
|
28392
28218
|
});
|
28393
28219
|
}
|
28394
28220
|
|
@@ -28473,12 +28299,12 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28473
28299
|
}
|
28474
28300
|
|
28475
28301
|
return multiArrayMacro(args, function (dependentKeys) {
|
28476
|
-
var
|
28302
|
+
var _this2 = this;
|
28477
28303
|
|
28478
28304
|
var uniq = _emberMetalCore.default.A();
|
28479
28305
|
|
28480
28306
|
dependentKeys.forEach(function (dependentKey) {
|
28481
|
-
var value = _emberMetalProperty_get.get(
|
28307
|
+
var value = _emberMetalProperty_get.get(_this2, dependentKey);
|
28482
28308
|
if (_emberRuntimeUtils.isArray(value)) {
|
28483
28309
|
value.forEach(function (item) {
|
28484
28310
|
if (uniq.indexOf(item) === -1) {
|
@@ -28536,10 +28362,10 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28536
28362
|
}
|
28537
28363
|
|
28538
28364
|
return multiArrayMacro(args, function (dependentKeys) {
|
28539
|
-
var
|
28365
|
+
var _this3 = this;
|
28540
28366
|
|
28541
28367
|
var arrays = dependentKeys.map(function (dependentKey) {
|
28542
|
-
var array = _emberMetalProperty_get.get(
|
28368
|
+
var array = _emberMetalProperty_get.get(_this3, dependentKey);
|
28543
28369
|
|
28544
28370
|
return _emberRuntimeUtils.isArray(array) ? array : [];
|
28545
28371
|
});
|
@@ -28700,7 +28526,11 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28700
28526
|
|
28701
28527
|
function customSort(itemsKey, comparator) {
|
28702
28528
|
return arrayMacro(itemsKey, function (value) {
|
28703
|
-
|
28529
|
+
var _this4 = this;
|
28530
|
+
|
28531
|
+
return value.slice().sort(function (x, y) {
|
28532
|
+
return comparator.call(_this4, x, y);
|
28533
|
+
});
|
28704
28534
|
});
|
28705
28535
|
}
|
28706
28536
|
|
@@ -28708,7 +28538,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28708
28538
|
// depending on the sortProperties
|
28709
28539
|
function propertySort(itemsKey, sortPropertiesKey) {
|
28710
28540
|
var cp = new _emberMetalComputed.ComputedProperty(function (key) {
|
28711
|
-
var
|
28541
|
+
var _this5 = this;
|
28712
28542
|
|
28713
28543
|
function didChange() {
|
28714
28544
|
this.notifyPropertyChange(key);
|
@@ -28745,7 +28575,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28745
28575
|
// TODO: Ideally we'd only do this if things have changed
|
28746
28576
|
// Add observers
|
28747
28577
|
normalizedSort.forEach(function (prop) {
|
28748
|
-
var args = [
|
28578
|
+
var args = [_this5, itemsKey + '.@each.' + prop[0], didChange];
|
28749
28579
|
cp._sortPropObservers.push(args);
|
28750
28580
|
_emberMetalObserver.addObserver.apply(null, args);
|
28751
28581
|
});
|
@@ -28776,282 +28606,6 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
28776
28606
|
*/
|
28777
28607
|
|
28778
28608
|
// Ember.assert
|
28779
|
-
enifed('ember-runtime/controllers/array_controller', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/system/array_proxy', 'ember-runtime/mixins/sortable', 'ember-runtime/mixins/controller', 'ember-metal/computed', 'ember-metal/error', 'ember-runtime/mixins/array', 'ember-metal/replace'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeSystemArray_proxy, _emberRuntimeMixinsSortable, _emberRuntimeMixinsController, _emberMetalComputed, _emberMetalError, _emberRuntimeMixinsArray, _emberMetalReplace) {
|
28780
|
-
var arrayControllerDeprecation = '`Ember.ArrayController` is deprecated.';
|
28781
|
-
|
28782
|
-
exports.arrayControllerDeprecation = arrayControllerDeprecation;
|
28783
|
-
/**
|
28784
|
-
`Ember.ArrayController` provides a way for you to publish a collection of
|
28785
|
-
objects so that you can easily bind to the collection from a Handlebars
|
28786
|
-
`#each` helper, an `Ember.CollectionView`, or other controllers.
|
28787
|
-
|
28788
|
-
The advantage of using an `ArrayController` is that you only have to set up
|
28789
|
-
your view bindings once; to change what's displayed, simply swap out the
|
28790
|
-
`model` property on the controller.
|
28791
|
-
|
28792
|
-
For example, imagine you wanted to display a list of items fetched via an XHR
|
28793
|
-
request. Create an `Ember.ArrayController` and set its `model` property:
|
28794
|
-
|
28795
|
-
```javascript
|
28796
|
-
MyApp.listController = Ember.ArrayController.create();
|
28797
|
-
|
28798
|
-
$.get('people.json', function(data) {
|
28799
|
-
MyApp.listController.set('model', data);
|
28800
|
-
});
|
28801
|
-
```
|
28802
|
-
|
28803
|
-
Then, create a view that binds to your new controller:
|
28804
|
-
|
28805
|
-
```handlebars
|
28806
|
-
{{#each MyApp.listController as |person|}}
|
28807
|
-
{{person.firstName}} {{person.lastName}}
|
28808
|
-
{{/each}}
|
28809
|
-
```
|
28810
|
-
|
28811
|
-
Although you are binding to the controller, the behavior of this controller
|
28812
|
-
is to pass through any methods or properties to the underlying array. This
|
28813
|
-
capability comes from `Ember.ArrayProxy`, which this class inherits from.
|
28814
|
-
|
28815
|
-
Sometimes you want to display computed properties within the body of an
|
28816
|
-
`#each` helper that depend on the underlying items in `model`, but are not
|
28817
|
-
present on those items. To do this, set `itemController` to the name of a
|
28818
|
-
controller that will wrap each individual item.
|
28819
|
-
|
28820
|
-
For example:
|
28821
|
-
|
28822
|
-
```handlebars
|
28823
|
-
{{#each controller as |post|}}
|
28824
|
-
<li>{{post.title}} ({{post.titleLength}} characters)</li>
|
28825
|
-
{{/each}}
|
28826
|
-
```
|
28827
|
-
|
28828
|
-
```javascript
|
28829
|
-
App.PostsController = Ember.ArrayController.extend({
|
28830
|
-
itemController: 'post'
|
28831
|
-
});
|
28832
|
-
|
28833
|
-
App.PostController = Ember.Controller.extend({
|
28834
|
-
// the `title` property will be proxied to the underlying post.
|
28835
|
-
titleLength: function() {
|
28836
|
-
return this.get('title').length;
|
28837
|
-
}.property('title')
|
28838
|
-
});
|
28839
|
-
```
|
28840
|
-
|
28841
|
-
In some cases it is helpful to return a different `itemController` depending
|
28842
|
-
on the particular item. Subclasses can do this by overriding
|
28843
|
-
`lookupItemController`.
|
28844
|
-
|
28845
|
-
For example:
|
28846
|
-
|
28847
|
-
```javascript
|
28848
|
-
App.MyArrayController = Ember.ArrayController.extend({
|
28849
|
-
lookupItemController: function( object ) {
|
28850
|
-
if (object.get('isSpecial')) {
|
28851
|
-
return "special"; // use App.SpecialController
|
28852
|
-
} else {
|
28853
|
-
return "regular"; // use App.RegularController
|
28854
|
-
}
|
28855
|
-
}
|
28856
|
-
});
|
28857
|
-
```
|
28858
|
-
|
28859
|
-
The itemController instances will have a `parentController` property set to
|
28860
|
-
the `ArrayController` instance.
|
28861
|
-
|
28862
|
-
@class ArrayController
|
28863
|
-
@namespace Ember
|
28864
|
-
@extends Ember.ArrayProxy
|
28865
|
-
@uses Ember.SortableMixin
|
28866
|
-
@uses Ember.ControllerMixin
|
28867
|
-
@deprecated
|
28868
|
-
@public
|
28869
|
-
*/
|
28870
|
-
|
28871
|
-
exports.default = _emberRuntimeSystemArray_proxy.default.extend(_emberRuntimeMixinsController.default, _emberRuntimeMixinsSortable.default, {
|
28872
|
-
|
28873
|
-
/**
|
28874
|
-
A string containing the controller name used to wrap items.
|
28875
|
-
For example:
|
28876
|
-
```javascript
|
28877
|
-
App.MyArrayController = Ember.ArrayController.extend({
|
28878
|
-
itemController: 'myItem' // use App.MyItemController
|
28879
|
-
});
|
28880
|
-
```
|
28881
|
-
@property itemController
|
28882
|
-
@type String
|
28883
|
-
@default null
|
28884
|
-
@private
|
28885
|
-
*/
|
28886
|
-
itemController: null,
|
28887
|
-
|
28888
|
-
/**
|
28889
|
-
Return the name of the controller to wrap items, or `null` if items should
|
28890
|
-
be returned directly. The default implementation simply returns the
|
28891
|
-
`itemController` property, but subclasses can override this method to return
|
28892
|
-
different controllers for different objects.
|
28893
|
-
For example:
|
28894
|
-
```javascript
|
28895
|
-
App.MyArrayController = Ember.ArrayController.extend({
|
28896
|
-
lookupItemController: function( object ) {
|
28897
|
-
if (object.get('isSpecial')) {
|
28898
|
-
return "special"; // use App.SpecialController
|
28899
|
-
} else {
|
28900
|
-
return "regular"; // use App.RegularController
|
28901
|
-
}
|
28902
|
-
}
|
28903
|
-
});
|
28904
|
-
```
|
28905
|
-
@method lookupItemController
|
28906
|
-
@param {Object} object
|
28907
|
-
@return {String}
|
28908
|
-
@private
|
28909
|
-
*/
|
28910
|
-
lookupItemController: function (object) {
|
28911
|
-
return _emberMetalProperty_get.get(this, 'itemController');
|
28912
|
-
},
|
28913
|
-
|
28914
|
-
objectAtContent: function (idx) {
|
28915
|
-
var length = _emberMetalProperty_get.get(this, 'length');
|
28916
|
-
var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent');
|
28917
|
-
var object = arrangedContent && arrangedContent.objectAt(idx);
|
28918
|
-
var controllerClass;
|
28919
|
-
|
28920
|
-
if (idx >= 0 && idx < length) {
|
28921
|
-
controllerClass = this.lookupItemController(object);
|
28922
|
-
|
28923
|
-
if (controllerClass) {
|
28924
|
-
return this.controllerAt(idx, object, controllerClass);
|
28925
|
-
}
|
28926
|
-
}
|
28927
|
-
|
28928
|
-
// When `controllerClass` is falsy, we have not opted in to using item
|
28929
|
-
// controllers, so return the object directly.
|
28930
|
-
|
28931
|
-
// When the index is out of range, we want to return the "out of range"
|
28932
|
-
// value, whatever that might be. Rather than make assumptions
|
28933
|
-
// (e.g. guessing `null` or `undefined`) we defer this to `arrangedContent`.
|
28934
|
-
return object;
|
28935
|
-
},
|
28936
|
-
|
28937
|
-
arrangedContentDidChange: function () {
|
28938
|
-
this._super.apply(this, arguments);
|
28939
|
-
this._resetSubControllers();
|
28940
|
-
},
|
28941
|
-
|
28942
|
-
arrayContentDidChange: function (idx, removedCnt, addedCnt) {
|
28943
|
-
var subControllers = this._subControllers;
|
28944
|
-
|
28945
|
-
if (subControllers.length) {
|
28946
|
-
var subControllersToRemove = subControllers.slice(idx, idx + removedCnt);
|
28947
|
-
|
28948
|
-
subControllersToRemove.forEach(function (subController) {
|
28949
|
-
if (subController) {
|
28950
|
-
subController.destroy();
|
28951
|
-
}
|
28952
|
-
});
|
28953
|
-
|
28954
|
-
_emberMetalReplace.default(subControllers, idx, removedCnt, new Array(addedCnt));
|
28955
|
-
}
|
28956
|
-
|
28957
|
-
// The shadow array of subcontrollers must be updated before we trigger
|
28958
|
-
// observers, otherwise observers will get the wrong subcontainer when
|
28959
|
-
// calling `objectAt`
|
28960
|
-
this._super(idx, removedCnt, addedCnt);
|
28961
|
-
},
|
28962
|
-
|
28963
|
-
init: function () {
|
28964
|
-
_emberMetalCore.default.deprecate(arrayControllerDeprecation, this.isGenerated);
|
28965
|
-
|
28966
|
-
this._super.apply(this, arguments);
|
28967
|
-
this._subControllers = [];
|
28968
|
-
},
|
28969
|
-
|
28970
|
-
model: _emberMetalComputed.computed({
|
28971
|
-
get: function (key) {
|
28972
|
-
return _emberMetalCore.default.A();
|
28973
|
-
},
|
28974
|
-
set: function (key, value) {
|
28975
|
-
_emberMetalCore.default.assert('ArrayController expects `model` to implement the Ember.Array mixin. ' + 'This can often be fixed by wrapping your model with `Ember.A()`.', _emberRuntimeMixinsArray.default.detect(value) || !value);
|
28976
|
-
|
28977
|
-
return value;
|
28978
|
-
}
|
28979
|
-
}),
|
28980
|
-
|
28981
|
-
/**
|
28982
|
-
Flag to mark as being "virtual". Used to keep this instance
|
28983
|
-
from participating in the parentController hierarchy.
|
28984
|
-
@private
|
28985
|
-
@property _isVirtual
|
28986
|
-
@type Boolean
|
28987
|
-
*/
|
28988
|
-
_isVirtual: false,
|
28989
|
-
|
28990
|
-
controllerAt: function (idx, object, controllerClass) {
|
28991
|
-
var container = _emberMetalProperty_get.get(this, 'container');
|
28992
|
-
var subControllers = this._subControllers;
|
28993
|
-
var fullName, subController, parentController;
|
28994
|
-
|
28995
|
-
if (subControllers.length > idx) {
|
28996
|
-
subController = subControllers[idx];
|
28997
|
-
|
28998
|
-
if (subController) {
|
28999
|
-
return subController;
|
29000
|
-
}
|
29001
|
-
}
|
29002
|
-
|
29003
|
-
if (this._isVirtual) {
|
29004
|
-
parentController = _emberMetalProperty_get.get(this, 'parentController');
|
29005
|
-
} else {
|
29006
|
-
parentController = this;
|
29007
|
-
}
|
29008
|
-
|
29009
|
-
fullName = 'controller:' + controllerClass;
|
29010
|
-
|
29011
|
-
if (!container._registry.has(fullName)) {
|
29012
|
-
throw new _emberMetalError.default('Could not resolve itemController: "' + controllerClass + '"');
|
29013
|
-
}
|
29014
|
-
|
29015
|
-
subController = container.lookupFactory(fullName).create({
|
29016
|
-
target: parentController,
|
29017
|
-
parentController: parentController,
|
29018
|
-
model: object
|
29019
|
-
});
|
29020
|
-
|
29021
|
-
subControllers[idx] = subController;
|
29022
|
-
|
29023
|
-
return subController;
|
29024
|
-
},
|
29025
|
-
|
29026
|
-
_subControllers: null,
|
29027
|
-
|
29028
|
-
_resetSubControllers: function () {
|
29029
|
-
var controller;
|
29030
|
-
var subControllers = this._subControllers;
|
29031
|
-
|
29032
|
-
if (subControllers.length) {
|
29033
|
-
for (var i = 0, length = subControllers.length; length > i; i++) {
|
29034
|
-
controller = subControllers[i];
|
29035
|
-
|
29036
|
-
if (controller) {
|
29037
|
-
controller.destroy();
|
29038
|
-
}
|
29039
|
-
}
|
29040
|
-
|
29041
|
-
subControllers.length = 0;
|
29042
|
-
}
|
29043
|
-
},
|
29044
|
-
|
29045
|
-
willDestroy: function () {
|
29046
|
-
this._resetSubControllers();
|
29047
|
-
this._super.apply(this, arguments);
|
29048
|
-
}
|
29049
|
-
});
|
29050
|
-
});
|
29051
|
-
/**
|
29052
|
-
@module ember
|
29053
|
-
@submodule ember-runtime
|
29054
|
-
*/
|
29055
28609
|
enifed('ember-runtime/controllers/controller', ['exports', 'ember-metal/core', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject'], function (exports, _emberMetalCore, _emberRuntimeSystemObject, _emberRuntimeMixinsController, _emberRuntimeInject) {
|
29056
28610
|
|
29057
28611
|
/**
|
@@ -29238,7 +28792,7 @@ enifed('ember-runtime/core', ['exports'], function (exports) {
|
|
29238
28792
|
return a === b;
|
29239
28793
|
}
|
29240
28794
|
});
|
29241
|
-
enifed('ember-runtime/ext/function', ['exports', 'ember-metal/core', 'ember-metal/
|
28795
|
+
enifed('ember-runtime/ext/function', ['exports', 'ember-metal/core', 'ember-metal/computed', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalComputed, _emberMetalMixin) {
|
29242
28796
|
|
29243
28797
|
var a_slice = Array.prototype.slice;
|
29244
28798
|
var FunctionPrototype = Function.prototype;
|
@@ -29364,40 +28918,6 @@ enifed('ember-runtime/ext/function', ['exports', 'ember-metal/core', 'ember-meta
|
|
29364
28918
|
*/
|
29365
28919
|
FunctionPrototype.observesImmediately = _emberMetalCore.default.deprecateFunc('Function#observesImmediately is deprecated. Use Function#observes instead', FunctionPrototype._observesImmediately);
|
29366
28920
|
|
29367
|
-
/**
|
29368
|
-
The `observesBefore` extension of Javascript's Function prototype is
|
29369
|
-
available when `Ember.EXTEND_PROTOTYPES` or
|
29370
|
-
`Ember.EXTEND_PROTOTYPES.Function` is true, which is the default.
|
29371
|
-
You can get notified when a property change is about to happen by
|
29372
|
-
adding the `observesBefore` call to the end of your method
|
29373
|
-
declarations in classes that you write. For example:
|
29374
|
-
```javascript
|
29375
|
-
Ember.Object.extend({
|
29376
|
-
valueObserver: function() {
|
29377
|
-
// Executes whenever the "value" property is about to change
|
29378
|
-
}.observesBefore('value')
|
29379
|
-
});
|
29380
|
-
```
|
29381
|
-
See `Ember.beforeObserver`.
|
29382
|
-
@method observesBefore
|
29383
|
-
@for Function
|
29384
|
-
@private
|
29385
|
-
*/
|
29386
|
-
FunctionPrototype.observesBefore = function () {
|
29387
|
-
var watched = [];
|
29388
|
-
var addWatchedProperty = function (obs) {
|
29389
|
-
watched.push(obs);
|
29390
|
-
};
|
29391
|
-
|
29392
|
-
for (var i = 0, l = arguments.length; i < l; ++i) {
|
29393
|
-
_emberMetalExpand_properties.default(arguments[i], addWatchedProperty);
|
29394
|
-
}
|
29395
|
-
|
29396
|
-
this.__ember_observesBefore__ = watched;
|
29397
|
-
|
29398
|
-
return this;
|
29399
|
-
};
|
29400
|
-
|
29401
28921
|
/**
|
29402
28922
|
The `on` extension of Javascript's Function prototype is available
|
29403
28923
|
when `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Function` is
|
@@ -29909,23 +29429,14 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal/core', 'e
|
|
29909
29429
|
@method willMergeMixin
|
29910
29430
|
*/
|
29911
29431
|
willMergeMixin: function (props) {
|
29912
|
-
var hashName;
|
29913
|
-
|
29914
29432
|
if (!props._actions) {
|
29915
29433
|
_emberMetalCore.default.assert('\'actions\' should not be a function', typeof props.actions !== 'function');
|
29916
29434
|
|
29917
29435
|
if (!!props.actions && typeof props.actions === 'object') {
|
29918
|
-
hashName = 'actions';
|
29919
|
-
} else if (!!props.events && typeof props.events === 'object') {
|
29920
|
-
_emberMetalCore.default.deprecate('Action handlers contained in an `events` object are deprecated in favor' + ' of putting them in an `actions` object', false);
|
29921
|
-
hashName = 'events';
|
29922
|
-
}
|
29923
|
-
|
29924
|
-
if (hashName) {
|
29436
|
+
var hashName = 'actions';
|
29925
29437
|
props._actions = _emberMetalMerge.default(props._actions || {}, props[hashName]);
|
29438
|
+
delete props[hashName];
|
29926
29439
|
}
|
29927
|
-
|
29928
|
-
delete props[hashName];
|
29929
29440
|
}
|
29930
29441
|
},
|
29931
29442
|
|
@@ -30011,7 +29522,7 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
|
|
30011
29522
|
concrete implementation, but it can be used up by other classes that want
|
30012
29523
|
to appear like arrays.
|
30013
29524
|
|
30014
|
-
For example, ArrayProxy
|
29525
|
+
For example, ArrayProxy is a concrete classes that can
|
30015
29526
|
be instantiated to implement array-like behavior. Both of these classes use
|
30016
29527
|
the Array Mixin by way of the MutableArray mixin, which allows observable
|
30017
29528
|
changes to be made to the underlying array.
|
@@ -30511,9 +30022,6 @@ enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal/mixin'], func
|
|
30511
30022
|
enifed('ember-runtime/mixins/controller', ['exports', 'ember-metal/mixin', 'ember-metal/alias', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/controller_content_model_alias_deprecation'], function (exports, _emberMetalMixin, _emberMetalAlias, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsController_content_model_alias_deprecation) {
|
30512
30023
|
|
30513
30024
|
/**
|
30514
|
-
`Ember.ControllerMixin` provides a standard interface for all classes that
|
30515
|
-
compose Ember's controller layer: `Ember.Controller` and `Ember.ArrayController`.
|
30516
|
-
|
30517
30025
|
@class ControllerMixin
|
30518
30026
|
@namespace Ember
|
30519
30027
|
@uses Ember.ActionHandler
|
@@ -30605,7 +30113,7 @@ enifed('ember-runtime/mixins/controller_content_model_alias_deprecation', ['expo
|
|
30605
30113
|
});
|
30606
30114
|
});
|
30607
30115
|
// Ember.deprecate
|
30608
|
-
enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-runtime/mixins/freezable', 'ember-runtime/system/string', 'ember-metal/error'], function (exports, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsFreezable, _emberRuntimeSystemString, _emberMetalError) {
|
30116
|
+
enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-runtime/mixins/freezable', 'ember-runtime/system/string', 'ember-metal/error'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberRuntimeMixinsFreezable, _emberRuntimeSystemString, _emberMetalError) {
|
30609
30117
|
|
30610
30118
|
/**
|
30611
30119
|
Implements some standard methods for copying an object. Add this mixin to
|
@@ -30645,9 +30153,11 @@ enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/property_get',
|
|
30645
30153
|
consuming more memory.
|
30646
30154
|
@method frozenCopy
|
30647
30155
|
@return {Object} copy of receiver or receiver
|
30156
|
+
@deprecated Use `Object.freeze` instead.
|
30648
30157
|
@private
|
30649
30158
|
*/
|
30650
30159
|
frozenCopy: function () {
|
30160
|
+
_emberMetalCore.default.deprecate('`frozenCopy` is deprecated, use Object.freeze instead.');
|
30651
30161
|
if (_emberRuntimeMixinsFreezable.Freezable && _emberRuntimeMixinsFreezable.Freezable.detect(this)) {
|
30652
30162
|
return _emberMetalProperty_get.get(this, 'isFrozen') ? this : this.copy().freeze();
|
30653
30163
|
} else {
|
@@ -31161,16 +30671,6 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31161
30671
|
});
|
31162
30672
|
},
|
31163
30673
|
|
31164
|
-
/**
|
31165
|
-
@method everyProperty
|
31166
|
-
@param {String} key the property to test
|
31167
|
-
@param {String} [value] optional value to test against.
|
31168
|
-
@deprecated Use `isEvery` instead
|
31169
|
-
@return {Boolean}
|
31170
|
-
@private
|
31171
|
-
*/
|
31172
|
-
everyProperty: _emberMetalMixin.aliasMethod('isEvery'),
|
31173
|
-
|
31174
30674
|
/**
|
31175
30675
|
Returns `true` if the passed property resolves to the value of the second
|
31176
30676
|
argument for all items in the enumerable. This method is often simpler/faster
|
@@ -31236,37 +30736,6 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31236
30736
|
return found;
|
31237
30737
|
},
|
31238
30738
|
|
31239
|
-
/**
|
31240
|
-
Returns `true` if the passed function returns true for any item in the
|
31241
|
-
enumeration. This corresponds with the `some()` method in JavaScript 1.6.
|
31242
|
-
The callback method you provide should have the following signature (all
|
31243
|
-
parameters are optional):
|
31244
|
-
```javascript
|
31245
|
-
function(item, index, enumerable);
|
31246
|
-
```
|
31247
|
-
- `item` is the current item in the iteration.
|
31248
|
-
- `index` is the current index in the iteration.
|
31249
|
-
- `enumerable` is the enumerable object itself.
|
31250
|
-
It should return the `true` to include the item in the results, `false`
|
31251
|
-
otherwise.
|
31252
|
-
Note that in addition to a callback, you can also pass an optional target
|
31253
|
-
object that will be set as `this` on the context. This is a good way
|
31254
|
-
to give your iterator function access to the current object.
|
31255
|
-
Usage Example:
|
31256
|
-
```javascript
|
31257
|
-
if (people.some(isManager)) {
|
31258
|
-
Paychecks.addBiggerBonus();
|
31259
|
-
}
|
31260
|
-
```
|
31261
|
-
@method some
|
31262
|
-
@param {Function} callback The callback to execute
|
31263
|
-
@param {Object} [target] The target object to use
|
31264
|
-
@return {Boolean} `true` if the passed function returns `true` for any item
|
31265
|
-
@deprecated Use `any` instead
|
31266
|
-
@private
|
31267
|
-
*/
|
31268
|
-
some: _emberMetalMixin.aliasMethod('any'),
|
31269
|
-
|
31270
30739
|
/**
|
31271
30740
|
Returns `true` if the passed property resolves to the value of the second
|
31272
30741
|
argument for any item in the enumerable. This method is often simpler/faster
|
@@ -31282,16 +30751,6 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31282
30751
|
return this.any(iter.apply(this, arguments));
|
31283
30752
|
},
|
31284
30753
|
|
31285
|
-
/**
|
31286
|
-
@method anyBy
|
31287
|
-
@param {String} key the property to test
|
31288
|
-
@param {String} [value] optional value to test against.
|
31289
|
-
@return {Boolean}
|
31290
|
-
@deprecated Use `isAny` instead
|
31291
|
-
@private
|
31292
|
-
*/
|
31293
|
-
anyBy: _emberMetalMixin.aliasMethod('isAny'),
|
31294
|
-
|
31295
30754
|
/**
|
31296
30755
|
This will combine the values of the enumerator into a single value. It
|
31297
30756
|
is a useful way to collect a summary value from an enumeration. This
|
@@ -31820,7 +31279,7 @@ enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal/mixin', 'ember-m
|
|
31820
31279
|
}
|
31821
31280
|
});
|
31822
31281
|
});
|
31823
|
-
enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalMixin, _emberMetalProperty_get, _emberMetalProperty_set) {
|
31282
|
+
enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal/core', 'ember-metal/mixin', 'ember-metal/property_get', 'ember-metal/property_set'], function (exports, _emberMetalCore, _emberMetalMixin, _emberMetalProperty_get, _emberMetalProperty_set) {
|
31824
31283
|
|
31825
31284
|
/**
|
31826
31285
|
The `Ember.Freezable` mixin implements some basic methods for marking an
|
@@ -31877,10 +31336,16 @@ enifed('ember-runtime/mixins/freezable', ['exports', 'ember-metal/mixin', 'ember
|
|
31877
31336
|
@class Freezable
|
31878
31337
|
@namespace Ember
|
31879
31338
|
@since Ember 0.9
|
31339
|
+
@deprecated Use `Object.freeze` instead.
|
31880
31340
|
@private
|
31881
31341
|
*/
|
31882
31342
|
var Freezable = _emberMetalMixin.Mixin.create({
|
31883
31343
|
|
31344
|
+
init: function () {
|
31345
|
+
_emberMetalCore.default.deprecate('`Ember.Freezable` is deprecated, use `Object.freeze` instead.');
|
31346
|
+
this._super.apply(this, arguments);
|
31347
|
+
},
|
31348
|
+
|
31884
31349
|
/**
|
31885
31350
|
Set to `true` when the object is frozen. Use this property to detect
|
31886
31351
|
whether your object is frozen or not.
|
@@ -31936,7 +31401,7 @@ enifed('ember-runtime/mixins/mutable_array', ['exports', 'ember-metal/property_g
|
|
31936
31401
|
This mixin defines the API for modifying array-like objects. These methods
|
31937
31402
|
can be applied only to a collection that keeps its items in an ordered set.
|
31938
31403
|
It builds upon the Array mixin and adds methods to modify the array.
|
31939
|
-
|
31404
|
+
One concrete implementations of this class include ArrayProxy.
|
31940
31405
|
|
31941
31406
|
It is important to use the methods in this class to modify arrays so that
|
31942
31407
|
changes are observable. This allows the binding system in Ember to function
|
@@ -32651,11 +32116,6 @@ enifed('ember-runtime/mixins/observable', ['exports', 'ember-metal/core', 'ember
|
|
32651
32116
|
return this;
|
32652
32117
|
},
|
32653
32118
|
|
32654
|
-
_addBeforeObserver: function (key, target, method) {
|
32655
|
-
_emberMetalCore.default.deprecate('Before observers are deprecated and will be removed in a future release. If you want to keep track of previous values you have to implement it yourself.', false, { url: 'http://emberjs.com/guides/deprecations/#toc_deprecate-beforeobservers' });
|
32656
|
-
_emberMetalObserver._addBeforeObserver(this, key, target, method);
|
32657
|
-
},
|
32658
|
-
|
32659
32119
|
/**
|
32660
32120
|
Adds an observer on a property.
|
32661
32121
|
This is the core method used to register an observer for a property.
|
@@ -32853,7 +32313,7 @@ enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal/property_g
|
|
32853
32313
|
}
|
32854
32314
|
|
32855
32315
|
/**
|
32856
|
-
A low level mixin making ObjectProxy
|
32316
|
+
A low level mixin making ObjectProxy promise-aware.
|
32857
32317
|
|
32858
32318
|
```javascript
|
32859
32319
|
var ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin);
|
@@ -33012,309 +32472,6 @@ enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal/property_g
|
|
33012
32472
|
};
|
33013
32473
|
}
|
33014
32474
|
});
|
33015
|
-
enifed('ember-runtime/mixins/sortable', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/compare', 'ember-metal/observer', 'ember-metal/computed', 'ember-metal/computed_macros', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeCompare, _emberMetalObserver, _emberMetalComputed, _emberMetalComputed_macros, _emberMetalMixin) {
|
33016
|
-
//ES6TODO: should we access these directly from their package or from how their exposed in ember-metal?
|
33017
|
-
|
33018
|
-
/**
|
33019
|
-
`Ember.SortableMixin` provides a standard interface for array proxies
|
33020
|
-
to specify a sort order and maintain this sorting when objects are added,
|
33021
|
-
removed, or updated without changing the implicit order of their underlying
|
33022
|
-
model array:
|
33023
|
-
|
33024
|
-
```javascript
|
33025
|
-
songs = [
|
33026
|
-
{trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'},
|
33027
|
-
{trackNumber: 2, title: 'Back in the U.S.S.R.'},
|
33028
|
-
{trackNumber: 3, title: 'Glass Onion'},
|
33029
|
-
];
|
33030
|
-
|
33031
|
-
songsController = Ember.ArrayController.create({
|
33032
|
-
model: songs,
|
33033
|
-
sortProperties: ['trackNumber'],
|
33034
|
-
sortAscending: true
|
33035
|
-
});
|
33036
|
-
|
33037
|
-
songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}
|
33038
|
-
|
33039
|
-
songsController.addObject({trackNumber: 1, title: 'Dear Prudence'});
|
33040
|
-
songsController.get('firstObject'); // {trackNumber: 1, title: 'Dear Prudence'}
|
33041
|
-
```
|
33042
|
-
|
33043
|
-
If you add or remove the properties to sort by or change the sort direction the model
|
33044
|
-
sort order will be automatically updated.
|
33045
|
-
|
33046
|
-
```javascript
|
33047
|
-
songsController.set('sortProperties', ['title']);
|
33048
|
-
songsController.get('firstObject'); // {trackNumber: 2, title: 'Back in the U.S.S.R.'}
|
33049
|
-
|
33050
|
-
songsController.toggleProperty('sortAscending');
|
33051
|
-
songsController.get('firstObject'); // {trackNumber: 4, title: 'Ob-La-Di, Ob-La-Da'}
|
33052
|
-
```
|
33053
|
-
|
33054
|
-
`SortableMixin` works by sorting the `arrangedContent` array, which is the array that
|
33055
|
-
`ArrayProxy` displays. Due to the fact that the underlying 'content' array is not changed, that
|
33056
|
-
array will not display the sorted list:
|
33057
|
-
|
33058
|
-
```javascript
|
33059
|
-
songsController.get('content').get('firstObject'); // Returns the unsorted original content
|
33060
|
-
songsController.get('firstObject'); // Returns the sorted content.
|
33061
|
-
```
|
33062
|
-
|
33063
|
-
Although the sorted content can also be accessed through the `arrangedContent` property,
|
33064
|
-
it is preferable to use the proxied class and not the `arrangedContent` array directly.
|
33065
|
-
|
33066
|
-
@class SortableMixin
|
33067
|
-
@namespace Ember
|
33068
|
-
@uses Ember.MutableEnumerable
|
33069
|
-
@private
|
33070
|
-
*/
|
33071
|
-
exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsMutable_enumerable.default, {
|
33072
|
-
|
33073
|
-
/**
|
33074
|
-
Specifies which properties dictate the `arrangedContent`'s sort order.
|
33075
|
-
When specifying multiple properties the sorting will use properties
|
33076
|
-
from the `sortProperties` array prioritized from first to last.
|
33077
|
-
@property {Array} sortProperties
|
33078
|
-
@private
|
33079
|
-
*/
|
33080
|
-
sortProperties: null,
|
33081
|
-
|
33082
|
-
/**
|
33083
|
-
Specifies the `arrangedContent`'s sort direction.
|
33084
|
-
Sorts the content in ascending order by default. Set to `false` to
|
33085
|
-
use descending order.
|
33086
|
-
@property {Boolean} sortAscending
|
33087
|
-
@default true
|
33088
|
-
@private
|
33089
|
-
*/
|
33090
|
-
sortAscending: true,
|
33091
|
-
|
33092
|
-
/**
|
33093
|
-
The function used to compare two values. You can override this if you
|
33094
|
-
want to do custom comparisons. Functions must be of the type expected by
|
33095
|
-
Array#sort, i.e.,
|
33096
|
-
* return 0 if the two parameters are equal,
|
33097
|
-
* return a negative value if the first parameter is smaller than the second or
|
33098
|
-
* return a positive value otherwise:
|
33099
|
-
```javascript
|
33100
|
-
function(x, y) { // These are assumed to be integers
|
33101
|
-
if (x === y)
|
33102
|
-
return 0;
|
33103
|
-
return x < y ? -1 : 1;
|
33104
|
-
}
|
33105
|
-
```
|
33106
|
-
@property sortFunction
|
33107
|
-
@type {Function}
|
33108
|
-
@default Ember.compare
|
33109
|
-
@private
|
33110
|
-
*/
|
33111
|
-
sortFunction: _emberRuntimeCompare.default,
|
33112
|
-
|
33113
|
-
orderBy: function (item1, item2) {
|
33114
|
-
var _this = this;
|
33115
|
-
|
33116
|
-
var result = 0;
|
33117
|
-
var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties');
|
33118
|
-
var sortAscending = _emberMetalProperty_get.get(this, 'sortAscending');
|
33119
|
-
var sortFunction = _emberMetalProperty_get.get(this, 'sortFunction');
|
33120
|
-
|
33121
|
-
_emberMetalCore.default.assert('you need to define `sortProperties`', !!sortProperties);
|
33122
|
-
|
33123
|
-
sortProperties.forEach(function (propertyName) {
|
33124
|
-
if (result === 0) {
|
33125
|
-
result = sortFunction.call(_this, _emberMetalProperty_get.get(item1, propertyName), _emberMetalProperty_get.get(item2, propertyName));
|
33126
|
-
if (result !== 0 && !sortAscending) {
|
33127
|
-
result = -1 * result;
|
33128
|
-
}
|
33129
|
-
}
|
33130
|
-
});
|
33131
|
-
|
33132
|
-
return result;
|
33133
|
-
},
|
33134
|
-
|
33135
|
-
destroy: function () {
|
33136
|
-
var _this2 = this;
|
33137
|
-
|
33138
|
-
var content = _emberMetalProperty_get.get(this, 'content');
|
33139
|
-
var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties');
|
33140
|
-
|
33141
|
-
if (content && sortProperties) {
|
33142
|
-
content.forEach(function (item) {
|
33143
|
-
sortProperties.forEach(function (sortProperty) {
|
33144
|
-
_emberMetalObserver.removeObserver(item, sortProperty, _this2, 'contentItemSortPropertyDidChange');
|
33145
|
-
});
|
33146
|
-
});
|
33147
|
-
}
|
33148
|
-
|
33149
|
-
return this._super.apply(this, arguments);
|
33150
|
-
},
|
33151
|
-
|
33152
|
-
isSorted: _emberMetalComputed_macros.notEmpty('sortProperties'),
|
33153
|
-
|
33154
|
-
/**
|
33155
|
-
Overrides the default `arrangedContent` from `ArrayProxy` in order to sort by `sortFunction`.
|
33156
|
-
Also sets up observers for each `sortProperty` on each item in the content Array.
|
33157
|
-
@property arrangedContent
|
33158
|
-
@private
|
33159
|
-
*/
|
33160
|
-
arrangedContent: _emberMetalComputed.computed('content', 'sortProperties.@each', {
|
33161
|
-
get: function (key) {
|
33162
|
-
var _this3 = this;
|
33163
|
-
|
33164
|
-
var content = _emberMetalProperty_get.get(this, 'content');
|
33165
|
-
var isSorted = _emberMetalProperty_get.get(this, 'isSorted');
|
33166
|
-
var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties');
|
33167
|
-
|
33168
|
-
if (content && isSorted) {
|
33169
|
-
content = content.slice();
|
33170
|
-
content.sort(function (item1, item2) {
|
33171
|
-
return _this3.orderBy(item1, item2);
|
33172
|
-
});
|
33173
|
-
|
33174
|
-
content.forEach(function (item) {
|
33175
|
-
sortProperties.forEach(function (sortProperty) {
|
33176
|
-
_emberMetalObserver.addObserver(item, sortProperty, _this3, 'contentItemSortPropertyDidChange');
|
33177
|
-
});
|
33178
|
-
});
|
33179
|
-
|
33180
|
-
return _emberMetalCore.default.A(content);
|
33181
|
-
}
|
33182
|
-
|
33183
|
-
return content;
|
33184
|
-
}
|
33185
|
-
}),
|
33186
|
-
|
33187
|
-
_contentWillChange: _emberMetalMixin._beforeObserver('content', function () {
|
33188
|
-
var _this4 = this;
|
33189
|
-
|
33190
|
-
var content = _emberMetalProperty_get.get(this, 'content');
|
33191
|
-
var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties');
|
33192
|
-
|
33193
|
-
if (content && sortProperties) {
|
33194
|
-
content.forEach(function (item) {
|
33195
|
-
sortProperties.forEach(function (sortProperty) {
|
33196
|
-
_emberMetalObserver.removeObserver(item, sortProperty, _this4, 'contentItemSortPropertyDidChange');
|
33197
|
-
});
|
33198
|
-
});
|
33199
|
-
}
|
33200
|
-
|
33201
|
-
this._super.apply(this, arguments);
|
33202
|
-
}),
|
33203
|
-
|
33204
|
-
sortPropertiesWillChange: _emberMetalMixin._beforeObserver('sortProperties', function () {
|
33205
|
-
this._lastSortAscending = undefined;
|
33206
|
-
}),
|
33207
|
-
|
33208
|
-
sortPropertiesDidChange: _emberMetalMixin.observer('sortProperties', function () {
|
33209
|
-
this._lastSortAscending = undefined;
|
33210
|
-
}),
|
33211
|
-
|
33212
|
-
sortAscendingWillChange: _emberMetalMixin._beforeObserver('sortAscending', function () {
|
33213
|
-
this._lastSortAscending = _emberMetalProperty_get.get(this, 'sortAscending');
|
33214
|
-
}),
|
33215
|
-
|
33216
|
-
sortAscendingDidChange: _emberMetalMixin.observer('sortAscending', function () {
|
33217
|
-
if (this._lastSortAscending !== undefined && _emberMetalProperty_get.get(this, 'sortAscending') !== this._lastSortAscending) {
|
33218
|
-
var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent');
|
33219
|
-
arrangedContent.reverseObjects();
|
33220
|
-
}
|
33221
|
-
}),
|
33222
|
-
|
33223
|
-
contentArrayWillChange: function (array, idx, removedCount, addedCount) {
|
33224
|
-
var _this5 = this;
|
33225
|
-
|
33226
|
-
var isSorted = _emberMetalProperty_get.get(this, 'isSorted');
|
33227
|
-
|
33228
|
-
if (isSorted) {
|
33229
|
-
var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent');
|
33230
|
-
var removedObjects = array.slice(idx, idx + removedCount);
|
33231
|
-
var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties');
|
33232
|
-
|
33233
|
-
removedObjects.forEach(function (item) {
|
33234
|
-
arrangedContent.removeObject(item);
|
33235
|
-
|
33236
|
-
sortProperties.forEach(function (sortProperty) {
|
33237
|
-
_emberMetalObserver.removeObserver(item, sortProperty, _this5, 'contentItemSortPropertyDidChange');
|
33238
|
-
}, _this5);
|
33239
|
-
}, this);
|
33240
|
-
}
|
33241
|
-
|
33242
|
-
return this._super(array, idx, removedCount, addedCount);
|
33243
|
-
},
|
33244
|
-
|
33245
|
-
contentArrayDidChange: function (array, idx, removedCount, addedCount) {
|
33246
|
-
var _this6 = this;
|
33247
|
-
|
33248
|
-
var isSorted = _emberMetalProperty_get.get(this, 'isSorted');
|
33249
|
-
var sortProperties = _emberMetalProperty_get.get(this, 'sortProperties');
|
33250
|
-
|
33251
|
-
if (isSorted) {
|
33252
|
-
var addedObjects = array.slice(idx, idx + addedCount);
|
33253
|
-
|
33254
|
-
addedObjects.forEach(function (item) {
|
33255
|
-
_this6.insertItemSorted(item);
|
33256
|
-
|
33257
|
-
sortProperties.forEach(function (sortProperty) {
|
33258
|
-
_emberMetalObserver.addObserver(item, sortProperty, _this6, 'contentItemSortPropertyDidChange');
|
33259
|
-
});
|
33260
|
-
});
|
33261
|
-
}
|
33262
|
-
|
33263
|
-
return this._super(array, idx, removedCount, addedCount);
|
33264
|
-
},
|
33265
|
-
|
33266
|
-
insertItemSorted: function (item) {
|
33267
|
-
var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent');
|
33268
|
-
var length = _emberMetalProperty_get.get(arrangedContent, 'length');
|
33269
|
-
|
33270
|
-
var idx = this._binarySearch(item, 0, length);
|
33271
|
-
arrangedContent.insertAt(idx, item);
|
33272
|
-
},
|
33273
|
-
|
33274
|
-
contentItemSortPropertyDidChange: function (item) {
|
33275
|
-
var arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent');
|
33276
|
-
var oldIndex = arrangedContent.indexOf(item);
|
33277
|
-
var leftItem = arrangedContent.objectAt(oldIndex - 1);
|
33278
|
-
var rightItem = arrangedContent.objectAt(oldIndex + 1);
|
33279
|
-
var leftResult = leftItem && this.orderBy(item, leftItem);
|
33280
|
-
var rightResult = rightItem && this.orderBy(item, rightItem);
|
33281
|
-
|
33282
|
-
if (leftResult < 0 || rightResult > 0) {
|
33283
|
-
arrangedContent.removeObject(item);
|
33284
|
-
this.insertItemSorted(item);
|
33285
|
-
}
|
33286
|
-
},
|
33287
|
-
|
33288
|
-
_binarySearch: function (item, low, high) {
|
33289
|
-
var mid, midItem, res, arrangedContent;
|
33290
|
-
|
33291
|
-
if (low === high) {
|
33292
|
-
return low;
|
33293
|
-
}
|
33294
|
-
|
33295
|
-
arrangedContent = _emberMetalProperty_get.get(this, 'arrangedContent');
|
33296
|
-
|
33297
|
-
mid = low + Math.floor((high - low) / 2);
|
33298
|
-
midItem = arrangedContent.objectAt(mid);
|
33299
|
-
|
33300
|
-
res = this.orderBy(midItem, item);
|
33301
|
-
|
33302
|
-
if (res < 0) {
|
33303
|
-
return this._binarySearch(item, mid + 1, high);
|
33304
|
-
} else if (res > 0) {
|
33305
|
-
return this._binarySearch(item, low, mid);
|
33306
|
-
}
|
33307
|
-
|
33308
|
-
return mid;
|
33309
|
-
}
|
33310
|
-
});
|
33311
|
-
});
|
33312
|
-
/**
|
33313
|
-
@module ember
|
33314
|
-
@submodule ember-runtime
|
33315
|
-
*/
|
33316
|
-
|
33317
|
-
// Ember.assert, Ember.A
|
33318
32475
|
enifed('ember-runtime/mixins/target_action_support', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/mixin', 'ember-metal/computed'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalMixin, _emberMetalComputed) {
|
33319
32476
|
|
33320
32477
|
/**
|
@@ -34041,8 +33198,8 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34041
33198
|
});
|
34042
33199
|
// alerts 'Name is Steve'.
|
34043
33200
|
```
|
34044
|
-
NOTE: If you do override `init` for a framework class like `Ember.View
|
34045
|
-
|
33201
|
+
NOTE: If you do override `init` for a framework class like `Ember.View`,
|
33202
|
+
be sure to call `this._super.apply(this, arguments)` in your
|
34046
33203
|
`init` declaration! If you don't, Ember may not have an opportunity to
|
34047
33204
|
do important setup work, and you'll see strange behavior in your
|
34048
33205
|
application.
|
@@ -34331,28 +33488,6 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34331
33488
|
return Class;
|
34332
33489
|
},
|
34333
33490
|
|
34334
|
-
/**
|
34335
|
-
Equivalent to doing `extend(arguments).create()`.
|
34336
|
-
If possible use the normal `create` method instead.
|
34337
|
-
@method createWithMixins
|
34338
|
-
@static
|
34339
|
-
@param [arguments]*
|
34340
|
-
@private
|
34341
|
-
@deprecated
|
34342
|
-
*/
|
34343
|
-
createWithMixins: _emberMetal.default.deprecateFunc('.createWithMixins is deprecated, please use .create or .extend accordingly', function () {
|
34344
|
-
var C = this;
|
34345
|
-
|
34346
|
-
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
34347
|
-
args[_key2] = arguments[_key2];
|
34348
|
-
}
|
34349
|
-
|
34350
|
-
if (args.length > 0) {
|
34351
|
-
this._initMixins(args);
|
34352
|
-
}
|
34353
|
-
return new C();
|
34354
|
-
}),
|
34355
|
-
|
34356
33491
|
/**
|
34357
33492
|
Creates an instance of a class. Accepts either no arguments, or an object
|
34358
33493
|
containing values to initialize the newly instantiated object with.
|
@@ -34386,8 +33521,8 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34386
33521
|
create: function () {
|
34387
33522
|
var C = this;
|
34388
33523
|
|
34389
|
-
for (var
|
34390
|
-
args[
|
33524
|
+
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
33525
|
+
args[_key2] = arguments[_key2];
|
34391
33526
|
}
|
34392
33527
|
|
34393
33528
|
if (args.length > 0) {
|
@@ -35263,8 +34398,7 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal/core', 'emb
|
|
35263
34398
|
}
|
35264
34399
|
});
|
35265
34400
|
|
35266
|
-
exports.NativeArray
|
35267
|
-
= NativeArray = NativeArray.without.apply(NativeArray, ignore);
|
34401
|
+
exports.NativeArray = NativeArray = NativeArray.without.apply(NativeArray, ignore);
|
35268
34402
|
|
35269
34403
|
/**
|
35270
34404
|
Creates an `Ember.NativeArray` from an Array like object.
|
@@ -35336,7 +34470,8 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal/core', 'emb
|
|
35336
34470
|
|
35337
34471
|
_emberMetalCore.default.A = A; // ES6TODO: Setting A onto the object returned by ember-metal/core to avoid circles
|
35338
34472
|
exports.A = A;
|
35339
|
-
exports.NativeArray = NativeArray
|
34473
|
+
exports.NativeArray = NativeArray // TODO: only use default export
|
34474
|
+
;
|
35340
34475
|
exports.default = NativeArray;
|
35341
34476
|
});
|
35342
34477
|
/**
|
@@ -36445,12 +35580,8 @@ enifed('ember-runtime/utils', ['exports', 'ember-runtime/mixins/array', 'ember-r
|
|
36445
35580
|
return ret;
|
36446
35581
|
}
|
36447
35582
|
});
|
36448
|
-
enifed('ember-template-compiler', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-
|
35583
|
+
enifed('ember-template-compiler', ['exports', 'ember-metal', 'ember-template-compiler/system/precompile', 'ember-template-compiler/system/compile', 'ember-template-compiler/system/template', 'ember-template-compiler/plugins', 'ember-template-compiler/plugins/transform-old-binding-syntax', 'ember-template-compiler/plugins/transform-old-class-binding-syntax', 'ember-template-compiler/plugins/transform-item-class', 'ember-template-compiler/plugins/transform-component-attrs-into-mut', 'ember-template-compiler/plugins/transform-component-curly-to-readonly', 'ember-template-compiler/plugins/transform-angle-bracket-components', 'ember-template-compiler/plugins/transform-input-on-to-onEvent', 'ember-template-compiler/plugins/transform-each-into-collection', 'ember-template-compiler/plugins/deprecate-view-and-controller-paths', 'ember-template-compiler/plugins/deprecate-view-helper', 'ember-template-compiler/compat'], function (exports, _emberMetal, _emberTemplateCompilerSystemPrecompile, _emberTemplateCompilerSystemCompile, _emberTemplateCompilerSystemTemplate, _emberTemplateCompilerPlugins, _emberTemplateCompilerPluginsTransformOldBindingSyntax, _emberTemplateCompilerPluginsTransformOldClassBindingSyntax, _emberTemplateCompilerPluginsTransformItemClass, _emberTemplateCompilerPluginsTransformComponentAttrsIntoMut, _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly, _emberTemplateCompilerPluginsTransformAngleBracketComponents, _emberTemplateCompilerPluginsTransformInputOnToOnEvent, _emberTemplateCompilerPluginsTransformEachIntoCollection, _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths, _emberTemplateCompilerPluginsDeprecateViewHelper, _emberTemplateCompilerCompat) {
|
36449
35584
|
|
36450
|
-
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformWithAsToHash.default);
|
36451
|
-
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachInToBlockParams.default);
|
36452
|
-
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformSingleArgEach.default);
|
36453
|
-
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachIntoCollection.default);
|
36454
35585
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldBindingSyntax.default);
|
36455
35586
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformOldClassBindingSyntax.default);
|
36456
35587
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformItemClass.default);
|
@@ -36458,8 +35589,12 @@ enifed('ember-template-compiler', ['exports', 'ember-metal', 'ember-template-com
|
|
36458
35589
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformComponentCurlyToReadonly.default);
|
36459
35590
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformAngleBracketComponents.default);
|
36460
35591
|
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformInputOnToOnEvent.default);
|
36461
|
-
|
36462
|
-
|
35592
|
+
|
35593
|
+
if (_emberMetal.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
35594
|
+
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsTransformEachIntoCollection.default);
|
35595
|
+
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewAndControllerPaths.default);
|
35596
|
+
_emberTemplateCompilerPlugins.registerPlugin('ast', _emberTemplateCompilerPluginsDeprecateViewHelper.default);
|
35597
|
+
}
|
36463
35598
|
|
36464
35599
|
exports._Ember = _emberMetal.default;
|
36465
35600
|
exports.precompile = _emberTemplateCompilerSystemPrecompile.default;
|
@@ -36784,80 +35919,6 @@ enifed('ember-template-compiler/plugins/transform-component-curly-to-readonly',
|
|
36784
35919
|
|
36785
35920
|
exports.default = TransformComponentCurlyToReadonly;
|
36786
35921
|
});
|
36787
|
-
enifed('ember-template-compiler/plugins/transform-each-in-to-block-params', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) {
|
36788
|
-
/**
|
36789
|
-
@module ember
|
36790
|
-
@submodule ember-htmlbars
|
36791
|
-
*/
|
36792
|
-
|
36793
|
-
/**
|
36794
|
-
An HTMLBars AST transformation that replaces all instances of
|
36795
|
-
|
36796
|
-
```handlebars
|
36797
|
-
{{#each item in items}}
|
36798
|
-
{{/each}}
|
36799
|
-
```
|
36800
|
-
|
36801
|
-
with
|
36802
|
-
|
36803
|
-
```handlebars
|
36804
|
-
{{#each items as |item|}}
|
36805
|
-
{{/each}}
|
36806
|
-
```
|
36807
|
-
|
36808
|
-
@class TransformEachInToBlockParams
|
36809
|
-
@private
|
36810
|
-
*/
|
36811
|
-
function TransformEachInToBlockParams(options) {
|
36812
|
-
// set later within HTMLBars to the syntax package
|
36813
|
-
this.syntax = null;
|
36814
|
-
this.options = options;
|
36815
|
-
}
|
36816
|
-
|
36817
|
-
/**
|
36818
|
-
@private
|
36819
|
-
@method transform
|
36820
|
-
@param {AST} ast The AST to be transformed.
|
36821
|
-
*/
|
36822
|
-
TransformEachInToBlockParams.prototype.transform = function TransformEachInToBlockParams_transform(ast) {
|
36823
|
-
var b = this.syntax.builders;
|
36824
|
-
var walker = new this.syntax.Walker();
|
36825
|
-
var moduleName = this.options.moduleName;
|
36826
|
-
|
36827
|
-
walker.visit(ast, function (node) {
|
36828
|
-
if (validate(node)) {
|
36829
|
-
|
36830
|
-
var removedParams = node.params.splice(0, 2);
|
36831
|
-
var keyword = removedParams[0].original;
|
36832
|
-
var moduleInfo = undefined;
|
36833
|
-
|
36834
|
-
if (node.type === 'BlockStatement') {
|
36835
|
-
moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.program.loc);
|
36836
|
-
|
36837
|
-
if (node.program.blockParams.length) {
|
36838
|
-
throw new Error('You cannot use keyword (`{{#each foo in bar}}`) and block params (`{{#each bar as |foo|}}`) at the same time ' + moduleInfo + '.');
|
36839
|
-
}
|
36840
|
-
|
36841
|
-
node.program.blockParams = [keyword];
|
36842
|
-
} else {
|
36843
|
-
moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.loc);
|
36844
|
-
|
36845
|
-
node.hash.pairs.push(b.pair('keyword', b.string(keyword)));
|
36846
|
-
}
|
36847
|
-
|
36848
|
-
_emberMetalCore.default.deprecate('Using the \'{{#each item in model}}\' form of the {{#each}} helper ' + moduleInfo + 'is deprecated. ' + 'Please use the block param form instead (\'{{#each model as |item|}}\').', false, { url: 'http://emberjs.com/guides/deprecations/#toc_code-in-code-syntax-for-code-each-code' });
|
36849
|
-
}
|
36850
|
-
});
|
36851
|
-
|
36852
|
-
return ast;
|
36853
|
-
};
|
36854
|
-
|
36855
|
-
function validate(node) {
|
36856
|
-
return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'each' && node.params.length === 3 && node.params[1].type === 'PathExpression' && node.params[1].original === 'in';
|
36857
|
-
}
|
36858
|
-
|
36859
|
-
exports.default = TransformEachInToBlockParams;
|
36860
|
-
});
|
36861
35922
|
enifed('ember-template-compiler/plugins/transform-each-in-to-hash', ['exports'], function (exports) {
|
36862
35923
|
/**
|
36863
35924
|
@module ember
|
@@ -37359,98 +36420,6 @@ enifed('ember-template-compiler/plugins/transform-old-class-binding-syntax', ['e
|
|
37359
36420
|
return segments;
|
37360
36421
|
}
|
37361
36422
|
});
|
37362
|
-
enifed('ember-template-compiler/plugins/transform-single-arg-each', ['exports'], function (exports) {
|
37363
|
-
exports.default = TransformSingleArgEach;
|
37364
|
-
|
37365
|
-
function TransformSingleArgEach() {
|
37366
|
-
this.syntax = null;
|
37367
|
-
}
|
37368
|
-
|
37369
|
-
TransformSingleArgEach.prototype.transform = function TransformSingleArgEach_transform(ast) {
|
37370
|
-
var b = this.syntax.builders;
|
37371
|
-
var walker = new this.syntax.Walker();
|
37372
|
-
|
37373
|
-
walker.visit(ast, function (node) {
|
37374
|
-
if (!validate(node)) {
|
37375
|
-
return;
|
37376
|
-
}
|
37377
|
-
|
37378
|
-
node.params.push(b.path('this'));
|
37379
|
-
});
|
37380
|
-
|
37381
|
-
return ast;
|
37382
|
-
};
|
37383
|
-
|
37384
|
-
function validate(node) {
|
37385
|
-
return (node.type === 'BlockStatement' || node.type === 'MustacheStatement') && node.path.original === 'each' && node.params.length === 0;
|
37386
|
-
}
|
37387
|
-
});
|
37388
|
-
enifed('ember-template-compiler/plugins/transform-with-as-to-hash', ['exports', 'ember-metal/core', 'ember-template-compiler/system/calculate-location-display'], function (exports, _emberMetalCore, _emberTemplateCompilerSystemCalculateLocationDisplay) {
|
37389
|
-
|
37390
|
-
/**
|
37391
|
-
An HTMLBars AST transformation that replaces all instances of
|
37392
|
-
|
37393
|
-
```handlebars
|
37394
|
-
{{#with foo.bar as bar}}
|
37395
|
-
{{/with}}
|
37396
|
-
```
|
37397
|
-
|
37398
|
-
with
|
37399
|
-
|
37400
|
-
```handlebars
|
37401
|
-
{{#with foo.bar as |bar|}}
|
37402
|
-
{{/with}}
|
37403
|
-
```
|
37404
|
-
|
37405
|
-
@private
|
37406
|
-
@class TransformWithAsToHash
|
37407
|
-
*/
|
37408
|
-
function TransformWithAsToHash(options) {
|
37409
|
-
// set later within HTMLBars to the syntax package
|
37410
|
-
this.syntax = null;
|
37411
|
-
this.options = options || {};
|
37412
|
-
}
|
37413
|
-
|
37414
|
-
/**
|
37415
|
-
@private
|
37416
|
-
@method transform
|
37417
|
-
@param {AST} ast The AST to be transformed.
|
37418
|
-
*/
|
37419
|
-
TransformWithAsToHash.prototype.transform = function TransformWithAsToHash_transform(ast) {
|
37420
|
-
var pluginContext = this;
|
37421
|
-
var walker = new pluginContext.syntax.Walker();
|
37422
|
-
var moduleName = this.options.moduleName;
|
37423
|
-
|
37424
|
-
walker.visit(ast, function (node) {
|
37425
|
-
if (pluginContext.validate(node)) {
|
37426
|
-
|
37427
|
-
if (node.program && node.program.blockParams.length) {
|
37428
|
-
throw new Error('You cannot use keyword (`{{with foo as bar}}`) and block params (`{{with foo as |bar|}}`) at the same time.');
|
37429
|
-
}
|
37430
|
-
|
37431
|
-
var moduleInfo = _emberTemplateCompilerSystemCalculateLocationDisplay.default(moduleName, node.program.loc);
|
37432
|
-
|
37433
|
-
_emberMetalCore.default.deprecate('Using {{with}} without block syntax ' + moduleInfo + 'is deprecated. ' + 'Please use standard block form (`{{#with foo as |bar|}}`) ' + 'instead.', false, { url: 'http://emberjs.com/deprecations/v1.x/#toc_code-as-code-sytnax-for-code-with-code' });
|
37434
|
-
|
37435
|
-
var removedParams = node.params.splice(1, 2);
|
37436
|
-
var keyword = removedParams[1].original;
|
37437
|
-
node.program.blockParams = [keyword];
|
37438
|
-
}
|
37439
|
-
});
|
37440
|
-
|
37441
|
-
return ast;
|
37442
|
-
};
|
37443
|
-
|
37444
|
-
TransformWithAsToHash.prototype.validate = function TransformWithAsToHash_validate(node) {
|
37445
|
-
return node.type === 'BlockStatement' && node.path.original === 'with' && node.params.length === 3 && node.params[1].type === 'PathExpression' && node.params[1].original === 'as';
|
37446
|
-
};
|
37447
|
-
|
37448
|
-
exports.default = TransformWithAsToHash;
|
37449
|
-
});
|
37450
|
-
/**
|
37451
|
-
@module ember
|
37452
|
-
@submodule ember-htmlbars
|
37453
|
-
*/
|
37454
36423
|
enifed('ember-template-compiler/system/calculate-location-display', ['exports'], function (exports) {
|
37455
36424
|
exports.default = calculateLocationDisplay;
|
37456
36425
|
|
@@ -37548,7 +36517,7 @@ enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-meta
|
|
37548
36517
|
|
37549
36518
|
options.buildMeta = function buildMeta(program) {
|
37550
36519
|
return {
|
37551
|
-
revision: 'Ember@2.0.0-beta.
|
36520
|
+
revision: 'Ember@2.0.0-beta.3',
|
37552
36521
|
loc: program.loc,
|
37553
36522
|
moduleName: options.moduleName
|
37554
36523
|
};
|
@@ -38066,7 +37035,7 @@ enifed('ember-testing/helpers', ['exports', 'ember-metal/core', 'ember-metal/fea
|
|
38066
37035
|
the DOM
|
38067
37036
|
@return {Object} jQuery object representing the results of the query
|
38068
37037
|
@throws {Error} throws error if jQuery object returned has a length of 0
|
38069
|
-
@
|
37038
|
+
@public
|
38070
37039
|
*/
|
38071
37040
|
helper('findWithAssert', findWithAssert);
|
38072
37041
|
|
@@ -38863,16 +37832,24 @@ enifed('ember-views', ['exports', 'ember-runtime', 'ember-views/system/jquery',
|
|
38863
37832
|
ViewUtils.getViewClientRects = _emberViewsSystemUtils.getViewClientRects;
|
38864
37833
|
ViewUtils.getViewBoundingClientRect = _emberViewsSystemUtils.getViewBoundingClientRect;
|
38865
37834
|
|
38866
|
-
_emberRuntime.default.
|
38867
|
-
|
38868
|
-
|
38869
|
-
|
38870
|
-
|
37835
|
+
if (_emberRuntime.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
37836
|
+
_emberRuntime.default.CoreView = _emberViewsViewsCore_view.DeprecatedCoreView;
|
37837
|
+
_emberRuntime.default.View = _emberViewsViewsView.DeprecatedView;
|
37838
|
+
_emberRuntime.default.View.states = _emberViewsViewsStates.states;
|
37839
|
+
_emberRuntime.default.View.cloneStates = _emberViewsViewsStates.cloneStates;
|
37840
|
+
_emberRuntime.default.View._Renderer = _emberMetalViewsRenderer.default;
|
37841
|
+
}
|
37842
|
+
|
37843
|
+
_emberRuntime.default._Renderer = _emberMetalViewsRenderer.default;
|
37844
|
+
|
38871
37845
|
_emberRuntime.default.Checkbox = _emberViewsViewsCheckbox.default;
|
38872
37846
|
_emberRuntime.default.TextField = _emberViewsViewsText_field.default;
|
38873
37847
|
_emberRuntime.default.TextArea = _emberViewsViewsText_area.default;
|
38874
37848
|
|
38875
|
-
_emberRuntime.default.
|
37849
|
+
if (_emberRuntime.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
37850
|
+
_emberRuntime.default.Select = _emberViewsViewsSelect.DeprecatedSelect;
|
37851
|
+
}
|
37852
|
+
|
38876
37853
|
_emberRuntime.default.SelectOption = _emberViewsViewsSelect.SelectOption;
|
38877
37854
|
_emberRuntime.default.SelectOptgroup = _emberViewsViewsSelect.SelectOptgroup;
|
38878
37855
|
|
@@ -38884,9 +37861,11 @@ enifed('ember-views', ['exports', 'ember-runtime', 'ember-views/system/jquery',
|
|
38884
37861
|
_emberRuntime.default.EventDispatcher = _emberViewsSystemEvent_dispatcher.default;
|
38885
37862
|
|
38886
37863
|
// Deprecated:
|
38887
|
-
_emberRuntime.default.
|
38888
|
-
|
38889
|
-
|
37864
|
+
if (_emberRuntime.default.ENV._ENABLE_LEGACY_VIEW_SUPPORT) {
|
37865
|
+
_emberRuntime.default._Metamorph = _emberViewsCompatMetamorph_view._Metamorph;
|
37866
|
+
_emberRuntime.default._MetamorphView = _emberViewsCompatMetamorph_view.default;
|
37867
|
+
_emberRuntime.default._LegacyEachView = _emberViewsViewsLegacy_each_view.default;
|
37868
|
+
}
|
38890
37869
|
|
38891
37870
|
// END EXPORTS
|
38892
37871
|
|
@@ -39797,7 +38776,7 @@ enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal/core',
|
|
39797
38776
|
```javascript
|
39798
38777
|
// Applies the 'high' class to the view element
|
39799
38778
|
Ember.View.extend({
|
39800
|
-
classNameBindings: ['priority']
|
38779
|
+
classNameBindings: ['priority'],
|
39801
38780
|
priority: 'high'
|
39802
38781
|
});
|
39803
38782
|
```
|
@@ -39806,7 +38785,7 @@ enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal/core',
|
|
39806
38785
|
```javascript
|
39807
38786
|
// Applies the 'is-urgent' class to the view element
|
39808
38787
|
Ember.View.extend({
|
39809
|
-
classNameBindings: ['isUrgent']
|
38788
|
+
classNameBindings: ['isUrgent'],
|
39810
38789
|
isUrgent: true
|
39811
38790
|
});
|
39812
38791
|
```
|
@@ -39815,7 +38794,7 @@ enifed('ember-views/mixins/class_names_support', ['exports', 'ember-metal/core',
|
|
39815
38794
|
```javascript
|
39816
38795
|
// Applies the 'urgent' class to the view element
|
39817
38796
|
Ember.View.extend({
|
39818
|
-
classNameBindings: ['isUrgent:urgent']
|
38797
|
+
classNameBindings: ['isUrgent:urgent'],
|
39819
38798
|
isUrgent: true
|
39820
38799
|
});
|
39821
38800
|
```
|
@@ -41041,7 +40020,7 @@ enifed('ember-views/streams/should_display', ['exports', 'ember-metal/core', 'em
|
|
41041
40020
|
return predicate;
|
41042
40021
|
}
|
41043
40022
|
|
41044
|
-
if (type && type === 'object') {
|
40023
|
+
if (type && type === 'object' && predicate !== null) {
|
41045
40024
|
var isTruthy = _emberMetalProperty_get.get(predicate, 'isTruthy');
|
41046
40025
|
if (typeof isTruthy === 'boolean') {
|
41047
40026
|
return isTruthy;
|
@@ -41100,7 +40079,7 @@ enifed('ember-views/streams/should_display', ['exports', 'ember-metal/core', 'em
|
|
41100
40079
|
}
|
41101
40080
|
});
|
41102
40081
|
});
|
41103
|
-
enifed('ember-views/streams/utils', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-
|
40082
|
+
enifed('ember-views/streams/utils', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-runtime/system/string', 'ember-metal/streams/utils', 'ember-runtime/mixins/controller'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberRuntimeSystemString, _emberMetalStreamsUtils, _emberRuntimeMixinsController) {
|
41104
40083
|
exports.readViewFactory = readViewFactory;
|
41105
40084
|
exports.readComponentFactory = readComponentFactory;
|
41106
40085
|
exports.readUnwrappedModel = readUnwrappedModel;
|
@@ -41110,13 +40089,8 @@ enifed('ember-views/streams/utils', ['exports', 'ember-metal/core', 'ember-metal
|
|
41110
40089
|
var viewClass;
|
41111
40090
|
|
41112
40091
|
if (typeof value === 'string') {
|
41113
|
-
|
41114
|
-
|
41115
|
-
_emberMetalCore.default.deprecate('Resolved the view "' + value + '" on the global context. Pass a view name to be looked up on the container instead, such as {{view "select"}}.', !viewClass, { url: 'http://emberjs.com/guides/deprecations/#toc_global-lookup-of-views' });
|
41116
|
-
} else {
|
41117
|
-
_emberMetalCore.default.assert('View requires a container to resolve views not passed in through the context', !!container);
|
41118
|
-
viewClass = container.lookupFactory('view:' + value);
|
41119
|
-
}
|
40092
|
+
_emberMetalCore.default.assert('View requires a container to resolve views not passed in through the context', !!container);
|
40093
|
+
viewClass = container.lookupFactory('view:' + value);
|
41120
40094
|
} else {
|
41121
40095
|
viewClass = value;
|
41122
40096
|
}
|
@@ -42524,14 +41498,14 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-vie
|
|
42524
41498
|
}),
|
42525
41499
|
|
42526
41500
|
/**
|
42527
|
-
|
42528
|
-
this controller has registered for notifications of the action.
|
41501
|
+
Calls a action passed to a component.
|
42529
41502
|
For example a component for playing or pausing music may translate click events
|
42530
41503
|
into action notifications of "play" or "stop" depending on some internal state
|
42531
41504
|
of the component:
|
42532
|
-
|
42533
|
-
|
42534
|
-
|
41505
|
+
```javascript
|
41506
|
+
// app/components/play-button.js
|
41507
|
+
export default Ember.Component.extend({
|
41508
|
+
click() {
|
42535
41509
|
if (this.get('isPlaying')) {
|
42536
41510
|
this.sendAction('play');
|
42537
41511
|
} else {
|
@@ -42540,55 +41514,56 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-vie
|
|
42540
41514
|
}
|
42541
41515
|
});
|
42542
41516
|
```
|
42543
|
-
|
42544
|
-
trigger actions in the outer application context:
|
41517
|
+
The actions "play" and "stop" must be passed to this `play-button` component:
|
42545
41518
|
```handlebars
|
42546
|
-
{{! application.hbs }}
|
42547
|
-
{{play-button play="musicStarted" stop="musicStopped"}}
|
41519
|
+
{{! app/templates/application.hbs }}
|
41520
|
+
{{play-button play=(action "musicStarted") stop=(action "musicStopped")}}
|
42548
41521
|
```
|
42549
41522
|
When the component receives a browser `click` event it translate this
|
42550
41523
|
interaction into application-specific semantics ("play" or "stop") and
|
42551
|
-
|
42552
|
-
|
42553
|
-
|
42554
|
-
|
41524
|
+
calls the specified action.
|
41525
|
+
```javascript
|
41526
|
+
// app/controller/application.js
|
41527
|
+
export default Ember.Controller.extend({
|
42555
41528
|
actions: {
|
42556
|
-
musicStarted
|
41529
|
+
musicStarted() {
|
42557
41530
|
// called when the play button is clicked
|
42558
41531
|
// and the music started playing
|
42559
41532
|
},
|
42560
|
-
musicStopped
|
41533
|
+
musicStopped() {
|
42561
41534
|
// called when the play button is clicked
|
42562
41535
|
// and the music stopped playing
|
42563
41536
|
}
|
42564
41537
|
}
|
42565
41538
|
});
|
42566
41539
|
```
|
42567
|
-
If no action
|
41540
|
+
If no action is passed to `sendAction` a default name of "action"
|
42568
41541
|
is assumed.
|
42569
41542
|
```javascript
|
42570
|
-
|
42571
|
-
|
41543
|
+
// app/components/next-button.js
|
41544
|
+
export default Ember.Component.extend({
|
41545
|
+
click() {
|
42572
41546
|
this.sendAction();
|
42573
41547
|
}
|
42574
41548
|
});
|
42575
41549
|
```
|
42576
41550
|
```handlebars
|
42577
|
-
{{! application.hbs }}
|
42578
|
-
{{next-button action="playNextSongInAlbum"}}
|
41551
|
+
{{! app/templates/application.hbs }}
|
41552
|
+
{{next-button action=(action "playNextSongInAlbum")}}
|
42579
41553
|
```
|
42580
41554
|
```javascript
|
41555
|
+
// app/controllers/application.js
|
42581
41556
|
App.ApplicationController = Ember.Controller.extend({
|
42582
41557
|
actions: {
|
42583
|
-
playNextSongInAlbum
|
41558
|
+
playNextSongInAlbum() {
|
42584
41559
|
...
|
42585
41560
|
}
|
42586
41561
|
}
|
42587
41562
|
});
|
42588
41563
|
```
|
42589
41564
|
@method sendAction
|
42590
|
-
@param [action] {String} the action to
|
42591
|
-
@param [
|
41565
|
+
@param [action] {String} the action to call
|
41566
|
+
@param [params] {*} arguments for the action
|
42592
41567
|
@public
|
42593
41568
|
*/
|
42594
41569
|
sendAction: function (action) {
|
@@ -42714,7 +41689,7 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-vie
|
|
42714
41689
|
});
|
42715
41690
|
// Ember.assert, Ember.Handlebars
|
42716
41691
|
enifed('ember-views/views/container_view', ['exports', 'ember-metal/core', 'ember-runtime/mixins/mutable_array', 'ember-views/views/view', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/events', 'ember-htmlbars/templates/container-view'], function (exports, _emberMetalCore, _emberRuntimeMixinsMutable_array, _emberViewsViewsView, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalEvents, _emberHtmlbarsTemplatesContainerView) {
|
42717
|
-
_emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.0.0-beta.
|
41692
|
+
_emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.0.0-beta.3';
|
42718
41693
|
|
42719
41694
|
/**
|
42720
41695
|
@module ember
|
@@ -43160,39 +42135,16 @@ enifed('ember-views/views/core_view', ['exports', 'ember-metal/core', 'ember-met
|
|
43160
42135
|
|
43161
42136
|
exports.default = CoreView;
|
43162
42137
|
});
|
43163
|
-
enifed('ember-views/views/legacy_each_view', ['exports', 'ember-htmlbars/templates/legacy-each', 'ember-metal/property_get', 'ember-metal/
|
42138
|
+
enifed('ember-views/views/legacy_each_view', ['exports', 'ember-htmlbars/templates/legacy-each', 'ember-metal/property_get', 'ember-metal/computed', 'ember-views/views/view', 'ember-views/views/collection_view', 'ember-views/mixins/empty_view_support'], function (exports, _emberHtmlbarsTemplatesLegacyEach, _emberMetalProperty_get, _emberMetalComputed, _emberViewsViewsView, _emberViewsViewsCollection_view, _emberViewsMixinsEmpty_view_support) {
|
43164
42139
|
exports.default = _emberViewsViewsView.default.extend(_emberViewsMixinsEmpty_view_support.default, {
|
43165
42140
|
template: _emberHtmlbarsTemplatesLegacyEach.default,
|
43166
42141
|
tagName: '',
|
43167
42142
|
|
43168
|
-
|
43169
|
-
|
43170
|
-
|
43171
|
-
_isVirtual: true,
|
43172
|
-
parentController: _emberMetalProperty_get.get(this, 'controller'),
|
43173
|
-
itemController: itemController,
|
43174
|
-
target: _emberMetalProperty_get.get(this, 'controller'),
|
43175
|
-
_eachView: this,
|
43176
|
-
content: this.getAttr('content')
|
43177
|
-
});
|
43178
|
-
|
43179
|
-
return controller;
|
43180
|
-
}),
|
43181
|
-
|
43182
|
-
_willUpdate: function (attrs) {
|
43183
|
-
var itemController = this.getAttrFor(attrs, 'itemController');
|
43184
|
-
|
43185
|
-
if (itemController) {
|
43186
|
-
var arrayController = _emberMetalProperty_get.get(this, '_arrayController');
|
43187
|
-
_emberMetalProperty_set.set(arrayController, 'content', this.getAttrFor(attrs, 'content'));
|
43188
|
-
}
|
43189
|
-
},
|
42143
|
+
/*
|
42144
|
+
Support for ArrayController has been extracted to the ember-legacy-controllers addon.
|
42145
|
+
*/
|
43190
42146
|
|
43191
42147
|
_arrangedContent: _emberMetalComputed.computed('attrs.content', function () {
|
43192
|
-
if (this.getAttr('itemController')) {
|
43193
|
-
return _emberMetalProperty_get.get(this, '_arrayController');
|
43194
|
-
}
|
43195
|
-
|
43196
42148
|
return this.getAttr('content');
|
43197
42149
|
}),
|
43198
42150
|
|