From: woltlab.com Date: Thu, 29 Jan 2015 17:16:46 +0000 (+0100) Subject: Updating minified JavaScript files X-Git-Tag: 2.1.0_Beta_4~34 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3adeafd70056434aa14c88500f6b1eb1882260dc;p=GitHub%2FWoltLab%2FWCF.git Updating minified JavaScript files --- diff --git a/wcfsetup/install/files/js/WCF.Combined.min.js b/wcfsetup/install/files/js/WCF.Combined.min.js index 72abb6358e..77f7a3602b 100755 --- a/wcfsetup/install/files/js/WCF.Combined.min.js +++ b/wcfsetup/install/files/js/WCF.Combined.min.js @@ -118,7 +118,7 @@ window.matchMedia||(window.matchMedia=function(){var c=window.styleMedia||window (function (window, undefined) {"use strict";WCF.Tagging={};WCF.Tagging.TagList=WCF.EditableItemList.extend({_className:"wcf\\data\\tag\\TagAction",_maxLength:0,init:function(c,a,b){this._allowCustomInput=true;this._maxLength=b;this._super(c,a);this._data=[];this._search=new WCF.Tagging.TagSearch(this._searchInput,$.proxy(this.addItem,this));this._itemList.addClass("tagList");$(c).data("__api",this)},_keyDown:function(b){if(this._super(b)){if(b===null){return true}var a=b.which;if(a===8||a===27||a===13||a===46){return true}else{if(a>36&&a<41){return true}}if(this._searchInput.val().length>=this._maxLength){return false}return true}return false},_submit:function(){this._super();for(var b=0,a=this._data.length;b').val(this._data[b]).appendTo(this._form)}}},addItem:function(b){if(!b.objectID&&b.label.length>this._maxLength){b.label=b.label.substr(0,this._maxLength)}if(WCF.inArray(b.label,this._data)){return true}var a=$('
  • '+WCF.String.escapeHTML(b.label)+"
  • ").data("objectID",b.objectID).data("label",b.label).appendTo(this._itemList);a.click($.proxy(this._click,this));if(this._search){this._search.addExcludedSearchValue(b.label)}this._addItem(b.objectID,b.label);return true},_addItem:function(b,a){this._data.push(a)},clearList:function(){this._super();this._data=[]},getTags:function(){return this._data},_removeItem:function(d,a){for(var c=0,b=this._data.length;c '+WCF.Language.get("wcf.global.loading")+"").appendTo(a.getItemList());return a},_load:function(){},_success:function(d){if(d.returnValues.template!==undefined){var e=this._dropdown.getItemList().empty();$(d.returnValues.template).appendTo(e);if(!e.children().length){$('
  • '+this._options.noItems+"
  • ").appendTo(e)}if(this._options.enableMarkAsRead){var b=this._dropdown.getItemList().children(".interactiveDropdownItemOutstanding");if(this._markAllAsReadLink===null&&b.length&&this._options.markAllAsReadConfirmMessage){var c=this._markAllAsReadLink=$('
  • ').appendTo(this._dropdown.getLinkList());c.click((function(f){this._dropdown.close();WCF.System.Confirmation.show(this._options.markAllAsReadConfirmMessage,(function(g){if(g==="confirm"){this._markAllAsRead()}}).bind(this));return false}).bind(this))}b.each((function(g,i){var f=$(i).addClass("interactiveDropdownItemOutstandingIcon");var h=f.data("objectID");var j=$('
    ').appendTo(f);j.click((function(k){this._markAsRead(k,h);return false}).bind(this))}).bind(this))}this._dropdown.getItemList().children().each(function(h,i){var g=$(i);var f=g.data("link");if(f){if($.browser.msie){g.click(function(j){if(j.target.tagName!=="A"){window.location=f;return false}})}else{g.addClass("interactiveDropdownItemShadow");$('').appendTo(g)}if(g.data("linkReplaceAll")){g.find("> .box32 a:not(.userLink)").prop("href",f)}}});this._dropdown.rebuildScrollbar()}if(d.returnValues.totalCount!==undefined){this.updateBadge(d.returnValues.totalCount)}if(this._options.enableMarkAsRead){if(d.returnValues.markAsRead){var a=this._dropdown.getItemList().children("li[data-object-id="+d.returnValues.markAsRead+"]");if(a.length){a.removeClass("interactiveDropdownItemOutstanding").data("isRead",true);a.children(".interactiveDropdownItemMarkAsRead").remove()}}else{if(d.returnValues.markAllAsRead){this.resetItems();this.updateBadge(0)}}}},_markAsRead:function(a,b){},_markAllAsRead:function(){},updateBadge:function(a){a=parseInt(a)||0;if(a){if(this._badge===null){this._badge=$('').appendTo(this._triggerElement.children("a"));this._badge.before(" ")}this._badge.text(a)}else{if(this._badge!==null){this._badge.remove()}}if(this._options.enableMarkAsRead){if(!a&&this._markAllAsReadLink!==null){this._markAllAsReadLink.remove();this._markAllAsReadLink=null}}},resetItems:function(){this._dropdown.resetItems()}});WCF.User.Panel.Notification=WCF.User.Panel.Abstract.extend({_favico:null,init:function(b){b.enableMarkAsRead=true;this._super($("#userNotifications"),"userNotifications",b);try{this._favico=new Favico({animation:"none",type:"circle"});if(this._badge!==null){var a=parseInt(this._badge.text())||0;this._favico.badge(a)}}catch(c){console.debug("[WCF.User.Panel.Notification] Failed to initialized Favico: "+c.message)}WCF.System.PushNotification.addCallback("userNotificationCount",$.proxy(this.updateUserNotificationCount,this))},_initDropdown:function(){var a=this._super();$('
  • ').appendTo(a.getLinkList());return a},_load:function(){this._proxy.setOption("data",{actionName:"getOutstandingNotifications",className:"wcf\\data\\user\\notification\\UserNotificationAction"});this._proxy.sendRequest()},_markAsRead:function(a,b){this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",objectIDs:[b]});this._proxy.sendRequest()},_markAllAsRead:function(a){this._proxy.setOption("data",{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"});this._proxy.sendRequest()},resetItems:function(){this._super();if(this._markAllAsReadLink){this._markAllAsReadLink.remove();this._markAllAsReadLink=null}},updateBadge:function(a){a=parseInt(a)||0;if(this._favico!==null){this._favico.badge(a)}this._super(a)},updateUserNotificationCount:function(a){if(this._dropdown!==null){this._dropdown.resetItems()}this.updateBadge(a)}});WCF.User.Panel.UserMenu=WCF.User.Panel.Abstract.extend({init:function(){this._super($("#userMenu"),"userMenu",{pointerOffset:"13px",staticDropdown:true})}});WCF.User.QuickLogin={_dialog:null,_loginMessage:null,init:function(){$(".loginLink").click($.proxy(this._render,this));$("#loginForm input[name=url]").val(function(a,b){return window.location.protocol+"//"+window.location.host+b})},show:function(a){if(a){if(this._loginMessage===null){this._loginMessage=$('

    ').hide().prependTo($("#loginForm > form"))}this._loginMessage.show().text(a)}else{if(this._loginMessage!==null){this._loginMessage.hide()}}this._render()},_render:function(a){if(a!==undefined){a.preventDefault()}if(this._dialog===null){this._dialog=$("#loginForm").wcfDialog({title:WCF.Language.get("wcf.user.login")});this._dialog.find("#username").focus()}else{this._dialog.wcfDialog("open")}}};WCF.User.Profile={};WCF.User.Profile.ActivityPointList={_cache:{},_dialog:null,_didInit:false,_proxy:null,init:function(){if(this._didInit){return}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=true},_init:function(){$(".activityPointsDisplay").removeClass("activityPointsDisplay").click($.proxy(this._click,this))},_click:function(b){b.preventDefault();var a=$(b.currentTarget).data("userID");if(this._cache[a]===undefined){this._proxy.setOption("data",{actionName:"getDetailedActivityPointList",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[a]});this._proxy.sendRequest()}else{this._show(a)}},_show:function(a){if(this._dialog===null){this._dialog=$("

    "+this._cache[a]+"
    ").hide().appendTo(document.body);this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.activityPoint")})}else{this._dialog.html(this._cache[a]);this._dialog.wcfDialog("open")}},_success:function(b,c,a){this._cache[b.returnValues.userID]=b.returnValues.template;this._show(b.returnValues.userID)}};WCF.User.Profile.Follow=Class.extend({_button:null,_following:false,_proxy:null,_userID:0,init:function(a,b){this._following=b;this._userID=a;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._createButton();this._showButton()},_createButton:function(){this._button=$('
  • ").prependTo($("#profileButtonContainer"));this._button.click($.proxy(this._execute,this))},_execute:function(b){b.preventDefault();var a=(this._following)?"unfollow":"follow";this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}});this._proxy.sendRequest()},_showButton:function(){if(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")}else{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(b,d,a){this._following=b.returnValues.following;this._showButton();var c=new WCF.System.Notification();c.show()}});WCF.User.Profile.IgnoreUser=Class.extend({_button:null,_isIgnoredUser:false,_proxy:null,_userID:0,init:function(b,a){this._userID=b;this._isIgnoredUser=a;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._updateButton();this._button.click($.proxy(this._click,this))},_click:function(a){a.preventDefault();var b=(this._isIgnoredUser)?"unignore":"ignore";this._proxy.setOption("data",{actionName:b,className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}});this._proxy.sendRequest()},_success:function(b,d,a){this._isIgnoredUser=b.returnValues.isIgnoredUser;this._updateButton();var c=new WCF.System.Notification();c.show()},_updateButton:function(){if(this._button===null){this._button=$('
  • ").prependTo($("#profileButtonContainer"))}this._button.find(".button").data("tooltip",WCF.Language.get("wcf.user.button."+(this._isIgnoredUser?"un":"")+"ignore"));if(this._isIgnoredUser){this._button.find(".button").addClass("active").children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank")}else{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(a){this._profileContent=$("#profileContent");this._userID=a;var c=this._profileContent.data("active");var b=false;this._profileContent.find("div.tabMenuContent").each($.proxy(function(e,d){var f=$(d).wcfIdentify();if(c===f){this._hasContent[f]=true}else{this._hasContent[f]=false;b=true}},this));if(b){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(d,f){var e=$(f);if(e.hasClass("ui-state-active")){if(d){this._loadContent(null,{newPanel:$("#"+e.attr("aria-controls"))})}return false}},this))}},_loadContent:function(b,c){var d=$(c.newPanel);var a=d.attr("id");if(!this._hasContent[a]){this._proxy.setOption("data",{actionName:"getContent",className:"wcf\\data\\user\\profile\\menu\\item\\UserProfileMenuItemAction",parameters:{data:{containerID:a,menuItem:d.data("menuItem"),userID:this._userID}}});this._proxy.sendRequest()}},_success:function(d,e,c){var b=d.returnValues.containerID;this._hasContent[b]=true;var a=this._profileContent.find("#"+b);$("
    "+d.returnValues.template+"
    ").hide().appendTo(a);a.children("div").wcfBlindIn()}});WCF.User.Profile.Editor=Class.extend({_actionName:"",_buttons:{},_cachedTemplate:"",_proxy:null,_tab:null,_userID:0,init:function(a,b){this._actionName="";this._cachedTemplate="";this._tab=$("#about");this._userID=a;this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._initButtons();if(b){this._beginEdit()}},_initButtons:function(){var a=$("#profileButtonContainer");this._buttons={beginEdit:$('
  • '+WCF.Language.get("wcf.user.editProfile")+"
  • ").click($.proxy(this._beginEdit,this)).appendTo(a)}},_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 b=/values\[([a-zA-Z0-9._-]+)\]/;var a={};this._tab.find("input, textarea, select").each(function(e,g){var d=$(g);var f=null;switch(d.getTagName()){case"input":var c=d.attr("type");if((c==="radio"||c==="checkbox")&&!d.prop("checked")){return}break;case"textarea":if(d.data("redactor")){f=d.redactor("wutil.getText")}break}var h=d.attr("name");if(b.test(h)){a[RegExp.$1]=(f===null)?d.val():f}});this._proxy.setOption("data",{actionName:"save",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[this._userID],parameters:{values:a}});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(b,c,a){switch(this._actionName){case"beginEdit":this._prepareEdit(b);break;case"save":if(b.returnValues.success){this._cachedTemplate=b.returnValues.template;this._restore()}else{this._prepareEdit(b,true)}break}},_prepareEdit:function(b,c){this._destroyEditor();var a=this;this._tab.html(function(e,d){if(c!==true){a._cachedTemplate=d}return b.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(d){if(d.which===$.ui.keyCode.ENTER){a._save();d.preventDefault();return false}})},_destroyEditor:function(){this._tab.find("textarea").each(function(b,a){var c=$(a);if(c.data("redactor")){c.redactor("core.destroy")}})}});WCF.User.Registration={};WCF.User.Registration.Validation=Class.extend({_actionName:"",_className:"",_confirmElement:null,_element:null,_errorMessages:{},_options:{},_proxy:null,init:function(b,c,a){this._element=b;this._element.blur($.proxy(this._blur,this));this._confirmElement=c||null;if(this._confirmElement!==null){this._confirmElement.blur($.proxy(this._blurConfirm,this))}a=a||{};this._setOptions(a);this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this),showLoadingOverlay:false});this._setErrorMessages()},_setOptions:function(a){},_setErrorMessages:function(){this._errorMessages={ajaxError:"",notEqual:""}},_blur:function(b){var a=this._element.val();if(!a){return this._showError(this._element,WCF.Language.get("wcf.global.form.error.empty"))}if(this._confirmElement!==null){var c=this._confirmElement.val();if(c!=""&&a!=c){return this._showError(this._confirmElement,this._errorMessages.notEqual)}}if(!this._validateOptions()){return}this._proxy.setOption("data",{actionName:this._actionName,className:this._className,parameters:this._getParameters()});this._proxy.sendRequest()},_getParameters:function(){return{}},_validateOptions:function(){return true},_blurConfirm:function(b){var a=this._confirmElement.val();if(!a){return this._showError(this._confirmElement,WCF.Language.get("wcf.global.form.error.empty"))}this._blur(b)},_success:function(b,c,a){if(b.returnValues.isValid){this._showSuccess(this._element);if(this._confirmElement!==null&&this._confirmElement.val()){this._showSuccess(this._confirmElement)}}else{this._showError(this._element,WCF.Language.get(this._errorMessages.ajaxError+b.returnValues.error))}},_showError:function(a,b){a.parent().parent().addClass("formError").removeClass("formSuccess");var c=a.parent().find("small.innerError");if(!c.length){c=$("").addClass("innerError").insertAfter(a)}c.text(b)},_showSuccess:function(a){a.parent().parent().addClass("formSuccess").removeClass("formError");a.next("small.innerError").remove()}});WCF.User.Registration.Validation.Username=WCF.User.Registration.Validation.extend({_actionName:"validateUsername",_className:"wcf\\data\\user\\UserRegistrationAction",_setOptions:function(a){this._options=$.extend(true,{minlength:3,maxlength:25},a)},_setErrorMessages:function(){this._errorMessages={ajaxError:"wcf.user.username.error."}},_validateOptions:function(){var a=this._element.val();if(a.lengththis._options.maxlength){this._showError(this._element,WCF.Language.get("wcf.user.username.error.notValid"));return false}return true},_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));if($.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(){if(this._email.val()==""){this._username.enable();this._username.parents("dl:eq(0)").removeClass("disabled")}else{this._username.disable();this._username.parents("dl:eq(0)").addClass("disabled")}},_checkUsername:function(){if(this._username.val()==""){this._email.enable();this._email.parents("dl:eq(0)").removeClass("disabled")}else{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(a){if(a==="confirm"){new WCF.Action.Proxy({autoSend:true,data:{actionName:"markAllAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction"},success:function(){window.location.reload()}})}})});this._convertList()},_convertList:function(){$(".userNotificationItemList > .notificationItem").each((function(c,d){var a=$(d);if(!a.data("isRead")){a.find("a:not(.userLink)").prop("href",a.data("link"));var b=$('').appendTo(a);b.click($.proxy(this._markAsConfirmed,this))}if(!a.find("a").length){a.find(".details > p:eq(0)").html(function(f,e){return''+e+""})}}).bind(this));WCF.DOMNodeInsertedHandler.execute()},_markAsConfirmed:function(a){a.preventDefault();var b=$(a.currentTarget).parents(".notificationItem:eq(0)").data("objectID");this._proxy.setOption("data",{actionName:"markAsConfirmed",className:"wcf\\data\\user\\notification\\UserNotificationAction",objectIDs:[b]});this._proxy.sendRequest();return false},_success:function(c,d,b){var a=$(".userNotificationItemList > .notificationItem[data-object-id="+c.returnValues.markAsRead+"]");a.data("isRead",true);a.find(".newContentBadge").remove();a.find(".notificationItemMarkAsConfirmed").remove();a.removeClass("notificationUnconfirmed")}});WCF.User.SignaturePreview=WCF.Message.Preview.extend({_handleResponse:function(b){var a=$("#previewContainer");if(!a.length){a=$('
    '+WCF.Language.get("wcf.global.preview")+"
    ").insertBefore($("#signatureContainer")).wcfFadeIn()}a.children("div").first().html(b.returnValues.message)}});WCF.User.RecentActivityLoader=Class.extend({_container:null,_filteredByFollowedUsers:false,_loadButton:null,_proxy:null,_userID:0,init:function(b,a){this._container=$("#recentActivities");this._filteredByFollowedUsers=(a===true);this._userID=b;if(this._userID!==null&&!this._userID){console.debug("[WCF.User.RecentActivityLoader] Invalid parameter 'userID' given.");return}this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});if(this._container.children("li").length){this._loadButton=$('
  • ").appendTo(this._container);this._loadButton=this._loadButton.children("button").click($.proxy(this._click,this))}else{$('
  • '+WCF.Language.get("wcf.user.recentActivity.noMoreEntries")+"
  • ").appendTo(this._container)}if(WCF.User.userID){$(".jsRecentActivitySwitchContext .button").click($.proxy(this._switchContext,this))}},_click:function(){this._loadButton.enable();var a={lastEventID:this._container.data("lastEventID"),lastEventTime:this._container.data("lastEventTime")};if(this._userID){a.userID=this._userID}else{if(this._filteredByFollowedUsers){a.filteredByFollowedUsers=1}}this._proxy.setOption("data",{actionName:"load",className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction",parameters:a});this._proxy.sendRequest()},_switchContext:function(a){a.preventDefault();if(!$(a.currentTarget).hasClass("active")){new WCF.Action.Proxy({autoSend:true,data:{actionName:"switchContext",className:"wcf\\data\\user\\activity\\event\\UserActivityEventAction"},success:function(){window.location.hash="#dashboardBoxRecentActivity";window.location.reload()}})}},_success:function(b,c,a){if(b.returnValues.template){$(b.returnValues.template).insertBefore(this._loadButton.parent());this._container.data("lastEventTime",b.returnValues.lastEventTime);this._container.data("lastEventID",b.returnValues.lastEventID);this._loadButton.enable()}else{$(""+WCF.Language.get("wcf.user.recentActivity.noMoreEntries")+"").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(a){this._container=$("#likeList");this._userID=a;if(!this._userID){console.debug("[WCF.User.RecentActivityLoader] Invalid parameter 'userID' given.");return}this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});var b=$('
  • "+WCF.Language.get("wcf.like.likes.noMoreEntries")+"
  • ").appendTo(this._container);this._loadButton=b.children("button").click($.proxy(this._click,this));this._noMoreEntries=b.children("small").hide();if(this._container.find("> li").length==2){this._loadButton.hide();this._noMoreEntries.show()}$("#likeType .button").click($.proxy(this._clickLikeType,this));$("#likeValue .button").click($.proxy(this._clickLikeValue,this))},_clickLikeType:function(a){var b=$(a.currentTarget);if(this._likeType!=b.data("likeType")){this._likeType=b.data("likeType");$("#likeType .button").removeClass("active");b.addClass("active");this._reload()}},_clickLikeValue:function(a){var b=$(a.currentTarget);if(this._likeValue!=b.data("likeValue")){this._likeValue=b.data("likeValue");$("#likeValue .button").removeClass("active");b.addClass("active");$("#likeType > li:first-child > .button").text(WCF.Language.get("wcf.like."+(this._likeValue==-1?"dis":"")+"likesReceived"));$("#likeType > li:last-child > .button").text(WCF.Language.get("wcf.like."+(this._likeValue==-1?"dis":"")+"likesGiven"));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 a={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:a});this._proxy.sendRequest()},_success:function(b,c,a){if(b.returnValues.template){$(b.returnValues.template).insertBefore(this._loadButton.parent());this._container.data("lastLikeTime",b.returnValues.lastLikeTime);this._noMoreEntries.hide();this._loadButton.show().enable()}else{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:false});WCF.System.ObjectStore.add("WCF.User.ProfilePreview",this)},_loadContent:function(){var a=$("#"+this._activeElementID);var c=a.data("userID");if(this._userProfiles[c]){this._insertContent(this._activeElementID,this._userProfiles[c],true)}else{this._proxy.setOption("data",{actionName:"getUserProfile",className:"wcf\\data\\user\\UserProfileAction",objectIDs:[c]});var d=this._activeElementID;var b=this;this._proxy.setOption("success",function(f,g,e){b._userProfiles[c]=f.returnValues.template;b._insertContent(d,f.returnValues.template,true)});this._proxy.setOption("failure",function(f,e,h,g){b._userProfiles[c]=f.message;b._insertContent(d,f.message,true);return false});this._proxy.sendRequest()}},purge:function(a){delete this._userProfiles[a];this._data={}}});WCF.User.Action={};WCF.User.Action.Follow=Class.extend({_containerList:null,_followButtonSelector:".jsFollowButton",_userID:0,init:function(b,a){if(!b.length){return}this._containerList=b;if(a){this._followButtonSelector=a}this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._containerList.each($.proxy(function(d,c){$(c).find(this._followButtonSelector).click($.proxy(this._click,this))},this))},_click:function(b){b.preventDefault();var a=$(b.target);if(!a.is("a")){a=a.closest("a")}this._userID=a.data("objectID");this._proxy.setOption("data",{actionName:a.data("following")?"unfollow":"follow",className:"wcf\\data\\user\\follow\\UserFollowAction",parameters:{data:{userID:this._userID}}});this._proxy.sendRequest()},_success:function(c,e,b){this._containerList.each($.proxy(function(g,f){var h=$(f).find(this._followButtonSelector).get(0);if(h&&$(h).data("objectID")==this._userID){h=$(h);if(c.returnValues.following){h.data("tooltip",WCF.Language.get("wcf.user.button.unfollow")).children(".icon").removeClass("icon-plus").addClass("icon-minus")}else{h.data("tooltip",WCF.Language.get("wcf.user.button.follow")).children(".icon").removeClass("icon-minus").addClass("icon-plus")}h.data("following",c.returnValues.following);return false}},this));var d=new WCF.System.Notification();d.show();var a=this;WCF.System.ObjectStore.invoke("WCF.User.ProfilePreview",function(f){f.purge(a._userID)})}});WCF.User.Action.Ignore=Class.extend({_containerList:null,_ignoreButtonSelector:".jsIgnoreButton",_userID:0,init:function(a,b){if(!a.length){return}this._containerList=a;if(b){this._ignoreButtonSelector=b}this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});this._containerList.each($.proxy(function(d,c){$(c).find(this._ignoreButtonSelector).click($.proxy(this._click,this))},this))},_click:function(b){b.preventDefault();var a=$(b.target);if(!a.is("a")){a=a.closest("a")}this._userID=a.data("objectID");this._proxy.setOption("data",{actionName:a.data("ignored")?"unignore":"ignore",className:"wcf\\data\\user\\ignore\\UserIgnoreAction",parameters:{data:{ignoreUserID:this._userID}}});this._proxy.sendRequest()},_success:function(c,e,b){this._containerList.each($.proxy(function(g,f){var h=$(f).find(this._ignoreButtonSelector).get(0);if(h&&$(h).data("objectID")==this._userID){h=$(h);if(c.returnValues.isIgnoredUser){h.data("tooltip",WCF.Language.get("wcf.user.button.unignore")).children(".icon").removeClass("icon-ban-circle").addClass("icon-circle-blank")}else{h.data("tooltip",WCF.Language.get("wcf.user.button.ignore")).children(".icon").removeClass("icon-circle-blank").addClass("icon-ban-circle")}h.data("ignored",c.returnValues.isIgnoredUser);return false}},this));var d=new WCF.System.Notification();d.show();var a=this;WCF.System.ObjectStore.invoke("WCF.User.ProfilePreview",function(f){f.purge(a._userID)})}});WCF.User.Avatar={};WCF.User.Avatar.Crop=Class.extend({_cropX:0,_cropY:0,_dialog:null,_proxy:null,MAX_THUMBNAIL_SIZE:128,init:function(a){this._avatarID=a;if(this._dialog){this.destroy()}this._dialog=null;if(!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(a){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(b){if(!this._dialog){this._dialog=$("
    ").hide().appendTo(document.body);this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.avatar.type.custom.crop")})}this._dialog.html(b.returnValues.template);this._dialog.find('button[data-type="save"]').click($.proxy(this._crop,this));this._cropX=b.returnValues.cropX;this._cropY=b.returnValues.cropY;var a=$("#userAvatarCropSelection > img");$("#userAvatarCropSelection").css({height:a.height()+"px",width:a.width()+"px"});$("#userAvatarCropOverlaySelection").css({"background-image":"url("+a.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(){if(!this._dialog){this._proxy.setOption("data",{actionName:"getCropDialog",className:"wcf\\data\\user\\avatar\\UserAvatarAction",objectIDs:[this._avatarID]});this._proxy.sendRequest()}else{this._dialog.wcfDialog("open")}},_success:function(b,d,a){switch(b.actionName){case"getCropDialog":this._getCropDialog(b);break;case"cropAvatar":$("#avatarUpload > dt > img").replaceWith($('').css({width:"96px",height:"96px"}).click($.proxy(this._showCropDialog,this)));WCF.DOMNodeInsertedHandler.execute();this._dialog.wcfDialog("close");var c=new WCF.System.Notification();c.show();break}},_updateSelection:function(a,b){this._cropX=b.position.left;this._cropY=b.position.top;$("#userAvatarCropOverlaySelection").css({"background-position":-b.position.left+"px "+-b.position.top+"px"})}});WCF.User.Avatar.Upload=WCF.Upload.extend({_avatarCrop:null,_userID:0,init:function(b,a){this._super($("#avatarUpload > dd > div"),undefined,"wcf\\data\\user\\avatar\\UserAvatarAction");this._userID=b||0;this._avatarCrop=a;$("#avatarForm input[type=radio]").change(function(){if($(this).val()=="custom"){$("#avatarUpload > dd > div").show()}else{$("#avatarUpload > dd > div").hide()}});if(!$("#avatarForm input[type=radio][value=custom]:checked").length){$("#avatarUpload > dd > div").hide()}},_initFile:function(a){return $("#avatarUpload > dt > img")},_success:function(c,a){if(a.returnValues.url){this._updateImage(a.returnValues.url,a.returnValues.canCrop);if(a.returnValues.canCrop){if(!this._avatarCrop){this._avatarCrop=new WCF.User.Avatar.Crop(a.returnValues.avatarID)}else{this._avatarCrop.init(a.returnValues.avatarID)}}else{if(this._avatarCrop){this._avatarCrop.destroy();this._avatarCrop=null}}$("#avatarUpload > dd > .innerError").remove();var b=new WCF.System.Notification(WCF.Language.get("wcf.user.avatar.upload.success"));b.show()}else{if(a.returnValues.errorType){this._getInnerErrorElement().text(WCF.Language.get("wcf.user.avatar.upload.error."+a.returnValues.errorType))}}},_updateImage:function(b,a){$("#avatarUpload > dt > img").remove();var c=$('').css({height:"auto","max-height":"96px","max-width":"96px",width:"auto"});if(a){c.addClass("userAvatarCrop").addClass("jsTooltip");c.attr("title",WCF.Language.get("wcf.user.avatar.type.custom.crop"))}$("#avatarUpload > dt").prepend(c);WCF.DOMNodeInsertedHandler.execute()},_getInnerErrorElement:function(){var a=$("#avatarUpload > dd > .innerError");if(!a.length){a=$('');$("#avatarUpload > dd").append(a)}return a},_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(c,a,b){this._additionalParameters=b||{};this._cache={};this._className=c;this._dialog=null;this._dialogTitle=a;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(b,c){if(c&&c.activePage){this._pageNo=c.activePage}if(this._pageCount!=0&&(this._pageNo<1||this._pageNo>this._pageCount)){console.debug("[WCF.User.List] Cannot access page "+this._pageNo+" of "+this._pageCount);return}if(this._cache[this._pageNo]){var a=false;if(this._dialog===null){this._dialog=$('
    ').hide().appendTo(document.body);a=true}this._dialog.empty();this._dialog.html(this._cache[this._pageNo]);if(this._pageCount>1){this._dialog.find(".jsPagination").wcfPages({activePage:this._pageNo,maxPage:this._pageCount}).on("wcfpagesswitched",$.proxy(this._showPage,this))}if(a){this._dialog.wcfDialog({title:this._dialogTitle})}else{this._dialog.wcfDialog("open").wcfDialog("render")}}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(b,c,a){if(b.returnValues.pageCount){this._pageCount=b.returnValues.pageCount}this._cache[this._pageNo]=b.returnValues.template;this._showPage()}});WCF.User.ObjectWatch={};WCF.User.ObjectWatch.Subscribe=Class.extend({_buttonSelector:".jsSubscribeButton",_buttons:{},_dialog:null,_notification:null,_reloadOnUnsubscribe:false,init:function(a){this._buttons={};this._notification=null;this._reloadOnUnsubscribe=(a===true);this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)});$(this._buttonSelector).each($.proxy(function(b,c){var e=$(c);var d=e.data("objectID");this._buttons[d]=e.click($.proxy(this._click,this))},this));WCF.System.Event.addListener("com.woltlab.wcf.objectWatch","update",$.proxy(this._updateSubscriptionStatus,this))},_click:function(a){a.preventDefault();var b=$(a.currentTarget);this._proxy.setOption("data",{actionName:"manageSubscription",className:"wcf\\data\\user\\object\\watch\\UserObjectWatchAction",parameters:{objectID:b.data("objectID"),objectType:b.data("objectType")}});this._proxy.sendRequest()},_success:function(c,e,b){if(c.actionName==="manageSubscription"){if(this._dialog===null){this._dialog=$("
    "+c.returnValues.template+"
    ").hide().appendTo(document.body);this._dialog.wcfDialog({title:WCF.Language.get("wcf.user.objectWatch.manageSubscription")})}else{this._dialog.html(c.returnValues.template);this._dialog.wcfDialog("open")}this._dialog.find(".formSubmit > .jsButtonSave").data("objectID",c.returnValues.objectID).click($.proxy(this._save,this));var a=this._dialog.find("input[name=enableNotification]").disable();this._dialog.find("input[name=subscribe]").change(function(f){var g=$(f.currentTarget);if(g.val()==1){a.enable()}else{a.disable()}});var d=this._dialog.find("input[name=subscribe]:checked");if(d.length&&d.val()==1){a.enable()}}else{if(c.actionName==="saveSubscription"&&this._dialog.is(":visible")){this._dialog.wcfDialog("close");this._updateSubscriptionStatus({isSubscribed:c.returnValues.subscribe,objectID:c.returnValues.objectID});if(this._notification===null){this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit"))}this._notification.show()}}},_save:function(b){var d=this._buttons[$(b.currentTarget).data("objectID")];var c=this._dialog.find("input[name=subscribe]:checked").val();var a=(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:a,objectID:d.data("objectID"),objectType:d.data("objectType"),subscribe:c}});this._proxy.sendRequest()},_updateSubscriptionStatus:function(c){var b=$(this._buttonSelector+"[data-object-id="+c.objectID+"]");var a=b.children(".icon");if(c.isSubscribed){a.removeClass("icon-bookmark-empty").addClass("icon-bookmark");b.data("isSubscribed",true)}else{a.removeClass("icon-bookmark").addClass("icon-bookmark-empty");b.data("isSubscribed",false);if(this._reloadOnUnsubscribe){window.location.reload();return}}WCF.System.Event.fireEvent("com.woltlab.wcf.objectWatch","updatedSubscription",c)}});WCF.User.InlineEditor=WCF.InlineEditor.extend({_additionalOptions:{},_dialog:null,_permissions:{},init:function(a){this._super(a);WCF.System.ObjectStore.add("WCF.User.InlineEditor",this)},_execute:function(b,d){if(!this._validate(b,d)){return false}var c={};var a=$("#"+b);if(this._additionalOptions[d]!==undefined){this._additionalOptions[d].callback(b)}else{switch(d){case"unban":case"enableAvatar":case"enableSignature":switch(d){case"unban":c.banned=0;break;case"enableAvatar":c.disableAvatar=0;break;case"enableSignature":c.disableSignature=0;break}this._proxy.setOption("data",{actionName:d,className:"wcf\\data\\user\\UserAction",objectIDs:[a.data("objectID")]});this._proxy.sendRequest();break;case"ban":case"disableAvatar":case"disableSignature":if(d=="ban"){c.banned=1}else{c[d]=1}this._showReasonDialog(a.data("objectID"),d);break;case"advanced":window.location=this._getTriggerElement(a).attr("href");break}}if($.getLength(c)){this._updateData.push({data:c,elementID:b,})}},_executeReasonAction:function(c,d,f){var b=this._dialog.data("optionName");this._dialog.find(".innerError").remove();var a="";if(!$("#"+b+"NeverExpires").is(":checked")){a=$("#"+b+"ExpiresDatePicker").val();if(!a){this._dialog.find("#"+b+"ExpiresSettings > dd > small").prepend($('').text(WCF.Language.get("wcf.global.form.error.empty")));return}}var e={};e[b+"Reason"]=$("#"+b+"Reason").val();e[b+"Expires"]=a;this._proxy.setOption("data",{actionName:b,className:"wcf\\data\\user\\UserAction",objectIDs:[this._dialog.data("userID")],parameters:e});this._proxy.sendRequest()},_getPermission:function(a){if(this._permissions[a]){return this._permissions[a]}return 0},_getTriggerElement:function(a){return a.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 a in this._additionalOptions){this._options.push({label:this._additionalOptions[a].label,optionName:a})}this._options.push({optionName:"divider"});this._options.push({label:WCF.Language.get("wcf.user.edit"),optionName:"advanced"})},_show:function(c){var a=$(c.currentTarget);var d=a.data("elementID");if(!this._dropdowns[d]){var b=a.next(".dropdownMenu");if(b){this._dropdowns[d]=b;WCF.Dropdown.initDropdown(this._getTriggerElement(this._elements[d]),true)}}return this._super(c)},_showReasonDialog:function(a,b){if(this._dialog){this._dialog.remove()}this._dialog=$("
    ").hide().appendTo(document.body);this._dialog.append($('