aboutsummaryrefslogtreecommitdiff
path: root/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js')
-rw-r--r--js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js79
1 files changed, 79 insertions, 0 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
new file mode 100644
index 00000000..a27d4450
--- /dev/null
+++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
@@ -0,0 +1,79 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7////////////////////////////////////////////////////////////////////////
8//
9var Montage = require("montage/core/core").Montage,
10 Component = require("montage/ui/component").Component;
11
12var CodeEditorViewOptions = exports.CodeEditorViewOptions = Montage.create(Component, {
13
14 prepareForDraw: {
15 value: function() {
16 Object.defineBinding(this.codeCompleteCheck , "checked", {
17 boundObject: this.application.ninja.codeEditorController,
18 boundObjectPropertyPath: "automaticCodeComplete",
19 oneway : false
20 });
21
22 Object.defineBinding(this.zoomHottext , "value", {
23 boundObject: this.application.ninja.codeEditorController,
24 boundObjectPropertyPath: "zoomFactor",
25 oneway : false
26 });
27
28 }
29 },
30
31 didDraw: {
32 enumerable: false,
33 value: function() {
34 //this.format.addEventListener("click", this.handleFormat.bind(this), false);
35 this.comment.addEventListener("click", this.handleComment.bind(this), false);
36 this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false);
37 this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false);
38 this.shortKeys.addEventListener("click", this.handleShortKeys.bind(this), false);
39 }
40 },
41
42 handleFormat:{
43 value: function(evt){
44 this.application.ninja.codeEditorController.autoFormatSelection();
45 }
46 },
47 handleComment:{
48 value: function(evt){
49 this.application.ninja.codeEditorController.commentSelection(true);
50 }
51 },
52
53 handleUncomment:{
54 value: function(evt){
55 this.application.ninja.codeEditorController.commentSelection(false);
56 }
57 },
58
59 handleThemeSelection:{
60 value: function(evt){
61 this.application.ninja.codeEditorController.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value;
62 this.application.ninja.codeEditorController.handleThemeSelection();
63 }
64 },
65
66 handleShortKeys:{
67 value:function(evt){
68 var list = this.shortKeys.querySelector(".list");
69 if(list && list.classList.contains("hide")){
70 list.classList.remove("hide");
71 list.classList.add("show");
72 }else if(list && list.classList.contains("show")){
73 list.classList.remove("show");
74 list.classList.add("hide");
75 }
76 }
77 }
78
79}); \ No newline at end of file