Updating minified JavaScript files
authorWoltLab <woltlab@woltlab.com>
Thu, 4 Mar 2021 11:46:12 +0000 (11:46 +0000)
committerWoltLab <woltlab@woltlab.com>
Thu, 4 Mar 2021 11:46:12 +0000 (11:46 +0000)
files/js/WCF.Conversation.min.js
files/js/WCF.Conversation.tiny.min.js
files/js/WoltLabSuite.Core.Conversation.min.js
files/js/WoltLabSuite.Core.Conversation.tiny.min.js

index b33de283f7189bca44f724435ddbefb9ca928b31..21afa1f495a0774babf51796dc3d1ca496fea897 100755 (executable)
@@ -1 +1 @@
-WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each(function(index,conversation){var $conversation=$(conversation),$conversationID=$conversation.data("conversationID"),$labelIDs;self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})})},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var s=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each(function(e,a){var t=$(a);if(t.hasClass("dropdownDivider"))return!1;var n=t.find("span");s.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})}),s},update:function(e,a,t){if(this._conversations[e]){var n=this._conversations[e];switch(a){case"close":$('<li><span class="icon icon16 fa-lock jsTooltip jsIconLock" title="'+WCF.Language.get("wcf.global.state.closed")+'" /></li>').prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":var s={};WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each(function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}});var i=n.find(".columnSubject > .labelList");if(t.length){i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty();for(var o=0,l=t.length;o<l;o++){var r=s[t[o]];$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i)}}else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each(function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1}),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){if(this._conversations[e]){var n=$(".contentHeaderTitle > .contentHeaderMetaData");switch(a){case"close":$('<li><span class="icon icon16 fa-lock jsIconLock" /> '+WCF.Language.get("wcf.global.state.closed")+"</li>").appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":var s,i,o=n.find(".labelList");t.length?(s=this.getAvailableLabels(),o.length||(o=(o=$('<li><span class="icon icon16 fa-tags"></span> <ul class="labelList"></ul></li>').prependTo(n)).children("ul")),i="",t.forEach(function(a){s.forEach(function(e){e.labelID==a&&(i+='<li><span class="label badge'+(e.cssClassName?" "+e.cssClassName:"")+'">'+e.label+"</span></li>")})}),o[0].innerHTML=i):o.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(var t in a.returnValues.conversationData){var n;a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return this._editorHandler.getPermission(t,"canCloseConversation")?"close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"):!1;case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(a,e){if(!this._validate(a,e))return!1;switch(e){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],function(e){new e(elData(elById(a),"conversation-id"))});break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,a);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],function(e){e.beginEdit(elData(elById(a),"conversation-id"))});break;case"close":case"open":this._updateConversation(a,e,{isClosed:"close"===e?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+a).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+a)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){for(var e=0,a=this._updateData.length;e<a;e++){var t=this._updateData[e],n=this._elements[t.elementID].data("conversationID");switch(t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.RemoveParticipant=WCF.Action.Delete.extend({_conversationID:0,init:function(e){this._conversationID=e,this._super("wcf\\data\\conversation\\ConversationAction",".jsParticipant")},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"removeParticipant",className:this._className,objectIDs:[this._conversationID],parameters:{userID:$(e).data("objectID")}}),this.proxy.sendRequest()},_success:function(e,a,t){var n=e.returnValues.userID;for(var s in this._containers){var i=$("#"+this._containers[s]);i.find(".jsDeleteButton").data("objectID")==n&&(i.find(".userLink").addClass("conversationLeft"),i.find(".jsDeleteButton").remove())}}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var n=[];this._dialog.find("input").each(function(e,a){var t=$(a);t.is(":checked")&&n.push(t.data("labelID"))}),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:n}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){var n;if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else this._deletedLabelID?(n=new RegExp("(\\?|&)labelID="+this._deletedLabelID),window.location=window.location.toString().replace(n,"")):window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render"));var a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text()));$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children("legend").html(t),$("#labelName").val(a.text()).trigger("keyup");var n=a.data("cssClassName");$("#labelManagementList input").each(function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")}),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy(function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))},this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Preview=WCF.Popover.extend({_proxy:null,init:function(){this._super(".conversationLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.DOMNodeInsertedHandler.addCallback("WCF.Conversation.Preview",$.proxy(this._initContainers,this))},_loadContent:function(){var e=$("#"+this._activeElementID);this._proxy.setOption("data",{actionName:"getMessagePreview",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[e.data("conversationID")]});var n=this._activeElementID,s=this;this._proxy.setOption("success",function(e,a,t){s._insertContent(n,e.returnValues.template,!0)}),this._proxy.sendRequest()}}),WCF.User.Panel.Conversation=WCF.User.Panel.Abstract.extend({init:function(e){e.enableMarkAsRead=!0,this._super($("#unreadConversations"),"unreadConversations",e),WCF.System.Event.addListener("com.woltlab.wcf.conversation.userPanel","reset",function(){this.resetItems(),this.updateBadge(0),this._loadData=!0}.bind(this)),require(["EventHandler"],function(e){e.add("com.woltlab.wcf.UserMenuMobile","more",function(e){"com.woltlab.wcf.conversation"===e.identifier&&this.toggle()}.bind(this))}.bind(this))},_initDropdown:function(){var e=this._super();return this._options.canStartConversation&&$('<li><a href="'+this._options.newConversationLink+'" title="'+this._options.newConversation+'" class="jsTooltip"><span class="icon icon24 fa-plus" /></a></li>').appendTo(e.getLinkList()),e},_load:function(){this._proxy.setOption("data",{actionName:"getMixedConversationList",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_markAsRead:function(e,a){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[a]}),this._proxy.sendRequest()},_markAllAsRead:function(e){this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()}}),WCF.Conversation.MarkAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(document).on("dblclick",".conversationList .new .columnAvatar",$.proxy(this._dblclick,this))},_dblclick:function(e){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[$(e.currentTarget).parents("ol:eq(0)").data("conversationID")]}),this._proxy.sendRequest()},_success:function(n,e,a){$(".conversationList .new").each(function(e,a){var t=$(a);WCF.inArray(t.data("conversationID"),n.objectIDs)&&(t.removeClass("new"),t.find(".firstNewPost").parent().remove(),t.find(".columnAvatar").off("dblclick"))})}}),WCF.Conversation.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\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){WCF.System.Event.fireEvent("com.woltlab.wcf.conversation.userPanel","reset");var n=$(".conversationList");n.find(".new").removeClass("new"),n.find(".columnAvatar").off("dblclick")}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}}),WCF.Conversation.Message.QuoteHandler=WCF.Message.Quote.Handler.extend({init:function(e){this._super(e,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}});
\ No newline at end of file
+WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each((function(index,conversation){var $labelIDs,$conversation=$(conversation),$conversationID=$conversation.data("conversationID");self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})}))},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var e=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each((function(a,t){var n,s=$(t);if(s.hasClass("dropdownDivider"))return!1;n=s.find("span"),e.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})})),e},update:function(e,a,t){var n,s,i,o,l,r;if(this._conversations[e]){switch(n=this._conversations[e],a){case"close":$('<li><span class="icon icon16 fa-lock jsTooltip jsIconLock" title="'+WCF.Language.get("wcf.global.state.closed")+'" /></li>').prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":if(s={},WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each((function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}})),i=n.find(".columnSubject > .labelList"),t.length)for(i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty(),o=0,l=t.length;o<l;o++)r=s[t[o]],$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i);else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each((function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1})),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){var n,s,i,o;if(this._conversations[e])switch(n=$(".contentHeaderTitle > .contentHeaderMetaData"),a){case"close":$('<li><span class="icon icon16 fa-lock jsIconLock" /> '+WCF.Language.get("wcf.global.state.closed")+"</li>").appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":s=n.find(".labelList"),t.length?(i=this.getAvailableLabels(),s.length||(s=(s=$('<li><span class="icon icon16 fa-tags"></span> <ul class="labelList"></ul></li>').prependTo(n)).children("ul")),o="",t.forEach((function(e){i.forEach((function(a){a.labelID==e&&(o+='<li><span class="label badge'+(a.cssClassName?" "+a.cssClassName:"")+'">'+a.label+"</span></li>")}))})),s[0].innerHTML=o):s.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){var t,n;switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(t in a.returnValues.conversationData)a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return!!this._editorHandler.getPermission(t,"canCloseConversation")&&("close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"));case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(e,a){if(!this._validate(e,a))return!1;switch(a){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],(function(a){new a(elData(elById(e),"conversation-id"))}));break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,e);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],(function(a){a.beginEdit(elData(elById(e),"conversation-id"))}));break;case"close":case"open":this._updateConversation(e,a,{isClosed:"close"===a?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+e).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+e)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){var e,a,t,n;for(e=0,a=this._updateData.length;e<a;e++)switch(t=this._updateData[e],n=this._elements[t.elementID].data("conversationID"),t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.RemoveParticipant=WCF.Action.Delete.extend({_conversationID:0,init:function(e){this._conversationID=e,this._super("wcf\\data\\conversation\\ConversationAction",".jsParticipant")},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"removeParticipant",className:this._className,objectIDs:[this._conversationID],parameters:{userID:$(e).data("objectID")}}),this.proxy.sendRequest()},_success:function(e,a,t){var n,s,i=e.returnValues.userID;for(n in this._containers)(s=$("#"+this._containers[n])).find(".jsDeleteButton").data("objectID")==i&&(s.find(".userLink").addClass("conversationLeft"),s.find(".jsDeleteButton").remove())}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var e=[];this._dialog.find("input").each((function(a,t){var n=$(t);n.is(":checked")&&e.push(n.data("labelID"))})),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:e}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else if(this._deletedLabelID){var n=new RegExp("(\\?|&)labelID="+this._deletedLabelID);window.location=window.location.toString().replace(n,"")}else window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){var a,t,n;this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render")),a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text())),$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children("legend").html(t),$("#labelName").val(a.text()).trigger("keyup"),n=a.data("cssClassName"),$("#labelManagementList input").each((function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")})),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy((function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))}),this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Preview=WCF.Popover.extend({_proxy:null,init:function(){this._super(".conversationLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.DOMNodeInsertedHandler.addCallback("WCF.Conversation.Preview",$.proxy(this._initContainers,this))},_loadContent:function(){var e,a,t=$("#"+this._activeElementID);this._proxy.setOption("data",{actionName:"getMessagePreview",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[t.data("conversationID")]}),e=this._activeElementID,a=this,this._proxy.setOption("success",(function(t,n,s){a._insertContent(e,t.returnValues.template,!0)})),this._proxy.sendRequest()}}),WCF.User.Panel.Conversation=WCF.User.Panel.Abstract.extend({init:function(e){e.enableMarkAsRead=!0,this._super($("#unreadConversations"),"unreadConversations",e),WCF.System.Event.addListener("com.woltlab.wcf.conversation.userPanel","reset",function(){this.resetItems(),this.updateBadge(0),this._loadData=!0}.bind(this)),require(["EventHandler"],function(e){e.add("com.woltlab.wcf.UserMenuMobile","more",function(e){"com.woltlab.wcf.conversation"===e.identifier&&this.toggle()}.bind(this))}.bind(this))},_initDropdown:function(){var e=this._super();return this._options.canStartConversation&&$('<li><a href="'+this._options.newConversationLink+'" title="'+this._options.newConversation+'" class="jsTooltip"><span class="icon icon24 fa-plus" /></a></li>').appendTo(e.getLinkList()),e},_load:function(){this._proxy.setOption("data",{actionName:"getMixedConversationList",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_markAsRead:function(e,a){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[a]}),this._proxy.sendRequest()},_markAllAsRead:function(e){this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()}}),WCF.Conversation.MarkAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(document).on("dblclick",".conversationList .new .columnAvatar",$.proxy(this._dblclick,this))},_dblclick:function(e){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[$(e.currentTarget).parents("ol:eq(0)").data("conversationID")]}),this._proxy.sendRequest()},_success:function(e,a,t){$(".conversationList .new").each((function(a,t){var n=$(t);WCF.inArray(n.data("conversationID"),e.objectIDs)&&(n.removeClass("new"),n.find(".firstNewPost").parent().remove(),n.find(".columnAvatar").off("dblclick"))}))}}),WCF.Conversation.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\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){WCF.System.Event.fireEvent("com.woltlab.wcf.conversation.userPanel","reset");var n=$(".conversationList");n.find(".new").removeClass("new"),n.find(".columnAvatar").off("dblclick")}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}}),WCF.Conversation.Message.QuoteHandler=WCF.Message.Quote.Handler.extend({init:function(e){this._super(e,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}});
\ No newline at end of file
index b33de283f7189bca44f724435ddbefb9ca928b31..21afa1f495a0774babf51796dc3d1ca496fea897 100644 (file)
@@ -1 +1 @@
-WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each(function(index,conversation){var $conversation=$(conversation),$conversationID=$conversation.data("conversationID"),$labelIDs;self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})})},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var s=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each(function(e,a){var t=$(a);if(t.hasClass("dropdownDivider"))return!1;var n=t.find("span");s.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})}),s},update:function(e,a,t){if(this._conversations[e]){var n=this._conversations[e];switch(a){case"close":$('<li><span class="icon icon16 fa-lock jsTooltip jsIconLock" title="'+WCF.Language.get("wcf.global.state.closed")+'" /></li>').prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":var s={};WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each(function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}});var i=n.find(".columnSubject > .labelList");if(t.length){i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty();for(var o=0,l=t.length;o<l;o++){var r=s[t[o]];$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i)}}else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each(function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1}),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){if(this._conversations[e]){var n=$(".contentHeaderTitle > .contentHeaderMetaData");switch(a){case"close":$('<li><span class="icon icon16 fa-lock jsIconLock" /> '+WCF.Language.get("wcf.global.state.closed")+"</li>").appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":var s,i,o=n.find(".labelList");t.length?(s=this.getAvailableLabels(),o.length||(o=(o=$('<li><span class="icon icon16 fa-tags"></span> <ul class="labelList"></ul></li>').prependTo(n)).children("ul")),i="",t.forEach(function(a){s.forEach(function(e){e.labelID==a&&(i+='<li><span class="label badge'+(e.cssClassName?" "+e.cssClassName:"")+'">'+e.label+"</span></li>")})}),o[0].innerHTML=i):o.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(var t in a.returnValues.conversationData){var n;a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return this._editorHandler.getPermission(t,"canCloseConversation")?"close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"):!1;case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(a,e){if(!this._validate(a,e))return!1;switch(e){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],function(e){new e(elData(elById(a),"conversation-id"))});break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,a);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],function(e){e.beginEdit(elData(elById(a),"conversation-id"))});break;case"close":case"open":this._updateConversation(a,e,{isClosed:"close"===e?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+a).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+a)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){for(var e=0,a=this._updateData.length;e<a;e++){var t=this._updateData[e],n=this._elements[t.elementID].data("conversationID");switch(t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.RemoveParticipant=WCF.Action.Delete.extend({_conversationID:0,init:function(e){this._conversationID=e,this._super("wcf\\data\\conversation\\ConversationAction",".jsParticipant")},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"removeParticipant",className:this._className,objectIDs:[this._conversationID],parameters:{userID:$(e).data("objectID")}}),this.proxy.sendRequest()},_success:function(e,a,t){var n=e.returnValues.userID;for(var s in this._containers){var i=$("#"+this._containers[s]);i.find(".jsDeleteButton").data("objectID")==n&&(i.find(".userLink").addClass("conversationLeft"),i.find(".jsDeleteButton").remove())}}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var n=[];this._dialog.find("input").each(function(e,a){var t=$(a);t.is(":checked")&&n.push(t.data("labelID"))}),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:n}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){var n;if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else this._deletedLabelID?(n=new RegExp("(\\?|&)labelID="+this._deletedLabelID),window.location=window.location.toString().replace(n,"")):window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render"));var a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text()));$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children("legend").html(t),$("#labelName").val(a.text()).trigger("keyup");var n=a.data("cssClassName");$("#labelManagementList input").each(function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")}),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy(function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))},this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Preview=WCF.Popover.extend({_proxy:null,init:function(){this._super(".conversationLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.DOMNodeInsertedHandler.addCallback("WCF.Conversation.Preview",$.proxy(this._initContainers,this))},_loadContent:function(){var e=$("#"+this._activeElementID);this._proxy.setOption("data",{actionName:"getMessagePreview",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[e.data("conversationID")]});var n=this._activeElementID,s=this;this._proxy.setOption("success",function(e,a,t){s._insertContent(n,e.returnValues.template,!0)}),this._proxy.sendRequest()}}),WCF.User.Panel.Conversation=WCF.User.Panel.Abstract.extend({init:function(e){e.enableMarkAsRead=!0,this._super($("#unreadConversations"),"unreadConversations",e),WCF.System.Event.addListener("com.woltlab.wcf.conversation.userPanel","reset",function(){this.resetItems(),this.updateBadge(0),this._loadData=!0}.bind(this)),require(["EventHandler"],function(e){e.add("com.woltlab.wcf.UserMenuMobile","more",function(e){"com.woltlab.wcf.conversation"===e.identifier&&this.toggle()}.bind(this))}.bind(this))},_initDropdown:function(){var e=this._super();return this._options.canStartConversation&&$('<li><a href="'+this._options.newConversationLink+'" title="'+this._options.newConversation+'" class="jsTooltip"><span class="icon icon24 fa-plus" /></a></li>').appendTo(e.getLinkList()),e},_load:function(){this._proxy.setOption("data",{actionName:"getMixedConversationList",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_markAsRead:function(e,a){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[a]}),this._proxy.sendRequest()},_markAllAsRead:function(e){this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()}}),WCF.Conversation.MarkAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(document).on("dblclick",".conversationList .new .columnAvatar",$.proxy(this._dblclick,this))},_dblclick:function(e){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[$(e.currentTarget).parents("ol:eq(0)").data("conversationID")]}),this._proxy.sendRequest()},_success:function(n,e,a){$(".conversationList .new").each(function(e,a){var t=$(a);WCF.inArray(t.data("conversationID"),n.objectIDs)&&(t.removeClass("new"),t.find(".firstNewPost").parent().remove(),t.find(".columnAvatar").off("dblclick"))})}}),WCF.Conversation.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\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){WCF.System.Event.fireEvent("com.woltlab.wcf.conversation.userPanel","reset");var n=$(".conversationList");n.find(".new").removeClass("new"),n.find(".columnAvatar").off("dblclick")}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}}),WCF.Conversation.Message.QuoteHandler=WCF.Message.Quote.Handler.extend({init:function(e){this._super(e,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}});
\ No newline at end of file
+WCF.Conversation={},WCF.Conversation.EditorHandler=Class.extend({_attributes:{},_conversations:{},_permissions:{},init:function(availableLabels){this._conversations={};var self=this;$(".conversation").each((function(index,conversation){var $labelIDs,$conversation=$(conversation),$conversationID=$conversation.data("conversationID");self._conversations[$conversationID]||(self._conversations[$conversationID]=$conversation,$labelIDs=eval($conversation.data("labelIDs")),self._attributes[$conversationID]={isClosed:!!$conversation.data("isClosed"),labelIDs:$labelIDs},self._permissions[$conversationID]={canAddParticipants:!!$conversation.data("canAddParticipants"),canCloseConversation:!!$conversation.data("canCloseConversation")})}))},getPermission:function(e,a){return void 0!==this._permissions[e][a]&&!!this._permissions[e][a]},getValue:function(e,a){switch(a){case"labelIDs":return void 0===this._attributes[e].labelIDs&&(this._attributes[e].labelIDs=[]),this._attributes[e].labelIDs;case"isClosed":return!!this._attributes[e].isClosed}},countAvailableLabels:function(){return this.getAvailableLabels().length},getAvailableLabels:function(){var e=[];return WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu").children("li").each((function(a,t){var n,s=$(t);if(s.hasClass("dropdownDivider"))return!1;n=s.find("span"),e.push({cssClassName:n.data("cssClassName"),labelID:n.data("labelID"),label:n.text()})})),e},update:function(e,a,t){var n,s,i,o,l,r;if(this._conversations[e]){switch(n=this._conversations[e],a){case"close":$('<li><span class="icon icon16 fa-lock jsTooltip jsIconLock" title="'+WCF.Language.get("wcf.global.state.closed")+'" /></li>').prependTo(n.find(".statusIcons")),this._attributes[e].isClosed=1;break;case"labelIDs":if(s={},WCF.Dropdown.getDropdownMenu("conversationLabelFilter").find("li > a > span").each((function(e,a){var t=$(a);s[t.data("labelID")]={cssClassName:t.data("cssClassName"),label:t.text(),url:t.parent().attr("href")}})),i=n.find(".columnSubject > .labelList"),t.length)for(i.length||(i=$('<ul class="labelList" />').prependTo(n.find(".columnSubject"))),i.empty(),o=0,l=t.length;o<l;o++)r=s[t[o]],$('<li><a href="'+r.url+'" class="badge label'+(r.cssClassName?" "+r.cssClassName:"")+'">'+WCF.String.escapeHTML(r.label)+"</a></li>").appendTo(i);else i.length&&i.remove();break;case"open":n.find(".statusIcons li").each((function(e,a){var t=$(a);if(t.children("span.jsIconLock").length)return t.remove(),!1})),this._attributes[e].isClosed=0}WCF.Clipboard.reload()}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.EditorHandlerConversation=WCF.Conversation.EditorHandler.extend({_availableLabels:null,init:function(e){this._availableLabels=e||[],this._super()},getAvailableLabels:function(){return this._availableLabels},update:function(e,a,t){var n,s,i,o;if(this._conversations[e])switch(n=$(".contentHeaderTitle > .contentHeaderMetaData"),a){case"close":$('<li><span class="icon icon16 fa-lock jsIconLock" /> '+WCF.Language.get("wcf.global.state.closed")+"</li>").appendTo(n),this._attributes[e].isClosed=1;break;case"labelIDs":s=n.find(".labelList"),t.length?(i=this.getAvailableLabels(),s.length||(s=(s=$('<li><span class="icon icon16 fa-tags"></span> <ul class="labelList"></ul></li>').prependTo(n)).children("ul")),o="",t.forEach((function(e){i.forEach((function(a){a.labelID==e&&(o+='<li><span class="label badge'+(a.cssClassName?" "+a.cssClassName:"")+'">'+a.label+"</span></li>")}))})),s[0].innerHTML=o):s.parent().remove();break;case"open":n.find(".jsIconLock").parent().remove(),this._attributes[e].isClosed=0}else console.debug("[WCF.Conversation.EditorHandler] Unknown conversation id '"+e+"'")}}),WCF.Conversation.Clipboard=Class.extend({_editorHandler:null,init:function(e){this._editorHandler=e,WCF.System.Event.addListener("com.woltlab.wcf.clipboard","com.woltlab.wcf.conversation.conversation",function(e){null===e.responseData?this._execute(e.data.actionName,e.data.parameters):this._evaluateResponse(e.data.actionName,e.responseData)}.bind(this))},_execute:function(e,a){"com.woltlab.wcf.conversation.conversation.assignLabel"===e&&new WCF.Conversation.Label.Editor(this._editorHandler,null,a.objectIDs)},_evaluateResponse:function(e,a){var t,n;switch(e){case"com.woltlab.wcf.conversation.conversation.leave":case"com.woltlab.wcf.conversation.conversation.leavePermanently":case"com.woltlab.wcf.conversation.conversation.markAsRead":case"com.woltlab.wcf.conversation.conversation.restore":window.location.reload();break;case"com.woltlab.wcf.conversation.conversation.close":case"com.woltlab.wcf.conversation.conversation.open":for(t in a.returnValues.conversationData)a.returnValues.conversationData.hasOwnProperty(t)&&(n=a.returnValues.conversationData[t],this._editorHandler.update(t,n.isClosed?"close":"open",n))}}}),WCF.Conversation.InlineEditor=WCF.InlineEditor.extend({_editorHandler:null,_environment:"conversation",_setOptions:function(){this._options=[{label:WCF.Language.get("wcf.conversation.edit.subject"),optionName:"editSubject"},{label:WCF.Language.get("wcf.conversation.edit.close"),optionName:"close"},{label:WCF.Language.get("wcf.conversation.edit.open"),optionName:"open"},{label:WCF.Language.get("wcf.conversation.edit.assignLabel"),optionName:"assignLabel"},{optionName:"divider"},{label:WCF.Language.get("wcf.conversation.edit.addParticipants"),optionName:"addParticipants"},{label:WCF.Language.get("wcf.conversation.edit.leave"),optionName:"leave"},{label:WCF.Language.get("wcf.global.button.edit"),optionName:"edit",isQuickOption:!0}]},setEditorHandler:function(e,a){this._editorHandler=e,this._environment="list"==a?"list":"conversation"},_getTriggerElement:function(e){return e.find(".jsConversationInlineEditor")},_validate:function(e,a){var t=$("#"+e).data("conversationID");switch(a){case"addParticipants":return this._editorHandler.getPermission(t,"canAddParticipants");case"assignLabel":return!!this._editorHandler.countAvailableLabels();case"editSubject":return!!this._editorHandler.getPermission(t,"canCloseConversation");case"close":case"open":return!!this._editorHandler.getPermission(t,"canCloseConversation")&&("close"===a?!this._editorHandler.getValue(t,"isClosed"):this._editorHandler.getValue(t,"isClosed"));case"leave":return!0;case"edit":return!!$("#"+e).data("isDraft")}return!1},_execute:function(e,a){if(!this._validate(e,a))return!1;switch(a){case"addParticipants":require(["WoltLabSuite/Core/Conversation/Ui/Participant/Add"],(function(a){new a(elData(elById(e),"conversation-id"))}));break;case"assignLabel":new WCF.Conversation.Label.Editor(this._editorHandler,e);break;case"editSubject":require(["WoltLabSuite/Core/Conversation/Ui/Subject/Editor"],(function(a){a.beginEdit(elData(elById(e),"conversation-id"))}));break;case"close":case"open":this._updateConversation(e,a,{isClosed:"close"===a?1:0});break;case"leave":new WCF.Conversation.Leave([$("#"+e).data("conversationID")],this._environment);break;case"edit":window.location=this._getTriggerElement($("#"+e)).prop("href")}},_updateConversation:function(e,a,t){var n=this._elements[e].data("conversationID");switch(a){case"close":case"editSubject":case"open":this._updateData.push({elementID:e,optionName:a,data:t}),this._proxy.setOption("data",{actionName:a,className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[n]}),this._proxy.sendRequest()}},_updateState:function(){var e,a,t,n;for(e=0,a=this._updateData.length;e<a;e++)switch(t=this._updateData[e],n=this._elements[t.elementID].data("conversationID"),t.optionName){case"close":case"editSubject":case"open":this._editorHandler.update(n,t.optionName,t.data)}}}),WCF.Conversation.Leave=Class.extend({_conversationIDs:[],_dialog:null,_environment:"",_proxy:null,init:function(e,a){this._conversationIDs=e,this._dialog=null,this._environment=a,this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLeaveForm",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"getLeaveForm":this._showDialog(e);break;case"hideConversation":"conversation"===this._environment?window.location=e.returnValues.redirectURL:window.location.reload()}},_showDialog:function(e){null===this._dialog&&(this._dialog=$("#leaveDialog"),this._dialog.length||(this._dialog=$('<div id="leaveDialog" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.leave.title")}),this._dialog.wcfDialog("render"),this._dialog.find("#hideConversation").click($.proxy(this._click,this))},_click:function(){var e=this._dialog.find("input[type=radio]:checked");1===e.length&&(this._proxy.setOption("data",{actionName:"hideConversation",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:this._conversationIDs,parameters:{hideConversation:e.val()}}),this._proxy.sendRequest())}}),WCF.Conversation.RemoveParticipant=WCF.Action.Delete.extend({_conversationID:0,init:function(e){this._conversationID=e,this._super("wcf\\data\\conversation\\ConversationAction",".jsParticipant")},_sendRequest:function(e){this.proxy.setOption("data",{actionName:"removeParticipant",className:this._className,objectIDs:[this._conversationID],parameters:{userID:$(e).data("objectID")}}),this.proxy.sendRequest()},_success:function(e,a,t){var n,s,i=e.returnValues.userID;for(n in this._containers)(s=$("#"+this._containers[n])).find(".jsDeleteButton").data("objectID")==i&&(s.find(".userLink").addClass("conversationLeft"),s.find(".jsDeleteButton").remove())}}),WCF.Conversation.Label={},WCF.Conversation.Label.Editor=Class.extend({_conversationIDs:0,_dialog:null,_editorHandler:null,_notification:null,_proxy:null,init:function(e,a,t){this._conversationIDs=a?[$("#"+a).data("conversationID")]:t,this._dialog=null,this._editorHandler=e,this._notification=new WCF.System.Notification(WCF.Language.get("wcf.global.success.edit")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),this._loadDialog()},_loadDialog:function(){this._proxy.setOption("data",{actionName:"getLabelForm",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs}}),this._proxy.sendRequest()},_success:function(e,a,t){switch(e.returnValues.actionName){case"assignLabel":this._assignLabels(e);break;case"getLabelForm":this._renderDialog(e)}},_renderDialog:function(e){null===this._dialog&&(this._dialog=$("#conversationLabelForm"),this._dialog.length||(this._dialog=$('<div id="conversationLabelForm" />').hide().appendTo(document.body))),this._dialog.html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.assignLabels")}),this._dialog.wcfDialog("render"),$("#assignLabels").click($.proxy(this._save,this))},_save:function(){var e=[];this._dialog.find("input").each((function(a,t){var n=$(t);n.is(":checked")&&e.push(n.data("labelID"))})),this._proxy.setOption("data",{actionName:"assignLabel",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{conversationIDs:this._conversationIDs,labelIDs:e}}),this._proxy.sendRequest()},_assignLabels:function(e){for(var a=0,t=this._conversationIDs.length;a<t;a++)this._editorHandler.update(this._conversationIDs[a],"labelIDs",e.returnValues.labelIDs);this._dialog.wcfDialog("close"),this._notification.show()}}),WCF.Conversation.Label.Manager=Class.extend({_deletedLabelID:0,_dialog:null,_labels:null,_link:"",_notification:"",_proxy:null,_maxLabels:0,_labelCount:0,init:function(e){this._deletedLabelID=0,this._maxLabels=0,this._labelCount=0,this._link=e,this._labels=WCF.Dropdown.getDropdownMenu("conversationLabelFilter").children(".scrollableDropdownMenu"),$("#manageLabel").click($.proxy(this._click,this)),this._notification=new WCF.System.Notification(WCF.Language.get("wcf.conversation.label.management.addLabel.success")),this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)})},_click:function(){this._proxy.setOption("data",{actionName:"getLabelManagement",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){if(null===this._dialog&&(this._dialog=$('<div id="labelManagement" />').hide().appendTo(document.body)),e.returnValues&&e.returnValues.actionName)switch(e.returnValues.actionName){case"add":this._insertLabel(e);break;case"getLabelManagement":this._maxLabels=parseInt(e.returnValues.maxLabels),this._labelCount=parseInt(e.returnValues.labelCount),this._dialog.empty().html(e.returnValues.template),this._dialog.wcfDialog({title:WCF.Language.get("wcf.conversation.label.management")}),this._dialog.wcfDialog("render"),this._bindListener()}else if(this._deletedLabelID){var n=new RegExp("(\\?|&)labelID="+this._deletedLabelID);window.location=window.location.toString().replace(n,"")}else window.location.reload()},_insertLabel:function(e){var a=$('<li><a href="'+this._link+"&labelID="+e.returnValues.labelID+'"><span class="badge label'+(e.returnValues.cssClassName?" "+e.returnValues.cssClassName:"")+'">'+e.returnValues.label+"</span></a></li>");a.find("a > span").data("labelID",e.returnValues.labelID).data("cssClassName",e.returnValues.cssClassName),this._labels.append(a),this._notification.show(),this._labelCount++,this._labelCount>=this._maxLabels&&$("#conversationLabelManagementForm").hide()},_bindListener:function(){$("#labelName").on("keyup keydown keypress",$.proxy(this._updateLabels,this)),$.browser.mozilla&&$.browser.touch&&$("#labelName").on("input",$.proxy(this._updateLabels,this)),this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").hide(),this._dialog.wcfDialog("render")),$("#addLabel").disable().click($.proxy(this._addLabel,this)),$("#editLabel").disable(),this._dialog.find(".conversationLabelList a.label").click($.proxy(this._edit,this))},_edit:function(e){var a,t,n;this._labelCount>=this._maxLabels&&($("#conversationLabelManagementForm").show(),this._dialog.wcfDialog("render")),a=$(e.currentTarget),t=WCF.Language.get("wcf.conversation.label.management.editLabel").replace(/#labelName#/,WCF.String.escapeHTML(a.text())),$("#conversationLabelManagementForm").data("labelID",a.data("labelID")).children("legend").html(t),$("#labelName").val(a.text()).trigger("keyup"),n=a.data("cssClassName"),$("#labelManagementList input").each((function(e,a){var t=$(a);t.val()==n&&t.attr("checked","checked")})),$("#addLabel").hide(),$("#editLabel").show().click($.proxy(this._editLabel,this)),$("#deleteLabel").show().click($.proxy(this._deleteLabel,this))},_editLabel:function(){this._proxy.setOption("data",{actionName:"update",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")],parameters:{data:{cssClassName:$("#labelManagementList input:checked").val(),label:$("#labelName").val()}}}),this._proxy.sendRequest()},_deleteLabel:function(){var e=WCF.Language.get("wcf.conversation.label.management.deleteLabel.confirmMessage").replace(/#labelName#/,$("#labelName").val());WCF.System.Confirmation.show(e,$.proxy((function(e){"confirm"===e&&(this._proxy.setOption("data",{actionName:"delete",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",objectIDs:[$("#conversationLabelManagementForm").data("labelID")]}),this._proxy.sendRequest(),this._deletedLabelID=$("#conversationLabelManagementForm").data("labelID"))}),this),void 0,void 0,!0)},_updateLabels:function(){var e=$.trim($("#labelName").val());e?$("#addLabel, #editLabel").enable():($("#addLabel, #editLabel").disable(),e=WCF.Language.get("wcf.conversation.label.placeholder")),$("#labelManagementList").find("span.label").text(e)},_addLabel:function(){var e=$("#labelName").val(),a=$("#labelManagementList input:checked").val();this._proxy.setOption("data",{actionName:"add",className:"wcf\\data\\conversation\\label\\ConversationLabelAction",parameters:{data:{cssClassName:a,labelName:e}}}),this._proxy.sendRequest(),this._dialog.wcfDialog("close")}}),WCF.Conversation.Preview=WCF.Popover.extend({_proxy:null,init:function(){this._super(".conversationLink"),this._proxy=new WCF.Action.Proxy({showLoadingOverlay:!1}),WCF.DOMNodeInsertedHandler.addCallback("WCF.Conversation.Preview",$.proxy(this._initContainers,this))},_loadContent:function(){var e,a,t=$("#"+this._activeElementID);this._proxy.setOption("data",{actionName:"getMessagePreview",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[t.data("conversationID")]}),e=this._activeElementID,a=this,this._proxy.setOption("success",(function(t,n,s){a._insertContent(e,t.returnValues.template,!0)})),this._proxy.sendRequest()}}),WCF.User.Panel.Conversation=WCF.User.Panel.Abstract.extend({init:function(e){e.enableMarkAsRead=!0,this._super($("#unreadConversations"),"unreadConversations",e),WCF.System.Event.addListener("com.woltlab.wcf.conversation.userPanel","reset",function(){this.resetItems(),this.updateBadge(0),this._loadData=!0}.bind(this)),require(["EventHandler"],function(e){e.add("com.woltlab.wcf.UserMenuMobile","more",function(e){"com.woltlab.wcf.conversation"===e.identifier&&this.toggle()}.bind(this))}.bind(this))},_initDropdown:function(){var e=this._super();return this._options.canStartConversation&&$('<li><a href="'+this._options.newConversationLink+'" title="'+this._options.newConversation+'" class="jsTooltip"><span class="icon icon24 fa-plus" /></a></li>').appendTo(e.getLinkList()),e},_load:function(){this._proxy.setOption("data",{actionName:"getMixedConversationList",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_markAsRead:function(e,a){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[a]}),this._proxy.sendRequest()},_markAllAsRead:function(e){this._proxy.setOption("data",{actionName:"markAllAsRead",className:"wcf\\data\\conversation\\ConversationAction"}),this._proxy.sendRequest()}}),WCF.Conversation.MarkAsRead=Class.extend({_proxy:null,init:function(){this._proxy=new WCF.Action.Proxy({success:$.proxy(this._success,this)}),$(document).on("dblclick",".conversationList .new .columnAvatar",$.proxy(this._dblclick,this))},_dblclick:function(e){this._proxy.setOption("data",{actionName:"markAsRead",className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[$(e.currentTarget).parents("ol:eq(0)").data("conversationID")]}),this._proxy.sendRequest()},_success:function(e,a,t){$(".conversationList .new").each((function(a,t){var n=$(t);WCF.inArray(n.data("conversationID"),e.objectIDs)&&(n.removeClass("new"),n.find(".firstNewPost").parent().remove(),n.find(".columnAvatar").off("dblclick"))}))}}),WCF.Conversation.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\\conversation\\ConversationAction"}),this._proxy.sendRequest()},_success:function(e,a,t){WCF.System.Event.fireEvent("com.woltlab.wcf.conversation.userPanel","reset");var n=$(".conversationList");n.find(".new").removeClass("new"),n.find(".columnAvatar").off("dblclick")}}),WCF.Conversation.Message={},WCF.Conversation.Message.InlineEditor=WCF.Message.InlineEditor.extend({init:function(e,a){this._super(e,!0,a)},_getClassName:function(){return"wcf\\data\\conversation\\message\\ConversationMessageAction"}}),WCF.Conversation.Message.QuoteHandler=WCF.Message.Quote.Handler.extend({init:function(e){this._super(e,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}});
\ No newline at end of file
index 2d3e36bdf736f4eaed077fedfe0d0711f606e463..2c1de11dfccec1c5c22ac000631a2127c547af37 100644 (file)
@@ -1 +1 @@
-define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["Ajax","Language","Ui/Dialog","Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User"],function(t,e,n,i,a){"use strict";function s(t){this.init(t)}return s.prototype={init:function(e){this._conversationId=e,t.api(this,{actionName:"getAddParticipantsForm"})},_ajaxSetup:function(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this._conversationId]}}},_ajaxSuccess:function(t){switch(t.actionName){case"addParticipants":this._handleResponse(t);break;case"getAddParticipantsForm":this._render(t)}},_handleResponse:function(t){if(t.returnValues.errorMessage){var e=elCreate("small");e.className="innerError",e.textContent=t.returnValues.errorMessage;var a=elById("participantsInput").closest(".inputItemList");a.parentNode.insertBefore(e,a.nextSibling);var s=e.nextElementSibling;return void(s&&s.classList.contains("innerError")&&elRemove(s))}t.returnValues.count&&i.show(t.returnValues.successMessage,window.location.reload.bind(window.location)),n.close(this)},_render:function(t){n.open(this,t.returnValues.template);var e=elById("addParticipants");e.disabled=!0,a.init("participantsInput",{callbackChange:function(t,n){e.disabled=0===n.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",this._submit.bind(this))},_submit:function(){for(var e=a.getValues("participantsInput"),i=[],s=[],r=0,o=e.length;r<o;r++)"group"===e[r].type?s.push(e[r].objectId):i.push(e[r].value);var c={participants:i,participantsGroupIDs:s},u=elBySel('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]',n.getDialog(this).content);u&&(c.visibility=u.value),t.api(this,{actionName:"addParticipants",parameters:c})},_dialogSetup:function(){return{id:"conversationAddParticipants",options:{title:e.get("wcf.conversation.edit.addParticipants")},source:null}}},s}),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["Ajax","EventKey","Language","Ui/Dialog","Ui/Notification"],function(t,e,n,i,a){"use strict";var s=0,r=null;return{beginEdit:function(t){s=t,i.open(this)},_saveEdit:function(e){e.preventDefault();var i=r.nextElementSibling;i&&i.classList.contains("innerError")&&elRemove(i);var a=r.value.trim();""===a?(i=elCreate("small"),i.className="innerError",i.textContent=n.get("wcf.global.form.error.empty"),r.parentNode.insertBefore(i,r.nextElementSibling)):t.api(this,{parameters:{subject:a},objectIDs:[s]})},_getCurrentValue:function(){var t="";return elBySelAll('.jsConversationSubject[data-conversation-id="'+s+'"], .conversationLink[data-object-id="'+s+'"]',void 0,function(e){t=e.textContent}),t},_ajaxSuccess:function(t){i.close(this),elBySelAll('.jsConversationSubject[data-conversation-id="'+s+'"], .conversationLink[data-object-id="'+s+'"]',void 0,function(e){e.textContent=t.returnValues.subject}),a.show()},_dialogSetup:function(){return{id:"dialogConversationSubjectEditor",options:{onSetup:function(t){r=elById("jsConversationSubject"),r.addEventListener("keyup",function(t){e.Enter(t)&&this._saveEdit(t)}.bind(this)),elBySel(".jsButtonSave",t).addEventListener(WCF_CLICK_EVENT,this._saveEdit.bind(this))}.bind(this),onShow:function(){r.value=this._getCurrentValue()}.bind(this),title:n.get("wcf.conversation.edit.subject")},source:'<dl><dt><label for="jsConversationSubject">'+n.get("wcf.global.subject")+'</label></dt><dd><input type="text" id="jsConversationSubject" class="long" maxlength="255"></dd></dl><div class="formSubmit"><button class="buttonPrimary jsButtonSave">'+n.get("wcf.global.button.save")+"</button></div>"}},_ajaxSetup:function(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}});
\ No newline at end of file
+define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User","WoltLabSuite/Core/Language"],(function(t,e,i,a,r,s,o,n,u){"use strict";a=i.__importStar(a),r=i.__importDefault(r),s=i.__importDefault(s),o=i.__importStar(o),n=i.__importStar(n),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,a.api(this,{actionName:"getAddParticipantsForm"})}_ajaxSetup(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this.conversationId]}}}_ajaxSuccess(t){switch(t.actionName){case"addParticipants":this.handleResponse(t);break;case"getAddParticipantsForm":this.render(t)}}handleResponse(t){t.returnValues.errorMessage?r.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&o.show(t.returnValues.successMessage,(()=>window.location.reload())),s.default.close(this))}render(t){s.default.open(this,t.returnValues.template);const e=document.getElementById("addParticipants");e.disabled=!0,n.init("participantsInput",{callbackChange:(t,i)=>{e.disabled=0===i.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",(()=>this.submit()))}submit(){const t=[],e=[];n.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},r=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');r&&(i.visibility=r.value),a.api(this,{actionName:"addParticipants",parameters:i})}_dialogSetup(){return{id:"conversationAddParticipants",options:{title:u.get("wcf.conversation.edit.addParticipants")},source:null}}}})),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["require","exports","tslib","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Language","WoltLabSuite/Core/Ui/Notification"],(function(t,e,i,a,r,s,o,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,a=i.__importDefault(a),r=i.__importDefault(r),s=i.__importStar(s),o=i.__importStar(o),n=i.__importStar(n);class u{constructor(t){this.objectId=t}show(){a.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?r.default.innerError(this.subject,o.get("wcf.global.form.error.empty")):(r.default.innerError(this.subject,""),s.api(this,{parameters:{subject:e},objectIDs:[this.objectId]}))}getCurrentValue(){return Array.from(document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`)).map((t=>t.textContent)).slice(-1)[0]}_ajaxSuccess(t){a.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),n.show()}_dialogSetup(){return{id:"dialogConversationSubjectEditor",options:{onSetup:t=>{this.subject=document.getElementById("jsConversationSubject"),this.subject.addEventListener("keyup",(t=>{"Enter"===t.key&&this.saveEdit(t)})),t.querySelector(".jsButtonSave").addEventListener("click",(t=>this.saveEdit(t)))},onShow:()=>{this.subject.value=this.getCurrentValue()},title:o.get("wcf.conversation.edit.subject")},source:`\n        <dl>\n          <dt>\n            <label for="jsConversationSubject">${o.get("wcf.global.subject")}</label>\n          </dt>\n          <dd>\n            <input type="text" id="jsConversationSubject" class="long" maxlength="255">\n          </dd>\n        </dl>\n        <div class="formSubmit">\n          <button class="buttonPrimary jsButtonSave">${o.get("wcf.global.button.save")}</button>\n        </div>\n      `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}}));
\ No newline at end of file
index 2d3e36bdf736f4eaed077fedfe0d0711f606e463..2c1de11dfccec1c5c22ac000631a2127c547af37 100644 (file)
@@ -1 +1 @@
-define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["Ajax","Language","Ui/Dialog","Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User"],function(t,e,n,i,a){"use strict";function s(t){this.init(t)}return s.prototype={init:function(e){this._conversationId=e,t.api(this,{actionName:"getAddParticipantsForm"})},_ajaxSetup:function(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this._conversationId]}}},_ajaxSuccess:function(t){switch(t.actionName){case"addParticipants":this._handleResponse(t);break;case"getAddParticipantsForm":this._render(t)}},_handleResponse:function(t){if(t.returnValues.errorMessage){var e=elCreate("small");e.className="innerError",e.textContent=t.returnValues.errorMessage;var a=elById("participantsInput").closest(".inputItemList");a.parentNode.insertBefore(e,a.nextSibling);var s=e.nextElementSibling;return void(s&&s.classList.contains("innerError")&&elRemove(s))}t.returnValues.count&&i.show(t.returnValues.successMessage,window.location.reload.bind(window.location)),n.close(this)},_render:function(t){n.open(this,t.returnValues.template);var e=elById("addParticipants");e.disabled=!0,a.init("participantsInput",{callbackChange:function(t,n){e.disabled=0===n.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",this._submit.bind(this))},_submit:function(){for(var e=a.getValues("participantsInput"),i=[],s=[],r=0,o=e.length;r<o;r++)"group"===e[r].type?s.push(e[r].objectId):i.push(e[r].value);var c={participants:i,participantsGroupIDs:s},u=elBySel('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]',n.getDialog(this).content);u&&(c.visibility=u.value),t.api(this,{actionName:"addParticipants",parameters:c})},_dialogSetup:function(){return{id:"conversationAddParticipants",options:{title:e.get("wcf.conversation.edit.addParticipants")},source:null}}},s}),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["Ajax","EventKey","Language","Ui/Dialog","Ui/Notification"],function(t,e,n,i,a){"use strict";var s=0,r=null;return{beginEdit:function(t){s=t,i.open(this)},_saveEdit:function(e){e.preventDefault();var i=r.nextElementSibling;i&&i.classList.contains("innerError")&&elRemove(i);var a=r.value.trim();""===a?(i=elCreate("small"),i.className="innerError",i.textContent=n.get("wcf.global.form.error.empty"),r.parentNode.insertBefore(i,r.nextElementSibling)):t.api(this,{parameters:{subject:a},objectIDs:[s]})},_getCurrentValue:function(){var t="";return elBySelAll('.jsConversationSubject[data-conversation-id="'+s+'"], .conversationLink[data-object-id="'+s+'"]',void 0,function(e){t=e.textContent}),t},_ajaxSuccess:function(t){i.close(this),elBySelAll('.jsConversationSubject[data-conversation-id="'+s+'"], .conversationLink[data-object-id="'+s+'"]',void 0,function(e){e.textContent=t.returnValues.subject}),a.show()},_dialogSetup:function(){return{id:"dialogConversationSubjectEditor",options:{onSetup:function(t){r=elById("jsConversationSubject"),r.addEventListener("keyup",function(t){e.Enter(t)&&this._saveEdit(t)}.bind(this)),elBySel(".jsButtonSave",t).addEventListener(WCF_CLICK_EVENT,this._saveEdit.bind(this))}.bind(this),onShow:function(){r.value=this._getCurrentValue()}.bind(this),title:n.get("wcf.conversation.edit.subject")},source:'<dl><dt><label for="jsConversationSubject">'+n.get("wcf.global.subject")+'</label></dt><dd><input type="text" id="jsConversationSubject" class="long" maxlength="255"></dd></dl><div class="formSubmit"><button class="buttonPrimary jsButtonSave">'+n.get("wcf.global.button.save")+"</button></div>"}},_ajaxSetup:function(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}});
\ No newline at end of file
+define("WoltLabSuite/Core/Conversation/Ui/Participant/Add",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Ui/Notification","WoltLabSuite/Core/Ui/ItemList/User","WoltLabSuite/Core/Language"],(function(t,e,i,a,r,s,o,n,u){"use strict";a=i.__importStar(a),r=i.__importDefault(r),s=i.__importDefault(s),o=i.__importStar(o),n=i.__importStar(n),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,a.api(this,{actionName:"getAddParticipantsForm"})}_ajaxSetup(){return{data:{className:"wcf\\data\\conversation\\ConversationAction",objectIDs:[this.conversationId]}}}_ajaxSuccess(t){switch(t.actionName){case"addParticipants":this.handleResponse(t);break;case"getAddParticipantsForm":this.render(t)}}handleResponse(t){t.returnValues.errorMessage?r.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&o.show(t.returnValues.successMessage,(()=>window.location.reload())),s.default.close(this))}render(t){s.default.open(this,t.returnValues.template);const e=document.getElementById("addParticipants");e.disabled=!0,n.init("participantsInput",{callbackChange:(t,i)=>{e.disabled=0===i.length},excludedSearchValues:t.returnValues.excludedSearchValues,maxItems:t.returnValues.maxItems,includeUserGroups:t.returnValues.canAddGroupParticipants&&t.returnValues.restrictUserGroupIDs.length>0,restrictUserGroupIDs:t.returnValues.restrictUserGroupIDs,csvPerType:!0}),e.addEventListener("click",(()=>this.submit()))}submit(){const t=[],e=[];n.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},r=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');r&&(i.visibility=r.value),a.api(this,{actionName:"addParticipants",parameters:i})}_dialogSetup(){return{id:"conversationAddParticipants",options:{title:u.get("wcf.conversation.edit.addParticipants")},source:null}}}})),define("WoltLabSuite/Core/Conversation/Ui/Subject/Editor",["require","exports","tslib","WoltLabSuite/Core/Ui/Dialog","WoltLabSuite/Core/Dom/Util","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Language","WoltLabSuite/Core/Ui/Notification"],(function(t,e,i,a,r,s,o,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,a=i.__importDefault(a),r=i.__importDefault(r),s=i.__importStar(s),o=i.__importStar(o),n=i.__importStar(n);class u{constructor(t){this.objectId=t}show(){a.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?r.default.innerError(this.subject,o.get("wcf.global.form.error.empty")):(r.default.innerError(this.subject,""),s.api(this,{parameters:{subject:e},objectIDs:[this.objectId]}))}getCurrentValue(){return Array.from(document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`)).map((t=>t.textContent)).slice(-1)[0]}_ajaxSuccess(t){a.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),n.show()}_dialogSetup(){return{id:"dialogConversationSubjectEditor",options:{onSetup:t=>{this.subject=document.getElementById("jsConversationSubject"),this.subject.addEventListener("keyup",(t=>{"Enter"===t.key&&this.saveEdit(t)})),t.querySelector(".jsButtonSave").addEventListener("click",(t=>this.saveEdit(t)))},onShow:()=>{this.subject.value=this.getCurrentValue()},title:o.get("wcf.conversation.edit.subject")},source:`\n        <dl>\n          <dt>\n            <label for="jsConversationSubject">${o.get("wcf.global.subject")}</label>\n          </dt>\n          <dd>\n            <input type="text" id="jsConversationSubject" class="long" maxlength="255">\n          </dd>\n        </dl>\n        <div class="formSubmit">\n          <button class="buttonPrimary jsButtonSave">${o.get("wcf.global.button.save")}</button>\n        </div>\n      `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}}));
\ No newline at end of file