From ef012ee1f69593a5c9dc2c904bb022d83cca9246 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sun, 2 Jun 2013 17:06:55 +0200 Subject: [PATCH] Removed obsolete code --- wcfsetup/install/files/acp/js/WCF.ACP.User.js | 107 ----------------- wcfsetup/install/files/acp/js/WCF.ACP.js | 109 ++++++++++++++++++ .../install/files/acp/templates/userList.tpl | 1 - 3 files changed, 109 insertions(+), 108 deletions(-) delete mode 100644 wcfsetup/install/files/acp/js/WCF.ACP.User.js diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.User.js b/wcfsetup/install/files/acp/js/WCF.ACP.User.js deleted file mode 100644 index 7f597c6963..0000000000 --- a/wcfsetup/install/files/acp/js/WCF.ACP.User.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Generic implementation to enable users. - */ -WCF.ACP.User.EnableHandler = { - /** - * action proxy - * @var WCF.Action.Proxy - */ - _proxy: null, - - /** - * Initializes WCF.ACP.User.EnableHandler on first use. - */ - init: function() { - this._proxy = new WCF.Action.Proxy({ - success: $.proxy(this._success, this) - }); - - $('.jsEnableButton').click($.proxy(function(event) { - var $button = $(event.currentTarget); - if ($button.data('enabled')) { - this.disable([ $button.data('objectID') ]); - } - else { - this.enable([ $button.data('objectID') ]); - } - }, this)); - - // bind listener - $('.jsClipboardEditor').each($.proxy(function(index, container) { - var $container = $(container); - var $types = eval($container.data('types')); - if (WCF.inArray('com.woltlab.wcf.user', $types)) { - $container.on('clipboardAction', $.proxy(this._execute, this)); - return false; - } - }, this)); - }, - - /** - * Handles clipboard actions. - * - * @param object event - * @param string type - * @param string actionName - * @param object parameters - */ - _execute: function(event, type, actionName, parameters) { - if (actionName == 'com.woltlab.wcf.user.enable') { - this.enable(parameters.objectIDs); - } - }, - - /** - * Disables users. - * - * @param array userIDs - */ - disable: function(userIDs) { - this._proxy.setOption('data', { - actionName: 'disable', - className: 'wcf\\data\\user\\UserAction', - objectIDs: userIDs - }); - this._proxy.sendRequest(); - }, - - /** - * Enables users. - * - * @param array userIDs - */ - enable: function(userIDs) { - this._proxy.setOption('data', { - actionName: 'enable', - className: 'wcf\\data\\user\\UserAction', - objectIDs: userIDs - }); - this._proxy.sendRequest(); - }, - - /** - * Handles successful AJAX calls. - * - * @param object data - * @param string textStatus - * @param jQuery jqXHR - */ - _success: function(data, textStatus, jqXHR) { - $('.jsEnableButton').each(function(index, button) { - var $button = $(button); - if (WCF.inArray($button.data('objectID'), data.objectIDs)) { - if (data.actionName == 'disable') { - $button.data('enabled', false).data('tooltip', $button.data('enableMessage')).removeClass('icon-circle-blank').addClass('icon-off'); - } - else { - $button.data('enabled', true).data('tooltip', $button.data('disableMessage')).removeClass('icon-off').addClass('icon-circle-blank'); - } - } - }); - - var $notification = new WCF.System.Notification(); - $notification.show(); - - WCF.Clipboard.reload(); - } -}; diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index e508dde145..346d55c7b4 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -2018,3 +2018,112 @@ WCF.ACP.User.BanHandler = { WCF.Clipboard.reload(); } }; + +/** + * Generic implementation to enable users. + */ +WCF.ACP.User.EnableHandler = { + /** + * action proxy + * @var WCF.Action.Proxy + */ + _proxy: null, + + /** + * Initializes WCF.ACP.User.EnableHandler on first use. + */ + init: function() { + this._proxy = new WCF.Action.Proxy({ + success: $.proxy(this._success, this) + }); + + $('.jsEnableButton').click($.proxy(function(event) { + var $button = $(event.currentTarget); + if ($button.data('enabled')) { + this.disable([ $button.data('objectID') ]); + } + else { + this.enable([ $button.data('objectID') ]); + } + }, this)); + + // bind listener + $('.jsClipboardEditor').each($.proxy(function(index, container) { + var $container = $(container); + var $types = eval($container.data('types')); + if (WCF.inArray('com.woltlab.wcf.user', $types)) { + $container.on('clipboardAction', $.proxy(this._execute, this)); + return false; + } + }, this)); + }, + + /** + * Handles clipboard actions. + * + * @param object event + * @param string type + * @param string actionName + * @param object parameters + */ + _execute: function(event, type, actionName, parameters) { + if (actionName == 'com.woltlab.wcf.user.enable') { + this.enable(parameters.objectIDs); + } + }, + + /** + * Disables users. + * + * @param array userIDs + */ + disable: function(userIDs) { + this._proxy.setOption('data', { + actionName: 'disable', + className: 'wcf\\data\\user\\UserAction', + objectIDs: userIDs + }); + this._proxy.sendRequest(); + }, + + /** + * Enables users. + * + * @param array userIDs + */ + enable: function(userIDs) { + this._proxy.setOption('data', { + actionName: 'enable', + className: 'wcf\\data\\user\\UserAction', + objectIDs: userIDs + }); + this._proxy.sendRequest(); + }, + + /** + * Handles successful AJAX calls. + * + * @param object data + * @param string textStatus + * @param jQuery jqXHR + */ + _success: function(data, textStatus, jqXHR) { + $('.jsEnableButton').each(function(index, button) { + var $button = $(button); + if (WCF.inArray($button.data('objectID'), data.objectIDs)) { + if (data.actionName == 'disable') { + $button.data('enabled', false).data('tooltip', $button.data('enableMessage')).removeClass('icon-circle-blank').addClass('icon-off'); + } + else { + $button.data('enabled', true).data('tooltip', $button.data('disableMessage')).removeClass('icon-off').addClass('icon-circle-blank'); + } + } + }); + + var $notification = new WCF.System.Notification(); + $notification.show(); + + WCF.Clipboard.reload(); + } +}; + diff --git a/wcfsetup/install/files/acp/templates/userList.tpl b/wcfsetup/install/files/acp/templates/userList.tpl index 06807f0a78..ad4ca8ac9e 100644 --- a/wcfsetup/install/files/acp/templates/userList.tpl +++ b/wcfsetup/install/files/acp/templates/userList.tpl @@ -7,7 +7,6 @@ {include file='header'} {event name='javascriptInclude'} -