xwp / wp-shortcode-ui-richtext

Shortcake (Shortcode UI) Richtext
15 stars 11 forks source link

Create global variable #20

Open kuliebiakin opened 6 years ago

kuliebiakin commented 6 years ago

Hi,

I used this good plugin on one project where was implemented repeatable function in post element and to reinitialize editors I added code which is based on extra wp.shortcake.hooks.doAction('shortcode-ui.render_edit', shortcode); call, so I have a suggestion to create global variable e.g. suiRichText, so that developers of themes/plugins will have a possibility to call load/unload methods etc. by themselves:

window.suiRichText = {
    selector: 'textarea.shortcake-richtext, #inner_content',
    load: <Function>,
    unload: <Function>,
    loadedEditors: <Array>,
    loaded: <Boolean>
}

What do you think about that?

mehigh commented 6 years ago

If you contribute it with a PR, I'm fine to merge it in and release it.