Merge modelist branch & use it

This branch now depends on the modelist being pulled in as a module. I'm
using the modelist to generate the menu options for switching modes
because it's redundant to have the same massive list in two places.

The modelist module also has some awesome features so I choose it over
my silly list. :D
This commit is contained in:
Matthew Kastor 2013-04-05 01:33:56 -04:00 • committed by nightwing
commit 47329e944f

View file

@ -66,6 +66,7 @@ define(function(require, exports, module) {
* @param {ace.Editor} editor An instance of the ace editor. * @param {ace.Editor} editor An instance of the ace editor.
*/ */
module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) { module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) {
var modelist = require('../modelist');
editor.menuOptions = { editor.menuOptions = {
"setNewLineMode" : [{ "setNewLineMode" : [{
"textContent" : "unix", "textContent" : "unix",
@ -167,225 +168,15 @@ module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) {
"value" : "ace/theme/xcode" "value" : "ace/theme/xcode"
} }
], ],
"setMode" : [{ "setMode" : []
"textContent" : "abap",
"value" : "ace/mode/abap"
}, {
"textContent" : "asciidoc",
"value" : "ace/mode/asciidoc"
}, {
"textContent" : "c9search",
"value" : "ace/mode/c9search"
}, {
"textContent" : "clojure",
"value" : "ace/mode/clojure"
}, {
"textContent" : "coffee",
"value" : "ace/mode/coffee"
}, {
"textContent" : "coldfusion",
"value" : "ace/mode/coldfusion"
}, {
"textContent" : "csharp",
"value" : "ace/mode/csharp"
}, {
"textContent" : "css",
"value" : "ace/mode/css"
}, {
"textContent" : "curly",
"value" : "ace/mode/curly"
}, {
"textContent" : "c_cpp",
"value" : "ace/mode/c_cpp"
}, {
"textContent" : "dart",
"value" : "ace/mode/dart"
}, {
"textContent" : "diff",
"value" : "ace/mode/diff"
}, {
"textContent" : "django",
"value" : "ace/mode/django"
}, {
"textContent" : "dot",
"value" : "ace/mode/dot"
}, {
"textContent" : "ftl",
"value" : "ace/mode/ftl"
}, {
"textContent" : "glsl",
"value" : "ace/mode/glsl"
}, {
"textContent" : "golang",
"value" : "ace/mode/golang"
}, {
"textContent" : "groovy",
"value" : "ace/mode/groovy"
}, {
"textContent" : "haml",
"value" : "ace/mode/haml"
}, {
"textContent" : "haxe",
"value" : "ace/mode/haxe"
}, {
"textContent" : "html",
"value" : "ace/mode/html"
}, {
"textContent" : "jade",
"value" : "ace/mode/jade"
}, {
"textContent" : "java",
"value" : "ace/mode/java"
}, {
"textContent" : "javascript",
"value" : "ace/mode/javascript"
}, {
"textContent" : "json",
"value" : "ace/mode/json"
}, {
"textContent" : "jsp",
"value" : "ace/mode/jsp"
}, {
"textContent" : "jsx",
"value" : "ace/mode/jsx"
}, {
"textContent" : "latex",
"value" : "ace/mode/latex"
}, {
"textContent" : "less",
"value" : "ace/mode/less"
}, {
"textContent" : "liquid",
"value" : "ace/mode/liquid"
}, {
"textContent" : "lisp",
"value" : "ace/mode/lisp"
}, {
"textContent" : "livescript",
"value" : "ace/mode/livescript"
}, {
"textContent" : "logiql",
"value" : "ace/mode/logiql"
}, {
"textContent" : "lsl",
"value" : "ace/mode/lsl"
}, {
"textContent" : "lua",
"value" : "ace/mode/lua"
}, {
"textContent" : "luapage",
"value" : "ace/mode/luapage"
}, {
"textContent" : "lucene",
"value" : "ace/mode/lucene"
}, {
"textContent" : "makefile",
"value" : "ace/mode/makefile"
}, {
"textContent" : "markdown",
"value" : "ace/mode/markdown"
}, {
"textContent" : "objectivec",
"value" : "ace/mode/objectivec"
}, {
"textContent" : "ocaml",
"value" : "ace/mode/ocaml"
}, {
"textContent" : "pascal",
"value" : "ace/mode/pascal"
}, {
"textContent" : "perl",
"value" : "ace/mode/perl"
}, {
"textContent" : "pgsql",
"value" : "ace/mode/pgsql"
}, {
"textContent" : "php",
"value" : "ace/mode/php"
}, {
"textContent" : "powershell",
"value" : "ace/mode/powershell"
}, {
"textContent" : "python",
"value" : "ace/mode/python"
}, {
"textContent" : "r",
"value" : "ace/mode/r"
}, {
"textContent" : "rdoc",
"value" : "ace/mode/rdoc"
}, {
"textContent" : "rhtml",
"value" : "ace/mode/rhtml"
}, {
"textContent" : "ruby",
"value" : "ace/mode/ruby"
}, {
"textContent" : "sass",
"value" : "ace/mode/sass"
}, {
"textContent" : "scad",
"value" : "ace/mode/scad"
}, {
"textContent" : "scala",
"value" : "ace/mode/scala"
}, {
"textContent" : "scheme",
"value" : "ace/mode/scheme"
}, {
"textContent" : "scss",
"value" : "ace/mode/scss"
}, {
"textContent" : "sh",
"value" : "ace/mode/sh"
}, {
"textContent" : "sql",
"value" : "ace/mode/sql"
}, {
"textContent" : "stylus",
"value" : "ace/mode/stylus"
}, {
"textContent" : "svg",
"value" : "ace/mode/svg"
}, {
"textContent" : "tcl",
"value" : "ace/mode/tcl"
}, {
"textContent" : "tex",
"value" : "ace/mode/tex"
}, {
"textContent" : "text",
"value" : "ace/mode/text"
}, {
"textContent" : "textile",
"value" : "ace/mode/textile"
}, {
"textContent" : "tmsnippet",
"value" : "ace/mode/tmsnippet"
}, {
"textContent" : "tm_snippet",
"value" : "ace/mode/tm_snippet"
}, {
"textContent" : "toml",
"value" : "ace/mode/toml"
}, {
"textContent" : "typescript",
"value" : "ace/mode/typescript"
}, {
"textContent" : "vbscript",
"value" : "ace/mode/vbscript"
}, {
"textContent" : "xml",
"value" : "ace/mode/xml"
}, {
"textContent" : "xquery",
"value" : "ace/mode/xquery"
}, {
"textContent" : "yaml",
"value" : "ace/mode/yaml"
}
]
}; };
modelist.modes.forEach(function (mode) {
editor.menuOptions.setMode.push({
'textContent' : mode.name,
'value' : mode.mode
});
});
}; };