]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/plugins-imagemanager.js
Update docker-compose.yml
[bookstack] / resources / js / wysiwyg / plugins-imagemanager.js
index e7dd126cb0f9571c57c6d8c173e5d92dd6fe4033..f1ea120502a4ee99286e82fe94fc56ce5247b8d9 100644 (file)
@@ -1,8 +1,7 @@
 /**
  * @param {Editor} editor
- * @param {String} url
  */
-function register(editor, url) {
+function register(editor) {
     // Custom Image picker button
     editor.ui.registry.addButton('imagemanager-insert', {
         title: 'Insert image',
@@ -12,7 +11,7 @@ function register(editor, url) {
             /** @type {ImageManager} * */
             const imageManager = window.$components.first('image-manager');
             imageManager.show(image => {
-                const imageUrl = image.thumbs.display || image.url;
+                const imageUrl = image.thumbs?.display || image.url;
                 let html = `<a href="${image.url}" target="_blank">`;
                 html += `<img src="${imageUrl}" alt="${image.name}">`;
                 html += '</a>';
@@ -23,9 +22,8 @@ function register(editor, url) {
 }
 
 /**
- * @param {WysiwygConfigOptions} options
  * @return {register}
  */
-export function getPlugin(options) {
+export function getPlugin() {
     return register;
 }