Updating minified JavaScript files
authorwoltlab.com <woltlab@woltlab.com>
Thu, 29 Sep 2016 07:46:34 +0000 (09:46 +0200)
committerwoltlab.com <woltlab@woltlab.com>
Thu, 29 Sep 2016 07:46:34 +0000 (09:46 +0200)
wcfsetup/install/files/js/WCF.Combined.min.js

index 1b71f28261f19d9d376cbfca7e314f6204f9aa95..2b906092b6f92401691c70b8e5db6ad0a366644e 100755 (executable)
@@ -109,8 +109,8 @@ forceInsert:"saveQuote"===e.actionName?!0:!1,quote:e.returnValues.renderedQuote}
 (function (window, undefined) {"use strict";WCF.Tagging={},WCF.Tagging.TagList=WCF.EditableItemList.extend({_className:"wcf\\data\\tag\\TagAction",_maxLength:0,init:function(t,a,i){this._allowCustomInput=!0,this._maxLength=i,this._super(t,a),this._data=[],this._search=new WCF.Tagging.TagSearch(this._searchInput,$.proxy(this.addItem,this)),this._itemList.addClass("tagList"),$(t).data("__api",this)},_keyDown:function(t){if(this._super(t)){if(null===t)return!0;var a=t.which;return 8===a||27===a||13===a||46===a?!0:a>36&&41>a?!0:this._searchInput.val().length>=this._maxLength?!1:!0}return!1},_submit:function(){this._super();for(var t=0,a=this._data.length;a>t;t++)this._data[t]&&$('<input type="hidden" name="tags[]" />').val(this._data[t]).appendTo(this._form)},addItem:function(t){if(!t.objectID&&t.label.length>this._maxLength&&(t.label=t.label.substr(0,this._maxLength)),WCF.inArray(t.label,this._data))return!0;var a=$('<li class="badge tag">'+WCF.String.escapeHTML(t.label)+"</li>").data("objectID",t.objectID).data("label",t.label).appendTo(this._itemList);return a.click($.proxy(this._click,this)),this._search&&this._search.addExcludedSearchValue(t.label),this._addItem(t.objectID,t.label),!0},_addItem:function(t,a){this._data.push(a)},clearList:function(){this._super(),this._data=[]},getTags:function(){return this._data},_removeItem:function(t,a){for(var i=0,e=this._data.length;e>i;i++)if(this._data[i]===a)return void this._data.splice(i,1)},load:function(t){if(t&&t.length)for(var a=0,i=t.length;i>a;a++)this.addItem({objectID:0,label:WCF.String.unescapeHTML(t[a])})}}),WCF.Tagging.TagSearch=WCF.Search.Base.extend({_className:"wcf\\data\\tag\\TagAction",init:function(t,a,i,e){this._super(t,a,i,e,!1)}}); })(this);
 
 // WCF.User.js
-(function (window, undefined) {"use strict";WCF.User.Login=Class.extend({_loginSubmitButton:null,_password:null,_passwordContainer:null,_useCookies:null,_useCookiesContainer:null,init:function(t){this._loginSubmitButton=$("#loginSubmitButton"),this._password=$("#password"),this._passwordContainer=this._password.parents("dl"),this._useCookies=$("#useCookies"),this._useCookiesContainer=this._useCookies.parents("dl");var e=$("#loginForm");e.find("input[name=action]").change($.proxy(this._change,this)),t&&WCF.User.QuickLogin.init()},_change:function(t){"register"===$(t.currentTarget).val()?this._setState(!1,WCF.Language.get("wcf.user.button.register")):this._setState(!0,WCF.Language.get("wcf.user.button.login"))},_setState:function(t,e){t?(this._password.enable(),this._passwordContainer.removeClass("disabled"),this._useCookies.enable(),this._useCookiesContainer.removeClass("disabled")):(this._password.disable(),this._passwordContainer.addClass("disabled"),this._useCookies.disable(),this._useCookiesContainer.addClass("disabled")),this._loginSubmitButton.val(e)}}),WCF.User.Panel={},WCF.User.Panel.Abstract=Class.extend({_badge:null,_dropdown:null,_identifier:"",_loadData:!0,_markAllAsReadLink:null,_options:{},_proxy:null,_triggerElement:null,init:function(t,e,i){if(this._dropdown=null,this._loadData=!0,this._identifier=e,this._triggerElement=t,this._options=i,this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._triggerElement.click($.proxy(this.toggle,this)),this._options.showAllLink&&this._triggerElement.dblclick($.proxy(this._dblClick,this)),this._options.staticDropdown===!0)this._loadData=!1;else{var s=this._triggerElement.find("span.badge");s.length&&(this._badge=s)}},toggle:function(t){if(t.preventDefault(),null===this._dropdown&&(this._dropdown=this._initDropdown()),this._dropdown.toggle()){if(!this._loadData&&null!==this._badge){var e=parseInt(this._badge.text())||0;e&&!this._dropdown.getItemList().children(".interactiveDropdownItemOutstanding").length&&(this._loadData=!0)}this._loadData&&(this._loadData=!1,this._load())}return!1},_dblClick:function(t){return t.preventDefault(),window.location=this._options.showAllLink,!1},_initDropdown:function(){var t=WCF.Dropdown.Interactive.Handler.create(this._triggerElement,this._identifier,this._options);return $('<li class="loading"><span class="icon icon24 fa-spinner" /> <span>'+WCF.Language.get("wcf.global.loading")+"</span></li>").appendTo(t.getItemList()),t},_load:function(){},_success:function(t){if(void 0!==t.returnValues.template){var e=this._dropdown.getItemList().empty();if($(t.returnValues.template).appendTo(e),e.children().length||$('<li class="noItems">'+this._options.noItems+"</li>").appendTo(e),this._options.enableMarkAsRead){var i=this._dropdown.getItemList().children(".interactiveDropdownItemOutstanding");if(null===this._markAllAsReadLink&&i.length&&this._options.markAllAsReadConfirmMessage){var s=this._markAllAsReadLink=$('<li class="interactiveDropdownItemMarkAllAsRead"><a href="#" title="'+WCF.Language.get("wcf.user.panel.markAllAsRead")+'" class="jsTooltip"><span class="icon icon16 fa-check" /></a></li>').appendTo(this._dropdown.getLinkList());s.click(function(){return this._dropdown.close(),WCF.System.Confirmation.show(this._options.markAllAsReadConfirmMessage,function(t){"confirm"===t&&this._markAllAsRead()}.bind(this)),!1}.bind(this))}i.each(function(t,e){var i=$(e).addClass("interactiveDropdownItemOutstandingIcon"),s=i.data("objectID"),a=$('<div class="interactiveDropdownItemMarkAsRead"><a href="#" title="'+WCF.Language.get("wcf.user.panel.markAsRead")+'" class="jsTooltip"><span class="icon icon16 fa-check" /></a></div>').appendTo(i);a.click(function(t){return this._markAsRead(t,s),!1}.bind(this))}.bind(this))}this._dropdown.getItemList().children().each(function(t,e){var i=$(e),s=i.data("link");s&&($.browser.msie?i.click(function(t){return"A"!==t.target.tagName?(window.location=s,!1):void 0}):(i.addClass("interactiveDropdownItemShadow"),$('<a href="'+s+'" class="interactiveDropdownItemShadowLink" />').appendTo(i)),i.data("linkReplaceAll")&&i.find("> .box32 a:not(.userLink)").prop("href",s))}),this._dropdown.rebuildScrollbar()}if(void 0!==t.returnValues.totalCount&&this.updateBadge(t.returnValues.totalCount),this._options.enableMarkAsRead)if(t.returnValues.markAsRead){var a=this._dropdown.getItemList().children("li[data-object-id="+t.returnValues.markAsRead+"]");a.length&&(a.removeClass("interactiveDropdownItemOutstanding").data("isRead",!0),a.children(".interactiveDropdownItemMarkAsRead").remove())}else t.returnValues.markAllAsRead&&(this.resetItems(),this.updateBadge(0))},_markAsRead:function(){},_markAllAsRead:function(){},updateBadge:function(t){t=parseInt(t)||0,t?(null===this._badge&&(this._badge=$('<span class="badge badgeInverse" />').appendTo(this._triggerElement.children("a")),this._badge.before(" ")),this._badge.text(t)):null!==this._badge&&(this._badge.remove(),this._badge=null),this._options.enableMarkAsRead&&(t||null===this._markAllAsReadLink||(this._markAllAsReadLink.remove(),this._markAllAsReadLink=null))},resetItems:function(){null!==this._dropdown&&this._dropdown.resetItems()}}),WCF.User.Panel.Notification=WCF.User.Panel.Abstract.extend({_favico:null,init:function(t){t.enableMarkAsRead=!0,this._super($("#userNotifications"),"userNotifications",t);try{if(this._favico=new Favico({animation:"none",type:"circle"}),null!==this._badge){var e=parseInt(this._badge.text())||0;this._favico.badge(e)}}catch(t){console.debug("[WCF.User.Panel.Notification] Failed to initialized Favico: "+t.message)}WCF.System.PushNotification.addCallback("userNotificationCount",$.proxy(this.updateUserNotificationCount,this))},_initDropdown:function(){var t=this._super();return $('<li><a href="'+this._options.settingsLink+'" title="'+WCF.Language.get("wcf.user.panel.settings")+'" class="jsTooltip"><span class="icon icon16 fa-cog" /></a></li>').appendTo(t.getLinkList()),t},_load:function(){this._proxy.setOption("data",{actionName:"getOutstandingNotifications",className:"wcf\\data\\user\\notification\\UserNotificationAction"}),this._proxy.sendRequest()},_markAsRead:function(t,e){this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",objectIDs:[e]}),this._proxy.sendRequest()},_markAllAsRead:function(){this._proxy.setOption("data",{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"}),this._proxy.sendRequest()},resetItems:function(){this._super(),this._markAllAsReadLink&&(this._markAllAsReadLink.remove(),this._markAllAsReadLink=null)},updateBadge:function(t){t=parseInt(t)||0,null!==this._favico&&this._favico.badge(t),this._super(t)},updateUserNotificationCount:function(t){null!==this._dropdown&&this._dropdown.resetItems(),this.updateBadge(t)}}),WCF.User.Panel.UserMenu=WCF.User.Panel.Abstract.extend({init:function(){this._super($("#userMenu"),"userMenu",{pointerOffset:"13px",staticDropdown:!0})}}),WCF.User.QuickLogin={_dialog:null,_loginMessage:null,init:function(){$(".loginLink").click($.proxy(this._render,this)),$("#loginForm input[name=url]").val(function(t,e){return window.location.protocol+"//"+window.location.host+e})},show:function(t){t?(null===this._loginMessage&&(this._loginMessage=$('<p class="info" />').hide().prependTo($("#loginForm > form"))),this._loginMessage.show().text(t)):null!==this._loginMessage&&this._loginMessage.hide(),this._render()},_render:function(t){void 0!==t&&t.preventDefault(),null===this._dialog?(this._dialog=$("#loginForm").wcfDialog({title:WCF.Language.get("wcf.user.login")}),this._dialog.find("#username").focus()):this._dialog.wcfDialog("open")}},WCF.User.Profile={},WCF.User.Profile.ActivityPointList={_cache:{},_dialog:null,_didInit:!1,_proxy:null,init:function(){this._didInit||(this._cache={},this._dialog=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._init(),WCF.DOMNodeInsertedHandler.addCallback("WCF.User.Profile.ActivityPointList",$.proxy(this._init,this)),this._didInit=!0)},_init:function(){$(".activityPointsDisplay").removeClass("activityPointsDisplay").click($.proxy(this._click,this))},_click:function(t){t.preventDefault();var e=$(t.currentTarget).data("userID");void 0===this._cache[e]?(this._proxy.setOption("data",{actionName:"getDetailedActivityPointList",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]}),this._proxy.sendRequest()):this._show(e)},_show:function(t){null===this._dialog?(this._dialog=$("<div>"+this._cache[t]+"</div>").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.activityPoint")})):(this._dialog.html(this._cache[t]),this._dialog.wcfDialog("open"))},_success:function(t){this._cache[t.returnValues.userID]=t.returnValues.template,this._show(t.returnValues.userID)}},WCF.User.Profile.Follow=Class.extend({_button:null,_following:!1,_proxy:null,_userID:0,init:function(t,e){this._following=e,this._userID=t,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._createButton(),this._showButton()},_createButton:function(){this._button=$('<li id="followUser"><a href="#" class="button jsTooltip" title="'+WCF.Language.get("wcf.user.button."+(this._following?"un":"")+"follow")+'"><span class="icon icon16 icon-plus"></span> <span class="invisible">'+WCF.Language.get("wcf.user.button."+(this._following?"un":"")+"follow")+"</span></a></li>").prependTo($("#profileButtonContainer")),this._button.click($.proxy(this._execute,this))},_execute:function(t){t.preventDefault();var e=this._following?"unfollow":"follow";this._proxy.setOption("data",{actionName:e,className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}}),this._proxy.sendRequest()},_showButton:function(){this._following?this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button.unfollow")).addClass("active").children(".icon").removeClass("icon-plus").addClass("icon-minus"):this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button.follow")).removeClass("active").children(".icon").removeClass("icon-minus").addClass("icon-plus")},_success:function(t){this._following=t.returnValues.following,this._showButton();var e=new WCF.System.Notification;e.show()}}),WCF.User.Profile.IgnoreUser=Class.extend({_button:null,_isIgnoredUser:!1,_proxy:null,_userID:0,init:function(t,e){this._userID=t,this._isIgnoredUser=e,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._updateButton(),this._button.click($.proxy(this._click,this))},_click:function(t){t.preventDefault();var e=this._isIgnoredUser?"unignore":"ignore";this._proxy.setOption("data",{actionName:e,className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._isIgnoredUser=t.returnValues.isIgnoredUser,this._updateButton();var e=new WCF.System.Notification;e.show()},_updateButton:function(){null===this._button&&(this._button=$('<li id="ignoreUser"><a href="#" class="button jsTooltip" title="'+WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")+'"><span class="icon icon16 icon-ban-circle"></span> <span class="invisible">'+WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")+"</span></a></li>").prependTo($("#profileButtonContainer"))),this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")),this._isIgnoredUser?this._button.find(".button").addClass("active").children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank"):this._button.find(".button").removeClass("active").children(".icon").removeClass("icon-circle-blank").addClass("icon-ban-circle")}}),WCF.User.Profile.TabMenu=Class.extend({_hasContent:{},_profileContent:null,_proxy:null,_userID:0,init:function(t){this._profileContent=$("#profileContent"),this._userID=t;var e=this._profileContent.data("active"),i=!1;this._profileContent.find("div.tabMenuContent").each($.proxy(function(t,s){var a=$(s).wcfIdentify();e===a?this._hasContent[a]=!0:(this._hasContent[a]=!1,i=!0)},this)),i&&(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._profileContent.on("wcftabsbeforeactivate",$.proxy(this._loadContent,this)),this._profileContent.find("> nav.tabMenu > ul > li").each($.proxy(function(t,e){var i=$(e);return i.hasClass("ui-state-active")?(t&&this._loadContent(null,{newPanel:$("#"+i.attr("aria-controls"))}),!1):void 0},this)))},_loadContent:function(t,e){var i=$(e.newPanel),s=i.attr("id");this._hasContent[s]||(this._proxy.setOption("data",{actionName:"getContent",className:"wcf\\data\\user\\profile\\menu\\item\\UserProfileMenuItemAction",parameters:{data:{containerID:s,menuItem:i.data("menuItem"),userID:this._userID}}}),this._proxy.sendRequest())},_success:function(t){var e=t.returnValues.containerID;this._hasContent[e]=!0;var i=this._profileContent.find("#"+e);$("<div>"+t.returnValues.template+"</div>").hide().appendTo(i),i.children("div").wcfBlindIn()}}),WCF.User.Profile.Editor=Class.extend({_actionName:"",_buttons:{},_cachedTemplate:"",_proxy:null,_tab:null,_userID:0,init:function(t,e){this._actionName="",this._cachedTemplate="",this._tab=$("#about"),this._userID=t,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initButtons(),e&&this._beginEdit()},_initButtons:function(){var t=$("#profileButtonContainer");this._buttons={beginEdit:$('<li><a class="button"><span class="icon icon16 icon-pencil" /> <span>'+WCF.Language.get("wcf.user.editProfile")+"</span></a></li>").click($.proxy(this._beginEdit,this)).appendTo(t)}},_beginEdit:function(){this._actionName="beginEdit",this._buttons.beginEdit.hide(),$("#profileContent").wcfTabs("select","about"),this._proxy.setOption("data",{actionName:"beginEdit",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[this._userID]}),this._proxy.sendRequest()},_save:function(){this._actionName="save";var t=/values\[([a-zA-Z0-9._-]+)\]/,e={};this._tab.find("input, textarea, select").each(function(i,s){var a=$(s),n=null;switch(a.getTagName()){case"input":var o=a.attr("type");if(("radio"===o||"checkbox"===o)&&!a.prop("checked"))return;break;case"textarea":a.data("redactor")&&(n=a.redactor("wutil.getText"))}var r=a.attr("name");if(t.test(r)){var l=RegExp.$1;null===n&&(n=a.val()),"checkbox"===a.attr("type")&&/\[\]$/.test(r)?(Array.isArray(e[l])||(e[l]=[]),e[l].push(n)):e[l]=n}}),this._proxy.setOption("data",{actionName:"save",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[this._userID],parameters:{values:e}}),this._proxy.sendRequest()},_restore:function(){this._actionName="restore",this._buttons.beginEdit.show(),this._destroyEditor(),this._tab.html(this._cachedTemplate).children().css({height:"auto"})},_success:function(t){switch(this._actionName){case"beginEdit":this._prepareEdit(t);break;case"save":t.returnValues.success?(this._cachedTemplate=t.returnValues.template,this._restore()):this._prepareEdit(t,!0)}},_prepareEdit:function(t,e){this._destroyEditor();var i=this;this._tab.html(function(s,a){return e!==!0&&(i._cachedTemplate=a),t.returnValues.template}),this._tab.find("input[type=text]").attr("autocomplete","off"),this._tab.find(".formSubmit > button[data-type=save]").click($.proxy(this._save,this)),this._tab.find(".formSubmit > button[data-type=restore]").click($.proxy(this._restore,this)),this._tab.find("input").keyup(function(t){return t.which===$.ui.keyCode.ENTER?(i._save(),t.preventDefault(),!1):void 0})},_destroyEditor:function(){this._tab.find("textarea").each(function(t,e){var i=$(e);i.data("redactor")&&i.redactor("core.destroy")})}}),WCF.User.Registration={},WCF.User.Registration.Validation=Class.extend({_actionName:"",_className:"",_confirmElement:null,_element:null,_errorMessages:{},_options:{},_proxy:null,init:function(t,e,i){this._element=t,this._element.blur($.proxy(this._blur,this)),this._confirmElement=e||null,null!==this._confirmElement&&this._confirmElement.blur($.proxy(this._blurConfirm,this)),i=i||{},this._setOptions(i),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),showLoadingOverlay:!1}),this._setErrorMessages()},_setOptions:function(){},_setErrorMessages:function(){this._errorMessages={ajaxError:"",notEqual:""}},_blur:function(){var t=this._element.val();if(!t)return this._showError(this._element,WCF.Language.get("wcf.global.form.error.empty"));if(null!==this._confirmElement){var e=this._confirmElement.val();if(""!=e&&t!=e)return this._showError(this._confirmElement,this._errorMessages.notEqual)}this._validateOptions()&&(this._proxy.setOption("data",{actionName:this._actionName,className:this._className,parameters:this._getParameters()}),this._proxy.sendRequest())},_getParameters:function(){return{}},_validateOptions:function(){return!0},_blurConfirm:function(t){var e=this._confirmElement.val();return e?void this._blur(t):this._showError(this._confirmElement,WCF.Language.get("wcf.global.form.error.empty"))},_success:function(t){t.returnValues.isValid?(this._showSuccess(this._element),null!==this._confirmElement&&this._confirmElement.val()&&this._showSuccess(this._confirmElement)):this._showError(this._element,WCF.Language.get(this._errorMessages.ajaxError+t.returnValues.error))},_showError:function(t,e){t.parent().parent().addClass("formError").removeClass("formSuccess");var i=t.parent().find("small.innerError");i.length||(i=$("<small />").addClass("innerError").insertAfter(t)),i.text(e)},_showSuccess:function(t){t.parent().parent().addClass("formSuccess").removeClass("formError"),t.next("small.innerError").remove()}}),WCF.User.Registration.Validation.Username=WCF.User.Registration.Validation.extend({_actionName:"validateUsername",_className:"wcf\\data\\user\\UserRegistrationAction",_setOptions:function(t){this._options=$.extend(!0,{minlength:3,maxlength:25},t)},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.username.error."}},_validateOptions:function(){var t=this._element.val();return t.length<this._options.minlength||t.length>this._options.maxlength?(this._showError(this._element,WCF.Language.get("wcf.user.username.error.notValid")),!1):!0},_getParameters:function(){return{username:this._element.val()}}}),WCF.User.Registration.Validation.EmailAddress=WCF.User.Registration.Validation.extend({_actionName:"validateEmailAddress",_className:"wcf\\data\\user\\UserRegistrationAction",_getParameters:function(){return{email:this._element.val()}},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.email.error.",notEqual:WCF.Language.get("wcf.user.confirmEmail.error.notEqual")}}}),WCF.User.Registration.Validation.Password=WCF.User.Registration.Validation.extend({_actionName:"validatePassword",_className:"wcf\\data\\user\\UserRegistrationAction",_getParameters:function(){return{password:this._element.val()}},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.password.error.",notEqual:WCF.Language.get("wcf.user.confirmPassword.error.notEqual")}}}),WCF.User.Registration.LostPassword=Class.extend({_email:null,_username:null,init:function(){this._email=$("#emailInput"),this._username=$("#usernameInput"),this._email.keyup($.proxy(this._checkEmail,this)),this._username.keyup($.proxy(this._checkUsername,this)),$.browser.mozilla&&$.browser.touch&&(this._email.on("input",$.proxy(this._checkEmail,this)),this._username.on("input",$.proxy(this._checkUsername,this))),this._checkEmail(),this._checkUsername()},_checkEmail:function(){""==this._email.val()?(this._username.enable(),this._username.parents("dl:eq(0)").removeClass("disabled")):(this._username.disable(),this._username.parents("dl:eq(0)").addClass("disabled"))},_checkUsername:function(){""==this._username.val()?(this._email.enable(),this._email.parents("dl:eq(0)").removeClass("disabled")):(this._email.disable(),this._email.parents("dl:eq(0)").addClass("disabled"))}}),WCF.Notification={},WCF.Notification.List=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(".contentNavigation .jsMarkAllAsConfirmed").click(function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.user.notification.markAllAsConfirmed.confirmMessage"),function(t){"confirm"===t&&new WCF.Action.Proxy({autoSend:!0,data:{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"},success:function(){window.location.reload()}})})}),this._convertList()},_convertList:function(){$(".userNotificationItemList > .notificationItem").each(function(t,e){var i=$(e);if(!i.data("isRead")){i.find("a:not(.userLink)").prop("href",i.data("link"));var s=$('<a href="#" class="icon icon24 fa-check notificationItemMarkAsConfirmed jsTooltip" title="'+WCF.Language.get("wcf.user.notification.markAsConfirmed")+'" />').appendTo(i);s.click($.proxy(this._markAsConfirmed,this))}i.find("a:not(.notificationItemMarkAsConfirmed)").length||i.find(".details > p:eq(0)").html(function(t,e){return'<a href="'+i.data("link")+'">'+e+"</a>"})}.bind(this)),WCF.DOMNodeInsertedHandler.execute()},_markAsConfirmed:function(t){t.preventDefault();var e=$(t.currentTarget).parents(".notificationItem:eq(0)").data("objectID");return this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",objectIDs:[e]}),this._proxy.sendRequest(),!1},_success:function(t){var e=$(".userNotificationItemList > .notificationItem[data-object-id="+t.returnValues.markAsRead+"]");e.data("isRead",!0),e.find(".newContentBadge").remove(),e.find(".notificationItemMarkAsConfirmed").remove(),e.removeClass("notificationUnconfirmed")}}),WCF.User.SignaturePreview=WCF.Message.Preview.extend({_handleResponse:function(t){var e=$("#previewContainer");e.length||(e=$('<fieldset id="previewContainer"><legend>'+WCF.Language.get("wcf.global.preview")+"</legend><div></div></fieldset>").insertBefore($("#signatureContainer")).wcfFadeIn()),e.children("div").first().html(t.returnValues.message)}}),WCF.User.RecentActivityLoader=Class.extend({_container:null,_filteredByFollowedUsers:!1,_loadButton:null,_proxy:null,_userID:0,init:function(t,e){return this._container=$("#recentActivities"),this._filteredByFollowedUsers=e===!0,this._userID=t,null===this._userID||this._userID?(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._container.children("li").length?(this._loadButton=$('<li class="recentActivitiesMore showMore"><button class="small">'+WCF.Language.get("wcf.user.recentActivity.more")+"</button></li>").appendTo(this._container),this._loadButton=this._loadButton.children("button").click($.proxy(this._click,this))):$('<li class="recentActivitiesMore showMore"><small>'+WCF.Language.get("wcf.user.recentActivity.noMoreEntries")+"</small></li>").appendTo(this._container),void(WCF.User.userID&&$(".jsRecentActivitySwitchContext .button").click($.proxy(this._switchContext,this)))):void console.debug("[WCF.User.RecentActivityLoader] Invalid parameter 'userID' given.")},_click:function(){this._loadButton.enable();var t={lastEventID:this._container.data("lastEventID"),lastEventTime:this._container.data("lastEventTime")};this._userID?t.userID=this._userID:this._filteredByFollowedUsers&&(t.filteredByFollowedUsers=1),this._proxy.setOption("data",{actionName:"load",className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction",parameters:t}),this._proxy.sendRequest()},_switchContext:function(t){t.preventDefault(),$(t.currentTarget).hasClass("active")||new WCF.Action.Proxy({autoSend:!0,data:{actionName:"switchContext",className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction"},success:function(){window.location.hash="#dashboardBoxRecentActivity",window.location.reload()}})},_success:function(t){t.returnValues.template?($(t.returnValues.template).insertBefore(this._loadButton.parent()),this._container.data("lastEventTime",t.returnValues.lastEventTime),this._container.data("lastEventID",t.returnValues.lastEventID),this._loadButton.enable()):($("<small>"+WCF.Language.get("wcf.user.recentActivity.noMoreEntries")+"</small>").appendTo(this._loadButton.parent()),this._loadButton.remove())}}),WCF.User.LikeLoader=Class.extend({_container:null,_likeType:"received",_likeValue:1,_loadButton:null,_noMoreEntries:null,_proxy:null,_userID:0,init:function(t){if(this._container=$("#likeList"),this._userID=t,!this._userID)return void console.debug("[WCF.User.RecentActivityLoader] Invalid parameter 'userID' given.");this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});var e=$('<li class="likeListMore recentActivitiesMore showMore"><button class="small">'+WCF.Language.get("wcf.like.likes.more")+"</button><small>"+WCF.Language.get("wcf.like.likes.noMoreEntries")+"</small></li>").appendTo(this._container);this._loadButton=e.children("button").click($.proxy(this._click,this)),this._noMoreEntries=e.children("small").hide(),2==this._container.find("> li").length&&(this._loadButton.hide(),this._noMoreEntries.show()),$("#likeType .button").click($.proxy(this._clickLikeType,this)),$("#likeValue .button").click($.proxy(this._clickLikeValue,this))},_clickLikeType:function(t){var e=$(t.currentTarget);this._likeType!=e.data("likeType")&&(this._likeType=e.data("likeType"),$("#likeType .button").removeClass("active"),e.addClass("active"),this._reload())},_clickLikeValue:function(t){var e=$(t.currentTarget);this._likeValue!=e.data("likeValue")&&(this._likeValue=e.data("likeValue"),$("#likeValue .button").removeClass("active"),e.addClass("active"),$("#likeType > li:first-child > .button").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likesReceived")),$("#likeType > li:last-child > .button").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likesGiven")),this._container.find("> li.likeListMore button").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likes.more")),this._container.find("> li.likeListMore small").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likes.noMoreEntries")),this._reload())},_reload:function(){this._container.find("> li:not(:first-child):not(:last-child)").remove(),this._container.data("lastLikeTime",0),this._click()},_click:function(){this._loadButton.enable();var t={lastLikeTime:this._container.data("lastLikeTime"),userID:this._userID,likeType:this._likeType,likeValue:this._likeValue};this._proxy.setOption("data",{actionName:"load",className:"wcf\\data\\like\\LikeAction",parameters:t}),this._proxy.sendRequest()},_success:function(t){t.returnValues.template?($(t.returnValues.template).insertBefore(this._loadButton.parent()),this._container.data("lastLikeTime",t.returnValues.lastLikeTime),this._noMoreEntries.hide(),this._loadButton.show().enable()):(this._noMoreEntries.show(),this._loadButton.hide())}}),WCF.User.ProfilePreview=WCF.Popover.extend({_proxy:null,_userProfiles:{},init:function(){this._super(".userLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.System.ObjectStore.add("WCF.User.ProfilePreview",this)},_loadContent:function(){var t=$("#"+this._activeElementID),e=t.data("userID");if(this._userProfiles[e])this._insertContent(this._activeElementID,this._userProfiles[e],!0);else{this._proxy.setOption("data",{actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]});var i=this._activeElementID,s=this;this._proxy.setOption("success",function(t){s._userProfiles[e]=t.returnValues.template,s._insertContent(i,t.returnValues.template,!0)}),this._proxy.setOption("failure",function(t){return s._userProfiles[e]=t.message,s._insertContent(i,t.message,!0),!1}),this._proxy.sendRequest()}},purge:function(t){delete this._userProfiles[t],this._data={}}}),WCF.User.Action={},WCF.User.Action.Follow=Class.extend({_containerList:null,_followButtonSelector:".jsFollowButton",_userID:0,init:function(t,e){t.length&&(this._containerList=t,e&&(this._followButtonSelector=e),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._containerList.each($.proxy(function(t,e){$(e).find(this._followButtonSelector).click($.proxy(this._click,this))},this)))},_click:function(t){t.preventDefault();var e=$(t.target);e.is("a")||(e=e.closest("a")),this._userID=e.data("objectID"),this._proxy.setOption("data",{actionName:e.data("following")?"unfollow":"follow",className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._containerList.each($.proxy(function(e,i){var s=$(i).find(this._followButtonSelector).get(0);return s&&$(s).data("objectID")==this._userID?(s=$(s),t.returnValues.following?s.data("tooltip",WCF.Language.get("wcf.user.button.unfollow")).children(".icon").removeClass("icon-plus").addClass("icon-minus"):s.data("tooltip",WCF.Language.get("wcf.user.button.follow")).children(".icon").removeClass("icon-minus").addClass("icon-plus"),s.data("following",t.returnValues.following),!1):void 0},this));var e=new WCF.System.Notification;e.show();var i=this;WCF.System.ObjectStore.invoke("WCF.User.ProfilePreview",function(t){t.purge(i._userID)})}}),WCF.User.Action.Ignore=Class.extend({_containerList:null,_ignoreButtonSelector:".jsIgnoreButton",_userID:0,init:function(t,e){t.length&&(this._containerList=t,e&&(this._ignoreButtonSelector=e),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._containerList.each($.proxy(function(t,e){$(e).find(this._ignoreButtonSelector).click($.proxy(this._click,this))},this)))},_click:function(t){t.preventDefault();var e=$(t.target);e.is("a")||(e=e.closest("a")),this._userID=e.data("objectID"),this._proxy.setOption("data",{actionName:e.data("ignored")?"unignore":"ignore",className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._containerList.each($.proxy(function(e,i){var s=$(i).find(this._ignoreButtonSelector).get(0);return s&&$(s).data("objectID")==this._userID?(s=$(s),t.returnValues.isIgnoredUser?s.data("tooltip",WCF.Language.get("wcf.user.button.unignore")).children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank"):s.data("tooltip",WCF.Language.get("wcf.user.button.ignore")).children(".icon").removeClass("icon-circle-blank").addClass("icon-ban-circle"),s.data("ignored",t.returnValues.isIgnoredUser),!1):void 0},this));var e=new WCF.System.Notification;e.show();var i=this;WCF.System.ObjectStore.invoke("WCF.User.ProfilePreview",function(t){t.purge(i._userID)})}}),WCF.User.Avatar={},WCF.User.Avatar.Crop=Class.extend({_cropX:0,_cropY:0,_dialog:null,_proxy:null,MAX_THUMBNAIL_SIZE:128,init:function(t){this._avatarID=t,this._dialog&&this.destroy(),this._dialog=null,this._proxy||(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})),$(".userAvatarCrop").click($.proxy(this._showCropDialog,this))},destroy:function(){this._dialog.remove()},_crop:function(){this._proxy.setOption("data",{actionName:"cropAvatar",className:"wcf\\data\\user\\avatar\\UserAvatarAction",objectIDs:[this._avatarID],parameters:{cropX:this._cropX,cropY:this._cropY}}),this._proxy.sendRequest()},_getCropDialog:function(t){this._dialog||(this._dialog=$("<div />").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.avatar.type.custom.crop")})),this._dialog.html(t.returnValues.template),this._dialog.find('button[data-type="save"]').click($.proxy(this._crop,this)),this._cropX=t.returnValues.cropX,this._cropY=t.returnValues.cropY;var e=$("#userAvatarCropSelection > img");$("#userAvatarCropSelection").css({height:e.height()+"px",width:e.width()+"px"}),$("#userAvatarCropOverlaySelection").css({"background-image":"url("+e.attr("src")+")","background-position":-this._cropX+"px "+-this._cropY+"px",left:this._cropX+"px",top:this._cropY+"px"}).draggable({containment:"parent",drag:$.proxy(this._updateSelection,this),stop:$.proxy(this._updateSelection,this)
-}),this._dialog.find('button[data-type="save"]').click($.proxy(this._save,this)),this._dialog.wcfDialog("render")},_showCropDialog:function(){this._dialog?this._dialog.wcfDialog("open"):(this._proxy.setOption("data",{actionName:"getCropDialog",className:"wcf\\data\\user\\avatar\\UserAvatarAction",objectIDs:[this._avatarID]}),this._proxy.sendRequest())},_success:function(t){switch(t.actionName){case"getCropDialog":this._getCropDialog(t);break;case"cropAvatar":$("#avatarUpload > dt > img").replaceWith($('<img src="'+t.returnValues.url+'" alt="" class="userAvatarCrop jsTooltip" title="'+WCF.Language.get("wcf.user.avatar.type.custom.crop")+'" />').css({width:"96px",height:"96px"}).click($.proxy(this._showCropDialog,this))),WCF.DOMNodeInsertedHandler.execute(),this._dialog.wcfDialog("close");var e=new WCF.System.Notification;e.show()}},_updateSelection:function(t,e){this._cropX=e.position.left,this._cropY=e.position.top,$("#userAvatarCropOverlaySelection").css({"background-position":-e.position.left+"px "+-e.position.top+"px"})}}),WCF.User.Avatar.Upload=WCF.Upload.extend({_avatarCrop:null,_userID:0,init:function(t,e){this._super($("#avatarUpload > dd > div"),void 0,"wcf\\data\\user\\avatar\\UserAvatarAction"),this._userID=t||0,this._avatarCrop=e,$("#avatarForm input[type=radio]").change(function(){"custom"==$(this).val()?$("#avatarUpload > dd > div").show():$("#avatarUpload > dd > div").hide()}),$("#avatarForm input[type=radio][value=custom]:checked").length||$("#avatarUpload > dd > div").hide()},_initFile:function(){return $("#avatarUpload > dt > img")},_success:function(t,e){if(e.returnValues.url){this._updateImage(e.returnValues.url,e.returnValues.canCrop),e.returnValues.canCrop?this._avatarCrop?this._avatarCrop.init(e.returnValues.avatarID):this._avatarCrop=new WCF.User.Avatar.Crop(e.returnValues.avatarID):this._avatarCrop&&(this._avatarCrop.destroy(),this._avatarCrop=null),$("#avatarUpload > dd > .innerError").remove();var i=new WCF.System.Notification(WCF.Language.get("wcf.user.avatar.upload.success"));i.show()}else e.returnValues.errorType&&this._getInnerErrorElement().text(WCF.Language.get("wcf.user.avatar.upload.error."+e.returnValues.errorType))},_updateImage:function(t,e){$("#avatarUpload > dt > img").remove();var i=$('<img src="'+t+'" alt="" />').css({height:"auto","max-height":"96px","max-width":"96px",width:"auto"});e&&(i.addClass("userAvatarCrop").addClass("jsTooltip"),i.attr("title",WCF.Language.get("wcf.user.avatar.type.custom.crop"))),$("#avatarUpload > dt").prepend(i),WCF.DOMNodeInsertedHandler.execute()},_getInnerErrorElement:function(){var t=$("#avatarUpload > dd > .innerError");return t.length||(t=$('<small class="innerError"></span>'),$("#avatarUpload > dd").append(t)),t},_getParameters:function(){return{userID:this._userID}}}),WCF.User.List=Class.extend({_additionalParameters:{},_cache:{},_className:"",_dialog:null,_dialogTitle:"",_pageCount:0,_pageNo:1,_proxy:null,init:function(t,e,i){this._additionalParameters=i||{},this._cache={},this._className=t,this._dialog=null,this._dialogTitle=e,this._pageCount=0,this._pageNo=1,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},open:function(){this._pageNo=1,this._showPage()},_showPage:function(t,e){if(e&&e.activePage&&(this._pageNo=e.activePage),0!=this._pageCount&&(this._pageNo<1||this._pageNo>this._pageCount))return void console.debug("[WCF.User.List] Cannot access page "+this._pageNo+" of "+this._pageCount);if(this._cache[this._pageNo]){var i=!1;null===this._dialog&&(this._dialog=$('<div id="userList'+this._className.hashCode()+'" />').hide().appendTo(document.body),i=!0),this._dialog.empty(),this._dialog.html(this._cache[this._pageNo]),this._pageCount>1&&this._dialog.find(".jsPagination").wcfPages({activePage:this._pageNo,maxPage:this._pageCount}).on("wcfpagesswitched",$.proxy(this._showPage,this)),i?this._dialog.wcfDialog({title:this._dialogTitle}):this._dialog.wcfDialog("open").wcfDialog("render"),WCF.DOMNodeInsertedHandler.execute()}else this._additionalParameters.pageNo=this._pageNo,this._proxy.setOption("data",{actionName:"getGroupedUserList",className:this._className,interfaceName:"wcf\\data\\IGroupedUserListAction",parameters:this._additionalParameters}),this._proxy.sendRequest()},_success:function(t){t.returnValues.pageCount&&(this._pageCount=t.returnValues.pageCount),this._cache[this._pageNo]=t.returnValues.template,this._showPage()}}),WCF.User.ObjectWatch={},WCF.User.ObjectWatch.Subscribe=Class.extend({_buttonSelector:".jsSubscribeButton",_buttons:{},_dialog:null,_notification:null,_reloadOnUnsubscribe:!1,init:function(t){this._buttons={},this._notification=null,this._reloadOnUnsubscribe=t===!0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(this._buttonSelector).each($.proxy(function(t,e){var i=$(e),s=i.data("objectID");this._buttons[s]=i.click($.proxy(this._click,this))},this)),WCF.System.Event.addListener("com.woltlab.wcf.objectWatch","update",$.proxy(this._updateSubscriptionStatus,this))},_click:function(t){t.preventDefault();var e=$(t.currentTarget);this._proxy.setOption("data",{actionName:"manageSubscription",className:"wcf\\data\\user\\object\\watch\\UserObjectWatchAction",parameters:{objectID:e.data("objectID"),objectType:e.data("objectType")}}),this._proxy.sendRequest()},_success:function(t){if("manageSubscription"===t.actionName){null===this._dialog?(this._dialog=$("<div>"+t.returnValues.template+"</div>").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.objectWatch.manageSubscription")})):(this._dialog.html(t.returnValues.template),this._dialog.wcfDialog("open")),this._dialog.find(".formSubmit > .jsButtonSave").data("objectID",t.returnValues.objectID).click($.proxy(this._save,this));var e=this._dialog.find("input[name=enableNotification]").disable();this._dialog.find("input[name=subscribe]").change(function(t){var i=$(t.currentTarget);1==i.val()?e.enable():e.disable()});var i=this._dialog.find("input[name=subscribe]:checked");i.length&&1==i.val()&&e.enable()}else"saveSubscription"===t.actionName&&this._dialog.is(":visible")&&(this._dialog.wcfDialog("close"),this._updateSubscriptionStatus({isSubscribed:t.returnValues.subscribe,objectID:t.returnValues.objectID}),null===this._notification&&(this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))),this._notification.show())},_save:function(t){var e=this._buttons[$(t.currentTarget).data("objectID")],i=this._dialog.find("input[name=subscribe]:checked").val(),s=this._dialog.find("input[name=enableNotification]").is(":checked")?1:0;this._proxy.setOption("data",{actionName:"saveSubscription",className:"wcf\\data\\user\\object\\watch\\UserObjectWatchAction",parameters:{enableNotification:s,objectID:e.data("objectID"),objectType:e.data("objectType"),subscribe:i}}),this._proxy.sendRequest()},_updateSubscriptionStatus:function(t){var e=$(this._buttonSelector+"[data-object-id="+t.objectID+"]"),i=e.children(".icon");if(t.isSubscribed)i.removeClass("icon-bookmark-empty").addClass("icon-bookmark"),e.data("isSubscribed",!0);else if(i.removeClass("icon-bookmark").addClass("icon-bookmark-empty"),e.data("isSubscribed",!1),this._reloadOnUnsubscribe)return void window.location.reload();WCF.System.Event.fireEvent("com.woltlab.wcf.objectWatch","updatedSubscription",t)}}),WCF.User.InlineEditor=WCF.InlineEditor.extend({_additionalOptions:{},_dialog:null,_permissions:{},init:function(t){this._super(t),WCF.System.ObjectStore.add("WCF.User.InlineEditor",this)},_execute:function(t,e){if(!this._validate(t,e))return!1;var i={},s=$("#"+t);if(void 0!==this._additionalOptions[e])this._additionalOptions[e].callback(t);else switch(e){case"unban":case"enableAvatar":case"enableSignature":switch(e){case"unban":i.banned=0;break;case"enableAvatar":i.disableAvatar=0;break;case"enableSignature":i.disableSignature=0}this._proxy.setOption("data",{actionName:e,className:"wcf\\data\\user\\UserAction",objectIDs:[s.data("objectID")]}),this._proxy.sendRequest();break;case"ban":case"disableAvatar":case"disableSignature":"ban"==e?i.banned=1:i[e]=1,this._showReasonDialog(s.data("objectID"),e);break;case"advanced":window.location=this._getTriggerElement(s).attr("href")}$.getLength(i)&&this._updateData.push({data:i,elementID:t})},_executeReasonAction:function(){var t=this._dialog.data("optionName");this._dialog.find(".innerError").remove();var e="";if(!$("#"+t+"NeverExpires").is(":checked")&&(e=$("#"+t+"ExpiresDatePicker").val(),!e))return void this._dialog.find("#"+t+"ExpiresSettings > dd > small").prepend($('<small class="innerError" />').text(WCF.Language.get("wcf.global.form.error.empty")));var i={};i[t+"Reason"]=$("#"+t+"Reason").val(),i[t+"Expires"]=e,this._proxy.setOption("data",{actionName:t,className:"wcf\\data\\user\\UserAction",objectIDs:[this._dialog.data("userID")],parameters:i}),this._proxy.sendRequest()},_getPermission:function(t){return this._permissions[t]?this._permissions[t]:0},_getTriggerElement:function(t){return t.find(".jsUserInlineEditor")},_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.user.ban"),optionName:"ban"},{label:WCF.Language.get("wcf.user.unban"),optionName:"unban"},{label:WCF.Language.get("wcf.user.disableAvatar"),optionName:"disableAvatar"},{label:WCF.Language.get("wcf.user.enableAvatar"),optionName:"enableAvatar"},{label:WCF.Language.get("wcf.user.disableSignature"),optionName:"disableSignature"},{label:WCF.Language.get("wcf.user.enableSignature"),optionName:"enableSignature"}];for(var t in this._additionalOptions)this._options.push({label:this._additionalOptions[t].label,optionName:t});this._options.push({optionName:"divider"}),this._options.push({label:WCF.Language.get("wcf.user.edit"),optionName:"advanced"})},_show:function(t){var e=$(t.currentTarget),i=e.data("elementID");if(!this._dropdowns[i]){var s=e.next(".dropdownMenu");s&&(this._dropdowns[i]=s,WCF.Dropdown.initDropdown(this._getTriggerElement(this._elements[i]),!0))}return this._super(t)},_showReasonDialog:function(t,e){this._dialog&&this._dialog.remove(),this._dialog=$("<div />").hide().appendTo(document.body),this._dialog.append($('<fieldset><dl><dt><label for="'+e+'Reason">'+WCF.Language.get("wcf.global.reason")+'</label></dt><dd><textarea id="'+e+'Reason" cols="40" rows="3" />'+(WCF.Language.get("wcf.user."+e+".reason.description")!="wcf.user."+e+".reason.description"?"<small>"+WCF.Language.get("wcf.user."+e+".reason.description")+"</small>":"")+'</dd></dl><dl><dt></dt><dd><label for="'+e+'NeverExpires"><input type="checkbox" name="'+e+'NeverExpires" id="'+e+'NeverExpires" checked="checked" /> '+WCF.Language.get("wcf.user."+e+".neverExpires")+'</label></dd></dl><dl id="'+e+'ExpiresSettings" style="display: none;"><dt><label for="'+e+'Expires">'+WCF.Language.get("wcf.user."+e+".expires")+'</label></dt><dd><input type="date" name="'+e+'Expires" id="'+e+'Expires" class="medium" min="'+new Date(1e3*TIME_NOW).toISOString()+'" data-ignore-timezone="true" /><small>'+WCF.Language.get("wcf.user."+e+".expires.description")+"</small></dd></dl></fieldset>")),this._dialog.append($('<div class="formSubmit"><button class="buttonPrimary" accesskey="s">'+WCF.Language.get("wcf.global.button.submit")+"</button></div>")),this._dialog.data("optionName",e).data("userID",t),this._dialog.find("#"+e+"NeverExpires").change(function(){$("#"+e+"ExpiresSettings").toggle()}),this._dialog.find("button").click($.proxy(this._executeReasonAction,this)),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user."+e+".confirmMessage")})},_updateState:function(t){this._notification.show();for(var e=0,i=this._updateData.length;i>e;e++){var s=this._updateData[e],a=$("#"+s.elementID);for(var n in s.data)a.data(n,s.data[n])}("ban"==t.actionName||"disableAvatar"==t.actionName||"disableSignature"==t.actionName)&&this._dialog.wcfDialog("close"),"unban"==t.actionName&&$(".userHeadline .jsUserBanned").remove()},_validate:function(t,e){var i=$("#"+t);if(void 0!==this._additionalOptions[e])return!0;switch(e){case"ban":case"unban":return this._getPermission("canBanUser")?"ban"==e?!i.data("banned"):i.data("banned"):!1;case"disableAvatar":case"enableAvatar":return this._getPermission("canDisableAvatar")?"disableAvatar"==e?!i.data("disableAvatar"):i.data("disableAvatar"):!1;case"disableSignature":case"enableSignature":return this._getPermission("canDisableSignature")?"disableSignature"==e?!i.data("disableSignature"):i.data("disableSignature"):!1;case"advanced":return this._getPermission("canEditUser")}return!1},addOption:function(t,e,i){$.isFunction(i)||console.debug("[WCF.User.InlineEditor] Missing callback"),void 0!==this._additionalOptions[e]&&console.debug('[WCF.User.InlineEditor] Additional option with name "'+e+"' already exists"),this._additionalOptions[e]={callback:i,label:t},this._setOptions()},setPermission:function(t,e){this._permissions[t]=e},setPermissions:function(t){for(var e in t)this.setPermission(e,t[e])}}); })(this);
+(function (window, undefined) {"use strict";WCF.User.Login=Class.extend({_loginSubmitButton:null,_password:null,_passwordContainer:null,_useCookies:null,_useCookiesContainer:null,init:function(t){this._loginSubmitButton=$("#loginSubmitButton"),this._password=$("#password"),this._passwordContainer=this._password.parents("dl"),this._useCookies=$("#useCookies"),this._useCookiesContainer=this._useCookies.parents("dl");var e=$("#loginForm");e.find("input[name=action]").change($.proxy(this._change,this)),t&&WCF.User.QuickLogin.init()},_change:function(t){"register"===$(t.currentTarget).val()?this._setState(!1,WCF.Language.get("wcf.user.button.register")):this._setState(!0,WCF.Language.get("wcf.user.button.login"))},_setState:function(t,e){t?(this._password.enable(),this._passwordContainer.removeClass("disabled"),this._useCookies.enable(),this._useCookiesContainer.removeClass("disabled")):(this._password.disable(),this._passwordContainer.addClass("disabled"),this._useCookies.disable(),this._useCookiesContainer.addClass("disabled")),this._loginSubmitButton.val(e)}}),WCF.User.Panel={},WCF.User.Panel.Abstract=Class.extend({_badge:null,_dropdown:null,_identifier:"",_loadData:!0,_markAllAsReadLink:null,_options:{},_proxy:null,_triggerElement:null,init:function(t,e,i){if(this._dropdown=null,this._loadData=!0,this._identifier=e,this._triggerElement=t,this._options=i,this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1,success:$.proxy(this._success,this)}),this._triggerElement.click($.proxy(this.toggle,this)),this._options.showAllLink&&this._triggerElement.dblclick($.proxy(this._dblClick,this)),this._options.staticDropdown===!0)this._loadData=!1;else{var s=this._triggerElement.find("span.badge");s.length&&(this._badge=s)}},toggle:function(t){if(t.preventDefault(),null===this._dropdown&&(this._dropdown=this._initDropdown()),this._dropdown.toggle()){if(!this._loadData&&null!==this._badge){var e=parseInt(this._badge.text())||0;e&&!this._dropdown.getItemList().children(".interactiveDropdownItemOutstanding").length&&(this._loadData=!0)}this._loadData&&(this._loadData=!1,this._load())}return!1},_dblClick:function(t){return t.preventDefault(),window.location=this._options.showAllLink,!1},_initDropdown:function(){var t=WCF.Dropdown.Interactive.Handler.create(this._triggerElement,this._identifier,this._options);return $('<li class="loading"><span class="icon icon24 fa-spinner" /> <span>'+WCF.Language.get("wcf.global.loading")+"</span></li>").appendTo(t.getItemList()),t},_load:function(){},_success:function(t){if(void 0!==t.returnValues.template){var e=this._dropdown.getItemList().empty();if($(t.returnValues.template).appendTo(e),e.children().length||$('<li class="noItems">'+this._options.noItems+"</li>").appendTo(e),this._options.enableMarkAsRead){var i=this._dropdown.getItemList().children(".interactiveDropdownItemOutstanding");if(null===this._markAllAsReadLink&&i.length&&this._options.markAllAsReadConfirmMessage){var s=this._markAllAsReadLink=$('<li class="interactiveDropdownItemMarkAllAsRead"><a href="#" title="'+WCF.Language.get("wcf.user.panel.markAllAsRead")+'" class="jsTooltip"><span class="icon icon16 fa-check" /></a></li>').appendTo(this._dropdown.getLinkList());s.click(function(){return this._dropdown.close(),WCF.System.Confirmation.show(this._options.markAllAsReadConfirmMessage,function(t){"confirm"===t&&this._markAllAsRead()}.bind(this)),!1}.bind(this))}i.each(function(t,e){var i=$(e).addClass("interactiveDropdownItemOutstandingIcon"),s=i.data("objectID"),a=$('<div class="interactiveDropdownItemMarkAsRead"><a href="#" title="'+WCF.Language.get("wcf.user.panel.markAsRead")+'" class="jsTooltip"><span class="icon icon16 fa-check" /></a></div>').appendTo(i);a.click(function(t){return this._markAsRead(t,s),!1}.bind(this))}.bind(this))}this._dropdown.getItemList().children().each(function(t,e){var i=$(e),s=i.data("link");s&&($.browser.msie?i.click(function(t){return"A"!==t.target.tagName?(window.location=s,!1):void 0}):(i.addClass("interactiveDropdownItemShadow"),$('<a href="'+s+'" class="interactiveDropdownItemShadowLink" />').appendTo(i)),i.data("linkReplaceAll")&&i.find("> .box32 a:not(.userLink)").prop("href",s))}),this._dropdown.rebuildScrollbar()}if(void 0!==t.returnValues.totalCount&&this.updateBadge(t.returnValues.totalCount),this._options.enableMarkAsRead)if(t.returnValues.markAsRead){var a=this._dropdown.getItemList().children("li[data-object-id="+t.returnValues.markAsRead+"]");a.length&&(a.removeClass("interactiveDropdownItemOutstanding").data("isRead",!0),a.children(".interactiveDropdownItemMarkAsRead").remove())}else t.returnValues.markAllAsRead&&(this.resetItems(),this.updateBadge(0))},_markAsRead:function(){},_markAllAsRead:function(){},updateBadge:function(t){t=parseInt(t)||0,t?(null===this._badge&&(this._badge=$('<span class="badge badgeInverse" />').appendTo(this._triggerElement.children("a")),this._badge.before(" ")),this._badge.text(t)):null!==this._badge&&(this._badge.remove(),this._badge=null),this._options.enableMarkAsRead&&(t||null===this._markAllAsReadLink||(this._markAllAsReadLink.remove(),this._markAllAsReadLink=null))},resetItems:function(){null!==this._dropdown&&this._dropdown.resetItems()}}),WCF.User.Panel.Notification=WCF.User.Panel.Abstract.extend({_favico:null,init:function(t){t.enableMarkAsRead=!0,this._super($("#userNotifications"),"userNotifications",t);try{if(this._favico=new Favico({animation:"none",type:"circle"}),null!==this._badge){var e=parseInt(this._badge.text())||0;this._favico.badge(e)}}catch(t){console.debug("[WCF.User.Panel.Notification] Failed to initialized Favico: "+t.message)}WCF.System.PushNotification.addCallback("userNotificationCount",$.proxy(this.updateUserNotificationCount,this))},_initDropdown:function(){var t=this._super();return $('<li><a href="'+this._options.settingsLink+'" title="'+WCF.Language.get("wcf.user.panel.settings")+'" class="jsTooltip"><span class="icon icon16 fa-cog" /></a></li>').appendTo(t.getLinkList()),t},_load:function(){this._proxy.setOption("data",{actionName:"getOutstandingNotifications",className:"wcf\\data\\user\\notification\\UserNotificationAction"}),this._proxy.sendRequest()},_markAsRead:function(t,e){this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",objectIDs:[e]}),this._proxy.sendRequest()},_markAllAsRead:function(){this._proxy.setOption("data",{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"}),this._proxy.sendRequest()},resetItems:function(){this._super(),this._markAllAsReadLink&&(this._markAllAsReadLink.remove(),this._markAllAsReadLink=null)},updateBadge:function(t){t=parseInt(t)||0,null!==this._favico&&this._favico.badge(t),this._super(t)},updateUserNotificationCount:function(t){null!==this._dropdown&&this._dropdown.resetItems(),this.updateBadge(t)}}),WCF.User.Panel.UserMenu=WCF.User.Panel.Abstract.extend({init:function(){this._super($("#userMenu"),"userMenu",{pointerOffset:"13px",staticDropdown:!0})}}),WCF.User.QuickLogin={_dialog:null,_loginMessage:null,init:function(){$(".loginLink").click($.proxy(this._render,this)),$("#loginForm input[name=url]").val(function(t,e){return window.location.protocol+"//"+window.location.host+e})},show:function(t){t?(null===this._loginMessage&&(this._loginMessage=$('<p class="info" />').hide().prependTo($("#loginForm > form"))),this._loginMessage.show().text(t)):null!==this._loginMessage&&this._loginMessage.hide(),this._render()},_render:function(t){void 0!==t&&t.preventDefault(),null===this._dialog?(this._dialog=$("#loginForm").wcfDialog({title:WCF.Language.get("wcf.user.login")}),this._dialog.find("#username").focus()):this._dialog.wcfDialog("open")}},WCF.User.Profile={},WCF.User.Profile.ActivityPointList={_cache:{},_dialog:null,_didInit:!1,_proxy:null,init:function(){this._didInit||(this._cache={},this._dialog=null,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._init(),WCF.DOMNodeInsertedHandler.addCallback("WCF.User.Profile.ActivityPointList",$.proxy(this._init,this)),this._didInit=!0)},_init:function(){$(".activityPointsDisplay").removeClass("activityPointsDisplay").click($.proxy(this._click,this))},_click:function(t){t.preventDefault();var e=$(t.currentTarget).data("userID");void 0===this._cache[e]?(this._proxy.setOption("data",{actionName:"getDetailedActivityPointList",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]}),this._proxy.sendRequest()):this._show(e)},_show:function(t){null===this._dialog?(this._dialog=$("<div>"+this._cache[t]+"</div>").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.activityPoint")})):(this._dialog.html(this._cache[t]),this._dialog.wcfDialog("open"))},_success:function(t){this._cache[t.returnValues.userID]=t.returnValues.template,this._show(t.returnValues.userID)}},WCF.User.Profile.Follow=Class.extend({_button:null,_following:!1,_proxy:null,_userID:0,init:function(t,e){this._following=e,this._userID=t,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._createButton(),this._showButton()},_createButton:function(){this._button=$('<li id="followUser"><a href="#" class="button jsTooltip" title="'+WCF.Language.get("wcf.user.button."+(this._following?"un":"")+"follow")+'"><span class="icon icon16 icon-plus"></span> <span class="invisible">'+WCF.Language.get("wcf.user.button."+(this._following?"un":"")+"follow")+"</span></a></li>").prependTo($("#profileButtonContainer")),this._button.click($.proxy(this._execute,this))},_execute:function(t){t.preventDefault();var e=this._following?"unfollow":"follow";this._proxy.setOption("data",{actionName:e,className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}}),this._proxy.sendRequest()},_showButton:function(){this._following?this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button.unfollow")).addClass("active").children(".icon").removeClass("icon-plus").addClass("icon-minus"):this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button.follow")).removeClass("active").children(".icon").removeClass("icon-minus").addClass("icon-plus")},_success:function(t){this._following=t.returnValues.following,this._showButton();var e=new WCF.System.Notification;e.show()}}),WCF.User.Profile.IgnoreUser=Class.extend({_button:null,_isIgnoredUser:!1,_proxy:null,_userID:0,init:function(t,e){this._userID=t,this._isIgnoredUser=e,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._updateButton(),this._button.click($.proxy(this._click,this))},_click:function(t){t.preventDefault();var e=this._isIgnoredUser?"unignore":"ignore";this._proxy.setOption("data",{actionName:e,className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._isIgnoredUser=t.returnValues.isIgnoredUser,this._updateButton();var e=new WCF.System.Notification;e.show()},_updateButton:function(){null===this._button&&(this._button=$('<li id="ignoreUser"><a href="#" class="button jsTooltip" title="'+WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")+'"><span class="icon icon16 icon-ban-circle"></span> <span class="invisible">'+WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")+"</span></a></li>").prependTo($("#profileButtonContainer"))),this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore")),this._isIgnoredUser?this._button.find(".button").addClass("active").children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank"):this._button.find(".button").removeClass("active").children(".icon").removeClass("icon-circle-blank").addClass("icon-ban-circle")}}),WCF.User.Profile.TabMenu=Class.extend({_hasContent:{},_profileContent:null,_proxy:null,_userID:0,init:function(t){this._profileContent=$("#profileContent"),this._userID=t;var e=this._profileContent.data("active"),i=!1;this._profileContent.find("div.tabMenuContent").each($.proxy(function(t,s){var a=$(s).wcfIdentify();e===a?this._hasContent[a]=!0:(this._hasContent[a]=!1,i=!0)},this)),i&&(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._profileContent.on("wcftabsbeforeactivate",$.proxy(this._loadContent,this)),this._profileContent.find("> nav.tabMenu > ul > li").each($.proxy(function(t,e){var i=$(e);return i.hasClass("ui-state-active")?(t&&this._loadContent(null,{newPanel:$("#"+i.attr("aria-controls"))}),!1):void 0},this)))},_loadContent:function(t,e){var i=$(e.newPanel),s=i.attr("id");this._hasContent[s]||(this._proxy.setOption("data",{actionName:"getContent",className:"wcf\\data\\user\\profile\\menu\\item\\UserProfileMenuItemAction",parameters:{data:{containerID:s,menuItem:i.data("menuItem"),userID:this._userID}}}),this._proxy.sendRequest())},_success:function(t){var e=t.returnValues.containerID;this._hasContent[e]=!0;var i=this._profileContent.find("#"+e);$("<div>"+t.returnValues.template+"</div>").hide().appendTo(i),i.children("div").wcfBlindIn()}}),WCF.User.Profile.Editor=Class.extend({_actionName:"",_buttons:{},_cachedTemplate:"",_proxy:null,_tab:null,_userID:0,init:function(t,e){this._actionName="",this._cachedTemplate="",this._tab=$("#about"),this._userID=t,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initButtons(),e&&this._beginEdit()},_initButtons:function(){var t=$("#profileButtonContainer");this._buttons={beginEdit:$('<li><a class="button"><span class="icon icon16 icon-pencil" /> <span>'+WCF.Language.get("wcf.user.editProfile")+"</span></a></li>").click($.proxy(this._beginEdit,this)).appendTo(t)}},_beginEdit:function(){this._actionName="beginEdit",this._buttons.beginEdit.hide(),$("#profileContent").wcfTabs("select","about"),this._proxy.setOption("data",{actionName:"beginEdit",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[this._userID]}),this._proxy.sendRequest()},_save:function(){this._actionName="save";var t=/values\[([a-zA-Z0-9._-]+)\]/,e={};this._tab.find("input, textarea, select").each(function(i,s){var a=$(s),n=null;switch(a.getTagName()){case"input":var o=a.attr("type");if(("radio"===o||"checkbox"===o)&&!a.prop("checked"))return;break;case"textarea":a.data("redactor")&&(n=a.redactor("wutil.getText"))}var r=a.attr("name");if(t.test(r)){var l=RegExp.$1;null===n&&(n=a.val()),"checkbox"===a.attr("type")&&/\[\]$/.test(r)?(Array.isArray(e[l])||(e[l]=[]),e[l].push(n)):e[l]=n}}),this._proxy.setOption("data",{actionName:"save",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[this._userID],parameters:{values:e}}),this._proxy.sendRequest()},_restore:function(){this._actionName="restore",this._buttons.beginEdit.show(),this._destroyEditor(),this._tab.html(this._cachedTemplate).children().css({height:"auto"})},_success:function(t){switch(this._actionName){case"beginEdit":this._prepareEdit(t);break;case"save":t.returnValues.success?(this._cachedTemplate=t.returnValues.template,this._restore()):this._prepareEdit(t,!0)}},_prepareEdit:function(t,e){this._destroyEditor();var i=this;this._tab.html(function(s,a){return e!==!0&&(i._cachedTemplate=a),t.returnValues.template}),this._tab.find("input[type=text]").attr("autocomplete","off"),this._tab.find(".formSubmit > button[data-type=save]").click($.proxy(this._save,this)),this._tab.find(".formSubmit > button[data-type=restore]").click($.proxy(this._restore,this)),this._tab.find("input").keyup(function(t){return t.which===$.ui.keyCode.ENTER?(i._save(),t.preventDefault(),!1):void 0})},_destroyEditor:function(){this._tab.find("textarea").each(function(t,e){var i=$(e);i.data("redactor")&&i.redactor("core.destroy")})}}),WCF.User.Registration={},WCF.User.Registration.Validation=Class.extend({_actionName:"",_className:"",_confirmElement:null,_element:null,_errorMessages:{},_options:{},_proxy:null,init:function(t,e,i){this._element=t,this._element.blur($.proxy(this._blur,this)),this._confirmElement=e||null,null!==this._confirmElement&&this._confirmElement.blur($.proxy(this._blurConfirm,this)),i=i||{},this._setOptions(i),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),showLoadingOverlay:!1}),this._setErrorMessages()},_setOptions:function(){},_setErrorMessages:function(){this._errorMessages={ajaxError:"",notEqual:""}},_blur:function(){var t=this._element.val();if(!t)return this._showError(this._element,WCF.Language.get("wcf.global.form.error.empty"));if(null!==this._confirmElement){var e=this._confirmElement.val();if(""!=e&&t!=e)return this._showError(this._confirmElement,this._errorMessages.notEqual)}this._validateOptions()&&(this._proxy.setOption("data",{actionName:this._actionName,className:this._className,parameters:this._getParameters()}),this._proxy.sendRequest())},_getParameters:function(){return{}},_validateOptions:function(){return!0},_blurConfirm:function(t){var e=this._confirmElement.val();return e?void this._blur(t):this._showError(this._confirmElement,WCF.Language.get("wcf.global.form.error.empty"))},_success:function(t){t.returnValues.isValid?(this._showSuccess(this._element),null!==this._confirmElement&&this._confirmElement.val()&&this._showSuccess(this._confirmElement)):this._showError(this._element,WCF.Language.get(this._errorMessages.ajaxError+t.returnValues.error))},_showError:function(t,e){t.parent().parent().addClass("formError").removeClass("formSuccess");var i=t.parent().find("small.innerError");i.length||(i=$("<small />").addClass("innerError").insertAfter(t)),i.text(e)},_showSuccess:function(t){t.parent().parent().addClass("formSuccess").removeClass("formError"),t.next("small.innerError").remove()}}),WCF.User.Registration.Validation.Username=WCF.User.Registration.Validation.extend({_actionName:"validateUsername",_className:"wcf\\data\\user\\UserRegistrationAction",_setOptions:function(t){this._options=$.extend(!0,{minlength:3,maxlength:25},t)},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.username.error."}},_validateOptions:function(){var t=this._element.val();return t.length<this._options.minlength||t.length>this._options.maxlength?(this._showError(this._element,WCF.Language.get("wcf.user.username.error.notValid")),!1):!0},_getParameters:function(){return{username:this._element.val()}}}),WCF.User.Registration.Validation.EmailAddress=WCF.User.Registration.Validation.extend({_actionName:"validateEmailAddress",_className:"wcf\\data\\user\\UserRegistrationAction",_getParameters:function(){return{email:this._element.val()}},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.email.error.",notEqual:WCF.Language.get("wcf.user.confirmEmail.error.notEqual")}}}),WCF.User.Registration.Validation.Password=WCF.User.Registration.Validation.extend({_actionName:"validatePassword",_className:"wcf\\data\\user\\UserRegistrationAction",_getParameters:function(){return{password:this._element.val()}},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.password.error.",notEqual:WCF.Language.get("wcf.user.confirmPassword.error.notEqual")}}}),WCF.User.Registration.LostPassword=Class.extend({_email:null,_username:null,init:function(){this._email=$("#emailInput"),this._username=$("#usernameInput"),this._email.keyup($.proxy(this._checkEmail,this)),this._username.keyup($.proxy(this._checkUsername,this)),$.browser.mozilla&&$.browser.touch&&(this._email.on("input",$.proxy(this._checkEmail,this)),this._username.on("input",$.proxy(this._checkUsername,this))),this._checkEmail(),this._checkUsername()},_checkEmail:function(){""==this._email.val()?(this._username.enable(),this._username.parents("dl:eq(0)").removeClass("disabled")):(this._username.disable(),this._username.parents("dl:eq(0)").addClass("disabled"))},_checkUsername:function(){""==this._username.val()?(this._email.enable(),this._email.parents("dl:eq(0)").removeClass("disabled")):(this._email.disable(),this._email.parents("dl:eq(0)").addClass("disabled"))}}),WCF.Notification={},WCF.Notification.List=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(".contentNavigation .jsMarkAllAsConfirmed").click(function(){WCF.System.Confirmation.show(WCF.Language.get("wcf.user.notification.markAllAsConfirmed.confirmMessage"),function(t){"confirm"===t&&new WCF.Action.Proxy({autoSend:!0,data:{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"},success:function(){window.location.reload()}})})}),this._convertList()},_convertList:function(){$(".userNotificationItemList > .notificationItem").each(function(t,e){var i=$(e);if(!i.data("isRead")){i.find("a:not(.userLink)").prop("href",i.data("link"));var s=$('<a href="#" class="icon icon24 fa-check notificationItemMarkAsConfirmed jsTooltip" title="'+WCF.Language.get("wcf.user.notification.markAsConfirmed")+'" />').appendTo(i);s.click($.proxy(this._markAsConfirmed,this))}i.find("a:not(.notificationItemMarkAsConfirmed)").length||i.find(".details > p:eq(0)").html(function(t,e){return'<a href="'+i.data("link")+'">'+e+"</a>"})}.bind(this)),WCF.DOMNodeInsertedHandler.execute()},_markAsConfirmed:function(t){t.preventDefault();var e=$(t.currentTarget).parents(".notificationItem:eq(0)").data("objectID");return this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",objectIDs:[e]}),this._proxy.sendRequest(),!1},_success:function(t){var e=$(".userNotificationItemList > .notificationItem[data-object-id="+t.returnValues.markAsRead+"]");e.data("isRead",!0),e.find(".newContentBadge").remove(),e.find(".notificationItemMarkAsConfirmed").remove(),e.removeClass("notificationUnconfirmed")}}),WCF.User.SignaturePreview=WCF.Message.Preview.extend({_handleResponse:function(t){var e=$("#previewContainer");e.length||(e=$('<fieldset id="previewContainer"><legend>'+WCF.Language.get("wcf.global.preview")+"</legend><div></div></fieldset>").insertBefore($("#signatureContainer")).wcfFadeIn()),e.children("div").first().html(t.returnValues.message)}}),WCF.User.RecentActivityLoader=Class.extend({_container:null,_filteredByFollowedUsers:!1,_loadButton:null,_proxy:null,_userID:0,init:function(t,e){return this._container=$("#recentActivities"),this._filteredByFollowedUsers=e===!0,this._userID=t,null===this._userID||this._userID?(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._container.children("li").length?(this._loadButton=$('<li class="recentActivitiesMore showMore"><button class="small">'+WCF.Language.get("wcf.user.recentActivity.more")+"</button></li>").appendTo(this._container),this._loadButton=this._loadButton.children("button").click($.proxy(this._click,this))):$('<li class="recentActivitiesMore showMore"><small>'+WCF.Language.get("wcf.user.recentActivity.noMoreEntries")+"</small></li>").appendTo(this._container),void(WCF.User.userID&&$(".jsRecentActivitySwitchContext .button").click($.proxy(this._switchContext,this)))):void console.debug("[WCF.User.RecentActivityLoader] Invalid parameter 'userID' given.")},_click:function(){this._loadButton.enable();var t={lastEventID:this._container.data("lastEventID"),lastEventTime:this._container.data("lastEventTime")};this._userID?t.userID=this._userID:this._filteredByFollowedUsers&&(t.filteredByFollowedUsers=1),this._proxy.setOption("data",{actionName:"load",className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction",parameters:t}),this._proxy.sendRequest()},_switchContext:function(t){t.preventDefault(),$(t.currentTarget).hasClass("active")||new WCF.Action.Proxy({autoSend:!0,data:{actionName:"switchContext",className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction"},success:function(){window.location.hash="#dashboardBoxRecentActivity",window.location.reload()}})},_success:function(t){t.returnValues.template?($(t.returnValues.template).insertBefore(this._loadButton.parent()),this._container.data("lastEventTime",t.returnValues.lastEventTime),this._container.data("lastEventID",t.returnValues.lastEventID),this._loadButton.enable()):($("<small>"+WCF.Language.get("wcf.user.recentActivity.noMoreEntries")+"</small>").appendTo(this._loadButton.parent()),this._loadButton.remove())}}),WCF.User.LikeLoader=Class.extend({_container:null,_likeType:"received",_likeValue:1,_loadButton:null,_noMoreEntries:null,_proxy:null,_userID:0,init:function(t){if(this._container=$("#likeList"),this._userID=t,!this._userID)return void console.debug("[WCF.User.RecentActivityLoader] Invalid parameter 'userID' given.");this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});var e=$('<li class="likeListMore recentActivitiesMore showMore"><button class="small">'+WCF.Language.get("wcf.like.likes.more")+"</button><small>"+WCF.Language.get("wcf.like.likes.noMoreEntries")+"</small></li>").appendTo(this._container);this._loadButton=e.children("button").click($.proxy(this._click,this)),this._noMoreEntries=e.children("small").hide(),2==this._container.find("> li").length&&(this._loadButton.hide(),this._noMoreEntries.show()),$("#likeType .button").click($.proxy(this._clickLikeType,this)),$("#likeValue .button").click($.proxy(this._clickLikeValue,this))},_clickLikeType:function(t){var e=$(t.currentTarget);this._likeType!=e.data("likeType")&&(this._likeType=e.data("likeType"),$("#likeType .button").removeClass("active"),e.addClass("active"),this._reload())},_clickLikeValue:function(t){var e=$(t.currentTarget);this._likeValue!=e.data("likeValue")&&(this._likeValue=e.data("likeValue"),$("#likeValue .button").removeClass("active"),e.addClass("active"),$("#likeType > li:first-child > .button").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likesReceived")),$("#likeType > li:last-child > .button").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likesGiven")),this._container.find("> li.likeListMore button").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likes.more")),this._container.find("> li.likeListMore small").text(WCF.Language.get("wcf.like."+(-1==this._likeValue?"dis":"")+"likes.noMoreEntries")),this._reload())},_reload:function(){this._container.find("> li:not(:first-child):not(:last-child)").remove(),this._container.data("lastLikeTime",0),this._click()},_click:function(){this._loadButton.enable();var t={lastLikeTime:this._container.data("lastLikeTime"),userID:this._userID,likeType:this._likeType,likeValue:this._likeValue};this._proxy.setOption("data",{actionName:"load",className:"wcf\\data\\like\\LikeAction",parameters:t}),this._proxy.sendRequest()},_success:function(t){t.returnValues.template?($(t.returnValues.template).insertBefore(this._loadButton.parent()),this._container.data("lastLikeTime",t.returnValues.lastLikeTime),this._noMoreEntries.hide(),this._loadButton.show().enable()):(this._noMoreEntries.show(),this._loadButton.hide())}}),WCF.User.ProfilePreview=WCF.Popover.extend({_proxy:null,_userProfiles:{},init:function(){this._super(".userLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.System.ObjectStore.add("WCF.User.ProfilePreview",this)},_loadContent:function(){var t=$("#"+this._activeElementID),e=t.data("userID");if(this._userProfiles[e])this._insertContent(this._activeElementID,this._userProfiles[e],!0);else{this._proxy.setOption("data",{actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[e]});var i=this._activeElementID,s=this;this._proxy.setOption("success",function(t){s._userProfiles[e]=t.returnValues.template,s._insertContent(i,t.returnValues.template,!0)}),this._proxy.setOption("failure",function(t){return s._userProfiles[e]=t.message,s._insertContent(i,t.message,!0),!1}),this._proxy.sendRequest()}},purge:function(t){delete this._userProfiles[t],this._data={}}}),WCF.User.Action={},WCF.User.Action.Follow=Class.extend({_containerList:null,_followButtonSelector:".jsFollowButton",_userID:0,init:function(t,e){t.length&&(this._containerList=t,e&&(this._followButtonSelector=e),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._containerList.each($.proxy(function(t,e){$(e).find(this._followButtonSelector).click($.proxy(this._click,this))},this)))},_click:function(t){t.preventDefault();var e=$(t.target);e.is("a")||(e=e.closest("a")),this._userID=e.data("objectID"),this._proxy.setOption("data",{actionName:e.data("following")?"unfollow":"follow",className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._containerList.each($.proxy(function(e,i){var s=$(i).find(this._followButtonSelector).get(0);return s&&$(s).data("objectID")==this._userID?(s=$(s),t.returnValues.following?(s.data("tooltip",WCF.Language.get("wcf.user.button.unfollow")).children(".icon").removeClass("icon-plus").addClass("icon-minus"),s.children(".invisible").text(WCF.Language.get("wcf.user.button.unfollow"))):(s.data("tooltip",WCF.Language.get("wcf.user.button.follow")).children(".icon").removeClass("icon-minus").addClass("icon-plus"),s.children(".invisible").text(WCF.Language.get("wcf.user.button.follow"))),s.data("following",t.returnValues.following),!1):void 0},this));var e=new WCF.System.Notification;e.show();var i=this;WCF.System.ObjectStore.invoke("WCF.User.ProfilePreview",function(t){t.purge(i._userID)})}}),WCF.User.Action.Ignore=Class.extend({_containerList:null,_ignoreButtonSelector:".jsIgnoreButton",_userID:0,init:function(t,e){t.length&&(this._containerList=t,e&&(this._ignoreButtonSelector=e),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._containerList.each($.proxy(function(t,e){$(e).find(this._ignoreButtonSelector).click($.proxy(this._click,this))},this)))},_click:function(t){t.preventDefault();var e=$(t.target);e.is("a")||(e=e.closest("a")),this._userID=e.data("objectID"),this._proxy.setOption("data",{actionName:e.data("ignored")?"unignore":"ignore",className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}}),this._proxy.sendRequest()},_success:function(t){this._containerList.each($.proxy(function(e,i){var s=$(i).find(this._ignoreButtonSelector).get(0);return s&&$(s).data("objectID")==this._userID?(s=$(s),t.returnValues.isIgnoredUser?(s.data("tooltip",WCF.Language.get("wcf.user.button.unignore")).children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank"),s.children(".invisible").text(WCF.Language.get("wcf.user.button.unignore"))):(s.data("tooltip",WCF.Language.get("wcf.user.button.ignore")).children(".icon").removeClass("icon-circle-blank").addClass("icon-ban-circle"),s.children(".invisible").text(WCF.Language.get("wcf.user.button.ignore"))),s.data("ignored",t.returnValues.isIgnoredUser),!1):void 0},this));var e=new WCF.System.Notification;e.show();var i=this;WCF.System.ObjectStore.invoke("WCF.User.ProfilePreview",function(t){t.purge(i._userID)})}}),WCF.User.Avatar={},WCF.User.Avatar.Crop=Class.extend({_cropX:0,_cropY:0,_dialog:null,_proxy:null,MAX_THUMBNAIL_SIZE:128,init:function(t){this._avatarID=t,this._dialog&&this.destroy(),this._dialog=null,this._proxy||(this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})),$(".userAvatarCrop").click($.proxy(this._showCropDialog,this))},destroy:function(){this._dialog.remove()},_crop:function(){this._proxy.setOption("data",{actionName:"cropAvatar",className:"wcf\\data\\user\\avatar\\UserAvatarAction",objectIDs:[this._avatarID],parameters:{cropX:this._cropX,cropY:this._cropY}}),this._proxy.sendRequest()},_getCropDialog:function(t){this._dialog||(this._dialog=$("<div />").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.avatar.type.custom.crop")})),this._dialog.html(t.returnValues.template),this._dialog.find('button[data-type="save"]').click($.proxy(this._crop,this)),this._cropX=t.returnValues.cropX,this._cropY=t.returnValues.cropY;var e=$("#userAvatarCropSelection > img");$("#userAvatarCropSelection").css({height:e.height()+"px",width:e.width()+"px"
+}),$("#userAvatarCropOverlaySelection").css({"background-image":"url("+e.attr("src")+")","background-position":-this._cropX+"px "+-this._cropY+"px",left:this._cropX+"px",top:this._cropY+"px"}).draggable({containment:"parent",drag:$.proxy(this._updateSelection,this),stop:$.proxy(this._updateSelection,this)}),this._dialog.find('button[data-type="save"]').click($.proxy(this._save,this)),this._dialog.wcfDialog("render")},_showCropDialog:function(){this._dialog?this._dialog.wcfDialog("open"):(this._proxy.setOption("data",{actionName:"getCropDialog",className:"wcf\\data\\user\\avatar\\UserAvatarAction",objectIDs:[this._avatarID]}),this._proxy.sendRequest())},_success:function(t){switch(t.actionName){case"getCropDialog":this._getCropDialog(t);break;case"cropAvatar":$("#avatarUpload > dt > img").replaceWith($('<img src="'+t.returnValues.url+'" alt="" class="userAvatarCrop jsTooltip" title="'+WCF.Language.get("wcf.user.avatar.type.custom.crop")+'" />').css({width:"96px",height:"96px"}).click($.proxy(this._showCropDialog,this))),WCF.DOMNodeInsertedHandler.execute(),this._dialog.wcfDialog("close");var e=new WCF.System.Notification;e.show()}},_updateSelection:function(t,e){this._cropX=e.position.left,this._cropY=e.position.top,$("#userAvatarCropOverlaySelection").css({"background-position":-e.position.left+"px "+-e.position.top+"px"})}}),WCF.User.Avatar.Upload=WCF.Upload.extend({_avatarCrop:null,_userID:0,init:function(t,e){this._super($("#avatarUpload > dd > div"),void 0,"wcf\\data\\user\\avatar\\UserAvatarAction"),this._userID=t||0,this._avatarCrop=e,$("#avatarForm input[type=radio]").change(function(){"custom"==$(this).val()?$("#avatarUpload > dd > div").show():$("#avatarUpload > dd > div").hide()}),$("#avatarForm input[type=radio][value=custom]:checked").length||$("#avatarUpload > dd > div").hide()},_initFile:function(){return $("#avatarUpload > dt > img")},_success:function(t,e){if(e.returnValues.url){this._updateImage(e.returnValues.url,e.returnValues.canCrop),e.returnValues.canCrop?this._avatarCrop?this._avatarCrop.init(e.returnValues.avatarID):this._avatarCrop=new WCF.User.Avatar.Crop(e.returnValues.avatarID):this._avatarCrop&&(this._avatarCrop.destroy(),this._avatarCrop=null),$("#avatarUpload > dd > .innerError").remove();var i=new WCF.System.Notification(WCF.Language.get("wcf.user.avatar.upload.success"));i.show()}else e.returnValues.errorType&&this._getInnerErrorElement().text(WCF.Language.get("wcf.user.avatar.upload.error."+e.returnValues.errorType))},_updateImage:function(t,e){$("#avatarUpload > dt > img").remove();var i=$('<img src="'+t+'" alt="" />').css({height:"auto","max-height":"96px","max-width":"96px",width:"auto"});e&&(i.addClass("userAvatarCrop").addClass("jsTooltip"),i.attr("title",WCF.Language.get("wcf.user.avatar.type.custom.crop"))),$("#avatarUpload > dt").prepend(i),WCF.DOMNodeInsertedHandler.execute()},_getInnerErrorElement:function(){var t=$("#avatarUpload > dd > .innerError");return t.length||(t=$('<small class="innerError"></span>'),$("#avatarUpload > dd").append(t)),t},_getParameters:function(){return{userID:this._userID}}}),WCF.User.List=Class.extend({_additionalParameters:{},_cache:{},_className:"",_dialog:null,_dialogTitle:"",_pageCount:0,_pageNo:1,_proxy:null,init:function(t,e,i){this._additionalParameters=i||{},this._cache={},this._className=t,this._dialog=null,this._dialogTitle=e,this._pageCount=0,this._pageNo=1,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},open:function(){this._pageNo=1,this._showPage()},_showPage:function(t,e){if(e&&e.activePage&&(this._pageNo=e.activePage),0!=this._pageCount&&(this._pageNo<1||this._pageNo>this._pageCount))return void console.debug("[WCF.User.List] Cannot access page "+this._pageNo+" of "+this._pageCount);if(this._cache[this._pageNo]){var i=!1;null===this._dialog&&(this._dialog=$('<div id="userList'+this._className.hashCode()+'" />').hide().appendTo(document.body),i=!0),this._dialog.empty(),this._dialog.html(this._cache[this._pageNo]),this._pageCount>1&&this._dialog.find(".jsPagination").wcfPages({activePage:this._pageNo,maxPage:this._pageCount}).on("wcfpagesswitched",$.proxy(this._showPage,this)),i?this._dialog.wcfDialog({title:this._dialogTitle}):this._dialog.wcfDialog("open").wcfDialog("render"),WCF.DOMNodeInsertedHandler.execute()}else this._additionalParameters.pageNo=this._pageNo,this._proxy.setOption("data",{actionName:"getGroupedUserList",className:this._className,interfaceName:"wcf\\data\\IGroupedUserListAction",parameters:this._additionalParameters}),this._proxy.sendRequest()},_success:function(t){t.returnValues.pageCount&&(this._pageCount=t.returnValues.pageCount),this._cache[this._pageNo]=t.returnValues.template,this._showPage()}}),WCF.User.ObjectWatch={},WCF.User.ObjectWatch.Subscribe=Class.extend({_buttonSelector:".jsSubscribeButton",_buttons:{},_dialog:null,_notification:null,_reloadOnUnsubscribe:!1,init:function(t){this._buttons={},this._notification=null,this._reloadOnUnsubscribe=t===!0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(this._buttonSelector).each($.proxy(function(t,e){var i=$(e),s=i.data("objectID");this._buttons[s]=i.click($.proxy(this._click,this))},this)),WCF.System.Event.addListener("com.woltlab.wcf.objectWatch","update",$.proxy(this._updateSubscriptionStatus,this))},_click:function(t){t.preventDefault();var e=$(t.currentTarget);this._proxy.setOption("data",{actionName:"manageSubscription",className:"wcf\\data\\user\\object\\watch\\UserObjectWatchAction",parameters:{objectID:e.data("objectID"),objectType:e.data("objectType")}}),this._proxy.sendRequest()},_success:function(t){if("manageSubscription"===t.actionName){null===this._dialog?(this._dialog=$("<div>"+t.returnValues.template+"</div>").hide().appendTo(document.body),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.objectWatch.manageSubscription")})):(this._dialog.html(t.returnValues.template),this._dialog.wcfDialog("open")),this._dialog.find(".formSubmit > .jsButtonSave").data("objectID",t.returnValues.objectID).click($.proxy(this._save,this));var e=this._dialog.find("input[name=enableNotification]").disable();this._dialog.find("input[name=subscribe]").change(function(t){var i=$(t.currentTarget);1==i.val()?e.enable():e.disable()});var i=this._dialog.find("input[name=subscribe]:checked");i.length&&1==i.val()&&e.enable()}else"saveSubscription"===t.actionName&&this._dialog.is(":visible")&&(this._dialog.wcfDialog("close"),this._updateSubscriptionStatus({isSubscribed:t.returnValues.subscribe,objectID:t.returnValues.objectID}),null===this._notification&&(this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))),this._notification.show())},_save:function(t){var e=this._buttons[$(t.currentTarget).data("objectID")],i=this._dialog.find("input[name=subscribe]:checked").val(),s=this._dialog.find("input[name=enableNotification]").is(":checked")?1:0;this._proxy.setOption("data",{actionName:"saveSubscription",className:"wcf\\data\\user\\object\\watch\\UserObjectWatchAction",parameters:{enableNotification:s,objectID:e.data("objectID"),objectType:e.data("objectType"),subscribe:i}}),this._proxy.sendRequest()},_updateSubscriptionStatus:function(t){var e=$(this._buttonSelector+"[data-object-id="+t.objectID+"]"),i=e.children(".icon");if(t.isSubscribed)i.removeClass("icon-bookmark-empty").addClass("icon-bookmark"),e.data("isSubscribed",!0);else if(i.removeClass("icon-bookmark").addClass("icon-bookmark-empty"),e.data("isSubscribed",!1),this._reloadOnUnsubscribe)return void window.location.reload();WCF.System.Event.fireEvent("com.woltlab.wcf.objectWatch","updatedSubscription",t)}}),WCF.User.InlineEditor=WCF.InlineEditor.extend({_additionalOptions:{},_dialog:null,_permissions:{},init:function(t){this._super(t),WCF.System.ObjectStore.add("WCF.User.InlineEditor",this)},_execute:function(t,e){if(!this._validate(t,e))return!1;var i={},s=$("#"+t);if(void 0!==this._additionalOptions[e])this._additionalOptions[e].callback(t);else switch(e){case"unban":case"enableAvatar":case"enableSignature":switch(e){case"unban":i.banned=0;break;case"enableAvatar":i.disableAvatar=0;break;case"enableSignature":i.disableSignature=0}this._proxy.setOption("data",{actionName:e,className:"wcf\\data\\user\\UserAction",objectIDs:[s.data("objectID")]}),this._proxy.sendRequest();break;case"ban":case"disableAvatar":case"disableSignature":"ban"==e?i.banned=1:i[e]=1,this._showReasonDialog(s.data("objectID"),e);break;case"advanced":window.location=this._getTriggerElement(s).attr("href")}$.getLength(i)&&this._updateData.push({data:i,elementID:t})},_executeReasonAction:function(){var t=this._dialog.data("optionName");this._dialog.find(".innerError").remove();var e="";if(!$("#"+t+"NeverExpires").is(":checked")&&(e=$("#"+t+"ExpiresDatePicker").val(),!e))return void this._dialog.find("#"+t+"ExpiresSettings > dd > small").prepend($('<small class="innerError" />').text(WCF.Language.get("wcf.global.form.error.empty")));var i={};i[t+"Reason"]=$("#"+t+"Reason").val(),i[t+"Expires"]=e,this._proxy.setOption("data",{actionName:t,className:"wcf\\data\\user\\UserAction",objectIDs:[this._dialog.data("userID")],parameters:i}),this._proxy.sendRequest()},_getPermission:function(t){return this._permissions[t]?this._permissions[t]:0},_getTriggerElement:function(t){return t.find(".jsUserInlineEditor")},_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.user.ban"),optionName:"ban"},{label:WCF.Language.get("wcf.user.unban"),optionName:"unban"},{label:WCF.Language.get("wcf.user.disableAvatar"),optionName:"disableAvatar"},{label:WCF.Language.get("wcf.user.enableAvatar"),optionName:"enableAvatar"},{label:WCF.Language.get("wcf.user.disableSignature"),optionName:"disableSignature"},{label:WCF.Language.get("wcf.user.enableSignature"),optionName:"enableSignature"}];for(var t in this._additionalOptions)this._options.push({label:this._additionalOptions[t].label,optionName:t});this._options.push({optionName:"divider"}),this._options.push({label:WCF.Language.get("wcf.user.edit"),optionName:"advanced"})},_show:function(t){var e=$(t.currentTarget),i=e.data("elementID");if(!this._dropdowns[i]){var s=e.next(".dropdownMenu");s&&(this._dropdowns[i]=s,WCF.Dropdown.initDropdown(this._getTriggerElement(this._elements[i]),!0))}return this._super(t)},_showReasonDialog:function(t,e){this._dialog&&this._dialog.remove(),this._dialog=$("<div />").hide().appendTo(document.body),this._dialog.append($('<fieldset><dl><dt><label for="'+e+'Reason">'+WCF.Language.get("wcf.global.reason")+'</label></dt><dd><textarea id="'+e+'Reason" cols="40" rows="3" />'+(WCF.Language.get("wcf.user."+e+".reason.description")!="wcf.user."+e+".reason.description"?"<small>"+WCF.Language.get("wcf.user."+e+".reason.description")+"</small>":"")+'</dd></dl><dl><dt></dt><dd><label for="'+e+'NeverExpires"><input type="checkbox" name="'+e+'NeverExpires" id="'+e+'NeverExpires" checked="checked" /> '+WCF.Language.get("wcf.user."+e+".neverExpires")+'</label></dd></dl><dl id="'+e+'ExpiresSettings" style="display: none;"><dt><label for="'+e+'Expires">'+WCF.Language.get("wcf.user."+e+".expires")+'</label></dt><dd><input type="date" name="'+e+'Expires" id="'+e+'Expires" class="medium" min="'+new Date(1e3*TIME_NOW).toISOString()+'" data-ignore-timezone="true" /><small>'+WCF.Language.get("wcf.user."+e+".expires.description")+"</small></dd></dl></fieldset>")),this._dialog.append($('<div class="formSubmit"><button class="buttonPrimary" accesskey="s">'+WCF.Language.get("wcf.global.button.submit")+"</button></div>")),this._dialog.data("optionName",e).data("userID",t),this._dialog.find("#"+e+"NeverExpires").change(function(){$("#"+e+"ExpiresSettings").toggle()}),this._dialog.find("button").click($.proxy(this._executeReasonAction,this)),this._dialog.wcfDialog({title:WCF.Language.get("wcf.user."+e+".confirmMessage")})},_updateState:function(t){this._notification.show();for(var e=0,i=this._updateData.length;i>e;e++){var s=this._updateData[e],a=$("#"+s.elementID);for(var n in s.data)a.data(n,s.data[n])}("ban"==t.actionName||"disableAvatar"==t.actionName||"disableSignature"==t.actionName)&&this._dialog.wcfDialog("close"),"unban"==t.actionName&&$(".userHeadline .jsUserBanned").remove()},_validate:function(t,e){var i=$("#"+t);if(void 0!==this._additionalOptions[e])return!0;switch(e){case"ban":case"unban":return this._getPermission("canBanUser")?"ban"==e?!i.data("banned"):i.data("banned"):!1;case"disableAvatar":case"enableAvatar":return this._getPermission("canDisableAvatar")?"disableAvatar"==e?!i.data("disableAvatar"):i.data("disableAvatar"):!1;case"disableSignature":case"enableSignature":return this._getPermission("canDisableSignature")?"disableSignature"==e?!i.data("disableSignature"):i.data("disableSignature"):!1;case"advanced":return this._getPermission("canEditUser")}return!1},addOption:function(t,e,i){$.isFunction(i)||console.debug("[WCF.User.InlineEditor] Missing callback"),void 0!==this._additionalOptions[e]&&console.debug('[WCF.User.InlineEditor] Additional option with name "'+e+"' already exists"),this._additionalOptions[e]={callback:i,label:t},this._setOptions()},setPermission:function(t,e){this._permissions[t]=e},setPermissions:function(t){for(var e in t)this.setPermission(e,t[e])}}); })(this);
 
 // WCF.Moderation.js
 (function (window, undefined) {"use strict";WCF.Moderation={},WCF.Moderation.Management=Class.extend({_buttonSelector:"",_className:"",_confirmationTemplate:{},_dialog:null,_languageItem:"",_proxy:null,_queueID:0,_redirectURL:"",init:function(e,t,a){return this._buttonSelector?this._className?(this._dialog=null,this._queueID=e,this._redirectURL=t,this._languageItem=a,this._proxy=new WCF.Action.Proxy({failure:$.proxy(this._failure,this),success:$.proxy(this._success,this)}),$(this._buttonSelector).click($.proxy(this._click,this)),void $("<a>"+WCF.Language.get("wcf.moderation.assignedUser.change")+"</a>").click($.proxy(this._clickAssignedUser,this)).insertAfter($("#moderationAssignedUserContainer > dd > span"))):void console.debug("[WCF.Moderation.Management] Missing class name, aborting."):void console.debug("[WCF.Moderation.Management] Missing button selector, aborting.")},_click:function(e){var t=$(e.currentTarget).wcfIdentify(),a="";this._confirmationTemplate[t]&&(a=this._confirmationTemplate[t]),WCF.System.Confirmation.show(WCF.Language.get(this._languageItem.replace(/{actionName}/,t)),$.proxy(function(e){if("confirm"===e){var i={actionName:t,className:this._className,objectIDs:[this._queueID]};this._confirmationTemplate[t]&&(i.parameters={},a.find("input, textarea").each(function(e,t){var a=$(t),o=a.val();"input"===a.getTagName()&&"checkbox"===a.attr("type")&&(a.is(":checked")||(o=null)),null!==o&&(i.parameters[a.attr("name")]=o)})),this._proxy.setOption("data",i),this._proxy.sendRequest(),$(this._buttonSelector).disable()}},this),{},a)},_clickAssignedUser:function(){this._proxy.setOption("data",{actionName:"getAssignUserForm",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction",objectIDs:[this._queueID]}),this._proxy.sendRequest()},_success:function(e){switch(e.actionName){case"getAssignUserForm":null===this._dialog?(this._dialog=$("<div />").hide().appendTo(document.body),this._dialog.html(e.returnValues.template).wcfDialog({title:WCF.Language.get("wcf.moderation.assignedUser")})):this._dialog.html(e.returnValues.template).wcfDialog("open"),this._dialog.find("button[data-type=submit]").click($.proxy(this._assignUser,this));break;case"assignUser":var t=$("#moderationAssignedUserContainer > dd > span").empty();e.returnValues.userID?$('<a href="'+e.returnValues.link+'" data-user-id="'+e.returnValues.userID+'" class="userLink">'+WCF.String.escapeHTML(e.returnValues.username)+"</a>").appendTo(t):t.append(e.returnValues.username),t.append(" "),e.returnValues.newStatus&&$("#moderationStatusContainer > dd").text(WCF.Language.get("wcf.moderation.status."+e.returnValues.newStatus)),this._dialog.wcfDialog("close"),(new WCF.System.Notification).show();break;default:var a=new WCF.System.Notification(WCF.Language.get("wcf.global.success")),i=this;a.show(function(){window.location=i._redirectURL})}},_failure:function(e){if(e.returnValues&&e.returnValues.fieldName&&"assignedUsername"==e.returnValues.fieldName){this._dialog.find("small.innerError").remove();var t="";switch(e.returnValues.errorType){case"empty":t=WCF.Language.get("wcf.global.form.error.empty");break;case"notAffected":t=WCF.Language.get("wcf.moderation.assignedUser.error.notAffected");break;default:t=WCF.Language.get("wcf.user.username.error."+e.returnValues.errorType,{username:this._dialog.find("#assignedUsername").val()})}return $('<small class="innerError">'+t+"</small>").insertAfter(this._dialog.find("#assignedUsername")),!1}return!0},_assignUser:function(){var e=this._dialog.find("input[name=assignedUserID]:checked").val(),t="";return-1==e&&(t=$.trim(this._dialog.find("#assignedUsername").val())),-1==e&&0==t.length?(this._dialog.find("small.innerError").remove(),void $('<small class="innerError">'+WCF.Language.get("wcf.global.form.error.empty")+"</small>").insertAfter(this._dialog.find("#assignedUsername"))):(this._proxy.setOption("data",{actionName:"assignUser",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction",objectIDs:[this._queueID],parameters:{assignedUserID:e,assignedUsername:t}}),void this._proxy.sendRequest())}}),WCF.Moderation.Queue={},WCF.Moderation.Queue.MarkAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(document).on("dblclick",".moderationList .new .columnAvatar",$.proxy(this._dblclick,this))},_dblclick:function(e){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction",objectIDs:[$(e.currentTarget).parents("tr:eq(0)").data("queueID")]}),this._proxy.sendRequest()},_success:function(e){$(".moderationList .new").each(function(t,a){var i=$(a);WCF.inArray(i.data("queueID"),e.objectIDs)&&(i.removeClass("new"),i.find(".columnAvatar").off("dblclick"))})}}),WCF.Moderation.Queue.MarkAllAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(".markAllAsReadButton").click($.proxy(this._click,this))},_click:function(e){e.preventDefault(),this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction"}),this._proxy.sendRequest()},_success:function(){var e=$(".moderationList");e.find(".new").removeClass("new"),e.find(".columnAvatar").off("dblclick")}}),WCF.Moderation.Activation={},WCF.Moderation.Activation.Management=WCF.Moderation.Management.extend({init:function(e,t){this._buttonSelector="#enableContent, #removeContent",this._className="wcf\\data\\moderation\\queue\\ModerationQueueActivationAction",this._super(e,t,"wcf.moderation.activation.{actionName}.confirmMessage")}}),WCF.Moderation.Report={},WCF.Moderation.Report.Content=Class.extend({_buttons:{},_buttonSelector:"",_dialog:null,_notification:null,_objectID:0,_objectType:"",_proxy:null,init:function(e,t){this._objectType=e,this._buttonSelector=t,this._buttons={},this._notification=null,this._objectID=0,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._initButtons(),WCF.DOMNodeInsertedHandler.addCallback("WCF.Moderation.Report"+this._objectType.hashCode(),$.proxy(this._initButtons,this))},_initButtons:function(){var e=this;$(this._buttonSelector).each(function(t,a){var i=$(a),o=i.wcfIdentify();e._buttons[o]||(e._buttons[o]=i,i.click($.proxy(e._click,e)))})},_click:function(e){e.preventDefault(),this._objectID=$(e.currentTarget).data("objectID"),this._proxy.setOption("data",{actionName:"prepareReport",className:"wcf\\data\\moderation\\queue\\ModerationQueueReportAction",parameters:{objectID:this._objectID,objectType:this._objectType}}),this._proxy.sendRequest()},_success:function(e){e.returnValues.reported?(null===this._notification&&(this._notification=new WCF.System.Notification(WCF.Language.get("wcf.moderation.report.success"))),this._dialog.wcfDialog("close"),this._notification.show()):e.returnValues.template&&(this._showDialog(e.returnValues.template),e.returnValues.alreadyReported||this._dialog.find(".jsSubmitReport").click($.proxy(this._submit,this)))},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#moderationReport"),this._dialog.length||(this._dialog=$('<div id="moderationReport" />').hide().appendTo(document.body))),this._dialog.html(e).wcfDialog({title:WCF.Language.get("wcf.moderation.report.reportContent")}).wcfDialog("render")},_submit:function(){var e=this._dialog.find(".jsReportMessage").val();return""==$.trim(e)?(this._dialog.find("fieldset > dl").addClass("formError"),void(this._dialog.find(".innerError").length||this._dialog.find(".jsReportMessage").after($('<small class="innerError">'+WCF.Language.get("wcf.global.form.error.empty")+"</small>")))):(this._proxy.setOption("data",{actionName:"report",className:"wcf\\data\\moderation\\queue\\ModerationQueueReportAction",parameters:{message:e,objectID:this._objectID,objectType:this._objectType}}),void this._proxy.sendRequest())}}),WCF.Moderation.Report.Management=WCF.Moderation.Management.extend({init:function(e,t){this._buttonSelector="#removeContent, #removeReport",this._className="wcf\\data\\moderation\\queue\\ModerationQueueReportAction",this._super(e,t,"wcf.moderation.report.{actionName}.confirmMessage"),this._confirmationTemplate.removeContent=$('<fieldset><dl><dt><label for="message">'+WCF.Language.get("wcf.moderation.report.removeContent.reason")+'</label></dt><dd><textarea name="message" id="message" cols="40" rows="3" /></dd></dl></fieldset>')}}),WCF.User.Panel.Moderation=WCF.User.Panel.Abstract.extend({init:function(e){e.enableMarkAsRead=!0,this._super($("#outstandingModeration"),"outstandingModeration",e)},_initDropdown:function(){var e=this._super();return $('<li><a href="'+this._options.deletedContentLink+'" title="'+this._options.deletedContent+'" class="jsTooltip"><span class="icon icon16 fa-trash-o" /></a></li>').appendTo(e.getLinkList()),e},_load:function(){this._proxy.setOption("data",{actionName:"getOutstandingQueues",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction"}),this._proxy.sendRequest()},_markAsRead:function(e,t){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction",objectIDs:[t]}),this._proxy.sendRequest()},_markAllAsRead:function(){this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\moderation\\queue\\ModerationQueueAction"}),this._proxy.sendRequest()},resetItems:function(){this._super(),this._loadData=!0}}); })(this);