Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WoltLab Suite 6.0. with CKEditor Clippings not works. #433

Open
Endor8 opened this issue Nov 29, 2023 · 3 comments
Open

WoltLab Suite 6.0. with CKEditor Clippings not works. #433

Endor8 opened this issue Nov 29, 2023 · 3 comments

Comments

@Endor8
Copy link

Endor8 commented Nov 29, 2023

Hi.
The extension does not work with WoltLab Suite 6.0.
The use now the CKEditor.
I know you are already informed about this:
ckeditor/ckeditor5#11604 (comment)
Have you seen the answer to cadeyrn:
ckeditor/ckeditor5#11604 (comment)

Actually it is impossible to insert a text module.
For example in this forum:
https://www.camp-firefox.de/forum/

I hope you will be able to fix this.
Thank you for your help.

Kind regards
Endor8, and 2002Andreas

@aecreations
Copy link
Owner

Thanks for bringing this to my attention. I will research alternatives to using execCommand for inserting text into an HTML editor.

@aecreations
Copy link
Owner

I've tried using the Clipboard API to create and execute a clipboard paste event to cause an HTML-formatted clipping to be inserted. Unfortunately, that didn't work in CKEditor, and it also caused clipping insertion to stop working in any HTML editor (e.g. TinyMCE, email composer in Gmail, etc.). Reading through the MDN documentation, it appears this is by design[1]:

It's possible to construct and dispatch a synthetic paste event, but this will not affect the document's contents.

Here are the code changes for this fix attempt, in case anyone is interested: b9ffa50

I have refactored the content script (commits 7084e42 and 2d0d46b), where the clipping insertion (a.k.a. "paste") is performed, to use the DOM Range API[2] instead of document.execCommand(), but this only maintains existing behaviour using modern APIs; it still doesn't resolve the issue with CKEditor.

The workaround to this issue still applies: copy the text of the desired clipping from Clippings Manager, and manually paste it into the CKEditor HTML text box. There is an enhancement in an upcoming release of Clippings that will make this workaround a bit easier (issue #437).

--
[1] https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event
[2] https://developer.mozilla.org/en-US/docs/Web/API/Range

@Endor8
Copy link
Author

Endor8 commented Mar 31, 2024

Hi aecreations.
Thank you for the infomations.
There is a thread in a forum the user DeJaVu tries to fix it:
https://www.camp-firefox.de/forum/thema/137758-ckeditor-und-clippings/?postID=1246886#post1246886
I hope it helps.
Happy Easter.
Kind regards
Endor8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants