diff options
author | Ananya Sen | 2012-02-15 09:50:20 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-15 09:50:20 -0800 |
commit | 2e308be9bec5e06d81b2905b65005a232f0a190d (patch) | |
tree | c208938eabfe85e33ccbbceb9f66ad780f70f62a /js/mediators | |
parent | e327eccb93e2bc513fcbb7ab302783d6bce83884 (diff) | |
download | ninja-2e308be9bec5e06d81b2905b65005a232f0a190d.tar.gz |
Revert "Creating NinjaTemplate to HTML function"
This reverts commit e327eccb93e2bc513fcbb7ab302783d6bce83884.
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/mediators')
-rw-r--r-- | js/mediators/io-mediator.js | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js index 2008e40f..599b7d84 100644 --- a/js/mediators/io-mediator.js +++ b/js/mediators/io-mediator.js | |||
@@ -142,7 +142,12 @@ exports.IoMediator = Montage.create(Component, { | |||
142 | // | 142 | // |
143 | switch (file.mode) { | 143 | switch (file.mode) { |
144 | case 'html': | 144 | case 'html': |
145 | contents = this.parseNinjaTemplateToHtml(file); | 145 | file.document.content.document.body.innerHTML = file.body; |
146 | file.document.content.document.head.innerHTML = file.head; | ||
147 | if (file.style) { | ||
148 | file.document.content.document.head.getElementsByTagName('style')[0].innerHTML = this.getCssFromRules(file.style.cssRules); | ||
149 | } | ||
150 | contents = file.document.content.document.documentElement.outerHTML; | ||
146 | break; | 151 | break; |
147 | default: | 152 | default: |
148 | contents = file.content; | 153 | contents = file.content; |
@@ -184,21 +189,6 @@ exports.IoMediator = Montage.create(Component, { | |||
184 | } | 189 | } |
185 | }, | 190 | }, |
186 | //////////////////////////////////////////////////////////////////// | 191 | //////////////////////////////////////////////////////////////////// |
187 | //TODO: Expand to allow more templates | ||
188 | parseNinjaTemplateToHtml: { | ||
189 | enumerable: false, | ||
190 | value: function (template) { | ||
191 | // | ||
192 | template.document.content.document.body.innerHTML = template.body; | ||
193 | template.document.content.document.head.innerHTML = template.head; | ||
194 | //TODO: Remove temp fix for styles | ||
195 | if (template.style) { | ||
196 | template.document.content.document.head.getElementsByTagName('style')[0].innerHTML = this.getCssFromRules(template.style.cssRules); | ||
197 | } | ||
198 | return template.document.content.document.documentElement.outerHTML; | ||
199 | } | ||
200 | }, | ||
201 | //////////////////////////////////////////////////////////////////// | ||
202 | //Method to return a string from CSS rules (to be saved to a file) | 192 | //Method to return a string from CSS rules (to be saved to a file) |
203 | getCssFromRules: { | 193 | getCssFromRules: { |
204 | enumerable: false, | 194 | enumerable: false, |