diff options
Diffstat (limited to 'js')
-rwxr-xr-x | js/components/ui/icon-list-basic/icon.reel/icon.js | 14 | ||||
-rwxr-xr-x | js/components/ui/tree-basic/treeItem.reel/treeItem.js | 14 | ||||
-rwxr-xr-x | js/controllers/document-controller.js | 59 | ||||
-rwxr-xr-x | js/controllers/selection-controller.js | 19 | ||||
-rwxr-xr-x | js/controllers/styles-controller.js | 10 | ||||
-rwxr-xr-x | js/data/menu-data.js | 6 | ||||
-rwxr-xr-x | js/document/html-document.js | 43 | ||||
-rwxr-xr-x | js/helper-classes/3D/draw-utils.js | 10 | ||||
-rwxr-xr-x | js/io/ui/file-picker/file-picker-controller.js | 2 | ||||
-rwxr-xr-x | js/io/ui/file-picker/file-picker-model.js | 6 | ||||
-rw-r--r-- | js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js | 7 | ||||
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.js | 4 | ||||
-rwxr-xr-x | js/stage/layout.js | 10 | ||||
-rwxr-xr-x | js/stage/stage-view.reel/stage-view.js | 5 |
14 files changed, 166 insertions, 43 deletions
diff --git a/js/components/ui/icon-list-basic/icon.reel/icon.js b/js/components/ui/icon-list-basic/icon.reel/icon.js index 72adbfa1..1ef6e277 100755 --- a/js/components/ui/icon-list-basic/icon.reel/icon.js +++ b/js/components/ui/icon-list-basic/icon.reel/icon.js | |||
@@ -174,21 +174,17 @@ var Icon = exports.Icon = Montage.create(Component, { | |||
174 | enumerable: true, | 174 | enumerable: true, |
175 | value:{ | 175 | value:{ |
176 | "img_root":"images/picker/", | 176 | "img_root":"images/picker/", |
177 | ".png":"png_file.png", | ||
178 | ".jpg":"jpeg_file.png", | ||
179 | ".js":"js_file.png", | 177 | ".js":"js_file.png", |
178 | ".json":"json_file.png", | ||
180 | ".css":"css_file.png", | 179 | ".css":"css_file.png", |
181 | ".html":"html_file.png", | 180 | ".html":"html_file.png", |
182 | ".xml":"xml_file.png", | 181 | ".xml":"xml_file.png", |
183 | ".php":"php_file.png", | 182 | ".php":"php_file.png", |
183 | ".pl":"pl_file.png", | ||
184 | ".py":"py_file.png", | ||
185 | ".rb":"rb_file.png", | ||
184 | ".doc":"doc_file.png", | 186 | ".doc":"doc_file.png", |
185 | ".docx":"doc_file.png", | 187 | ".txt":"txt_file.png", |
186 | ".rtf":"rtf_file.png", | ||
187 | ".pdf":"pdf_file.png", | ||
188 | ".zip":"zip_file.png", | ||
189 | ".rar":"zip_file.png", | ||
190 | ".app":"executable.png", | ||
191 | ".exe":"executable.png", | ||
192 | "file_default":"file.png", | 188 | "file_default":"file.png", |
193 | "directory":"folder.png" | 189 | "directory":"folder.png" |
194 | } | 190 | } |
diff --git a/js/components/ui/tree-basic/treeItem.reel/treeItem.js b/js/components/ui/tree-basic/treeItem.reel/treeItem.js index 4c71cb6b..a67dad43 100755 --- a/js/components/ui/tree-basic/treeItem.reel/treeItem.js +++ b/js/components/ui/tree-basic/treeItem.reel/treeItem.js | |||
@@ -242,21 +242,17 @@ exports.TreeItem = Montage.create(Component, { | |||
242 | enumerable: true, | 242 | enumerable: true, |
243 | value:{ | 243 | value:{ |
244 | "img_root":"images/picker/", | 244 | "img_root":"images/picker/", |
245 | ".png":"png_file.png", | ||
246 | ".jpg":"jpeg_file.png", | ||
247 | ".js":"js_file.png", | 245 | ".js":"js_file.png", |
246 | ".json":"json_file.png", | ||
248 | ".css":"css_file.png", | 247 | ".css":"css_file.png", |
249 | ".html":"html_file.png", | 248 | ".html":"html_file.png", |
250 | ".xml":"xml_file.png", | 249 | ".xml":"xml_file.png", |
251 | ".php":"php_file.png", | 250 | ".php":"php_file.png", |
251 | ".pl":"pl_file.png", | ||
252 | ".py":"py_file.png", | ||
253 | ".rb":"rb_file.png", | ||
252 | ".doc":"doc_file.png", | 254 | ".doc":"doc_file.png", |
253 | ".docx":"doc_file.png", | 255 | ".txt":"txt_file.png", |
254 | ".rtf":"rtf_file.png", | ||
255 | ".pdf":"pdf_file.png", | ||
256 | ".zip":"zip_file.png", | ||
257 | ".rar":"zip_file.png", | ||
258 | ".app":"executable.png", | ||
259 | ".exe":"executable.png", | ||
260 | "file_default":"file.png", | 256 | "file_default":"file.png", |
261 | "directory":"folder.png" | 257 | "directory":"folder.png" |
262 | } | 258 | } |
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 194496a6..87e93465 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -60,8 +60,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
60 | this.eventManager.addEventListener("executeSave", this, false); | 60 | this.eventManager.addEventListener("executeSave", this, false); |
61 | this.eventManager.addEventListener("executeSaveAs", this, false); | 61 | this.eventManager.addEventListener("executeSaveAs", this, false); |
62 | this.eventManager.addEventListener("executeSaveAll", this, false); | 62 | this.eventManager.addEventListener("executeSaveAll", this, false); |
63 | this.eventManager.addEventListener("executeFileClose", this, false); | ||
63 | 64 | ||
64 | this.eventManager.addEventListener("recordStyleChanged", this, false); | 65 | this.eventManager.addEventListener("styleSheetDirty", this, false); |
65 | 66 | ||
66 | } | 67 | } |
67 | }, | 68 | }, |
@@ -157,17 +158,29 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
157 | if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ | 158 | if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ |
158 | saveAsSettings.fileName = this.activeDocument.name; | 159 | saveAsSettings.fileName = this.activeDocument.name; |
159 | saveAsSettings.folderUri = this.activeDocument.uri.substring(0, this.activeDocument.uri.lastIndexOf("/")); | 160 | saveAsSettings.folderUri = this.activeDocument.uri.substring(0, this.activeDocument.uri.lastIndexOf("/")); |
160 | //add callback | 161 | saveAsSettings.callback = this.saveAsCallback.bind(this); |
161 | this.application.ninja.newFileController.showSaveAsDialog(saveAsSettings); | 162 | this.application.ninja.newFileController.showSaveAsDialog(saveAsSettings); |
162 | } | 163 | } |
163 | } | 164 | } |
164 | }, | 165 | }, |
165 | 166 | //////////////////////////////////////////////////////////////////// | |
167 | handleExecuteFileClose:{ | ||
168 | value: function(event) { | ||
169 | if(this.activeDocument && this.application.ninja.coreIoApi.cloudAvailable()){ | ||
170 | this.closeDocument(this.activeDocument.uuid); | ||
171 | } | ||
172 | } | ||
173 | }, | ||
174 | //////////////////////////////////////////////////////////////////// | ||
166 | // | 175 | // |
167 | fileSaveResult: { | 176 | fileSaveResult: { |
168 | value: function (result) { | 177 | value: function (result) { |
169 | if(result.status === 204){ | 178 | if((result.status === 204) || (result.status === 404)){//204=>existing file || 404=>new file... saved |
170 | this.activeDocument.needsSave = false; | 179 | this.activeDocument.needsSave = false; |
180 | if(this.application.ninja.currentDocument !== null){ | ||
181 | //clear Dirty StyleSheets for the saved document | ||
182 | this.application.ninja.stylesController.clearDirtyStyleSheets(this.application.ninja.currentDocument); | ||
183 | } | ||
171 | } | 184 | } |
172 | } | 185 | } |
173 | }, | 186 | }, |
@@ -249,6 +262,29 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
249 | }, | 262 | }, |
250 | //////////////////////////////////////////////////////////////////// | 263 | //////////////////////////////////////////////////////////////////// |
251 | // | 264 | // |
265 | saveAsCallback:{ | ||
266 | value:function(saveAsDetails){ | ||
267 | var fileUri = null, filename = saveAsDetails.filename, destination = saveAsDetails.destination; | ||
268 | //update document metadata | ||
269 | this.activeDocument.name = ""+filename; | ||
270 | //prepare new file uri | ||
271 | if(destination && (destination.charAt(destination.length -1) !== "/")){ | ||
272 | destination = destination + "/"; | ||
273 | } | ||
274 | fileUri = destination+filename; | ||
275 | |||
276 | this.activeDocument.uri = fileUri; | ||
277 | //save a new file | ||
278 | //use the ioMediator.fileSaveAll when implemented | ||
279 | this.activeDocument._userDocument.name=filename; | ||
280 | this.activeDocument._userDocument.root=destination; | ||
281 | this.activeDocument._userDocument.uri=fileUri; | ||
282 | this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); | ||
283 | // | ||
284 | } | ||
285 | }, | ||
286 | |||
287 | //////////////////////////////////////////////////////////////////// | ||
252 | openDocument: { | 288 | openDocument: { |
253 | value: function(doc) { | 289 | value: function(doc) { |
254 | 290 | ||
@@ -336,14 +372,23 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
336 | nextDocumentIndex = closeDocumentIndex - 1; | 372 | nextDocumentIndex = closeDocumentIndex - 1; |
337 | } | 373 | } |
338 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); | 374 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); |
375 | if(typeof this.activeDocument.stopVideos !== "undefined"){doc.stopVideos();} | ||
339 | this._removeDocumentView(doc.container); | 376 | this._removeDocumentView(doc.container); |
340 | }else if(this._documents.length === 0){ | 377 | }else if(this._documents.length === 0){ |
378 | if(typeof this.activeDocument.pauseAndStopVideos !== "undefined"){ | ||
379 | this.activeDocument.pauseAndStopVideos(); | ||
380 | } | ||
341 | this.activeDocument = null; | 381 | this.activeDocument = null; |
342 | this._removeDocumentView(doc.container); | 382 | this._removeDocumentView(doc.container); |
343 | this.application.ninja.stage.stageView.hideRulers(); | 383 | this.application.ninja.stage.stageView.hideRulers(); |
344 | document.getElementById("iframeContainer").style.display="block"; | 384 | document.getElementById("iframeContainer").style.display="block"; |
345 | 385 | ||
346 | this.application.ninja.stage.hideCanvas(true); | 386 | this.application.ninja.stage.hideCanvas(true); |
387 | }else{//closing inactive document tab - just clear DOM | ||
388 | if(typeof doc.pauseAndStopVideos !== "undefined"){ | ||
389 | doc.pauseAndStopVideos(); | ||
390 | } | ||
391 | this._removeDocumentView(doc.container); | ||
347 | } | 392 | } |
348 | 393 | ||
349 | NJevent("closeDocument", doc.uri); | 394 | NJevent("closeDocument", doc.uri); |
@@ -506,5 +551,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
506 | value: function() { | 551 | value: function() { |
507 | return "userDocument_" + (this._iframeCounter++); | 552 | return "userDocument_" + (this._iframeCounter++); |
508 | } | 553 | } |
554 | }, | ||
555 | |||
556 | handleStyleSheetDirty:{ | ||
557 | value:function(){ | ||
558 | this.activeDocument.needsSave = true; | ||
509 | } |