From: Cyperghost Date: Thu, 7 Nov 2024 12:31:01 +0000 (+0100) Subject: `WCF.User.Avatar` and `WCF.User.Avatar.Upload` are no longer used X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2897de9c441e7edb5a4dca9b6b20ba089ab16f5b;p=GitHub%2FWoltLab%2FWCF.git `WCF.User.Avatar` and `WCF.User.Avatar.Upload` are no longer used --- diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index 1029c79f32..53d181b725 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -1400,150 +1400,6 @@ else { }); } -/** - * Namespace for avatar functions. - */ -WCF.User.Avatar = {}; - -if (COMPILER_TARGET_DEFAULT) { - /** - * Avatar upload function - * - * @see WCF.Upload - */ - WCF.User.Avatar.Upload = WCF.Upload.extend({ - /** - * user id of avatar owner - * @var integer - */ - _userID: 0, - - /** - * Initializes a new WCF.User.Avatar.Upload object. - * - * @param integer userID - */ - init: function (userID) { - this._super($('#avatarUpload > dd > div'), undefined, 'wcf\\data\\user\\avatar\\UserAvatarAction'); - this._userID = userID || 0; - - $('#avatarForm input[type=radio]').change(function () { - if ($(this).val() == 'custom') { - $('#avatarUpload > dd > div').show(); - } - else { - $('#avatarUpload > dd > div').hide(); - } - }); - if (!$('#avatarForm input[type=radio][value=custom]:checked').length) { - $('#avatarUpload > dd > div').hide(); - } - }, - - /** - * @see WCF.Upload._initFile() - */ - _initFile: function (file) { - return $('#avatarUpload > dt > img'); - }, - - /** - * @see WCF.Upload._success() - */ - _success: function (uploadID, data) { - if (data.returnValues.url) { - this._updateImage(data.returnValues.url); - - // hide error - $('#avatarUpload > dd > .innerError').remove(); - - // show success message - var $notification = new WCF.System.Notification(WCF.Language.get('wcf.user.avatar.upload.success')); - $notification.show(); - } - else if (data.returnValues.errorType) { - // show error - this._getInnerErrorElement().text(WCF.Language.get('wcf.user.avatar.upload.error.' + data.returnValues.errorType)); - } - }, - - /** - * Updates the displayed avatar image. - * - * @param string url - */ - _updateImage: function (url) { - $('#avatarUpload > dt > img').remove(); - var $image = $('').css({ - 'height': 'auto', - 'max-height': '96px', - 'max-width': '96px', - 'width': 'auto' - }); - - $('#avatarUpload > dt').prepend($image); - - WCF.DOMNodeInsertedHandler.execute(); - }, - - /** - * Returns the inner error element. - * - * @return jQuery - */ - _getInnerErrorElement: function () { - var $span = $('#avatarUpload > dd > .innerError'); - if (!$span.length) { - $span = $(''); - $('#avatarUpload > dd').append($span); - } - - return $span; - }, - - /** - * @see WCF.Upload._getParameters() - */ - _getParameters: function () { - return { - userID: this._userID - }; - } - }); -} -else { - WCF.User.Avatar.Upload = WCF.Upload.extend({ - _userID: 0, - init: function() {}, - _initFile: function() {}, - _success: function() {}, - _updateImage: function() {}, - _getInnerErrorElement: function() {}, - _getParameters: function() {}, - _name: "", - _buttonSelector: {}, - _fileListSelector: {}, - _fileUpload: {}, - _className: "", - _iframe: {}, - _internalFileID: 0, - _options: {}, - _uploadMatrix: {}, - _supportsAJAXUpload: true, - _overlay: {}, - _createButton: function() {}, - _insertButton: function() {}, - _removeButton: function() {}, - _upload: function() {}, - _createUploadMatrix: function() {}, - _error: function() {}, - _progress: function() {}, - _showOverlay: function() {}, - _evaluateResponse: function() {}, - _getFilename: function() {} - }); -} - /** * Generic implementation for grouped user lists. *