/** * @param {Editor} editor */ function register(editor) { // Custom Image picker button editor.ui.registry.addButton('imagemanager-insert', { title: 'Insert image', icon: 'image', tooltip: 'Insert image', onAction() { /** @type {ImageManager} * */ const imageManager = window.$components.first('image-manager'); imageManager.show(image => { const imageUrl = image.thumbs?.display || image.url; let html = ``; html += `${image.name}`; html += ''; editor.execCommand('mceInsertContent', false, html); }, 'gallery'); }, }); } /** * @return {register} */ export function getPlugin() { return register; }