aecreations / clippings

Clippings: an extension for Mozilla Firefox
20 stars 4 forks source link

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

Open Endor8 opened 11 months ago

Endor8 commented 11 months ago

Hi. The extension does not work with WoltLab Suite 6.0. The use now the CKEditor. I know you are already informed about this: https://github.com/ckeditor/ckeditor5/issues/11604#issue-1199426749 Have you seen the answer to cadeyrn: https://github.com/ckeditor/ckeditor5/issues/11604#issuecomment-1831462153

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 commented 11 months ago

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

aecreations commented 10 months ago

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: b9ffa50ce3d203084120c1ad8019fe9db2878b51

I have refactored the content script (commits 7084e422bade88dada73db21d249281095690605 and 2d0d46b31dea20ff3ec4e42e1d4b42e0be260c39), 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 commented 7 months ago

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

Endor8 commented 3 months ago

Hi aecreations. Any news about this. Will Clippings 7.0 work again with CKEditor? I hope it. Kind regards Endor8

aecreations commented 3 months ago

Pasting a clipping from the context menu still won't work with CKEditor. The workaround to the CKEditor limitation still applies: copy the clipping text and then paste it into CKEditor.

The good news is that Clippings 7.0 will make it easier to copy clipping text, either from Clippings Manager, or the new Clippings Sidebar. Clippings 7.0 is now in beta, and you're welcome to try it out: https://aecreations.blogspot.com/2024/08/clippings-70-beta-2-released.html