parttio / tinymce-for-flow

TinyMCE wrapper for Vaadin 10+
Other
8 stars 6 forks source link

Any way to call insert function ? #3

Closed ado2000 closed 4 years ago

ado2000 commented 5 years ago

Hi, thanks for the component,

is there any way to insert text at the caret position ?

It is possible by calling a js method like "tinymce.activeEditor.selection.setContent('html string');"

Thanks

mstahv commented 4 years ago

Hi!

I think that shouldn't be too hard to implement it. What is the use case? Where is the html string coming from (like automatically from background thread, separate button, keyboard shortcut) ?

ado2000 commented 4 years ago

Hi, the main use for us should be using a different button or combobox that adds ( on click/select ) some placeholder text into the html editor ad caret position, like %%user_name%%

so, the user click into the editor on the point where they want to insert the placeholder, than click on the button or combobox to insert the placeholder.

Thanks

mstahv commented 4 years ago

I believe the change referred above helps you. Let me know if it don't. I'll cut a new release in next couple of minutes.

mstahv commented 4 years ago

1.4 should be synchronised to maven repository shortly.

ado2000 commented 4 years ago

Hi Matti, sorry for the delay,

it works like a charm.

Thanks a lot.