diff options
author | Valerio Virgillito | 2012-05-04 15:31:40 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-04 15:31:40 -0700 |
commit | 3ebed34665fa73b0ce613b400f3029ebf4476439 (patch) | |
tree | 09a3c592035030bda7bb62d1f908ce263377d74c /js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.js | |
parent | 8dcbac5d4c30e9dfbc543a5f997939111e9c9f89 (diff) | |
parent | 526e423e4a2734c2b139af23911e912452a4443f (diff) | |
download | ninja-3ebed34665fa73b0ce613b400f3029ebf4476439.tar.gz |
Merge branch 'refs/heads/master' into dom-architecture
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 | ||