aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-17 15:44:09 -0700
committerNivesh Rajbhandari2012-05-17 15:44:09 -0700
commit90ba0afd8510ab8862812726ee0a301b5681280a (patch)
tree36d0b2a68550bba730d14da95872f9c0cbf85b5d
parent43994432117686f18eb1783418ef83744ae01d79 (diff)
parent342c97ac9b727b22a7b0bfefca4d2a168bc3055b (diff)
downloadninja-90ba0afd8510ab8862812726ee0a301b5681280a.tar.gz
Merge branch 'refs/heads/dom-architecture-master' into Dom-Architecture
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.html37
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js24
-rw-r--r--js/document/templates/app/main.js (renamed from js/document/templates/html/main.js)4
-rwxr-xr-xjs/document/templates/app/package.json (renamed from js/document/templates/banner/package.json)0
-rwxr-xr-xjs/document/templates/banner/index.html2
-rw-r--r--js/document/templates/banner/main.js55
-rwxr-xr-xjs/document/templates/html/index.html2
-rwxr-xr-xjs/document/templates/html/package.json10
-rwxr-xr-xjs/document/templates/montage-html/package.json9
9 files changed, 25 insertions, 118 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html
index ae3e2022..0dabc781 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.html
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.html
@@ -32,30 +32,23 @@
32 } 32 }
33 ], 33 ],
34 "bindings": { 34 "bindings": {
35 "label": { 35 "label": {"<-": "@buttonsList.objectAtCurrentIteration.label"},
36 "boundObject": {"@": "repetition1"}, 36 "value": {"<-": "@buttonsList.objectAtCurrentIteration.nodeUuid"}
37 "boundObjectPropertyPath": "objectAtCurrentIteration.label", 37 }
38 "oneway": true 38 },
39 }, 39
40 "value": { 40 "buttonsListController": {
41 "boundObject": {"@": "repetition1"}, 41 "prototype": "montage/ui/controller/array-controller",
42 "boundObjectPropertyPath": "objectAtCurrentIteration.nodeUuid", 42 "bindings": {
43 "oneway": true 43 "content": {"<<->": "@owner.containerElements"}
44 }
45 } 44 }
46 }, 45 },
47 46
48 "repetition1": { 47 "buttonsList": {
49 "prototype": "montage/ui/repetition.reel", 48 "prototype": "montage/ui/repetition.reel",
50 "properties": { 49 "properties": {
51 "element": {"#": "breadcrumb_container"} 50 "element": {"#": "breadcrumb_container"},
52 }, 51 "contentController": {"@": "buttonsListController"}
53 "bindings": {
54 "objects": {
55 "boundObject": {"@": "owner"},
56 "boundObjectPropertyPath": "containerElements",
57 "oneway": true
58 }
59 } 52 }
60 }, 53 },
61 54
@@ -65,11 +58,7 @@
65 "element": {"#": "disabledCondition"} 58 "element": {"#": "disabledCondition"}
66 }, 59 },
67 "bindings": { 60 "bindings": {
68 "condition": { 61 "condition": {"<-": "@owner.disabled"}
69 "boundObject": {"@": "owner"},
70 "boundObjectPropertyPath": "disabled",
71 "oneway": true
72 }
73 } 62 }
74 } 63 }
75 } 64 }
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index c1b021a3..d2a6b1e4 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -60,30 +60,18 @@ exports.Breadcrumb = Montage.create(Component, {
60 value: function() { 60 value: function() {
61 var parentNode; 61 var parentNode;
62 62
63 this.containerElements.length = 0; 63// delete this.containerElements;
64 this.containerElements = [];
64 65
65 parentNode = this.container; 66 parentNode = this.container;
66 67
67 // This is for the old template support. 68 while(parentNode !== this.application.ninja.currentDocument.documentRoot) {
68 // TODO: Remove marker for old template: NINJA-STAGE-REWORK
69 if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") {
70 while(parentNode.id !== "UserContent") {
71 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
72 parentNode = parentNode.parentNode;
73 }
74
75 // This is always the top container which is now hardcoded to body
76 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"});
77 } else {
78 while(parentNode !== this.application.ninja.currentDocument.documentRoot) {
79 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
80 parentNode = parentNode.parentNode;
81 }
82
83 // This is always the top container which is now hardcoded to body
84 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); 69 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
70 parentNode = parentNode.parentNode;
85 } 71 }
86 72
73 // This is always the top container which is now hardcoded to body
74 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName});
87 } 75 }
88 }, 76 },
89 77
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> */
6var 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
11exports.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=".