`WCF.User.Avatar` and `WCF.User.Avatar.Upload` are no longer used
authorCyperghost <olaf_schmitz_1@t-online.de>
Thu, 7 Nov 2024 12:31:01 +0000 (13:31 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Thu, 7 Nov 2024 12:31:01 +0000 (13:31 +0100)
wcfsetup/install/files/js/WCF.User.js

index 1029c79f32b6a67ca162076ff6363dbbe2e6bf75..53d181b725f3d6adc3f6f52f938a59a11d710334 100644 (file)
@@ -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 = $('<img src="' + url + '" class="userAvatarImage" alt="" />').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 = $('<small class="innerError"></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.
  *