[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Wiki Pages: WYSIWYG editor external link popup unusable with Elementplus enabled
"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6926014fb0b68_2a1f397788161d@gitlab-sidekiq-low-urgency-cpu-bound-v2-7cc5cbf57-fdknn.mail> |
luci pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
e09931f8 by Elifeleti Mukisa Dan at 2025-11-25T19:11:55+00:00
[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
- - - - -
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/e09931f849e64df55f3f7f37df20e46d2b791f52
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e09931f849e64df55f3f7f37df20e46d2b791f52
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