From: Alexander Ebert Date: Sun, 14 Dec 2014 01:46:24 +0000 (+0100) Subject: Removed obsolete code X-Git-Tag: 2.1.0_Beta_1~20 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b5d85d8243a5fb8ecd98988a95dc5c700d502b30;p=GitHub%2FWoltLab%2FWCF.git Removed obsolete code --- diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index ecb6b99db7..ed31bb944f 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -1765,282 +1765,6 @@ WCF.Notification.List = Class.extend({ } }); -/** - * Loads notification for the user panel. - * - * @see WCF.UserPanel - */ -WCF.Notification.UserPanel = WCF.UserPanel.extend({ - /** - * Favico object - * @var Favico - */ - _favico: null, - - /** - * action proxy - * @var WCF.Action.Proxy - */ - _proxy: null, - - /** - * link to show all notifications - * @var string - */ - _showAllLink: '', - - /** - * @see WCF.UserPanel.init() - */ - init: function(showAllLink) { - this._favico = null; - - try { - this._favico = new Favico({ - animation: 'none', - type: 'circle', - }); - } - catch (e) { /* ignore for now */ } - - this._noItems = 'wcf.user.notification.noMoreNotifications'; - this._proxy = new WCF.Action.Proxy({ - success: $.proxy(this._success, this) - }); - this._showAllLink = showAllLink; - - this._super('userNotifications'); - - // update page title - if (this._container.data('count') && this._favico !== null) { - this._favico.badge(this._container.data('count')); - } - - WCF.System.PushNotification.addCallback('userNotificationCount', $.proxy(this.updateUserNotificationCount, this)); - }, - - /** - * @see WCF.UserPanel._addDefaultItems() - */ - _addDefaultItems: function(dropdownMenu) { - this._addDivider(dropdownMenu); - $('
  • ' + WCF.Language.get('wcf.user.notification.showAll') + '
  • ').appendTo(dropdownMenu); - this._addDivider(dropdownMenu); - $('
  • ' + WCF.Language.get('wcf.user.notification.markAllAsConfirmed') + '
  • ').click($.proxy(this._markAllAsConfirmed, this)).appendTo(dropdownMenu); - }, - - /** - * @see WCF.UserPanel._getParameters() - */ - _getParameters: function() { - return { - actionName: 'getOutstandingNotifications', - className: 'wcf\\data\\user\\notification\\UserNotificationAction' - }; - }, - - /** - * @see WCF.UserPanel._click() - */ - _click: function(event) { - if (this._didLoad) { - var $badge = this._container.find('.badge'); - if ($badge.length && parseInt($badge.text()) > 0) { - var $dropdownMenu = WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify()); - - // check if there is at least one unconfirmed item - var $count = $dropdownMenu.children('li.notificationUnconfirmed').length; - if (!$count && $count != $badge.text() && !$dropdownMenu.is(':visible')) { - this._resetList(); - - this._super(event); - } - } - } - else { - this._super(event); - } - }, - - /** - * @see WCF.UserPanel._after() - */ - _after: function(dropdownMenu) { - var $items = WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify()).children('li.jsNotificationItem'); - - var $insertAfter = null; - $items.each((function(index, item) { - var $item = $(item); - var $isConfirmed = $item.data('isConfirmed'); - - if (!$.browser.msie) { - $item.addClass('notificationItemLink'); - $('').appendTo($item); - } - - if (!$isConfirmed) { - $item.find('a:not(.userLink)').prop('href', $item.data('confirmLink')); - - if (!$.browser.mobile) { - var $markAsConfirmed = $('').prependTo($item.find('> span.box24 > .framed')); - $markAsConfirmed.click($.proxy(this._markAsConfirmed, this)); - } - } - - if (!$item.data('isConfirmed')) { - $insertAfter = $item; - } - - $item.click(function(event) { - if (event.target.tagName !== 'A') { - window.location = $item.data('link'); - } - }); - }).bind(this)); - - if ($insertAfter !== null) { - // check if it is followed by a confirmed item - if ($insertAfter.next('.notificationItem').length) { - $('
  • ' + WCF.Language.get('wcf.global.loading') + '
  • ').prependTo($dropdownMenu); - - // remove double separators - $dropdownMenu.children('.dropdownDivider + .dropdownDivider').remove(); - - this._didLoad = false; - }, - - _removeMarkAllAsConfirmed: function() { - $('#userNotificationsMarkAllAsConfirmed').hide().prev('.dropdownDivider').hide(); - }, - - /** - * Updates user notification count. - * - * @param integer count - */ - updateUserNotificationCount: function(count) { - // close dropdown - WCF.Dropdown.close('userNotifications'); - - // revert dropdown to initial state - this._resetList(); - - // update badge - this._updateBadge(count); - - if (parseInt(count) > 0) { - $('#userNotificationsMarkAllAsConfirmed').show().prev('.dropdownDivider').show(); - } - } -}); - /** * Signature preview. *