ember-source 1.4.0 → 1.5.0.beta.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-data-deps.js +543 -263
- data/dist/ember-data-deps.min.js +5 -5
- data/dist/ember-data-deps.prod.js +538 -259
- data/dist/ember-debug.js +1 -4
- data/dist/ember-runtime.js +543 -263
- data/dist/ember-runtime.min.js +5 -5
- data/dist/ember-runtime.prod.js +538 -259
- data/dist/ember-spade.js +2 -2
- data/dist/ember-template-compiler.js +2 -9
- data/dist/ember-template-compiler.min.js +2 -2
- data/dist/ember-template-compiler.prod.js +2 -9
- data/dist/ember-tests.js +3 -2
- data/dist/ember.js +1483 -572
- data/dist/ember.min.js +11 -10
- data/dist/ember.prod.js +1353 -546
- metadata +3 -3
data/dist/ember-debug.js
CHANGED
@@ -7,7 +7,7 @@ var Ember = { assert: function() {}, FEATURES: { isEnabled: function() {} } };
|
|
7
7
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
8
8
|
* @license Licensed under MIT license
|
9
9
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
10
|
-
* @version 1.
|
10
|
+
* @version 1.5.0-beta.1
|
11
11
|
*/
|
12
12
|
|
13
13
|
|
@@ -119,9 +119,6 @@ Ember.debug = function(message) {
|
|
119
119
|
will be displayed.
|
120
120
|
*/
|
121
121
|
Ember.deprecate = function(message, test) {
|
122
|
-
if (Ember.TESTING_DEPRECATION) { return; }
|
123
|
-
|
124
|
-
if (arguments.length === 1) { test = false; }
|
125
122
|
if (test) { return; }
|
126
123
|
|
127
124
|
if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new Ember.Error(message); }
|
data/dist/ember-runtime.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 1.
|
8
|
+
* @version 1.5.0-beta.1
|
9
9
|
*/
|
10
10
|
|
11
11
|
|
@@ -117,9 +117,6 @@ Ember.debug = function(message) {
|
|
117
117
|
will be displayed.
|
118
118
|
*/
|
119
119
|
Ember.deprecate = function(message, test) {
|
120
|
-
if (Ember.TESTING_DEPRECATION) { return; }
|
121
|
-
|
122
|
-
if (arguments.length === 1) { test = false; }
|
123
120
|
if (test) { return; }
|
124
121
|
|
125
122
|
if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new Ember.Error(message); }
|
@@ -209,7 +206,7 @@ if (!Ember.testing) {
|
|
209
206
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
210
207
|
* @license Licensed under MIT license
|
211
208
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
212
|
-
* @version 1.
|
209
|
+
* @version 1.5.0-beta.1.1
|
213
210
|
*/
|
214
211
|
|
215
212
|
|
@@ -292,7 +289,7 @@ var define, requireModule, require, requirejs;
|
|
292
289
|
|
293
290
|
@class Ember
|
294
291
|
@static
|
295
|
-
@version 1.
|
292
|
+
@version 1.5.0-beta.1
|
296
293
|
*/
|
297
294
|
|
298
295
|
if ('undefined' === typeof Ember) {
|
@@ -319,10 +316,10 @@ Ember.toString = function() { return "Ember"; };
|
|
319
316
|
/**
|
320
317
|
@property VERSION
|
321
318
|
@type String
|
322
|
-
@default '1.
|
319
|
+
@default '1.5.0-beta.1'
|
323
320
|
@static
|
324
321
|
*/
|
325
|
-
Ember.VERSION = '1.
|
322
|
+
Ember.VERSION = '1.5.0-beta.1';
|
326
323
|
|
327
324
|
/**
|
328
325
|
Standard environmental variables. You can define these in a global `EmberENV`
|
@@ -552,7 +549,34 @@ Ember.none = Ember.deprecateFunc("Ember.none is deprecated. Please use Ember.isN
|
|
552
549
|
Ember.isEmpty = function(obj) {
|
553
550
|
return Ember.isNone(obj) || (obj.length === 0 && typeof obj !== 'function') || (typeof obj === 'object' && Ember.get(obj, 'length') === 0);
|
554
551
|
};
|
555
|
-
Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty)
|
552
|
+
Ember.empty = Ember.deprecateFunc("Ember.empty is deprecated. Please use Ember.isEmpty instead.", Ember.isEmpty);
|
553
|
+
|
554
|
+
|
555
|
+
/**
|
556
|
+
A value is blank if it is empty or a whitespace string.
|
557
|
+
|
558
|
+
```javascript
|
559
|
+
Ember.isBlank(); // true
|
560
|
+
Ember.isBlank(null); // true
|
561
|
+
Ember.isBlank(undefined); // true
|
562
|
+
Ember.isBlank(''); // true
|
563
|
+
Ember.isBlank([]); // true
|
564
|
+
Ember.isBlank('\n\t'); // true
|
565
|
+
Ember.isBlank(' '); // true
|
566
|
+
Ember.isBlank({}); // false
|
567
|
+
Ember.isBlank('\n\t Hello'); // false
|
568
|
+
Ember.isBlank('Hello world'); // false
|
569
|
+
Ember.isBlank([1,2,3]); // false
|
570
|
+
```
|
571
|
+
|
572
|
+
@method isBlank
|
573
|
+
@for Ember
|
574
|
+
@param {Object} obj Value to test
|
575
|
+
@return {Boolean}
|
576
|
+
*/
|
577
|
+
Ember.isBlank = function(obj) {
|
578
|
+
return Ember.isEmpty(obj) || (typeof obj === 'string' && obj.match(/\S/) === null);
|
579
|
+
};
|
556
580
|
|
557
581
|
|
558
582
|
})();
|
@@ -797,19 +821,35 @@ var arrayIndexOf = isNativeFunc(Array.prototype.indexOf) ? Array.prototype.index
|
|
797
821
|
return -1;
|
798
822
|
};
|
799
823
|
|
824
|
+
var arrayFilter = isNativeFunc(Array.prototype.filter) ? Array.prototype.filter : function (fn, context) {
|
825
|
+
var i,
|
826
|
+
value,
|
827
|
+
result = [],
|
828
|
+
length = this.length;
|
829
|
+
|
830
|
+
for (i = 0; i < length; i++) {
|
831
|
+
if (this.hasOwnProperty(i)) {
|
832
|
+
value = this[i];
|
833
|
+
if (fn.call(context, value, i, this)) {
|
834
|
+
result.push(value);
|
835
|
+
}
|
836
|
+
}
|
837
|
+
}
|
838
|
+
return result;
|
839
|
+
};
|
800
840
|
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
@namespace Ember
|
805
|
-
@property ArrayPolyfills
|
806
|
-
*/
|
807
|
-
Ember.ArrayPolyfills = {
|
808
|
-
map: arrayMap,
|
809
|
-
forEach: arrayForEach,
|
810
|
-
indexOf: arrayIndexOf
|
811
|
-
};
|
841
|
+
/**
|
842
|
+
Array polyfills to support ES5 features in older browsers.
|
812
843
|
|
844
|
+
@namespace Ember
|
845
|
+
@property ArrayPolyfills
|
846
|
+
*/
|
847
|
+
Ember.ArrayPolyfills = {
|
848
|
+
map: arrayMap,
|
849
|
+
forEach: arrayForEach,
|
850
|
+
filter: arrayFilter,
|
851
|
+
indexOf: arrayIndexOf
|
852
|
+
};
|
813
853
|
|
814
854
|
if (Ember.SHIM_ES5) {
|
815
855
|
if (!Array.prototype.map) {
|
@@ -820,6 +860,10 @@ if (Ember.SHIM_ES5) {
|
|
820
860
|
Array.prototype.forEach = arrayForEach;
|
821
861
|
}
|
822
862
|
|
863
|
+
if (!Array.prototype.filter) {
|
864
|
+
Array.prototype.filter = arrayFilter;
|
865
|
+
}
|
866
|
+
|
823
867
|
if (!Array.prototype.indexOf) {
|
824
868
|
Array.prototype.indexOf = arrayIndexOf;
|
825
869
|
}
|
@@ -885,29 +929,6 @@ Ember.Error.prototype = Ember.create(Error.prototype);
|
|
885
929
|
*/
|
886
930
|
Ember.onerror = null;
|
887
931
|
|
888
|
-
/**
|
889
|
-
Wrap code block in a try/catch if `Ember.onerror` is set.
|
890
|
-
|
891
|
-
@private
|
892
|
-
@method handleErrors
|
893
|
-
@for Ember
|
894
|
-
@param {Function} func
|
895
|
-
@param [context]
|
896
|
-
*/
|
897
|
-
Ember.handleErrors = function(func, context) {
|
898
|
-
// Unfortunately in some browsers we lose the backtrace if we rethrow the existing error,
|
899
|
-
// so in the event that we don't have an `onerror` handler we don't wrap in a try/catch
|
900
|
-
if ('function' === typeof Ember.onerror) {
|
901
|
-
try {
|
902
|
-
return func.call(context || this);
|
903
|
-
} catch (error) {
|
904
|
-
Ember.onerror(error);
|
905
|
-
}
|
906
|
-
} else {
|
907
|
-
return func.call(context || this);
|
908
|
-
}
|
909
|
-
};
|
910
|
-
|
911
932
|
})();
|
912
933
|
|
913
934
|
|
@@ -928,9 +949,9 @@ var o_defineProperty = Ember.platform.defineProperty,
|
|
928
949
|
o_create = Ember.create,
|
929
950
|
// Used for guid generation...
|
930
951
|
GUID_KEY = '__ember'+ (+ new Date()),
|
931
|
-
uuid = 0,
|
932
952
|
numberCache = [],
|
933
|
-
stringCache = {}
|
953
|
+
stringCache = {},
|
954
|
+
uuid = 0;
|
934
955
|
|
935
956
|
var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
|
936
957
|
|
@@ -978,8 +999,12 @@ Ember.generateGuid = function generateGuid(obj, prefix) {
|
|
978
999
|
if (!prefix) prefix = Ember.GUID_PREFIX;
|
979
1000
|
var ret = (prefix + (uuid++));
|
980
1001
|
if (obj) {
|
981
|
-
|
982
|
-
|
1002
|
+
if (obj[GUID_KEY] === null) {
|
1003
|
+
obj[GUID_KEY] = ret;
|
1004
|
+
} else {
|
1005
|
+
GUID_DESC.value = ret;
|
1006
|
+
o_defineProperty(obj, GUID_KEY, GUID_DESC);
|
1007
|
+
}
|
983
1008
|
}
|
984
1009
|
return ret;
|
985
1010
|
};
|
@@ -1026,9 +1051,14 @@ Ember.guidFor = function guidFor(obj) {
|
|
1026
1051
|
if (obj[GUID_KEY]) return obj[GUID_KEY];
|
1027
1052
|
if (obj === Object) return '(Object)';
|
1028
1053
|
if (obj === Array) return '(Array)';
|
1029
|
-
ret = 'ember'+(uuid++);
|
1030
|
-
|
1031
|
-
|
1054
|
+
ret = 'ember' + (uuid++);
|
1055
|
+
|
1056
|
+
if (obj[GUID_KEY] === null) {
|
1057
|
+
obj[GUID_KEY] = ret;
|
1058
|
+
} else {
|
1059
|
+
GUID_DESC.value = ret;
|
1060
|
+
o_defineProperty(obj, GUID_KEY, GUID_DESC);
|
1061
|
+
}
|
1032
1062
|
return ret;
|
1033
1063
|
}
|
1034
1064
|
};
|
@@ -1231,13 +1261,11 @@ Ember.metaPath = function metaPath(obj, path, writable) {
|
|
1231
1261
|
@return {Function} wrapped function.
|
1232
1262
|
*/
|
1233
1263
|
Ember.wrap = function(func, superFunc) {
|
1234
|
-
function K() {}
|
1235
|
-
|
1236
1264
|
function superWrapper() {
|
1237
|
-
var ret, sup = this.
|
1238
|
-
this.
|
1265
|
+
var ret, sup = this.__nextSuper;
|
1266
|
+
this.__nextSuper = superFunc;
|
1239
1267
|
ret = func.apply(this, arguments);
|
1240
|
-
this.
|
1268
|
+
this.__nextSuper = sup;
|
1241
1269
|
return ret;
|
1242
1270
|
}
|
1243
1271
|
|
@@ -2250,8 +2278,13 @@ var o_create = Ember.create,
|
|
2250
2278
|
|
2251
2279
|
function indexOf(array, target, method) {
|
2252
2280
|
var index = -1;
|
2253
|
-
|
2254
|
-
|
2281
|
+
// hashes are added to the end of the event array
|
2282
|
+
// so it makes sense to start searching at the end
|
2283
|
+
// of the array and search in reverse
|
2284
|
+
for (var i = array.length - 3 ; i >=0; i -= 3) {
|
2285
|
+
if (target === array[i] && method === array[i + 1]) {
|
2286
|
+
index = i; break;
|
2287
|
+
}
|
2255
2288
|
}
|
2256
2289
|
return index;
|
2257
2290
|
}
|
@@ -2406,9 +2439,10 @@ function removeListener(obj, eventName, target, method) {
|
|
2406
2439
|
an object might suspend its property change listener while it is
|
2407
2440
|
setting that property.
|
2408
2441
|
|
2409
|
-
@private
|
2410
2442
|
@method suspendListener
|
2411
2443
|
@for Ember
|
2444
|
+
|
2445
|
+
@private
|
2412
2446
|
@param obj
|
2413
2447
|
@param {String} eventName
|
2414
2448
|
@param {Object|Function} targetOrMethod A target object or a function
|
@@ -2437,9 +2471,10 @@ function suspendListener(obj, eventName, target, method, callback) {
|
|
2437
2471
|
/**
|
2438
2472
|
Suspends multiple listeners during a callback.
|
2439
2473
|
|
2440
|
-
@private
|
2441
2474
|
@method suspendListeners
|
2442
2475
|
@for Ember
|
2476
|
+
|
2477
|
+
@private
|
2443
2478
|
@param obj
|
2444
2479
|
@param {Array} eventName Array of event names
|
2445
2480
|
@param {Object|Function} targetOrMethod A target object or a function
|
@@ -3456,7 +3491,7 @@ function consoleMethod(name) {
|
|
3456
3491
|
|
3457
3492
|
if (method) {
|
3458
3493
|
// Older IE doesn't support apply, but Chrome needs it
|
3459
|
-
if (method.apply) {
|
3494
|
+
if (typeof method.apply === 'function') {
|
3460
3495
|
logToConsole = function() {
|
3461
3496
|
method.apply(consoleObj, arguments);
|
3462
3497
|
};
|
@@ -3700,7 +3735,12 @@ Ember.defineProperty = function(obj, keyName, desc, data, meta) {
|
|
3700
3735
|
obj[keyName] = undefined; // make enumerable
|
3701
3736
|
}
|
3702
3737
|
|
3703
|
-
|
3738
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
3739
|
+
if (desc.func && desc._dependentCPs) {
|
3740
|
+
addImplicitCPs(obj, desc._dependentCPs, meta);
|
3741
|
+
}
|
3742
|
+
}
|
3743
|
+
} else {
|
3704
3744
|
descs[keyName] = undefined; // shadow descriptor in proto
|
3705
3745
|
if (desc == null) {
|
3706
3746
|
value = data;
|
@@ -3735,6 +3775,22 @@ Ember.defineProperty = function(obj, keyName, desc, data, meta) {
|
|
3735
3775
|
return this;
|
3736
3776
|
};
|
3737
3777
|
|
3778
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
3779
|
+
var addImplicitCPs = function defineImplicitCPs(obj, implicitCPs, meta) {
|
3780
|
+
var cp, key, length = implicitCPs.length;
|
3781
|
+
|
3782
|
+
for (var i=0; i<length; ++i) {
|
3783
|
+
cp = implicitCPs[i];
|
3784
|
+
key = cp.implicitCPKey;
|
3785
|
+
|
3786
|
+
Ember.defineProperty(obj, key, cp, undefined, meta);
|
3787
|
+
|
3788
|
+
if (cp._dependentCPs) {
|
3789
|
+
addImplicitCPs(obj, cp._dependentCPs, meta);
|
3790
|
+
}
|
3791
|
+
}
|
3792
|
+
};
|
3793
|
+
}
|
3738
3794
|
|
3739
3795
|
})();
|
3740
3796
|
|
@@ -4471,6 +4527,7 @@ var get = Ember.get,
|
|
4471
4527
|
|
4472
4528
|
var expandProperties = Ember.expandProperties;
|
4473
4529
|
|
4530
|
+
|
4474
4531
|
// ..........................................................
|
4475
4532
|
// DEPENDENT KEYS
|
4476
4533
|
//
|
@@ -4629,19 +4686,36 @@ function removeDependentKeys(desc, obj, keyName, meta) {
|
|
4629
4686
|
*/
|
4630
4687
|
function ComputedProperty(func, opts) {
|
4631
4688
|
this.func = func;
|
4632
|
-
|
4689
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
4690
|
+
setDependentKeys(this, opts && opts.dependentKeys);
|
4691
|
+
} else {
|
4633
4692
|
this._dependentKeys = opts && opts.dependentKeys;
|
4634
|
-
|
4693
|
+
}
|
4635
4694
|
|
4636
4695
|
this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : true;
|
4637
4696
|
this._readOnly = opts && (opts.readOnly !== undefined || !!opts.readOnly);
|
4638
4697
|
}
|
4639
4698
|
|
4640
4699
|
Ember.ComputedProperty = ComputedProperty;
|
4700
|
+
|
4641
4701
|
ComputedProperty.prototype = new Ember.Descriptor();
|
4642
4702
|
|
4643
4703
|
var ComputedPropertyPrototype = ComputedProperty.prototype;
|
4704
|
+
ComputedPropertyPrototype._dependentKeys = undefined;
|
4705
|
+
ComputedPropertyPrototype._suspended = undefined;
|
4706
|
+
ComputedPropertyPrototype._meta = undefined;
|
4644
4707
|
|
4708
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
4709
|
+
ComputedPropertyPrototype._dependentCPs = undefined;
|
4710
|
+
ComputedPropertyPrototype.implicitCPKey = undefined;
|
4711
|
+
|
4712
|
+
ComputedPropertyPrototype.toString = function() {
|
4713
|
+
if (this.implicitCPKey) {
|
4714
|
+
return this.implicitCPKey;
|
4715
|
+
}
|
4716
|
+
return Ember.Descriptor.prototype.toString.apply(this, arguments);
|
4717
|
+
};
|
4718
|
+
}
|
4645
4719
|
|
4646
4720
|
/**
|
4647
4721
|
Properties are cacheable by default. Computed property will automatically
|
@@ -4746,9 +4820,11 @@ ComputedPropertyPrototype.property = function() {
|
|
4746
4820
|
expandProperties(arguments[i], addArg);
|
4747
4821
|
}
|
4748
4822
|
|
4749
|
-
|
4823
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
4824
|
+
setDependentKeys(this, args);
|
4825
|
+
} else {
|
4750
4826
|
this._dependentKeys = args;
|
4751
|
-
|
4827
|
+
}
|
4752
4828
|
|
4753
4829
|
return this;
|
4754
4830
|
};
|
@@ -5010,8 +5086,74 @@ function getProperties(self, propertyNames) {
|
|
5010
5086
|
|
5011
5087
|
var registerComputed, registerComputedWithProperties;
|
5012
5088
|
|
5089
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
5090
|
+
var guidFor = Ember.guidFor,
|
5091
|
+
map = Ember.EnumerableUtils.map,
|
5092
|
+
filter = Ember.EnumerableUtils.filter,
|
5093
|
+
typeOf = Ember.typeOf;
|
5094
|
+
|
5095
|
+
var implicitKey = function (cp) {
|
5096
|
+
return [guidFor(cp)].concat(cp._dependentKeys).join('_').replace(/\./g, '_DOT_');
|
5097
|
+
};
|
5013
5098
|
|
5099
|
+
var normalizeDependentKey = function (key) {
|
5100
|
+
if (key instanceof Ember.ComputedProperty) {
|
5101
|
+
return implicitKey(key);
|
5102
|
+
} else {
|
5103
|
+
return key;
|
5104
|
+
}
|
5105
|
+
};
|
5014
5106
|
|
5107
|
+
var normalizeDependentKeys = function (keys) {
|
5108
|
+
return map(keys, function (key) {
|
5109
|
+
return normalizeDependentKey(key);
|
5110
|
+
});
|
5111
|
+
};
|
5112
|
+
|
5113
|
+
var selectDependentCPs = function (keys) {
|
5114
|
+
return filter(keys, function (key) {
|
5115
|
+
return key instanceof Ember.ComputedProperty;
|
5116
|
+
});
|
5117
|
+
};
|
5118
|
+
|
5119
|
+
var setDependentKeys = function(cp, dependentKeys) {
|
5120
|
+
if (dependentKeys) {
|
5121
|
+
cp._dependentKeys = normalizeDependentKeys(dependentKeys);
|
5122
|
+
cp._dependentCPs = selectDependentCPs(dependentKeys);
|
5123
|
+
} else {
|
5124
|
+
cp._dependentKeys = cp._dependentCPs = [];
|
5125
|
+
}
|
5126
|
+
cp.implicitCPKey = implicitKey(cp);
|
5127
|
+
};
|
5128
|
+
// expose `normalizeDependentKey[s]` so user CP macros can easily support
|
5129
|
+
// composition
|
5130
|
+
Ember.computed.normalizeDependentKey = normalizeDependentKey;
|
5131
|
+
Ember.computed.normalizeDependentKeys = normalizeDependentKeys;
|
5132
|
+
|
5133
|
+
registerComputed = function (name, macro) {
|
5134
|
+
Ember.computed[name] = function(dependentKey) {
|
5135
|
+
var args = normalizeDependentKeys(a_slice.call(arguments));
|
5136
|
+
return Ember.computed(dependentKey, function() {
|
5137
|
+
return macro.apply(this, args);
|
5138
|
+
});
|
5139
|
+
};
|
5140
|
+
};
|
5141
|
+
}
|
5142
|
+
|
5143
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
5144
|
+
registerComputedWithProperties = function(name, macro) {
|
5145
|
+
Ember.computed[name] = function() {
|
5146
|
+
var args = a_slice.call(arguments);
|
5147
|
+
var properties = normalizeDependentKeys(args);
|
5148
|
+
|
5149
|
+
var computed = Ember.computed(function() {
|
5150
|
+
return macro.apply(this, [getProperties(this, properties)]);
|
5151
|
+
});
|
5152
|
+
|
5153
|
+
return computed.property.apply(computed, args);
|
5154
|
+
};
|
5155
|
+
};
|
5156
|
+
} else {
|
5015
5157
|
registerComputed = function (name, macro) {
|
5016
5158
|
Ember.computed[name] = function(dependentKey) {
|
5017
5159
|
var args = a_slice.call(arguments);
|
@@ -5032,39 +5174,48 @@ var registerComputed, registerComputedWithProperties;
|
|
5032
5174
|
return computed.property.apply(computed, properties);
|
5033
5175
|
};
|
5034
5176
|
};
|
5177
|
+
}
|
5035
5178
|
|
5036
5179
|
|
5180
|
+
if (Ember.FEATURES.isEnabled('composable-computed-properties')) {
|
5181
|
+
Ember.computed.literal = function (value) {
|
5182
|
+
return Ember.computed(function () {
|
5183
|
+
return value;
|
5184
|
+
});
|
5185
|
+
};
|
5186
|
+
}
|
5037
5187
|
|
5038
5188
|
|
5039
|
-
/**
|
5040
|
-
|
5041
|
-
|
5189
|
+
/**
|
5190
|
+
A computed property that returns true if the value of the dependent
|
5191
|
+
property is null, an empty string, empty array, or empty function.
|
5042
5192
|
|
5043
|
-
|
5044
|
-
|
5045
|
-
|
5193
|
+
Note: When using `Ember.computed.empty` to watch an array make sure to
|
5194
|
+
use the `array.[]` syntax so the computed can subscribe to transitions
|
5195
|
+
from empty to non-empty states.
|
5046
5196
|
|
5047
|
-
|
5197
|
+
Example
|
5048
5198
|
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5199
|
+
```javascript
|
5200
|
+
var ToDoList = Ember.Object.extend({
|
5201
|
+
done: Ember.computed.empty('todos.[]') // detect array changes
|
5202
|
+
});
|
5203
|
+
var todoList = ToDoList.create({todos: ['Unit Test', 'Documentation', 'Release']});
|
5204
|
+
todoList.get('done'); // false
|
5205
|
+
todoList.get('todos').clear(); // []
|
5206
|
+
todoList.get('done'); // true
|
5207
|
+
```
|
5208
|
+
|
5209
|
+
@method computed.empty
|
5210
|
+
@for Ember
|
5211
|
+
@param {String} dependentKey
|
5212
|
+
@return {Ember.ComputedProperty} computed property which negate
|
5213
|
+
the original value for property
|
5214
|
+
*/
|
5215
|
+
registerComputed('empty', function(dependentKey) {
|
5216
|
+
return Ember.isEmpty(get(this, dependentKey));
|
5052
5217
|
});
|
5053
|
-
var todoList = ToDoList.create({todos: ['Unit Test', 'Documentation', 'Release']});
|
5054
|
-
todoList.get('done'); // false
|
5055
|
-
todoList.get('todos').clear(); // []
|
5056
|
-
todoList.get('done'); // true
|
5057
|
-
```
|
5058
5218
|
|
5059
|
-
@method computed.empty
|
5060
|
-
@for Ember
|
5061
|
-
@param {String} dependentKey
|
5062
|
-
@return {Ember.ComputedProperty} computed property which negate
|
5063
|
-
the original value for property
|
5064
|
-
*/
|
5065
|
-
registerComputed('empty', function(dependentKey) {
|
5066
|
-
return Ember.isEmpty(get(this, dependentKey));
|
5067
|
-
});
|
5068
5219
|
|
5069
5220
|
/**
|
5070
5221
|
A computed property that returns true if the value of the dependent
|
@@ -5565,6 +5716,52 @@ Ember.computed.oneWay = function(dependentKey) {
|
|
5565
5716
|
});
|
5566
5717
|
};
|
5567
5718
|
|
5719
|
+
|
5720
|
+
|
5721
|
+
/**
|
5722
|
+
Where `computed.oneWay` provides oneWay bindings, `computed.readOnly` provides
|
5723
|
+
a readOnly one way binding. Very often when using `computed.oneWay` one does
|
5724
|
+
not also want changes to propogate back up, as they will replace the value.
|
5725
|
+
|
5726
|
+
This prevents the reverse flow, and also throws an exception when it occurs.
|
5727
|
+
|
5728
|
+
Example
|
5729
|
+
|
5730
|
+
```javascript
|
5731
|
+
User = Ember.Object.extend({
|
5732
|
+
firstName: null,
|
5733
|
+
lastName: null,
|
5734
|
+
nickName: Ember.computed.readOnly('firstName')
|
5735
|
+
});
|
5736
|
+
|
5737
|
+
user = User.create({
|
5738
|
+
firstName: 'Teddy',
|
5739
|
+
lastName: 'Zeenny'
|
5740
|
+
});
|
5741
|
+
|
5742
|
+
user.get('nickName');
|
5743
|
+
# 'Teddy'
|
5744
|
+
|
5745
|
+
user.set('nickName', 'TeddyBear');
|
5746
|
+
# throws Exception
|
5747
|
+
# throw new Ember.Error('Cannot Set: nickName on: <User:ember27288>' );`
|
5748
|
+
|
5749
|
+
user.get('firstName');
|
5750
|
+
# 'Teddy'
|
5751
|
+
```
|
5752
|
+
|
5753
|
+
@method computed.readOnly
|
5754
|
+
@for Ember
|
5755
|
+
@param {String} dependentKey
|
5756
|
+
@return {Ember.ComputedProperty} computed property which creates a
|
5757
|
+
one way computed property to the original value for property.
|
5758
|
+
*/
|
5759
|
+
Ember.computed.readOnly = function(dependentKey) {
|
5760
|
+
return Ember.computed(dependentKey, function() {
|
5761
|
+
return get(this, dependentKey);
|
5762
|
+
}).readOnly();
|
5763
|
+
};
|
5764
|
+
|
5568
5765
|
/**
|
5569
5766
|
A computed property that acts like a standard getter and setter,
|
5570
5767
|
but returns the value at the provided `defaultPath` if the
|
@@ -5713,7 +5910,7 @@ Ember.removeBeforeObserver = function(obj, _path, target, method) {
|
|
5713
5910
|
|
5714
5911
|
|
5715
5912
|
(function() {
|
5716
|
-
define("backburner/queue",
|
5913
|
+
define("backburner/queue",
|
5717
5914
|
["exports"],
|
5718
5915
|
function(__exports__) {
|
5719
5916
|
"use strict";
|
@@ -5820,11 +6017,10 @@ define("backburner/queue",
|
|
5820
6017
|
}
|
5821
6018
|
};
|
5822
6019
|
|
5823
|
-
|
5824
6020
|
__exports__.Queue = Queue;
|
5825
6021
|
});
|
5826
6022
|
|
5827
|
-
define("backburner/deferred_action_queues",
|
6023
|
+
define("backburner/deferred_action_queues",
|
5828
6024
|
["backburner/queue","exports"],
|
5829
6025
|
function(__dependency1__, __exports__) {
|
5830
6026
|
"use strict";
|
@@ -5923,11 +6119,10 @@ define("backburner/deferred_action_queues",
|
|
5923
6119
|
return -1;
|
5924
6120
|
}
|
5925
6121
|
|
5926
|
-
|
5927
6122
|
__exports__.DeferredActionQueues = DeferredActionQueues;
|
5928
6123
|
});
|
5929
6124
|
|
5930
|
-
define("backburner",
|
6125
|
+
define("backburner",
|
5931
6126
|
["backburner/deferred_action_queues","exports"],
|
5932
6127
|
function(__dependency1__, __exports__) {
|
5933
6128
|
"use strict";
|
@@ -6128,24 +6323,39 @@ define("backburner",
|
|
6128
6323
|
return fn;
|
6129
6324
|
},
|
6130
6325
|
|
6131
|
-
throttle: function(target, method /* , args, wait */) {
|
6326
|
+
throttle: function(target, method /* , args, wait, [immediate] */) {
|
6132
6327
|
var self = this,
|
6133
6328
|
args = arguments,
|
6134
|
-
|
6329
|
+
immediate = pop.call(args),
|
6330
|
+
wait,
|
6135
6331
|
throttler,
|
6136
6332
|
index,
|
6137
6333
|
timer;
|
6138
6334
|
|
6335
|
+
if (typeof immediate === "number" || typeof immediate === "string") {
|
6336
|
+
wait = immediate;
|
6337
|
+
immediate = true;
|
6338
|
+
} else {
|
6339
|
+
wait = pop.call(args);
|
6340
|
+
}
|
6341
|
+
|
6342
|
+
wait = parseInt(wait, 10);
|
6343
|
+
|
6139
6344
|
index = findThrottler(target, method);
|
6140
6345
|
if (index > -1) { return throttlers[index]; } // throttled
|
6141
6346
|
|
6142
6347
|
timer = global.setTimeout(function() {
|
6143
|
-
|
6144
|
-
|
6348
|
+
if (!immediate) {
|
6349
|
+
self.run.apply(self, args);
|
6350
|
+
}
|
6145
6351
|
var index = findThrottler(target, method);
|
6146
6352
|
if (index > -1) { throttlers.splice(index, 1); }
|
6147
6353
|
}, wait);
|
6148
6354
|
|
6355
|
+
if (immediate) {
|
6356
|
+
self.run.apply(self, args);
|
6357
|
+
}
|
6358
|
+
|
6149
6359
|
throttler = [target, method, timer];
|
6150
6360
|
|
6151
6361
|
throttlers.push(throttler);
|
@@ -6242,7 +6452,7 @@ define("backburner",
|
|
6242
6452
|
}
|
6243
6453
|
}
|
6244
6454
|
} else if (Object.prototype.toString.call(timer) === "[object Array]"){ // we're cancelling a throttle or debounce
|
6245
|
-
return this._cancelItem(findThrottler, throttlers, timer) ||
|
6455
|
+
return this._cancelItem(findThrottler, throttlers, timer) ||
|
6246
6456
|
this._cancelItem(findDebouncee, debouncees, timer);
|
6247
6457
|
} else {
|
6248
6458
|
return; // timer was null or not a timer
|
@@ -6352,10 +6562,8 @@ define("backburner",
|
|
6352
6562
|
return index;
|
6353
6563
|
}
|
6354
6564
|
|
6355
|
-
|
6356
6565
|
__exports__.Backburner = Backburner;
|
6357
6566
|
});
|
6358
|
-
|
6359
6567
|
})();
|
6360
6568
|
|
6361
6569
|
|
@@ -6413,22 +6621,21 @@ var Backburner = requireModule('backburner').Backburner,
|
|
6413
6621
|
@param {Object} [args*] Any additional arguments you wish to pass to the method.
|
6414
6622
|
@return {Object} return value from invoking the passed function.
|
6415
6623
|
*/
|
6416
|
-
Ember.run = function(
|
6417
|
-
var ret;
|
6418
|
-
|
6624
|
+
Ember.run = function() {
|
6419
6625
|
if (Ember.onerror) {
|
6420
|
-
|
6421
|
-
ret = backburner.run.apply(backburner, arguments);
|
6422
|
-
} catch (e) {
|
6423
|
-
Ember.onerror(e);
|
6424
|
-
}
|
6626
|
+
return onerror(arguments);
|
6425
6627
|
} else {
|
6426
|
-
|
6628
|
+
return backburner.run.apply(backburner, arguments);
|
6427
6629
|
}
|
6428
|
-
|
6429
|
-
return ret;
|
6430
6630
|
};
|
6431
6631
|
|
6632
|
+
function onerror(args) {
|
6633
|
+
try {
|
6634
|
+
return backburner.run.apply(backburner, args);
|
6635
|
+
} catch(error) {
|
6636
|
+
Ember.onerror(error);
|
6637
|
+
}
|
6638
|
+
}
|
6432
6639
|
/**
|
6433
6640
|
If no run-loop is present, it creates a new one. If a run loop is
|
6434
6641
|
present it will queue itself to run on the existing run-loops action
|
@@ -6503,7 +6710,7 @@ Ember.run.join = function(target, method /* args */) {
|
|
6503
6710
|
run-loop-wrapped callback handler.
|
6504
6711
|
|
6505
6712
|
```javascript
|
6506
|
-
jQuery(window).on('resize', Ember.run.bind(this, this.
|
6713
|
+
jQuery(window).on('resize', Ember.run.bind(this, this.handleResize));
|
6507
6714
|
```
|
6508
6715
|
|
6509
6716
|
@method bind
|
@@ -6837,7 +7044,7 @@ Ember.run.next = function() {
|
|
6837
7044
|
|
6838
7045
|
var throttle = Ember.run.throttle(myContext, function() {
|
6839
7046
|
// will not be executed
|
6840
|
-
}, 1);
|
7047
|
+
}, 1, false);
|
6841
7048
|
Ember.run.cancel(throttle);
|
6842
7049
|
|
6843
7050
|
var debounce = Ember.run.debounce(myContext, function() {
|
@@ -6923,7 +7130,8 @@ Ember.run.cancel = function(timer) {
|
|
6923
7130
|
then it will be looked up on the passed target.
|
6924
7131
|
@param {Object} [args*] Optional arguments to pass to the timeout.
|
6925
7132
|
@param {Number} wait Number of milliseconds to wait.
|
6926
|
-
@param {Boolean} immediate Trigger the function on the leading instead
|
7133
|
+
@param {Boolean} immediate Trigger the function on the leading instead
|
7134
|
+
of the trailing edge of the wait interval. Defaults to false.
|
6927
7135
|
@return {Array} Timer information for use in cancelling, see `Ember.run.cancel`.
|
6928
7136
|
*/
|
6929
7137
|
Ember.run.debounce = function() {
|
@@ -6939,9 +7147,7 @@ Ember.run.debounce = function() {
|
|
6939
7147
|
var myContext = {name: 'throttle'};
|
6940
7148
|
|
6941
7149
|
Ember.run.throttle(myContext, myFunc, 150);
|
6942
|
-
|
6943
|
-
// 50ms passes
|
6944
|
-
Ember.run.throttle(myContext, myFunc, 150);
|
7150
|
+
// myFunc is invoked with context myContext
|
6945
7151
|
|
6946
7152
|
// 50ms passes
|
6947
7153
|
Ember.run.throttle(myContext, myFunc, 150);
|
@@ -6950,8 +7156,9 @@ Ember.run.debounce = function() {
|
|
6950
7156
|
Ember.run.throttle(myContext, myFunc, 150);
|
6951
7157
|
|
6952
7158
|
// 150ms passes
|
7159
|
+
Ember.run.throttle(myContext, myFunc, 150);
|
6953
7160
|
// myFunc is invoked with context myContext
|
6954
|
-
// console logs 'throttle ran.' twice,
|
7161
|
+
// console logs 'throttle ran.' twice, 250ms apart.
|
6955
7162
|
```
|
6956
7163
|
|
6957
7164
|
@method throttle
|
@@ -7475,6 +7682,16 @@ var Mixin, REQUIRED, Alias,
|
|
7475
7682
|
|
7476
7683
|
var expandProperties = Ember.expandProperties;
|
7477
7684
|
|
7685
|
+
function superFunction(){
|
7686
|
+
var ret, func = this.__nextSuper;
|
7687
|
+
if (func) {
|
7688
|
+
this.__nextSuper = null;
|
7689
|
+
ret = func.apply(this, arguments);
|
7690
|
+
this.__nextSuper = func;
|
7691
|
+
}
|
7692
|
+
return ret;
|
7693
|
+
}
|
7694
|
+
|
7478
7695
|
function mixinsMeta(obj) {
|
7479
7696
|
var m = metaFor(obj, true), ret = m.mixins;
|
7480
7697
|
if (!ret) {
|
@@ -7600,19 +7817,26 @@ function applyMergedProperties(obj, key, value, values) {
|
|
7600
7817
|
|
7601
7818
|
if (!baseValue) { return value; }
|
7602
7819
|
|
7603
|
-
var newBase = Ember.merge({}, baseValue)
|
7820
|
+
var newBase = Ember.merge({}, baseValue),
|
7821
|
+
hasFunction = false;
|
7822
|
+
|
7604
7823
|
for (var prop in value) {
|
7605
7824
|
if (!value.hasOwnProperty(prop)) { continue; }
|
7606
7825
|
|
7607
7826
|
var propValue = value[prop];
|
7608
7827
|
if (isMethod(propValue)) {
|
7609
7828
|
// TODO: support for Computed Properties, etc?
|
7829
|
+
hasFunction = true;
|
7610
7830
|
newBase[prop] = giveMethodSuper(obj, prop, propValue, baseValue, {});
|
7611
7831
|
} else {
|
7612
7832
|
newBase[prop] = propValue;
|
7613
7833
|
}
|
7614
7834
|
}
|
7615
7835
|
|
7836
|
+
if (hasFunction) {
|
7837
|
+
newBase._super = superFunction;
|
7838
|
+
}
|
7839
|
+
|
7616
7840
|
return newBase;
|
7617
7841
|
}
|
7618
7842
|
|
@@ -7621,7 +7845,7 @@ function addNormalizedProperty(base, key, value, meta, descs, values, concats, m
|
|
7621
7845
|
if (value === REQUIRED && descs[key]) { return CONTINUE; }
|
7622
7846
|
|
7623
7847
|
// Wrap descriptor function to implement
|
7624
|
-
//
|
7848
|
+
// __nextSuper() if needed
|
7625
7849
|
if (value.func) {
|
7626
7850
|
value = giveDescriptorSuper(meta, key, value, values, descs);
|
7627
7851
|
}
|
@@ -7769,6 +7993,8 @@ function applyMixin(obj, mixins, partial) {
|
|
7769
7993
|
var descs = {}, values = {}, m = metaFor(obj),
|
7770
7994
|
key, value, desc, keys = [];
|
7771
7995
|
|
7996
|
+
obj._super = superFunction;
|
7997
|
+
|
7772
7998
|
// Go through all mixins and hashes passed in, and:
|
7773
7999
|
//
|
7774
8000
|
// * Handle concatenated properties
|
@@ -10444,133 +10670,11 @@ define("rsvp",
|
|
10444
10670
|
})();
|
10445
10671
|
|
10446
10672
|
(function() {
|
10447
|
-
|
10448
|
-
|
10449
|
-
|
10450
|
-
// @module container
|
10451
|
-
@private
|
10452
|
-
*/
|
10453
|
-
|
10454
|
-
/*
|
10455
|
-
Flag to enable/disable model factory injections (disabled by default)
|
10456
|
-
If model factory injections are enabled, models should not be
|
10457
|
-
accessed globally (only through `container.lookupFactory('model:modelName'))`);
|
10458
|
-
*/
|
10459
|
-
Ember.MODEL_FACTORY_INJECTIONS = false || !!Ember.ENV.MODEL_FACTORY_INJECTIONS;
|
10460
|
-
|
10461
|
-
define("container",
|
10462
|
-
[],
|
10463
|
-
function() {
|
10673
|
+
define("container/container",
|
10674
|
+
["container/inheriting_dict","exports"],
|
10675
|
+
function(__dependency1__, __exports__) {
|
10464
10676
|
"use strict";
|
10465
|
-
|
10466
|
-
// A safe and simple inheriting object.
|
10467
|
-
function InheritingDict(parent) {
|
10468
|
-
this.parent = parent;
|
10469
|
-
this.dict = {};
|
10470
|
-
}
|
10471
|
-
|
10472
|
-
InheritingDict.prototype = {
|
10473
|
-
|
10474
|
-
/**
|
10475
|
-
@property parent
|
10476
|
-
@type InheritingDict
|
10477
|
-
@default null
|
10478
|
-
*/
|
10479
|
-
|
10480
|
-
parent: null,
|
10481
|
-
|
10482
|
-
/**
|
10483
|
-
Object used to store the current nodes data.
|
10484
|
-
|
10485
|
-
@property dict
|
10486
|
-
@type Object
|
10487
|
-
@default Object
|
10488
|
-
*/
|
10489
|
-
dict: null,
|
10490
|
-
|
10491
|
-
/**
|
10492
|
-
Retrieve the value given a key, if the value is present at the current
|
10493
|
-
level use it, otherwise walk up the parent hierarchy and try again. If
|
10494
|
-
no matching key is found, return undefined.
|
10495
|
-
|
10496
|
-
@method get
|
10497
|
-
@param {String} key
|
10498
|
-
@return {any}
|
10499
|
-
*/
|
10500
|
-
get: function(key) {
|
10501
|
-
var dict = this.dict;
|
10502
|
-
|
10503
|
-
if (dict.hasOwnProperty(key)) {
|
10504
|
-
return dict[key];
|
10505
|
-
}
|
10506
|
-
|
10507
|
-
if (this.parent) {
|
10508
|
-
return this.parent.get(key);
|
10509
|
-
}
|
10510
|
-
},
|
10511
|
-
|
10512
|
-
/**
|
10513
|
-
Set the given value for the given key, at the current level.
|
10514
|
-
|
10515
|
-
@method set
|
10516
|
-
@param {String} key
|
10517
|
-
@param {Any} value
|
10518
|
-
*/
|
10519
|
-
set: function(key, value) {
|
10520
|
-
this.dict[key] = value;
|
10521
|
-
},
|
10522
|
-
|
10523
|
-
/**
|
10524
|
-
Delete the given key
|
10525
|
-
|
10526
|
-
@method remove
|
10527
|
-
@param {String} key
|
10528
|
-
*/
|
10529
|
-
remove: function(key) {
|
10530
|
-
delete this.dict[key];
|
10531
|
-
},
|
10532
|
-
|
10533
|
-
/**
|
10534
|
-
Check for the existence of given a key, if the key is present at the current
|
10535
|
-
level return true, otherwise walk up the parent hierarchy and try again. If
|
10536
|
-
no matching key is found, return false.
|
10537
|
-
|
10538
|
-
@method has
|
10539
|
-
@param {String} key
|
10540
|
-
@return {Boolean}
|
10541
|
-
*/
|
10542
|
-
has: function(key) {
|
10543
|
-
var dict = this.dict;
|
10544
|
-
|
10545
|
-
if (dict.hasOwnProperty(key)) {
|
10546
|
-
return true;
|
10547
|
-
}
|
10548
|
-
|
10549
|
-
if (this.parent) {
|
10550
|
-
return this.parent.has(key);
|
10551
|
-
}
|
10552
|
-
|
10553
|
-
return false;
|
10554
|
-
},
|
10555
|
-
|
10556
|
-
/**
|
10557
|
-
Iterate and invoke a callback for each local key-value pair.
|
10558
|
-
|
10559
|
-
@method eachLocal
|
10560
|
-
@param {Function} callback
|
10561
|
-
@param {Object} binding
|
10562
|
-
*/
|
10563
|
-
eachLocal: function(callback, binding) {
|
10564
|
-
var dict = this.dict;
|
10565
|
-
|
10566
|
-
for (var prop in dict) {
|
10567
|
-
if (dict.hasOwnProperty(prop)) {
|
10568
|
-
callback.call(binding, prop, dict[prop]);
|
10569
|
-
}
|
10570
|
-
}
|
10571
|
-
}
|
10572
|
-
};
|
10573
|
-
|
10677
|
+
var InheritingDict = __dependency1__["default"];
|
10574
10678
|
|
10575
10679
|
// A lightweight container that helps to assemble and decouple components.
|
10576
10680
|
// Public api for the container is still in flux.
|
@@ -11286,7 +11390,7 @@ define("container",
|
|
11286
11390
|
}
|
11287
11391
|
}
|
11288
11392
|
|
11289
|
-
function injectionsFor(container
|
11393
|
+
function injectionsFor(container, fullName) {
|
11290
11394
|
var splitName = fullName.split(":"),
|
11291
11395
|
type = splitName[0],
|
11292
11396
|
injections = [];
|
@@ -11376,9 +11480,144 @@ define("container",
|
|
11376
11480
|
injections.push({ property: property, fullName: injectionName });
|
11377
11481
|
}
|
11378
11482
|
|
11379
|
-
|
11380
|
-
});
|
11483
|
+
__exports__["default"] = Container;
|
11484
|
+
});
|
11485
|
+
define("container/inheriting_dict",
|
11486
|
+
["exports"],
|
11487
|
+
function(__exports__) {
|
11488
|
+
"use strict";
|
11489
|
+
// A safe and simple inheriting object.
|
11490
|
+
function InheritingDict(parent) {
|
11491
|
+
this.parent = parent;
|
11492
|
+
this.dict = {};
|
11493
|
+
}
|
11494
|
+
|
11495
|
+
InheritingDict.prototype = {
|
11496
|
+
|
11497
|
+
/**
|
11498
|
+
@property parent
|
11499
|
+
@type InheritingDict
|
11500
|
+
@default null
|
11501
|
+
*/
|
11502
|
+
|
11503
|
+
parent: null,
|
11504
|
+
|
11505
|
+
/**
|
11506
|
+
Object used to store the current nodes data.
|
11507
|
+
|
11508
|
+
@property dict
|
11509
|
+
@type Object
|
11510
|
+
@default Object
|
11511
|
+
*/
|
11512
|
+
dict: null,
|
11513
|
+
|
11514
|
+
/**
|
11515
|
+
Retrieve the value given a key, if the value is present at the current
|
11516
|
+
level use it, otherwise walk up the parent hierarchy and try again. If
|
11517
|
+
no matching key is found, return undefined.
|
11518
|
+
|
11519
|
+
@method get
|
11520
|
+
@param {String} key
|
11521
|
+
@return {any}
|
11522
|
+
*/
|
11523
|
+
get: function(key) {
|
11524
|
+
var dict = this.dict;
|
11525
|
+
|
11526
|
+
if (dict.hasOwnProperty(key)) {
|
11527
|
+
return dict[key];
|
11528
|
+
}
|
11529
|
+
|
11530
|
+
if (this.parent) {
|
11531
|
+
return this.parent.get(key);
|
11532
|
+
}
|
11533
|
+
},
|
11534
|
+
|
11535
|
+
/**
|
11536
|
+
Set the given value for the given key, at the current level.
|
11537
|
+
|
11538
|
+
@method set
|
11539
|
+
@param {String} key
|
11540
|
+
@param {Any} value
|
11541
|
+
*/
|
11542
|
+
set: function(key, value) {
|
11543
|
+
this.dict[key] = value;
|
11544
|
+
},
|
11545
|
+
|
11546
|
+
/**
|
11547
|
+
Delete the given key
|
11548
|
+
|
11549
|
+
@method remove
|
11550
|
+
@param {String} key
|
11551
|
+
*/
|
11552
|
+
remove: function(key) {
|
11553
|
+
delete this.dict[key];
|
11554
|
+
},
|
11555
|
+
|
11556
|
+
/**
|
11557
|
+
Check for the existence of given a key, if the key is present at the current
|
11558
|
+
level return true, otherwise walk up the parent hierarchy and try again. If
|
11559
|
+
no matching key is found, return false.
|
11560
|
+
|
11561
|
+
@method has
|
11562
|
+
@param {String} key
|
11563
|
+
@return {Boolean}
|
11564
|
+
*/
|
11565
|
+
has: function(key) {
|
11566
|
+
var dict = this.dict;
|
11567
|
+
|
11568
|
+
if (dict.hasOwnProperty(key)) {
|
11569
|
+
return true;
|
11570
|
+
}
|
11381
11571
|
|
11572
|
+
if (this.parent) {
|
11573
|
+
return this.parent.has(key);
|
11574
|
+
}
|
11575
|
+
|
11576
|
+
return false;
|
11577
|
+
},
|
11578
|
+
|
11579
|
+
/**
|
11580
|
+
Iterate and invoke a callback for each local key-value pair.
|
11581
|
+
|
11582
|
+
@method eachLocal
|
11583
|
+
@param {Function} callback
|
11584
|
+
@param {Object} binding
|
11585
|
+
*/
|
11586
|
+
eachLocal: function(callback, binding) {
|
11587
|
+
var dict = this.dict;
|
11588
|
+
|
11589
|
+
for (var prop in dict) {
|
11590
|
+
if (dict.hasOwnProperty(prop)) {
|
11591
|
+
callback.call(binding, prop, dict[prop]);
|
11592
|
+
}
|
11593
|
+
}
|
11594
|
+
}
|
11595
|
+
};
|
11596
|
+
|
11597
|
+
__exports__["default"] = InheritingDict;
|
11598
|
+
});
|
11599
|
+
define("container",
|
11600
|
+
["container/container","exports"],
|
11601
|
+
function(__dependency1__, __exports__) {
|
11602
|
+
"use strict";
|
11603
|
+
/**
|
11604
|
+
Public api for the container is still in flux.
|
11605
|
+
The public api, specified on the application namespace should be considered the stable api.
|
11606
|
+
// @module container
|
11607
|
+
@private
|
11608
|
+
*/
|
11609
|
+
|
11610
|
+
/*
|
11611
|
+
Flag to enable/disable model factory injections (disabled by default)
|
11612
|
+
If model factory injections are enabled, models should not be
|
11613
|
+
accessed globally (only through `container.lookupFactory('model:modelName'))`);
|
11614
|
+
*/
|
11615
|
+
Ember.MODEL_FACTORY_INJECTIONS = false || !!Ember.ENV.MODEL_FACTORY_INJECTIONS;
|
11616
|
+
|
11617
|
+
var Container = __dependency1__["default"];
|
11618
|
+
|
11619
|
+
__exports__["default"] = Container;
|
11620
|
+
});
|
11382
11621
|
})();
|
11383
11622
|
|
11384
11623
|
(function() {
|
@@ -12567,6 +12806,13 @@ var undefinedDescriptor = {
|
|
12567
12806
|
value: undefined
|
12568
12807
|
};
|
12569
12808
|
|
12809
|
+
var nullDescriptor = {
|
12810
|
+
configurable: true,
|
12811
|
+
writable: true,
|
12812
|
+
enumerable: false,
|
12813
|
+
value: null
|
12814
|
+
};
|
12815
|
+
|
12570
12816
|
function makeCtor() {
|
12571
12817
|
|
12572
12818
|
// Note: avoid accessing any properties on the object since it makes the
|
@@ -12579,8 +12825,8 @@ function makeCtor() {
|
|
12579
12825
|
if (!wasApplied) {
|
12580
12826
|
Class.proto(); // prepare prototype...
|
12581
12827
|
}
|
12582
|
-
o_defineProperty(this, GUID_KEY,
|
12583
|
-
o_defineProperty(this, '
|
12828
|
+
o_defineProperty(this, GUID_KEY, nullDescriptor);
|
12829
|
+
o_defineProperty(this, '__nextSuper', undefinedDescriptor);
|
12584
12830
|
var m = meta(this), proto = m.proto;
|
12585
12831
|
m.proto = this;
|
12586
12832
|
if (initMixins) {
|
@@ -15212,8 +15458,6 @@ DependentArraysObserver.prototype = {
|
|
15212
15458
|
},
|
15213
15459
|
|
15214
15460
|
setupObservers: function (dependentArray, dependentKey) {
|
15215
|
-
Ember.assert("dependent array must be an `Ember.Array`", Ember.Array.detect(dependentArray));
|
15216
|
-
|
15217
15461
|
this.dependentKeysByGuid[guidFor(dependentArray)] = dependentKey;
|
15218
15462
|
|
15219
15463
|
dependentArray.addArrayObserver(this, {
|
@@ -15603,6 +15847,11 @@ function ReduceComputedProperty(options) {
|
|
15603
15847
|
|
15604
15848
|
meta.dependentArraysObserver.suspendArrayObservers(function () {
|
15605
15849
|
forEach(cp._dependentKeys, function (dependentKey) {
|
15850
|
+
Ember.assert(
|
15851
|
+
"dependent array " + dependentKey + " must be an `Ember.Array`. " +
|
15852
|
+
"If you are not extending arrays, you will need to wrap native arrays with `Ember.A`",
|
15853
|
+
!(Ember.isArray(get(this, dependentKey)) && !Ember.Array.detect(get(this, dependentKey))));
|
15854
|
+
|
15606
15855
|
if (!partiallyRecomputeFor(this, dependentKey)) { return; }
|
15607
15856
|
|
15608
15857
|
var dependentArray = get(this, dependentKey),
|
@@ -15722,7 +15971,7 @@ ReduceComputedProperty.prototype.property = function () {
|
|
15722
15971
|
dependentArrayKey,
|
15723
15972
|
itemPropertyKey;
|
15724
15973
|
|
15725
|
-
forEach(
|
15974
|
+
forEach(args, function (dependentKey) {
|
15726
15975
|
if (doubleEachPropertyPattern.test(dependentKey)) {
|
15727
15976
|
throw new Ember.Error("Nested @each properties not supported: " + dependentKey);
|
15728
15977
|
} else if (match = eachPropertyPattern.exec(dependentKey)) {
|
@@ -16833,10 +17082,12 @@ Ember.computed.sort = function (itemsKey, sortDefinition) {
|
|
16833
17082
|
|
16834
17083
|
|
16835
17084
|
instanceMeta.order = function (itemA, itemB) {
|
16836
|
-
var
|
17085
|
+
var isProxy = itemB instanceof SearchProxy,
|
17086
|
+
sortProperty, result, asc;
|
17087
|
+
|
16837
17088
|
for (var i = 0; i < this.sortProperties.length; ++i) {
|
16838
17089
|
sortProperty = this.sortProperties[i];
|
16839
|
-
result = Ember.compare(get(itemA, sortProperty), get(itemB, sortProperty));
|
17090
|
+
result = Ember.compare(get(itemA, sortProperty), isProxy ? itemB[sortProperty] : get(itemB, sortProperty));
|
16840
17091
|
|
16841
17092
|
if (result !== 0) {
|
16842
17093
|
asc = this.sortPropertyAscending[sortProperty];
|
@@ -18055,9 +18306,37 @@ Ember.Evented = Ember.Mixin.create({
|
|
18055
18306
|
(function() {
|
18056
18307
|
var RSVP = requireModule("rsvp");
|
18057
18308
|
|
18058
|
-
|
18059
|
-
|
18060
|
-
|
18309
|
+
if (Ember.FEATURES['ember-runtime-test-friendly-promises']) {
|
18310
|
+
|
18311
|
+
var asyncStart = function() {
|
18312
|
+
if (Ember.Test && Ember.Test.adapter) {
|
18313
|
+
Ember.Test.adapter.asyncStart();
|
18314
|
+
}
|
18315
|
+
};
|
18316
|
+
|
18317
|
+
var asyncEnd = function() {
|
18318
|
+
if (Ember.Test && Ember.Test.adapter) {
|
18319
|
+
Ember.Test.adapter.asyncEnd();
|
18320
|
+
}
|
18321
|
+
};
|
18322
|
+
|
18323
|
+
RSVP.configure('async', function(callback, promise) {
|
18324
|
+
var async = !Ember.run.currentRunLoop;
|
18325
|
+
|
18326
|
+
if (Ember.testing && async) { asyncStart(); }
|
18327
|
+
|
18328
|
+
Ember.run.backburner.schedule('actions', function(){
|
18329
|
+
if (Ember.testing && async) { asyncEnd(); }
|
18330
|
+
callback(promise);
|
18331
|
+
});
|
18332
|
+
});
|
18333
|
+
} else {
|
18334
|
+
RSVP.configure('async', function(callback, promise) {
|
18335
|
+
Ember.run.backburner.schedule('actions', function(){
|
18336
|
+
callback(promise);
|
18337
|
+
});
|
18338
|
+
});
|
18339
|
+
}
|
18061
18340
|
|
18062
18341
|
RSVP.Promise.prototype.fail = function(callback, label){
|
18063
18342
|
Ember.deprecate('RSVP.Promise.fail has been renamed as RSVP.Promise.catch');
|
@@ -18347,7 +18626,8 @@ Ember.ActionHandler = Ember.Mixin.create({
|
|
18347
18626
|
} else {
|
18348
18627
|
return;
|
18349
18628
|
}
|
18350
|
-
} else if (this.deprecatedSend && this.deprecatedSendHandles && this.deprecatedSendHandles(actionName)) {
|
18629
|
+
} else if (!Ember.FEATURES.isEnabled('ember-routing-drop-deprecated-action-style') && this.deprecatedSend && this.deprecatedSendHandles && this.deprecatedSendHandles(actionName)) {
|
18630
|
+
Ember.warn("The current default is deprecated but will prefer to handle actions directly on the controller instead of a similarly named action in the actions hash. To turn off this deprecated feature set: Ember.FEATURES['ember-routing-drop-deprecated-action-style'] = true");
|
18351
18631
|
if (this.deprecatedSend.apply(this, [].slice.call(arguments)) === true) {
|
18352
18632
|
// handler return true, so this action will bubble
|
18353
18633
|
} else {
|
@@ -19092,7 +19372,7 @@ Ember.SubArray.prototype = {
|
|
19092
19372
|
|
19093
19373
|
|
19094
19374
|
(function() {
|
19095
|
-
Ember.Container = requireModule('container');
|
19375
|
+
Ember.Container = requireModule('container')['default'];
|
19096
19376
|
Ember.Container.set = Ember.set;
|
19097
19377
|
|
19098
19378
|
})();
|
@@ -20927,7 +21207,7 @@ Ember.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,
|
|
20927
21207
|
var container = get(this, 'container'),
|
20928
21208
|
subControllers = get(this, '_subControllers'),
|
20929
21209
|
subController = subControllers[idx],
|
20930
|
-
|
21210
|
+
fullName;
|
20931
21211
|
|
20932
21212
|
if (subController) { return subController; }
|
20933
21213
|
|