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.js76
1 files changed, 76 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..41fd991e
--- /dev/null
+++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js
@@ -0,0 +1,76 @@
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 hasReel: {
14 value: true
15 },
16
17 prepareForDraw: {
18 value: function() {
19 Object.defineBinding(this.codeCompleteCheck , "checked", {
20 boundObject: this.application.ninja.codeEditorController,
21 boundObjectPropertyPath: "automaticCodeComplete",
22 oneway : false
23 });
24
25 Object.defineBinding(this.zoomHottext , "value", {
26 boundObject: this.application.ninja.codeEditorController,
27 boundObjectPropertyPath: "zoomFactor",
28 oneway : false
29 });
30
31 }
32 },
33
34 willDraw: {
35 enumerable: false,
36 value: function() {}
37 },
38 draw: {
39 enumerable: false,
40 value: function() {}
41 },
42 didDraw: {
43 enumerable: false,
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 }
50 },
51
52 handleFormat:{
53 value: function(evt){
54 this.application.ninja.codeEditorController.autoFormatSelection();
55 }
56 },
57 handleComment:{
58 value: function(evt){
59 this.application.ninja.codeEditorController.commentSelection(true);
60 }
61 },
62
63 handleUncomment:{
64 value: function(evt){
65 this.application.ninja.codeEditorController.commentSelection(false);
66 }
67 },
68
69 handleThemeSelection:{
70 value: function(evt){
71 this.application.ninja.codeEditorController.editorTheme = this.themeSelect.options[this.themeSelect.selectedIndex].value;
72 this.application.ninja.codeEditorController.handleThemeSelection();
73 }
74 }
75
76}); \ No newline at end of file