ebess / advanced-nova-media-library

A Laravel Nova field for displaying, creating, updating and ordering a Spatie Media Library model.
597 stars 297 forks source link

Integrate to WYSIWYG editor? #200

Open ngtranthanhtoan opened 4 years ago

ngtranthanhtoan commented 4 years ago

Hi there,

I see the package is great!

I'm wondering is there any way that I can integrate this package to a WYSIWYG editor?

For example, if I am using TinyMCE editor, How can I open the media pop up and insert the image to the editor.

bkintanar commented 4 years ago

I don't think that's falls into the scope of this package. I'm sorry.

7ammer commented 3 years ago

For anyone thinking about looking into this further...

TinyMCE adds the string query ?editor=tinymce5 to the end of the iframe url so you could look for this and then override the "image select" button with the following methods...

parent.postMessage({ mceAction: 'insert', content: 'the-file-path' });
parent.postMessage({ mceAction: 'close' });