diff options
Diffstat (limited to 'js/stage/stage-view.reel')
-rwxr-xr-x | js/stage/stage-view.reel/stage-view.js | 120 |
1 files changed, 1 insertions, 119 deletions
diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 757c5e51..139fa032 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js | |||
@@ -33,81 +33,6 @@ exports.StageView = Montage.create(Component, { | |||
33 | 33 | ||
34 | /** | 34 | /** |
35 | * Public method | 35 | * Public method |
36 | * Creates a textarea element which will contain the content of the opened text document. | ||
37 | */ | ||
38 | createTextAreaElement: { | ||
39 | value: function(uuid) { | ||
40 | var codeMirrorDiv = document.createElement("div"); | ||
41 | codeMirrorDiv.id = "codeMirror_" + uuid; | ||
42 | codeMirrorDiv.style.display = "block"; | ||
43 | this.element.appendChild(codeMirrorDiv); | ||
44 | |||
45 | var textArea = document.createElement("textarea"); | ||
46 | textArea.id = "code"; | ||
47 | textArea.name = "code"; | ||
48 | codeMirrorDiv.appendChild(textArea); | ||
49 | |||
50 | return textArea; | ||
51 | } | ||
52 | }, | ||
53 | |||
54 | /** | ||
55 | * Public method | ||
56 | * Creates a new instance of a code editor | ||
57 | */ | ||
58 | createTextView: { | ||
59 | value: function(doc) { | ||
60 | var type; | ||
61 | this.application.ninja.documentController._hideCurrentDocument(); | ||
62 | this.hideOtherDocuments(doc.uuid); | ||
63 | |||
64 | switch(doc.documentType) { | ||
65 | case "css" : | ||
66 | type = "css"; | ||
67 | break; | ||
68 | case "js" : | ||
69 | type = "javascript"; | ||
70 | break; | ||
71 | case "html" : | ||
72 | type = "htmlmixed"; | ||
73 | break; | ||
74 | case "json" : | ||
75 | type = "javascript"; | ||
76 | break; | ||
77 | case "php" : | ||
78 | type = "php"; | ||
79 | break; | ||
80 | case "pl" : | ||
81 | type = "perl"; | ||
82 | break; | ||
83 | case "py" : | ||
84 | type = "python"; | ||
85 | break; | ||
86 | case "rb" : | ||
87 | type = "ruby"; | ||
88 | break; | ||
89 | case "xml" : | ||
90 | type = "xml"; | ||
91 | break; | ||
92 | } | ||
93 | document.getElementById("codeMirror_"+doc.uuid).style.display="block"; | ||
94 | |||
95 | doc.editor = this.application.ninja.codeEditorController.createEditor(doc, type, doc.documentType); | ||
96 | doc.editor.hline = doc.editor.setLineClass(0, "activeline"); | ||
97 | |||
98 | this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe | ||
99 | this.application.ninja.documentController.activeDocument = doc; | ||
100 | this.application.ninja.stage.hideCanvas(true); | ||
101 | document.getElementById("iframeContainer").style.display="none";//hide the iframe when switching to code view | ||
102 | |||
103 | this.showCodeViewBar(true); | ||
104 | this.application.ninja.codeEditorController.applySettings(); | ||
105 | this.collapseAllPanels(); | ||
106 | } | ||
107 | }, | ||
108 | |||
109 | /** | ||
110 | * Public method | ||
111 | * Switches between documents. Document state data is saved and restored whereever applicable | 36 | * Switches between documents. Document state data is saved and restored whereever applicable |
112 | */ | 37 | */ |
113 | switchDocument:{ | 38 | switchDocument:{ |
@@ -135,16 +60,6 @@ exports.StageView = Montage.create(Component, { | |||
135 | } | 60 | } |
136 | }, | 61 | }, |
137 | 62 | ||
138 | /** | ||
139 | * Public method | ||
140 | * Switches between different views of a design document, like HTML design view, HTML code view | ||
141 | */ | ||
142 | switchDesignDocViews: { | ||
143 | value: function() { | ||
144 | //TODO | ||
145 | } | ||
146 | }, | ||
147 | |||
148 | showRulers:{ | 63 | showRulers:{ |
149 | value:function(){ | 64 | value:function(){ |
150 | this.application.ninja.rulerTop.style.display = "block"; | 65 | this.application.ninja.rulerTop.style.display = "block"; |
@@ -156,39 +71,6 @@ exports.StageView = Montage.create(Component, { | |||
156 | this.application.ninja.rulerTop.style.display = "none"; | 71 | this.application.ninja.rulerTop.style.display = "none"; |
157 | this.application.ninja.rulerLeft.style.display = "none"; | 72 | this.application.ninja.rulerLeft.style.display = "none"; |
158 | } | 73 | } |
159 | }, | ||
160 | showCodeViewBar:{ | ||
161 | value:function(isCodeView){ | ||
162 | if(isCodeView === true) { | ||
163 | this.application.ninja.editorViewOptions.element.style.display = "block"; | ||
164 | this.application.ninja.documentBar.element.style.display = "none"; | ||
165 | } else { | ||
166 | this.application.ninja.documentBar.element.style.display = "block"; | ||
167 | this.application.ninja.editorViewOptions.element.style.display = "none"; | ||
168 | } | ||
169 | } | ||
170 | }, | ||
171 | |||
172 | collapseAllPanels:{ | ||
173 | value:function(){ | ||
174 | this.application.ninja.panelSplitter.collapse(); | ||
175 | this.application.ninja.timelineSplitter.collapse(); | ||
176 | this.application.ninja.toolsSplitter.collapse(); | ||
177 | this.application.ninja.optionsSplitter.collapse(); | ||
178 | } | ||
179 | }, | ||
180 | restoreAllPanels:{ | ||
181 | value:function(){ | ||
182 | this.application.ninja.panelSplitter.restore(); | ||
183 | this.application.ninja.timelineSplitter.restore(); | ||
184 | this.application.ninja.toolsSplitter.restore(); | ||
185 | this.application.ninja.optionsSplitter.restore(); | ||
186 | } | ||
187 | }, | ||
188 | |||
189 | applyTheme:{ | ||
190 | value:function(themeClass){ | ||
191 | this.element.className = "codeViewContainer "+themeClass; | ||
192 | } | ||
193 | } | 74 | } |
75 | |||
194 | }); \ No newline at end of file | 76 | }); \ No newline at end of file |