aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-08 17:36:57 -0700
committerValerio Virgillito2012-05-08 17:36:57 -0700
commitf8c467bd268e10d4f07136ca932c6eaffc94bc12 (patch)
tree16c9785629451a461f855cba4b4e36f28e639a8c /js/controllers
parentb425025001c0ef0ea0ea8439d60a133c3fac61b0 (diff)
parentef1daccfad5381badd53b9d045c2687f9b0e090d (diff)
downloadninja-f8c467bd268e10d4f07136ca932c6eaffc94bc12.tar.gz
Merge pull request #204 from joseeight/Document
I/O: Adding Save Functionality
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 cf96208f..17ae8cc3 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 ////////////////////////////////////////////////////////////////////