add_editor_menu_options uses themelist to generate theme options

This commit is contained in:
Matthew Kastor 2013-04-05 16:49:18 -04:00 committed by nightwing
commit 60616deec0

View file

@ -52,7 +52,7 @@
* Matthew Christopher Kastor-Inare III </a><br />
* Hial Atropa!!
*/
define(function(require, exports, module) {
'use strict';
@ -67,6 +67,7 @@ define(function(require, exports, module) {
*/
module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) {
var modelist = require('../modelist');
var themelist = require('../themelist');
editor.menuOptions = {
"setNewLineMode" : [{
"textContent" : "unix",
@ -79,103 +80,22 @@ module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) {
"value" : "auto"
}
],
"setTheme" : [{
"textContent" : "ambiance",
"value" : "ace/theme/ambiance"
}, {
"textContent" : "chaos",
"value" : "ace/theme/chaos"
}, {
"textContent" : "chrome",
"value" : "ace/theme/chrome"
}, {
"textContent" : "clouds",
"value" : "ace/theme/clouds"
}, {
"textContent" : "clouds_midnight",
"value" : "ace/theme/clouds_midnight"
}, {
"textContent" : "cobalt",
"value" : "ace/theme/cobalt"
}, {
"textContent" : "crimson_editor",
"value" : "ace/theme/crimson_editor"
}, {
"textContent" : "dawn",
"value" : "ace/theme/dawn"
}, {
"textContent" : "dreamweaver",
"value" : "ace/theme/dreamweaver"
}, {
"textContent" : "eclipse",
"value" : "ace/theme/eclipse"
}, {
"textContent" : "github",
"value" : "ace/theme/github"
}, {
"textContent" : "idle_fingers",
"value" : "ace/theme/idle_fingers"
}, {
"textContent" : "kr",
"value" : "ace/theme/kr"
}, {
"textContent" : "merbivore",
"value" : "ace/theme/merbivore"
}, {
"textContent" : "merbivore_soft",
"value" : "ace/theme/merbivore_soft"
}, {
"textContent" : "monokai",
"value" : "ace/theme/monokai"
}, {
"textContent" : "mono_industrial",
"value" : "ace/theme/mono_industrial"
}, {
"textContent" : "pastel_on_dark",
"value" : "ace/theme/pastel_on_dark"
}, {
"textContent" : "solarized_dark",
"value" : "ace/theme/solarized_dark"
}, {
"textContent" : "solarized_light",
"value" : "ace/theme/solarized_light"
}, {
"textContent" : "textmate",
"value" : "ace/theme/textmate"
}, {
"textContent" : "tomorrow",
"value" : "ace/theme/tomorrow"
}, {
"textContent" : "tomorrow_night",
"value" : "ace/theme/tomorrow_night"
}, {
"textContent" : "tomorrow_night_blue",
"value" : "ace/theme/tomorrow_night_blue"
}, {
"textContent" : "tomorrow_night_bright",
"value" : "ace/theme/tomorrow_night_bright"
}, {
"textContent" : "tomorrow_night_eighties",
"value" : "ace/theme/tomorrow_night_eighties"
}, {
"textContent" : "twilight",
"value" : "ace/theme/twilight"
}, {
"textContent" : "vibrant_ink",
"value" : "ace/theme/vibrant_ink"
}, {
"textContent" : "xcode",
"value" : "ace/theme/xcode"
}
],
"setTheme" : [],
"setMode" : []
};
modelist.modes.forEach(function (mode) {
editor.menuOptions.setMode.push({
editor.menuOptions.setTheme = themelist.themes.map(function (theme) {
return {
'textContent' : theme.desc,
'value' : theme.theme
};
});
editor.menuOptions.setMode = modelist.modes.map(function (mode) {
return {
'textContent' : mode.name,
'value' : mode.mode
});
};
});
};