aboutsummaryrefslogtreecommitdiff
path: root/js/mediators/io-mediator.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-12 16:50:33 -0800
committerJose Antonio Marquez2012-02-12 16:50:33 -0800
commitb1fc4f84d92efeaa33ec239b662235c9e8218d0c (patch)
tree8f8c9aacb3c2a2315b8f44ca4400dfea95e21833 /js/mediators/io-mediator.js
parent9f2356c48b831d32d7278648656fe44b98bc4a1f (diff)
downloadninja-b1fc4f84d92efeaa33ec239b662235c9e8218d0c.tar.gz
File Save (HTML only)
Added the ability to save an HTML file from design view, need to add CSS detection and saving (of styles in <style> only). Also need to add 'Save All' for all file attached to the HTML file.
Diffstat (limited to 'js/mediators/io-mediator.js')
-rw-r--r--js/mediators/io-mediator.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js
index 2f286e5e..deb748c7 100644
--- a/js/mediators/io-mediator.js
+++ b/js/mediators/io-mediator.js
@@ -138,6 +138,20 @@ exports.IoMediator = Montage.create(Component, {
138 enumerable: false, 138 enumerable: false,
139 value: function (file, callback) { 139 value: function (file, callback) {
140 // 140 //
141 var contents, save;
142 //
143 switch (file.mode) {
144 case 'html':
145 file.document.content.document.body.innerHTML = file.body;
146 file.document.content.document.head.innerHTML = file.head;
147 contents = file.document.content.document.documentElement.outerHTML;
148 break;
149 default:
150 break;
151 }
152 //
153 save = this.fio.saveFile({uri: file.document.uri, contents: contents})
154 console.log(save);
141 } 155 }
142 }, 156 },
143 //////////////////////////////////////////////////////////////////// 157 ////////////////////////////////////////////////////////////////////