2 * @param {Editor} editor
5 function register(editor, url) {
6 // Custom Image picker button
7 editor.ui.registry.addButton('imagemanager-insert', {
10 tooltip: 'Insert image',
12 /** @type {ImageManager} **/
13 const imageManager = window.$components.first('image-manager');
14 imageManager.show(function (image) {
15 const imageUrl = image.thumbs.display || image.url;
16 let html = `<a href="${image.url}" target="_blank">`;
17 html += `<img src="${imageUrl}" alt="${image.name}">`;
19 editor.execCommand('mceInsertContent', false, html);
27 * @param {WysiwygConfigOptions} options
30 export function getPlugin(options) {