aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js121
-rwxr-xr-xjs/ninja.reel/ninja.html24
2 files changed, 66 insertions, 79 deletions
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 07561580..a27d4450 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
@@ -10,81 +10,70 @@ var Montage = require("montage/core/core").Montage,
10 Component = require("montage/ui/component").Component; 10 Component = require("montage/ui/component").Component;
11 11
12var CodeEditorViewOptions = exports.CodeEditorViewOptions = Montage.create(Component, { 12var CodeEditorViewOptions = exports.CodeEditorViewOptions = Montage.create(Component, {
13 hasReel: {
14 value: true
15 },
16 13
17 prepareForDraw: { 14 prepareForDraw: {
18 value: function() { 15 value: function() {
19 Object.defineBinding(this.codeCompleteCheck , "checked", { 16 Object.defineBinding(this.codeCompleteCheck , "checked", {
20 boundObject: this.application.ninja.codeEditorController, 17 boundObject: this.application.ninja.codeEditorController,
21 boundObjectPropertyPath: "automaticCodeComplete", 18 boundObjectPropertyPath: "automaticCodeComplete",
22 oneway : false 19 oneway : false
23 }); 20 });
24 21
25 Object.defineBinding(this.zoomHottext , "value", { 22 Object.defineBinding(this.zoomHottext , "value", {
26 boundObject: this.application.ninja.codeEditorController, 23 boundObject: this.application.ninja.codeEditorController,
27 boundObjectPropertyPath: "zoomFactor", 24 boundObjectPropertyPath: "zoomFactor",
28 oneway : false 25 oneway : false
29 }); 26 });
30 27
31 } 28 }
32 }, 29 },
33 30
34 willDraw: { 31 didDraw: {
35 enumerable: false, 32 enumerable: false,
36 value: function() {} 33 value: function() {
37 }, 34 //this.format.addEventListener("click", this.handleFormat.bind(this), false);
38 draw: { 35 this.comment.addEventListener("click", this.handleComment.bind(this), false);
39 enumerable: false, 36 this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false);
40 value: function() {} 37 this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false);
41 }, 38 this.shortKeys.addEventListener("click", this.handleShortKeys.bind(this), false);
42 didDraw: { 39 }
43 enumerable: false, 40 },
44 value: function() {
45 //this.format.addEventListener("click", this.handleFormat.bind(this), false);
46 this.comment.addEventListener("click", this.handleComment.bind(this), false);
47 this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false);
48 this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false);
49 this.shortKeys.addEventListener("click", this.handleShortKeys.bind(this), false);
50 }
51 },
52 41
53 handleFormat:{ 42 handleFormat:{
54 value: function(evt){ 43 value: function(evt){
55 this.application.ninja.codeEditorController.autoFormatSelection(); 44 this.application.ninja.codeEditorController.autoFormatSelection();
56 } 45 }
57 }, 46 },
58 handleComment:{ 47 handleComment:{
59 value: function(evt){ 48 value: function(evt){
60 this.application.ninja.codeEditorController.commentSelection(true); 49 this.application.ninja.codeEditorController.commentSelection(true);
61 } 50 }
62 }, 51 },
63 52
64 handleUncomment:{ 53 handleUncomment:{
65 value: function(evt){ 54 value: function(evt){
66 this.application.ninja.codeEditorController.commentSelection(false); 55 this.application.ninja.codeEditorController.commentSelection(false);
67 } 56 }
68 }, 57 },
69 58
70 handleThemeSelection:{ 59 handleThemeSelection:{
71 value: function(evt){ 60 value: function(evt){
72 this.application.ninja.codeEditorController.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value; 61 this.application.ninja.codeEditorController.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value;
73 this.application.ninja.codeEditorController.handleThemeSelection(); 62 this.application.ninja.codeEditorController.handleThemeSelection();
74 } 63 }
75 }, 64 },
76 65
77 handleShortKeys:{ 66 handleShortKeys:{
78 value:function(evt){ 67 value:function(evt){
79 var list = this.shortKeys.querySelector(".list"); 68 var list = this.shortKeys.querySelector(".list");
80 if(list && list.classList.contains("hide")){ 69 if(list && list.classList.contains("hide")){
81 list.classList.remove("hide"); 70 list.classList.remove("hide");
82 list.classList.add("show"); 71 list.classList.add("show");
83 }else if(list && list.classList.contains("show")){ 72 }else if(list && list.classList.contains("show")){
84 list.classList.remove("show"); 73 list.classList.remove("show");
85 list.classList.add("hide"); 74 list.classList.add("hide");
86 }
87 } 75 }
88 } 76 }
77 }
89 78
90}); \ No newline at end of file 79}); \ No newline at end of file
diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html
index a9dba720..34dc8135 100755
--- a/js/ninja.reel/ninja.html
+++ b/js/ninja.reel/ninja.html
@@ -196,13 +196,12 @@
196 } 196 }
197 }, 197 },
198 198
199 199 "editorViewOptions": {
200 "editorViewOptions": { 200 "prototype": "js/code-editor/ui/code-editor-view-options.reel",
201 "prototype": "js/code-editor/ui/code-editor-view-options.reel[CodeEditorViewOptions]", 201 "properties": {
202 "properties": { 202 "element": {"#": "editorViewOptions"}
203 "element": {"#": "editorViewOptions"} 203 }
204 } 204 },
205 },
206 205
207 "panelContainer": { 206 "panelContainer": {
208 "prototype": "js/panels/PanelContainer.reel", 207 "prototype": "js/panels/PanelContainer.reel",
@@ -270,7 +269,6 @@
270 "oneway": true 269 "oneway": true
271 } 270 }
272 } 271 }
273
274 }, 272 },
275 273
276 "documentController1": { 274 "documentController1": {
@@ -320,7 +318,7 @@
320 }, 318 },
321 319
322 "codeEditorController": { 320 "codeEditorController": {
323 "prototype": "js/controllers/code-editor-controller[CodeEditorController]" 321 "prototype": "js/controllers/code-editor-controller"
324 }, 322 },
325 323
326 "owner": { 324 "owner": {
@@ -352,12 +350,12 @@
352 "ioMediator": {"@": "ioMediator"}, 350 "ioMediator": {"@": "ioMediator"},
353 "timeline": {"@": "timeline"}, 351 "timeline": {"@": "timeline"},
354 "mainMenuController": {"@": "mainMenuController"}, 352 "mainMenuController": {"@": "mainMenuController"},
355 "codeEditorController": {"@": "codeEditorController"}, 353 "codeEditorController": {"@": "codeEditorController"},
356 "rightPanelContainer": {"#": "rightPanelContainer" }, 354 "rightPanelContainer": {"#": "rightPanelContainer" },
357 "panelSplitter": {"@": "splitter3"}, 355 "panelSplitter": {"@": "splitter3"},
358 "timelineSplitter": {"@": "splitter4"}, 356 "timelineSplitter": {"@": "splitter4"},
359 "toolsSplitter": {"@": "splitter2"}, 357 "toolsSplitter": {"@": "splitter2"},
360 "optionsSplitter": {"@": "splitter1"} 358 "optionsSplitter": {"@": "splitter1"}
361 } 359 }
362 } 360 }
363 } 361 }