mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
feat: render actual elements in markdown cheatsheet instead of labels
Replace text labels (h1, bold, italic) with rendered HTML in the Rendu column: headings, strong, em, del, code, links, blockquote, lists, hr, sup, small
This commit is contained in:
@@ -83,7 +83,7 @@ $extraJsInline = '';
|
||||
|
||||
if ($editType === 'page' || $editType === 'about_page') {
|
||||
$initialContent = $page["content"] ?? "";
|
||||
$extraJs = ["/assets/js/vendor/overtype.min.js", "/assets/js/app/autosave.js"];
|
||||
$extraJs = ["/assets/js/vendor/overtype.min.js", "/assets/js/app/autosave-handler.js"];
|
||||
$extraJsInline = <<<'JS'
|
||||
var OT = window.OverType.default || window.OverType;
|
||||
var hidden = document.getElementById('content');
|
||||
@@ -92,12 +92,15 @@ var editor = new OT(document.getElementById('editor'), {
|
||||
minHeight: '400px',
|
||||
spellcheck: false,
|
||||
toolbar: true,
|
||||
onChange: function(value) { hidden.value = value; }
|
||||
onChange: function(value) {
|
||||
hidden.value = value;
|
||||
hidden.dispatchEvent(new CustomEvent('overtype:change', { bubbles: true }));
|
||||
}
|
||||
});
|
||||
JS;
|
||||
} elseif ($editType === 'form_help') {
|
||||
$initialContent = $formHelpContent;
|
||||
$extraJs = ["/assets/js/vendor/overtype.min.js", "/assets/js/app/autosave.js"];
|
||||
$extraJs = ["/assets/js/vendor/overtype.min.js", "/assets/js/app/autosave-handler.js"];
|
||||
$extraJsInline = <<<'JS'
|
||||
var OT = window.OverType.default || window.OverType;
|
||||
var hidden = document.getElementById('content');
|
||||
@@ -106,11 +109,14 @@ var editor = new OT(document.getElementById('editor'), {
|
||||
minHeight: '400px',
|
||||
spellcheck: false,
|
||||
toolbar: true,
|
||||
onChange: function(value) { hidden.value = value; }
|
||||
onChange: function(value) {
|
||||
hidden.value = value;
|
||||
hidden.dispatchEvent(new CustomEvent('overtype:change', { bubbles: true }));
|
||||
}
|
||||
});
|
||||
JS;
|
||||
} elseif ($editType === 'apropos') {
|
||||
$extraJs = ["/assets/js/app/autosave.js"];
|
||||
$extraJs = ["/assets/js/app/autosave-handler.js"];
|
||||
}
|
||||
|
||||
$isAdmin = true;
|
||||
|
||||
Reference in New Issue
Block a user