Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

chatter.min.js 6.6KB

1
  1. var __awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i{constructor(){this.methods={onMessageSent:function(n){console.log("Connected !"+n.fromUserId+n.message)},onUserTyping:function(t){t.isTyping?n.Platform.Connect.Components.Chat.Instance().showtyping(t.userName,t.fromUserId,t.chatGroupId,t.isPrivate):n.Platform.Connect.Components.Chat.Instance().hidestatus(t.chatGroupId,t.userName)},onMessageReceived:function(t){n.Platform.Connect.Components.Chat.Instance().onMessageReceived(t)},EnableVedio:function(t){n.Platform.Connect.Components.Chat.Instance().EnableVedio(t)},UpdateDeliveryStatus:function(t){n.Platform.Connect.Components.Chat.Instance().UpdateDeliveryStatus(t)},UpdateReadStatus:function(t){n.Platform.Connect.Components.Chat.Instance().UpdateReadStatus(t)},onUserDisconnected:function(){},Editedmsg:function(t){n.Platform.Connect.Components.Chat.Instance().editedMsg(t)},Deleteforeveryone:function(t){n.Platform.Connect.Components.Chat.Instance().deleteall(t)},ChangeProfileImage:function(t){n.Platform.Connect.Components.Chat.Instance().updateProfile(t.photoUrl,t.chatGroupId)},OnGroupNameChanged:function(t){n.Platform.Connect.Components.Chat.Instance().updateGroupName(t.groupName,t.chatgroupid)},OnPrivateWindowOpened:function(t){n.Platform.Connect.Components.Chat.Instance().OnPrivateWindowOpened(t)},EnableMeeting:function(t,i){n.Platform.Connect.Components.Chat.Instance().EnableMeeting(t,i)},addParticipants:function(t){n.Platform.Connect.Components.Chat.Instance().addParticipants(t)},onlinestatus:function(t,i){n.Platform.Connect.Components.Chat.Instance().onlinestatus(t,i)},updatedstatus:function(t){n.Platform.Connect.Components.Chat.Instance().status(t)},GetChatUnreadCount:function(n){$("#chatIconBadge").text(n).removeClass("d-none")},updatechatcount:function(){$("#chatIconBadge").text(Number($("#chatIconBadge").text())+1).removeClass("d-none")},removeadmin:function(t,i){n.Platform.Connect.Components.Chat.Instance().removeAdmin(t,i)},makeadmin:function(t,i){n.Platform.Connect.Components.Chat.Instance().makeAdmin(t,i)},removeparticipant:function(t,i){n.Platform.Connect.Components.Chat.Instance().removeParticipants(t,i)}}}init(){this._chatHub=n.Platform.Connect.Hubs.ChatHub.Instance(_appsettings.chathub_url());this.connection=this._chatHub;this.start()}getClientMethods(){return[{MethodName:"removeadmin",Method:this.methods.removeadmin},{MethodName:"makeadmin",Method:this.methods.makeadmin},{MethodName:"removeparticipant",Method:this.methods.removeparticipant},{MethodName:"onMessageSent",Method:this.methods.onMessageSent},{MethodName:"onUserTyping",Method:this.methods.onUserTyping},{MethodName:"onMessageReceived",Method:this.methods.onMessageReceived},{MethodName:"EnableVedio",Method:this.methods.EnableVedio},{MethodName:"UpdateDeliveryStatus",Method:this.methods.UpdateDeliveryStatus},{MethodName:"UpdateReadStatus",Method:this.methods.UpdateReadStatus},{MethodName:"onUserDisconnected",Method:this.methods.onUserDisconnected},{MethodName:"Editedmsg",Method:this.methods.Editedmsg},{MethodName:"Deleteforeveryone",Method:this.methods.Deleteforeveryone},{MethodName:"ChangeProfileImage",Method:this.methods.ChangeProfileImage},{MethodName:"OnPrivateWindowOpened",Method:this.methods.OnPrivateWindowOpened},{MethodName:"OnGroupNameChanged",Method:this.methods.OnGroupNameChanged},{MethodName:"EnableMeeting",Method:this.methods.EnableMeeting},{MethodName:"addParticipants",Method:this.methods.addParticipants},{MethodName:"onlinestatus",Method:this.methods.onlinestatus},{MethodName:"updatedstatus",Method:this.methods.updatedstatus},{MethodName:"GetChatUnreadCount",Method:this.methods.GetChatUnreadCount},{MethodName:"updatechatcount",Method:this.methods.updatechatcount},]}registerClientMethods(){let n=this.getClientMethods();if(n)for(var t=0;t<n.length;t++)this.connection.register(n[t].MethodName,n[t].Method)}start(){return __awaiter(this,void 0,void 0,function*(){try{this.registerClientMethods();this.connection.connect(function(){let i=n.Platform.Membership.Infos.Identity.getCurrentUser(),t=new n.Platform.Connect.Server.Packets.Connect;t.SessionId=i.sessionId;t.UnibaseId=i.unibaseId;t.UserId=i.userId;t.UserName=i.name;t.ActiveChatGroupId=0;n.Platform.Connect.Components.Chatter.instance._chatHub.server.UserConnected(t,null)})}catch(t){console.log(t);setTimeout(this.start,5e3)}})}onTyping(i,r){t.Chat.isBlock||(i.IsTyping=!0,n.Platform.Connect.Components.Chatter.instance._chatHub.server.UserTyping(i,r))}onTypingStop(i,r){t.Chat.isBlock||(i.IsTyping=!1,n.Platform.Connect.Components.Chatter.instance._chatHub.server.UserTyping(i,r))}onMessageSent(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.SendPrivateMessage(t,i)}openvideo(t){n.Platform.Connect.Components.Chatter.instance._chatHub.server.OpenVideo(t)}updateActiveChatGroup(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.UpdateActiveChatGroup(t,i)}updateDeliveryStatus(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.UpdateDeliveryStatus(t,i)}updateReadStatus(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.UpdateReadStatus(t,i)}editMessage(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.EditMessage(t,i)}Deleteforeveryone(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.Deleteall(t,i)}updateLastMessage(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.updateLastMessage(t,i)}OnPrivateWindowOpened(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.OnPrivateWindowOpened(t,i)}OnGroupNameChanged(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.OnGroupNameChanged(t,i)}EnableAudio(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.EnableAudio(t,i)}EnableVedio(t,i){n.Platform.Connect.Components.Chatter.instance._chatHub.server.EnableVedio(t,i)}GetUnreadChatCount(){var t=n.Platform.Membership.Infos.Identity.currentUser.sessionId;n.Platform.Connect.Components.Chatter.instance._chatHub.server.GetUnreadChatCount(t)}addParticipants(t){n.Platform.Connect.Components.Chatter.instance._chatHub.server.addParticipantsInGrp(t)}static Instance(){return this.instance===undefined&&(this.instance=new i),this.instance}}t.Chatter=i})(i=t.Components||(t.Components={}))})(i=t.Connect||(t.Connect={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));