aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-08 17:33:13 -0700
committerJose Antonio Marquez2012-05-08 17:33:13 -0700
commita1e8540f5656e62db6a89f3af7829be6b259b7ed (patch)
tree1b8a445cf5c145a9622813da88555596640e7e37 /js/controllers
parent4504972c1f3b9bf1d02a4484a07a8a85cf9ccee2 (diff)
downloadninja-a1e8540f5656e62db6a89f3af7829be6b259b7ed.tar.gz
Adding SAVE for I/O
Adding save functionality to new template. Need to implement user UI for prompts and also clean up...
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js29
1 files changed, 20 insertions, 9 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 6a25420a..ed4d33eb 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -166,23 +166,34 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
166 } 166 }
167 }, 167 },
168 //////////////////////////////////////////////////////////////////// 168 ////////////////////////////////////////////////////////////////////
169 //TODO: Check for appropiate structures 169 //
170 handleExecuteSave: { 170 handleExecuteSave: {
171 value: function(event) { 171 value: function(event) {
172 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ 172 //
173 //Text and HTML document classes should return the same save object for fileSave 173 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){
174 this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); 174 //
175 } 175 this.activeDocument.model.save(this.testCallback.bind(this)); //this.fileSaveResult.bind(this)
176 } else {
177 //Error:
178 }
176 } 179 }
177 }, 180 },
181 testCallback: {
182 value: function (value) {
183 console.log(value);
184 }
185 },
178 //////////////////////////////////////////////////////////////////// 186 ////////////////////////////////////////////////////////////////////
179 //TODO: Check for appropiate structures 187 //TODO: Check for appropiate structures
180 handleExecuteSaveAll: { 188 handleExecuteSaveAll: {
181 value: function(event) { 189 value: function(event) {
182 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ 190 //
183 //Text and HTML document classes should return the same save object for fileSave 191 if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){
184 this.application.ninja.ioMediator.fileSave(this.activeDocument.saveAll(), this.fileSaveResult.bind(this)); 192 //
185 } 193 this.activeDocument.model.saveAll(this.testCallback.bind(this)); //this.fileSaveResult.bind(this)
194 } else {
195 //Error:
196 }
186 } 197 }
187 }, 198 },
188 //////////////////////////////////////////////////////////////////// 199 ////////////////////////////////////////////////////////////////////