ember-source 2.1.0.beta.3 → 2.1.0
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-runtime.js +22451 -0
- data/dist/ember-template-compiler.js +326 -179
- data/dist/ember-testing.js +83 -7
- data/dist/ember.debug.js +833 -558
- data/dist/ember.js +833 -558
- data/dist/ember.min.js +14 -14
- data/dist/ember.prod.js +730 -549
- metadata +5 -4
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.1.0
|
8
|
+
* @version 2.1.0
|
9
9
|
*/
|
10
10
|
|
11
11
|
(function() {
|
@@ -129,13 +129,23 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
129
129
|
this.instanceStack = [];
|
130
130
|
this._debouncees = [];
|
131
131
|
this._throttlers = [];
|
132
|
-
this._timers = [];
|
133
132
|
this._eventCallbacks = {
|
134
133
|
end: [],
|
135
134
|
begin: []
|
136
135
|
};
|
136
|
+
|
137
|
+
this._timerTimeoutId = undefined;
|
138
|
+
this._timers = [];
|
139
|
+
|
140
|
+
var _this = this;
|
141
|
+
this._boundRunExpiredTimers = function () {
|
142
|
+
_this._runExpiredTimers();
|
143
|
+
};
|
137
144
|
}
|
138
145
|
|
146
|
+
// ms of delay before we conclude a timeout was lost
|
147
|
+
var TIMEOUT_STALLED_THRESHOLD = 1000;
|
148
|
+
|
139
149
|
Backburner.prototype = {
|
140
150
|
begin: function () {
|
141
151
|
var options = this.options;
|
@@ -291,39 +301,60 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
291
301
|
}
|
292
302
|
},
|
293
303
|
|
304
|
+
/*
|
305
|
+
Join the passed method with an existing queue and execute immediately,
|
306
|
+
if there isn't one use `Backburner#run`.
|
307
|
+
The join method is like the run method except that it will schedule into
|
308
|
+
an existing queue if one already exists. In either case, the join method will
|
309
|
+
immediately execute the passed in function and return its result.
|
310
|
+
@method join
|
311
|
+
@param {Object} target
|
312
|
+
@param {Function} method The method to be executed
|
313
|
+
@param {any} args The method arguments
|
314
|
+
@return method result
|
315
|
+
*/
|
294
316
|
join: function () /* target, method, args */{
|
295
|
-
if (this.currentInstance) {
|
296
|
-
|
297
|
-
|
317
|
+
if (!this.currentInstance) {
|
318
|
+
return this.run.apply(this, arguments);
|
319
|
+
}
|
298
320
|
|
299
|
-
|
300
|
-
|
301
|
-
target = null;
|
302
|
-
} else {
|
303
|
-
target = arguments[0];
|
304
|
-
method = arguments[1];
|
305
|
-
}
|
321
|
+
var length = arguments.length;
|
322
|
+
var method, target;
|
306
323
|
|
307
|
-
|
308
|
-
|
309
|
-
|
324
|
+
if (length === 1) {
|
325
|
+
method = arguments[0];
|
326
|
+
target = null;
|
327
|
+
} else {
|
328
|
+
target = arguments[0];
|
329
|
+
method = arguments[1];
|
330
|
+
}
|
310
331
|
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
}
|
320
|
-
return method.apply(target, args);
|
321
|
-
}
|
332
|
+
if (_backburnerUtils.isString(method)) {
|
333
|
+
method = target[method];
|
334
|
+
}
|
335
|
+
|
336
|
+
if (length === 1) {
|
337
|
+
return method();
|
338
|
+
} else if (length === 2) {
|
339
|
+
return method.call(target);
|
322
340
|
} else {
|
323
|
-
|
341
|
+
var args = new Array(length - 2);
|
342
|
+
for (var i = 0, l = length - 2; i < l; i++) {
|
343
|
+
args[i] = arguments[i + 2];
|
344
|
+
}
|
345
|
+
return method.apply(target, args);
|
324
346
|
}
|
325
347
|
},
|
326
348
|
|
349
|
+
/*
|
350
|
+
Defer the passed function to run inside the specified queue.
|
351
|
+
@method defer
|
352
|
+
@param {String} queueName
|
353
|
+
@param {Object} target
|
354
|
+
@param {Function|String} method The method or method name to be executed
|
355
|
+
@param {any} args The method arguments
|
356
|
+
@return method result
|
357
|
+
*/
|
327
358
|
defer: function (queueName /* , target, method, args */) {
|
328
359
|
var length = arguments.length;
|
329
360
|
var method, target, args;
|
@@ -466,12 +497,27 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
466
497
|
}
|
467
498
|
}
|
468
499
|
|
500
|
+
return this._setTimeout(fn, executeAt);
|
501
|
+
},
|
502
|
+
|
503
|
+
_setTimeout: function (fn, executeAt) {
|
504
|
+
if (this._timers.length === 0) {
|
505
|
+
this._timers.push(executeAt, fn);
|
506
|
+
this._installTimerTimeout();
|
507
|
+
return fn;
|
508
|
+
}
|
509
|
+
|
510
|
+
this._reinstallStalledTimerTimeout();
|
511
|
+
|
469
512
|
// find position to insert
|
470
513
|
var i = _backburnerBinarySearch.default(executeAt, this._timers);
|
471
514
|
|
472
515
|
this._timers.splice(i, 0, executeAt, fn);
|
473
516
|
|
474
|
-
|
517
|
+
// we should be the new earliest timer if i == 0
|
518
|
+
if (i === 0) {
|
519
|
+
this._reinstallTimerTimeout();
|
520
|
+
}
|
475
521
|
|
476
522
|
return fn;
|
477
523
|
},
|
@@ -569,20 +615,13 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
569
615
|
},
|
570
616
|
|
571
617
|
cancelTimers: function () {
|
572
|
-
var clearItems = function (item) {
|
573
|
-
clearTimeout(item[2]);
|
574
|
-
};
|
575
|
-
|
576
618
|
_backburnerUtils.each(this._throttlers, clearItems);
|
577
619
|
this._throttlers = [];
|
578
620
|
|
579
621
|
_backburnerUtils.each(this._debouncees, clearItems);
|
580
622
|
this._debouncees = [];
|
581
623
|
|
582
|
-
|
583
|
-
clearTimeout(this._laterTimer);
|
584
|
-
this._laterTimer = null;
|
585
|
-
}
|
624
|
+
this._clearTimerTimeout();
|
586
625
|
this._timers = [];
|
587
626
|
|
588
627
|
if (this._autorun) {
|
@@ -607,15 +646,7 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
607
646
|
if (this._timers[i + 1] === timer) {
|
608
647
|
this._timers.splice(i, 2); // remove the two elements
|
609
648
|
if (i === 0) {
|
610
|
-
|
611
|
-
// Active timer? Then clear timer and reset for future timer
|
612
|
-
clearTimeout(this._laterTimer);
|
613
|
-
this._laterTimer = null;
|
614
|
-
}
|
615
|
-
if (this._timers.length > 0) {
|
616
|
-
// Update to next available timer when available
|
617
|
-
updateLaterTimer(this, this._timers[0], this._timers[0] - _backburnerUtils.now());
|
618
|
-
}
|
649
|
+
this._reinstallTimerTimeout();
|
619
650
|
}
|
620
651
|
return true;
|
621
652
|
}
|
@@ -649,6 +680,67 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
649
680
|
}
|
650
681
|
|
651
682
|
return false;
|
683
|
+
},
|
684
|
+
|
685
|
+
_runExpiredTimers: function () {
|
686
|
+
this._timerTimeoutId = undefined;
|
687
|
+
this.run(this, this._scheduleExpiredTimers);
|
688
|
+
},
|
689
|
+
|
690
|
+
_scheduleExpiredTimers: function () {
|
691
|
+
var n = _backburnerUtils.now();
|
692
|
+
var timers = this._timers;
|
693
|
+
var i = 0;
|
694
|
+
var l = timers.length;
|
695
|
+
for (; i < l; i += 2) {
|
696
|
+
var executeAt = timers[i];
|
697
|
+
var fn = timers[i + 1];
|
698
|
+
if (executeAt <= n) {
|
699
|
+
this.schedule(this.options.defaultQueue, null, fn);
|
700
|
+
} else {
|
701
|
+
break;
|
702
|
+
}
|
703
|
+
}
|
704
|
+
timers.splice(0, i);
|
705
|
+
this._installTimerTimeout();
|
706
|
+
},
|
707
|
+
|
708
|
+
_reinstallStalledTimerTimeout: function () {
|
709
|
+
if (!this._timerTimeoutId) {
|
710
|
+
return;
|
711
|
+
}
|
712
|
+
// if we have a timer we should always have a this._timerTimeoutId
|
713
|
+
var minExpiresAt = this._timers[0];
|
714
|
+
var delay = _backburnerUtils.now() - minExpiresAt;
|
715
|
+
// threshold of a second before we assume that the currently
|
716
|
+
// installed timeout will not run, so we don't constantly reinstall
|
717
|
+
// timeouts that are delayed but good still
|
718
|
+
if (delay < TIMEOUT_STALLED_THRESHOLD) {
|
719
|
+
return;
|
720
|
+
}
|
721
|
+
},
|
722
|
+
|
723
|
+
_reinstallTimerTimeout: function () {
|
724
|
+
this._clearTimerTimeout();
|
725
|
+
this._installTimerTimeout();
|
726
|
+
},
|
727
|
+
|
728
|
+
_clearTimerTimeout: function () {
|
729
|
+
if (!this._timerTimeoutId) {
|
730
|
+
return;
|
731
|
+
}
|
732
|
+
clearTimeout(this._timerTimeoutId);
|
733
|
+
this._timerTimeoutId = undefined;
|
734
|
+
},
|
735
|
+
|
736
|
+
_installTimerTimeout: function () {
|
737
|
+
if (!this._timers.length) {
|
738
|
+
return;
|
739
|
+
}
|
740
|
+
var minExpiresAt = this._timers[0];
|
741
|
+
var n = _backburnerUtils.now();
|
742
|
+
var wait = Math.max(0, minExpiresAt - n);
|
743
|
+
this._timerTimeoutId = setTimeout(this._boundRunExpiredTimers, wait);
|
652
744
|
}
|
653
745
|
};
|
654
746
|
|
@@ -676,52 +768,6 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
676
768
|
});
|
677
769
|
}
|
678
770
|
|
679
|
-
function updateLaterTimer(backburner, executeAt, wait) {
|
680
|
-
var n = _backburnerUtils.now();
|
681
|
-
if (!backburner._laterTimer || executeAt < backburner._laterTimerExpiresAt || backburner._laterTimerExpiresAt < n) {
|
682
|
-
|
683
|
-
if (backburner._laterTimer) {
|
684
|
-
// Clear when:
|
685
|
-
// - Already expired
|
686
|
-
// - New timer is earlier
|
687
|
-
clearTimeout(backburner._laterTimer);
|
688
|
-
|
689
|
-
if (backburner._laterTimerExpiresAt < n) {
|
690
|
-
// If timer was never triggered
|
691
|
-
// Calculate the left-over wait-time
|
692
|
-
wait = Math.max(0, executeAt - n);
|
693
|
-
}
|
694
|
-
}
|
695
|
-
|
696
|
-
backburner._laterTimer = _backburnerPlatform.default.setTimeout(function () {
|
697
|
-
backburner._laterTimer = null;
|
698
|
-
backburner._laterTimerExpiresAt = null;
|
699
|
-
executeTimers(backburner);
|
700
|
-
}, wait);
|
701
|
-
|
702
|
-
backburner._laterTimerExpiresAt = n + wait;
|
703
|
-
}
|
704
|
-
}
|
705
|
-
|
706
|
-
function executeTimers(backburner) {
|
707
|
-
var n = _backburnerUtils.now();
|
708
|
-
var fns, i, l;
|
709
|
-
|
710
|
-
backburner.run(function () {
|
711
|
-
i = _backburnerBinarySearch.default(n, backburner._timers);
|
712
|
-
|
713
|
-
fns = backburner._timers.splice(0, i);
|
714
|
-
|
715
|
-
for (i = 1, l = fns.length; i < l; i += 2) {
|
716
|
-
backburner.schedule(backburner.options.defaultQueue, null, fns[i]);
|
717
|
-
}
|
718
|
-
});
|
719
|
-
|
720
|
-
if (backburner._timers.length) {
|
721
|
-
updateLaterTimer(backburner, backburner._timers[0], backburner._timers[0] - n);
|
722
|
-
}
|
723
|
-
}
|
724
|
-
|
725
771
|
function findDebouncee(target, method, debouncees) {
|
726
772
|
return findItem(target, method, debouncees);
|
727
773
|
}
|
@@ -744,6 +790,10 @@ enifed('backburner', ['exports', './backburner/utils', './backburner/platform',
|
|
744
790
|
|
745
791
|
return index;
|
746
792
|
}
|
793
|
+
|
794
|
+
function clearItems(item) {
|
795
|
+
clearTimeout(item[2]);
|
796
|
+
}
|
747
797
|
});
|
748
798
|
enifed("backburner/binary-search", ["exports"], function (exports) {
|
749
799
|
"use strict";
|
@@ -821,10 +871,9 @@ enifed('backburner/deferred-action-queues', ['exports', './utils', './queue'], f
|
|
821
871
|
flush: function () {
|
822
872
|
var queues = this.queues;
|
823
873
|
var queueNames = this.queueNames;
|
824
|
-
var queueName, queue
|
874
|
+
var queueName, queue;
|
825
875
|
var queueNameIndex = 0;
|
826
876
|
var numberOfQueues = queueNames.length;
|
827
|
-
var options = this.options;
|
828
877
|
|
829
878
|
while (queueNameIndex < numberOfQueues) {
|
830
879
|
queueName = queueNames[queueNameIndex];
|
@@ -948,11 +997,6 @@ enifed('backburner/queue', ['exports', './utils'], function (exports, _utils) {
|
|
948
997
|
},
|
949
998
|
|
950
999
|
pushUnique: function (target, method, args, stack) {
|
951
|
-
var queue = this._queue,
|
952
|
-
currentTarget,
|
953
|
-
currentMethod,
|
954
|
-
i,
|
955
|
-
l;
|
956
1000
|
var KEY = this.globalOptions.GUID_KEY;
|
957
1001
|
|
958
1002
|
if (target && KEY) {
|
@@ -3405,7 +3449,6 @@ enifed('ember-application/system/application-instance', ['exports', 'ember-metal
|
|
3405
3449
|
/**
|
3406
3450
|
@module ember
|
3407
3451
|
@submodule ember-application
|
3408
|
-
@private
|
3409
3452
|
*/
|
3410
3453
|
|
3411
3454
|
'use strict';
|
@@ -3431,6 +3474,10 @@ enifed('ember-application/system/application-instance', ['exports', 'ember-metal
|
|
3431
3474
|
it once the particular test run or FastBoot request has finished.
|
3432
3475
|
|
3433
3476
|
@public
|
3477
|
+
@class Ember.ApplicationInstance
|
3478
|
+
@extends Ember.Object
|
3479
|
+
@uses RegistryProxyMixin
|
3480
|
+
@uses ContainerProxyMixin
|
3434
3481
|
*/
|
3435
3482
|
|
3436
3483
|
var ApplicationInstance = _emberRuntimeSystemObject.default.extend(_emberRuntimeMixinsRegistry_proxy.default, _emberRuntimeMixinsContainer_proxy.default, {
|
@@ -3602,7 +3649,12 @@ enifed('ember-application/system/application-instance', ['exports', 'ember-metal
|
|
3602
3649
|
var instance = this;
|
3603
3650
|
return {
|
3604
3651
|
lookup: function () {
|
3605
|
-
_emberMetal.default.deprecate('Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead.', false, {
|
3652
|
+
_emberMetal.default.deprecate('Using `ApplicationInstance.container.lookup` is deprecated. Please use `ApplicationInstance.lookup` instead.', false, {
|
3653
|
+
id: 'ember-application.app-instance-container',
|
3654
|
+
until: '3.0.0',
|
3655
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-applicationinstance-container'
|
3656
|
+
});
|
3657
|
+
|
3606
3658
|
return instance.lookup.apply(instance, arguments);
|
3607
3659
|
}
|
3608
3660
|
};
|
@@ -3758,7 +3810,7 @@ enifed('ember-application/system/application', ['exports', 'dag-map', 'container
|
|
3758
3810
|
});
|
3759
3811
|
```
|
3760
3812
|
|
3761
|
-
Initializers provide an opportunity to access the
|
3813
|
+
Initializers provide an opportunity to access the internal registry, which
|
3762
3814
|
organizes the different components of an Ember application. Additionally
|
3763
3815
|
they provide a chance to access the instantiated application. Beyond
|
3764
3816
|
being used for libraries, initializers are also a great way to organize
|
@@ -3791,6 +3843,7 @@ enifed('ember-application/system/application', ['exports', 'dag-map', 'container
|
|
3791
3843
|
@class Application
|
3792
3844
|
@namespace Ember
|
3793
3845
|
@extends Ember.Namespace
|
3846
|
+
@uses RegistryProxyMixin
|
3794
3847
|
@public
|
3795
3848
|
*/
|
3796
3849
|
|
@@ -4133,7 +4186,11 @@ enifed('ember-application/system/application', ['exports', 'dag-map', 'container
|
|
4133
4186
|
this._runInitializer('initializers', function (name, initializer) {
|
4134
4187
|
_emberMetal.default.assert('No application initializer named \'' + name + '\'', !!initializer);
|
4135
4188
|
if (initializer.initialize.length === 2) {
|
4136
|
-
_emberMetal.default.deprecate('The `initialize` method for Application initializer \'' + name + '\' should take only one argument - `App`, an instance of an `Application`.', false, {
|
4189
|
+
_emberMetal.default.deprecate('The `initialize` method for Application initializer \'' + name + '\' should take only one argument - `App`, an instance of an `Application`.', false, {
|
4190
|
+
id: 'ember-application.app-initializer-initialize-arguments',
|
4191
|
+
until: '3.0.0',
|
4192
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_initializer-arity'
|
4193
|
+
});
|
4137
4194
|
|
4138
4195
|
initializer.initialize(App.__registry__, App);
|
4139
4196
|
} else {
|
@@ -5322,10 +5379,66 @@ enifed('ember-debug', ['exports', 'ember-metal/core', 'ember-metal/assert', 'emb
|
|
5322
5379
|
}, false);
|
5323
5380
|
}
|
5324
5381
|
}
|
5325
|
-
|
5382
|
+
/**
|
5383
|
+
@public
|
5384
|
+
@class Ember.Debug
|
5385
|
+
*/
|
5326
5386
|
_emberMetalCore.default.Debug = {};
|
5327
5387
|
|
5388
|
+
/**
|
5389
|
+
Allows for runtime registration of handler functions that override the default deprecation behavior.
|
5390
|
+
Deprecations are invoked by calls to [Ember.deprecate](http://emberjs.com/api/classes/Ember.html#method_deprecate).
|
5391
|
+
The following example demonstrates its usage by registering a handler that throws an error if the
|
5392
|
+
message contains the word "should", otherwise defers to the default handler.
|
5393
|
+
```javascript
|
5394
|
+
Ember.Debug.registerDeprecationHandler((message, options, next) => {
|
5395
|
+
if (message.indexOf('should') !== -1) {
|
5396
|
+
throw new Error(`Deprecation message with should: ${message}`);
|
5397
|
+
} else {
|
5398
|
+
// defer to whatever handler was registered before this one
|
5399
|
+
next(message, options);
|
5400
|
+
}
|
5401
|
+
}
|
5402
|
+
```
|
5403
|
+
The handler function takes the following arguments:
|
5404
|
+
<ul>
|
5405
|
+
<li> <code>message</code> - The message received from the deprecation call. </li>
|
5406
|
+
<li> <code>options</code> - An object passed in with the deprecation call containing additional information including:</li>
|
5407
|
+
<ul>
|
5408
|
+
<li> <code>id</code> - an id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li>
|
5409
|
+
<li> <code>until</code> - is the version number Ember the feature and deprecation will be removed in.</li>
|
5410
|
+
</ul>
|
5411
|
+
<li> <code>next</code> - a function that calls into the previously registered handler.</li>
|
5412
|
+
</ul>
|
5413
|
+
@public
|
5414
|
+
@static
|
5415
|
+
@method registerDeprecationHandler
|
5416
|
+
@param handler {Function} a function to handle deprecation calls
|
5417
|
+
*/
|
5328
5418
|
_emberMetalCore.default.Debug.registerDeprecationHandler = _emberDebugDeprecate.registerHandler;
|
5419
|
+
/**
|
5420
|
+
Allows for runtime registration of handler functions that override the default warning behavior.
|
5421
|
+
Warnings are invoked by calls made to [Ember.warn](http://emberjs.com/api/classes/Ember.html#method_warn).
|
5422
|
+
The following example demonstrates its usage by registering a handler that does nothing overriding Ember's
|
5423
|
+
default warning behavior.
|
5424
|
+
```javascript
|
5425
|
+
// next is not called, so no warnings get the default behavior
|
5426
|
+
Ember.Debug.registerWarnHandler(() => {});
|
5427
|
+
```
|
5428
|
+
The handler function takes the following arguments:
|
5429
|
+
<ul>
|
5430
|
+
<li> <code>message</code> - The message received from the warn call. </li>
|
5431
|
+
<li> <code>options</code> - An object passed in with the warn call containing additional information including:</li>
|
5432
|
+
<ul>
|
5433
|
+
<li> <code>id</code> - an id of the warning in the form of <code>package-name.specific-warning</code>.</li>
|
5434
|
+
</ul>
|
5435
|
+
<li> <code>next</code> - a function that calls into the previously registered handler.</li>
|
5436
|
+
</ul>
|
5437
|
+
@public
|
5438
|
+
@static
|
5439
|
+
@method registerWarnHandler
|
5440
|
+
@param handler {Function} a function to handle warnings
|
5441
|
+
*/
|
5329
5442
|
_emberMetalCore.default.Debug.registerWarnHandler = _emberDebugWarn.registerHandler;
|
5330
5443
|
|
5331
5444
|
/*
|
@@ -5446,15 +5559,27 @@ enifed('ember-debug/deprecate', ['exports', 'ember-metal/core', 'ember-metal/err
|
|
5446
5559
|
|
5447
5560
|
function deprecate(message, test, options) {
|
5448
5561
|
if (!options || !options.id && !options.until) {
|
5449
|
-
deprecate(missingOptionsDeprecation, false, {
|
5562
|
+
deprecate(missingOptionsDeprecation, false, {
|
5563
|
+
id: 'ember-debug.deprecate-options-missing',
|
5564
|
+
until: '3.0.0',
|
5565
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
5566
|
+
});
|
5450
5567
|
}
|
5451
5568
|
|
5452
5569
|
if (options && !options.id) {
|
5453
|
-
deprecate(missingOptionsIdDeprecation, false, {
|
5570
|
+
deprecate(missingOptionsIdDeprecation, false, {
|
5571
|
+
id: 'ember-debug.deprecate-id-missing',
|
5572
|
+
until: '3.0.0',
|
5573
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
5574
|
+
});
|
5454
5575
|
}
|
5455
5576
|
|
5456
5577
|
if (options && !options.until) {
|
5457
|
-
deprecate(missingOptionsUntilDeprecation, options && options.until, {
|
5578
|
+
deprecate(missingOptionsUntilDeprecation, options && options.until, {
|
5579
|
+
id: 'ember-debug.deprecate-until-missing',
|
5580
|
+
until: '3.0.0',
|
5581
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
5582
|
+
});
|
5458
5583
|
}
|
5459
5584
|
|
5460
5585
|
_emberDebugHandlers.invoke.apply(undefined, ['deprecate'].concat(_slice.call(arguments)));
|
@@ -5541,11 +5666,19 @@ enifed('ember-debug/warn', ['exports', 'ember-metal/core', 'ember-metal/logger',
|
|
5541
5666
|
|
5542
5667
|
function warn(message, test, options) {
|
5543
5668
|
if (!options) {
|
5544
|
-
_emberMetalCore.default.deprecate(missingOptionsDeprecation, false, {
|
5669
|
+
_emberMetalCore.default.deprecate(missingOptionsDeprecation, false, {
|
5670
|
+
id: 'ember-debug.warn-options-missing',
|
5671
|
+
until: '3.0.0',
|
5672
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
5673
|
+
});
|
5545
5674
|
}
|
5546
5675
|
|
5547
5676
|
if (options && !options.id) {
|
5548
|
-
_emberMetalCore.default.deprecate(missingOptionsIdDeprecation, false, {
|
5677
|
+
_emberMetalCore.default.deprecate(missingOptionsIdDeprecation, false, {
|
5678
|
+
id: 'ember-debug.warn-id-missing',
|
5679
|
+
until: '3.0.0',
|
5680
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-debug-function-options'
|
5681
|
+
});
|
5549
5682
|
}
|
5550
5683
|
|
5551
5684
|
_emberDebugHandlers.invoke.apply(undefined, ['warn'].concat(_slice.call(arguments)));
|
@@ -5593,7 +5726,7 @@ enifed('ember-extension-support/container_debug_adapter', ['exports', 'ember-met
|
|
5593
5726
|
Application.initializer({
|
5594
5727
|
name: "containerDebugAdapter",
|
5595
5728
|
|
5596
|
-
initialize: function(
|
5729
|
+
initialize: function(application) {
|
5597
5730
|
application.register('container-debug-adapter:main', require('app/container-debug-adapter'));
|
5598
5731
|
}
|
5599
5732
|
});
|
@@ -5712,7 +5845,7 @@ enifed('ember-extension-support/data_adapter', ['exports', 'ember-metal/property
|
|
5712
5845
|
Application.initializer({
|
5713
5846
|
name: "data-adapter",
|
5714
5847
|
|
5715
|
-
initialize: function(
|
5848
|
+
initialize: function(application) {
|
5716
5849
|
application.register('data-adapter:main', DS.DataAdapter);
|
5717
5850
|
}
|
5718
5851
|
});
|
@@ -8369,7 +8502,7 @@ enifed('ember-htmlbars/keywords/each', ['exports'], function (exports) {
|
|
8369
8502
|
return false;
|
8370
8503
|
}
|
8371
8504
|
});
|
8372
|
-
enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-metal/streams/stream', 'ember-metal/streams/
|
8505
|
+
enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-metal/streams/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, _emberMetalStreamsStream, _emberMetalStreamsUtils, _emberMetalMerge, _emberHtmlbarsUtilsSubscribe, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalObserver) {
|
8373
8506
|
/**
|
8374
8507
|
@module ember
|
8375
8508
|
@submodule ember-templates
|
@@ -8460,11 +8593,8 @@ enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-met
|
|
8460
8593
|
|
8461
8594
|
var DynamicKeyStream = function DynamicKeyStream(source, keySource) {
|
8462
8595
|
if (!_emberMetalStreamsUtils.isStream(keySource)) {
|
8463
|
-
return
|
8596
|
+
return source.get(keySource);
|
8464
8597
|
}
|
8465
|
-
_emberMetalCore.default.assert('DynamicKeyStream error: source must be a stream', _emberMetalStreamsUtils.isStream(source)); // TODO: This isn't necessary.
|
8466
|
-
|
8467
|
-
// used to get the original path for debugging and legacy purposes
|
8468
8598
|
var label = labelFor(source, keySource);
|
8469
8599
|
|
8470
8600
|
this.init(label);
|
@@ -8475,13 +8605,12 @@ enifed('ember-htmlbars/keywords/get', ['exports', 'ember-metal/core', 'ember-met
|
|
8475
8605
|
this.observedKey = null;
|
8476
8606
|
};
|
8477
8607
|
|
8478
|
-
DynamicKeyStream.prototype = Object.create(
|
8608
|
+
DynamicKeyStream.prototype = Object.create(_emberMetalStreamsStream.default.prototype);
|
8479
8609
|
|
8480
8610
|
_emberMetalMerge.default(DynamicKeyStream.prototype, {
|
8481
8611
|
key: function () {
|
8482
8612
|
var key = this.keyDep.getValue();
|
8483
8613
|
if (typeof key === 'string') {
|
8484
|
-
_emberMetalCore.default.assert('DynamicKeyStream error: key must not have a \'.\'', key.indexOf('.') === -1);
|
8485
8614
|
return key;
|
8486
8615
|
}
|
8487
8616
|
},
|
@@ -8870,7 +8999,7 @@ enifed('ember-htmlbars/keywords/outlet', ['exports', 'ember-metal/core', 'ember-
|
|
8870
8999
|
|
8871
9000
|
'use strict';
|
8872
9001
|
|
8873
|
-
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.1.0
|
9002
|
+
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.1.0';
|
8874
9003
|
|
8875
9004
|
/**
|
8876
9005
|
The `{{outlet}}` helper lets you specify where a child routes will render in
|
@@ -9927,28 +10056,42 @@ enifed('ember-htmlbars/node-managers/component-node-manager', ['exports', 'ember
|
|
9927
10056
|
// if the component is rendered via {{component}} helper, the first
|
9928
10057
|
// element of `params` is the name of the component, so we need to
|
9929
10058
|
// skip that when the positional parameters are constructed
|
9930
|
-
var paramsStartIndex = renderNode.state.isComponentHelper ? 1 : 0;
|
9931
10059
|
var isNamed = typeof positionalParams === 'string';
|
9932
|
-
var paramsStream = undefined;
|
9933
10060
|
|
9934
10061
|
if (isNamed) {
|
9935
|
-
|
9936
|
-
|
9937
|
-
|
10062
|
+
processRestPositionalParameters(renderNode, positionalParams, params, attrs);
|
10063
|
+
} else {
|
10064
|
+
processNamedPositionalParameters(renderNode, positionalParams, params, attrs);
|
10065
|
+
}
|
10066
|
+
}
|
10067
|
+
|
10068
|
+
function processNamedPositionalParameters(renderNode, positionalParams, params, attrs) {
|
10069
|
+
var paramsStartIndex = renderNode.state.isComponentHelper ? 1 : 0;
|
10070
|
+
|
10071
|
+
for (var i = 0; i < positionalParams.length; i++) {
|
10072
|
+
var param = params[paramsStartIndex + i];
|
9938
10073
|
|
9939
|
-
|
10074
|
+
_emberMetalCore.default.assert('You cannot specify both a positional param (at position ' + i + ') and the hash argument `' + positionalParams[i] + '`.', !(positionalParams[i] in attrs));
|
10075
|
+
|
10076
|
+
attrs[positionalParams[i]] = param;
|
9940
10077
|
}
|
10078
|
+
}
|
9941
10079
|
|
9942
|
-
|
9943
|
-
|
9944
|
-
|
9945
|
-
|
9946
|
-
|
9947
|
-
|
9948
|
-
|
9949
|
-
|
9950
|
-
|
9951
|
-
|
10080
|
+
function processRestPositionalParameters(renderNode, positionalParamsName, params, attrs) {
|
10081
|
+
// If there is already an attribute for that variable, do nothing
|
10082
|
+
_emberMetalCore.default.assert('You cannot specify positional parameters and the hash argument `' + positionalParamsName + '`.', !(positionalParamsName in attrs));
|
10083
|
+
|
10084
|
+
var paramsStartIndex = renderNode.state.isComponentHelper ? 1 : 0;
|
10085
|
+
|
10086
|
+
var paramsStream = new _emberMetalStreamsStream.default(function () {
|
10087
|
+
return _emberMetalStreamsUtils.readArray(params.slice(paramsStartIndex));
|
10088
|
+
}, 'params');
|
10089
|
+
|
10090
|
+
attrs[positionalParamsName] = paramsStream;
|
10091
|
+
|
10092
|
+
for (var i = paramsStartIndex; i < params.length; i++) {
|
10093
|
+
var param = params[i];
|
10094
|
+
paramsStream.addDependency(param);
|
9952
10095
|
}
|
9953
10096
|
}
|
9954
10097
|
|
@@ -14174,36 +14317,35 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14174
14317
|
//
|
14175
14318
|
|
14176
14319
|
/**
|
14177
|
-
A computed property transforms an object's function into a property.
|
14320
|
+
A computed property transforms an object literal with object's accessor function(s) into a property.
|
14178
14321
|
|
14179
14322
|
By default the function backing the computed property will only be called
|
14180
14323
|
once and the result will be cached. You can specify various properties
|
14181
14324
|
that your computed property depends on. This will force the cached
|
14182
14325
|
result to be recomputed if the dependencies are modified.
|
14183
14326
|
|
14184
|
-
In the following example we declare a computed property
|
14185
|
-
`.
|
14186
|
-
dependencies (depending on firstName and lastName). The fullName function
|
14327
|
+
In the following example we declare a computed property - `fullName` - by calling
|
14328
|
+
`.Ember.computed()` with property dependencies (`firstName` and `lastName`) as leading arguments and getter accessor function. The `fullName` getter function
|
14187
14329
|
will be called once (regardless of how many times it is accessed) as long
|
14188
|
-
as its dependencies have not changed. Once firstName or lastName are updated
|
14189
|
-
any future calls (or anything bound) to fullName will incorporate the new
|
14330
|
+
as its dependencies have not changed. Once `firstName` or `lastName` are updated
|
14331
|
+
any future calls (or anything bound) to `fullName` will incorporate the new
|
14190
14332
|
values.
|
14191
14333
|
|
14192
14334
|
```javascript
|
14193
|
-
|
14335
|
+
let Person = Ember.Object.extend({
|
14194
14336
|
// these will be supplied by `create`
|
14195
14337
|
firstName: null,
|
14196
14338
|
lastName: null,
|
14197
14339
|
|
14198
|
-
fullName: function() {
|
14199
|
-
|
14200
|
-
|
14340
|
+
fullName: Ember.computed('firstName', 'lastName', function() {
|
14341
|
+
let firstName = this.get('firstName'),
|
14342
|
+
lastName = this.get('lastName');
|
14201
14343
|
|
14202
|
-
|
14203
|
-
}
|
14344
|
+
return firstName + ' ' + lastName;
|
14345
|
+
})
|
14204
14346
|
});
|
14205
14347
|
|
14206
|
-
|
14348
|
+
let tom = Person.create({
|
14207
14349
|
firstName: 'Tom',
|
14208
14350
|
lastName: 'Dale'
|
14209
14351
|
});
|
@@ -14211,44 +14353,69 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14211
14353
|
tom.get('fullName') // 'Tom Dale'
|
14212
14354
|
```
|
14213
14355
|
|
14214
|
-
You can also define what Ember should do when setting a computed property.
|
14215
|
-
If you try to set a computed property, it will
|
14216
|
-
value you want to set it to
|
14217
|
-
third parameter.
|
14356
|
+
You can also define what Ember should do when setting a computed property by providing additional function (`set`) in hash argument.
|
14357
|
+
If you try to set a computed property, it will try to invoke setter accessor function with the key and
|
14358
|
+
value you want to set it to as arguments.
|
14218
14359
|
|
14219
14360
|
```javascript
|
14220
|
-
|
14361
|
+
let Person = Ember.Object.extend({
|
14221
14362
|
// these will be supplied by `create`
|
14222
14363
|
firstName: null,
|
14223
14364
|
lastName: null,
|
14224
14365
|
|
14225
|
-
fullName:
|
14226
|
-
|
14227
|
-
|
14228
|
-
|
14229
|
-
var lastName = this.get('lastName');
|
14366
|
+
fullName: Ember.computed('firstName', 'lastName', {
|
14367
|
+
get(key) {
|
14368
|
+
let firstName = this.get('firstName'),
|
14369
|
+
lastName = this.get('lastName');
|
14230
14370
|
|
14231
14371
|
return firstName + ' ' + lastName;
|
14372
|
+
},
|
14373
|
+
set(key, value) {
|
14374
|
+
let [firstName, lastName] = value.split(' ');
|
14232
14375
|
|
14233
|
-
|
14234
|
-
|
14235
|
-
var name = value.split(' ');
|
14236
|
-
|
14237
|
-
this.set('firstName', name[0]);
|
14238
|
-
this.set('lastName', name[1]);
|
14376
|
+
this.set('firstName', firstName);
|
14377
|
+
this.set('lastName', lastName);
|
14239
14378
|
|
14240
14379
|
return value;
|
14241
14380
|
}
|
14242
|
-
}
|
14381
|
+
})
|
14243
14382
|
});
|
14244
14383
|
|
14245
|
-
|
14384
|
+
let person = Person.create();
|
14246
14385
|
|
14247
14386
|
person.set('fullName', 'Peter Wagenet');
|
14248
14387
|
person.get('firstName'); // 'Peter'
|
14249
14388
|
person.get('lastName'); // 'Wagenet'
|
14250
14389
|
```
|
14251
14390
|
|
14391
|
+
You can overwrite computed property with normal property (no longer computed), that won't change if dependencies change, if you set computed property and it won't have setter accessor function defined.
|
14392
|
+
|
14393
|
+
You can also mark computed property as `.readOnly()` and block all attempts to set it.
|
14394
|
+
|
14395
|
+
```javascript
|
14396
|
+
let Person = Ember.Object.extend({
|
14397
|
+
// these will be supplied by `create`
|
14398
|
+
firstName: null,
|
14399
|
+
lastName: null,
|
14400
|
+
|
14401
|
+
fullName: Ember.computed('firstName', 'lastName', {
|
14402
|
+
get(key) {
|
14403
|
+
let firstName = this.get('firstName');
|
14404
|
+
let lastName = this.get('lastName');
|
14405
|
+
|
14406
|
+
return firstName + ' ' + lastName;
|
14407
|
+
}
|
14408
|
+
}).readOnly()
|
14409
|
+
});
|
14410
|
+
|
14411
|
+
let person = Person.create();
|
14412
|
+
person.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
|
14413
|
+
```
|
14414
|
+
|
14415
|
+
Additional resources:
|
14416
|
+
- [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md)
|
14417
|
+
- [New computed syntax explained in "Ember 1.12 released" ](http://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax)
|
14418
|
+
|
14252
14419
|
@class ComputedProperty
|
14253
14420
|
@namespace Ember
|
14254
14421
|
@constructor
|
@@ -14296,10 +14463,10 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14296
14463
|
invalidation and notification when cached value is invalidated.
|
14297
14464
|
|
14298
14465
|
```javascript
|
14299
|
-
|
14300
|
-
value: function() {
|
14466
|
+
let outsideService = Ember.Object.extend({
|
14467
|
+
value: Ember.computed(function() {
|
14301
14468
|
return OutsideService.getValue();
|
14302
|
-
}
|
14469
|
+
}).volatile()
|
14303
14470
|
}).create();
|
14304
14471
|
```
|
14305
14472
|
|
@@ -14318,13 +14485,13 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14318
14485
|
mode the computed property will throw an error when set.
|
14319
14486
|
|
14320
14487
|
```javascript
|
14321
|
-
|
14322
|
-
guid: function() {
|
14488
|
+
let Person = Ember.Object.extend({
|
14489
|
+
guid: Ember.computed(function() {
|
14323
14490
|
return 'guid-guid-guid';
|
14324
|
-
}
|
14491
|
+
}).readOnly()
|
14325
14492
|
});
|
14326
14493
|
|
14327
|
-
|
14494
|
+
let person = Person.create();
|
14328
14495
|
|
14329
14496
|
person.set('guid', 'new-guid'); // will throw an exception
|
14330
14497
|
```
|
@@ -14345,8 +14512,8 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14345
14512
|
arguments containing key paths that this computed property depends on.
|
14346
14513
|
|
14347
14514
|
```javascript
|
14348
|
-
|
14349
|
-
fullName: computed(function() {
|
14515
|
+
let President = Ember.Object.extend({
|
14516
|
+
fullName: Ember.computed(function() {
|
14350
14517
|
return this.get('firstName') + ' ' + this.get('lastName');
|
14351
14518
|
|
14352
14519
|
// Tell Ember that this computed property depends on firstName
|
@@ -14354,7 +14521,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14354
14521
|
}).property('firstName', 'lastName')
|
14355
14522
|
});
|
14356
14523
|
|
14357
|
-
|
14524
|
+
let president = President.create({
|
14358
14525
|
firstName: 'Barack',
|
14359
14526
|
lastName: 'Obama'
|
14360
14527
|
});
|
@@ -14394,10 +14561,10 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14394
14561
|
You can pass a hash of these values to a computed property like this:
|
14395
14562
|
|
14396
14563
|
```
|
14397
|
-
person: function() {
|
14398
|
-
|
14564
|
+
person: Ember.computed(function() {
|
14565
|
+
let personId = this.get('personId');
|
14399
14566
|
return App.Person.create({ id: personId });
|
14400
|
-
}
|
14567
|
+
}).meta({ type: App.Person })
|
14401
14568
|
```
|
14402
14569
|
|
14403
14570
|
The hash that you pass to the `meta()` function will be saved on the
|
@@ -14447,15 +14614,15 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14447
14614
|
Otherwise, call the function passing the property name as an argument.
|
14448
14615
|
|
14449
14616
|
```javascript
|
14450
|
-
|
14451
|
-
fullName: function(keyName) {
|
14617
|
+
let Person = Ember.Object.extend({
|
14618
|
+
fullName: Ember.computed('firstName', 'lastName', function(keyName) {
|
14452
14619
|
// the keyName parameter is 'fullName' in this case.
|
14453
14620
|
return this.get('firstName') + ' ' + this.get('lastName');
|
14454
|
-
}
|
14621
|
+
})
|
14455
14622
|
});
|
14456
14623
|
|
14457
14624
|
|
14458
|
-
|
14625
|
+
let tom = Person.create({
|
14459
14626
|
firstName: 'Tom',
|
14460
14627
|
lastName: 'Dale'
|
14461
14628
|
});
|
@@ -14506,35 +14673,35 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14506
14673
|
the value of the property to the value being set.
|
14507
14674
|
|
14508
14675
|
Generally speaking if you intend for your computed property to be set
|
14509
|
-
|
14676
|
+
you should pass `set(key, value)` function in hash as argument to `Ember.computed()` along with `get(key)` function.
|
14510
14677
|
|
14511
14678
|
```javascript
|
14512
|
-
|
14679
|
+
let Person = Ember.Object.extend({
|
14513
14680
|
// these will be supplied by `create`
|
14514
14681
|
firstName: null,
|
14515
14682
|
lastName: null,
|
14516
14683
|
|
14517
|
-
fullName:
|
14684
|
+
fullName: Ember.computed('firstName', 'lastName', {
|
14518
14685
|
// getter
|
14519
|
-
|
14520
|
-
|
14521
|
-
|
14686
|
+
get() {
|
14687
|
+
let firstName = this.get('firstName');
|
14688
|
+
let lastName = this.get('lastName');
|
14522
14689
|
|
14523
14690
|
return firstName + ' ' + lastName;
|
14524
|
-
|
14691
|
+
},
|
14525
14692
|
// setter
|
14526
|
-
|
14527
|
-
|
14693
|
+
set(key, value) {
|
14694
|
+
let [firstName, lastName] = value.split(' ');
|
14528
14695
|
|
14529
|
-
this.set('firstName',
|
14530
|
-
this.set('lastName',
|
14696
|
+
this.set('firstName', firstName);
|
14697
|
+
this.set('lastName', lastName);
|
14531
14698
|
|
14532
14699
|
return value;
|
14533
14700
|
}
|
14534
|
-
}
|
14701
|
+
})
|
14535
14702
|
});
|
14536
14703
|
|
14537
|
-
|
14704
|
+
let person = Person.create();
|
14538
14705
|
|
14539
14706
|
person.set('fullName', 'Peter Wagenet');
|
14540
14707
|
person.get('firstName'); // 'Peter'
|
@@ -14544,7 +14711,6 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14544
14711
|
@method set
|
14545
14712
|
@param {String} keyName The key being accessed.
|
14546
14713
|
@param {Object} newValue The new value being assigned.
|
14547
|
-
@param {String} oldValue The old value being replaced.
|
14548
14714
|
@return {Object} The return value of the function backing the CP.
|
14549
14715
|
@public
|
14550
14716
|
*/
|
@@ -14654,24 +14820,26 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14654
14820
|
computed property function. You can use this helper to define properties
|
14655
14821
|
with mixins or via `Ember.defineProperty()`.
|
14656
14822
|
|
14657
|
-
|
14658
|
-
|
14659
|
-
|
14823
|
+
If you pass function as argument - it will be used as getter.
|
14824
|
+
You can pass hash with two functions - instead of single function - as argument to provide both getter and setter.
|
14825
|
+
|
14826
|
+
The `get` function should accept two parameters, `key` and `value`. If `value` is not
|
14827
|
+
undefined you should set the `value` first. In either case return the
|
14660
14828
|
current value of the property.
|
14661
14829
|
|
14662
14830
|
A computed property defined in this way might look like this:
|
14663
14831
|
|
14664
14832
|
```js
|
14665
|
-
|
14833
|
+
let Person = Ember.Object.extend({
|
14666
14834
|
firstName: 'Betty',
|
14667
14835
|
lastName: 'Jones',
|
14668
14836
|
|
14669
|
-
fullName: Ember.computed('firstName', 'lastName', function(
|
14837
|
+
fullName: Ember.computed('firstName', 'lastName', function() {
|
14670
14838
|
return this.get('firstName') + ' ' + this.get('lastName');
|
14671
14839
|
})
|
14672
14840
|
});
|
14673
14841
|
|
14674
|
-
|
14842
|
+
let client = Person.create();
|
14675
14843
|
|
14676
14844
|
client.get('fullName'); // 'Betty Jones'
|
14677
14845
|
|
@@ -14689,7 +14857,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/core', 'ember-metal/prop
|
|
14689
14857
|
(if prototype extensions are enabled, which is the default behavior):
|
14690
14858
|
|
14691
14859
|
```js
|
14692
|
-
fullName
|
14860
|
+
fullName() {
|
14693
14861
|
return this.get('firstName') + ' ' + this.get('lastName');
|
14694
14862
|
}.property('firstName', 'lastName')
|
14695
14863
|
```
|
@@ -14793,7 +14961,7 @@ enifed('ember-metal/core', ['exports', 'ember-metal/assert'], function (exports,
|
|
14793
14961
|
|
14794
14962
|
@class Ember
|
14795
14963
|
@static
|
14796
|
-
@version 2.1.0
|
14964
|
+
@version 2.1.0
|
14797
14965
|
@public
|
14798
14966
|
*/
|
14799
14967
|
|
@@ -14827,11 +14995,11 @@ enifed('ember-metal/core', ['exports', 'ember-metal/assert'], function (exports,
|
|
14827
14995
|
|
14828
14996
|
@property VERSION
|
14829
14997
|
@type String
|
14830
|
-
@default '2.1.0
|
14998
|
+
@default '2.1.0'
|
14831
14999
|
@static
|
14832
15000
|
@public
|
14833
15001
|
*/
|
14834
|
-
Ember.VERSION = '2.1.0
|
15002
|
+
Ember.VERSION = '2.1.0';
|
14835
15003
|
|
14836
15004
|
/**
|
14837
15005
|
The hash of environment variables used to control various configuration
|
@@ -21265,7 +21433,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
21265
21433
|
|
21266
21434
|
You can also use this method on DOM Element objects.
|
21267
21435
|
|
21268
|
-
@
|
21436
|
+
@public
|
21269
21437
|
@method guidFor
|
21270
21438
|
@for Ember
|
21271
21439
|
@param {Object} obj any object, string, number, Element, or primitive
|
@@ -21338,6 +21506,8 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
21338
21506
|
}
|
21339
21507
|
}
|
21340
21508
|
|
21509
|
+
var HAS_SUPER_PATTERN = /\.(_super|call\(this|apply\(this)/;
|
21510
|
+
|
21341
21511
|
var checkHasSuper = (function () {
|
21342
21512
|
var sourceAvailable = (function () {
|
21343
21513
|
return this;
|
@@ -21345,7 +21515,7 @@ enifed('ember-metal/utils', ['exports'], function (exports) {
|
|
21345
21515
|
|
21346
21516
|
if (sourceAvailable) {
|
21347
21517
|
return function checkHasSuper(func) {
|
21348
|
-
return func.toString()
|
21518
|
+
return HAS_SUPER_PATTERN.test(func.toString());
|
21349
21519
|
};
|
21350
21520
|
}
|
21351
21521
|
|
@@ -23049,7 +23219,7 @@ enifed('ember-routing-views/components/link-to', ['exports', 'ember-metal/core',
|
|
23049
23219
|
|
23050
23220
|
'use strict';
|
23051
23221
|
|
23052
|
-
_emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.1.0
|
23222
|
+
_emberHtmlbarsTemplatesLinkTo.default.meta.revision = 'Ember@2.1.0';
|
23053
23223
|
|
23054
23224
|
/**
|
23055
23225
|
`Ember.LinkComponent` renders an element whose `click` event triggers a
|
@@ -23470,22 +23640,10 @@ enifed('ember-routing-views/components/link-to', ['exports', 'ember-metal/core',
|
|
23470
23640
|
|
23471
23641
|
_emberMetalCore.default.assert('You must provide one or more parameters to the link-to component.', params.length);
|
23472
23642
|
|
23473
|
-
if (attrs.disabledClass) {
|
23474
|
-
this.set('disabledClass', attrs.disabledClass);
|
23475
|
-
}
|
23476
|
-
|
23477
|
-
if (attrs.activeClass) {
|
23478
|
-
this.set('activeClass', attrs.activeClass);
|
23479
|
-
}
|
23480
|
-
|
23481
23643
|
if (attrs.disabledWhen) {
|
23482
23644
|
this.set('disabled', attrs.disabledWhen);
|
23483
23645
|
}
|
23484
23646
|
|
23485
|
-
if (attrs.loadingClass) {
|
23486
|
-
this.set('loadingClass', attrs.loadingClass);
|
23487
|
-
}
|
23488
|
-
|
23489
23647
|
// Process the positional arguments, in order.
|
23490
23648
|
// 1. Inline link title comes first, if present.
|
23491
23649
|
if (!this[_emberHtmlbarsNodeManagersComponentNodeManager.HAS_BLOCK]) {
|
@@ -23544,7 +23702,7 @@ enifed('ember-routing-views/views/outlet', ['exports', 'ember-views/views/view',
|
|
23544
23702
|
|
23545
23703
|
'use strict';
|
23546
23704
|
|
23547
|
-
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.1.0
|
23705
|
+
_emberHtmlbarsTemplatesTopLevelView.default.meta.revision = 'Ember@2.1.0';
|
23548
23706
|
|
23549
23707
|
var CoreOutletView = _emberViewsViewsView.default.extend({
|
23550
23708
|
defaultTemplate: _emberHtmlbarsTemplatesTopLevelView.default,
|
@@ -30883,8 +31041,19 @@ enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal/mixin'], func
|
|
30883
31041
|
});
|
30884
31042
|
});
|
30885
31043
|
enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal/run_loop', 'ember-metal/mixin'], function (exports, _emberMetalRun_loop, _emberMetalMixin) {
|
31044
|
+
/**
|
31045
|
+
@module ember
|
31046
|
+
@submodule ember-runtime
|
31047
|
+
*/
|
30886
31048
|
'use strict';
|
30887
31049
|
|
31050
|
+
/**
|
31051
|
+
ContainerProxyMixin is used to provide public access to specific
|
31052
|
+
container functionality.
|
31053
|
+
|
31054
|
+
@class ContainerProxyMixin
|
31055
|
+
@private
|
31056
|
+
*/
|
30888
31057
|
exports.default = _emberMetalMixin.Mixin.create({
|
30889
31058
|
/**
|
30890
31059
|
The container stores state.
|
@@ -31662,7 +31831,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31662
31831
|
@param {Function} callback The callback to execute
|
31663
31832
|
@param {Object} [target] The target object to use
|
31664
31833
|
@return {Boolean} `true` if the passed function returns `true` for any item
|
31665
|
-
@
|
31834
|
+
@public
|
31666
31835
|
*/
|
31667
31836
|
any: function (callback, target) {
|
31668
31837
|
var len = _emberMetalProperty_get.get(this, 'length');
|
@@ -31726,7 +31895,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31726
31895
|
@param {Object} initialValue Initial value for the reduce
|
31727
31896
|
@param {String} reducerProperty internal use only.
|
31728
31897
|
@return {Object} The reduced value.
|
31729
|
-
@
|
31898
|
+
@public
|
31730
31899
|
*/
|
31731
31900
|
reduce: function (callback, initialValue, reducerProperty) {
|
31732
31901
|
if (typeof callback !== 'function') {
|
@@ -31750,7 +31919,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31750
31919
|
@param {String} methodName the name of the method
|
31751
31920
|
@param {Object...} args optional arguments to pass as well.
|
31752
31921
|
@return {Array} return values from calling invoke.
|
31753
|
-
@
|
31922
|
+
@public
|
31754
31923
|
*/
|
31755
31924
|
invoke: function (methodName) {
|
31756
31925
|
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
@@ -31775,7 +31944,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31775
31944
|
guaranteed. Corresponds to the method implemented by Prototype.
|
31776
31945
|
@method toArray
|
31777
31946
|
@return {Array} the enumerable as an array.
|
31778
|
-
@
|
31947
|
+
@public
|
31779
31948
|
*/
|
31780
31949
|
toArray: function () {
|
31781
31950
|
var ret = _emberMetalCore.default.A();
|
@@ -31842,7 +32011,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/core', 'ember
|
|
31842
32011
|
This only works on primitive data types, e.g. Strings, Numbers, etc.
|
31843
32012
|
@method uniq
|
31844
32013
|
@return {Ember.Enumerable}
|
31845
|
-
@
|
32014
|
+
@public
|
31846
32015
|
*/
|
31847
32016
|
uniq: function () {
|
31848
32017
|
var ret = _emberMetalCore.default.A();
|
@@ -33424,9 +33593,22 @@ enifed('ember-runtime/mixins/promise_proxy', ['exports', 'ember-metal/property_g
|
|
33424
33593
|
}
|
33425
33594
|
});
|
33426
33595
|
enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal/core', 'ember-metal/mixin'], function (exports, _emberMetalCore, _emberMetalMixin) {
|
33596
|
+
/**
|
33597
|
+
@module ember
|
33598
|
+
@submodule ember-runtime
|
33599
|
+
*/
|
33600
|
+
|
33427
33601
|
'use strict';
|
33428
33602
|
|
33429
33603
|
exports.buildFakeRegistryWithDeprecations = buildFakeRegistryWithDeprecations;
|
33604
|
+
|
33605
|
+
/**
|
33606
|
+
RegistryProxyMixin is used to provide public access to specific
|
33607
|
+
registry functionality.
|
33608
|
+
|
33609
|
+
@class RegistryProxyMixin
|
33610
|
+
@private
|
33611
|
+
*/
|
33430
33612
|
exports.default = _emberMetalMixin.Mixin.create({
|
33431
33613
|
__registry__: null,
|
33432
33614
|
|
@@ -33478,8 +33660,7 @@ enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal/core', 'e
|
|
33478
33660
|
App.register('communication:main', App.Email, { singleton: false });
|
33479
33661
|
App.register('session', App.session, { instantiate: false });
|
33480
33662
|
```
|
33481
|
-
@
|
33482
|
-
@method register
|
33663
|
+
@method register
|
33483
33664
|
@param fullName {String} type:name (e.g., 'model:user')
|
33484
33665
|
@param factory {Function} (e.g., App.Person)
|
33485
33666
|
@param options {Object} (optional) disable instantiation or singleton usage
|
@@ -33656,7 +33837,12 @@ enifed('ember-runtime/mixins/registry_proxy', ['exports', 'ember-metal/core', 'e
|
|
33656
33837
|
|
33657
33838
|
function buildFakeRegistryFunction(instance, typeForMessage, deprecatedProperty, nonDeprecatedProperty) {
|
33658
33839
|
return function () {
|
33659
|
-
_emberMetalCore.default.deprecate('Using `' + typeForMessage + '.registry.' + deprecatedProperty + '` is deprecated. Please use `' + typeForMessage + '.' + nonDeprecatedProperty + '` instead.', false, {
|
33840
|
+
_emberMetalCore.default.deprecate('Using `' + typeForMessage + '.registry.' + deprecatedProperty + '` is deprecated. Please use `' + typeForMessage + '.' + nonDeprecatedProperty + '` instead.', false, {
|
33841
|
+
id: 'ember-application.app-instance-registry',
|
33842
|
+
until: '3.0.0',
|
33843
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-application-registry-ember-applicationinstance-registry'
|
33844
|
+
});
|
33845
|
+
|
33660
33846
|
return instance[nonDeprecatedProperty].apply(instance, arguments);
|
33661
33847
|
};
|
33662
33848
|
}
|
@@ -34192,6 +34378,8 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34192
34378
|
// https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
|
34193
34379
|
//
|
34194
34380
|
|
34381
|
+
var _Mixin$create;
|
34382
|
+
|
34195
34383
|
'REMOVE_USE_STRICT: true';
|
34196
34384
|
|
34197
34385
|
/**
|
@@ -34201,7 +34389,8 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34201
34389
|
|
34202
34390
|
// using ember-metal/lib/main here to ensure that ember-debug is setup
|
34203
34391
|
// if present
|
34204
|
-
|
34392
|
+
var POST_INIT = _emberMetalUtils.symbol('POST_INIT');
|
34393
|
+
exports.POST_INIT = POST_INIT;
|
34205
34394
|
var schedule = _emberMetalRun_loop.default.schedule;
|
34206
34395
|
var applyMixin = _emberMetalMixin.Mixin._apply;
|
34207
34396
|
var finishPartial = _emberMetalMixin.Mixin.finishPartial;
|
@@ -34324,6 +34513,8 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34324
34513
|
this.init.apply(this, args);
|
34325
34514
|
}
|
34326
34515
|
|
34516
|
+
this[POST_INIT]();
|
34517
|
+
|
34327
34518
|
m.proto = proto;
|
34328
34519
|
_emberMetalChains.finishChains(this);
|
34329
34520
|
_emberMetalEvents.sendEvent(this, 'init');
|
@@ -34370,7 +34561,7 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34370
34561
|
CoreObject.toString = function () {
|
34371
34562
|
return 'Ember.CoreObject';
|
34372
34563
|
};
|
34373
|
-
CoreObject.PrototypeMixin = _emberMetalMixin.Mixin.create({
|
34564
|
+
CoreObject.PrototypeMixin = _emberMetalMixin.Mixin.create((_Mixin$create = {
|
34374
34565
|
reopen: function () {
|
34375
34566
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
34376
34567
|
args[_key] = arguments[_key];
|
@@ -34403,180 +34594,40 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34403
34594
|
@method init
|
34404
34595
|
@public
|
34405
34596
|
*/
|
34406
|
-
init: function () {}
|
34407
|
-
__defineNonEnumerable: function (property) {
|
34408
|
-
Object.defineProperty(this, property.name, property.descriptor);
|
34409
|
-
//this[property.name] = property.descriptor.value;
|
34410
|
-
},
|
34597
|
+
init: function () {}
|
34411
34598
|
|
34412
|
-
|
34413
|
-
|
34414
|
-
|
34415
|
-
|
34416
|
-
|
34417
|
-
|
34418
|
-
|
34419
|
-
|
34420
|
-
is the `classNames` property of `Ember.View`.
|
34421
|
-
Here is some sample code showing the difference between a concatenated
|
34422
|
-
property and a normal one:
|
34423
|
-
```javascript
|
34424
|
-
App.BarView = Ember.View.extend({
|
34425
|
-
someNonConcatenatedProperty: ['bar'],
|
34426
|
-
classNames: ['bar']
|
34427
|
-
});
|
34428
|
-
App.FooBarView = App.BarView.extend({
|
34429
|
-
someNonConcatenatedProperty: ['foo'],
|
34430
|
-
classNames: ['foo']
|
34431
|
-
});
|
34432
|
-
var fooBarView = App.FooBarView.create();
|
34433
|
-
fooBarView.get('someNonConcatenatedProperty'); // ['foo']
|
34434
|
-
fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']
|
34435
|
-
```
|
34436
|
-
This behavior extends to object creation as well. Continuing the
|
34437
|
-
above example:
|
34438
|
-
```javascript
|
34439
|
-
var view = App.FooBarView.create({
|
34440
|
-
someNonConcatenatedProperty: ['baz'],
|
34441
|
-
classNames: ['baz']
|
34442
|
-
})
|
34443
|
-
view.get('someNonConcatenatedProperty'); // ['baz']
|
34444
|
-
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
34445
|
-
```
|
34446
|
-
Adding a single property that is not an array will just add it in the array:
|
34447
|
-
```javascript
|
34448
|
-
var view = App.FooBarView.create({
|
34449
|
-
classNames: 'baz'
|
34450
|
-
})
|
34451
|
-
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
34452
|
-
```
|
34453
|
-
Using the `concatenatedProperties` property, we can tell Ember to mix the
|
34454
|
-
content of the properties.
|
34455
|
-
In `Ember.View` the `classNameBindings` and `attributeBindings` properties
|
34456
|
-
are also concatenated, in addition to `classNames`.
|
34457
|
-
This feature is available for you to use throughout the Ember object model,
|
34458
|
-
although typical app developers are likely to use it infrequently. Since
|
34459
|
-
it changes expectations about behavior of properties, you should properly
|
34460
|
-
document its usage in each individual concatenated property (to not
|
34461
|
-
mislead your users to think they can override the property in a subclass).
|
34462
|
-
@property concatenatedProperties
|
34463
|
-
@type Array
|
34464
|
-
@default null
|
34465
|
-
@public
|
34466
|
-
*/
|
34467
|
-
concatenatedProperties: null,
|
34468
|
-
|
34469
|
-
/**
|
34470
|
-
Destroyed object property flag.
|
34471
|
-
if this property is `true` the observers and bindings were already
|
34472
|
-
removed by the effect of calling the `destroy()` method.
|
34473
|
-
@property isDestroyed
|
34474
|
-
@default false
|
34475
|
-
@public
|
34476
|
-
*/
|
34477
|
-
isDestroyed: false,
|
34478
|
-
|
34479
|
-
/**
|
34480
|
-
Destruction scheduled flag. The `destroy()` method has been called.
|
34481
|
-
The object stays intact until the end of the run loop at which point
|
34482
|
-
the `isDestroyed` flag is set.
|
34483
|
-
@property isDestroying
|
34484
|
-
@default false
|
34485
|
-
@public
|
34486
|
-
*/
|
34487
|
-
isDestroying: false,
|
34488
|
-
|
34489
|
-
/**
|
34490
|
-
Destroys an object by setting the `isDestroyed` flag and removing its
|
34491
|
-
metadata, which effectively destroys observers and bindings.
|
34492
|
-
If you try to set a property on a destroyed object, an exception will be
|
34493
|
-
raised.
|
34494
|
-
Note that destruction is scheduled for the end of the run loop and does not
|
34495
|
-
happen immediately. It will set an isDestroying flag immediately.
|
34496
|
-
@method destroy
|
34497
|
-
@return {Ember.Object} receiver
|
34498
|
-
@public
|
34499
|
-
*/
|
34500
|
-
destroy: function () {
|
34501
|
-
if (this.isDestroying) {
|
34502
|
-
return;
|
34503
|
-
}
|
34504
|
-
this.isDestroying = true;
|
34505
|
-
|
34506
|
-
schedule('actions', this, this.willDestroy);
|
34507
|
-
schedule('destroy', this, this._scheduledDestroy);
|
34508
|
-
return this;
|
34509
|
-
},
|
34510
|
-
|
34511
|
-
/**
|
34512
|
-
Override to implement teardown.
|
34513
|
-
@method willDestroy
|
34514
|
-
@public
|
34515
|
-
*/
|
34516
|
-
willDestroy: _emberMetalCore.K,
|
34517
|
-
|
34518
|
-
/**
|
34519
|
-
Invoked by the run loop to actually destroy the object. This is
|
34520
|
-
scheduled for execution by the `destroy` method.
|
34521
|
-
@private
|
34522
|
-
@method _scheduledDestroy
|
34523
|
-
*/
|
34524
|
-
_scheduledDestroy: function () {
|
34525
|
-
if (this.isDestroyed) {
|
34526
|
-
return;
|
34527
|
-
}
|
34528
|
-
_emberMetalWatching.destroy(this);
|
34529
|
-
this.isDestroyed = true;
|
34530
|
-
},
|
34531
|
-
|
34532
|
-
bind: function (to, from) {
|
34533
|
-
if (!(from instanceof _emberMetalBinding.Binding)) {
|
34534
|
-
from = _emberMetalBinding.Binding.from(from);
|
34535
|
-
}
|
34536
|
-
from.to(to).connect(this);
|
34537
|
-
return from;
|
34538
|
-
},
|
34539
|
-
|
34540
|
-
/**
|
34541
|
-
Returns a string representation which attempts to provide more information
|
34542
|
-
than Javascript's `toString` typically does, in a generic way for all Ember
|
34543
|
-
objects.
|
34544
|
-
```javascript
|
34545
|
-
App.Person = Em.Object.extend()
|
34546
|
-
person = App.Person.create()
|
34547
|
-
person.toString() //=> "<App.Person:ember1024>"
|
34548
|
-
```
|
34549
|
-
If the object's class is not defined on an Ember namespace, it will
|
34550
|
-
indicate it is a subclass of the registered superclass:
|
34551
|
-
```javascript
|
34552
|
-
Student = App.Person.extend()
|
34553
|
-
student = Student.create()
|
34554
|
-
student.toString() //=> "<(subclass of App.Person):ember1025>"
|
34555
|
-
```
|
34556
|
-
If the method `toStringExtension` is defined, its return value will be
|
34557
|
-
included in the output.
|
34558
|
-
```javascript
|
34559
|
-
App.Teacher = App.Person.extend({
|
34560
|
-
toStringExtension: function() {
|
34561
|
-
return this.get('fullName');
|
34562
|
-
}
|
34563
|
-
});
|
34564
|
-
teacher = App.Teacher.create()
|
34565
|
-
teacher.toString(); //=> "<App.Teacher:ember1026:Tom Dale>"
|
34566
|
-
```
|
34567
|
-
@method toString
|
34568
|
-
@return {String} string representation
|
34569
|
-
@public
|
34570
|
-
*/
|
34571
|
-
toString: function () {
|
34572
|
-
var hasToStringExtension = typeof this.toStringExtension === 'function';
|
34573
|
-
var extension = hasToStringExtension ? ':' + this.toStringExtension() : '';
|
34574
|
-
var ret = '<' + this.constructor.toString() + ':' + _emberMetalUtils.guidFor(this) + extension + '>';
|
34599
|
+
}, _Mixin$create[POST_INIT] = function () {}, _Mixin$create.__defineNonEnumerable = function (property) {
|
34600
|
+
Object.defineProperty(this, property.name, property.descriptor);
|
34601
|
+
//this[property.name] = property.descriptor.value;
|
34602
|
+
}, _Mixin$create.concatenatedProperties = null, _Mixin$create.mergedProperties = null, _Mixin$create.isDestroyed = false, _Mixin$create.isDestroying = false, _Mixin$create.destroy = function () {
|
34603
|
+
if (this.isDestroying) {
|
34604
|
+
return;
|
34605
|
+
}
|
34606
|
+
this.isDestroying = true;
|
34575
34607
|
|
34576
|
-
|
34577
|
-
|
34608
|
+
schedule('actions', this, this.willDestroy);
|
34609
|
+
schedule('destroy', this, this._scheduledDestroy);
|
34610
|
+
return this;
|
34611
|
+
}, _Mixin$create.willDestroy = _emberMetalCore.K, _Mixin$create._scheduledDestroy = function () {
|
34612
|
+
if (this.isDestroyed) {
|
34613
|
+
return;
|
34578
34614
|
}
|
34579
|
-
|
34615
|
+
_emberMetalWatching.destroy(this);
|
34616
|
+
this.isDestroyed = true;
|
34617
|
+
}, _Mixin$create.bind = function (to, from) {
|
34618
|
+
if (!(from instanceof _emberMetalBinding.Binding)) {
|
34619
|
+
from = _emberMetalBinding.Binding.from(from);
|
34620
|
+
}
|
34621
|
+
from.to(to).connect(this);
|
34622
|
+
return from;
|
34623
|
+
}, _Mixin$create.toString = function () {
|
34624
|
+
var hasToStringExtension = typeof this.toStringExtension === 'function';
|
34625
|
+
var extension = hasToStringExtension ? ':' + this.toStringExtension() : '';
|
34626
|
+
var ret = '<' + this.constructor.toString() + ':' + _emberMetalUtils.guidFor(this) + extension + '>';
|
34627
|
+
|
34628
|
+
this.toString = makeToString(ret);
|
34629
|
+
return ret;
|
34630
|
+
}, _Mixin$create));
|
34580
34631
|
|
34581
34632
|
CoreObject.PrototypeMixin.ownerConstructor = CoreObject;
|
34582
34633
|
|
@@ -34965,6 +35016,195 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal', 'ember-met
|
|
34965
35016
|
|
34966
35017
|
// NOTE: this object should never be included directly. Instead use `Ember.Object`.
|
34967
35018
|
// We only define this separately so that `Ember.Set` can depend on it.
|
35019
|
+
|
35020
|
+
/**
|
35021
|
+
Defines the properties that will be concatenated from the superclass
|
35022
|
+
(instead of overridden).
|
35023
|
+
By default, when you extend an Ember class a property defined in
|
35024
|
+
the subclass overrides a property with the same name that is defined
|
35025
|
+
in the superclass. However, there are some cases where it is preferable
|
35026
|
+
to build up a property's value by combining the superclass' property
|
35027
|
+
value with the subclass' value. An example of this in use within Ember
|
35028
|
+
is the `classNames` property of `Ember.View`.
|
35029
|
+
Here is some sample code showing the difference between a concatenated
|
35030
|
+
property and a normal one:
|
35031
|
+
```javascript
|
35032
|
+
App.BarView = Ember.View.extend({
|
35033
|
+
someNonConcatenatedProperty: ['bar'],
|
35034
|
+
classNames: ['bar']
|
35035
|
+
});
|
35036
|
+
App.FooBarView = App.BarView.extend({
|
35037
|
+
someNonConcatenatedProperty: ['foo'],
|
35038
|
+
classNames: ['foo']
|
35039
|
+
});
|
35040
|
+
var fooBarView = App.FooBarView.create();
|
35041
|
+
fooBarView.get('someNonConcatenatedProperty'); // ['foo']
|
35042
|
+
fooBarView.get('classNames'); // ['ember-view', 'bar', 'foo']
|
35043
|
+
```
|
35044
|
+
This behavior extends to object creation as well. Continuing the
|
35045
|
+
above example:
|
35046
|
+
```javascript
|
35047
|
+
var view = App.FooBarView.create({
|
35048
|
+
someNonConcatenatedProperty: ['baz'],
|
35049
|
+
classNames: ['baz']
|
35050
|
+
})
|
35051
|
+
view.get('someNonConcatenatedProperty'); // ['baz']
|
35052
|
+
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
35053
|
+
```
|
35054
|
+
Adding a single property that is not an array will just add it in the array:
|
35055
|
+
```javascript
|
35056
|
+
var view = App.FooBarView.create({
|
35057
|
+
classNames: 'baz'
|
35058
|
+
})
|
35059
|
+
view.get('classNames'); // ['ember-view', 'bar', 'foo', 'baz']
|
35060
|
+
```
|
35061
|
+
Using the `concatenatedProperties` property, we can tell Ember to mix the
|
35062
|
+
content of the properties.
|
35063
|
+
In `Ember.View` the `classNameBindings` and `attributeBindings` properties
|
35064
|
+
are also concatenated, in addition to `classNames`.
|
35065
|
+
This feature is available for you to use throughout the Ember object model,
|
35066
|
+
although typical app developers are likely to use it infrequently. Since
|
35067
|
+
it changes expectations about behavior of properties, you should properly
|
35068
|
+
document its usage in each individual concatenated property (to not
|
35069
|
+
mislead your users to think they can override the property in a subclass).
|
35070
|
+
@property concatenatedProperties
|
35071
|
+
@type Array
|
35072
|
+
@default null
|
35073
|
+
@public
|
35074
|
+
*/
|
35075
|
+
|
35076
|
+
/**
|
35077
|
+
Defines the properties that will be merged from the superclass
|
35078
|
+
(instead of overridden).
|
35079
|
+
By default, when you extend an Ember class a property defined in
|
35080
|
+
the subclass overrides a property with the same name that is defined
|
35081
|
+
in the superclass. However, there are some cases where it is preferable
|
35082
|
+
to build up a property's value by merging the superclass property value
|
35083
|
+
with the subclass property's value. An example of this in use within Ember
|
35084
|
+
is the `queryParams` property of routes.
|
35085
|
+
Here is some sample code showing the difference between a merged
|
35086
|
+
property and a normal one:
|
35087
|
+
```javascript
|
35088
|
+
App.BarRoute = Ember.Route.extend({
|
35089
|
+
someNonMergedProperty: {
|
35090
|
+
nonMerged: 'superclass value of nonMerged'
|
35091
|
+
},
|
35092
|
+
queryParams: {
|
35093
|
+
page: {replace: false},
|
35094
|
+
limit: {replace: true}
|
35095
|
+
}
|
35096
|
+
});
|
35097
|
+
App.FooBarRoute = App.BarRoute.extend({
|
35098
|
+
someNonMergedProperty: {
|
35099
|
+
completelyNonMerged: 'subclass value of nonMerged'
|
35100
|
+
},
|
35101
|
+
queryParams: {
|
35102
|
+
limit: {replace: false}
|
35103
|
+
}
|
35104
|
+
});
|
35105
|
+
var fooBarRoute = App.FooBarRoute.create();
|
35106
|
+
fooBarRoute.get('someNonMergedProperty');
|
35107
|
+
// => { completelyNonMerged: 'subclass value of nonMerged' }
|
35108
|
+
//
|
35109
|
+
// Note the entire object, including the nonMerged property of
|
35110
|
+
// the superclass object, has been replaced
|
35111
|
+
fooBarRoute.get('queryParams');
|
35112
|
+
// => {
|
35113
|
+
// page: {replace: false},
|
35114
|
+
// limit: {replace: false}
|
35115
|
+
// }
|
35116
|
+
//
|
35117
|
+
// Note the page remains from the superclass, and the
|
35118
|
+
// `limit` property's value of `false` has been merged from
|
35119
|
+
// the subclass.
|
35120
|
+
```
|
35121
|
+
This behavior is not available during object `create` calls. It is only
|
35122
|
+
available at `extend` time.
|
35123
|
+
This feature is available for you to use throughout the Ember object model,
|
35124
|
+
although typical app developers are likely to use it infrequently. Since
|
35125
|
+
it changes expectations about behavior of properties, you should properly
|
35126
|
+
document its usage in each individual merged property (to not
|
35127
|
+
mislead your users to think they can override the property in a subclass).
|
35128
|
+
@property mergedProperties
|
35129
|
+
@type Array
|
35130
|
+
@default null
|
35131
|
+
@public
|
35132
|
+
*/
|
35133
|
+
|
35134
|
+
/**
|
35135
|
+
Destroyed object property flag.
|
35136
|
+
if this property is `true` the observers and bindings were already
|
35137
|
+
removed by the effect of calling the `destroy()` method.
|
35138
|
+
@property isDestroyed
|
35139
|
+
@default false
|
35140
|
+
@public
|
35141
|
+
*/
|
35142
|
+
|
35143
|
+
/**
|
35144
|
+
Destruction scheduled flag. The `destroy()` method has been called.
|
35145
|
+
The object stays intact until the end of the run loop at which point
|
35146
|
+
the `isDestroyed` flag is set.
|
35147
|
+
@property isDestroying
|
35148
|
+
@default false
|
35149
|
+
@public
|
35150
|
+
*/
|
35151
|
+
|
35152
|
+
/**
|
35153
|
+
Destroys an object by setting the `isDestroyed` flag and removing its
|
35154
|
+
metadata, which effectively destroys observers and bindings.
|
35155
|
+
If you try to set a property on a destroyed object, an exception will be
|
35156
|
+
raised.
|
35157
|
+
Note that destruction is scheduled for the end of the run loop and does not
|
35158
|
+
happen immediately. It will set an isDestroying flag immediately.
|
35159
|
+
@method destroy
|
35160
|
+
@return {Ember.Object} receiver
|
35161
|
+
@public
|
35162
|
+
*/
|
35163
|
+
|
35164
|
+
/**
|
35165
|
+
Override to implement teardown.
|
35166
|
+
@method willDestroy
|
35167
|
+
@public
|
35168
|
+
*/
|
35169
|
+
|
35170
|
+
/**
|
35171
|
+
Invoked by the run loop to actually destroy the object. This is
|
35172
|
+
scheduled for execution by the `destroy` method.
|
35173
|
+
@private
|
35174
|
+
@method _scheduledDestroy
|
35175
|
+
*/
|
35176
|
+
|
35177
|
+
/**
|
35178
|
+
Returns a string representation which attempts to provide more information
|
35179
|
+
than Javascript's `toString` typically does, in a generic way for all Ember
|
35180
|
+
objects.
|
35181
|
+
```javascript
|
35182
|
+
App.Person = Em.Object.extend()
|
35183
|
+
person = App.Person.create()
|
35184
|
+
person.toString() //=> "<App.Person:ember1024>"
|
35185
|
+
```
|
35186
|
+
If the object's class is not defined on an Ember namespace, it will
|
35187
|
+
indicate it is a subclass of the registered superclass:
|
35188
|
+
```javascript
|
35189
|
+
Student = App.Person.extend()
|
35190
|
+
student = Student.create()
|
35191
|
+
student.toString() //=> "<(subclass of App.Person):ember1025>"
|
35192
|
+
```
|
35193
|
+
If the method `toStringExtension` is defined, its return value will be
|
35194
|
+
included in the output.
|
35195
|
+
```javascript
|
35196
|
+
App.Teacher = App.Person.extend({
|
35197
|
+
toStringExtension: function() {
|
35198
|
+
return this.get('fullName');
|
35199
|
+
}
|
35200
|
+
});
|
35201
|
+
teacher = App.Teacher.create()
|
35202
|
+
teacher.toString(); //=> "<App.Teacher:ember1026:Tom Dale>"
|
35203
|
+
```
|
35204
|
+
@method toString
|
35205
|
+
@return {String} string representation
|
35206
|
+
@public
|
35207
|
+
*/
|
34968
35208
|
enifed('ember-runtime/system/each_proxy', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/empty_object'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalObserver, _emberMetalProperty_events, _emberMetalEmpty_object) {
|
34969
35209
|
'use strict';
|
34970
35210
|
|
@@ -35745,13 +35985,22 @@ enifed('ember-runtime/system/string', ['exports', 'ember-metal/core', 'ember-met
|
|
35745
35985
|
});
|
35746
35986
|
});
|
35747
35987
|
|
35748
|
-
var STRING_CLASSIFY_REGEXP_1 =
|
35749
|
-
var STRING_CLASSIFY_REGEXP_2 = /(
|
35988
|
+
var STRING_CLASSIFY_REGEXP_1 = /^(\-|_)+(.)?/;
|
35989
|
+
var STRING_CLASSIFY_REGEXP_2 = /(.)(\-|\_|\.|\s)+(.)?/g;
|
35990
|
+
var STRING_CLASSIFY_REGEXP_3 = /(^|\/|\.)([a-z])/g;
|
35750
35991
|
|
35751
35992
|
var CLASSIFY_CACHE = new _emberMetalCache.default(1000, function (str) {
|
35752
|
-
|
35753
|
-
return chr ? chr.toUpperCase() : '';
|
35754
|
-
}
|
35993
|
+
var replace1 = function (match, separator, chr) {
|
35994
|
+
return chr ? '_' + chr.toUpperCase() : '';
|
35995
|
+
};
|
35996
|
+
var replace2 = function (match, initialChar, separator, chr) {
|
35997
|
+
return initialChar + (chr ? chr.toUpperCase() : '');
|
35998
|
+
};
|
35999
|
+
var parts = str.split('/');
|
36000
|
+
for (var i = 0, len = parts.length; i < len; i++) {
|
36001
|
+
parts[i] = parts[i].replace(STRING_CLASSIFY_REGEXP_1, replace1).replace(STRING_CLASSIFY_REGEXP_2, replace2);
|
36002
|
+
}
|
36003
|
+
return parts.join('/').replace(STRING_CLASSIFY_REGEXP_3, function (match, separator, chr) {
|
35755
36004
|
return match.toUpperCase();
|
35756
36005
|
});
|
35757
36006
|
});
|
@@ -37202,7 +37451,7 @@ enifed('ember-template-compiler/system/compile_options', ['exports', 'ember-meta
|
|
37202
37451
|
options.buildMeta = function buildMeta(program) {
|
37203
37452
|
return {
|
37204
37453
|
topLevel: detectTopLevel(program),
|
37205
|
-
revision: 'Ember@2.1.0
|
37454
|
+
revision: 'Ember@2.1.0',
|
37206
37455
|
loc: program.loc,
|
37207
37456
|
moduleName: options.moduleName
|
37208
37457
|
};
|
@@ -40827,7 +41076,7 @@ enifed('ember-views/system/event_dispatcher', ['exports', 'ember-metal/core', 'e
|
|
40827
41076
|
},
|
40828
41077
|
|
40829
41078
|
_bubbleEvent: function (view, evt, eventName) {
|
40830
|
-
return
|
41079
|
+
return view.handleEvent(eventName, evt);
|
40831
41080
|
},
|
40832
41081
|
|
40833
41082
|
destroy: function () {
|
@@ -41655,7 +41904,11 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-run
|
|
41655
41904
|
// `layout` is no longer a CP, so this just ensures that the `defaultLayout`
|
41656
41905
|
// logic is supported with a deprecation
|
41657
41906
|
if (this.defaultLayout && !this.layout) {
|
41658
|
-
_emberMetalCore.default.deprecate('Specifying `defaultLayout` to ' + this + ' is deprecated. Please use `layout` instead.', false, {
|
41907
|
+
_emberMetalCore.default.deprecate('Specifying `defaultLayout` to ' + this + ' is deprecated. Please use `layout` instead.', false, {
|
41908
|
+
id: 'ember-views.component.defaultLayout',
|
41909
|
+
until: '3.0.0',
|
41910
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-component-defaultlayout'
|
41911
|
+
});
|
41659
41912
|
|
41660
41913
|
this.layout = this.defaultLayout;
|
41661
41914
|
}
|
@@ -41815,7 +42068,7 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-run
|
|
41815
42068
|
```hbs
|
41816
42069
|
{{! templates/application.hbs }}
|
41817
42070
|
{{foo-bar}}
|
41818
|
-
{{! templates/components/foo-bar.
|
42071
|
+
{{! templates/components/foo-bar.hbs }}
|
41819
42072
|
{{#if hasBlock}}
|
41820
42073
|
This will not be printed, because no block was provided
|
41821
42074
|
{{/if}}
|
@@ -41826,14 +42079,32 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-run
|
|
41826
42079
|
{{#foo-bar}}
|
41827
42080
|
Hi!
|
41828
42081
|
{{/foo-bar}}
|
41829
|
-
{{! templates/components/foo-bar.
|
42082
|
+
{{! templates/components/foo-bar.hbs }}
|
41830
42083
|
{{#if hasBlock}}
|
41831
42084
|
This will be printed because a block was provided
|
41832
42085
|
{{yield}}
|
41833
42086
|
{{/if}}
|
42087
|
+
```
|
42088
|
+
This helper accepts an argument with the name of the block we want to check the presence of.
|
42089
|
+
This is useful for checking for the presence of the optional inverse block in components.
|
42090
|
+
```hbs
|
42091
|
+
{{! templates/application.hbs }}
|
42092
|
+
{{#foo-bar}}
|
42093
|
+
Hi!
|
42094
|
+
{{else}}
|
42095
|
+
What's up?
|
42096
|
+
{{/foo-bar}}
|
42097
|
+
{{! templates/components/foo-bar.hbs }}
|
42098
|
+
{{yield}}
|
42099
|
+
{{#if (hasBlock "inverse")}}
|
42100
|
+
{{yield to="inverse"}}
|
42101
|
+
{{else}}
|
42102
|
+
How are you?
|
42103
|
+
{{/if}}
|
41834
42104
|
```
|
41835
42105
|
@public
|
41836
42106
|
@property hasBlock
|
42107
|
+
@param {String} [blockName="default"] The name of the block to check presence of.
|
41837
42108
|
@returns Boolean
|
41838
42109
|
*/
|
41839
42110
|
|
@@ -41846,7 +42117,7 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-run
|
|
41846
42117
|
{{#foo-bar}}
|
41847
42118
|
No block parameter.
|
41848
42119
|
{{/foo-bar}}
|
41849
|
-
{{! templates/components/foo-bar.
|
42120
|
+
{{! templates/components/foo-bar.hbs }}
|
41850
42121
|
{{#if hasBlockParams}}
|
41851
42122
|
This will not be printed, because no block was provided
|
41852
42123
|
{{yield this}}
|
@@ -41858,7 +42129,7 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-run
|
|
41858
42129
|
{{#foo-bar as |foo|}}
|
41859
42130
|
Hi!
|
41860
42131
|
{{/foo-bar}}
|
41861
|
-
{{! templates/components/foo-bar.
|
42132
|
+
{{! templates/components/foo-bar.hbs }}
|
41862
42133
|
{{#if hasBlockParams}}
|
41863
42134
|
This will be printed because a block was provided
|
41864
42135
|
{{yield this}}
|
@@ -41918,7 +42189,7 @@ enifed('ember-views/views/component', ['exports', 'ember-metal/core', 'ember-run
|
|
41918
42189
|
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) {
|
41919
42190
|
'use strict';
|
41920
42191
|
|
41921
|
-
_emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.1.0
|
42192
|
+
_emberHtmlbarsTemplatesContainerView.default.meta.revision = 'Ember@2.1.0';
|
41922
42193
|
|
41923
42194
|
/**
|
41924
42195
|
@module ember
|
@@ -43182,7 +43453,7 @@ enifed('ember-views/views/states/destroying', ['exports', 'ember-metal/merge', '
|
|
43182
43453
|
|
43183
43454
|
exports.default = destroying;
|
43184
43455
|
});
|
43185
|
-
enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/states/default', 'ember-metal/merge', 'ember-views/system/jquery', 'ember-metal/property_get', 'htmlbars-runtime'], function (exports, _emberViewsViewsStatesDefault, _emberMetalMerge, _emberViewsSystemJquery, _emberMetalProperty_get, _htmlbarsRuntime) {
|
43456
|
+
enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/states/default', 'ember-metal/merge', 'ember-views/system/jquery', 'ember-metal/run_loop', 'ember-metal/property_get', 'htmlbars-runtime'], function (exports, _emberViewsViewsStatesDefault, _emberMetalMerge, _emberViewsSystemJquery, _emberMetalRun_loop, _emberMetalProperty_get, _htmlbarsRuntime) {
|
43186
43457
|
'use strict';
|
43187
43458
|
|
43188
43459
|
var hasElement = Object.create(_emberViewsViewsStatesDefault.default);
|
@@ -43240,7 +43511,7 @@ enifed('ember-views/views/states/has_element', ['exports', 'ember-views/views/st
|
|
43240
43511
|
if (view.has(eventName)) {
|
43241
43512
|
// Handler should be able to re-dispatch events, so we don't
|
43242
43513
|
// preventDefault or stopPropagation.
|
43243
|
-
return view.trigger
|
43514
|
+
return _emberMetalRun_loop.default.join(view, view.trigger, eventName, evt);
|
43244
43515
|
} else {
|
43245
43516
|
return true; // continue event propagation
|
43246
43517
|
}
|
@@ -43475,13 +43746,17 @@ enifed('ember-views/views/text_field', ['exports', 'ember-metal/computed', 'embe
|
|
43475
43746
|
max: null
|
43476
43747
|
});
|
43477
43748
|
});
|
43478
|
-
enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-views/system/jquery', 'ember-views/system/ext', 'ember-views/views/core_view', 'ember-views/mixins/view_context_support', 'ember-views/mixins/view_child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/template_rendering_support', 'ember-views/mixins/class_names_support', 'ember-views/mixins/legacy_view_support', 'ember-views/mixins/instrumentation_support', 'ember-views/mixins/aria_role_support', 'ember-views/mixins/visibility_support', 'ember-views/compat/attrs-proxy', 'ember-metal/deprecate_property'], function (exports, _emberMetalCore, _emberMetalError, _emberMetalProperty_get, _emberMetalRun_loop, _emberMetalObserver, _emberMetalUtils, _emberMetalComputed, _emberMetalMixin, _emberViewsSystemJquery, _emberViewsSystemExt, _emberViewsViewsCore_view, _emberViewsMixinsView_context_support, _emberViewsMixinsView_child_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsTemplate_rendering_support, _emberViewsMixinsClass_names_support, _emberViewsMixinsLegacy_view_support, _emberViewsMixinsInstrumentation_support, _emberViewsMixinsAria_role_support, _emberViewsMixinsVisibility_support, _emberViewsCompatAttrsProxy, _emberMetalDeprecate_property) {
|
43749
|
+
enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-metal/error', 'ember-metal/property_get', 'ember-metal/run_loop', 'ember-metal/observer', 'ember-metal/utils', 'ember-metal/computed', 'ember-metal/mixin', 'ember-views/system/jquery', 'ember-views/system/ext', 'ember-views/views/core_view', 'ember-views/mixins/view_context_support', 'ember-views/mixins/view_child_views_support', 'ember-views/mixins/view_state_support', 'ember-views/mixins/template_rendering_support', 'ember-views/mixins/class_names_support', 'ember-views/mixins/legacy_view_support', 'ember-views/mixins/instrumentation_support', 'ember-views/mixins/aria_role_support', 'ember-views/mixins/visibility_support', 'ember-views/compat/attrs-proxy', 'ember-metal/deprecate_property', 'ember-runtime/system/core_object'], function (exports, _emberMetalCore, _emberMetalError, _emberMetalProperty_get, _emberMetalRun_loop, _emberMetalObserver, _emberMetalUtils, _emberMetalComputed, _emberMetalMixin, _emberViewsSystemJquery, _emberViewsSystemExt, _emberViewsViewsCore_view, _emberViewsMixinsView_context_support, _emberViewsMixinsView_child_views_support, _emberViewsMixinsView_state_support, _emberViewsMixinsTemplate_rendering_support, _emberViewsMixinsClass_names_support, _emberViewsMixinsLegacy_view_support, _emberViewsMixinsInstrumentation_support, _emberViewsMixinsAria_role_support, _emberViewsMixinsVisibility_support, _emberViewsCompatAttrsProxy, _emberMetalDeprecate_property, _emberRuntimeSystemCore_object) {
|
43479
43750
|
// Ember.assert, Ember.deprecate, Ember.warn, Ember.TEMPLATES,
|
43480
43751
|
// jQuery, Ember.lookup,
|
43481
43752
|
// Ember.ContainerView circular dependency
|
43482
43753
|
// Ember.ENV
|
43483
43754
|
'use strict';
|
43484
43755
|
|
43756
|
+
var _CoreView$extend;
|
43757
|
+
|
43758
|
+
var INIT_WAS_CALLED = _emberMetalUtils.symbol('INIT_WAS_CALLED');
|
43759
|
+
|
43485
43760
|
function K() {
|
43486
43761
|
return this;
|
43487
43762
|
}
|
@@ -44119,7 +44394,7 @@ enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-metal/er
|
|
44119
44394
|
@public
|
44120
44395
|
*/
|
44121
44396
|
// jscs:disable validateIndentation
|
44122
|
-
var View = _emberViewsViewsCore_view.default.extend(_emberViewsMixinsView_context_support.default, _emberViewsMixinsView_child_views_support.default, _emberViewsMixinsView_state_support.default, _emberViewsMixinsTemplate_rendering_support.default, _emberViewsMixinsClass_names_support.default, _emberViewsMixinsLegacy_view_support.default, _emberViewsMixinsInstrumentation_support.default, _emberViewsMixinsVisibility_support.default, _emberViewsCompatAttrsProxy.default, _emberViewsMixinsAria_role_support.default, {
|
44397
|
+
var View = _emberViewsViewsCore_view.default.extend(_emberViewsMixinsView_context_support.default, _emberViewsMixinsView_child_views_support.default, _emberViewsMixinsView_state_support.default, _emberViewsMixinsTemplate_rendering_support.default, _emberViewsMixinsClass_names_support.default, _emberViewsMixinsLegacy_view_support.default, _emberViewsMixinsInstrumentation_support.default, _emberViewsMixinsVisibility_support.default, _emberViewsCompatAttrsProxy.default, _emberViewsMixinsAria_role_support.default, (_CoreView$extend = {
|
44123
44398
|
concatenatedProperties: ['attributeBindings'],
|
44124
44399
|
|
44125
44400
|
/**
|
@@ -44687,176 +44962,121 @@ enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-metal/er
|
|
44687
44962
|
@private
|
44688
44963
|
*/
|
44689
44964
|
init: function () {
|
44965
|
+
this._super.apply(this, arguments);
|
44966
|
+
|
44690
44967
|
if (!this.elementId) {
|
44691
44968
|
this.elementId = _emberMetalUtils.guidFor(this);
|
44692
44969
|
}
|
44693
44970
|
|
44694
44971
|
this.scheduledRevalidation = false;
|
44695
44972
|
|
44696
|
-
this
|
44973
|
+
this[INIT_WAS_CALLED] = true;
|
44697
44974
|
|
44698
44975
|
if (!this._viewRegistry) {
|
44699
44976
|
this._viewRegistry = View.views;
|
44700
44977
|
}
|
44701
44978
|
|
44702
|
-
this.renderer.componentInitAttrs(this, this.attrs || {});
|
44703
|
-
|
44704
44979
|
_emberMetalCore.default.assert('Using a custom `.render` function is no longer supported.', !this.render);
|
44705
|
-
}
|
44706
|
-
|
44707
|
-
__defineNonEnumerable: function (property) {
|
44708
|
-
this[property.name] = property.descriptor.value;
|
44709
|
-
},
|
44710
|
-
|
44711
|
-
revalidate: function () {
|
44712
|
-
this.renderer.revalidateTopLevelView(this);
|
44713
|
-
this.scheduledRevalidation = false;
|
44714
|
-
},
|
44715
|
-
|
44716
|
-
scheduleRevalidate: function (node, label, manualRerender) {
|
44717
|
-
if (node && !this._dispatching && node.guid in this.env.renderedNodes) {
|
44718
|
-
if (manualRerender) {
|
44719
|
-
_emberMetalCore.default.deprecate('You manually rerendered ' + label + ' (a parent component) from a child component during the rendering process. This rarely worked in Ember 1.x and will be removed in Ember 2.0', false, { id: 'ember-views.manual-parent-rerender', until: '3.0.0' });
|
44720
|
-
} else {
|
44721
|
-
_emberMetalCore.default.deprecate('You modified ' + label + ' twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 2.0', false, { id: 'ember-views.render-double-modify', until: '3.0.0' });
|
44722
|
-
}
|
44723
|
-
_emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate);
|
44724
|
-
return;
|
44725
|
-
}
|
44726
|
-
|
44727
|
-
_emberMetalCore.default.deprecate('A property of ' + this + ' was modified inside the ' + this._dispatching + ' hook. You should never change properties on components, services or models during ' + this._dispatching + ' because it causes significant performance degradation.', !this._dispatching, { id: 'ember-views.dispatching-modify-property', until: '3.0.0' });
|
44728
|
-
|
44729
|
-
if (!this.scheduledRevalidation || this._dispatching) {
|
44730
|
-
this.scheduledRevalidation = true;
|
44731
|
-
_emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate);
|
44732
|
-
}
|
44733
|
-
},
|
44734
|
-
|
44735
|
-
templateRenderer: null,
|
44736
|
-
|
44737
|
-
/**
|
44738
|
-
Removes the view from its `parentView`, if one is found. Otherwise
|
44739
|
-
does nothing.
|
44740
|
-
@method removeFromParent
|
44741
|
-
@return {Ember.View} receiver
|
44742
|
-
@private
|
44743
|
-
*/
|
44744
|
-
removeFromParent: function () {
|
44745
|
-
var parent = this.parentView;
|
44980
|
+
}
|
44746
44981
|
|
44747
|
-
|
44748
|
-
|
44982
|
+
}, _CoreView$extend[_emberRuntimeSystemCore_object.POST_INIT] = function () {
|
44983
|
+
this._super.apply(this, arguments);
|
44749
44984
|
|
44750
|
-
|
44751
|
-
parent.removeChild(this);
|
44752
|
-
}
|
44753
|
-
return this;
|
44754
|
-
},
|
44985
|
+
_emberMetalCore.default.assert('You must call `this._super(...arguments);` when implementing `init` in a component. Please update ' + this + ' to call `this._super` from `init`.', this[INIT_WAS_CALLED]);
|
44755
44986
|
|
44756
|
-
|
44757
|
-
|
44758
|
-
|
44759
|
-
|
44760
|
-
|
44761
|
-
|
44762
|
-
|
44763
|
-
|
44764
|
-
|
44765
|
-
|
44766
|
-
|
44767
|
-
|
44768
|
-
|
44769
|
-
if (!this._super.apply(this, arguments)) {
|
44770
|
-
return;
|
44987
|
+
this.renderer.componentInitAttrs(this, this.attrs || {});
|
44988
|
+
}, _CoreView$extend.__defineNonEnumerable = function (property) {
|
44989
|
+
this[property.name] = property.descriptor.value;
|
44990
|
+
}, _CoreView$extend.revalidate = function () {
|
44991
|
+
this.renderer.revalidateTopLevelView(this);
|
44992
|
+
this.scheduledRevalidation = false;
|
44993
|
+
}, _CoreView$extend.scheduleRevalidate = function (node, label, manualRerender) {
|
44994
|
+
if (node && !this._dispatching && node.guid in this.env.renderedNodes) {
|
44995
|
+
if (manualRerender) {
|
44996
|
+
_emberMetalCore.default.deprecate('You manually rerendered ' + label + ' (a parent component) from a child component during the rendering process. This rarely worked in Ember 1.x and will be removed in Ember 2.0', false, { id: 'ember-views.manual-parent-rerender', until: '3.0.0' });
|
44997
|
+
} else {
|
44998
|
+
_emberMetalCore.default.deprecate('You modified ' + label + ' twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 2.0', false, { id: 'ember-views.render-double-modify', until: '3.0.0' });
|
44771
44999
|
}
|
45000
|
+
_emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate);
|
45001
|
+
return;
|
45002
|
+
}
|
44772
45003
|
|
44773
|
-
|
44774
|
-
if (viewName && parentView) {
|
44775
|
-
parentView.set(viewName, null);
|
44776
|
-
}
|
45004
|
+
_emberMetalCore.default.deprecate('A property of ' + this + ' was modified inside the ' + this._dispatching + ' hook. You should never change properties on components, services or models during ' + this._dispatching + ' because it causes significant performance degradation.', !this._dispatching, { id: 'ember-views.dispatching-modify-property', until: '3.0.0' });
|
44777
45005
|
|
44778
|
-
|
44779
|
-
|
44780
|
-
|
44781
|
-
|
45006
|
+
if (!this.scheduledRevalidation || this._dispatching) {
|
45007
|
+
this.scheduledRevalidation = true;
|
45008
|
+
_emberMetalRun_loop.default.scheduleOnce('render', this, this.revalidate);
|
45009
|
+
}
|
45010
|
+
}, _CoreView$extend.templateRenderer = null, _CoreView$extend.removeFromParent = function () {
|
45011
|
+
var parent = this.parentView;
|
44782
45012
|
|
44783
|
-
|
44784
|
-
|
45013
|
+
// Remove DOM element from parent
|
45014
|
+
this.remove();
|
44785
45015
|
|
44786
|
-
|
44787
|
-
|
44788
|
-
|
44789
|
-
|
44790
|
-
|
44791
|
-
|
44792
|
-
|
44793
|
-
|
44794
|
-
@param evt {Event}
|
44795
|
-
@private
|
44796
|
-
*/
|
44797
|
-
handleEvent: function (eventName, evt) {
|
44798
|
-
return this._currentState.handleEvent(this, eventName, evt);
|
44799
|
-
},
|
45016
|
+
if (parent) {
|
45017
|
+
parent.removeChild(this);
|
45018
|
+
}
|
45019
|
+
return this;
|
45020
|
+
}, _CoreView$extend.destroy = function () {
|
45021
|
+
// get parentView before calling super because it'll be destroyed
|
45022
|
+
var parentView = this.parentView;
|
45023
|
+
var viewName = this.viewName;
|
44800
45024
|
|
44801
|
-
|
44802
|
-
|
44803
|
-
|
44804
|
-
events.
|
44805
|
-
This method should only be called once the view has been inserted into the
|
44806
|
-
DOM.
|
44807
|
-
@method _register
|
44808
|
-
@private
|
44809
|
-
*/
|
44810
|
-
_register: function () {
|
44811
|
-
_emberMetalCore.default.assert('Attempted to register a view with an id already in use: ' + this.elementId, !this._viewRegistry[this.elementId]);
|
44812
|
-
this._viewRegistry[this.elementId] = this;
|
44813
|
-
},
|
45025
|
+
if (!this._super.apply(this, arguments)) {
|
45026
|
+
return;
|
45027
|
+
}
|
44814
45028
|
|
44815
|
-
|
44816
|
-
|
44817
|
-
|
44818
|
-
|
44819
|
-
@private
|
44820
|
-
*/
|
44821
|
-
_unregister: function () {
|
44822
|
-
delete this._viewRegistry[this.elementId];
|
44823
|
-
},
|
45029
|
+
// remove from non-virtual parent view if viewName was specified
|
45030
|
+
if (viewName && parentView) {
|
45031
|
+
parentView.set(viewName, null);
|
45032
|
+
}
|
44824
45033
|
|
44825
|
-
|
44826
|
-
|
44827
|
-
|
44828
|
-
|
44829
|
-
}
|
45034
|
+
// Destroy HTMLbars template
|
45035
|
+
if (this.lastResult) {
|
45036
|
+
this.lastResult.destroy();
|
45037
|
+
}
|
44830
45038
|
|
44831
|
-
|
44832
|
-
|
44833
|
-
|
45039
|
+
return this;
|
45040
|
+
}, _CoreView$extend.handleEvent = function (eventName, evt) {
|
45041
|
+
return this._currentState.handleEvent(this, eventName, evt);
|
45042
|
+
}, _CoreView$extend._register = function () {
|
45043
|
+
_emberMetalCore.default.assert('Attempted to register a view with an id already in use: ' + this.elementId, !this._viewRegistry[this.elementId]);
|
45044
|
+
this._viewRegistry[this.elementId] = this;
|
45045
|
+
}, _CoreView$extend._unregister = function () {
|
45046
|
+
delete this._viewRegistry[this.elementId];
|
45047
|
+
}, _CoreView$extend.registerObserver = function (root, path, target, observer) {
|
45048
|
+
if (!observer && 'function' === typeof target) {
|
45049
|
+
observer = target;
|
45050
|
+
target = null;
|
45051
|
+
}
|
44834
45052
|
|
44835
|
-
|
45053
|
+
if (!root || typeof root !== 'object') {
|
45054
|
+
return;
|
45055
|
+
}
|
44836
45056
|
|
44837
|
-
|
45057
|
+
var scheduledObserver = this._wrapAsScheduled(observer);
|
44838
45058
|
|
44839
|
-
|
44840
|
-
_emberMetalObserver.removeObserver(root, path, target, scheduledObserver);
|
44841
|
-
});
|
44842
|
-
},
|
45059
|
+
_emberMetalObserver.addObserver(root, path, target, scheduledObserver);
|
44843
45060
|
|
44844
|
-
|
44845
|
-
|
44846
|
-
|
44847
|
-
|
44848
|
-
|
44849
|
-
|
44850
|
-
|
44851
|
-
|
44852
|
-
|
44853
|
-
|
44854
|
-
|
45061
|
+
this.one('willClearRender', function () {
|
45062
|
+
_emberMetalObserver.removeObserver(root, path, target, scheduledObserver);
|
45063
|
+
});
|
45064
|
+
}, _CoreView$extend._wrapAsScheduled = function (fn) {
|
45065
|
+
var view = this;
|
45066
|
+
var stateCheckedFn = function () {
|
45067
|
+
view._currentState.invokeObserver(this, fn);
|
45068
|
+
};
|
45069
|
+
var scheduledFn = function () {
|
45070
|
+
_emberMetalRun_loop.default.scheduleOnce('render', this, stateCheckedFn);
|
45071
|
+
};
|
45072
|
+
return scheduledFn;
|
45073
|
+
}, _CoreView$extend));
|
44855
45074
|
// jscs:enable validateIndentation
|
44856
45075
|
|
44857
45076
|
_emberMetalDeprecate_property.deprecateProperty(View.prototype, 'currentState', '_currentState', {
|
44858
45077
|
id: 'ember-view.current-state',
|
44859
|
-
until: '2.3.0'
|
45078
|
+
until: '2.3.0',
|
45079
|
+
url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-component-currentstate'
|
44860
45080
|
});
|
44861
45081
|
|
44862
45082
|
/*
|
@@ -44934,6 +45154,61 @@ enifed('ember-views/views/view', ['exports', 'ember-metal/core', 'ember-metal/er
|
|
44934
45154
|
exports.DeprecatedView = DeprecatedView;
|
44935
45155
|
});
|
44936
45156
|
// for the side effect of extending Ember.run.queues
|
45157
|
+
|
45158
|
+
/*
|
45159
|
+
This is a special hook implemented in CoreObject, that allows Views/Components
|
45160
|
+
to have a way to ensure that `init` fires before `didInitAttrs` / `didReceiveAttrs`
|
45161
|
+
(so that `this._super` in init does not trigger `didReceiveAttrs` before the classes
|
45162
|
+
own `init` is finished).
|
45163
|
+
@method __postInitInitialization
|
45164
|
+
@private
|
45165
|
+
*/
|
45166
|
+
|
45167
|
+
/**
|
45168
|
+
Removes the view from its `parentView`, if one is found. Otherwise
|
45169
|
+
does nothing.
|
45170
|
+
@method removeFromParent
|
45171
|
+
@return {Ember.View} receiver
|
45172
|
+
@private
|
45173
|
+
*/
|
45174
|
+
|
45175
|
+
/**
|
45176
|
+
You must call `destroy` on a view to destroy the view (and all of its
|
45177
|
+
child views). This will remove the view from any parent node, then make
|
45178
|
+
sure that the DOM element managed by the view can be released by the
|
45179
|
+
memory manager.
|
45180
|
+
@method destroy
|
45181
|
+
@private
|
45182
|
+
*/
|
45183
|
+
|
45184
|
+
// .......................................................
|
45185
|
+
// EVENT HANDLING
|
45186
|
+
//
|
45187
|
+
|
45188
|
+
/**
|
45189
|
+
Handle events from `Ember.EventDispatcher`
|
45190
|
+
@method handleEvent
|
45191
|
+
@param eventName {String}
|
45192
|
+
@param evt {Event}
|
45193
|
+
@private
|
45194
|
+
*/
|
45195
|
+
|
45196
|
+
/**
|
45197
|
+
Registers the view in the view registry, keyed on the view's `elementId`.
|
45198
|
+
This is used by the EventDispatcher to locate the view in response to
|
45199
|
+
events.
|
45200
|
+
This method should only be called once the view has been inserted into the
|
45201
|
+
DOM.
|
45202
|
+
@method _register
|
45203
|
+
@private
|
45204
|
+
*/
|
45205
|
+
|
45206
|
+
/**
|
45207
|
+
Removes the view from the view registry. This should be called when the
|
45208
|
+
view is removed from DOM.
|
45209
|
+
@method _unregister
|
45210
|
+
@private
|
45211
|
+
*/
|
44937
45212
|
enifed('ember', ['exports', 'ember-metal', 'ember-runtime', 'ember-views', 'ember-routing', 'ember-application', 'ember-extension-support', 'ember-htmlbars', 'ember-routing-htmlbars', 'ember-routing-views', 'ember-metal/core', 'ember-runtime/system/lazy_load'], function (exports, _emberMetal, _emberRuntime, _emberViews, _emberRouting, _emberApplication, _emberExtensionSupport, _emberHtmlbars, _emberRoutingHtmlbars, _emberRoutingViews, _emberMetalCore, _emberRuntimeSystemLazy_load) {
|
44938
45213
|
// require the main entry points for each of these packages
|
44939
45214
|
// this is so that the global exports occur properly
|