[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Wiki Pages: WYSIWYG editor external link popup unusable with Elementplus enabled

"Elifeleti Mukisa Dan \(@Danelif\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6926d507c202b_2a2dcab5c44842@gitlab-sidekiq-low-urgency-cpu-bound-v2-57b49dfc9c-btrvx.mail>

Elifeleti Mukisa Dan pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
97b110a0 by Elifeleti Mukisa Dan at 2025-11-26T10:14:26+00:00
[BP][FIX] Wiki Pages: WYSIWYG editor external link popup unusable with Elementplus enabled
---
* [FIX] Wiki Pages: WYSIWYG editor external link popup unusable with Elementplus enabled
---
* [FIX] Fix Wiki WYSIWYG editor external link popup unusable

See merge request tikiwiki/tiki!9039


(cherry picked from commit e09931f849e64df55f3f7f37df20e46d2b791f52)

4e42a015 [FIX] Fix Wiki WYSIWYG editor external link popup unusable

Co-authored-by: Elifeleti Mukisa Dan <[email protected]>

See merge request tikiwiki/tiki!9123

- - - - -


2 changed files:

- src/js/vue-widgets/element-plus-ui/src/utils/applyInput.js
- src/js/wysiwyg/summernote/initSummernote.js


Changes:

=====================================
src/js/vue-widgets/element-plus-ui/src/utils/applyInput.js
=====================================
@@ -58,7 +58,11 @@ function transformContainerInputs(containerElement) {
         // --- Event Synchronization ---
 
         elementPlusUi.on("change", (e) => originalInput.val(e.detail[0]).trigger("change"));
-        elementPlusUi.on("input", (e) => originalInput.val(e.detail?.[0]).trigger("input"));
+        elementPlusUi.on("input", (e) => {
+            if (e.detail?.[0]) {
+                originalInput.val(e.detail?.[0]).trigger("input");
+            }
+        });
 
         ["blur", "focus", "keyup", "keydown"].forEach((event) => {
             elementPlusUi.on(event, (e) => {


=====================================
src/js/wysiwyg/summernote/initSummernote.js
=====================================
@@ -8,34 +8,58 @@ export default function (areaId, toolbar, options) {
 
     const { tools, icons, customButtons } = formatTikiToolbars(toolbar);
 
+    // Build callbacks normally
+    const callbacks = {
+        onInit: function () {
+            const toolbar = $(this).data("summernote").layoutInfo.toolbar;
+            toolbar.find(".custom-btn-wrapper").each(function () {
+                $(this).children().unwrap();
+            });
+            if (!options.inline) {
+                parseData(target, Handlers.dirtyCheck.bind(null, target), false);
+            } else {
+                Handlers.dirtyCheck(target);
+            }
+        },
+
+        onKeydown: function (event) {
+            if (event.key === "@") {
+                event.preventDefault();
+                renderUserMentionModal(areaId);
+            }
+        },
+
+        onCodeviewToggled: function () {
+            Handlers.customCodeview(target);
+        },
+    };
+
+    // Add onDialogShown ONLY when ElementPlus is active
+    if (window.elementPlus) {
+        callbacks.onDialogShown = function () {
+            setTimeout(() => {
+                const inputs = target.data("summernote").layoutInfo.editor.find(".modal-body").find("input, select");
+
+                inputs.each(function () {
+                    const elementPlusInput = $(`#${$(this).attr("element-plus-ref")}`);
+                    elementPlusInput.attr("value", $(this).val());
+
+                    // Sync back sanitized URL value after blur
+                    $(this).on("blur", () => {
+                        elementPlusInput.attr("value", $(this).val());
+                    });
+                });
+            }, 0);
+        };
+    }
+
     target.summernote({
         lang: options.lang,
         toolbar: tools,
         icons,
         buttons: customButtons,
         height: options.height,
-        callbacks: {
-            onInit: function () {
-                const toolbar = $(this).data("summernote").layoutInfo.toolbar;
-                toolbar.find(".custom-btn-wrapper").each(function () {
-                    $(this).children().unwrap();
-                });
-                if (!options.inline) {
-                    parseData(target, Handlers.dirtyCheck.bind(null, target), false);
-                } else {
-                    Handlers.dirtyCheck(target);
-                }
-            },
-            onKeydown: function (event) {
-                if (event.key === "@") {
-                    event.preventDefault();
-                    renderUserMentionModal(areaId);
-                }
-            },
-            onCodeviewToggled: function () {
-                Handlers.customCodeview(target);
-            },
-        },
+        callbacks,
     });
 
     Handlers.formSubmission(target);



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/97b110a0ffd52bb7306c5c5dcf715cf6d4221478

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/97b110a0ffd52bb7306c5c5dcf715cf6d4221478
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.