diff options
Diffstat (limited to 'js')
31 files changed, 1028 insertions, 499 deletions
diff --git a/js/components/layout/documents-tab.reel/documents-tab.html b/js/components/layout/documents-tab.reel/documents-tab.html index 4aed23d9..cf3dbbf5 100755 --- a/js/components/layout/documents-tab.reel/documents-tab.html +++ b/js/components/layout/documents-tab.reel/documents-tab.html | |||
@@ -33,17 +33,17 @@ | |||
33 | }, | 33 | }, |
34 | "name": { | 34 | "name": { |
35 | "boundObject": {"@": "repetition1"}, | 35 | "boundObject": {"@": "repetition1"}, |
36 | "boundObjectPropertyPath": "objectAtCurrentIteration.name", | 36 | "boundObjectPropertyPath": "objectAtCurrentIteration.model.file.name", |
37 | "oneway": true | 37 | "oneway": true |
38 | }, | 38 | }, |
39 | "saveFlag": { | 39 | "saveFlag": { |
40 | "boundObject": {"@": "repetition1"}, | 40 | "boundObject": {"@": "repetition1"}, |
41 | "boundObjectPropertyPath": "objectAtCurrentIteration.needsSave", | 41 | "boundObjectPropertyPath": "objectAtCurrentIteration.model.needsSave", |
42 | "oneway": true | 42 | "oneway": true |
43 | }, | 43 | }, |
44 | "active": { | 44 | "active": { |
45 | "boundObject": {"@": "repetition1"}, | 45 | "boundObject": {"@": "repetition1"}, |
46 | "boundObjectPropertyPath": "objectAtCurrentIteration.isActive", | 46 | "boundObjectPropertyPath": "objectAtCurrentIteration.model.isActive", |
47 | "oneway": true | 47 | "oneway": true |
48 | } | 48 | } |
49 | } | 49 | } |
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index c6bf4c6b..cf96208f 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -88,7 +88,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | //TODO: Ensure these APIs are not needed | |
92 | /* | ||
92 | //////////////////////////////////////////////////////////////////// | 93 | //////////////////////////////////////////////////////////////////// |
93 | // | 94 | // |
94 | handleWebRequest: { | 95 | handleWebRequest: { |
@@ -119,6 +120,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
119 | } | 120 | } |
120 | }, | 121 | }, |
121 | //////////////////////////////////////////////////////////////////// | 122 | //////////////////////////////////////////////////////////////////// |
123 | */ | ||
122 | 124 | ||
123 | 125 | ||
124 | 126 | ||
@@ -366,7 +368,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
366 | case 'html': | 368 | case 'html': |
367 | //Open in designer view | 369 | //Open in designer view |
368 | this._hackRootFlag = false; | 370 | this._hackRootFlag = false; |
369 | Montage.create(Document).init(doc, this, this._onOpenDocument); | 371 | Montage.create(Document).init(doc, this, this._onOpenDocument, 'design'); |
370 | break; | 372 | break; |
371 | default: | 373 | default: |
372 | //Open in code view | 374 | //Open in code view |
diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js index 14aeae24..943594f2 100755 --- a/js/controllers/elements/body-controller.js +++ b/js/controllers/elements/body-controller.js | |||
@@ -28,11 +28,39 @@ exports.BodyController = Montage.create(ElementController, { | |||
28 | 28 | ||
29 | getProperty: { | 29 | getProperty: { |
30 | value: function(el, p) { | 30 | value: function(el, p) { |
31 | switch(p) { | ||
32 | case "background" : | ||
33 | return this.application.ninja.colorController.getColorObjFromCss(this.application.ninja.stylesController.getElementStyle(el, "background-color", true, true)); | ||
34 | case "border": | ||
35 | return 0; | ||
36 | case "height": | ||
37 | case "width": | ||
38 | case "-webkit-transform-style": | ||
39 | return this.application.ninja.stylesController.getElementStyle(el, p, true, true); | ||
40 | default: | ||
41 | return ElementController.getProperty(el, p, true, true); | ||
42 | //console.log("Undefined Stage property ", p); | ||
43 | } | ||
31 | } | 44 | } |
32 | }, | 45 | }, |
33 | 46 | ||
34 | setProperty: { | 47 | setProperty: { |
35 | value: function(el, p, value) { | 48 | value: function(el, p, value) { |
49 | switch(p) { | ||
50 | case "body-background": | ||
51 | case "background": | ||
52 | this.application.ninja.stylesController.setElementStyle(el, "background-color", value, true); | ||
53 | break; | ||
54 | case "overflow": | ||
55 | case "width": | ||
56 | case "height": | ||
57 | case "-webkit-transform-style": | ||
58 | this.application.ninja.stylesController.setElementStyle(el, p, value, true); | ||
59 | this.application.ninja.stage.updatedStage = true; | ||
60 | break; | ||
61 | default: | ||
62 | console.log("Undefined property ", p, "for the Body Controller"); | ||
63 | } | ||
36 | } | 64 | } |
37 | }, | 65 | }, |
38 | 66 | ||
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 5665b09c..a81cdf7f 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js | |||
@@ -112,12 +112,12 @@ exports.SelectionController = Montage.create(Component, { | |||
112 | 112 | ||
113 | handleSelectAll: { | 113 | handleSelectAll: { |
114 | value: function(event) { | 114 | value: function(event) { |
115 | var selected = [], childNodes = []; | 115 | var selected = [], childNodes = [], self = this; |
116 | 116 | ||
117 | childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; | 117 | childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; |
118 | childNodes = Array.prototype.slice.call(childNodes, 0); | 118 | childNodes = Array.prototype.slice.call(childNodes, 0); |
119 | childNodes.forEach(function(item) { | 119 | childNodes.forEach(function(item) { |
120 | if(item.nodeType == 1) { | 120 | if(self.isNodeTraversable(item)) { |
121 | selected.push(item); | 121 | selected.push(item); |
122 | } | 122 | } |
123 | }); | 123 | }); |
@@ -152,7 +152,6 @@ exports.SelectionController = Montage.create(Component, { | |||
152 | 152 | ||
153 | selectElement: { | 153 | selectElement: { |
154 | value: function(element) { | 154 | value: function(element) { |
155 | |||
156 | if(this.findSelectedElement(element) === -1) { | 155 | if(this.findSelectedElement(element) === -1) { |
157 | 156 | ||
158 | if(this.application.ninja.currentDocument.inExclusion(element) !== -1){ | 157 | if(this.application.ninja.currentDocument.inExclusion(element) !== -1){ |
@@ -281,6 +280,13 @@ exports.SelectionController = Montage.create(Component, { | |||
281 | 280 | ||
282 | return -1; | 281 | return -1; |
283 | } | 282 | } |
283 | }, | ||
284 | |||
285 | isNodeTraversable: { | ||
286 | value: function( item ) { | ||
287 | if(item.nodeType !== 1) return false; | ||
288 | return ((item.nodeName !== "STYLE") && (item.nodeName !== "SCRIPT")); | ||
289 | } | ||
284 | } | 290 | } |
285 | 291 | ||
286 | }); | 292 | }); |
diff --git a/js/data/menu-data.js b/js/data/menu-data.js index 9e8bf945..1cde3e8d 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js | |||
@@ -22,13 +22,13 @@ exports.MenuData = Montage.create( Montage, { | |||
22 | "displayText" : "New File", | 22 | "displayText" : "New File", |
23 | "hasSubMenu" : false, | 23 | "hasSubMenu" : false, |
24 | "enabled": true, | 24 | "enabled": true, |
25 | "action": "executeNewFile" | 25 | "action": "executeNew |