From a5926e11ec918e91813fbff7c997bc99e1d815c0 Mon Sep 17 00:00:00 2001 From: WoltLab Date: Tue, 19 Apr 2022 08:45:52 +0000 Subject: [PATCH] Updating minified JavaScript files --- files/js/WoltLabSuite.Core.Conversation.min.js | 2 +- files/js/WoltLabSuite.Core.Conversation.tiny.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/js/WoltLabSuite.Core.Conversation.min.js b/files/js/WoltLabSuite.Core.Conversation.min.js index 2d5148a..90a82c9 100644 --- a/files/js/WoltLabSuite.Core.Conversation.min.js +++ b/files/js/WoltLabSuite.Core.Conversation.min.js @@ -1 +1 @@ -define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class o extends i.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=o,e.default=o})),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,o,n,s,a,r,u){"use strict";o=i.__importStar(o),n=i.__importDefault(n),s=i.__importDefault(s),a=i.__importStar(a),r=i.__importStar(r),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,o.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?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&a.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,r.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=[];r.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},n=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(i.visibility=n.value),o.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,o,n,s,a,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,o=i.__importDefault(o),n=i.__importDefault(n),s=i.__importStar(s),a=i.__importStar(a),r=i.__importStar(r);class u{constructor(t){this.objectId=t}show(){o.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,a.get("wcf.global.form.error.empty")):(n.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){o.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.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:a.get("wcf.conversation.edit.subject")},source:`\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,i,o){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,o=i.__importDefault(o),e.setup=function(){new o.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,i,o,n,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=i.__importDefault(n);class a{constructor(t,e){this.counter=0,this.stale=!0,this.view=void 0,this.button=t,this.options=e;const i=t.querySelector(".badge");if(i){const t=parseInt(i.textContent.trim());t&&(this.counter=t)}window.WCF.System.PushNotification.addCallback("userNotificationCount",(t=>{this.updateCounter(t),this.stale=!0}))}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,o.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").dispatch(),e=t.filter((t=>t.isUnread)).length;return this.updateCounter(e),this.stale=!1,t}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,o.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const i=new a(e,t);(0,s.registerProvider)(i)}r=!0}}})); \ No newline at end of file +define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class o extends i.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=o,e.default=o})),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,o,n,s,a,r,u){"use strict";o=i.__importStar(o),n=i.__importDefault(n),s=i.__importDefault(s),a=i.__importStar(a),r=i.__importStar(r),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,o.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?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&a.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,r.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=[];r.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},n=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(i.visibility=n.value),o.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,o,n,s,a,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,o=i.__importDefault(o),n=i.__importDefault(n),s=i.__importStar(s),a=i.__importStar(a),r=i.__importStar(r);class u{constructor(t){this.objectId=t}show(){o.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,a.get("wcf.global.form.error.empty")):(n.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){o.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.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:a.get("wcf.conversation.edit.subject")},source:`\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,i,o){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,o=i.__importDefault(o),e.setup=function(){new o.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,i,o,n,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=i.__importDefault(n);class a{constructor(t,e){this.counter=0,this.stale=!0,this.view=void 0,this.button=t,this.options=e;const i=t.querySelector(".badge");if(i){const t=parseInt(i.textContent.trim());t&&(this.counter=t)}}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,o.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").dispatch(),e=t.filter((t=>t.isUnread)).length;return this.updateCounter(e),this.stale=!1,t}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,o.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge","badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const i=new a(e,t);(0,s.registerProvider)(i)}r=!0}}})); \ No newline at end of file diff --git a/files/js/WoltLabSuite.Core.Conversation.tiny.min.js b/files/js/WoltLabSuite.Core.Conversation.tiny.min.js index 2d5148a..90a82c9 100644 --- a/files/js/WoltLabSuite.Core.Conversation.tiny.min.js +++ b/files/js/WoltLabSuite.Core.Conversation.tiny.min.js @@ -1 +1 @@ -define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class o extends i.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=o,e.default=o})),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,o,n,s,a,r,u){"use strict";o=i.__importStar(o),n=i.__importDefault(n),s=i.__importDefault(s),a=i.__importStar(a),r=i.__importStar(r),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,o.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?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&a.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,r.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=[];r.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},n=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(i.visibility=n.value),o.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,o,n,s,a,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,o=i.__importDefault(o),n=i.__importDefault(n),s=i.__importStar(s),a=i.__importStar(a),r=i.__importStar(r);class u{constructor(t){this.objectId=t}show(){o.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,a.get("wcf.global.form.error.empty")):(n.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){o.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.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:a.get("wcf.conversation.edit.subject")},source:`\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,i,o){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,o=i.__importDefault(o),e.setup=function(){new o.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,i,o,n,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=i.__importDefault(n);class a{constructor(t,e){this.counter=0,this.stale=!0,this.view=void 0,this.button=t,this.options=e;const i=t.querySelector(".badge");if(i){const t=parseInt(i.textContent.trim());t&&(this.counter=t)}window.WCF.System.PushNotification.addCallback("userNotificationCount",(t=>{this.updateCounter(t),this.stale=!0}))}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,o.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").dispatch(),e=t.filter((t=>t.isUnread)).length;return this.updateCounter(e),this.stale=!1,t}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,o.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const i=new a(e,t);(0,s.registerProvider)(i)}r=!0}}})); \ No newline at end of file +define("WoltLabSuite/Core/Conversation/Ui/Message/Quote",["require","exports","WoltLabSuite/Core/Ui/Message/Quote"],(function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UiConversationMessageQuote=void 0;class o extends i.UiMessageQuote{constructor(t){super(t,"wcf\\data\\conversation\\message\\ConversationMessageAction","com.woltlab.wcf.conversation.message",".message",".messageBody",".messageBody > div > div.messageText",!0)}}e.UiConversationMessageQuote=o,e.default=o})),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,o,n,s,a,r,u){"use strict";o=i.__importStar(o),n=i.__importDefault(n),s=i.__importDefault(s),a=i.__importStar(a),r=i.__importStar(r),u=i.__importStar(u);return class{constructor(t){this.conversationId=t,o.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?n.default.innerError(document.getElementById("participantsInput").closest(".inputItemList"),t.returnValues.errorMessage):(t.returnValues.count&&a.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,r.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=[];r.getValues("participantsInput").forEach((i=>{"group"===i.type?e.push(i.objectId):t.push(i.value)}));const i={participants:t,participantsGroupIDs:e,visibility:null},n=s.default.getDialog(this).content.querySelector('input[name="messageVisibility"]:checked, input[name="messageVisibility"][type="hidden"]');n&&(i.visibility=n.value),o.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,o,n,s,a,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.beginEdit=void 0,o=i.__importDefault(o),n=i.__importDefault(n),s=i.__importStar(s),a=i.__importStar(a),r=i.__importStar(r);class u{constructor(t){this.objectId=t}show(){o.default.open(this)}saveEdit(t){t.preventDefault();const e=this.subject.value.trim();""===e?n.default.innerError(this.subject,a.get("wcf.global.form.error.empty")):(n.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){o.default.close(this),document.querySelectorAll(`.jsConversationSubject[data-conversation-id="${this.objectId}"], .conversationLink[data-object-id="${this.objectId}"]`).forEach((e=>{e.textContent=t.returnValues.subject})),r.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:a.get("wcf.conversation.edit.subject")},source:`\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
\n `}}_ajaxSetup(){return{data:{actionName:"editSubject",className:"wcf\\data\\conversation\\ConversationAction"}}}}let c;e.beginEdit=function(t){c=new u(t),c.show()}})),define("WoltLabSuite/Core/Conversation/Ui/Object/Action/RemoveParticipant",["require","exports","tslib","WoltLabSuite/Core/Ui/Object/Action/Handler"],(function(t,e,i,o){"use strict";function n(t){t.objectElement.querySelector(".userLink").classList.add("conversationLeft"),t.objectElement.querySelector(".jsObjectAction[data-object-action='removeParticipant']").remove()}Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,o=i.__importDefault(o),e.setup=function(){new o.default("removeParticipant",[],n)}})),define("WoltLabSuite/Core/Conversation/Ui/User/Menu/Data/Conversation",["require","exports","tslib","WoltLabSuite/Core/Ajax","WoltLabSuite/Core/Ui/User/Menu/View","WoltLabSuite/Core/Ui/User/Menu/Manager"],(function(t,e,i,o,n,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0,n=i.__importDefault(n);class a{constructor(t,e){this.counter=0,this.stale=!0,this.view=void 0,this.button=t,this.options=e;const i=t.querySelector(".badge");if(i){const t=parseInt(i.textContent.trim());t&&(this.counter=t)}}getPanelButton(){return this.button}getMenuButtons(){const t=[];return this.options.canStartConversation&&t.push({icon:'',link:this.options.newConversationLink,name:"newConversation",title:this.options.newConversationTitle}),t}getIdentifier(){return"com.woltlab.wcf.conversation.conversations"}async getData(){const t=await(0,o.dboAction)("getConversations","wcf\\data\\conversation\\ConversationAction").dispatch(),e=t.filter((t=>t.isUnread)).length;return this.updateCounter(e),this.stale=!1,t}getFooter(){return{link:this.options.showAllLink,title:this.options.showAllTitle}}getTitle(){return this.options.title}getView(){return void 0===this.view&&(this.view=new n.default(this)),this.view}getEmptyViewMessage(){return this.options.noItems}hasPlainTitle(){return!0}hasUnreadContent(){return this.counter>0}isStale(){if(this.stale)return!0;const t=this.getView().getItems().filter((t=>"true"===t.dataset.isUnread));return this.counter!==t.length}async markAsRead(t){const e=await(0,o.dboAction)("markAsRead","wcf\\data\\conversation\\ConversationAction").objectIds([t]).dispatch();this.updateCounter(e.totalCount)}async markAllAsRead(){await(0,o.dboAction)("markAllAsRead","wcf\\data\\conversation\\ConversationAction").dispatch(),this.updateCounter(0)}updateCounter(t){let e=this.button.querySelector(".badge");null===e&&t>0&&(e=document.createElement("span"),e.classList.add("badge","badgeUpdate"),this.button.querySelector("a").append(e)),e&&(0===t?e.remove():e.textContent=t.toString()),this.counter=t}}let r=!1;e.setup=function(t){if(!r){const e=document.getElementById("unreadConversations");if(null!==e){const i=new a(e,t);(0,s.registerProvider)(i)}r=!0}}})); \ No newline at end of file -- 2.20.1