Commit 7182ddf3 authored by Jérome Perrin's avatar Jérome Perrin

code_mirror: Use mariadb for SQL mode

parent aab0ea16
...@@ -464,6 +464,11 @@ ...@@ -464,6 +464,11 @@
updateLinting(cm, found);\n updateLinting(cm, found);\n
});\n });\n
}\n }\n
\n
var mode = "&dtml-mode;";\n
if ( mode === "sql" ) {\n
mode = "text/x-mariadb";\n
}\n
\n \n
<dtml-if expr="mode == \'python\'">\n <dtml-if expr="mode == \'python\'">\n
lint_option = {"getAnnotations": checkPythonSourceCode,\n lint_option = {"getAnnotations": checkPythonSourceCode,\n
...@@ -477,7 +482,7 @@ ...@@ -477,7 +482,7 @@
// CodeMirror expects a DOM element, not a JQuery Object\n // CodeMirror expects a DOM element, not a JQuery Object\n
var cm = CodeMirror.fromTextArea(\n var cm = CodeMirror.fromTextArea(\n
getTextareaField()[0],\n getTextareaField()[0],\n
{mode: "&dtml-mode;",\n {mode: mode,\n
lineNumbers: true,\n lineNumbers: true,\n
showTrailingSpace: true,\n showTrailingSpace: true,\n
tabSize: 2,\n tabSize: 2,\n
...@@ -534,7 +539,7 @@ ...@@ -534,7 +539,7 @@
{value: cm.getValue(),\n {value: cm.getValue(),\n
orig: data,\n orig: data,\n
highlightDifferences: true,\n highlightDifferences: true,\n
mode: "&dtml-mode;",\n mode: mode,\n
lineNumbers: true,\n lineNumbers: true,\n
showTrailingSpace: true,\n showTrailingSpace: true,\n
matchBrackets: true,\n matchBrackets: true,\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment