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:
@@ -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.'"
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user