From 0a9862d521f7db10d02af7866d54b40dce6f58bb Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 22 Jun 2021 07:39:41 +0200 Subject: [PATCH] Remove `WCF.ACP.Style.ImageUpload` (#4323) This component has been deprecated for many years since 59ab4d0f66ddd21bc800b49ebbedcd91e6ae0c5c and even the suggested replacement has already been removed since 40132f4b2e00dd7896d31247a40144bc85b11d28. --- .../install/files/acp/js/WCF.ACP.Style.js | 98 ------------------- 1 file changed, 98 deletions(-) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.Style.js b/wcfsetup/install/files/acp/js/WCF.ACP.Style.js index bb3873be97..e4747262c5 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.Style.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.Style.js @@ -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 = $('').insertAfter(this._button); - } - - return $span; - } -}); - /** * Handles style list management buttons. */