jure965 / OpenLorem

Lorem ipsum API client web extension
GNU General Public License v3.0
15 stars 6 forks source link

Not working inside TinyMCE #15

Closed Aybee closed 4 years ago

Aybee commented 4 years ago

Bug, or Missing Feature?

Would be nice if it will work inside the editor TinyMCE. For example on this page http://skin.tiny.cloud/t5/

jure965 commented 4 years ago

Looks like the textarea part of the editor is an iframe. We may need to adjust permissions in our web extension manifest for iframes. Also TinyMCE has kinda specific layout, and text probably cannot be simply just inserted into the box, unless you know what you are doing.

Aybee commented 4 years ago

This addon makes it work to paste into TinyMCE https://github.com/simple-lorem-ipsum/simple-lorem-ipsum. Maybe you can take a look at how he did it?

jure965 commented 4 years ago

Hi @Aybee, regarding the issue, could you check with the latest version from master if it works for you?

Aybee commented 4 years ago

Hello @jure965 sorry for late response. Yes, it works in TinyMCE now, but if I set the cursor into another simple input[type=text] then it also pastes the lorem into the textarea.

I'm working with the content management system Contao. You can try it by yourself within the online Demo https://demo.contao.org/contao Following link should lead you directly to a content element with a TinyMCE textarea (if you get an error message simply click the "continue" link). https://demo.contao.org/contao?do=article&table=tl_content&id=1&act=edit

jure965 commented 4 years ago

Thank you for providing the link for testing. I added some logic for inserting in textboxes and fixed duplicate pasting on unfocused iframes. I am planning to release v0.5 with the fixes soon.

Aybee commented 4 years ago

Thank you. Now I can paste also into other input fields.

I will open a new ticket as it makes no sence to paste HTML paragraphs into an input type=text.