diff options
Diffstat (limited to 'js')
19 files changed, 97 insertions, 56 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 5e2a6461..df3c74f8 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -59,10 +59,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
59 | this.eventManager.addEventListener("executeNewFile", this, false); | 59 | this.eventManager.addEventListener("executeNewFile", this, false); |
60 | this.eventManager.addEventListener("executeSave", this, false); | 60 | this.eventManager.addEventListener("executeSave", this, false); |
61 | 61 | ||
62 | this.eventManager.addEventListener("recordStyleChanged", this, false); | 62 | this.eventManager.addEventListener("recordStyleChanged", this, false); |
63 | |||
64 | |||
65 | |||
66 | } | 63 | } |
67 | }, | 64 | }, |
68 | 65 | ||
@@ -119,8 +116,10 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
119 | //TODO: Check for appropiate structures | 116 | //TODO: Check for appropiate structures |
120 | handleExecuteSave: { | 117 | handleExecuteSave: { |
121 | value: function(event) { | 118 | value: function(event) { |
122 | //Text and HTML document classes should return the same save object for fileSave | 119 | if(!!this.activeDocument){ |
123 | this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); | 120 | //Text and HTML document classes should return the same save object for fileSave |
121 | this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); | ||
122 | } | ||
124 | } | 123 | } |
125 | }, | 124 | }, |
126 | //////////////////////////////////////////////////////////////////// | 125 | //////////////////////////////////////////////////////////////////// |
@@ -460,5 +459,5 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
460 | value: function() { | 459 | value: function() { |
461 | return "userDocument_" + (this._iframeCounter++); | 460 | return "userDocument_" + (this._iframeCounter++); |
462 | } | 461 | } |
463 | } | 462 | } |
464 | }); | 463 | }); |
diff --git a/js/document/text-document.js b/js/document/text-document.js index 3e20e1f6..1132ba65 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js | |||
@@ -27,7 +27,7 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { | |||
27 | // PRIVATE MEMBERS | 27 | // PRIVATE MEMBERS |
28 | _codeEditor: { | 28 | _codeEditor: { |
29 | value: { | 29 | value: { |
30 | "editor": { value: null, enumerable: false }, | 30 | "editor": { value: null, enumerable: false } |
31 | 31 | ||
32 | } | 32 | } |
33 | }, | 33 | }, |
@@ -192,5 +192,17 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { | |||
192 | value: function() { | 192 | value: function() { |
193 | // Have the XHR here? | 193 | // Have the XHR here? |
194 | } | 194 | } |
195 | }, | ||
196 | |||
197 | markEdited:{ | ||
198 | value: function() { | ||
199 | this.dirtyFlag = true; | ||
200 | } | ||
201 | }, | ||
202 | |||
203 | markUnedited:{ | ||
204 | value: function() { | ||
205 | this.dirtyFlag = false; | ||
206 | } | ||
195 | } | 207 | } |
196 | }); \ No newline at end of file | 208 | }); \ No newline at end of file |
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index a75b59bb..2051da43 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -1096,37 +1096,6 @@ exports.CoreIoApi = Montage.create(Component, { | |||
1096 | } | 1096 | } |
1097 | return status; | 1097 | return status; |
1098 | } | 1098 | } |
1099 | }, | ||
1100 | |||
1101 | //////////////////////////////////////////////////////////////////// | ||
1102 | /*** | ||
1103 | * check if the file exists | ||
1104 | */ | ||
1105 | checkFileExists:{ | ||
1106 | value: function(fileName, folderUri, fileType){ | ||
1107 | var uri = "", response=null, status=true; | ||
1108 | |||
1109 | //prepare absolute uri | ||
1110 | if(/[^/\\]$/g.test(folderUri)){ | ||
1111 | folderUri = folderUri + "/"; | ||
1112 | } | ||
1113 | |||
1114 | if(!!fileType && (fileName.lastIndexOf(fileType) !== (fileName.length - fileType.length))){ | ||
1115 | fileName = fileName+fileType; | ||
1116 | } | ||
1117 | |||
1118 | uri = ""+folderUri+fileName; | ||
1119 | |||
1120 | response = this.fileExists({"uri":uri}); | ||
1121 | if(!!response && response.success && (response.status === 204)){ | ||
1122 | status = true; | ||
1123 | }else if(!!response && response.success && (response.status === 404)){ | ||
1124 | status = false; | ||
1125 | }else{ | ||
1126 | status = false; | ||
1127 | } | ||
1128 | return status; | ||
1129 | } | ||
1130 | } | 1099 | } |
1131 | //////////////////////////////////////////////////////////////////// | 1100 | //////////////////////////////////////////////////////////////////// |
1132 | }); | 1101 | }); |
diff --git a/js/components/ui/FilePicker/file-input-field.reel/file-input-field.css b/js/io/ui/file-picker/file-input-field.reel/file-input-field.css index 91e412f8..91e412f8 100755 --- a/js/components/ui/FilePicker/file-input-field.reel/file-input-field.css +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.css | |||
diff --git a/js/components/ui/FilePicker/file-input-field.reel/file-input-field.html b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html index 46dd5c69..2fcaa075 100755 --- a/js/components/ui/FilePicker/file-input-field.reel/file-input-field.html +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html | |||
@@ -11,7 +11,7 @@ | |||
11 | <script type="text/montage-serialization"> | 11 | <script type="text/montage-serialization"> |
12 | { | 12 | { |
13 | "owner":{ | 13 | "owner":{ |
14 | "module": "js/components/ui/FilePicker/file-input-field.reel", | 14 | "module": "js/io/ui/file-picker/file-input-field.reel", |
15 | "name": "FileInputField", | 15 | "name": "FileInputField", |
16 | "properties": { | 16 | "properties": { |
17 | "element": {"#": "fileInputField"}, | 17 | "element": {"#": "fileInputField"}, |
diff --git a/js/components/ui/FilePicker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js index 235be8ad..235be8ad 100755 --- a/js/components/ui/FilePicker/file-input-field.reel/file-input-field.js +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js | |||
diff --git a/js/components/ui/FilePicker/file-picker-controller.js b/js/io/ui/file-picker/file-picker-controller.js index 0ff20cc8..129bebad 100755 --- a/js/components/ui/FilePicker/file-picker-controller.js +++ b/js/io/ui/file-picker/file-picker-controller.js | |||
@@ -6,8 +6,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
6 | 6 | ||
7 | 7 | ||
8 | var Montage = require("montage/core/core").Montage, | 8 | var Montage = require("montage/core/core").Montage, |
9 | pickerNavigatorReel = require("js/components/ui/FilePicker/pickerNavigator.reel").PickerNavigator, | 9 | pickerNavigatorReel = require("js/io/ui/file-picker/picker-navigator.reel").PickerNavigator, |
10 | filePickerModelModule = require("js/components/ui/FilePicker/file-picker-model"), | 10 | filePickerModelModule = require("js/io/ui/file-picker/file-picker-model"), |
11 | Popup = require("montage/ui/popup/popup.reel").Popup; | 11 | Popup = require("montage/ui/popup/popup.reel").Popup; |
12 | 12 | ||
13 | //singleton with functions to create a new file picker instance and utilities to format or filter the model data | 13 | //singleton with functions to create a new file picker instance and utilities to format or filter the model data |
diff --git a/js/components/ui/FilePicker/file-picker-model.js b/js/io/ui/file-picker/file-picker-model.js index d9cf02ed..09c3ae9c 100755 --- a/js/components/ui/FilePicker/file-picker-model.js +++ b/js/io/ui/file-picker/file-picker-model.js | |||
@@ -4,7 +4,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var filePickerControllerModule = require("js/components/ui/FilePicker/file-picker-controller"); | 7 | var filePickerControllerModule = require("js/io/ui/file-picker/file-picker-controller"); |
8 | 8 | ||
9 | //this is per file picker instance | 9 | //this is per file picker instance |
10 | exports.FilePickerModel = (require("montage/core/core").Montage).create(require("montage/ui/component").Component, { | 10 | exports.FilePickerModel = (require("montage/core/core").Montage).create(require("montage/ui/component").Component, { |
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.css index 796c283f..796c283f 100644 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css +++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.css | |||
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.html b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.html index 20cb0c68..f46068ec 100755 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.html +++ b/js/io/ui/file-picker/picker-navigator.reel/picker-navigator.html | |||
@@ -7,11 +7,11 @@ | |||
7 | <html> | 7 | <html> |
8 | <head> | 8 | <head> |
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | 9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
10 | <link rel="stylesheet" type="text/css" href="pickerNavigator.css"> | 10 | <link rel="stylesheet" type="text/css" href="picker-navigator.css"> |
11 | <script type="text/montage-serialization"> | 11 | <script type="text/montage-serialization"> |
12 | { | 12 | { |
13 | "owner":{ | 13 | "owner":{ |
14 | "module": "js/components/ui/FilePicker/pickerNavigator.reel", | 14 | "module": "js/io/ui/file-picker/picker-navigator.reel", |
15 | "name":"PickerNavigator", | 15 | "name":"PickerNavigator", |
16 | "properties":{ | 16 | "properties":{ |
17 | "element": {"#": "picker"}, | 17 | "element": {"#": "picker"}, |
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js b/js/io/ui/file-picker/picke |