File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/modules/im/install/js/im/v2/lib/menu/dist/registry.bundle.min.js
Back
this.BX=this.BX||{};this.BX.Messenger=this.BX.Messenger||{};this.BX.Messenger.v2=this.BX.Messenger.v2||{};(function(t,e,s,n,i,o){"use strict";class r{constructor(t){this.menuInstance=null;this.context=null;this.target=null;this.store=null;this.restClient=null;this.id="im-base-context-menu";this.$Bitrix=t;this.store=t.Data.get("controller").store;this.restClient=t.RestClient.get();this.onClosePopupHandler=this.onClosePopup.bind(this);s.EventEmitter.subscribe(i.EventType.dialog.closePopup,this.onClosePopupHandler)}openMenu(t,e){if(this.menuInstance){this.menuInstance.destroy();this.menuInstance=null}this.context=t;this.target=e;this.menuInstance=this.getMenuInstance();this.menuInstance.show()}getMenuInstance(){return e.MenuManager.create(this.getMenuOptions())}getMenuOptions(){return{id:this.id,bindOptions:{forceBindPosition:true,position:"bottom"},targetContainer:document.body,bindElement:this.target,cacheable:false,className:this.getMenuClassName(),items:this.getMenuItems()}}getMenuItems(){return[]}getMenuClassName(){return this.isDarkMode()?"im-context-menu-dark":""}isDarkMode(){return this.store.state.application.options.darkTheme}onClosePopup(){this.destroy()}close(){if(!this.menuInstance){return}this.menuInstance.destroy();this.menuInstance=null}destroy(){this.close();s.EventEmitter.unsubscribe(i.EventType.dialog.closePopup,this.onClosePopupHandler)}}class a{constructor(t){this.store=null;this.restClient=null;this.store=t.Data.get("controller").store;this.restClient=t.RestClient.get()}pinDialog(t){this.store.dispatch("recent/pin",{id:t,action:true});const e={DIALOG_ID:t,ACTION:"Y"};this.restClient.callMethod(i.RestMethod.imRecentPin,e).catch((e=>{console.error("Im.RecentList: error pinning chat",e);this.store.dispatch("recent/pin",{id:t,action:false})}))}unpinDialog(t){this.store.dispatch("recent/pin",{id:t,action:false});const e={DIALOG_ID:t,ACTION:"N"};this.restClient.callMethod(i.RestMethod.imRecentPin,e).catch((e=>{console.error("Im.RecentList: error unpinning chat",e);this.store.dispatch("recent/pin",{id:t,action:true})}))}}class c{constructor(t){this.store=null;this.restClient=null;this.store=t.Data.get("controller").store;this.restClient=t.RestClient.get()}readDialog(t){let e;const s=this.store.getters["dialogues/get"](t,true);if(s.counter>0){e={DIALOG_ID:t};this.restClient.callMethod(i.RestMethod.imDialogRead,e).catch((t=>{console.error("Im.RecentList: error reading chat",t)}));return}this.store.dispatch("recent/unread",{id:t,action:false});e={DIALOG_ID:t,ACTION:"N"};this.restClient.callMethod(i.RestMethod.imRecentUnread,e).catch((e=>{console.error("Im.RecentList: error reading chat",e);this.store.dispatch("recent/unread",{id:t,action:true})}))}unreadDialog(t){this.store.dispatch("recent/unread",{id:t,action:true});const e={DIALOG_ID:t,ACTION:"Y"};this.restClient.callMethod(i.RestMethod.imRecentUnread,e).catch((e=>{console.error("Im.RecentList: error unreading chat",e);this.store.dispatch("recent/unread",{id:t,action:false})}))}}class l{constructor(t){this.store=null;this.restClient=null;this.store=t.Data.get("controller").store;this.restClient=t.RestClient.get()}muteDialog(t){this.store.dispatch("dialogues/mute",{dialogId:t});const e={DIALOG_ID:t,ACTION:"Y"};this.restClient.callMethod(i.RestMethod.imChatMute,e).catch((e=>{console.error("Im.RecentList: error muting chat",e);this.store.dispatch("dialogues/unmute",{dialogId:t})}))}unmuteDialog(t){this.store.dispatch("dialogues/unmute",{dialogId:t});const e={DIALOG_ID:t,ACTION:"N"};this.restClient.callMethod(i.RestMethod.imChatMute,e).catch((e=>{console.error("Im.RecentList: error unmuting chat",e);this.store.dispatch("dialogues/mute",{dialogId:t})}))}}const h="intranet.controller.invite.reinvite";const u="intranet.controller.invite.deleteinvitation";const g={resendInvite(t){const e={params:{userId:t}};o.ajax.runAction(h,{data:e}).then((()=>{this.showNotification(o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_INVITE_RESEND_DONE"),2e3)}),(t=>{this.handleActionError(t)}))},cancelInvite(t){const e={params:{userId:t}};o.ajax.runAction(u,{data:e}).then((()=>{this.showNotification(o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_INVITE_CANCEL_DONE"),2e3)}),(t=>{this.handleActionError(t)}))},showNotification(t,e=4e3){BX.UI.Notification.Center.notify({content:t,autoHideDelay:e})},handleActionError(t){if(t.status==="error"&&t.errors.length>0){const e=t.errors.map((t=>t.message)).join(". ");this.showNotification(e);return true}this.showNotification(o.Loc.getMessage("IM_RECENT_CONNECT_ERROR"))}};class d{constructor(t){this.store=null;this.store=t.Data.get("controller").store}checkCallSupport(t){if(!BX.MessengerProxy.getPushServerStatus()||!BX.Call.Util.isWebRTCSupported()){return false}const e=Number.parseInt(t,10);return e>0?this.checkUserCallSupport(e):this.checkChatCallSupport(t)}checkUserCallSupport(t){const e=this.store.getters["users/get"](t);return e&&e.status!=="guest"&&!e.bot&&!e.network&&e.id!==this.getCurrentUserId()&&!!e.lastActivityDate}checkChatCallSupport(t){const e=this.store.getters["dialogues/get"](t);if(!e){return false}const{userCounter:s}=e;return s>1&&s<=BX.Call.Util.getUserLimit()}hasActiveCall(){return BX.MessengerProxy.getCallController().hasActiveCall()}getCurrentUserId(){return this.store.state.application.common.userId}}class I extends r{constructor(t){super(t);this.pinManager=null;this.unreadManager=null;this.muteManager=null;this.callHelper=null;this.id="im-recent-context-menu";this.pinManager=new a(t);this.unreadManager=new c(t);this.muteManager=new l(t);this.callHelper=new d(t)}getMenuOptions(){return{...super.getMenuOptions(),className:this.getMenuClassName(),angle:true,offsetLeft:32}}getMenuClassName(){return this.context.compactMode?"":super.getMenuClassName()}getMenuItems(){if(this.context.invitation.isActive){return this.getInviteItems()}return[this.getSendMessageItem(),this.getUnreadMessageItem(),this.getPinMessageItem(),this.getMuteItem(),this.getCallItem(),this.getHistoryItem(),this.getOpenProfileItem(),this.getHideItem(),this.getLeaveItem()]}getSendMessageItem(){return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_WRITE"),onclick:function(){const t=this.context.target===i.OpenTarget.current?i.OpenTarget.current:i.OpenTarget.auto;s.EventEmitter.emit(i.EventType.dialog.open,{...this.context,chat:this.store.getters["dialogues/get"](this.context.dialogId,true),user:this.store.getters["users/get"](this.context.dialogId,true),target:t});this.menuInstance.close()}.bind(this)}}getUnreadMessageItem(){let t=this.context.unread;if(!t){const e=this.store.getters["dialogues/get"](this.context.dialogId,true);t=e.counter>0}return{text:t?o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_READ"):o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_UNREAD"),onclick:function(){if(t){this.unreadManager.readDialog(this.context.dialogId)}else{this.unreadManager.unreadDialog(this.context.dialogId)}this.menuInstance.close()}.bind(this)}}getPinMessageItem(){const t=this.context.pinned;return{text:t?o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_UNPIN"):o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_PIN"),onclick:function(){if(t){this.pinManager.unpinDialog(this.context.dialogId)}else{this.pinManager.pinDialog(this.context.dialogId)}this.menuInstance.close()}.bind(this)}}getMuteItem(){const t=this.store.getters["dialogues/get"](this.context.dialogId);const e=t.type===i.ChatTypes.user;const s=t.type===i.ChatTypes.announcement;if(!t||e||s){return null}const n=this.store.getters["dialogues/getChatOption"](t.type,i.ChatOption.mute);if(!n){return null}const r=t.muteList.includes(this.getCurrentUserId());return{text:r?o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_UNMUTE"):o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_MUTE"),onclick:function(){if(r){this.muteManager.unmuteDialog(this.context.dialogId)}else{this.muteManager.muteDialog(this.context.dialogId)}this.menuInstance.close()}.bind(this)}}getCallItem(){const t=this.store.getters["dialogues/get"](this.context.dialogId);if(!t){return null}const e=t.type!==i.ChatTypes.user;const n=this.store.getters["dialogues/getChatOption"](t.type,i.ChatOption.call);if(e&&!n){return null}const r=this.callHelper.checkCallSupport(this.context.dialogId);const a=t.type===i.ChatTypes.announcement;const c=t.type===i.ChatTypes.call;const l=this.callHelper.hasActiveCall();if(!r||a||c||l){return null}return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_CALL"),onclick:function(){s.EventEmitter.emit(i.EventType.dialog.call,this.context);this.menuInstance.close()}.bind(this)}}getHistoryItem(){const t=this.store.getters["dialogues/get"](this.context.dialogId,true);const e=t.type===i.ChatTypes.user;if(e){return null}return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_HISTORY"),onclick:function(){const t=this.context.target===i.OpenTarget.current?i.OpenTarget.current:i.OpenTarget.auto;s.EventEmitter.emit(i.EventType.dialog.openHistory,{...this.context,chat:this.store.getters["dialogues/get"](this.context.dialogId,true),user:this.store.getters["users/get"](this.context.dialogId,true),target:t});this.menuInstance.close()}.bind(this)}}getOpenProfileItem(){const t=this.store.getters["dialogues/get"](this.context.dialogId,true);const e=t.type===i.ChatTypes.user;if(!e){return null}const s=`/company/personal/user/${this.context.dialogId}/`;return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_PROFILE"),href:s,onclick:function(){this.menuInstance.close()}.bind(this)}}getHideItem(){if(this.context.invitation.isActive||this.context.options.default_user_record){return null}return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_HIDE"),onclick:function(){s.EventEmitter.emit(i.EventType.dialog.hide,{...this.context,chat:this.store.getters["dialogues/get"](this.context.dialogId,true),user:this.store.getters["users/get"](this.context.dialogId,true)});this.menuInstance.close()}.bind(this)}}getLeaveItem(){const t=this.store.getters["dialogues/get"](this.context.dialogId);if(!t){return null}const e=t.type===i.ChatTypes.user;if(e){return null}let n=i.ChatOption.leave;if(t.owner===this.getCurrentUserId()){n=i.ChatOption.leaveOwner}const r=this.store.getters["dialogues/getChatOption"](t.type,n);const a=t.type===i.ChatTypes.call;if(a||!r){return null}return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_LEAVE"),onclick:function(){s.EventEmitter.emit(i.EventType.dialog.leave,{...this.context,chat:this.store.getters["dialogues/get"](this.context.dialogId,true),user:this.store.getters["users/get"](this.context.dialogId,true)});this.menuInstance.close()}.bind(this)}}getInviteItems(){const t=[this.getSendMessageItem(),this.getOpenProfileItem()];const e=BX.MessengerProxy.canInvite()&&this.getCurrentUserId()===this.context.invitation.originator;if(e){t.push(this.getDelimiter(),this.context.invitation.canResend?this.getResendInviteItem():null,this.getCancelInviteItem())}return t}getResendInviteItem(){return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_INVITE_RESEND"),onclick:function(){g.resendInvite(this.context.dialogId);this.menuInstance.close()}.bind(this)}}getCancelInviteItem(){return{text:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_INVITE_CANCEL"),onclick:function(){n.MessageBox.show({message:o.Loc.getMessage("IM_RECENT_CONTEXT_MENU_INVITE_CANCEL_CONFIRM"),modal:true,buttons:n.MessageBoxButtons.OK_CANCEL,onOk:t=>{g.cancelInvite(this.context.dialogId);t.close()},onCancel:t=>{t.close()}});this.menuInstance.close()}.bind(this)}}getDelimiter(){return{delimiter:true}}getCurrentUserId(){return this.store.state.application.common.userId}}t.BaseMenu=r;t.RecentMenu=I})(this.BX.Messenger.v2.Lib=this.BX.Messenger.v2.Lib||{},BX.Main,BX.Event,BX.UI.Dialogs,BX.Messenger.v2.Const,BX); //# sourceMappingURL=registry.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.27 |
proxy
|
phpinfo
|
Settings