]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/plugins-imagemanager.js
Readme: Added sponsor, removed road map section
[bookstack] / resources / js / wysiwyg / plugins-imagemanager.js
index 6969a50e22264bb77e96c626dc93d04329edeb3e..f1ea120502a4ee99286e82fe94fc56ce5247b8d9 100644 (file)
@@ -1,32 +1,29 @@
 /**
  * @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',
         icon: 'image',
         tooltip: 'Insert image',
         onAction() {
-            /** @type {ImageManager} **/
+            /** @type {ImageManager} * */
             const imageManager = window.$components.first('image-manager');
-            imageManager.show(function (image) {
-                const imageUrl = image.thumbs.display || image.url;
+            imageManager.show(image => {
+                const imageUrl = image.thumbs?.display || image.url;
                 let html = `<a href="${image.url}" target="_blank">`;
                 html += `<img src="${imageUrl}" alt="${image.name}">`;
                 html += '</a>';
                 editor.execCommand('mceInsertContent', false, html);
             }, 'gallery');
-        }
+        },
     });
 }
 
-
 /**
- * @param {WysiwygConfigOptions} options
  * @return {register}
  */
-export function getPlugin(options) {
+export function getPlugin() {
     return register;
-}
\ No newline at end of file
+}