aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js36
1 files changed, 1 insertions, 35 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 7e2fb599..7f4feff9 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -181,45 +181,11 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
181 var code = Montage.create(TextDocument, {"source": {value: doc.content}}), docuuid = Uuid.generate(), textArea; 181 var code = Montage.create(TextDocument, {"source": {value: doc.content}}), docuuid = Uuid.generate(), textArea;
182 textArea = this.application.ninja.stage.stageView.createTextAreaElement(docuuid); 182 textArea = this.application.ninja.stage.stageView.createTextAreaElement(docuuid);
183 code.initialize(doc, docuuid, textArea, textArea.parentNode); 183 code.initialize(doc, docuuid, textArea, textArea.parentNode);
184 code._documentType = doc.extension; 184 code.init(doc.name, doc.uri, doc.extension, null, docuuid);
185 code.textArea.value = doc.content; 185 code.textArea.value = doc.content;
186 this.application.ninja.stage.stageView.createTextView(code); 186 this.application.ninja.stage.stageView.createTextView(code);
187 break; 187 break;
188 } 188 }
189
190 return;
191
192
193
194
195
196 var newDoc;
197
198 if(!doc) return false;
199
200 // try {
201 if (doc.type === 'html' || doc.type === 'htm') {
202 console.log('hello');
203 newDoc = Montage.create(HTMLDocument);
204 newDoc.initialize(doc, Uuid.generate(), this._createIframeElement(), this._onOpenDocument);
205 } else {
206 newDoc = Montage.create(TextDocument, {
207 "source": { value: doc.source }
208 });
209 var docUuid = Uuid.generate();
210 var textArea = this.application.ninja.stage.stageView.createTextAreaElement(docUuid);
211 newDoc.initialize(doc, docUuid, textArea, textArea.parentNode);
212
213 // Tmp this will be filled with the real content
214 newDoc.textArea.value = doc.source; //this.tmpSourceForTesting;
215
216 this.textDocumentOpened(newDoc);
217
218 }
219
220 // } catch (err) {
221 // console.log("Could not open Document ", err);
222 // }
223 } 189 }
224 }, 190 },
225 //////////////////////////////////////////////////////////////////// 191 ////////////////////////////////////////////////////////////////////