1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 20:27:40 +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') == 'emails') {
$mode = 'xml';
} else {
$mode = 'htmlmixed';
}
echo ('<script>
$(document).ready(function() {
var editor = CodeMirror.fromTextArea(document.getElementById("content"), {
lineNumbers: false,
matchBrackets: true,
indentUnit: 4,
mode: "htmlmixed",
mode: "'.$mode.'",
indentWithTabs: true,
theme: "'.CodeMirror::$theme.'"
});