From d7610386e3ca9e63e1333ae31429fbd3036bf007 Mon Sep 17 00:00:00 2001 From: Paul Spenke Date: Sun, 2 Jul 2023 21:38:11 +0800 Subject: [PATCH] origin commit a3f022d --- plugi-core/dist/PageBuilderBody.js | 114 ++++++++++-------- plugi-core/dist/PageBuilderBody.umd.cjs | 2 +- .../src/Modules/GrapesJS/PageBuilder.php | 15 +++ .../GrapesJS/resources/assets/js/save-page.js | 62 +++++++--- .../GrapesJS/resources/views/pagebuilder.php | 1 + 5 files changed, 121 insertions(+), 73 deletions(-) diff --git a/plugi-core/dist/PageBuilderBody.js b/plugi-core/dist/PageBuilderBody.js index 16ad7a3..fc3ca89 100644 --- a/plugi-core/dist/PageBuilderBody.js +++ b/plugi-core/dist/PageBuilderBody.js @@ -29,14 +29,14 @@ function y() { function S() { window.editor.trigger("change:canvasOffset canvasScroll"); } -let b = !1; +let g = !1; $(document).keydown(function(t) { - t.which === 8 && (b = !0); + t.which === 8 && (g = !0); }).keyup(function(t) { - t.which === 8 && (b = !1); + t.which === 8 && (g = !1); }); $(window).on("beforeunload", function(t) { - b && t.preventDefault(); + g && t.preventDefault(); }); function A() { $(".gjs-blocks-cs").prepend($("#block-search")); @@ -93,11 +93,11 @@ window.editor.on("sorter:drag:end", function(t) { CKEDITOR.instances[i].destroy(!0); }); window.runScriptsOfComponentAndChildren = function(t) { - H(t), t.components().each(function(e) { + x(t), t.components().each(function(e) { runScriptsOfComponentAndChildren(e); }); }; -function H(t) { +function x(t) { let e = t.attributes["block-id"]; if (e === void 0 && (e = t.attributes.attributes.id), e && window.customBuilderScripts[e] !== void 0) { let i = t.attributes["style-identifier"], n = $("").append(window.customBuilderScripts[e]); @@ -106,8 +106,8 @@ function H(t) { a.type = "text/javascript", a.innerHTML = n.find("script").html(), window.editor.Canvas.getDocument().body.appendChild(a); } } -function R() { - x(); +function H() { + R(); let t = document.createElement("script"); t.type = "text/javascript", t.src = window.injectionScriptUrl; let e = t.outerHTML + "