diff options
26 files changed, 161 insertions, 41 deletions
diff --git a/images/picker/FileType-DirectoryOpen.png b/images/picker/FileType-DirectoryOpen.png new file mode 100755 index 00000000..0211ca4d --- /dev/null +++ b/images/picker/FileType-DirectoryOpen.png | |||
Binary files differ | |||
diff --git a/images/picker/css_file.png b/images/picker/css_file.png index dc7aaf7a..e46233fa 100755 --- a/images/picker/css_file.png +++ b/images/picker/css_file.png | |||
Binary files differ | |||
diff --git a/images/picker/doc_file.png b/images/picker/doc_file.png index 13743fd0..ef3143ef 100755 --- a/images/picker/doc_file.png +++ b/images/picker/doc_file.png | |||
Binary files differ | |||
diff --git a/images/picker/file.png b/images/picker/file.png index 13e476e6..d179ad72 100755 --- a/images/picker/file.png +++ b/images/picker/file.png | |||
Binary files differ | |||
diff --git a/images/picker/folder.png b/images/picker/folder.png index bbeaf2a3..bd552af5 100755 --- a/images/picker/folder.png +++ b/images/picker/folder.png | |||
Binary files differ | |||
diff --git a/images/picker/html_file.png b/images/picker/html_file.png index 596cc55b..bbce4ee3 100755 --- a/images/picker/html_file.png +++ b/images/picker/html_file.png | |||
Binary files differ | |||
diff --git a/images/picker/js_file.png b/images/picker/js_file.png index 95353fc8..997a573e 100755 --- a/images/picker/js_file.png +++ b/images/picker/js_file.png | |||
Binary files differ | |||
diff --git a/images/picker/json_file.png b/images/picker/json_file.png new file mode 100755 index 00000000..119d26e7 --- /dev/null +++ b/images/picker/json_file.png | |||
Binary files differ | |||
diff --git a/images/picker/php_file.png b/images/picker/php_file.png index c26fa0cc..be8b7673 100755 --- a/images/picker/php_file.png +++ b/images/picker/php_file.png | |||
Binary files differ | |||
diff --git a/images/picker/pl_file.png b/images/picker/pl_file.png new file mode 100755 index 00000000..989abcb6 --- /dev/null +++ b/images/picker/pl_file.png | |||
Binary files differ | |||
diff --git a/images/picker/py_file.png b/images/picker/py_file.png new file mode 100755 index 00000000..88d1fd54 --- /dev/null +++ b/images/picker/py_file.png | |||
Binary files differ | |||
diff --git a/images/picker/rb_file.png b/images/picker/rb_file.png new file mode 100755 index 00000000..e6df7109 --- /dev/null +++ b/images/picker/rb_file.png | |||
Binary files differ | |||
diff --git a/images/picker/txt_file.png b/images/picker/txt_file.png index 30887605..bef97b38 100755 --- a/images/picker/txt_file.png +++ b/images/picker/txt_file.png | |||
Binary files differ | |||
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..de080167 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -61,7 +61,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
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 | 63 | ||
64 | this.eventManager.addEventListener("recordStyleChanged", this, false); | 64 | this.eventManager.addEventListener("styleSheetDirty", this, false); |
65 | 65 | ||
66 | } | 66 | } |
67 | }, | 67 | }, |
@@ -157,7 +157,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
157 | if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ | 157 | if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ |
158 | saveAsSettings.fileName = this.activeDocument.name; | 158 | saveAsSettings.fileName = this.activeDocument.name; |
159 | saveAsSettings.folderUri = this.activeDocument.uri.substring(0, this.activeDocument.uri.lastIndexOf("/")); | 159 | saveAsSettings.folderUri = this.activeDocument.uri.substring(0, this.activeDocument.uri.lastIndexOf("/")); |
160 | //add callback | 160 | saveAsSettings.callback = this.saveAsCallback.bind(this); |
161 | this.application.ninja.newFileController.showSaveAsDialog(saveAsSettings); | 161 | this.application.ninja.newFileController.showSaveAsDialog(saveAsSettings); |
162 | } | 162 | } |
163 | } | 163 | } |
@@ -166,8 +166,12 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
166 | // | 166 | // |
167 | fileSaveResult: { | 167 | fileSaveResult: { |
168 | value: function (result) { | 168 | value: function (result) { |
169 | if(result.status === 204){ | 169 | if((result.status === 204) || (result.status === 404)){//204=>existing file || 404=>new file... saved |
170 | this.activeDocument.needsSave = false; | 170 | this.activeDocument.needsSave = false; |
171 | if(this.application.ninja.currentDocument !== null){ | ||
172 | //clear Dirty StyleSheets for the saved document | ||
173 | this.application.ninja.stylesController.clearDirtyStyleSheets(this.application.ninja.currentDocument); | ||
174 | } | ||
171 | } | 175 | } |
172 | } | 176 | } |
173 | }, | 177 | }, |
@@ -249,6 +253,29 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
249 | }, | 253 | }, |
250 | //////////////////////////////////////////////////////////////////// | 254 | //////////////////////////////////////////////////////////////////// |
251 | // | 255 | // |
256 | saveAsCallback:{ | ||
257 | value:function(saveAsDetails){ | ||
258 | var fileUri = null, filename = saveAsDetails.filename, destination = saveAsDetails.destination; | ||
259 | //update document metadata | ||
260 | this.activeDocument.name = ""+filename; | ||
261 | //prepare new file uri | ||
262 | if(destination && (destination.charAt(destination.length -1) !== "/")){ | ||
263 | destination = destination + "/"; | ||
264 | } | ||
265 | fileUri = destination+filename; | ||
266 | |||
267 | this.activeDocument.uri = fileUri; | ||
268 | //save a new file | ||
269 | //use the ioMediator.fileSaveAll when implemented | ||
270 | this.activeDocument._userDocument.name=filename; | ||
271 | this.activeDocument._userDocument.root=destination; | ||
272 | this.activeDocument._userDocument.uri=fileUri; | ||
273 | this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); | ||
274 | // | ||
275 | } | ||
276 | }, | ||
277 | |||
278 | //////////////////////////////////////////////////////////////////// | ||
252 | openDocument: { | 279 | openDocument: { |
253 | value: function(doc) { | 280 | value: function(doc) { |
254 | 281 | ||
@@ -336,14 +363,23 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
336 | nextDocumentIndex = closeDocumentIndex - 1; | 363 | nextDocumentIndex = closeDocumentIndex - 1; |
337 | } | 364 | } |
338 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); | 365 | this.application.ninja.stage.stageView.switchDocument(this._documents[nextDocumentIndex]); |
366 | doc.stopVideos(); | ||
339 | this._removeDocumentView(doc.container); | 367 | this._removeDocumentView(doc.container); |
340 | }else if(this._documents.length === 0){ | 368 | }else if(this._documents.length === 0){ |
369 | if(typeof this.activeDocument.pauseVideos !== "undefined"){ | ||
370 | this.activeDocument.pauseVideos(true); | ||
371 | } | ||
341 | this.activeDocument = null; | 372 | this.activeDocument = null; |
342 | this._removeDocumentView(doc.container); |