mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 15:24:00 +01:00
JSON highlighting also & set lint: true if JS/JSON
This commit is contained in:
@@ -31,30 +31,31 @@ top.ICEcoder.switchMode = function(mode) {
|
||||
fileExt = fileName.split(".");
|
||||
fileExt = fileExt[fileExt.length-1];
|
||||
var mode =
|
||||
fileExt == "js" ? "text/javascript"
|
||||
: fileExt == "coffee" ? "text/x-coffeescript"
|
||||
: fileExt == "rb" ? "text/x-ruby"
|
||||
: fileExt == "py" ? "text/x-python"
|
||||
: fileExt == "css" ? "text/css"
|
||||
: fileExt == "less" ? "text/x-less"
|
||||
: fileExt == "md" ? "text/x-markdown"
|
||||
: fileExt == "xml" ? "application/xml"
|
||||
: fileExt == "sql" ? "text/x-mysql" // also text/x-sql, text/x-mariadb, text/x-cassandra or text/x-plsql
|
||||
: fileExt == "erl" ? "text/x-erlang"
|
||||
: fileExt == "yaml" ? "text/x-yaml"
|
||||
: fileExt == "java" ? "text/x-java"
|
||||
: fileExt == "jl" ? "text/x-julia"
|
||||
: fileExt == "c" ? "text/x-csrc"
|
||||
: fileExt == "cpp" ? "text/x-c++src"
|
||||
: fileExt == "cs" ? "text/x-csharp"
|
||||
: fileExt == "go" ? "text/x-go"
|
||||
: fileExt == "lua" ? "text/x-lua"
|
||||
: fileExt == "pl" ? "text/x-perl"
|
||||
: fileExt == "rs" ? "text/x-rustsrc"
|
||||
: fileExt == "scss" ? "text/x-sass"
|
||||
fileExt == "js" || fileExt == "json" ? "text/javascript"
|
||||
: fileExt == "coffee" ? "text/x-coffeescript"
|
||||
: fileExt == "rb" ? "text/x-ruby"
|
||||
: fileExt == "py" ? "text/x-python"
|
||||
: fileExt == "css" ? "text/css"
|
||||
: fileExt == "less" ? "text/x-less"
|
||||
: fileExt == "md" ? "text/x-markdown"
|
||||
: fileExt == "xml" ? "application/xml"
|
||||
: fileExt == "sql" ? "text/x-mysql" // also text/x-sql, text/x-mariadb, text/x-cassandra or text/x-plsql
|
||||
: fileExt == "erl" ? "text/x-erlang"
|
||||
: fileExt == "yaml" ? "text/x-yaml"
|
||||
: fileExt == "java" ? "text/x-java"
|
||||
: fileExt == "jl" ? "text/x-julia"
|
||||
: fileExt == "c" ? "text/x-csrc"
|
||||
: fileExt == "cpp" ? "text/x-c++src"
|
||||
: fileExt == "cs" ? "text/x-csharp"
|
||||
: fileExt == "go" ? "text/x-go"
|
||||
: fileExt == "lua" ? "text/x-lua"
|
||||
: fileExt == "pl" ? "text/x-perl"
|
||||
: fileExt == "rs" ? "text/x-rustsrc"
|
||||
: fileExt == "scss" ? "text/x-sass"
|
||||
: "application/x-httpd-php";
|
||||
|
||||
cM.setOption("mode",mode);
|
||||
cM.setOption("lint",(fileExt == "js" || fileExt == "json") && top.ICEcoder.codeAssist ? true : false);
|
||||
cMdiff.setOption("mode",mode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user