aboutsummaryrefslogtreecommitdiff
path: root/js/code-editor
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-08-07 13:27:19 -0700
committerNivesh Rajbhandari2012-08-07 13:27:19 -0700
commitda71ec8bf450438a4dc904cb348e548d01dfcb3f (patch)
tree36bae4f77a61c2c6690566c79d07f5b6bc2c3936 /js/code-editor
parent923e760bf4a16baa82e81da6d38e671620664e8f (diff)
parent91c440a04f0108d05e663d1696027ca5601b25bc (diff)
downloadninja-da71ec8bf450438a4dc904cb348e548d01dfcb3f.tar.gz
Merge branch 'refs/heads/ninja-mqg734-master' into LineInCanvas
Diffstat (limited to 'js/code-editor')
-rw-r--r--js/code-editor/code-editor-wrapper.js6
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html2
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js35
3 files changed, 39 insertions, 4 deletions
diff --git a/js/code-editor/code-editor-wrapper.js b/js/code-editor/code-editor-wrapper.js
index 57fe4d3a..65f42db2 100644
--- a/js/code-editor/code-editor-wrapper.js
+++ b/js/code-editor/code-editor-wrapper.js
@@ -131,6 +131,12 @@ exports.CodeEditorWrapper = Montage.create(Component, {
131 this.application.ninja.editorViewOptions.codeEditorWrapper = this; 131 this.application.ninja.editorViewOptions.codeEditorWrapper = this;
132 } 132 }
133 133
134 //TODO:add codeEditorWrapper
135 if(!this.application.ninja.documentBar.codeEditorWrapper){
136 this.application.ninja.documentBar.codeEditorWrapper = this;
137 }
138
139
134 editorOptions = { 140 editorOptions = {
135 lineNumbers: true, 141 lineNumbers: true,
136 matchBrackets:true, 142 matchBrackets:true,
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html
index 476db181..e6cc3763 100644
--- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html
+++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html
@@ -80,7 +80,7 @@ POSSIBILITY OF SUCH DAMAGE.
80<body> 80<body>
81<div data-montage-id="viewOptions" class="viewOptions"> 81<div data-montage-id="viewOptions" class="viewOptions">
82 <div> 82 <div>
83 <input class="zoomFont" data-montage-id="zoomFont"/> 83 <input class="zoomFont" data-montage-id="zoomFont" style="display:none;"/>
84 <div class="autoCodeComplete" > 84 <div class="autoCodeComplete" >
85 <input type="checkbox" data-montage-id="codeComplete" /> 85 <input type="checkbox" data-montage-id="codeComplete" />
86 <label data-montage-id="autoCompleteLabel">Auto Code Hints</label> 86 <label data-montage-id="autoCompleteLabel">Auto Code Hints</label>
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
index 9344d34c..2ca6118b 100644
--- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
+++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
@@ -51,14 +51,31 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
51 51
52 this._currentDocument = value; 52 this._currentDocument = value;
53 53
54 if(!value || this._currentDocument.currentView === "design") { 54 if(!value || (this._currentDocument.currentView === "design")) {
55 this.visible = false; 55 this.visible = false;
56 } else { 56 } else if(this._currentDocument && this._currentDocument.currentView === "code") {
57 this.visible = true; 57
58 if(this._currentDocument.model.views.design){//code view of design document
59 this.application.ninja.editorViewOptions.visible = false;
60 //this.application.ninja.documentBar.codeEditorControls.visible = false;//todo
61 }else if(!this._currentDocument.model.views.design){//code view for text document
62 this.application.ninja.editorViewOptions.visible = true;
63 //this.application.ninja.documentBar.codeEditorControls.visible = false;
64 }
65
58 this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension]; 66 this.autocomplete = !this.codeCompletionSupport[this._currentDocument.model.file.extension];
59 this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked; 67 this._currentDocument.model.views.code.editor.automaticCodeHint = this.codeCompleteCheck.checked;
60 } 68 }
61 69
70 if(this._currentDocument && (this._currentDocument.currentView === "design")) {
71 this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false);
72 }
73
74 //hide the zoom hottext if it is code view of a design file
75 if (this._currentDocument && this._currentDocument.model && this._currentDocument.model.views.code){
76 this.zoomHottext.element.style.display = "block";
77 }
78
62 } 79 }
63 }, 80 },
64 81
@@ -209,6 +226,18 @@ exports.CodeEditorViewOptions = Montage.create(Component, {
209 } 226 }
210 }, 227 },
211 228
229 handleChange: {
230 value: function(notification) {
231 if(notification.currentPropertyPath === "model.currentViewIdentifier") {
232 if(this.currentDocument.model.currentView.identifier === "design-code") {
233 //this.application.ninja.documentBar.codeEditorControls.visible = false;//todo
234 } else {
235 //this.application.ninja.documentBar.codeEditorControls.visible = false;
236 }
237 }
238 }
239 },
240
212 handleFormat:{ 241 handleFormat:{
213 value: function(evt){ 242 value: function(evt){
214 var range = this.getSelectedRange(this.currentDocument.model.views.code.editor); 243 var range = this.getSelectedRange(this.currentDocument.model.views.code.editor);