diff options
author | Valerio Virgillito | 2012-05-17 12:25:37 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-17 12:25:37 -0700 |
commit | 342c97ac9b727b22a7b0bfefca4d2a168bc3055b (patch) | |
tree | 7909b8cbe077d988293d989d7eb3e6df58fb1710 /js/document/templates | |
parent | bac01dd8771d91dc227c970b3d29e72d8f079692 (diff) | |
parent | e713d437a3918b9e417d1a0bc9f11275fc9e6634 (diff) | |
download | ninja-342c97ac9b727b22a7b0bfefca4d2a168bc3055b.tar.gz |
Merge pull request #244 from joseeight/Document
Cleaning up files for templates
Diffstat (limited to 'js/document/templates')
-rw-r--r-- | js/document/templates/app/main.js (renamed from js/document/templates/html/main.js) | 4 | ||||
-rwxr-xr-x | js/document/templates/app/package.json (renamed from js/document/templates/banner/package.json) | 0 | ||||
-rwxr-xr-x | js/document/templates/banner/index.html | 2 | ||||
-rw-r--r-- | js/document/templates/banner/main.js | 55 | ||||
-rwxr-xr-x | js/document/templates/html/index.html | 2 | ||||
-rwxr-xr-x | js/document/templates/html/package.json | 10 | ||||
-rwxr-xr-x | js/document/templates/montage-html/package.json | 9 |
7 files changed, 6 insertions, 76 deletions
diff --git a/js/document/templates/html/main.js b/js/document/templates/app/main.js index ffa3fab2..a406abdb 100644 --- a/js/document/templates/html/main.js +++ b/js/document/templates/app/main.js | |||
@@ -43,6 +43,10 @@ exports.Main = Montage.create(Component, { | |||
43 | window.mjsTemplateCreator = TemplateCreator; | 43 | window.mjsTemplateCreator = TemplateCreator; |
44 | // | 44 | // |
45 | window.mjsTemplate = Template; | 45 | window.mjsTemplate = Template; |
46 | // | ||
47 | var templateEvent = document.createEvent("CustomEvent"); | ||
48 | templateEvent.initCustomEvent("mjsTemplateReady", false, true); | ||
49 | document.body.dispatchEvent(templateEvent); | ||
46 | 50 | ||
47 | 51 | ||
48 | // Dispatch event when this template has loaded. | 52 | // Dispatch event when this template has loaded. |
diff --git a/js/document/templates/banner/package.json b/js/document/templates/app/package.json index 4f36090a..4f36090a 100755 --- a/js/document/templates/banner/package.json +++ b/js/document/templates/app/package.json | |||
diff --git a/js/document/templates/banner/index.html b/js/document/templates/banner/index.html index 91ef06de..f1ee3d98 100755 --- a/js/document/templates/banner/index.html +++ b/js/document/templates/banner/index.html | |||
@@ -81,7 +81,7 @@ | |||
81 | 81 | ||
82 | <!-- TODO: Determine if loading Montage is always needed or if it could be done author-time or on file open --> | 82 | <!-- TODO: Determine if loading Montage is always needed or if it could be done author-time or on file open --> |
83 | 83 | ||
84 | <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script> | 84 | <script type="text/javascript" data-package="../app" src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script> |
85 | 85 | ||
86 | <script type="text/montage-serialization" data-ninja-template="true"> | 86 | <script type="text/montage-serialization" data-ninja-template="true"> |
87 | { | 87 | { |
diff --git a/js/document/templates/banner/main.js b/js/document/templates/banner/main.js deleted file mode 100644 index 2acbe8f3..00000000 --- a/js/document/templates/banner/main.js +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | var Montage = require("montage/core/core").Montage, | ||
7 | Component = require("montage/ui/component").Component, | ||
8 | Template = require("montage/ui/template").Template, | ||
9 | TemplateCreator = require("tools/template/template-creator").TemplateCreator; | ||
10 | |||
11 | exports.Main = Montage.create(Component, { | ||
12 | |||
13 | hasTemplate: { | ||
14 | value: false | ||
15 | }, | ||
16 | |||
17 | /** | ||
18 | * Adding window hooks to callback into this object from Ninja. | ||
19 | */ | ||
20 | templateDidLoad: { | ||
21 | value: function(){ | ||
22 | var self = this; | ||
23 | window.addComponent = function(element, data, callback) { | ||
24 | var component; | ||
25 | |||
26 | component = require.async(data.path) | ||
27 | .then(function(component) { | ||
28 | var componentRequire = component[data.name]; | ||
29 | var componentInstance = componentRequire.create(); | ||
30 | |||
31 | componentInstance.element = element; | ||
32 | |||
33 | componentInstance.needsDraw = true; | ||
34 | componentInstance.ownerComponent = self; | ||
35 | |||
36 | callback(componentInstance, element); | ||
37 | }) | ||
38 | .end(); | ||
39 | |||
40 | }; | ||
41 | |||
42 | window.mjsTemplateCreator = TemplateCreator; | ||
43 | // | ||
44 | window.mjsTemplate = Template; | ||
45 | |||
46 | // Dispatch event when this template has loaded. | ||
47 | /* | ||
48 | var newEvent = document.createEvent( "CustomEvent" ); | ||
49 | newEvent.initCustomEvent( "userTemplateDidLoad", false, true ); | ||
50 | document.body.dispatchEvent( newEvent ); | ||
51 | */ | ||
52 | |||
53 | } | ||
54 | } | ||
55 | }); \ No newline at end of file | ||
diff --git a/js/document/templates/html/index.html b/js/document/templates/html/index.html index 24159841..933df157 100755 --- a/js/document/templates/html/index.html +++ b/js/document/templates/html/index.html | |||
@@ -62,7 +62,7 @@ | |||
62 | } | 62 | } |
63 | </script> | 63 | </script> |
64 | 64 | ||
65 | <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script> | 65 | <script type="text/javascript" data-package="../app" src="../../../../node_modules/montage/montage.js" data-ninja-template="true"></script> |
66 | 66 | ||
67 | <script type="text/montage-serialization" data-ninja-template="true"> | 67 | <script type="text/montage-serialization" data-ninja-template="true"> |
68 | { | 68 | { |
diff --git a/js/document/templates/html/package.json b/js/document/templates/html/package.json deleted file mode 100755 index 4f36090a..00000000 --- a/js/document/templates/html/package.json +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | { | ||
2 | "directories": { | ||
3 | "lib": "" | ||
4 | }, | ||
5 | "mappings": { | ||
6 | "montage": "../../../../node_modules/montage/", | ||
7 | "tools": "../../../../node_modules/tools/", | ||
8 | "montage-google": "../../../../node_modules/montage-google/" | ||
9 | } | ||
10 | } \ No newline at end of file | ||
diff --git a/js/document/templates/montage-html/package.json b/js/document/templates/montage-html/package.json deleted file mode 100755 index d1e839dc..00000000 --- a/js/document/templates/montage-html/package.json +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | { | ||
2 | "directories": { | ||
3 | "lib": "" | ||
4 | }, | ||
5 | "mappings": { | ||
6 | "montage": "../../../../node_modules/montage/", | ||
7 | "montage-google": "../../../../node_modules/montage-google/" | ||
8 | } | ||
9 | } \ No newline at end of file | ||