mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-06 16:46:48 +01:00
SQL mode added
Chose MySQL as the default dialect, others possible so added a comment on that
This commit is contained in:
@@ -274,6 +274,7 @@ var ICEcoder = {
|
||||
: fileName.indexOf('.less')>0 ? cM.setOption("mode","less")
|
||||
: fileName.indexOf('.md')>0 ? cM.setOption("mode","markdown")
|
||||
: fileName.indexOf('.xml')>0 ? cM.setOption("mode","xml")
|
||||
: fileName.indexOf('.sql')>0 ? cM.setOption("mode","text/x-mysql") // also text/x-sql, text/x-mariadb, text/x-cassandra or text/x-plsql
|
||||
: cM.setOption("mode","application/x-httpd-php");
|
||||
}
|
||||
},
|
||||
@@ -289,7 +290,7 @@ var ICEcoder = {
|
||||
lCLen = lineContent.length;
|
||||
adjustCursor = 2;
|
||||
|
||||
if (["JavaScript","CoffeeScript","PHP","Python","Ruby","CSS"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
if (["JavaScript","CoffeeScript","PHP","Python","Ruby","CSS","SQL"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
if (cM.somethingSelected()) {
|
||||
if (ICEcoder.caretLocType=="Ruby"||ICEcoder.caretLocType=="Python") {
|
||||
startLine = cM.getCursor(true).line;
|
||||
@@ -305,7 +306,7 @@ var ICEcoder = {
|
||||
: cM.getSelection().slice(2,cM.getSelection().length-2));
|
||||
}
|
||||
} else {
|
||||
if (["CoffeeScript","CSS"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
if (["CoffeeScript","CSS","SQL"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
cM.setLine(linePos, lineContent.slice(0,2)!="/*"
|
||||
? "/*" + lineContent + "*/"
|
||||
: lineContent.slice(2,lCLen).slice(0,lCLen-4));
|
||||
@@ -1238,7 +1239,7 @@ var ICEcoder = {
|
||||
ICEcoder.nestDisplay.innerHTML = "";
|
||||
if ("undefined" != typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]) {
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (["js","coffee","css","less"].indexOf(fileName.split(".")[1])<0 &&
|
||||
if (["js","coffee","css","less","sql"].indexOf(fileName.split(".")[1])<0 &&
|
||||
(nestCheck.indexOf("include(")==-1)&&(nestCheck.indexOf("include_once(")==-1)) {
|
||||
|
||||
// Then for all the array items, output as the nest display
|
||||
@@ -1266,7 +1267,7 @@ var ICEcoder = {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
nestOK = true;
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (cM && fileName && ["js","coffee","css","less"].indexOf(fileName.split(".")[1])==-1) {
|
||||
if (cM && fileName && ["js","coffee","css","less","sql"].indexOf(fileName.split(".")[1])==-1) {
|
||||
nestOK = cM.getTokenAt({line:cM.lineCount(),ch:cM.lineInfo(cM.lineCount()-1).text.length}).className != "error" ? true : false;
|
||||
}
|
||||
ICEcoder.nestValid.style.background = nestOK ? "#0b0" : "#f00";
|
||||
@@ -1330,7 +1331,8 @@ var ICEcoder = {
|
||||
else if (fileName.indexOf(".css")>0) {caretLocType="CSS"}
|
||||
else if (fileName.indexOf(".less")>0) {caretLocType="LESS"}
|
||||
else if (fileName.indexOf(".md")>0) {caretLocType="Markdown"}
|
||||
else if (fileName.indexOf(".xml")>0) {caretLocType="XML"};
|
||||
else if (fileName.indexOf(".xml")>0) {caretLocType="XML"}
|
||||
else if (fileName.indexOf(".sql")>0) {caretLocType="SQL"};
|
||||
}
|
||||
|
||||
ICEcoder.caretLocType = caretLocType;
|
||||
|
||||
Reference in New Issue
Block a user