1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 12:17:42 +02:00

CodeMirror Plugin as a part of Monstra CMS #187

This commit is contained in:
Awilum
2014-01-31 21:23:34 +02:00
parent 358c7fdefe
commit b8ebd53272

View File

@@ -58,13 +58,20 @@ class CodeMirror
'); ');
if (Request::get('id') == 'themes' || Request::get('id') == 'snippets' || Request::get('id') == 'emails') { if (Request::get('id') == 'themes' || Request::get('id') == 'snippets' || Request::get('id') == 'emails') {
if (Request::get('id') == 'emails') {
$mode = 'xml';
} else {
$mode = 'htmlmixed';
}
echo ('<script> echo ('<script>
$(document).ready(function() { $(document).ready(function() {
var editor = CodeMirror.fromTextArea(document.getElementById("content"), { var editor = CodeMirror.fromTextArea(document.getElementById("content"), {
lineNumbers: false, lineNumbers: false,
matchBrackets: true, matchBrackets: true,
indentUnit: 4, indentUnit: 4,
mode: "htmlmixed", mode: "'.$mode.'",
indentWithTabs: true, indentWithTabs: true,
theme: "'.CodeMirror::$theme.'" theme: "'.CodeMirror::$theme.'"
}); });