aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/document-controller.js25
1 files changed, 5 insertions, 20 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 25f60cc5..f397ace7 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -9,8 +9,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
9var Montage = require("montage/core/core").Montage, 9var Montage = require("montage/core/core").Montage,
10 Component = require("montage/ui/component").Component, 10 Component = require("montage/ui/component").Component,
11 Uuid = require("montage/core/uuid").Uuid, 11 Uuid = require("montage/core/uuid").Uuid,
12 HTMLDocument = require("js/document/models/html-document").HTMLDocument, 12 HTMLDocument = require("js/document/html-document").HTMLDocument,
13 BaseDocument = require("js/document/models/base-document").BaseDocument, 13 TextDocument = require("js/document/text-document").TextDocument,
14 DocumentController; 14 DocumentController;
15//////////////////////////////////////////////////////////////////////// 15////////////////////////////////////////////////////////////////////////
16// 16//
@@ -28,13 +28,7 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
28 _iframeHolder: { value: null, enumerable: false }, 28 _iframeHolder: { value: null, enumerable: false },
29 _textHolder: { value: null, enumerable: false }, 29 _textHolder: { value: null, enumerable: false },
30 _codeMirrorCounter: {value: 1, enumerable: false}, 30 _codeMirrorCounter: {value: 1, enumerable: false},
31 31
32 tmpSourceForTesting: {
33 value: "function CodeMirror(place, givenOptions) {" +
34 "// Determine effective options based on given values and defaults." +
35 "var options = {}, defaults = CodeMirror.defaults; }"
36 },
37
38 activeDocument: { 32 activeDocument: {
39 get: function() { 33 get: function() {
40 return this._activeDocument; 34 return this._activeDocument;
@@ -62,21 +56,12 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
62 this.eventManager.addEventListener("executeSave", this, false); 56 this.eventManager.addEventListener("executeSave", this, false);
63 57
64 this.eventManager.addEventListener("recordStyleChanged", this, false); 58 this.eventManager.addEventListener("recordStyleChanged", this, false);
65
66 // Temporary testing opening a new file after Ninja has loaded
67 this.eventManager.addEventListener("executeNewProject", this, false);
68 } 59 }
69 }, 60 },
70 61
71 handleAppLoaded: { 62 handleAppLoaded: {
72 value: function() { 63 value: function() {
73 //this.openDocument({"type": "html"}); 64 //
74 }
75 },
76
77 handleExecuteNewProject: {
78 value: function() {
79 this.openDocument({"type": "html"});
80 } 65 }
81 }, 66 },
82 67
@@ -203,7 +188,7 @@ DocumentController = exports.DocumentController = Montage.create(Component, {
203 break; 188 break;
204 default: 189 default:
205 //Open in code view 190 //Open in code view
206 var code = Montage.create(BaseDocument, {"source": {value: doc.content}}), docuuid = Uuid.generate(), textArea; 191 var code = Montage.create(TextDocument, {"source": {value: doc.content}}), docuuid = Uuid.generate(), textArea;
207 textArea = this.application.ninja.stage.stageView.createTextAreaElement(docuuid); 192 textArea = this.application.ninja.stage.stageView.createTextAreaElement(docuuid);
208 code.initialize(doc, docuuid, textArea, textArea.parentNode); 193 code.initialize(doc, docuuid, textArea, textArea.parentNode);
209 //code.init(doc.name, doc.uri, doc.extension, null, docuuid); 194 //code.init(doc.name, doc.uri, doc.extension, null, docuuid);