ember-appkit-rails 0.0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +21 -3
- data/lib/ember/appkit/rails/version.rb +1 -1
- data/lib/generators/ember/component_generator.rb +24 -0
- data/lib/generators/ember/controller_generator.rb +31 -0
- data/lib/generators/ember/generator_helpers.rb +15 -3
- data/lib/generators/ember/model_generator.rb +47 -0
- data/lib/generators/ember/resource_generator.rb +25 -0
- data/lib/generators/ember/template_generator.rb +20 -0
- data/lib/generators/ember/view_generator.rb +23 -0
- data/lib/generators/templates/array_controller.js.es6 +4 -0
- data/lib/generators/templates/component.js.es6 +2 -0
- data/lib/generators/templates/component.template.hbs +0 -0
- data/lib/generators/templates/controller.js.es6 +3 -0
- data/lib/generators/templates/model.js.es6 +11 -0
- data/lib/generators/templates/object_controller.js.es6 +4 -0
- data/lib/generators/templates/template.hbs +5 -0
- data/lib/generators/templates/view.js.es6 +3 -0
- data/test/dummy/app/assets/javascripts/controllers/index.js.es6 +1 -3
- data/test/dummy/config/environments/development.rb +0 -1
- data/test/dummy/config/environments/test.rb +0 -1
- data/test/dummy/log/development.log +392 -0
- data/test/dummy/log/test.log +1160 -0
- data/test/dummy/tmp/app/assets/javascripts/templates/post.hbs +5 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{f2a13b6bc27457cb7513b583b4e69ed5 → 07a9ce16127008e142b1b0223c4d7784} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/19c9bc7dbf67a891e93c7a663a62ff1c +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/22d5df6f378a04858f2123ee6e176ff1 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{f8c79edb4a48d7e4f74a6113d25f4699 → 2ad53936554864466b852e4eae6d6803} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/30e6b42a491dc4952ff020137405d502 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/331122f2f78d79778408023cf5bad1e3 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/34b3026e7f937c6a19a0aee7f8451aad +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/36b770b8db4bb47ce9c524d7104be2e9 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4a1d4e32cd7b9fd1c62bfd553ae56051 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4bde569e155e5abfc2bc79bb61721688 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{f46d0d400dce471af50b05c9ac272ba9 → 5776b21d8a87e618d8323a9c4d3c86ff} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/720ee922899be7948cc2a8b27660ce0b +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7689ffe6d7c831ee178e07106482b2cc +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7bf1770d3a1c8bc1b59a4bc89d5c4bca +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7d008b32a16b10ea72ea849f47d9a095 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{3b825365f669ab10c71ccee9d64335b6 → 889c68982dadf8d222309363924fe44b} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/8e9feb35d7e388f760d17aaf89b32731 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/8ebc8c58233ab12eee6edfc0feca2492 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{0f63b9e77aec7451fc0c21d376f8eb28 → b340d5578308bb4c197a8ca3538b0e24} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/b3a5b51571520b61f892c51e979b9f53 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/bb4a2293175928af3e23c47488077098 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/bf689240392e7355c0de5cfd47272146 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c0bb6b15bdd48873e96974816e18abe9 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/c8c4c1b316845f30168739b5795846d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{b692b37dad694df23f130ceda8c808dd → dd568c8ef1f3f20b5931d72ef2eb5963} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e2a67ad17895f7711966ca1a5ff7af86 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e44f5ebcd8f42995512e64b96b63c9cf +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e8aa57b28c86586b8b7344feb891c43f +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e9abb671d48f6ff2be6ffb463ea652bf +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/ed5238112abbfd6a794a100804365903 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/ember-rails/ember.js +185 -120
- data/test/dummy/tmp/generator_test_output/app/assets/javascripts/application.js +0 -0
- data/test/dummy/tmp/generator_test_output/app/assets/javascripts/custom/application.js +0 -0
- data/test/dummy/tmp/generator_test_output/app/assets/javascripts/views/post.js.es6 +3 -0
- data/test/generators/bootstrap_generator_test.rb +18 -0
- data/test/generators/component_generator_test.rb +58 -0
- data/test/generators/controller_generator_test.rb +51 -0
- data/test/generators/model_generator_test.rb +48 -0
- data/test/generators/resource_generator_test.rb +43 -0
- data/test/generators/template_generator_test.rb +31 -0
- data/test/generators/view_generator_test.rb +55 -0
- data/test/support/generator_test_support.rb +14 -1
- data/vendor/assets/javascripts/app.js.es6 +13 -0
- data/{test/dummy/tmp/cache/assets/development/sprockets/ebc77031c7503fcc60aaa5c603aa9138 → vendor/assets/javascripts/ember-appkit/almond.js} +0 -0
- data/vendor/assets/javascripts/ember-appkit/index.js +5 -0
- data/vendor/assets/javascripts/ember-appkit/resolver.js +169 -0
- metadata +68 -132
- data/test/dummy/tmp/cache/assets/development/sprockets/009d416d9e579ca73b72e11a882283db +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0f63b9e77aec7451fc0c21d376f8eb28 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13c56481151a0f8ff72b183daf16c0ba +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/19c9bc7dbf67a891e93c7a663a62ff1c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/22d5df6f378a04858f2123ee6e176ff1 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/30095b6d23a5bac343099341a88a9768 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/30e6b42a491dc4952ff020137405d502 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/32a4bf18777e24ecbd1bb7bf1afb9d41 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/331122f2f78d79778408023cf5bad1e3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/34b3026e7f937c6a19a0aee7f8451aad +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/36b770b8db4bb47ce9c524d7104be2e9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3a168599f447464b14332bdfd140ff00 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3b825365f669ab10c71ccee9d64335b6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3f60ef531652da88a591066588c06000 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3fa9b534ed1d39ba8274b7ab49a38d11 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4138a0978ec2097970b05e52c1d1cf94 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/61df2fa75b3733030a82b166f1c135e9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/720ee922899be7948cc2a8b27660ce0b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/7689ffe6d7c831ee178e07106482b2cc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/776c336ba7d7935e564e9bf5072e3dd8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/7bf1770d3a1c8bc1b59a4bc89d5c4bca +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/7d008b32a16b10ea72ea849f47d9a095 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/832a081f27208b2b977b49b487d2bc89 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8333b0a9d6f14badf985b50415d5deee +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8e9feb35d7e388f760d17aaf89b32731 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8ebc8c58233ab12eee6edfc0feca2492 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8fc8cc19ffe18f3fb8d3a8506d9169b3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/91ce00d4fbb2d91206d66229af2dda20 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9475a88de7edd7f2eb6268573986cbdd +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/aee731d32c121990e31f5d68a034087c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b6477f770c118c6b4362a1043ea87879 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b692b37dad694df23f130ceda8c808dd +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b7ee576b652da2c60e89e6a466d073f4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c0bb6b15bdd48873e96974816e18abe9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c8c4c1b316845f30168739b5795846d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d05ba20923e543730084eb723e770f12 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e1658f6900cfc0ba388976a2fd25f94f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e2a67ad17895f7711966ca1a5ff7af86 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e44f5ebcd8f42995512e64b96b63c9cf +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e610538e56e78934ee9fa328294fcc06 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e8aa57b28c86586b8b7344feb891c43f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ed5238112abbfd6a794a100804365903 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f2a13b6bc27457cb7513b583b4e69ed5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f46d0d400dce471af50b05c9ac272ba9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f8c79edb4a48d7e4f74a6113d25f4699 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fa20075040efd309e2e2fdb310135e63 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/fdcd9e39dbe03f947086b7e6c1ce29d2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/009d416d9e579ca73b72e11a882283db +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/32a4bf18777e24ecbd1bb7bf1afb9d41 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3a168599f447464b14332bdfd140ff00 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3fa9b534ed1d39ba8274b7ab49a38d11 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/91ce00d4fbb2d91206d66229af2dda20 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/fdcd9e39dbe03f947086b7e6c1ce29d2 +0 -0
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -8,7 +8,7 @@
|
|
8
8
|
// ==========================================================================
|
9
9
|
|
10
10
|
|
11
|
-
// Version: 1.2.0-beta.
|
11
|
+
// Version: 1.2.0-beta.3
|
12
12
|
|
13
13
|
(function() {
|
14
14
|
/*global __fail__*/
|
@@ -194,7 +194,7 @@ if (!Ember.testing) {
|
|
194
194
|
// ==========================================================================
|
195
195
|
|
196
196
|
|
197
|
-
// Version: 1.2.0-beta.
|
197
|
+
// Version: 1.2.0-beta.3
|
198
198
|
|
199
199
|
(function() {
|
200
200
|
var define, requireModule;
|
@@ -259,7 +259,7 @@ var define, requireModule;
|
|
259
259
|
|
260
260
|
@class Ember
|
261
261
|
@static
|
262
|
-
@version 1.2.0-beta.
|
262
|
+
@version 1.2.0-beta.3
|
263
263
|
*/
|
264
264
|
|
265
265
|
if ('undefined' === typeof Ember) {
|
@@ -286,10 +286,10 @@ Ember.toString = function() { return "Ember"; };
|
|
286
286
|
/**
|
287
287
|
@property VERSION
|
288
288
|
@type String
|
289
|
-
@default '1.2.0-beta.
|
289
|
+
@default '1.2.0-beta.3'
|
290
290
|
@final
|
291
291
|
*/
|
292
|
-
Ember.VERSION = '1.2.0-beta.
|
292
|
+
Ember.VERSION = '1.2.0-beta.3';
|
293
293
|
|
294
294
|
/**
|
295
295
|
Standard environmental variables. You can define these in a global `ENV`
|
@@ -537,7 +537,7 @@ var platform = Ember.platform = {};
|
|
537
537
|
*/
|
538
538
|
Ember.create = Object.create;
|
539
539
|
|
540
|
-
// IE8 has Object.create but it couldn't treat property
|
540
|
+
// IE8 has Object.create but it couldn't treat property descriptors.
|
541
541
|
if (Ember.create) {
|
542
542
|
if (Ember.create({a: 1}, {a: {value: 2}}).a !== 2) {
|
543
543
|
Ember.create = null;
|
@@ -15800,7 +15800,6 @@ CoreObject.PrototypeMixin = Mixin.create({
|
|
15800
15800
|
```javascript
|
15801
15801
|
App.Person = Ember.Object.extend({
|
15802
15802
|
init: function() {
|
15803
|
-
this._super();
|
15804
15803
|
alert('Name is ' + this.get('name'));
|
15805
15804
|
}
|
15806
15805
|
});
|
@@ -17421,7 +17420,7 @@ Ember.NativeArray = NativeArray;
|
|
17421
17420
|
Does not modify the original object. Ember.A is not needed if
|
17422
17421
|
`Ember.EXTEND_PROTOTYPES` is `true` (the default value). However,
|
17423
17422
|
it is recommended that you use Ember.A when creating addons for
|
17424
|
-
ember or when you can not
|
17423
|
+
ember or when you can not guarantee that `Ember.EXTEND_PROTOTYPES`
|
17425
17424
|
will be `true`.
|
17426
17425
|
|
17427
17426
|
Example
|
@@ -20534,9 +20533,8 @@ Ember.View = Ember.CoreView.extend(
|
|
20534
20533
|
/**
|
20535
20534
|
The name of the template to lookup if no template is provided.
|
20536
20535
|
|
20537
|
-
`Ember.View` will
|
20538
|
-
`
|
20539
|
-
shared in `Ember.TEMPLATES`.
|
20536
|
+
By default `Ember.View` will lookup a template with this name in
|
20537
|
+
`Ember.TEMPLATES` (a shared global object).
|
20540
20538
|
|
20541
20539
|
@property templateName
|
20542
20540
|
@type String
|
@@ -20547,9 +20545,8 @@ Ember.View = Ember.CoreView.extend(
|
|
20547
20545
|
/**
|
20548
20546
|
The name of the layout to lookup if no layout is provided.
|
20549
20547
|
|
20550
|
-
`Ember.View` will
|
20551
|
-
`
|
20552
|
-
shared in `Ember.TEMPLATES`.
|
20548
|
+
By default `Ember.View` will lookup a template with this name in
|
20549
|
+
`Ember.TEMPLATES` (a shared global object).
|
20553
20550
|
|
20554
20551
|
@property layoutName
|
20555
20552
|
@type String
|
@@ -20557,15 +20554,6 @@ Ember.View = Ember.CoreView.extend(
|
|
20557
20554
|
*/
|
20558
20555
|
layoutName: null,
|
20559
20556
|
|
20560
|
-
/**
|
20561
|
-
The hash in which to look for `templateName`.
|
20562
|
-
|
20563
|
-
@property templates
|
20564
|
-
@type Ember.Object
|
20565
|
-
@default Ember.TEMPLATES
|
20566
|
-
*/
|
20567
|
-
templates: Ember.TEMPLATES,
|
20568
|
-
|
20569
20557
|
/**
|
20570
20558
|
The template used to render the view. This should be a function that
|
20571
20559
|
accepts an optional context parameter and returns a string of HTML that
|
@@ -29434,7 +29422,7 @@ define("route-recognizer",
|
|
29434
29422
|
return states.sort(function(a, b) {
|
29435
29423
|
if (a.types.stars !== b.types.stars) { return a.types.stars - b.types.stars; }
|
29436
29424
|
if (a.types.dynamics !== b.types.dynamics) { return a.types.dynamics - b.types.dynamics; }
|
29437
|
-
if (a.types.statics !== b.types.statics) { return
|
29425
|
+
if (a.types.statics !== b.types.statics) { return b.types.statics - a.types.statics; }
|
29438
29426
|
|
29439
29427
|
return 0;
|
29440
29428
|
});
|
@@ -29800,8 +29788,8 @@ define("route-recognizer",
|
|
29800
29788
|
|
29801
29789
|
(function() {
|
29802
29790
|
define("router",
|
29803
|
-
["route-recognizer","rsvp"],
|
29804
|
-
function(
|
29791
|
+
["route-recognizer","rsvp","exports"],
|
29792
|
+
function(__dependency1__, __dependency2__, __exports__) {
|
29805
29793
|
"use strict";
|
29806
29794
|
/**
|
29807
29795
|
@private
|
@@ -29821,6 +29809,8 @@ define("router",
|
|
29821
29809
|
* `{Object} context`: the active context for the handler
|
29822
29810
|
*/
|
29823
29811
|
|
29812
|
+
var RouteRecognizer = __dependency1__;
|
29813
|
+
var RSVP = __dependency2__;
|
29824
29814
|
|
29825
29815
|
var slice = Array.prototype.slice;
|
29826
29816
|
|
@@ -29975,6 +29965,7 @@ define("router",
|
|
29975
29965
|
// TODO: separate into module?
|
29976
29966
|
Router.Transition = Transition;
|
29977
29967
|
|
29968
|
+
__exports__['default'] = Router;
|
29978
29969
|
|
29979
29970
|
|
29980
29971
|
/**
|
@@ -30330,7 +30321,7 @@ define("router",
|
|
30330
30321
|
}
|
30331
30322
|
|
30332
30323
|
function isParam(object) {
|
30333
|
-
return (typeof object === "string" || object instanceof String ||
|
30324
|
+
return (typeof object === "string" || object instanceof String || typeof object === "number" || object instanceof Number);
|
30334
30325
|
}
|
30335
30326
|
|
30336
30327
|
|
@@ -30503,7 +30494,7 @@ define("router",
|
|
30503
30494
|
// Make sure this route is actually accessible by URL.
|
30504
30495
|
for (i = 0, len = results.length; i < len; ++i) {
|
30505
30496
|
|
30506
|
-
if (router.getHandler(results[i].handler).
|
30497
|
+
if (router.getHandler(results[i].handler).inaccessibleByURL) {
|
30507
30498
|
results = null;
|
30508
30499
|
break;
|
30509
30500
|
}
|
@@ -30870,14 +30861,7 @@ define("router",
|
|
30870
30861
|
checkAbort(transition);
|
30871
30862
|
|
30872
30863
|
try {
|
30873
|
-
|
30874
|
-
|
30875
|
-
// Don't overwrite contexts / update URL if this was a noop transition.
|
30876
|
-
if (!currentHandlerInfos || !currentHandlerInfos.length ||
|
30877
|
-
!router.recognizer.hasRoute(currentHandlerInfos[currentHandlerInfos.length - 1].name) ||
|
30878
|
-
currentHandlerInfos.length !== matchPointResults.matchPoint) {
|
30879
|
-
finalizeTransition(transition, handlerInfos);
|
30880
|
-
}
|
30864
|
+
finalizeTransition(transition, handlerInfos);
|
30881
30865
|
|
30882
30866
|
// currentHandlerInfos was updated in finalizeTransition
|
30883
30867
|
trigger(router, router.currentHandlerInfos, true, ['didTransition']);
|
@@ -30962,6 +30946,8 @@ define("router",
|
|
30962
30946
|
*/
|
30963
30947
|
function finalizeTransition(transition, handlerInfos) {
|
30964
30948
|
|
30949
|
+
log(transition.router, transition.sequence, "Validation succeeded, finalizing transition;");
|
30950
|
+
|
30965
30951
|
var router = transition.router,
|
30966
30952
|
seq = transition.sequence,
|
30967
30953
|
handlerName = handlerInfos[handlerInfos.length - 1].name,
|
@@ -30977,7 +30963,7 @@ define("router",
|
|
30977
30963
|
objects.unshift(isParam(providedModel) ? providedModel.toString() : handlerInfo.context);
|
30978
30964
|
}
|
30979
30965
|
|
30980
|
-
if (handlerInfo.handler.
|
30966
|
+
if (handlerInfo.handler.inaccessibleByURL) {
|
30981
30967
|
urlMethod = null;
|
30982
30968
|
}
|
30983
30969
|
}
|
@@ -31064,7 +31050,7 @@ define("router",
|
|
31064
31050
|
}
|
31065
31051
|
|
31066
31052
|
function handleError(reason) {
|
31067
|
-
if (reason instanceof Router.TransitionAborted) {
|
31053
|
+
if (reason instanceof Router.TransitionAborted || transition.isAborted) {
|
31068
31054
|
// if the transition was aborted and *no additional* error was thrown,
|
31069
31055
|
// reject with the Router.TransitionAborted instance
|
31070
31056
|
return RSVP.reject(reason);
|
@@ -31251,9 +31237,6 @@ define("router",
|
|
31251
31237
|
}
|
31252
31238
|
return object;
|
31253
31239
|
}
|
31254
|
-
|
31255
|
-
|
31256
|
-
return Router;
|
31257
31240
|
});
|
31258
31241
|
|
31259
31242
|
})();
|
@@ -31288,13 +31271,14 @@ DSL.prototype = {
|
|
31288
31271
|
|
31289
31272
|
if (callback) {
|
31290
31273
|
var dsl = new DSL(name);
|
31291
|
-
|
31292
|
-
|
31274
|
+
route(dsl, 'loading');
|
31275
|
+
route(dsl, 'error', { path: "/_unused_dummy_error_path_route_" + name + "/:error" });
|
31293
31276
|
callback.call(dsl);
|
31294
31277
|
this.push(options.path, name, dsl.generate(), options.queryParams);
|
31295
31278
|
} else {
|
31296
31279
|
this.push(options.path, name, null, options.queryParams);
|
31297
31280
|
}
|
31281
|
+
|
31298
31282
|
},
|
31299
31283
|
|
31300
31284
|
push: function(url, name, callback, queryParams) {
|
@@ -31305,19 +31289,7 @@ DSL.prototype = {
|
|
31305
31289
|
},
|
31306
31290
|
|
31307
31291
|
route: function(name, options) {
|
31308
|
-
|
31309
|
-
|
31310
|
-
options = options || {};
|
31311
|
-
|
31312
|
-
if (typeof options.path !== 'string') {
|
31313
|
-
options.path = "/" + name;
|
31314
|
-
}
|
31315
|
-
|
31316
|
-
if (this.parent && this.parent !== 'application') {
|
31317
|
-
name = this.parent + "." + name;
|
31318
|
-
}
|
31319
|
-
|
31320
|
-
this.push(options.path, name, null, options.queryParams);
|
31292
|
+
route(this, name, options);
|
31321
31293
|
},
|
31322
31294
|
|
31323
31295
|
generate: function() {
|
@@ -31336,6 +31308,22 @@ DSL.prototype = {
|
|
31336
31308
|
}
|
31337
31309
|
};
|
31338
31310
|
|
31311
|
+
function route(dsl, name, options) {
|
31312
|
+
Ember.assert("You must use `this.resource` to nest", typeof options !== 'function');
|
31313
|
+
|
31314
|
+
options = options || {};
|
31315
|
+
|
31316
|
+
if (typeof options.path !== 'string') {
|
31317
|
+
options.path = "/" + name;
|
31318
|
+
}
|
31319
|
+
|
31320
|
+
if (dsl.parent && dsl.parent !== 'application') {
|
31321
|
+
name = dsl.parent + "." + name;
|
31322
|
+
}
|
31323
|
+
|
31324
|
+
dsl.push(options.path, name, null, options.queryParams);
|
31325
|
+
}
|
31326
|
+
|
31339
31327
|
DSL.map = function(callback) {
|
31340
31328
|
var dsl = new DSL();
|
31341
31329
|
callback.call(dsl);
|
@@ -31421,7 +31409,7 @@ Ember.generateController = function(container, controllerName, context) {
|
|
31421
31409
|
@submodule ember-routing
|
31422
31410
|
*/
|
31423
31411
|
|
31424
|
-
var Router = requireModule("router");
|
31412
|
+
var Router = requireModule("router")['default'];
|
31425
31413
|
var get = Ember.get, set = Ember.set;
|
31426
31414
|
var defineProperty = Ember.defineProperty;
|
31427
31415
|
|
@@ -31697,17 +31685,135 @@ Ember.Router = Ember.Object.extend(Ember.Evented, {
|
|
31697
31685
|
}
|
31698
31686
|
});
|
31699
31687
|
|
31688
|
+
/**
|
31689
|
+
@private
|
31690
|
+
|
31691
|
+
Helper function for iterating root-ward, starting
|
31692
|
+
from (but not including) the provided `originRoute`.
|
31693
|
+
|
31694
|
+
Returns true if the last callback fired requested
|
31695
|
+
to bubble upward.
|
31696
|
+
*/
|
31697
|
+
function forEachRouteAbove(originRoute, transition, callback) {
|
31698
|
+
var handlerInfos = transition.handlerInfos,
|
31699
|
+
originRouteFound = false;
|
31700
|
+
|
31701
|
+
for (var i = handlerInfos.length - 1; i >= 0; --i) {
|
31702
|
+
var handlerInfo = handlerInfos[i],
|
31703
|
+
route = handlerInfo.handler;
|
31704
|
+
|
31705
|
+
if (!originRouteFound) {
|
31706
|
+
if (originRoute === route) {
|
31707
|
+
originRouteFound = true;
|
31708
|
+
}
|
31709
|
+
continue;
|
31710
|
+
}
|
31711
|
+
|
31712
|
+
if (callback(route, handlerInfos[i + 1].handler) !== true) {
|
31713
|
+
return false;
|
31714
|
+
}
|
31715
|
+
}
|
31716
|
+
return true;
|
31717
|
+
}
|
31718
|
+
|
31719
|
+
// These get invoked when an action bubbles above ApplicationRoute
|
31720
|
+
// and are not meant to be overridable.
|
31721
|
+
var defaultActionHandlers = {
|
31722
|
+
|
31723
|
+
willResolveModel: function(transition, originRoute) {
|
31724
|
+
originRoute.router._scheduleLoadingEvent(transition, originRoute);
|
31725
|
+
},
|
31726
|
+
|
31727
|
+
error: function(error, transition, originRoute) {
|
31728
|
+
|
31729
|
+
|
31730
|
+
// Attempt to find an appropriate error substate to enter.
|
31731
|
+
var router = originRoute.router;
|
31732
|
+
|
31733
|
+
var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {
|
31734
|
+
var childErrorRouteName = findChildRouteName(route, childRoute, 'error');
|
31735
|
+
if (childErrorRouteName) {
|
31736
|
+
router.intermediateTransitionTo(childErrorRouteName, error);
|
31737
|
+
return;
|
31738
|
+
}
|
31739
|
+
return true;
|
31740
|
+
});
|
31741
|
+
|
31742
|
+
if (tryTopLevel) {
|
31743
|
+
// Check for top-level error state to enter.
|
31744
|
+
if (routeHasBeenDefined(originRoute.router, 'application_error')) {
|
31745
|
+
router.intermediateTransitionTo('application_error', error);
|
31746
|
+
return;
|
31747
|
+
}
|
31748
|
+
} else {
|
31749
|
+
// Don't fire an assertion if we found an error substate.
|
31750
|
+
return;
|
31751
|
+
}
|
31752
|
+
|
31753
|
+
|
31754
|
+
Ember.Logger.assert(false, 'Error while loading route: ' + Ember.inspect(error));
|
31755
|
+
},
|
31756
|
+
|
31757
|
+
loading: function(transition, originRoute) {
|
31758
|
+
|
31759
|
+
|
31760
|
+
// Attempt to find an appropriate loading substate to enter.
|
31761
|
+
var router = originRoute.router;
|
31762
|
+
|
31763
|
+
var tryTopLevel = forEachRouteAbove(originRoute, transition, function(route, childRoute) {
|
31764
|
+
var childLoadingRouteName = findChildRouteName(route, childRoute, 'loading');
|
31765
|
+
|
31766
|
+
if (childLoadingRouteName) {
|
31767
|
+
router.intermediateTransitionTo(childLoadingRouteName);
|
31768
|
+
return;
|
31769
|
+
}
|
31770
|
+
|
31771
|
+
// Don't bubble above pivot route.
|
31772
|
+
if (transition.pivotHandler !== route) {
|
31773
|
+
return true;
|
31774
|
+
}
|
31775
|
+
});
|
31776
|
+
|
31777
|
+
if (tryTopLevel) {
|
31778
|
+
// Check for top-level loading state to enter.
|
31779
|
+
if (routeHasBeenDefined(originRoute.router, 'application_loading')) {
|
31780
|
+
router.intermediateTransitionTo('application_loading');
|
31781
|
+
return;
|
31782
|
+
}
|
31783
|
+
}
|
31784
|
+
|
31785
|
+
}
|
31786
|
+
};
|
31787
|
+
|
31788
|
+
function findChildRouteName(parentRoute, originatingChildRoute, name) {
|
31789
|
+
var router = parentRoute.router,
|
31790
|
+
childName,
|
31791
|
+
targetChildRouteName = originatingChildRoute.routeName.split('.').pop(),
|
31792
|
+
namespace = parentRoute.routeName === 'application' ? '' : parentRoute.routeName + '.';
|
31793
|
+
|
31794
|
+
childName = namespace + name;
|
31795
|
+
if (routeHasBeenDefined(router, childName)) {
|
31796
|
+
return childName;
|
31797
|
+
}
|
31798
|
+
}
|
31799
|
+
|
31800
|
+
function routeHasBeenDefined(router, name) {
|
31801
|
+
var container = router.container;
|
31802
|
+
return router.hasRoute(name) &&
|
31803
|
+
(container.has('template:' + name) || container.has('route:' + name));
|
31804
|
+
}
|
31805
|
+
|
31700
31806
|
function triggerEvent(handlerInfos, ignoreFailure, args) {
|
31701
31807
|
var name = args.shift();
|
31702
31808
|
|
31703
31809
|
if (!handlerInfos) {
|
31704
31810
|
if (ignoreFailure) { return; }
|
31705
|
-
throw new Ember.Error("
|
31811
|
+
throw new Ember.Error("Can't trigger action '" + name + "' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call `.send()` on the `Transition` object passed to the `model/beforeModel/afterModel` hooks.");
|
31706
31812
|
}
|
31707
31813
|
|
31708
31814
|
var eventWasHandled = false;
|
31709
31815
|
|
31710
|
-
for (var i=handlerInfos.length-1; i>=0; i--) {
|
31816
|
+
for (var i = handlerInfos.length - 1; i >= 0; i--) {
|
31711
31817
|
var handlerInfo = handlerInfos[i],
|
31712
31818
|
handler = handlerInfo.handler;
|
31713
31819
|
|
@@ -31720,14 +31826,27 @@ function triggerEvent(handlerInfos, ignoreFailure, args) {
|
|
31720
31826
|
}
|
31721
31827
|
}
|
31722
31828
|
|
31829
|
+
if (defaultActionHandlers[name]) {
|
31830
|
+
defaultActionHandlers[name].apply(null, args);
|
31831
|
+
return;
|
31832
|
+
}
|
31833
|
+
|
31723
31834
|
if (!eventWasHandled && !ignoreFailure) {
|
31724
|
-
throw new Ember.Error("Nothing handled the action '" + name + "'.
|
31835
|
+
throw new Ember.Error("Nothing handled the action '" + name + "'.");
|
31725
31836
|
}
|
31726
31837
|
}
|
31727
31838
|
|
31728
31839
|
function updatePaths(router) {
|
31729
|
-
var appController = router.container.lookup('controller:application')
|
31730
|
-
|
31840
|
+
var appController = router.container.lookup('controller:application');
|
31841
|
+
|
31842
|
+
if (!appController) {
|
31843
|
+
// appController might not exist when top-level loading/error
|
31844
|
+
// substates have been entered since ApplicationRoute hasn't
|
31845
|
+
// actually been entered at that point.
|
31846
|
+
return;
|
31847
|
+
}
|
31848
|
+
|
31849
|
+
var infos = router.router.currentHandlerInfos,
|
31731
31850
|
path = Ember.Router._routePath(infos);
|
31732
31851
|
|
31733
31852
|
if (!('currentPath' in appController)) {
|
@@ -31842,47 +31961,6 @@ var get = Ember.get, set = Ember.set,
|
|
31842
31961
|
a_forEach = Ember.EnumerableUtils.forEach,
|
31843
31962
|
a_replace = Ember.EnumerableUtils.replace;
|
31844
31963
|
|
31845
|
-
var defaultActionHandlers = {
|
31846
|
-
|
31847
|
-
willResolveModel: function(transition, originRoute) {
|
31848
|
-
this.router._scheduleLoadingEvent(transition, originRoute);
|
31849
|
-
},
|
31850
|
-
|
31851
|
-
error: function(error, transition, originRoute) {
|
31852
|
-
|
31853
|
-
if (this !== originRoute) {
|
31854
|
-
var childErrorRouteName = findChildRouteName(this, 'error');
|
31855
|
-
if (childErrorRouteName) {
|
31856
|
-
this.intermediateTransitionTo(childErrorRouteName, error);
|
31857
|
-
return;
|
31858
|
-
}
|
31859
|
-
}
|
31860
|
-
|
31861
|
-
|
31862
|
-
if (this.routeName === 'application') {
|
31863
|
-
Ember.Logger.assert(false, 'Error while loading route: ' + Ember.inspect(error));
|
31864
|
-
}
|
31865
|
-
|
31866
|
-
return true;
|
31867
|
-
},
|
31868
|
-
|
31869
|
-
loading: function(transition, originRoute) {
|
31870
|
-
|
31871
|
-
if (this === originRoute) {
|
31872
|
-
// This is the route with the error; just bubble
|
31873
|
-
// so that the parent route can look up its child loading route.
|
31874
|
-
return true;
|
31875
|
-
}
|
31876
|
-
|
31877
|
-
var childLoadingRouteName = findChildRouteName(this, 'loading');
|
31878
|
-
if (childLoadingRouteName) {
|
31879
|
-
this.intermediateTransitionTo(childLoadingRouteName);
|
31880
|
-
} else if (transition.pivotHandler !== this) {
|
31881
|
-
return true;
|
31882
|
-
}
|
31883
|
-
|
31884
|
-
}
|
31885
|
-
};
|
31886
31964
|
|
31887
31965
|
/**
|
31888
31966
|
The `Ember.Route` class is used to define individual routes. Refer to
|
@@ -32128,15 +32206,13 @@ Ember.Route = Ember.Object.extend(Ember.ActionHandler, {
|
|
32128
32206
|
*/
|
32129
32207
|
actions: null,
|
32130
32208
|
|
32131
|
-
_actions: defaultActionHandlers,
|
32132
|
-
|
32133
32209
|
/**
|
32134
32210
|
@deprecated
|
32135
32211
|
|
32136
32212
|
Please use `actions` instead.
|
32137
32213
|
@method events
|
32138
32214
|
*/
|
32139
|
-
events:
|
32215
|
+
events: null,
|
32140
32216
|
|
32141
32217
|
mergedProperties: ['events'],
|
32142
32218
|
|
@@ -32149,8 +32225,8 @@ Ember.Route = Ember.Object.extend(Ember.ActionHandler, {
|
|
32149
32225
|
deactivate: Ember.K,
|
32150
32226
|
|
32151
32227
|
/**
|
32152
|
-
This hook is executed when the router enters the route
|
32153
|
-
|
32228
|
+
This hook is executed when the router enters the route. It is not executed
|
32229
|
+
when the model for the route changes.
|
32154
32230
|
|
32155
32231
|
@method activate
|
32156
32232
|
*/
|
@@ -32677,7 +32753,7 @@ Ember.Route = Ember.Object.extend(Ember.ActionHandler, {
|
|
32677
32753
|
instance would be used.
|
32678
32754
|
|
32679
32755
|
Example
|
32680
|
-
|
32756
|
+
|
32681
32757
|
```js
|
32682
32758
|
App.PostRoute = Ember.Route.extend({
|
32683
32759
|
setupController: function(controller, model) {
|
@@ -33104,17 +33180,6 @@ function generateOutletTeardown(parentView, outlet) {
|
|
33104
33180
|
return function() { parentView.disconnectOutlet(outlet); };
|
33105
33181
|
}
|
33106
33182
|
|
33107
|
-
function findChildRouteName(route, name) {
|
33108
|
-
var container = route.container;
|
33109
|
-
|
33110
|
-
var childName = route.routeName === 'application' ? name : route.routeName + '.' + name;
|
33111
|
-
|
33112
|
-
var hasChild = route.router.hasRoute(childName) &&
|
33113
|
-
(container.has('template:' + childName) ||
|
33114
|
-
container.has('route:' + childName));
|
33115
|
-
|
33116
|
-
return hasChild && childName;
|
33117
|
-
}
|
33118
33183
|
|
33119
33184
|
|
33120
33185
|
})();
|