From 1f891c58bad0b7746659aa4138001b5ee76d9a0e Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 17 Apr 2012 18:10:39 -0700 Subject: added theme choices for editor Signed-off-by: Ananya Sen --- .../code-editor-view-options.css | 30 +++++++++++++++++++++- .../code-editor-view-options.html | 20 +++++++++++++-- .../code-editor-view-options.js | 14 +++++++--- 3 files changed, 58 insertions(+), 6 deletions(-) (limited to 'js/code-editor') 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 90cf88d3..91054fb9 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 @@ -7,8 +7,36 @@ display:inline; } +.viewOptions .autoCodeComplete{ + float:left; +} + +.viewOptions .floatButtons{ + float:left; + font-size:9px; + padding-left: 20px; +} + .viewOptions .format{ - float:right; + float:left; + margin-left:5px; +} + +.viewOptions .themeOptions{ + float: right; +} + +.viewOptions .themeOptions select{ + background-color: #616161; + color: white; font-size:9px; + margin-top:2px; + border-color: #616161; +} + +.viewOptions .themeOptions select option{ + background-color: #616161; + color: white; + border-color: #616161; } 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 6698baa9..4a6cfa59 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 @@ -39,7 +39,8 @@ "zoomHottext":{"@":"zoomHottext"}, "format":{"#": "format"}, "comment":{"#":"comment"}, - "uncomment":{"#":"uncomment"} + "uncomment":{"#":"uncomment"}, + "themeSelect":{"#":"themeSelect"} } } } @@ -54,10 +55,25 @@ Automatic Completion
- +
+
+ Theme + +
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 a381ae2a..0625dad9 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 @@ -45,24 +45,32 @@ var CodeEditorViewOptions = exports.CodeEditorViewOptions = Montage.create(Compo this.format.addEventListener("click", this.handleFormat.bind(this), false); this.comment.addEventListener("click", this.handleComment.bind(this), false); this.uncomment.addEventListener("click", this.handleUncomment.bind(this), false); + this.themeSelect.addEventListener("change", this.handleThemeSelection.bind(this), false); } }, handleFormat:{ - value: function(){ + value: function(evt){ this.application.ninja.codeEditorController.autoFormatSelection(); } }, handleComment:{ - value: function(){ + value: function(evt){ this.application.ninja.codeEditorController.commentSelection(true); } }, handleUncomment:{ - value: function(){ + value: function(evt){ this.application.ninja.codeEditorController.commentSelection(false); } + }, + + handleThemeSelection:{ + value: function(evt){ + var theme = this.themeSelect.options[this.themeSelect.selectedIndex].value; + this.application.ninja.codeEditorController.handleThemeSelection(theme); + } } }); \ No newline at end of file -- cgit v1.2.3