diff --git a/src/main/resources/js/chat-room.min.js b/src/main/resources/js/chat-room.min.js index c7fd2420..78040d85 100644 --- a/src/main/resources/js/chat-room.min.js +++ b/src/main/resources/js/chat-room.min.js @@ -57,7 +57,7 @@ border-bottom: none; `;$("#emojis").html(a)},listenUploadEmojis:function(){$("#uploadEmoji").fileupload({acceptFileTypes:/(\.|\/)(gif|jpe?g|png)$/i,maxFileSize:5242880,multipart:!0,pasteZone:null,dropZone:null,url:Label.servePath+"/upload",paramName:"file[]",add:function(e,a){var t;ext=a.files[0].type.split("/")[1],window.File&&window.FileReader&&window.FileList&&window.Blob?((t=new FileReader).readAsArrayBuffer(a.files[0]),t.onload=function(e){var t=new Uint8Array(e.target.result.slice(0,11));isImage(t)?5242880\n\n
\n
\n \n
\n',"从URL导入表情包"),$("#fromURL").focus(),$("#fromURL").unbind(),$("#fromURL").bind("keypress",function(e){"13"==e.keyCode&&(ChatRoom.addEmoji($("#fromURL").val()),Util.closeAlert())})},addEmoji:function(){for(let e=0;e
  • "+e.msg+"
  • "),ChatRoom.editor.setValue(t))},error:function(e){$("#chatContentTip").addClass("error").html(""),ChatRoom.editor.setValue(t)},complete:function(e,t){ChatRoom.isSend=!1,$(".form button.red").removeAttr("disabled").css("opacity","1")}}))},more:function(){NProgress.start(),setTimeout(function(){let e;var t;1!==++page&&(t=(t=$(".chats__item"))[t.length-1],e=$(t).attr("id").replace("chatroom","")),Label.hasMore&&(1===page?$.ajax({url:Label.servePath+"/chat-room/more?page="+page,type:"GET",cache:!1,async:!1,success:function(e){if(0!==e.data.length){for(var t in e.data){t=e.data[t];0===$("#chatroom"+t.oId).length&&ChatRoom.renderMsg(t,"more"),ChatRoom.resetMoreBtnListen()}Util.listenUserCard(),ChatRoom.imageViewer()}else alert("没有更多聊天消息了!"),Label.hasMore=!1}}):$.ajax({url:Label.servePath+"/chat-room/getMessage?size=25&mode=1&oId="+e,type:"GET",cache:!1,async:!1,success:function(e){if(0!==e.data.length){for(var t in e.data){t=e.data[t];0===$("#chatroom"+t.oId).length&&ChatRoom.renderMsg(t,"more"),ChatRoom.resetMoreBtnListen()}Util.listenUserCard(),ChatRoom.imageViewer()}else alert("没有更多聊天消息了!"),Label.hasMore=!1}})),NProgress.done()},0)},resetMoreBtnListen:function(){$("body").unbind(),$("body").click(function(e){"aPersonListPanel"!==$(e.target).closest("a").attr("id")&&"personListPanel"!==$(e.target).closest(".module").attr("id")&&$("#personListPanel").hide()}),$("body").click(function(){$("details[open]").removeAttr("open")})},groupRevokeProcess:!1,startGroupRevoke:function(){$("#groupRevoke").attr("onclick","ChatRoom.stopGroupRevoke()"),$("#groupRevoke").html("关闭批量撤回"),Util.notice("warning",6e3,"批量撤回已启动,已在消息中添加便捷撤回按钮。
    使用完成后请记得关闭此功能。"),ChatRoom.groupRevokeProcess=!0;let e=setInterval(function(){ChatRoom.groupRevokeProcess||($("#chats").empty(),page=0,ChatRoom.more(),clearInterval(e)),$(".chats__item").each(function(){0===$(this).find(".button").length&&($(this).find(".date-bar").css("float","left"),$(this).find(".date-bar").html(""))})},500)},stopGroupRevoke:function(){$("#groupRevoke").attr("onclick","ChatRoom.startGroupRevoke()"),$("#groupRevoke").html("批量撤回"),Util.notice("success",1500,"批量撤回已关闭。"),ChatRoom.groupRevokeProcess=!1},adminRevoke:function(e){$.ajax({url:Label.servePath+"/chat-room/revoke/"+e,type:"DELETE",cache:!1,success:function(e){0!==e.code&&Util.notice("danger",1500,e.msg)}})},shileds:",",shiled:function(e){confirm("友好的交流是沟通的基础, 确定要屏蔽 Ta 吗?\n本次屏蔽仅针对当前页面有效, 刷新后需重新屏蔽!")&&(ChatRoom.shileds+=e+",")},revoke:function(e){confirm("确定要撤回吗?")&&$.ajax({url:Label.servePath+"/chat-room/revoke/"+e,type:"DELETE",cache:!1,success:function(e){0===e.code?Util.notice("success",1500,e.msg):Util.notice("danger",1500,e.msg)}})},repeat:function(e){let t="";$.ajax({url:Label.servePath+"/cr/raw/"+e,method:"get",async:!1,success:function(e){t=e.replace(/(