Remove `WCF.ACP.Style.ImageUpload` (#4323)
authorMatthias Schmidt <gravatronics@live.com>
Tue, 22 Jun 2021 05:39:41 +0000 (07:39 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jun 2021 05:39:41 +0000 (07:39 +0200)
This component has been deprecated for many years since 59ab4d0f66ddd21bc800b49ebbedcd91e6ae0c5c and even the suggested replacement has already been removed since 40132f4b2e00dd7896d31247a40144bc85b11d28.

wcfsetup/install/files/acp/js/WCF.ACP.Style.js

index bb3873be97ba2cb3abe6879353d92ddc37cdda35..e4747262c57cae672ae3ea73bc4c302dd3ef4382 100644 (file)
@@ -64,104 +64,6 @@ WCF.ACP.Style.CopyStyle = Class.extend({
        }
 });
 
-/**
- * Handles the preview image upload.
- * 
- * @param      integer         styleID
- * @param      string          tmpHash
- * @deprecated use WoltLabSuite/Core/Acp/Ui/Style/Image/Upload
- */
-WCF.ACP.Style.ImageUpload = WCF.Upload.extend({
-       /**
-        * upload button
-        * @var jQuery
-        */
-       _button: null,
-       
-       /**
-        * preview image
-        * @var jQuery
-        */
-       _image: null,
-       
-       /**
-        * style id
-        * @var integer
-        */
-       _styleID: 0,
-       
-       /**
-        * tmp hash
-        * @var string
-        */
-       _tmpHash: '',
-       
-       /**
-        * @see WCF.Upload.init()
-        */
-       init: function(styleID, tmpHash) {
-               this._styleID = parseInt(styleID) || 0;
-               this._tmpHash = tmpHash;
-               
-               this._button = $('#uploadImage');
-               this._image = $('#styleImage');
-               
-               this._super(this._button, undefined, 'wcf\\data\\style\\StyleAction');
-       },
-       
-       /**
-        * @see WCF.Upload._initFile()
-        */
-       _initFile: function(file) {
-               return this._image;
-       },
-       
-       /**
-        * @see WCF.Upload._getParameters()
-        */
-       _getParameters: function() {
-               return {
-                       styleID: this._styleID,
-                       tmpHash: this._tmpHash
-               };
-       },
-       
-       /**
-        * @see WCF.Upload._success()
-        */
-       _success: function(uploadID, data) {
-               if (data.returnValues.url) {
-                       // show image
-                       this._image.attr('src', data.returnValues.url + '?timestamp=' + Date.now());
-                       
-                       // hide error
-                       this._button.next('.innerError').remove();
-                       
-                       // show success message
-                       var $notification = new WCF.System.Notification(WCF.Language.get('wcf.global.success'));
-                       $notification.show();
-               }
-               else if (data.returnValues.errorType) {
-                       // show error
-                       this._getInnerErrorElement().text(WCF.Language.get('wcf.acp.style.image.error.' + data.returnValues.errorType));
-               }
-       },
-       
-       /**
-        * Returns error display element.
-        * 
-        * @return      jQuery
-        */
-       _getInnerErrorElement: function() {
-               var $span = this._button.next('.innerError');
-               if (!$span.length) {
-                       $span = $('<small class="innerError" />').insertAfter(this._button);
-               }
-               
-               return $span;
-       }
-});
-
 /**
  * Handles style list management buttons.
  */