diff options
author | Ananya Sen | 2012-04-16 18:19:17 -0700 |
---|---|---|
committer | Ananya Sen | 2012-04-16 18:19:17 -0700 |
commit | 2449fc403e8a8a22f092c87e3268a69a2be67e43 (patch) | |
tree | 71d660356892f98ce7a694c942d3fe132f171ac1 /js/code-editor | |
parent | c2ec390d42945d2df1aed3f2b7ff3d1aa722fce8 (diff) | |
download | ninja-2449fc403e8a8a22f092c87e3268a69a2be67e43.tar.gz |
Added comment and uncomment control in the editor view options
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/code-editor')
3 files changed, 42 insertions, 3 deletions
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.css b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.css index 5aa66af2..90cf88d3 100644 --- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.css +++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.css | |||
@@ -1,3 +1,14 @@ | |||
1 | .viewOptions{ | 1 | .viewOptions{ |
2 | color:#F7F7F7; | 2 | color:#F7F7F7; |
3 | } \ No newline at end of file | 3 | font-size:12px; |
4 | } | ||
5 | |||
6 | .viewOptions div{ | ||
7 | display:inline; | ||
8 | } | ||
9 | |||
10 | .viewOptions .format{ | ||
11 | float:right; | ||
12 | font-size:9px; | ||
13 | } | ||
14 | |||
diff --git a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html index c6d3da4e..6698baa9 100644 --- a/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html +++ b/js/code-editor/ui/code-editor-view-options.reel/code-editor-view-options.html | |||
@@ -36,7 +36,10 @@ | |||
36 | "properties": { | 36 | "properties": { |
37 | "element": {"#": "viewOptions"}, | 37 | "element": {"#": "viewOptions"}, |
38 | "codeCompleteCheck":{"@": "codeCompleteCheck"}, | 38 | "codeCompleteCheck":{"@": "codeCompleteCheck"}, |
39 | "zoomHottext":{"@":"zoomHottext"} | 39 | "zoomHottext":{"@":"zoomHottext"}, |
40 | "format":{"#": "format"}, | ||
41 | "comment":{"#":"comment"}, | ||
42 | "uncomment":{"#":"uncomment"} | ||
40 | } | 43 | } |
41 | } | 44 | } |
42 | } | 45 | } |
@@ -47,8 +50,13 @@ | |||
47 | <div> | 50 | <div> |
48 | <input class="zoomFont" id="zoomFont"/> | 51 | <input class="zoomFont" id="zoomFont"/> |
49 | <div class="autoCodeComplete" > | 52 | <div class="autoCodeComplete" > |
50 | <span>Automatic Code completion</span> | ||
51 | <input type="checkbox" id="codeComplete" /> | 53 | <input type="checkbox" id="codeComplete" /> |
54 | <span>Automatic Completion</span> | ||
55 | </div> | ||
56 | <div class="floatButtons"> | ||
57 | <!--<button id="format" value="format" class="nj-skinned format">Format</button>--> | ||
58 | <button id="comment" value="comment" class="nj-skinned format">comment</button> | ||
59 | <button id="uncomment" value="uncomment" class="nj-skinned format">uncomment</button> | ||
52 | </div> | 60 | </div> |
53 | </div> | 61 | </div> |
54 | </div> | 62 | </div> |
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 a1ff8547..a381ae2a 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 | |||
@@ -42,7 +42,27 @@ var CodeEditorViewOptions = exports.CodeEditorViewOptions = Montage.create(Compo | |||
42 | didDraw: { | 42 | didDraw: { |
43 | enumerable: false, | 43 | enumerable: false, |
44 | value: function() { | 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 | } | ||
49 | }, | ||
50 | |||
51 | handleFormat:{ | ||
52 | value: function(){ | ||
53 | this.application.ninja.codeEditorController.autoFormatSelection(); | ||
54 | } | ||
55 | }, | ||
56 | handleComment:{ | ||
57 | value: function(){ | ||
58 | this.application.ninja.codeEditorController.commentSelection(true); | ||
59 | } | ||
60 | }, | ||
45 | 61 | ||
62 | handleUncomment:{ | ||
63 | value: function(){ | ||
64 | this.application.ninja.codeEditorController.commentSelection(false); | ||
46 | } | 65 | } |
47 | } | 66 | } |
67 | |||
48 | }); \ No newline at end of file | 68 | }); \ No newline at end of file |