Skip to content

Commit

Permalink
Remove WCF.ACP.Style.ImageUpload (#4323)
Browse files Browse the repository at this point in the history
This component has been deprecated for many years since 59ab4d0 and even the suggested replacement has already been removed since 40132f4.
  • Loading branch information
Gravatronics committed Jun 22, 2021
1 parent 69da304 commit 0a9862d
Showing 1 changed file with 0 additions and 98 deletions.
98 changes: 0 additions & 98 deletions wcfsetup/install/files/acp/js/WCF.ACP.Style.js
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 0a9862d

Please sign in to comment.