diff options
author | Jose Antonio Marquez | 2012-05-04 14:00:54 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-04 14:00:54 -0700 |
commit | 9c0bda09a502472768f6dd5090a882d11be58d23 (patch) | |
tree | 28eb75165553daa979be3bc9223d35d875a008dc /js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js | |
parent | 2456f0d60f642016135aa0f96126cb3249343757 (diff) | |
parent | fec9ccee11ea21ffc95edce6e89d0d302b63e3d8 (diff) | |
download | ninja-9c0bda09a502472768f6dd5090a882d11be58d23.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into Document
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.js | 79 |
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> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | // | ||
9 | var Montage = require("montage/core/core").Montage, | ||
10 | Component = require("montage/ui/component").Component; | ||
11 | |||
12 | var 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 | ||