Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Post/product preview

givanzeb2f1bbacf92
diff --git a/app/template/editor.tpl b/app/template/editor.tpl
index ba69909..11b7bdb 100755
--- a/app/template/editor.tpl
+++ b/app/template/editor.tpl
@@ -8,6 +8,10 @@ if ($is_admin && $vvveb_is_page_edit) {
$css = file_get_contents($customCssFile);//'body {background:red}';
echo "<style id=\"vvvebjs-styles\">$css</style>";
}
+
+ if (isset($_GET['preview'])) {
+ echo '<link data-vvveb-helpers href="' . PUBLIC_PATH . 'css/vvvebjs-editor-helpers.css" rel="stylesheet">';
+ }
}
?>
diff --git a/public/js/libs/tinymce-options.js b/public/js/libs/tinymce-options.js
index b1359ed..58abc25 100755
--- a/public/js/libs/tinymce-options.js
+++ b/public/js/libs/tinymce-options.js
@@ -498,6 +498,9 @@ let tinyMceOptions = {
editor.on('change', function(ed, e) {
// text changed set has_changes flag to save revision
ed.target.container.parentNode.querySelector(".has_changes").value = "1";
+ delay(() => {
+ if (typeof contentElement !== "undefined") contentElement.innerHTML = editor.getContent();
+ }, 500);
});
window.dispatchEvent(new CustomEvent("tinymce.setup", {detail: editor}));