ember-source 1.0.0.rc6 → 1.0.0.rc6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ember-source might be problematic. Click here for more details.
- checksums.yaml +15 -0
- data/dist/ember-data-deps.js +403 -21
- data/dist/ember-data-deps.min.js +6 -6
- data/dist/ember-data-deps.prod.js +399 -17
- data/dist/ember-debug.js +2 -2
- data/dist/ember-old-router.js +503 -41
- data/dist/ember-old-router.min.js +9 -9
- data/dist/ember-old-router.prod.js +497 -35
- data/dist/ember-runtime.js +399 -17
- data/dist/ember-runtime.min.js +4 -4
- data/dist/ember-runtime.prod.js +395 -13
- data/dist/ember-spade.js +1 -1
- data/dist/ember-template-compiler.js +5 -5
- data/dist/ember-template-compiler.min.js +3 -3
- data/dist/ember-template-compiler.prod.js +1 -1
- data/dist/ember-tests.js +1 -1
- data/dist/ember.js +739 -87
- data/dist/ember.min.js +9 -9
- data/dist/ember.prod.js +587 -80
- metadata +8 -11
data/dist/ember-debug.js
CHANGED
data/dist/ember-old-router.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
// Version: v1.0.0-rc.6-
|
2
|
-
// Last commit:
|
1
|
+
// Version: v1.0.0-rc.6-56-g19271bc
|
2
|
+
// Last commit: 19271bc (2013-06-30 23:18:40 -0700)
|
3
3
|
|
4
4
|
|
5
5
|
(function() {
|
@@ -156,8 +156,8 @@ Ember.deprecateFunc = function(message, func) {
|
|
156
156
|
|
157
157
|
})();
|
158
158
|
|
159
|
-
// Version: v1.0.0-rc.6-
|
160
|
-
// Last commit:
|
159
|
+
// Version: v1.0.0-rc.6-56-g19271bc
|
160
|
+
// Last commit: 19271bc (2013-06-30 23:18:40 -0700)
|
161
161
|
|
162
162
|
|
163
163
|
(function() {
|
@@ -1198,9 +1198,9 @@ var needsFinallyFix = (function() {
|
|
1198
1198
|
@for Ember
|
1199
1199
|
@param {Function} tryable The function to run the try callback
|
1200
1200
|
@param {Function} finalizer The function to run the finally callback
|
1201
|
-
@param [binding]
|
1201
|
+
@param {Object} [binding] The optional calling object. Defaults to 'this'
|
1202
1202
|
@return {*} The return value is the that of the finalizer,
|
1203
|
-
unless that
|
1203
|
+
unless that value is undefined, in which case it is the return value
|
1204
1204
|
of the tryable
|
1205
1205
|
*/
|
1206
1206
|
|
@@ -1249,7 +1249,7 @@ if (needsFinallyFix) {
|
|
1249
1249
|
@param {Function} tryable The function to run the try callback
|
1250
1250
|
@param {Function} catchable The function to run the catchable callback
|
1251
1251
|
@param {Function} finalizer The function to run the finally callback
|
1252
|
-
@param [binding]
|
1252
|
+
@param {Object} [binding] The optional calling object. Defaults to 'this'
|
1253
1253
|
@return {*} The return value is the that of the finalizer,
|
1254
1254
|
unless that value is undefined, in which case it is the return value
|
1255
1255
|
of the tryable.
|
@@ -7311,12 +7311,43 @@ define("container",
|
|
7311
7311
|
[],
|
7312
7312
|
function() {
|
7313
7313
|
|
7314
|
+
/**
|
7315
|
+
A safe and simple inheriting object.
|
7316
|
+
|
7317
|
+
@class InheritingDict
|
7318
|
+
*/
|
7314
7319
|
function InheritingDict(parent) {
|
7315
7320
|
this.parent = parent;
|
7316
7321
|
this.dict = {};
|
7317
7322
|
}
|
7318
7323
|
|
7319
7324
|
InheritingDict.prototype = {
|
7325
|
+
|
7326
|
+
/**
|
7327
|
+
@property parent
|
7328
|
+
@type InheritingDict
|
7329
|
+
@default null
|
7330
|
+
*/
|
7331
|
+
|
7332
|
+
parent: null,
|
7333
|
+
|
7334
|
+
/**
|
7335
|
+
Object used to store the current nodes data.
|
7336
|
+
|
7337
|
+
@property dict
|
7338
|
+
@type Object
|
7339
|
+
@default Object
|
7340
|
+
*/
|
7341
|
+
dict: null,
|
7342
|
+
|
7343
|
+
/**
|
7344
|
+
Retrieve the value given a key, if the value is present at the current
|
7345
|
+
level use it, otherwise walk up the parent hierarchy and try again. If
|
7346
|
+
no matching key is found, return undefined.
|
7347
|
+
|
7348
|
+
@method get
|
7349
|
+
@return {any}
|
7350
|
+
*/
|
7320
7351
|
get: function(key) {
|
7321
7352
|
var dict = this.dict;
|
7322
7353
|
|
@@ -7329,10 +7360,26 @@ define("container",
|
|
7329
7360
|
}
|
7330
7361
|
},
|
7331
7362
|
|
7363
|
+
/**
|
7364
|
+
Set the given value for the given key, at the current level.
|
7365
|
+
|
7366
|
+
@method set
|
7367
|
+
@param {String} key
|
7368
|
+
@param {Any} value
|
7369
|
+
*/
|
7332
7370
|
set: function(key, value) {
|
7333
7371
|
this.dict[key] = value;
|
7334
7372
|
},
|
7335
7373
|
|
7374
|
+
/**
|
7375
|
+
Check for the existence of given a key, if the key is present at the current
|
7376
|
+
level return true, otherwise walk up the parent hierarchy and try again. If
|
7377
|
+
no matching key is found, return false.
|
7378
|
+
|
7379
|
+
@method has
|
7380
|
+
@param {String} key
|
7381
|
+
@returns {Boolean}
|
7382
|
+
*/
|
7336
7383
|
has: function(key) {
|
7337
7384
|
var dict = this.dict;
|
7338
7385
|
|
@@ -7347,6 +7394,13 @@ define("container",
|
|
7347
7394
|
return false;
|
7348
7395
|
},
|
7349
7396
|
|
7397
|
+
/**
|
7398
|
+
Iterate and invoke a callback for each local key-value pair.
|
7399
|
+
|
7400
|
+
@method eachLocal
|
7401
|
+
@param {Function} callback
|
7402
|
+
@param {Object} binding
|
7403
|
+
*/
|
7350
7404
|
eachLocal: function(callback, binding) {
|
7351
7405
|
var dict = this.dict;
|
7352
7406
|
|
@@ -7358,6 +7412,11 @@ define("container",
|
|
7358
7412
|
}
|
7359
7413
|
};
|
7360
7414
|
|
7415
|
+
/**
|
7416
|
+
A lightweight container that helps to assemble and decouple components.
|
7417
|
+
|
7418
|
+
@class Container
|
7419
|
+
*/
|
7361
7420
|
function Container(parent) {
|
7362
7421
|
this.parent = parent;
|
7363
7422
|
this.children = [];
|
@@ -7372,16 +7431,115 @@ define("container",
|
|
7372
7431
|
}
|
7373
7432
|
|
7374
7433
|
Container.prototype = {
|
7434
|
+
|
7435
|
+
/**
|
7436
|
+
@property parent
|
7437
|
+
@type Container
|
7438
|
+
@default null
|
7439
|
+
*/
|
7440
|
+
parent: null,
|
7441
|
+
|
7442
|
+
/**
|
7443
|
+
@property children
|
7444
|
+
@type Array
|
7445
|
+
@default []
|
7446
|
+
*/
|
7447
|
+
children: null,
|
7448
|
+
|
7449
|
+
/**
|
7450
|
+
@property resolver
|
7451
|
+
@type function
|
7452
|
+
*/
|
7453
|
+
resolver: null,
|
7454
|
+
|
7455
|
+
/**
|
7456
|
+
@property registry
|
7457
|
+
@type InheritingDict
|
7458
|
+
*/
|
7459
|
+
registry: null,
|
7460
|
+
|
7461
|
+
/**
|
7462
|
+
@property cache
|
7463
|
+
@type InheritingDict
|
7464
|
+
*/
|
7465
|
+
cache: null,
|
7466
|
+
|
7467
|
+
/**
|
7468
|
+
@property typeInjections
|
7469
|
+
@type InheritingDict
|
7470
|
+
*/
|
7471
|
+
typeInjections: null,
|
7472
|
+
|
7473
|
+
/**
|
7474
|
+
@property injections
|
7475
|
+
@type Object
|
7476
|
+
@default {}
|
7477
|
+
*/
|
7478
|
+
injections: null,
|
7479
|
+
|
7480
|
+
/**
|
7481
|
+
@private
|
7482
|
+
|
7483
|
+
@property _options
|
7484
|
+
@type InheritingDict
|
7485
|
+
@default null
|
7486
|
+
*/
|
7487
|
+
_options: null,
|
7488
|
+
|
7489
|
+
/**
|
7490
|
+
@private
|
7491
|
+
|
7492
|
+
@property _typeOptions
|
7493
|
+
@type InheritingDict
|
7494
|
+
*/
|
7495
|
+
_typeOptions: null,
|
7496
|
+
|
7497
|
+
/**
|
7498
|
+
Returns a new child of the current container. These children are configured
|
7499
|
+
to correctly inherit from the current container.
|
7500
|
+
|
7501
|
+
@method child
|
7502
|
+
@returns {Container}
|
7503
|
+
*/
|
7375
7504
|
child: function() {
|
7376
7505
|
var container = new Container(this);
|
7377
7506
|
this.children.push(container);
|
7378
7507
|
return container;
|
7379
7508
|
},
|
7380
7509
|
|
7510
|
+
/**
|
7511
|
+
Sets a key-value pair on the current container. If a parent container,
|
7512
|
+
has the same key, once set on a child, the parent and child will diverge
|
7513
|
+
as expected.
|
7514
|
+
|
7515
|
+
@method set
|
7516
|
+
@param {Object} obkect
|
7517
|
+
@param {String} key
|
7518
|
+
@param {any} value
|
7519
|
+
*/
|
7381
7520
|
set: function(object, key, value) {
|
7382
7521
|
object[key] = value;
|
7383
7522
|
},
|
7384
7523
|
|
7524
|
+
/**
|
7525
|
+
Registers a factory for later injection.
|
7526
|
+
|
7527
|
+
Example:
|
7528
|
+
|
7529
|
+
```javascript
|
7530
|
+
var container = new Container();
|
7531
|
+
|
7532
|
+
container.register('model:user', Person, {singleton: false });
|
7533
|
+
container.register('fruit:favorite', Orange);
|
7534
|
+
container.register('communication:main', Email, {singleton: false});
|
7535
|
+
```
|
7536
|
+
|
7537
|
+
@method register
|
7538
|
+
@param {String} type
|
7539
|
+
@param {String} name
|
7540
|
+
@param {Function} factory
|
7541
|
+
@param {Object} options
|
7542
|
+
*/
|
7385
7543
|
register: function(type, name, factory, options) {
|
7386
7544
|
var fullName;
|
7387
7545
|
|
@@ -7400,14 +7558,92 @@ define("container",
|
|
7400
7558
|
this._options.set(normalizedName, options || {});
|
7401
7559
|
},
|
7402
7560
|
|
7561
|
+
/**
|
7562
|
+
Given a fullName return the corresponding factory.
|
7563
|
+
|
7564
|
+
By default `resolve` will retreive the factory from
|
7565
|
+
it's containers registry.
|
7566
|
+
|
7567
|
+
```javascript
|
7568
|
+
var container = new Container();
|
7569
|
+
container.register('api:twitter', Twitter);
|
7570
|
+
|
7571
|
+
container.resolve('api:twitter') // => Twitter
|
7572
|
+
```
|
7573
|
+
|
7574
|
+
Optionally the container can be provided with a custom resolver.
|
7575
|
+
If provided, `resolve` will first provide the custom resolver
|
7576
|
+
the oppertunity to resolve the fullName, otherwise it will fallback
|
7577
|
+
to the registry.
|
7578
|
+
|
7579
|
+
```javascript
|
7580
|
+
var container = new Container();
|
7581
|
+
container.resolver = function(fullName) {
|
7582
|
+
// lookup via the module system of choice
|
7583
|
+
};
|
7584
|
+
|
7585
|
+
// the twitter factory is added to the module system
|
7586
|
+
container.resolve('api:twitter') // => Twitter
|
7587
|
+
```
|
7588
|
+
|
7589
|
+
@method resolve
|
7590
|
+
@param {String} fullName
|
7591
|
+
@returns {Function} fullName's factory
|
7592
|
+
*/
|
7403
7593
|
resolve: function(fullName) {
|
7404
7594
|
return this.resolver(fullName) || this.registry.get(fullName);
|
7405
7595
|
},
|
7406
7596
|
|
7597
|
+
/**
|
7598
|
+
A hook to enable custom fullName normalization behaviour
|
7599
|
+
|
7600
|
+
@method normalize
|
7601
|
+
@param {String} fullName
|
7602
|
+
@return {string} normalized fullName
|
7603
|
+
*/
|
7407
7604
|
normalize: function(fullName) {
|
7408
7605
|
return fullName;
|
7409
7606
|
},
|
7410
7607
|
|
7608
|
+
/**
|
7609
|
+
Given a fullName return a corresponding instance.
|
7610
|
+
|
7611
|
+
The default behaviour is for lookup to return a singleton instance.
|
7612
|
+
The singleton is scoped to the container, allowing multiple containers
|
7613
|
+
to all have there own locally scoped singletons.
|
7614
|
+
|
7615
|
+
```javascript
|
7616
|
+
var container = new Container();
|
7617
|
+
container.register('api:twitter', Twitter);
|
7618
|
+
|
7619
|
+
var twitter = container.lookup('api:twitter');
|
7620
|
+
|
7621
|
+
twitter instanceof Twitter; // => true
|
7622
|
+
|
7623
|
+
// by default the container will return singletons
|
7624
|
+
twitter2 = container.lookup('api:twitter');
|
7625
|
+
twitter instanceof Twitter; // => true
|
7626
|
+
|
7627
|
+
twitter === twitter2; //=> true
|
7628
|
+
```
|
7629
|
+
|
7630
|
+
If singletons are not wanted an optional flag can be provided at lookup.
|
7631
|
+
|
7632
|
+
```javascript
|
7633
|
+
var container = new Container();
|
7634
|
+
container.register('api:twitter', Twitter);
|
7635
|
+
|
7636
|
+
var twitter = container.lookup('api:twitter', { singleton: false });
|
7637
|
+
var twitter2 = container.lookup('api:twitter', { singleton: false });
|
7638
|
+
|
7639
|
+
twitter === twitter2; //=> false
|
7640
|
+
```
|
7641
|
+
|
7642
|
+
@method lookup
|
7643
|
+
@param {String} fullName
|
7644
|
+
@param {Object} options
|
7645
|
+
@return {any}
|
7646
|
+
*/
|
7411
7647
|
lookup: function(fullName, options) {
|
7412
7648
|
fullName = this.normalize(fullName);
|
7413
7649
|
|
@@ -7428,10 +7664,25 @@ define("container",
|
|
7428
7664
|
return value;
|
7429
7665
|
},
|
7430
7666
|
|
7667
|
+
/**
|
7668
|
+
Given a fullName return the corresponding factory.
|
7669
|
+
|
7670
|
+
@method lookupFactory
|
7671
|
+
@param {String} fullName
|
7672
|
+
@return {any}
|
7673
|
+
*/
|
7431
7674
|
lookupFactory: function(fullName) {
|
7432
7675
|
return factoryFor(this, fullName);
|
7433
7676
|
},
|
7434
7677
|
|
7678
|
+
/**
|
7679
|
+
Given a fullName check if the container is aware of its factory
|
7680
|
+
or singleton instance.
|
7681
|
+
|
7682
|
+
@method has
|
7683
|
+
@param {String} fullName
|
7684
|
+
@return {Boolean}
|
7685
|
+
*/
|
7435
7686
|
has: function(fullName) {
|
7436
7687
|
if (this.cache.has(fullName)) {
|
7437
7688
|
return true;
|
@@ -7440,27 +7691,144 @@ define("container",
|
|
7440
7691
|
return !!factoryFor(this, fullName);
|
7441
7692
|
},
|
7442
7693
|
|
7694
|
+
/**
|
7695
|
+
Allow registerying options for all factories of a type.
|
7696
|
+
|
7697
|
+
```javascript
|
7698
|
+
var container = new Container();
|
7699
|
+
|
7700
|
+
// if all of type `connection` must not be singletons
|
7701
|
+
container.optionsForType('connection', { singleton: false });
|
7702
|
+
|
7703
|
+
container.register('connection:twitter', TwitterConnection);
|
7704
|
+
container.register('connection:facebook', FacebookConnection);
|
7705
|
+
|
7706
|
+
var twitter = container.lookup('connection:twitter');
|
7707
|
+
var twitter2 = container.lookup('connection:twitter');
|
7708
|
+
|
7709
|
+
twitter === twitter2; // => false
|
7710
|
+
|
7711
|
+
var facebook = container.lookup('connection:facebook');
|
7712
|
+
var facebook2 = container.lookup('connection:facebook');
|
7713
|
+
|
7714
|
+
facebook === facebook2; // => false
|
7715
|
+
```
|
7716
|
+
|
7717
|
+
@method optionsForType
|
7718
|
+
@param {String} type
|
7719
|
+
@param {Object} options
|
7720
|
+
*/
|
7443
7721
|
optionsForType: function(type, options) {
|
7444
7722
|
if (this.parent) { illegalChildOperation('optionsForType'); }
|
7445
7723
|
|
7446
7724
|
this._typeOptions.set(type, options);
|
7447
7725
|
},
|
7448
7726
|
|
7727
|
+
/**
|
7728
|
+
@method options
|
7729
|
+
@param {String} type
|
7730
|
+
@param {Object} options
|
7731
|
+
*/
|
7449
7732
|
options: function(type, options) {
|
7450
7733
|
this.optionsForType(type, options);
|
7451
7734
|
},
|
7452
7735
|
|
7736
|
+
/*
|
7737
|
+
@private
|
7738
|
+
|
7739
|
+
Used only via `injection`.
|
7740
|
+
|
7741
|
+
Provides a specialized form of injection, specifically enabling
|
7742
|
+
all objects of one type to be injected with a reference to another
|
7743
|
+
object.
|
7744
|
+
|
7745
|
+
For example, provided each object of type `controller` needed a `router`.
|
7746
|
+
one would do the following:
|
7747
|
+
|
7748
|
+
```javascript
|
7749
|
+
var container = new Container();
|
7750
|
+
|
7751
|
+
container.register('router:main', Router);
|
7752
|
+
container.register('controller:user', UserController);
|
7753
|
+
container.register('controller:post', PostController);
|
7754
|
+
|
7755
|
+
container.typeInjection('controller', 'router', 'router:main');
|
7756
|
+
|
7757
|
+
var user = container.lookup('controller:user');
|
7758
|
+
var post = container.lookup('controller:post');
|
7759
|
+
|
7760
|
+
user.router instanceof Router; //=> true
|
7761
|
+
post.router instanceof Router; //=> true
|
7762
|
+
|
7763
|
+
// both controllers share the same router
|
7764
|
+
user.router === post.router; //=> true
|
7765
|
+
```
|
7766
|
+
|
7767
|
+
@method typeInjection
|
7768
|
+
@param {String} type
|
7769
|
+
@param {String} property
|
7770
|
+
@param {String} fullName
|
7771
|
+
*/
|
7453
7772
|
typeInjection: function(type, property, fullName) {
|
7454
7773
|
if (this.parent) { illegalChildOperation('typeInjection'); }
|
7455
7774
|
|
7456
7775
|
var injections = this.typeInjections.get(type);
|
7776
|
+
|
7457
7777
|
if (!injections) {
|
7458
7778
|
injections = [];
|
7459
7779
|
this.typeInjections.set(type, injections);
|
7460
7780
|
}
|
7461
|
-
|
7781
|
+
|
7782
|
+
injections.push({
|
7783
|
+
property: property,
|
7784
|
+
fullName: fullName
|
7785
|
+
});
|
7462
7786
|
},
|
7463
7787
|
|
7788
|
+
/*
|
7789
|
+
Defines injection rules.
|
7790
|
+
|
7791
|
+
These rules are used to inject dependencies onto objects when they
|
7792
|
+
are instantiated.
|
7793
|
+
|
7794
|
+
Two forms of injections are possible:
|
7795
|
+
|
7796
|
+
* Injecting one fullName on another fullName
|
7797
|
+
* Injecting one fullName on a type
|
7798
|
+
|
7799
|
+
Example:
|
7800
|
+
|
7801
|
+
```javascript
|
7802
|
+
var container = new Container();
|
7803
|
+
|
7804
|
+
container.register('source:main', Source);
|
7805
|
+
container.register('model:user', User);
|
7806
|
+
container.register('model:post', PostController);
|
7807
|
+
|
7808
|
+
// injecting one fullName on another fullName
|
7809
|
+
// eg. each user model gets a post model
|
7810
|
+
container.injection('model:user', 'post', 'model:post');
|
7811
|
+
|
7812
|
+
// injecting one fullName on another type
|
7813
|
+
container.injection('model', 'source', 'source:main');
|
7814
|
+
|
7815
|
+
var user = container.lookup('model:user');
|
7816
|
+
var post = container.lookup('model:post');
|
7817
|
+
|
7818
|
+
user.source instanceof Source; //=> true
|
7819
|
+
post.source instanceof Source; //=> true
|
7820
|
+
|
7821
|
+
user.post instanceof Post; //=> true
|
7822
|
+
|
7823
|
+
// and both models share the same source
|
7824
|
+
user.source === post.source; //=> true
|
7825
|
+
```
|
7826
|
+
|
7827
|
+
@method injection
|
7828
|
+
@param {String} factoryName
|
7829
|
+
@param {String} property
|
7830
|
+
@param {String} injectionName
|
7831
|
+
*/
|
7464
7832
|
injection: function(factoryName, property, injectionName) {
|
7465
7833
|
if (this.parent) { illegalChildOperation('injection'); }
|
7466
7834
|
|
@@ -7472,6 +7840,12 @@ define("container",
|
|
7472
7840
|
injections.push({ property: property, fullName: injectionName });
|
7473
7841
|
},
|
7474
7842
|
|
7843
|
+
/**
|
7844
|
+
A depth first traversal, destroying the container, its descendant containers and all
|
7845
|
+
their managed objects.
|
7846
|
+
|
7847
|
+
@method destroy
|
7848
|
+
*/
|
7475
7849
|
destroy: function() {
|
7476
7850
|
this.isDestroyed = true;
|
7477
7851
|
|
@@ -7489,6 +7863,9 @@ define("container",
|
|
7489
7863
|
this.isDestroyed = true;
|
7490
7864
|
},
|
7491
7865
|
|
7866
|
+
/**
|
7867
|
+
@method reset
|
7868
|
+
*/
|
7492
7869
|
reset: function() {
|
7493
7870
|
for (var i=0, l=this.children.length; i<l; i++) {
|
7494
7871
|
resetCache(this.children[i]);
|
@@ -7517,7 +7894,12 @@ define("container",
|
|
7517
7894
|
for (var i=0, l=injections.length; i<l; i++) {
|
7518
7895
|
injection = injections[i];
|
7519
7896
|
lookup = container.lookup(injection.fullName);
|
7520
|
-
|
7897
|
+
|
7898
|
+
if (lookup) {
|
7899
|
+
hash[injection.property] = lookup;
|
7900
|
+
} else {
|
7901
|
+
throw new Error('Attempting to inject an unknown injection: `' + injection.fullName + '`');
|
7902
|
+
}
|
7521
7903
|
}
|
7522
7904
|
|
7523
7905
|
return hash;
|
@@ -8706,7 +9088,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
8706
9088
|
@return {Array} The mapped array.
|
8707
9089
|
*/
|
8708
9090
|
map: function(callback, target) {
|
8709
|
-
var ret = Ember.A(
|
9091
|
+
var ret = Ember.A();
|
8710
9092
|
this.forEach(function(x, idx, i) {
|
8711
9093
|
ret[idx] = callback.call(target, x, idx,i);
|
8712
9094
|
});
|
@@ -8756,7 +9138,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
8756
9138
|
@return {Array} A filtered array.
|
8757
9139
|
*/
|
8758
9140
|
filter: function(callback, target) {
|
8759
|
-
var ret = Ember.A(
|
9141
|
+
var ret = Ember.A();
|
8760
9142
|
this.forEach(function(x, idx, i) {
|
8761
9143
|
if (callback.call(target, x, idx, i)) ret.push(x);
|
8762
9144
|
});
|
@@ -9045,7 +9427,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
9045
9427
|
@return {Array} return values from calling invoke.
|
9046
9428
|
*/
|
9047
9429
|
invoke: function(methodName) {
|
9048
|
-
var args, ret = Ember.A(
|
9430
|
+
var args, ret = Ember.A();
|
9049
9431
|
if (arguments.length>1) args = a_slice.call(arguments, 1);
|
9050
9432
|
|
9051
9433
|
this.forEach(function(x, idx) {
|
@@ -9066,7 +9448,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
9066
9448
|
@return {Array} the enumerable as an array.
|
9067
9449
|
*/
|
9068
9450
|
toArray: function() {
|
9069
|
-
var ret = Ember.A(
|
9451
|
+
var ret = Ember.A();
|
9070
9452
|
this.forEach(function(o, idx) { ret[idx] = o; });
|
9071
9453
|
return ret ;
|
9072
9454
|
},
|
@@ -9102,7 +9484,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
9102
9484
|
*/
|
9103
9485
|
without: function(value) {
|
9104
9486
|
if (!this.contains(value)) return this; // nothing to do
|
9105
|
-
var ret = Ember.A(
|
9487
|
+
var ret = Ember.A();
|
9106
9488
|
this.forEach(function(k) {
|
9107
9489
|
if (k !== value) ret[ret.length] = k;
|
9108
9490
|
}) ;
|
@@ -9122,7 +9504,7 @@ Ember.Enumerable = Ember.Mixin.create({
|
|
9122
9504
|
@return {Ember.Enumerable}
|
9123
9505
|
*/
|
9124
9506
|
uniq: function() {
|
9125
|
-
var ret = Ember.A(
|
9507
|
+
var ret = Ember.A();
|
9126
9508
|
this.forEach(function(k){
|
9127
9509
|
if (a_indexOf(ret, k)<0) ret.push(k);
|
9128
9510
|
});
|
@@ -9438,7 +9820,7 @@ Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.protot
|
|
9438
9820
|
@return {Array} New array with specified slice
|
9439
9821
|
*/
|
9440
9822
|
slice: function(beginIndex, endIndex) {
|
9441
|
-
var ret = Ember.A(
|
9823
|
+
var ret = Ember.A();
|
9442
9824
|
var length = get(this, 'length') ;
|
9443
9825
|
if (isNone(beginIndex)) beginIndex = 0 ;
|
9444
9826
|
if (isNone(endIndex) || (endIndex > length)) endIndex = length ;
|
@@ -11126,7 +11508,7 @@ Ember.Evented = Ember.Mixin.create({
|
|
11126
11508
|
},
|
11127
11509
|
|
11128
11510
|
/**
|
11129
|
-
Cancels subscription for
|
11511
|
+
Cancels subscription for given name, target, and method.
|
11130
11512
|
|
11131
11513
|
@method off
|
11132
11514
|
@param {String} name The name of the event
|
@@ -17438,7 +17820,7 @@ Ember.View.applyAttributeBindings = function(elem, name, value) {
|
|
17438
17820
|
}
|
17439
17821
|
} else if (name === 'value' || type === 'boolean') {
|
17440
17822
|
// We can't set properties to undefined or null
|
17441
|
-
if (
|
17823
|
+
if (Ember.isNone(value)) { value = ''; }
|
17442
17824
|
|
17443
17825
|
if (value !== elem.prop(name)) {
|
17444
17826
|
// value and booleans should always be properties
|
@@ -18620,9 +19002,9 @@ Ember.CollectionView.CONTAINER_MAP = {
|
|
18620
19002
|
|
18621
19003
|
The easiest way to create an `Ember.Component` is via
|
18622
19004
|
a template. If you name a template
|
18623
|
-
`
|
19005
|
+
`components/my-foo`, you will be able to use
|
18624
19006
|
`{{my-foo}}` in other templates, which will make
|
18625
|
-
an instance of the isolated
|
19007
|
+
an instance of the isolated component.
|
18626
19008
|
|
18627
19009
|
```html
|
18628
19010
|
{{app-profile person=currentUser}}
|
@@ -18639,25 +19021,24 @@ Ember.CollectionView.CONTAINER_MAP = {
|
|
18639
19021
|
include the **contents** of the custom tag:
|
18640
19022
|
|
18641
19023
|
```html
|
18642
|
-
{{#
|
18643
|
-
|
18644
|
-
{{/
|
19024
|
+
{{#app-profile person=currentUser}}
|
19025
|
+
<p>Admin mode</p>
|
19026
|
+
{{/app-profile}}
|
18645
19027
|
```
|
18646
19028
|
|
18647
19029
|
```html
|
18648
19030
|
<!-- app-profile template -->
|
18649
|
-
|
18650
19031
|
<h1>{{person.title}}</h1>
|
18651
19032
|
{{yield}} <!-- block contents -->
|
18652
19033
|
```
|
18653
19034
|
|
18654
|
-
If you want to customize the
|
19035
|
+
If you want to customize the component, in order to
|
18655
19036
|
handle events or actions, you implement a subclass
|
18656
19037
|
of `Ember.Component` named after the name of the
|
18657
|
-
|
19038
|
+
component.
|
18658
19039
|
|
18659
19040
|
For example, you could implement the action
|
18660
|
-
`hello` for the `app-profile`
|
19041
|
+
`hello` for the `app-profile` component:
|
18661
19042
|
|
18662
19043
|
```js
|
18663
19044
|
App.AppProfileComponent = Ember.Component.extend({
|
@@ -18667,7 +19048,7 @@ Ember.CollectionView.CONTAINER_MAP = {
|
|
18667
19048
|
});
|
18668
19049
|
```
|
18669
19050
|
|
18670
|
-
And then use it in the
|
19051
|
+
And then use it in the component's template:
|
18671
19052
|
|
18672
19053
|
```html
|
18673
19054
|
<!-- app-profile template -->
|
@@ -19613,10 +19994,10 @@ var sendEvent = function(eventName, sendRecursiveArguments, isUnhandledPass) {
|
|
19613
19994
|
})
|
19614
19995
|
}),
|
19615
19996
|
stateTwo: Ember.State.create({
|
19616
|
-
|
19617
|
-
|
19618
|
-
|
19619
|
-
|
19997
|
+
anAction: function(manager, context){
|
19998
|
+
// will not be called below because it is
|
19999
|
+
// not a parent of the current state
|
20000
|
+
}
|
19620
20001
|
})
|
19621
20002
|
})
|
19622
20003
|
|
@@ -20527,8 +20908,8 @@ if(!Handlebars && typeof require === 'function') {
|
|
20527
20908
|
Handlebars = require('handlebars');
|
20528
20909
|
}
|
20529
20910
|
|
20530
|
-
Ember.assert("Ember Handlebars requires Handlebars version 1.0.0
|
20531
|
-
Ember.assert("Ember Handlebars requires Handlebars version 1.0.0
|
20911
|
+
Ember.assert("Ember Handlebars requires Handlebars version 1.0.0. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.", Handlebars)
|
20912
|
+
Ember.assert("Ember Handlebars requires Handlebars version 1.0.0, COMPILER_REVISION expected: 4, got: " + Handlebars.COMPILER_REVISION + " – Please note: Builds of master may have other COMPILER_REVISION values.", Handlebars.COMPILER_REVISION === 4);
|
20532
20913
|
|
20533
20914
|
/**
|
20534
20915
|
Prepares the Handlebars templating library for use inside Ember's view
|
@@ -20715,7 +21096,7 @@ Ember.Handlebars.Compiler.prototype.mustache = function(mustache) {
|
|
20715
21096
|
} else if (mustache.params.length || mustache.hash) {
|
20716
21097
|
// no changes required
|
20717
21098
|
} else {
|
20718
|
-
var id = new Handlebars.AST.IdNode(['_triageMustache']);
|
21099
|
+
var id = new Handlebars.AST.IdNode([{ part: '_triageMustache' }]);
|
20719
21100
|
|
20720
21101
|
// Update the mustache node to include a hash value indicating whether the original node
|
20721
21102
|
// was escaped. This will allow us to properly escape values when the underlying value
|
@@ -21151,7 +21532,7 @@ function evaluateMultiPropertyBoundHelper(context, fn, normalizedProperties, opt
|
|
21151
21532
|
|
21152
21533
|
view.appendChild(bindView);
|
21153
21534
|
|
21154
|
-
// Assemble
|
21535
|
+
// Assemble list of watched properties that'll re-render this helper.
|
21155
21536
|
watchedProperties = [];
|
21156
21537
|
for (boundOption in boundOptions) {
|
21157
21538
|
if (boundOptions.hasOwnProperty(boundOption)) {
|
@@ -24052,6 +24433,7 @@ var set = Ember.set,
|
|
24052
24433
|
get = Ember.get,
|
24053
24434
|
indexOf = Ember.EnumerableUtils.indexOf,
|
24054
24435
|
indexesOf = Ember.EnumerableUtils.indexesOf,
|
24436
|
+
forEach = Ember.EnumerableUtils.forEach,
|
24055
24437
|
replace = Ember.EnumerableUtils.replace,
|
24056
24438
|
isArray = Ember.isArray,
|
24057
24439
|
precompileTemplate = Ember.Handlebars.compile;
|
@@ -24105,6 +24487,18 @@ Ember.SelectOption = Ember.View.extend({
|
|
24105
24487
|
}, 'parentView.optionValuePath')
|
24106
24488
|
});
|
24107
24489
|
|
24490
|
+
Ember.SelectOptgroup = Ember.CollectionView.extend({
|
24491
|
+
tagName: 'optgroup',
|
24492
|
+
attributeBindings: ['label'],
|
24493
|
+
|
24494
|
+
selectionBinding: 'parentView.selection',
|
24495
|
+
multipleBinding: 'parentView.multiple',
|
24496
|
+
optionLabelPathBinding: 'parentView.optionLabelPath',
|
24497
|
+
optionValuePathBinding: 'parentView.optionValuePath',
|
24498
|
+
|
24499
|
+
itemViewClassBinding: 'parentView.optionView'
|
24500
|
+
});
|
24501
|
+
|
24108
24502
|
/**
|
24109
24503
|
The `Ember.Select` view class renders a
|
24110
24504
|
[select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,
|
@@ -24355,8 +24749,8 @@ Ember.Select = Ember.View.extend(
|
|
24355
24749
|
tagName: 'select',
|
24356
24750
|
classNames: ['ember-select'],
|
24357
24751
|
defaultTemplate: Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
|
24358
|
-
this.compilerInfo = [
|
24359
|
-
helpers = helpers
|
24752
|
+
this.compilerInfo = [4,'>= 1.0.0'];
|
24753
|
+
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
|
24360
24754
|
var buffer = '', stack1, hashTypes, hashContexts, escapeExpression=this.escapeExpression, self=this;
|
24361
24755
|
|
24362
24756
|
function program1(depth0,data) {
|
@@ -24372,6 +24766,35 @@ function program1(depth0,data) {
|
|
24372
24766
|
|
24373
24767
|
function program3(depth0,data) {
|
24374
24768
|
|
24769
|
+
var stack1, hashTypes, hashContexts;
|
24770
|
+
hashTypes = {};
|
24771
|
+
hashContexts = {};
|
24772
|
+
stack1 = helpers.each.call(depth0, "view.groupedContent", {hash:{},inverse:self.noop,fn:self.program(4, program4, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
24773
|
+
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
24774
|
+
else { data.buffer.push(''); }
|
24775
|
+
}
|
24776
|
+
function program4(depth0,data) {
|
24777
|
+
|
24778
|
+
var hashContexts, hashTypes;
|
24779
|
+
hashContexts = {'contentBinding': depth0,'labelBinding': depth0};
|
24780
|
+
hashTypes = {'contentBinding': "ID",'labelBinding': "ID"};
|
24781
|
+
data.buffer.push(escapeExpression(helpers.view.call(depth0, "view.groupView", {hash:{
|
24782
|
+
'contentBinding': ("content"),
|
24783
|
+
'labelBinding': ("label")
|
24784
|
+
},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})));
|
24785
|
+
}
|
24786
|
+
|
24787
|
+
function program6(depth0,data) {
|
24788
|
+
|
24789
|
+
var stack1, hashTypes, hashContexts;
|
24790
|
+
hashTypes = {};
|
24791
|
+
hashContexts = {};
|
24792
|
+
stack1 = helpers.each.call(depth0, "view.content", {hash:{},inverse:self.noop,fn:self.program(7, program7, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
24793
|
+
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
24794
|
+
else { data.buffer.push(''); }
|
24795
|
+
}
|
24796
|
+
function program7(depth0,data) {
|
24797
|
+
|
24375
24798
|
var hashContexts, hashTypes;
|
24376
24799
|
hashContexts = {'contentBinding': depth0};
|
24377
24800
|
hashTypes = {'contentBinding': "STRING"};
|
@@ -24386,7 +24809,7 @@ function program3(depth0,data) {
|
|
24386
24809
|
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
24387
24810
|
hashTypes = {};
|
24388
24811
|
hashContexts = {};
|
24389
|
-
stack1 = helpers.
|
24812
|
+
stack1 = helpers['if'].call(depth0, "view.optionGroupPath", {hash:{},inverse:self.program(6, program6, data),fn:self.program(3, program3, data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});
|
24390
24813
|
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }
|
24391
24814
|
return buffer;
|
24392
24815
|
|
@@ -24486,6 +24909,45 @@ function program3(depth0,data) {
|
|
24486
24909
|
*/
|
24487
24910
|
optionValuePath: 'content',
|
24488
24911
|
|
24912
|
+
/**
|
24913
|
+
The path of the option group.
|
24914
|
+
When this property is used, `content` should be sorted by `optionGroupPath`.
|
24915
|
+
|
24916
|
+
@property optionGroupPath
|
24917
|
+
@type String
|
24918
|
+
@default null
|
24919
|
+
*/
|
24920
|
+
optionGroupPath: null,
|
24921
|
+
|
24922
|
+
/**
|
24923
|
+
The view class for optgroup.
|
24924
|
+
|
24925
|
+
@property groupView
|
24926
|
+
@type Ember.View
|
24927
|
+
@default Ember.SelectOptgroup
|
24928
|
+
*/
|
24929
|
+
groupView: Ember.SelectOptgroup,
|
24930
|
+
|
24931
|
+
groupedContent: Ember.computed(function() {
|
24932
|
+
var groupPath = get(this, 'optionGroupPath');
|
24933
|
+
var groupedContent = Ember.A();
|
24934
|
+
|
24935
|
+
forEach(get(this, 'content'), function(item) {
|
24936
|
+
var label = get(item, groupPath);
|
24937
|
+
|
24938
|
+
if (get(groupedContent, 'lastObject.label') !== label) {
|
24939
|
+
groupedContent.pushObject({
|
24940
|
+
label: label,
|
24941
|
+
content: Ember.A()
|
24942
|
+
});
|
24943
|
+
}
|
24944
|
+
|
24945
|
+
get(groupedContent, 'lastObject.content').push(item);
|
24946
|
+
});
|
24947
|
+
|
24948
|
+
return groupedContent;
|
24949
|
+
}).property('optionGroupPath', 'content.@each'),
|
24950
|
+
|
24489
24951
|
/**
|
24490
24952
|
The view class for option.
|
24491
24953
|
|
@@ -26423,7 +26885,7 @@ Ember.HashLocation = Ember.Object.extend({
|
|
26423
26885
|
willDestroy: function() {
|
26424
26886
|
var guid = Ember.guidFor(this);
|
26425
26887
|
|
26426
|
-
Ember.$(window).
|
26888
|
+
Ember.$(window).off('hashchange.ember-location-'+guid);
|
26427
26889
|
}
|
26428
26890
|
});
|
26429
26891
|
|
@@ -26581,7 +27043,7 @@ Ember.HistoryLocation = Ember.Object.extend({
|
|
26581
27043
|
willDestroy: function() {
|
26582
27044
|
var guid = Ember.guidFor(this);
|
26583
27045
|
|
26584
|
-
Ember.$(window).
|
27046
|
+
Ember.$(window).off('popstate.ember-location-'+guid);
|
26585
27047
|
}
|
26586
27048
|
});
|
26587
27049
|
|