diff options
author | Jose Antonio Marquez Russo | 2012-07-23 23:05:06 -0700 |
---|---|---|
committer | Jose Antonio Marquez Russo | 2012-07-23 23:05:06 -0700 |
commit | 2952c2465b9a66076344087f899c5c836ad15ad6 (patch) | |
tree | 34274616fd6e0964c9102dde2dd32f20d0cd0089 /js/document/document-html.js | |
parent | 5946ec8651547f846520add097850470a09df635 (diff) | |
download | ninja-2952c2465b9a66076344087f899c5c836ad15ad6.tar.gz |
New: Adding method to display document in code view
Added method to parse in memory document in code view. This allows users to view current in memory document in code view while not saving the document or external files. Still need to handle naming of paths for files that require saving but are not saved (webGL and Montage libraries). Also, need to implement method to switch back from code view to design view, but will need Timeline fixes.
Diffstat (limited to 'js/document/document-html.js')
-rwxr-xr-x | js/document/document-html.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index 569b6d8b..81a8912b 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -135,8 +135,7 @@ exports.HtmlDocument = Montage.create(Component, { | |||
135 | //////////////////////////////////////////////////////////////////// | 135 | //////////////////////////////////////////////////////////////////// |
136 | //TODO: Make into one method to use here and one init | 136 | //TODO: Make into one method to use here and one init |
137 | reloadView: { | 137 | reloadView: { |
138 | value: function (view, template) { | 138 | value: function (view, template, doc) { |
139 | var content; | ||
140 | // | 139 | // |
141 | this.model.parentContainer.removeChild(this.model.views.design.iframe); | 140 | this.model.parentContainer.removeChild(this.model.views.design.iframe); |
142 | //Initiliazing views and hiding | 141 | //Initiliazing views and hiding |
@@ -167,14 +166,13 @@ exports.HtmlDocument = Montage.create(Component, { | |||
167 | this._observer.observe(this.model.views.design.document.head, {childList: true}); | 166 | this._observer.observe(this.model.views.design.document.head, {childList: true}); |
168 | }.bind(this), template, {viewCallback: this.handleViewReady, context: this}); | 167 | }.bind(this), template, {viewCallback: this.handleViewReady, context: this}); |
169 | } else if(view === 'code'){ | 168 | } else if(view === 'code'){ |
170 | 169 | //TODO: Add logic to handle external changed files | |
171 | 170 | //Checking for template type and not saving external data | |
172 | //TODO: Parse in memory document through template to get current document | 171 | if (doc.template && (doc.template.type === 'banner' || doc.template.type === 'animation')) { |
173 | content = '<html><head>'+this.model.file.content.head+'</head><body>'+this.model.file.content.body+'</body></html>';//dummy | 172 | this.model.views.code.load(this.application.ninja.ioMediator.tmplt.parseNinjaTemplateToHtml(false, doc, true, null).content); |
174 | 173 | } else { | |
175 | 174 | this.model.views.code.load(this.application.ninja.ioMediator.tmplt.parseNinjaTemplateToHtml(false, doc, false, null).content); | |
176 | // | 175 | } |
177 | this.model.views.code.load(content); | ||
178 | //Setting current view object to code | 176 | //Setting current view object to code |
179 | this.currentView = 'code'; | 177 | this.currentView = 'code'; |
180 | this.model.currentView = this.model.views.code; | 178 | this.model.currentView = this.model.views.code; |