From 410ef385d53b3b658d8080af83aeb96c628affc9 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 19 Aug 2016 12:44:09 +0100 Subject: [PATCH] Load partial JS file in now --- processes/on-editor-load.php | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/processes/on-editor-load.php b/processes/on-editor-load.php index c242d0b..af3e4ef 100644 --- a/processes/on-editor-load.php +++ b/processes/on-editor-load.php @@ -30,31 +30,7 @@ top.ICEcoder.switchMode = function(mode) { cMdiff.setOption("mode",mode); } } else if (cM && fileName) { - fileExt = fileName.split("."); - fileExt = fileExt[fileExt.length-1]; - var mode = - 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 == "ino" ? "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 == "scss" ? "text/x-sass" - : "application/x-httpd-php"; + if (mode != cM.getOption("mode")) { cM.setOption("mode",mode);