ember-source 1.10.0.beta.4 → 1.10.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 +32 -25
- data/dist/ember-template-compiler.js +219 -68
- data/dist/ember-testing.js +12 -12
- data/dist/ember-tests.js +508 -73
- data/dist/ember-tests.prod.js +396 -73
- data/dist/ember.debug.js +564 -6494
- data/dist/ember.js +564 -6494
- data/dist/ember.min.js +12 -15
- data/dist/ember.prod.js +550 -6482
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7b3c948c4a161b9e0a7f1f0f9bf038c1b840161
|
4
|
+
data.tar.gz: 548e7087d1d51fb4d1dcd42cf57a1db271931ab7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43d4e42fb0f7b2bdd7162c9ef06c08c57cad56a06eb5ad2aecc87c30ec203f10246d61df34182d4b0d754eea0c1f86147268722875e17c45d816854c78f407b7
|
7
|
+
data.tar.gz: 64ff1f9d5e0e70f12fa3c944a7205d07328b55dd96e151ca505b5163ed6864585128dd1c6d0232d54a2d3da5763e03ec653b025e4544d518768d909639366dcc
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.10.0
|
1
|
+
1.10.0
|
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.10.0
|
8
|
+
* @version 1.10.0
|
9
9
|
*/
|
10
10
|
|
11
11
|
(function() {
|
@@ -4852,7 +4852,7 @@ define("ember-metal/core",
|
|
4852
4852
|
|
4853
4853
|
@class Ember
|
4854
4854
|
@static
|
4855
|
-
@version 1.10.0
|
4855
|
+
@version 1.10.0
|
4856
4856
|
*/
|
4857
4857
|
|
4858
4858
|
if ('undefined' === typeof Ember) {
|
@@ -4879,10 +4879,10 @@ define("ember-metal/core",
|
|
4879
4879
|
/**
|
4880
4880
|
@property VERSION
|
4881
4881
|
@type String
|
4882
|
-
@default '1.10.0
|
4882
|
+
@default '1.10.0'
|
4883
4883
|
@static
|
4884
4884
|
*/
|
4885
|
-
Ember.VERSION = '1.10.0
|
4885
|
+
Ember.VERSION = '1.10.0';
|
4886
4886
|
|
4887
4887
|
/**
|
4888
4888
|
Standard environmental variables. You can define these in a global `EmberENV`
|
@@ -4921,7 +4921,7 @@ define("ember-metal/core",
|
|
4921
4921
|
/**
|
4922
4922
|
Hash of enabled Canary features. Add to this before creating your application.
|
4923
4923
|
|
4924
|
-
You can also define `
|
4924
|
+
You can also define `EmberENV.FEATURES` if you need to enable features flagged at runtime.
|
4925
4925
|
|
4926
4926
|
@class FEATURES
|
4927
4927
|
@namespace Ember
|
@@ -4937,8 +4937,8 @@ define("ember-metal/core",
|
|
4937
4937
|
|
4938
4938
|
You can define the following configuration options:
|
4939
4939
|
|
4940
|
-
* `
|
4941
|
-
* `
|
4940
|
+
* `EmberENV.ENABLE_ALL_FEATURES` - force all features to be enabled.
|
4941
|
+
* `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly
|
4942
4942
|
enabled/disabled.
|
4943
4943
|
|
4944
4944
|
@method isEnabled
|
@@ -4974,7 +4974,7 @@ define("ember-metal/core",
|
|
4974
4974
|
|
4975
4975
|
In general we recommend leaving this option set to true since it rarely
|
4976
4976
|
conflicts with other code. If you need to turn it off however, you can
|
4977
|
-
define an `
|
4977
|
+
define an `EmberENV.EXTEND_PROTOTYPES` config to disable it.
|
4978
4978
|
|
4979
4979
|
@property EXTEND_PROTOTYPES
|
4980
4980
|
@type Boolean
|
@@ -6476,7 +6476,7 @@ define("ember-metal/is_present",
|
|
6476
6476
|
@for Ember
|
6477
6477
|
@param {Object} obj Value to test
|
6478
6478
|
@return {Boolean}
|
6479
|
-
@since 1.
|
6479
|
+
@since 1.8.0
|
6480
6480
|
*/
|
6481
6481
|
isPresent = function isPresent(obj) {
|
6482
6482
|
return !isBlank(obj);
|
@@ -6917,6 +6917,7 @@ define("ember-metal/map",
|
|
6917
6917
|
},
|
6918
6918
|
|
6919
6919
|
/**
|
6920
|
+
@since 1.8.0
|
6920
6921
|
@method delete
|
6921
6922
|
@param obj
|
6922
6923
|
@param _guid (optional and for internal use only)
|
@@ -7064,6 +7065,7 @@ define("ember-metal/map",
|
|
7064
7065
|
/**
|
7065
7066
|
This property will change as the number of objects in the map changes.
|
7066
7067
|
|
7068
|
+
@since 1.8.0
|
7067
7069
|
@property size
|
7068
7070
|
@type number
|
7069
7071
|
@default 0
|
@@ -7129,6 +7131,7 @@ define("ember-metal/map",
|
|
7129
7131
|
/**
|
7130
7132
|
Removes a value from the map for an associated key.
|
7131
7133
|
|
7134
|
+
@since 1.8.0
|
7132
7135
|
@method delete
|
7133
7136
|
@param {*} key
|
7134
7137
|
@return {Boolean} true if an item was removed, false otherwise
|
@@ -8540,12 +8543,15 @@ define("ember-metal/platform",
|
|
8540
8543
|
__exports__.canDefineNonEnumerableProperties = canDefineNonEnumerableProperties;
|
8541
8544
|
});
|
8542
8545
|
define("ember-metal/platform/create",
|
8543
|
-
["exports"],
|
8544
|
-
function(__exports__) {
|
8546
|
+
["ember-metal/platform/define_properties","exports"],
|
8547
|
+
function(__dependency1__, __exports__) {
|
8545
8548
|
// Remove "use strict"; from transpiled module until
|
8546
8549
|
// https://bugs.webkit.org/show_bug.cgi?id=138038 is fixed
|
8547
8550
|
//
|
8548
8551
|
// REMOVE_USE_STRICT: true
|
8552
|
+
//
|
8553
|
+
|
8554
|
+
var defineProperties = __dependency1__["default"];
|
8549
8555
|
|
8550
8556
|
/**
|
8551
8557
|
@class platform
|
@@ -8556,6 +8562,7 @@ define("ember-metal/platform/create",
|
|
8556
8562
|
/**
|
8557
8563
|
Identical to `Object.create()`. Implements if not available natively.
|
8558
8564
|
|
8565
|
+
@since 1.8.0
|
8559
8566
|
@method create
|
8560
8567
|
@for Ember
|
8561
8568
|
*/
|
@@ -8630,7 +8637,7 @@ define("ember-metal/platform/create",
|
|
8630
8637
|
}
|
8631
8638
|
|
8632
8639
|
if (properties !== undefined) {
|
8633
|
-
|
8640
|
+
defineProperties(object, properties);
|
8634
8641
|
}
|
8635
8642
|
|
8636
8643
|
return object;
|
@@ -9730,8 +9737,7 @@ define("ember-metal/run_loop",
|
|
9730
9737
|
May be a function or a string. If you pass a string
|
9731
9738
|
then it will be looked up on the passed target.
|
9732
9739
|
@param {Object} [args*] Any additional arguments you wish to pass to the method.
|
9733
|
-
@return {
|
9734
|
-
when called within an existing loop, no return value is possible.
|
9740
|
+
@return {Function} returns a new function that will always have a particular context
|
9735
9741
|
@since 1.4.0
|
9736
9742
|
*/
|
9737
9743
|
run.bind = function(target, method /* args */) {
|
@@ -10189,7 +10195,7 @@ define("ember-metal/run_loop",
|
|
10189
10195
|
function checkAutoRun() {
|
10190
10196
|
if (!run.currentRunLoop) {
|
10191
10197
|
Ember.assert("You have turned on testing mode, which disabled the run-loop's autorun." +
|
10192
|
-
" You will need to wrap any code with asynchronous side-effects in
|
10198
|
+
" You will need to wrap any code with asynchronous side-effects in a run", !Ember.testing);
|
10193
10199
|
}
|
10194
10200
|
}
|
10195
10201
|
|
@@ -14219,22 +14225,18 @@ define("ember-runtime/controllers/array_controller",
|
|
14219
14225
|
__exports__["default"] = ArrayProxy.extend(ControllerMixin, SortableMixin, {
|
14220
14226
|
|
14221
14227
|
/**
|
14222
|
-
|
14223
|
-
be used to lookup the container for the controller. As an alternative, you
|
14224
|
-
can also provide a controller class as the value.
|
14228
|
+
A string containing the controller name used to wrap items.
|
14225
14229
|
|
14226
14230
|
For example:
|
14227
14231
|
|
14228
14232
|
```javascript
|
14229
14233
|
App.MyArrayController = Ember.ArrayController.extend({
|
14230
|
-
itemController:
|
14231
|
-
//Item Controller Implementation
|
14232
|
-
})
|
14234
|
+
itemController: 'myItem' // use App.MyItemController
|
14233
14235
|
});
|
14234
14236
|
```
|
14235
14237
|
|
14236
14238
|
@property itemController
|
14237
|
-
@type String
|
14239
|
+
@type String
|
14238
14240
|
@default null
|
14239
14241
|
*/
|
14240
14242
|
itemController: null,
|
@@ -14902,6 +14904,9 @@ define("ember-runtime/ext/rsvp",
|
|
14902
14904
|
if (e && e.errorThrown) {
|
14903
14905
|
// jqXHR provides this
|
14904
14906
|
error = e.errorThrown;
|
14907
|
+
if (typeof error === 'string') {
|
14908
|
+
error = new Error(error);
|
14909
|
+
}
|
14905
14910
|
error.__reason_with_error_thrown__ = e;
|
14906
14911
|
} else {
|
14907
14912
|
error = e;
|
@@ -20573,7 +20578,8 @@ define("ember-runtime/system/core_object",
|
|
20573
20578
|
```
|
20574
20579
|
|
20575
20580
|
This will return the original hash that was passed to `meta()`.
|
20576
|
-
|
20581
|
+
|
20582
|
+
@static
|
20577
20583
|
@method metaForProperty
|
20578
20584
|
@param key {String} property name
|
20579
20585
|
*/
|
@@ -20608,7 +20614,8 @@ define("ember-runtime/system/core_object",
|
|
20608
20614
|
/**
|
20609
20615
|
Iterate over each computed property for the class, passing its name
|
20610
20616
|
and any associated metadata (see `metaForProperty`) to the callback.
|
20611
|
-
|
20617
|
+
|
20618
|
+
@static
|
20612
20619
|
@method eachComputedProperty
|
20613
20620
|
@param {Function} callback
|
20614
20621
|
@param {Object} binding
|
@@ -21278,7 +21285,7 @@ define("ember-runtime/system/native_array",
|
|
21278
21285
|
// because they are so common.
|
21279
21286
|
|
21280
21287
|
/**
|
21281
|
-
The NativeArray mixin contains the properties needed to
|
21288
|
+
The NativeArray mixin contains the properties needed to make the native
|
21282
21289
|
Array support Ember.MutableArray and all of its dependent APIs. Unless you
|
21283
21290
|
have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to
|
21284
21291
|
false, this will be applied automatically. Otherwise you can apply the mixin
|
@@ -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.10.0
|
8
|
+
* @version 1.10.0
|
9
9
|
*/
|
10
10
|
|
11
11
|
(function() {
|
@@ -114,7 +114,7 @@ define("ember-metal/core",
|
|
114
114
|
|
115
115
|
@class Ember
|
116
116
|
@static
|
117
|
-
@version 1.10.0
|
117
|
+
@version 1.10.0
|
118
118
|
*/
|
119
119
|
|
120
120
|
if ('undefined' === typeof Ember) {
|
@@ -141,10 +141,10 @@ define("ember-metal/core",
|
|
141
141
|
/**
|
142
142
|
@property VERSION
|
143
143
|
@type String
|
144
|
-
@default '1.10.0
|
144
|
+
@default '1.10.0'
|
145
145
|
@static
|
146
146
|
*/
|
147
|
-
Ember.VERSION = '1.10.0
|
147
|
+
Ember.VERSION = '1.10.0';
|
148
148
|
|
149
149
|
/**
|
150
150
|
Standard environmental variables. You can define these in a global `EmberENV`
|
@@ -183,7 +183,7 @@ define("ember-metal/core",
|
|
183
183
|
/**
|
184
184
|
Hash of enabled Canary features. Add to this before creating your application.
|
185
185
|
|
186
|
-
You can also define `
|
186
|
+
You can also define `EmberENV.FEATURES` if you need to enable features flagged at runtime.
|
187
187
|
|
188
188
|
@class FEATURES
|
189
189
|
@namespace Ember
|
@@ -199,8 +199,8 @@ define("ember-metal/core",
|
|
199
199
|
|
200
200
|
You can define the following configuration options:
|
201
201
|
|
202
|
-
* `
|
203
|
-
* `
|
202
|
+
* `EmberENV.ENABLE_ALL_FEATURES` - force all features to be enabled.
|
203
|
+
* `EmberENV.ENABLE_OPTIONAL_FEATURES` - enable any features that have not been explicitly
|
204
204
|
enabled/disabled.
|
205
205
|
|
206
206
|
@method isEnabled
|
@@ -236,7 +236,7 @@ define("ember-metal/core",
|
|
236
236
|
|
237
237
|
In general we recommend leaving this option set to true since it rarely
|
238
238
|
conflicts with other code. If you need to turn it off however, you can
|
239
|
-
define an `
|
239
|
+
define an `EmberENV.EXTEND_PROTOTYPES` config to disable it.
|
240
240
|
|
241
241
|
@property EXTEND_PROTOTYPES
|
242
242
|
@type Boolean
|
@@ -302,8 +302,8 @@ define("ember-metal/core",
|
|
302
302
|
__exports__["default"] = Ember;
|
303
303
|
});
|
304
304
|
define("ember-template-compiler",
|
305
|
-
["ember-metal/core","ember-template-compiler/system/precompile","ember-template-compiler/system/compile","ember-template-compiler/system/template","ember-template-compiler/plugins","ember-template-compiler/plugins/transform-each-in-to-hash","ember-template-compiler/plugins/transform-with-as-to-hash","exports"],
|
306
|
-
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {
|
305
|
+
["ember-metal/core","ember-template-compiler/system/precompile","ember-template-compiler/system/compile","ember-template-compiler/system/template","ember-template-compiler/plugins","ember-template-compiler/plugins/transform-each-in-to-hash","ember-template-compiler/plugins/transform-with-as-to-hash","ember-template-compiler/compat","exports"],
|
306
|
+
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {
|
307
307
|
"use strict";
|
308
308
|
var _Ember = __dependency1__["default"];
|
309
309
|
var precompile = __dependency2__["default"];
|
@@ -314,6 +314,8 @@ define("ember-template-compiler",
|
|
314
314
|
var TransformEachInToHash = __dependency6__["default"];
|
315
315
|
var TransformWithAsToHash = __dependency7__["default"];
|
316
316
|
|
317
|
+
// used for adding Ember.Handlebars.compile for backwards compat
|
318
|
+
|
317
319
|
registerPlugin('ast', TransformWithAsToHash);
|
318
320
|
registerPlugin('ast', TransformEachInToHash);
|
319
321
|
|
@@ -323,6 +325,50 @@ define("ember-template-compiler",
|
|
323
325
|
__exports__.template = template;
|
324
326
|
__exports__.registerPlugin = registerPlugin;
|
325
327
|
});
|
328
|
+
define("ember-template-compiler/compat",
|
329
|
+
["ember-metal/core","ember-template-compiler/compat/precompile","ember-template-compiler/system/compile","ember-template-compiler/system/template"],
|
330
|
+
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__) {
|
331
|
+
"use strict";
|
332
|
+
var Ember = __dependency1__["default"];
|
333
|
+
var precompile = __dependency2__["default"];
|
334
|
+
var compile = __dependency3__["default"];
|
335
|
+
var template = __dependency4__["default"];
|
336
|
+
|
337
|
+
var EmberHandlebars = Ember.Handlebars = Ember.Handlebars || {};
|
338
|
+
|
339
|
+
EmberHandlebars.precompile = precompile;
|
340
|
+
EmberHandlebars.compile = compile;
|
341
|
+
EmberHandlebars.template = template;
|
342
|
+
});
|
343
|
+
define("ember-template-compiler/compat/precompile",
|
344
|
+
["exports"],
|
345
|
+
function(__exports__) {
|
346
|
+
"use strict";
|
347
|
+
/**
|
348
|
+
@module ember
|
349
|
+
@submodule ember-template-compiler
|
350
|
+
*/
|
351
|
+
|
352
|
+
var compile, compileSpec;
|
353
|
+
|
354
|
+
__exports__["default"] = function(string) {
|
355
|
+
if ((!compile || !compileSpec) && Ember.__loader.registry['htmlbars-compiler/compiler']) {
|
356
|
+
var Compiler = requireModule('htmlbars-compiler/compiler');
|
357
|
+
|
358
|
+
compile = Compiler.compile;
|
359
|
+
compileSpec = Compiler.compileSpec;
|
360
|
+
}
|
361
|
+
|
362
|
+
if (!compile || !compileSpec) {
|
363
|
+
throw new Error('Cannot call `precompile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `precompile`.');
|
364
|
+
}
|
365
|
+
|
366
|
+
var asObject = arguments[1] === undefined ? true : arguments[1];
|
367
|
+
var compileFunc = asObject ? compile : compileSpec;
|
368
|
+
|
369
|
+
return compileFunc(string);
|
370
|
+
}
|
371
|
+
});
|
326
372
|
define("ember-template-compiler/plugins",
|
327
373
|
["exports"],
|
328
374
|
function(__exports__) {
|
@@ -502,17 +548,17 @@ define("ember-template-compiler/plugins/transform-with-as-to-hash",
|
|
502
548
|
__exports__["default"] = TransformWithAsToHash;
|
503
549
|
});
|
504
550
|
define("ember-template-compiler/system/compile",
|
505
|
-
["
|
506
|
-
function(__dependency1__, __dependency2__,
|
551
|
+
["ember-template-compiler/system/compile_options","ember-template-compiler/system/template","exports"],
|
552
|
+
function(__dependency1__, __dependency2__, __exports__) {
|
507
553
|
"use strict";
|
508
554
|
/**
|
509
555
|
@module ember
|
510
556
|
@submodule ember-template-compiler
|
511
557
|
*/
|
512
558
|
|
513
|
-
var compile
|
514
|
-
var compileOptions =
|
515
|
-
var template =
|
559
|
+
var compile;
|
560
|
+
var compileOptions = __dependency1__["default"];
|
561
|
+
var template = __dependency2__["default"];
|
516
562
|
|
517
563
|
/**
|
518
564
|
Uses HTMLBars `compile` function to process a string into a compiled template.
|
@@ -524,6 +570,14 @@ define("ember-template-compiler/system/compile",
|
|
524
570
|
@param {String} templateString This is the string to be compiled by HTMLBars.
|
525
571
|
*/
|
526
572
|
__exports__["default"] = function(templateString) {
|
573
|
+
if (!compile && Ember.__loader.registry['htmlbars-compiler/compiler']) {
|
574
|
+
compile = requireModule('htmlbars-compiler/compiler').compile;
|
575
|
+
}
|
576
|
+
|
577
|
+
if (!compile) {
|
578
|
+
throw new Error('Cannot call `compile` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compile`.');
|
579
|
+
}
|
580
|
+
|
527
581
|
var templateSpec = compile(templateString, compileOptions());
|
528
582
|
|
529
583
|
return template(templateSpec);
|
@@ -556,16 +610,16 @@ define("ember-template-compiler/system/compile_options",
|
|
556
610
|
}
|
557
611
|
});
|
558
612
|
define("ember-template-compiler/system/precompile",
|
559
|
-
["
|
560
|
-
function(__dependency1__,
|
613
|
+
["ember-template-compiler/system/compile_options","exports"],
|
614
|
+
function(__dependency1__, __exports__) {
|
561
615
|
"use strict";
|
562
616
|
/**
|
563
617
|
@module ember
|
564
618
|
@submodule ember-template-compiler
|
565
619
|
*/
|
566
620
|
|
567
|
-
var
|
568
|
-
var
|
621
|
+
var compileOptions = __dependency1__["default"];
|
622
|
+
var compileSpec;
|
569
623
|
|
570
624
|
/**
|
571
625
|
Uses HTMLBars `compile` function to process a string into a compiled template string.
|
@@ -578,6 +632,14 @@ define("ember-template-compiler/system/precompile",
|
|
578
632
|
@param {String} templateString This is the string to be compiled by HTMLBars.
|
579
633
|
*/
|
580
634
|
__exports__["default"] = function(templateString) {
|
635
|
+
if (!compileSpec && Ember.__loader.registry['htmlbars-compiler/compiler']) {
|
636
|
+
compileSpec = requireModule('htmlbars-compiler/compiler').compileSpec;
|
637
|
+
}
|
638
|
+
|
639
|
+
if (!compileSpec) {
|
640
|
+
throw new Error('Cannot call `compileSpec` without the template compiler loaded. Please load `ember-template-compiler.js` prior to calling `compileSpec`.');
|
641
|
+
}
|
642
|
+
|
581
643
|
return compileSpec(templateString, compileOptions());
|
582
644
|
}
|
583
645
|
});
|
@@ -788,13 +850,13 @@ define("htmlbars-compiler/fragment-javascript-compiler",
|
|
788
850
|
};
|
789
851
|
});
|
790
852
|
define("htmlbars-compiler/fragment-opcode-compiler",
|
791
|
-
["./template-visitor","./utils","../htmlbars-util/array-utils","exports"],
|
792
|
-
function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
|
853
|
+
["./template-visitor","./utils","../htmlbars-util","../htmlbars-util/array-utils","exports"],
|
854
|
+
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
|
793
855
|
"use strict";
|
794
856
|
var TemplateVisitor = __dependency1__["default"];
|
795
857
|
var processOpcodes = __dependency2__.processOpcodes;
|
796
|
-
var
|
797
|
-
var forEach =
|
858
|
+
var getAttrNamespace = __dependency3__.getAttrNamespace;
|
859
|
+
var forEach = __dependency4__.forEach;
|
798
860
|
|
799
861
|
function FragmentOpcodeCompiler() {
|
800
862
|
this.opcodes = [];
|
@@ -854,7 +916,7 @@ define("htmlbars-compiler/fragment-opcode-compiler",
|
|
854
916
|
FragmentOpcodeCompiler.prototype.attribute = function(attr) {
|
855
917
|
if (attr.value.type === 'TextNode') {
|
856
918
|
|
857
|
-
var namespace =
|
919
|
+
var namespace = getAttrNamespace(attr.name);
|
858
920
|
|
859
921
|
this.opcode('setAttribute', [attr.name, attr.value.chars, namespace]);
|
860
922
|
}
|
@@ -1126,14 +1188,14 @@ define("htmlbars-compiler/hydration-javascript-compiler",
|
|
1126
1188
|
};
|
1127
1189
|
});
|
1128
1190
|
define("htmlbars-compiler/hydration-opcode-compiler",
|
1129
|
-
["./template-visitor","./utils","../htmlbars-util/array-utils","../htmlbars-syntax/utils","exports"],
|
1130
|
-
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
|
1191
|
+
["./template-visitor","./utils","../htmlbars-util","../htmlbars-util/array-utils","../htmlbars-syntax/utils","exports"],
|
1192
|
+
function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {
|
1131
1193
|
"use strict";
|
1132
1194
|
var TemplateVisitor = __dependency1__["default"];
|
1133
1195
|
var processOpcodes = __dependency2__.processOpcodes;
|
1134
|
-
var
|
1135
|
-
var forEach =
|
1136
|
-
var isHelper =
|
1196
|
+
var getAttrNamespace = __dependency3__.getAttrNamespace;
|
1197
|
+
var forEach = __dependency4__.forEach;
|
1198
|
+
var isHelper = __dependency5__.isHelper;
|
1137
1199
|
|
1138
1200
|
function unwrapMustache(mustache) {
|
1139
1201
|
if (isHelper(mustache.sexpr)) {
|
@@ -1305,7 +1367,7 @@ define("htmlbars-compiler/hydration-opcode-compiler",
|
|
1305
1367
|
HydrationOpcodeCompiler.prototype.attribute = function(attr) {
|
1306
1368
|
var value = attr.value;
|
1307
1369
|
var escaped = true;
|
1308
|
-
var namespace =
|
1370
|
+
var namespace = getAttrNamespace(attr.name);
|
1309
1371
|
|
1310
1372
|
// TODO: Introduce context specific AST nodes to avoid switching here.
|
1311
1373
|
if (value.type === 'TextNode') {
|
@@ -1545,16 +1607,20 @@ define("htmlbars-compiler/template-compiler",
|
|
1545
1607
|
this.getHydrationHooks(indent + ' ', this.hydrationCompiler.hooks) +
|
1546
1608
|
indent+' dom.detectNamespace(contextualElement);\n' +
|
1547
1609
|
indent+' var fragment;\n' +
|
1548
|
-
indent+' if (
|
1549
|
-
indent+'
|
1550
|
-
indent+'
|
1551
|
-
indent+' this.
|
1552
|
-
indent+'
|
1553
|
-
indent+'
|
1610
|
+
indent+' if (env.useFragmentCache && dom.canClone) {\n' +
|
1611
|
+
indent+' if (this.cachedFragment === null) {\n' +
|
1612
|
+
indent+' fragment = this.build(dom);\n' +
|
1613
|
+
indent+' if (this.hasRendered) {\n' +
|
1614
|
+
indent+' this.cachedFragment = fragment;\n' +
|
1615
|
+
indent+' } else {\n' +
|
1616
|
+
indent+' this.hasRendered = true;\n' +
|
1617
|
+
indent+' }\n' +
|
1554
1618
|
indent+' }\n' +
|
1555
|
-
indent+'
|
1556
|
-
indent+'
|
1557
|
-
indent+'
|
1619
|
+
indent+' if (this.cachedFragment) {\n' +
|
1620
|
+
indent+' fragment = dom.cloneNode(this.cachedFragment, true);\n' +
|
1621
|
+
indent+' }\n' +
|
1622
|
+
indent+' } else {\n' +
|
1623
|
+
indent+' fragment = this.build(dom);\n' +
|
1558
1624
|
indent+' }\n' +
|
1559
1625
|
hydrationProgram +
|
1560
1626
|
indent+' return fragment;\n' +
|
@@ -1862,23 +1928,7 @@ define("htmlbars-compiler/utils",
|
|
1862
1928
|
}
|
1863
1929
|
}
|
1864
1930
|
|
1865
|
-
__exports__.processOpcodes = processOpcodes
|
1866
|
-
var defaultNamespaces = {
|
1867
|
-
html: 'http://www.w3.org/1999/xhtml',
|
1868
|
-
mathml: 'http://www.w3.org/1998/Math/MathML',
|
1869
|
-
svg: 'http://www.w3.org/2000/svg',
|
1870
|
-
xlink: 'http://www.w3.org/1999/xlink',
|
1871
|
-
xml: 'http://www.w3.org/XML/1998/namespace'
|
1872
|
-
};
|
1873
|
-
|
1874
|
-
function getNamespace(attrName) {
|
1875
|
-
var parts = attrName.split(':');
|
1876
|
-
if (parts.length > 1) {
|
1877
|
-
return defaultNamespaces[parts[0]];
|
1878
|
-
}
|
1879
|
-
}
|
1880
|
-
|
1881
|
-
__exports__.getNamespace = getNamespace;
|
1931
|
+
__exports__.processOpcodes = processOpcodes;
|
1882
1932
|
});
|
1883
1933
|
define("htmlbars-syntax",
|
1884
1934
|
["./htmlbars-syntax/walker","./htmlbars-syntax/builders","./htmlbars-syntax/parser","exports"],
|
@@ -3332,7 +3382,7 @@ define("htmlbars-syntax/node-handlers",
|
|
3332
3382
|
// Ensure that that the element stack is balanced properly.
|
3333
3383
|
var poppedNode = this.elementStack.pop();
|
3334
3384
|
if (poppedNode !== node) {
|
3335
|
-
throw new Error("Unclosed element
|
3385
|
+
throw new Error("Unclosed element `" + poppedNode.tag + "` (on line " + poppedNode.loc.start.line + ").");
|
3336
3386
|
}
|
3337
3387
|
|
3338
3388
|
return node;
|
@@ -3482,6 +3532,20 @@ define("htmlbars-syntax/parser",
|
|
3482
3532
|
// But this version of the transpiler does not support it properly
|
3483
3533
|
var syntax = __dependency7__;
|
3484
3534
|
|
3535
|
+
var splitLines;
|
3536
|
+
// IE8 throws away blank pieces when splitting strings with a regex
|
3537
|
+
// So we split using a string instead as appropriate
|
3538
|
+
if ("foo\n\nbar".split(/\n/).length === 2) {
|
3539
|
+
splitLines = function(str) {
|
3540
|
+
var clean = str.replace(/\r\n?/g, '\n');
|
3541
|
+
return clean.split('\n');
|
3542
|
+
};
|
3543
|
+
} else {
|
3544
|
+
splitLines = function(str) {
|
3545
|
+
return str.split(/(?:\r\n?|\n)/g);
|
3546
|
+
};
|
3547
|
+
}
|
3548
|
+
|
3485
3549
|
function preprocess(html, options) {
|
3486
3550
|
var ast = (typeof html === 'object') ? html : parse(html);
|
3487
3551
|
var combined = new HTMLProcessor(html, options).acceptNode(ast);
|
@@ -3507,7 +3571,7 @@ define("htmlbars-syntax/parser",
|
|
3507
3571
|
this.tokenHandlers = tokenHandlers;
|
3508
3572
|
|
3509
3573
|
if (typeof source === 'string') {
|
3510
|
-
this.source = source
|
3574
|
+
this.source = splitLines(source);
|
3511
3575
|
}
|
3512
3576
|
}
|
3513
3577
|
|
@@ -3810,11 +3874,11 @@ define("htmlbars-syntax/tokenizer",
|
|
3810
3874
|
__exports__.unwrapMustache = unwrapMustache;__exports__.Tokenizer = Tokenizer;
|
3811
3875
|
});
|
3812
3876
|
define("htmlbars-syntax/utils",
|
3813
|
-
["./builders","exports"],
|
3814
|
-
function(__dependency1__, __exports__) {
|
3877
|
+
["./builders","../htmlbars-util/array-utils","exports"],
|
3878
|
+
function(__dependency1__, __dependency2__, __exports__) {
|
3815
3879
|
"use strict";
|
3816
3880
|
var buildText = __dependency1__.buildText;
|
3817
|
-
|
3881
|
+
var indexOfArray = __dependency2__.indexOfArray;
|
3818
3882
|
// Regex to validate the identifier for block parameters.
|
3819
3883
|
// Based on the ID validation regex in Handlebars.
|
3820
3884
|
|
@@ -3832,7 +3896,7 @@ define("htmlbars-syntax/utils",
|
|
3832
3896
|
attrNames.push(element.attributes[i].name);
|
3833
3897
|
}
|
3834
3898
|
|
3835
|
-
var asIndex = attrNames
|
3899
|
+
var asIndex = indexOfArray(attrNames, 'as');
|
3836
3900
|
|
3837
3901
|
if (asIndex !== -1 && l > asIndex && attrNames[asIndex + 1].charAt(0) === '|') {
|
3838
3902
|
// Some basic validation, since we're doing the parsing ourselves
|
@@ -4007,6 +4071,9 @@ define("htmlbars-test-helpers",
|
|
4007
4071
|
|
4008
4072
|
// detect side-effects of cloning svg elements in IE9-11
|
4009
4073
|
var ieSVGInnerHTML = (function () {
|
4074
|
+
if (!document.createElementNS) {
|
4075
|
+
return false;
|
4076
|
+
}
|
4010
4077
|
var div = document.createElement('div');
|
4011
4078
|
var node = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
4012
4079
|
div.appendChild(node);
|
@@ -4019,20 +4086,31 @@ define("htmlbars-test-helpers",
|
|
4019
4086
|
// drop newlines in IE8
|
4020
4087
|
actualHTML = actualHTML.replace(/\r\n/gm, '');
|
4021
4088
|
// downcase ALLCAPS tags in IE8
|
4022
|
-
actualHTML = actualHTML.replace(/<\/?[A-Z]+/gi, function(tag){
|
4089
|
+
actualHTML = actualHTML.replace(/<\/?[A-Z\-]+/gi, function(tag){
|
4023
4090
|
return tag.toLowerCase();
|
4024
4091
|
});
|
4025
4092
|
// quote ids in IE8
|
4026
4093
|
actualHTML = actualHTML.replace(/id=([^ >]+)/gi, function(match, id){
|
4027
4094
|
return 'id="'+id+'"';
|
4028
4095
|
});
|
4096
|
+
// IE8 adds ':' to some tags
|
4097
|
+
// <keygen> becomes <:keygen>
|
4098
|
+
actualHTML = actualHTML.replace(/<(\/?):([^ >]+)/gi, function(match, slash, tag){
|
4099
|
+
return '<'+slash+tag;
|
4100
|
+
});
|
4101
|
+
|
4102
|
+
// Normalize the style attribute
|
4103
|
+
actualHTML = actualHTML.replace(/style="(.+?)"/gi, function(match, val){
|
4104
|
+
return 'style="'+val.toLowerCase()+';"';
|
4105
|
+
});
|
4106
|
+
|
4029
4107
|
}
|
4030
4108
|
if (ieSVGInnerHTML) {
|
4031
4109
|
// Replace `<svg xmlns="http://www.w3.org/2000/svg" height="50%" />` with `<svg height="50%"></svg>`, etc.
|
4032
4110
|
// drop namespace attribute
|
4033
4111
|
actualHTML = actualHTML.replace(/ xmlns="[^"]+"/, '');
|
4034
4112
|
// replace self-closing elements
|
4035
|
-
actualHTML = actualHTML.replace(/<([
|
4113
|
+
actualHTML = actualHTML.replace(/<([^ >]+) [^\/>]*\/>/gi, function(tag, tagName) {
|
4036
4114
|
return tag.slice(0, tag.length - 3) + '></' + tagName + '>';
|
4037
4115
|
});
|
4038
4116
|
}
|
@@ -4048,17 +4126,41 @@ define("htmlbars-test-helpers",
|
|
4048
4126
|
equal(element.outerHTML, checkedInputString);
|
4049
4127
|
}
|
4050
4128
|
|
4051
|
-
__exports__.isCheckedInputHTML = isCheckedInputHTML
|
4129
|
+
__exports__.isCheckedInputHTML = isCheckedInputHTML;// check which property has the node's text content
|
4130
|
+
var textProperty = document.createElement('div').textContent === undefined ? 'innerText' : 'textContent';
|
4131
|
+
function getTextContent(el) {
|
4132
|
+
// textNode
|
4133
|
+
if (el.nodeType === 3) {
|
4134
|
+
return el.nodeValue;
|
4135
|
+
} else {
|
4136
|
+
return el[textProperty];
|
4137
|
+
}
|
4138
|
+
}
|
4139
|
+
|
4140
|
+
__exports__.getTextContent = getTextContent;// IE8 does not have Object.create, so use a polyfill if needed.
|
4141
|
+
// Polyfill based on Mozilla's (MDN)
|
4142
|
+
function createObject(obj) {
|
4143
|
+
if (typeof Object.create === 'function') {
|
4144
|
+
return Object.create(obj);
|
4145
|
+
} else {
|
4146
|
+
var Temp = function() {};
|
4147
|
+
Temp.prototype = obj;
|
4148
|
+
return new Temp();
|
4149
|
+
}
|
4150
|
+
}
|
4151
|
+
__exports__.createObject = createObject;
|
4052
4152
|
});
|
4053
4153
|
define("htmlbars-util",
|
4054
|
-
["./htmlbars-util/safe-string","./htmlbars-util/handlebars/utils","exports"],
|
4055
|
-
function(__dependency1__, __dependency2__, __exports__) {
|
4154
|
+
["./htmlbars-util/safe-string","./htmlbars-util/handlebars/utils","./htmlbars-util/namespaces","exports"],
|
4155
|
+
function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
|
4056
4156
|
"use strict";
|
4057
4157
|
var SafeString = __dependency1__["default"];
|
4058
4158
|
var escapeExpression = __dependency2__.escapeExpression;
|
4159
|
+
var getAttrNamespace = __dependency3__.getAttrNamespace;
|
4059
4160
|
|
4060
4161
|
__exports__.SafeString = SafeString;
|
4061
4162
|
__exports__.escapeExpression = escapeExpression;
|
4163
|
+
__exports__.getAttrNamespace = getAttrNamespace;
|
4062
4164
|
});
|
4063
4165
|
define("htmlbars-util/array-utils",
|
4064
4166
|
["exports"],
|
@@ -4088,7 +4190,29 @@ define("htmlbars-util/array-utils",
|
|
4088
4190
|
return output;
|
4089
4191
|
}
|
4090
4192
|
|
4091
|
-
__exports__.map = map;
|
4193
|
+
__exports__.map = map;var getIdx;
|
4194
|
+
if (Array.prototype.indexOf) {
|
4195
|
+
getIdx = function(array, obj, from){
|
4196
|
+
return array.indexOf(obj, from);
|
4197
|
+
};
|
4198
|
+
} else {
|
4199
|
+
getIdx = function(array, obj, from) {
|
4200
|
+
if (from === undefined || from === null) {
|
4201
|
+
from = 0;
|
4202
|
+
} else if (from < 0) {
|
4203
|
+
from = Math.max(0, array.length + from);
|
4204
|
+
}
|
4205
|
+
for (var i = from, l= array.length; i < l; i++) {
|
4206
|
+
if (array[i] === obj) {
|
4207
|
+
return i;
|
4208
|
+
}
|
4209
|
+
}
|
4210
|
+
return -1;
|
4211
|
+
};
|
4212
|
+
}
|
4213
|
+
|
4214
|
+
var indexOfArray = getIdx;
|
4215
|
+
__exports__.indexOfArray = indexOfArray;
|
4092
4216
|
});
|
4093
4217
|
define("htmlbars-util/handlebars/safe-string",
|
4094
4218
|
["exports"],
|
@@ -4197,6 +4321,33 @@ define("htmlbars-util/handlebars/utils",
|
|
4197
4321
|
|
4198
4322
|
__exports__.appendContextPath = appendContextPath;
|
4199
4323
|
});
|
4324
|
+
define("htmlbars-util/namespaces",
|
4325
|
+
["exports"],
|
4326
|
+
function(__exports__) {
|
4327
|
+
"use strict";
|
4328
|
+
// ref http://dev.w3.org/html5/spec-LC/namespaces.html
|
4329
|
+
var defaultNamespaces = {
|
4330
|
+
html: 'http://www.w3.org/1999/xhtml',
|
4331
|
+
mathml: 'http://www.w3.org/1998/Math/MathML',
|
4332
|
+
svg: 'http://www.w3.org/2000/svg',
|
4333
|
+
xlink: 'http://www.w3.org/1999/xlink',
|
4334
|
+
xml: 'http://www.w3.org/XML/1998/namespace'
|
4335
|
+
};
|
4336
|
+
|
4337
|
+
function getAttrNamespace(attrName) {
|
4338
|
+
var namespace;
|
4339
|
+
|
4340
|
+
var colonIndex = attrName.indexOf(':');
|
4341
|
+
if (colonIndex !== -1) {
|
4342
|
+
var prefix = attrName.slice(0, colonIndex);
|
4343
|
+
namespace = defaultNamespaces[prefix];
|
4344
|
+
}
|
4345
|
+
|
4346
|
+
return namespace || null;
|
4347
|
+
}
|
4348
|
+
|
4349
|
+
__exports__.getAttrNamespace = getAttrNamespace;
|
4350
|
+
});
|
4200
4351
|
define("htmlbars-util/object-utils",
|
4201
4352
|
["exports"],
|
4202
4353
|
function(__exports__) {
|