diff options
Diffstat (limited to 'js')
41 files changed, 1216 insertions, 863 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index f35972b6..45a4d217 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js | |||
@@ -58,7 +58,7 @@ exports.Breadcrumb = Montage.create(Component, { | |||
58 | createContainerElements: { | 58 | createContainerElements: { |
59 | value: function() { | 59 | value: function() { |
60 | var parentNode; | 60 | var parentNode; |
61 | 61 | /* | |
62 | this.containerElements.length = 0; | 62 | this.containerElements.length = 0; |
63 | 63 | ||
64 | parentNode = this.container; | 64 | parentNode = this.container; |
@@ -70,7 +70,7 @@ exports.Breadcrumb = Montage.create(Component, { | |||
70 | 70 | ||
71 | // This is always the top container which is now hardcoded to body | 71 | // This is always the top container which is now hardcoded to body |
72 | this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); | 72 | this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); |
73 | 73 | */ | |
74 | 74 | ||
75 | 75 | ||
76 | } | 76 | } |
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index ddaeb061..1fcdf6d0 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -10,8 +10,7 @@ var Montage = require("montage/core/core").Montage, | |||
10 | Component = require("montage/ui/component").Component, | 10 | Component = require("montage/ui/component").Component, |
11 | Uuid = require("montage/core/uuid").Uuid, | 11 | Uuid = require("montage/core/uuid").Uuid, |
12 | HTMLDocument = require("js/document/html-document").HTMLDocument, | 12 | HTMLDocument = require("js/document/html-document").HTMLDocument, |
13 | TextDocument = require("js/document/text-document").TextDocument, | 13 | TextDocument = require("js/document/text-document").TextDocument; |
14 | DocumentController; | ||
15 | //////////////////////////////////////////////////////////////////////// | 14 | //////////////////////////////////////////////////////////////////////// |
16 | // | 15 | // |
17 | var DocumentController = exports.DocumentController = Montage.create(Component, { | 16 | var DocumentController = exports.DocumentController = Montage.create(Component, { |
@@ -19,6 +18,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
19 | value: false | 18 | value: false |
20 | }, | 19 | }, |
21 | 20 | ||
21 | webTemplate: { | ||
22 | value: false | ||
23 | }, | ||
24 | |||
22 | _documents: { | 25 | _documents: { |
23 | value: [] | 26 | value: [] |
24 | }, | 27 | }, |
@@ -65,6 +68,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
65 | this.eventManager.addEventListener("styleSheetDirty", this, false); | 68 | this.eventManager.addEventListener("styleSheetDirty", this, false); |
66 | 69 | ||
67 | this.eventManager.addEventListener("addComponentFirstDraw", this, false); | 70 | this.eventManager.addEventListener("addComponentFirstDraw", this, false); |
71 | |||
72 | // Temporary add listeners for the new stage templates | ||
73 | this.eventManager.addEventListener("executeWebpageOpen", this, false); | ||
74 | this.eventManager.addEventListener("executeNewWebpage", this, false); | ||
68 | } | 75 | } |
69 | }, | 76 | }, |
70 | 77 | ||
@@ -130,6 +137,20 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
130 | } | 137 | } |
131 | }, | 138 | }, |
132 | 139 | ||
140 | handleExecuteWebpageOpen: { | ||
141 | value: function(event) { | ||
142 | this.webTemplate = true; | ||
143 | this.handleExecuteFileOpen(event); | ||
144 | } | ||
145 | }, | ||
146 | |||
147 | handleExecuteNewWebpage: { | ||
148 | value: function(event) { | ||
149 | this.webTemplate = true; | ||
150 | this.handleExecuteNewFile(event); | ||
151 | } | ||
152 | }, | ||
153 | |||
133 | handleExecuteNewFile: { | 154 | handleExecuteNewFile: { |
134 | value: function(event) { | 155 | value: function(event) { |
135 | var newFileSettings = event._event.settings || {}; | 156 | var newFileSettings = event._event.settings || {}; |
@@ -235,7 +256,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
235 | this.creatingNewFile = true;//flag for timeline to identify new file flow | 256 | this.creatingNewFile = true;//flag for timeline to identify new file flow |
236 | 257 | ||
237 | this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); | 258 | this.application.ninja.ioMediator.fileOpen(response.uri, this.openFileCallback.bind(this)); |
238 | }else if(!!response && !response.success){ | 259 | } else if(!!response && !response.success){ |
239 | //Todo: restrict directory path to the sandbox, in the dialog itself | 260 | //Todo: restrict directory path to the sandbox, in the dialog itself |
240 | alert("Unable to create file.\n [Error: Forbidden directory]"); | 261 | alert("Unable to create file.\n [Error: Forbidden directory]"); |
241 | } | 262 | } |
@@ -311,9 +332,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
311 | this.documentHackReference = doc; | 332 | this.documentHackReference = doc; |
312 | // | 333 | // |
313 | switch (doc.extension) { | 334 | switch (doc.extension) { |
314 | case 'html': case 'html': | 335 | case 'html': |
315 | //Open in designer view | 336 | //Open in designer view |
316 | Montage.create(HTMLDocument).initialize(doc, Uuid.generate(), this._createIframeElement(), this._onOpenDocument.bind(this)); | 337 | Montage.create(HTMLDocument).initialize(doc, Uuid.generate(), this._createIframeElement(), this._onOpenDocument.bind(this), this.webTemplate); |
317 | break; | 338 | break; |
318 | default: | 339 | default: |
319 | //Open in code view | 340 | //Open in code view |
@@ -420,6 +441,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
420 | // Event Detail: Contains the current ActiveDocument | 441 | // Event Detail: Contains the current ActiveDocument |
421 | _onOpenDocument: { | 442 | _onOpenDocument: { |
422 | value: function(doc){ | 443 | value: function(doc){ |
444 | this.webTemplate = false; | ||
423 | this.application.ninja.currentDocument = doc; | 445 | this.application.ninja.currentDocument = doc; |
424 | this._hideCurrentDocument(); | 446 | this._hideCurrentDocument(); |
425 | this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); | 447 | this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); |
diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js index b5df3911..b8894c18 100755 --- a/js/controllers/elements/canvas-controller.js +++ b/js/controllers/elements/canvas-controller.js | |||
@@ -34,12 +34,12 @@ exports.CanvasController = Montage.create(ElementController, { | |||
34 | } | 34 | } |
35 | } | 35 | } |
36 | }, | 36 | }, |
37 | 37 | ||
38 | setProperties: { | 38 | setProperties: { |
39 | value: function(el, props, index) { | 39 | value: function(element, properties) { |
40 | for(var p in props) { | 40 | for(var property in properties) { |
41 | el.elementModel.controller.setProperty(el, p, props[p][index]); | 41 | this.setProperty(element, property, properties[property]); |
42 | } | 42 | } |
43 | } | 43 | } |
44 | } | 44 | } |
45 | }); \ No newline at end of file | 45 | }); \ No newline at end of file |