Remove obsolete code
authorMatthias Schmidt <gravatronics@live.com>
Fri, 8 Jan 2021 10:55:13 +0000 (11:55 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 8 Jan 2021 10:55:13 +0000 (11:55 +0100)
Only `insertType = "separate"` was ever supported.

wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js
wcfsetup/install/files/ts/WoltLabSuite/Core/Media/Manager/Editor.ts

index 64e3238a058fd06db955adbd1d6e61f601cb128c..6a2ec80178cb9db77733e742196535b4a5d8f8c1 100644 (file)
@@ -156,7 +156,6 @@ define(["require", "exports", "tslib", "./Base", "../../Core", "../../Event/Hand
         _insertMedia(event, thumbnailSize, closeEditor = false) {
             if (closeEditor === undefined)
                 closeEditor = true;
-            const insertType = "separate";
             // update insert options with selected values if method is called by clicking on 'insert' button
             // in dialog
             if (event) {
@@ -166,16 +165,10 @@ define(["require", "exports", "tslib", "./Base", "../../Core", "../../Event/Hand
                 thumbnailSize = thumbnailSizeSelect.value;
             }
             if (this._options.callbackInsert !== null) {
-                this._options.callbackInsert(this._mediaToInsert, insertType, thumbnailSize);
+                this._options.callbackInsert(this._mediaToInsert, "separate", thumbnailSize);
             }
             else {
-                if (insertType === "separate") {
-                    this._options.editor.buffer.set();
-                    this._mediaToInsert.forEach((media) => this._insertMediaItem(thumbnailSize, media));
-                }
-                else {
-                    this._insertMediaGallery();
-                }
+                this._options.editor.buffer.set();
             }
             if (this._mediaToInsertByClipboard) {
                 Clipboard.unmark("com.woltlab.wcf.media", Array.from(this._mediaToInsert.keys()));
@@ -187,14 +180,6 @@ define(["require", "exports", "tslib", "./Base", "../../Core", "../../Event/Hand
                 UiDialog.close(this);
             }
         }
-        /**
-         * Inserts a series of uploaded images into the editor using a slider.
-         */
-        _insertMediaGallery() {
-            const mediaIds = Array.from(this._mediaToInsert.keys());
-            this._options.editor.buffer.set();
-            this._options.editor.insert.text("[wsmg='" + mediaIds.join(",") + "'][/wsmg]");
-        }
         /**
          * Inserts a single media item into the editor.
          */
index 74bc6456055d5ed0a9889e42bc423545e9b684ef..85927fd2d3b263fec65471a3e346197b1dbae2bc 100644 (file)
@@ -205,8 +205,6 @@ class MediaManagerEditor extends MediaManager<MediaManagerEditorOptions> {
   protected _insertMedia(event?: Event | null, thumbnailSize?: string, closeEditor = false): void {
     if (closeEditor === undefined) closeEditor = true;
 
-    const insertType = "separate";
-
     // update insert options with selected values if method is called by clicking on 'insert' button
     // in dialog
     if (event) {
@@ -218,15 +216,9 @@ class MediaManagerEditor extends MediaManager<MediaManagerEditorOptions> {
     }
 
     if (this._options.callbackInsert !== null) {
-      this._options.callbackInsert(this._mediaToInsert, insertType, thumbnailSize!);
+      this._options.callbackInsert(this._mediaToInsert, "separate", thumbnailSize!);
     } else {
-      if (insertType === "separate") {
-        this._options.editor!.buffer.set();
-
-        this._mediaToInsert.forEach((media) => this._insertMediaItem(thumbnailSize!, media));
-      } else {
-        this._insertMediaGallery();
-      }
+      this._options.editor!.buffer.set();
     }
 
     if (this._mediaToInsertByClipboard) {
@@ -242,16 +234,6 @@ class MediaManagerEditor extends MediaManager<MediaManagerEditorOptions> {
     }
   }
 
-  /**
-   * Inserts a series of uploaded images into the editor using a slider.
-   */
-  protected _insertMediaGallery(): void {
-    const mediaIds = Array.from(this._mediaToInsert.keys());
-
-    this._options.editor!.buffer.set();
-    this._options.editor!.insert.text("[wsmg='" + mediaIds.join(",") + "'][/wsmg]");
-  }
-
   /**
    * Inserts a single media item into the editor.
    */