/* global tinymce I18n MarvinJsEditor */ // TinyMCE plugin tinymce.PluginManager.add('marvinjs', (editor) => { function openMarvinJs() { MarvinJsEditor.open({ mode: 'new-tinymce', marvinUrl: '/tiny_mce_assets/marvinjs', editor }); } // Add marvinjs button editor.ui.registry.addIcon( 'marvinjs', ` ` ); // Add a button that opens a window editor.ui.registry.addButton('marvinjs', { tooltip: I18n.t('marvinjs.new_button'), icon: 'marvinjs', onAction: openMarvinJs }); // Adds a menu item to the tools menu editor.ui.registry.addMenuItem('marvinjs', { text: I18n.t('marvinjs.new_button'), icon: 'marvinjs', context: 'insert', onAction: openMarvinJs }); return { getMetadata: () => ({ name: 'MarvinJs Plugin' }) }; });