From b260fbcdcaa6de5b76818716b9a52d63e68fd3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=BE=89?= <1101635162@qq.com> Date: Fri, 14 Jun 2024 16:18:12 +0800 Subject: [PATCH] :art: #148 build --- src/main/resources/js/chat-room.min.js | 28 +++++++++----------------- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/main/resources/js/chat-room.min.js b/src/main/resources/js/chat-room.min.js index a1ec9e0d..8d54af8c 100644 --- a/src/main/resources/js/chat-room.min.js +++ b/src/main/resources/js/chat-room.min.js @@ -1,4 +1,4 @@ -var el,ctx,isDrawing=!1,x=0,y=0,isClick=!0,thisClient="Web/PC网页端",BarragerColorPicker=null,DarwColorPicker=null,redPacketMap=new Map,catchUserParam=window.localStorage.robot_list||"",catchUsers=0{(new Date).getTime()-t<=700&&$("#emojiList").removeClass("showList")},null!==navigator.userAgent.match(/(phone|pad|pod|ios|Android|Mobile|BlackBerry|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian)/i)?0:600)}$("#emojiBtn").hover(function(e){$("#emojiList").css("top","290px"),0!==a&&(clearTimeout(a),a=0),t=(new Date).getTime(),setTimeout(()=>0!==$("#emojiBtn:hover").length&&$("#emojiList").addClass("showList"),300)},e),$("#emojiList").hover(function(){0!==a&&(clearTimeout(a),a=0),t=(new Date).getTime()},e)}$("#redPacketBtn").on("click",function(){Util.alert('
\n\n\n\n\n\n\n
\n
\n
总计:32 积分
\n \n
\n
',"发红包");var l=[],e=0,s=($("#userInput").on("focus input",function(){var a=$("#userInput").val().toUpperCase(),n=(clearTimeout(e),$(".selected-username-box").hide(),$("#chatUsernameSelectedPanel").html(""),"");s.forEach((e,t)=>{t.toUpperCase().includes(a)&&(n+=`
${t}
`)}),$("#chatUsernameSelectedPanel").html(n),$(".selected-username-box").show(),$(".candidateName").on("click",function(){var e=$(this).html();if(console.log(l.includes(e)),!l.includes(e)){l.push(e);var t,a=[];for(index in l)a.push(s.get(l[index]));for(t in $("#recivers").html(""),$("#redPacketCount").val(a.length),a)$("#recivers").append('\n\n')}})}),$("#userInput").on("blur",function(){e=setTimeout(()=>{$(".selected-username-box").hide()},500)}),new Map);$("#redPacketType").on("change",function(){var e=$("#redPacketType").val();"specify"===e?($("#who").removeAttr("style"),$("#redPacketCount").val("1"),$("#redPacketCount").attr("readOnly","true"),$.ajax({url:Label.servePath+"/chat-room/online-users",type:"GET",cache:!1,success:function(e){if(0==e.code)for(var t in $("#userOption").html(""),e.data.users){t=e.data.users[t];s.set(t.userName,t)}},error:function(e){}})):($("#who").css("display","none"),$("#gesture").css("display","none"),$("#redPacketCount").removeAttr("readOnly"),$("#redPacketMoneyLabel").removeAttr("style"),$("#totalAmount").css("display","inline"),$("#countx").text("个数"),$("#redPacketCount").val("1")),"heartbeat"===e&&($("#countx").text("个数(最少5个)"),$("#redPacketCount").val("5")),"rockPaperScissors"===e&&($("#gesture").removeAttr("style"),$("#redPacketCount").val("1"),$("#redPacketCount").attr("readOnly","true"),$("#redPacketAmount").text($("#redPacketMoney").val()+" (含猜拳红包税 5%,实际红包 "+Math.floor(.95*$("#redPacketMoney").val())+" 积分) ")),"dice"===e&&($("#redPacketMoneyLabel").css("display","none"),$("#totalAmount").css("display","none"),$("#countx").text("开盘人数"),$("#redPacketCount").val("3"))}),$("#redPacketMoney").unbind(),$("#redPacketCount").unbind(),$("#redPacketMoney").on("change",function(){""===$("#redPacketMoney").val()&&$("#redPacketMoney").val("32"),$("#redPacketMoney").val()<32&&$("#redPacketMoney").val("32"),$("#redPacketAmount").text($("#redPacketMoney").val()),"rockPaperScissors"===$("#redPacketType").val()&&$("#redPacketAmount").text($("#redPacketMoney").val()+" (含猜拳红包税 5%,实际红包 "+Math.floor(.95*$("#redPacketMoney").val())+" 积分) ")}),$("#redPacketMoney,#redPacketCount").bind("input propertychange",function(){var e=$("#redPacketType").val();"average"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("平分红包,人人有份!")):"random"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("摸鱼者,事竟成!")):"specify"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("试试看,这是给你的红包吗?")):"heartbeat"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("玩的就是心跳!")):"rockPaperScissors"===e&&$("#redPacketAmount").text($("#redPacketMoney").val()+" (含猜拳红包税 5%,实际红包 "+Math.floor(.95*$("#redPacketMoney").val())+" 积分) ")}),$("#redPacketType").on("change",function(){var e=$("#redPacketType").val();"average"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("平分红包,人人有份!")):"random"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("摸鱼者,事竟成!")):"specify"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("试试看,这是给你的红包吗?")):"heartbeat"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("玩的就是心跳!")):"rockPaperScissors"===e?$("#redPacketMsg").val("石头剪刀布!"):"dice"===e&&$("#redPacketMsg").val("买定离手!")}),$("#redPacketCount").on("change",function(){var e=$("#redPacketType").val();"dice"===e&&(15<$("#redPacketCount").val()&&$("#redPacketCount").val("15"),$("#redPacketCount").val()<3)&&$("#redPacketCount").val("3"),"heartbeat"===e&&$("#redPacketCount").val()<5&&$("#redPacketCount").val("5"),Number($("#redPacketCount").val())>Number($("#redPacketMoney").val())?$("#redPacketCount").val($("#redPacketMoney").val()):(100<$("#redPacketCount").val()&&$("#redPacketCount").val("100"),$("#redPacketCount").val()<=0&&$("#redPacketCount").val("1"))}),$("#redPacketConfirm").on("click",function(){let e=$("#redPacketType").val();var t=$("#redPacketMoney").val(),a=$("#redPacketCount").val();let n=$("#redPacketMsg").val(),s=l;var o=$("#gestureType").val();""!==e&&null!==e&&void 0!==e||(e="random"),0==(s=void 0===s?[]:s).length&&"specify"===e&&$("#chatContentTip").addClass("error").html(""),""===n&&(n="摸鱼者,事竟成!");let i;i="rockPaperScissors"!==e?{type:e,money:t,count:a,msg:n,recivers:s}:{type:e,money:t,count:a,msg:n,recivers:s,gesture:o};t={content:"[redpacket]"+JSON.stringify(i)+"[/redpacket]",client:thisClient};$.ajax({url:Label.servePath+"/chat-room/send",type:"POST",cache:!1,data:JSON.stringify(t),success:function(e){0!==e.code&&$("#chatContentTip").addClass("error").html("")},error:function(e){$("#chatContentTip").addClass("error").html("")}}),Util.closeAlert()})}),ChatRoom.loadAvatarPendant(),ChatRoom.loadXiaoIceGame(),ChatRoom.initCatchUser(),ChatRoom.charInit("paintCanvas"),$("#barragerBtn").on("click",function(){("none"===$("#barragerContent").css("display")?($("#barragerContent").slideDown(1e3),$("#paintContent")):$("#barragerContent")).slideUp(1e3)}),$("#barragerInput").keydown(function(e){13==e.keyCode&&ChatRoom.sendBarrager()}),$("#paintBtn").on("click",function(){("none"===$("#paintContent").css("display")?($("#paintContent").slideDown(1e3),$("#barragerContent")):$("#paintContent")).slideUp(1e3)}),BarragerColorPicker=new XNColorPicker({color:"#ffffff",selector:"#selectBarragerColor",showhistorycolor:!1,colorTypeOption:"single",autoConfirm:!0,onError:function(e){},onCancel:function(e){},onChange:function(e){},onConfirm:function(e){}}),DarwColorPicker=new XNColorPicker({color:"#000000",selector:"#selectColor",showhistorycolor:!1,colorTypeOption:"single",autoConfirm:!0,onError:function(e){},onCancel:function(e){},onChange:function(e){ChatRoom.changeColor(e.color.rgba)},onConfirm:function(e){ChatRoom.changeColor(e.color.rgba)}}),$("#selectWidth").bind("change",function(){var e=$("#selectWidth").val();ChatRoom.changeWidth(e)}),"true"===(localStorage.getItem("smoothMode")||"false")?ChatRoom.enableSmoothMode():setInterval(ChatRoom.reloadMessages,9e5)},enableSmoothMode:function(){console.log("Smooth mode enabling..."),$("#smoothMode").html("开启"),setInterval(ChatRoom.reloadMessages,3e3)},toggleSmoothMode:function(){let e;e="开启"===$("#smoothMode").html()?"false":"true",localStorage.setItem("smoothMode",e),"true"===e?(Util.notice("success",5e3,"流畅模式已开启,占用内存更小,体验更流畅。"),ChatRoom.enableSmoothMode()):location.reload()},sendBarrager:function(){var e=BarragerColorPicker.color.rgba,t=$("#barragerInput").val(),e={content:"[barrager]"+JSON.stringify({color:e,content:t})+"[/barrager]",client:thisClient};$.ajax({url:Label.servePath+"/chat-room/send",type:"POST",cache:!1,data:JSON.stringify(e),success:function(e){0!==e.code?$("#chatContentTip").addClass("error").html(""):$("#barragerInput").val("")},error:function(e){$("#chatContentTip").addClass("error").html("")}})},reloadMessages:function(){document.documentElement.scrollTop<=2e3&&ChatRoom.flashScreenQuiet()},flashScreen:function(){NProgress.start(),$("#chats").css("display","none"),page=1;var t=$("#chats>div");if(25div");if(25{(new Date).getTime()-t<=700&&$("#emojiList").removeClass("showList")},null!==navigator.userAgent.match(/(phone|pad|pod|ios|Android|Mobile|BlackBerry|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian)/i)?0:600)}$("#emojiBtn").hover(function(e){$("#emojiList").css("top","290px"),0!==a&&(clearTimeout(a),a=0),t=(new Date).getTime(),setTimeout(()=>0!==$("#emojiBtn:hover").length&&$("#emojiList").addClass("showList"),300)},e),$("#emojiList").hover(function(){0!==a&&(clearTimeout(a),a=0),t=(new Date).getTime()},e)}$("#redPacketBtn").on("click",function(){Util.alert('
\n\n\n\n\n\n\n
\n
\n
总计:32 积分
\n \n
\n
',"发红包");var l=[],e=0,o=($("#userInput").on("focus input",function(){var a=$("#userInput").val().toUpperCase(),n=(clearTimeout(e),$(".selected-username-box").hide(),$("#chatUsernameSelectedPanel").html(""),"");o.forEach((e,t)=>{t.toUpperCase().includes(a)&&(n+=`
${t}
`)}),$("#chatUsernameSelectedPanel").html(n),$(".selected-username-box").show(),$(".candidateName").on("click",function(){var e=$(this).html();if(console.log(l.includes(e)),!l.includes(e)){l.push(e);var t,a=[];for(index in l)a.push(o.get(l[index]));for(t in $("#recivers").html(""),$("#redPacketCount").val(a.length),a)$("#recivers").append('\n\n')}})}),$("#userInput").on("blur",function(){e=setTimeout(()=>{$(".selected-username-box").hide()},500)}),new Map);$("#redPacketType").on("change",function(){var e=$("#redPacketType").val();"specify"===e?($("#who").removeAttr("style"),$("#redPacketCount").val("1"),$("#redPacketCount").attr("readOnly","true"),$.ajax({url:Label.servePath+"/chat-room/online-users",type:"GET",cache:!1,success:function(e){if(0==e.code)for(var t in $("#userOption").html(""),e.data.users){t=e.data.users[t];o.set(t.userName,t)}},error:function(e){}})):($("#who").css("display","none"),$("#gesture").css("display","none"),$("#redPacketCount").removeAttr("readOnly"),$("#redPacketMoneyLabel").removeAttr("style"),$("#totalAmount").css("display","inline"),$("#countx").text("个数"),$("#redPacketCount").val("1")),"heartbeat"===e&&($("#countx").text("个数(最少5个)"),$("#redPacketCount").val("5")),"rockPaperScissors"===e&&($("#gesture").removeAttr("style"),$("#redPacketCount").val("1"),$("#redPacketCount").attr("readOnly","true"),$("#redPacketAmount").text($("#redPacketMoney").val()+" (含猜拳红包税 5%,实际红包 "+Math.floor(.95*$("#redPacketMoney").val())+" 积分) ")),"dice"===e&&($("#redPacketMoneyLabel").css("display","none"),$("#totalAmount").css("display","none"),$("#countx").text("开盘人数"),$("#redPacketCount").val("3"))}),$("#redPacketMoney").unbind(),$("#redPacketCount").unbind(),$("#redPacketMoney").on("change",function(){""===$("#redPacketMoney").val()&&$("#redPacketMoney").val("32"),$("#redPacketMoney").val()<32&&$("#redPacketMoney").val("32"),$("#redPacketAmount").text($("#redPacketMoney").val()),"rockPaperScissors"===$("#redPacketType").val()&&$("#redPacketAmount").text($("#redPacketMoney").val()+" (含猜拳红包税 5%,实际红包 "+Math.floor(.95*$("#redPacketMoney").val())+" 积分) ")}),$("#redPacketMoney,#redPacketCount").bind("input propertychange",function(){var e=$("#redPacketType").val();"average"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("平分红包,人人有份!")):"random"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("摸鱼者,事竟成!")):"specify"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("试试看,这是给你的红包吗?")):"heartbeat"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("玩的就是心跳!")):"rockPaperScissors"===e&&$("#redPacketAmount").text($("#redPacketMoney").val()+" (含猜拳红包税 5%,实际红包 "+Math.floor(.95*$("#redPacketMoney").val())+" 积分) ")}),$("#redPacketType").on("change",function(){var e=$("#redPacketType").val();"average"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("平分红包,人人有份!")):"random"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("摸鱼者,事竟成!")):"specify"===e?($("#redPacketAmount").text($("#redPacketMoney").val()*$("#redPacketCount").val()),$("#redPacketMsg").val("试试看,这是给你的红包吗?")):"heartbeat"===e?($("#redPacketAmount").text($("#redPacketMoney").val()),$("#redPacketMsg").val("玩的就是心跳!")):"rockPaperScissors"===e?$("#redPacketMsg").val("石头剪刀布!"):"dice"===e&&$("#redPacketMsg").val("买定离手!")}),$("#redPacketCount").on("change",function(){var e=$("#redPacketType").val();"dice"===e&&(15<$("#redPacketCount").val()&&$("#redPacketCount").val("15"),$("#redPacketCount").val()<3)&&$("#redPacketCount").val("3"),"heartbeat"===e&&$("#redPacketCount").val()<5&&$("#redPacketCount").val("5"),Number($("#redPacketCount").val())>Number($("#redPacketMoney").val())?$("#redPacketCount").val($("#redPacketMoney").val()):(100<$("#redPacketCount").val()&&$("#redPacketCount").val("100"),$("#redPacketCount").val()<=0&&$("#redPacketCount").val("1"))}),$("#redPacketConfirm").on("click",function(){let e=$("#redPacketType").val();var t=$("#redPacketMoney").val(),a=$("#redPacketCount").val();let n=$("#redPacketMsg").val(),o=l;var s=$("#gestureType").val();""!==e&&null!==e&&void 0!==e||(e="random"),0==(o=void 0===o?[]:o).length&&"specify"===e&&$("#chatContentTip").addClass("error").html("
  • 请选择红包发送对象
"),""===n&&(n="摸鱼者,事竟成!");let i;i="rockPaperScissors"!==e?{type:e,money:t,count:a,msg:n,recivers:o}:{type:e,money:t,count:a,msg:n,recivers:o,gesture:s};t={content:"[redpacket]"+JSON.stringify(i)+"[/redpacket]",client:thisClient};$.ajax({url:Label.servePath+"/chat-room/send",type:"POST",cache:!1,data:JSON.stringify(t),success:function(e){0!==e.code&&$("#chatContentTip").addClass("error").html("
  • "+e.msg+"
")},error:function(e){$("#chatContentTip").addClass("error").html("
  • "+e.statusText+"
")}}),Util.closeAlert()})}),ChatRoom.loadAvatarPendant(),ChatRoom.initCatchUser(),ChatRoom.charInit("paintCanvas"),$("#barragerBtn").on("click",function(){("none"===$("#barragerContent").css("display")?($("#barragerContent").slideDown(1e3),$("#paintContent")):$("#barragerContent")).slideUp(1e3)}),$("#barragerInput").keydown(function(e){13==e.keyCode&&ChatRoom.sendBarrager()}),$("#paintBtn").on("click",function(){("none"===$("#paintContent").css("display")?($("#paintContent").slideDown(1e3),$("#barragerContent")):$("#paintContent")).slideUp(1e3)}),BarragerColorPicker=new XNColorPicker({color:"#ffffff",selector:"#selectBarragerColor",showhistorycolor:!1,colorTypeOption:"single",autoConfirm:!0,onError:function(e){},onCancel:function(e){},onChange:function(e){},onConfirm:function(e){}}),DarwColorPicker=new XNColorPicker({color:"#000000",selector:"#selectColor",showhistorycolor:!1,colorTypeOption:"single",autoConfirm:!0,onError:function(e){},onCancel:function(e){},onChange:function(e){ChatRoom.changeColor(e.color.rgba)},onConfirm:function(e){ChatRoom.changeColor(e.color.rgba)}}),$("#selectWidth").bind("change",function(){var e=$("#selectWidth").val();ChatRoom.changeWidth(e)}),"true"===(localStorage.getItem("smoothMode")||"false")?ChatRoom.enableSmoothMode():setInterval(ChatRoom.reloadMessages,9e5)},enableSmoothMode:function(){console.log("Smooth mode enabling..."),$("#smoothMode").html("开启"),setInterval(ChatRoom.reloadMessages,3e3)},toggleSmoothMode:function(){let e;e="开启"===$("#smoothMode").html()?"false":"true",localStorage.setItem("smoothMode",e),"true"===e?(Util.notice("success",5e3,"流畅模式已开启,占用内存更小,体验更流畅。"),ChatRoom.enableSmoothMode()):location.reload()},sendBarrager:function(){var e=BarragerColorPicker.color.rgba,t=$("#barragerInput").val(),e={content:"[barrager]"+JSON.stringify({color:e,content:t})+"[/barrager]",client:thisClient};$.ajax({url:Label.servePath+"/chat-room/send",type:"POST",cache:!1,data:JSON.stringify(e),success:function(e){0!==e.code?$("#chatContentTip").addClass("error").html("
  • "+e.msg+"
"):$("#barragerInput").val("")},error:function(e){$("#chatContentTip").addClass("error").html("
  • "+e.statusText+"
")}})},reloadMessages:function(){document.documentElement.scrollTop<=2e3&&ChatRoom.flashScreenQuiet()},flashScreen:function(){NProgress.start(),$("#chats").css("display","none"),page=1;var t=$("#chats>div");if(25div");if(25 .dialog-panel { border-radius: 20px 20px 20px 20px; @@ -37,9 +37,9 @@ border-bottom: none;
-`),$.ajax({url:Label.servePath+"/chat-room/si-guo-list",type:"GET",cache:!1,async:!1,success:function(e){var a=e.data;0==a.length&&$("#si-guo-list").prepend('
  • 目前沒有受到處罰的魚油,請繼續保持!
  • ');for(let t=0;t`),$.ajax({url:Label.servePath+"/chat-room/si-guo-list",type:"GET",cache:!1,async:!1,success:function(e){var a=e.data;0==a.length&&$("#si-guo-list").prepend('
  • 目前沒有受到處罰的魚油,請繼續保持!
  • ');for(let t=0;t - +

    '+e+` @@ -47,24 +47,24 @@ border-bottom: none; 爲他求情

    - 將於 `+s.getFullYear()+"年"+(s.getMonth()+1<10?"0"+(s.getMonth()+1):s.getMonth()+1)+"月"+s.getDate()+"日 "+s.getHours()+"時"+s.getMinutes()+`分 釋放 + 將於 `+o.getFullYear()+"年"+(o.getMonth()+1<10?"0"+(o.getMonth()+1):o.getMonth()+1)+"月"+o.getDate()+"日 "+o.getHours()+"時"+o.getMinutes()+`分 釋放
    - `)}}})},submitCharacter:function(e){var t;0!==linesArray.length?(e=function(e){var e=e.split(","),t=e[0].match(/:(.*?);/)[1],a=atob(e[1]),n=a.length,s=new Uint8Array(n);for(;n--;)s[n]=a.charCodeAt(n);return new Blob([s],{type:t})}(document.getElementById(e).toDataURL()),(t=new FormData).append("file[]",e),$.ajax({url:Label.servePath+"/upload",type:"POST",cache:!1,data:t,processData:!1,contentType:!1,success:function(e){e=e.data.succMap.blob;ChatRoom.editor.setValue(ChatRoom.editor.getValue()+"![涂鸦]("+e+")"),ChatRoom.editor.focus(),ChatRoom.clearCharacter("paintCanvas"),$("#paintContent").slideUp(500)},error:function(e){}}),linesArray=[],$(window).scrollTop(0)):alert("画布为空,无法提交!")},clearCharacter:function(e){e=document.getElementById(e).getContext("2d");e.clearRect(0,0,e.canvas.width,e.canvas.height),linesArray=[]},revokeChatacter:function(e){0{ChatRoom.changeColor(t.color),ChatRoom.changeWidth(t.width),ctx.beginPath(),ctx.moveTo(t.point[0].x,t.point[0].y);for(let e=1;e\n\n
    \n
    \n \n
    \n',"设置话题")},updateDiscussData:function(e){e={content:"[setdiscuss]"+e+"[/setdiscuss]",client:thisClient};$.ajax({url:Label.servePath+"/chat-room/send",type:"POST",cache:!1,data:JSON.stringify(e),success:function(e){0!==e.code?Util.notice("danger",3e3,e.msg):Util.notice("success",3e3,"话题修改成功,所有人可见。
    16积分已扣除。")},error:function(e){Util.notice("danger",3e3,e.statusText)}})},useDiscuss:function(){var e=ChatRoom.editor.getValue();ChatRoom.editor.setValue("*`# "+$("#discuss-title").html()+" #`* "),ChatRoom.editor.insertValue(e,0),ChatRoom.editor.focus()},toggleOnlineAvatar:function(){"none"===$("#chatRoomOnlineCnt").css("display")?($("#chatRoomOnlineCnt").html(Label.onlineAvatarData),setTimeout(function(){$("#toggleAvatarBtn").html(''),$("#chatRoomOnlineCnt").slideDown(200),setTimeout(function(){Util.listenUserCard()},200)},100)):($("#toggleAvatarBtn").html(''),$("#chatRoomOnlineCnt").slideUp(200))},confirmed:!1,delEmoji:function(t){if(!0===ChatRoom.confirmed||confirm("确定要删除该表情包吗?")){ChatRoom.confirmed=!0;var a=ChatRoom.getEmojis();for(let e=0;e + `)}}})},submitCharacter:function(e){var t;0!==linesArray.length?(e=function(e){var e=e.split(","),t=e[0].match(/:(.*?);/)[1],a=atob(e[1]),n=a.length,o=new Uint8Array(n);for(;n--;)o[n]=a.charCodeAt(n);return new Blob([o],{type:t})}(document.getElementById(e).toDataURL()),(t=new FormData).append("file[]",e),$.ajax({url:Label.servePath+"/upload",type:"POST",cache:!1,data:t,processData:!1,contentType:!1,success:function(e){e=e.data.succMap.blob;ChatRoom.editor.setValue(ChatRoom.editor.getValue()+"![涂鸦]("+e+")"),ChatRoom.editor.focus(),ChatRoom.clearCharacter("paintCanvas"),$("#paintContent").slideUp(500)},error:function(e){}}),linesArray=[],$(window).scrollTop(0)):alert("画布为空,无法提交!")},clearCharacter:function(e){e=document.getElementById(e).getContext("2d");e.clearRect(0,0,e.canvas.width,e.canvas.height),linesArray=[]},revokeChatacter:function(e){0{ChatRoom.changeColor(t.color),ChatRoom.changeWidth(t.width),ctx.beginPath(),ctx.moveTo(t.point[0].x,t.point[0].y);for(let e=1;e\n\n
    \n
    \n \n
    \n',"设置话题")},updateDiscussData:function(e){e={content:"[setdiscuss]"+e+"[/setdiscuss]",client:thisClient};$.ajax({url:Label.servePath+"/chat-room/send",type:"POST",cache:!1,data:JSON.stringify(e),success:function(e){0!==e.code?Util.notice("danger",3e3,e.msg):Util.notice("success",3e3,"话题修改成功,所有人可见。
    16积分已扣除。")},error:function(e){Util.notice("danger",3e3,e.statusText)}})},useDiscuss:function(){var e=ChatRoom.editor.getValue();ChatRoom.editor.setValue("*`# "+$("#discuss-title").html()+" #`* "),ChatRoom.editor.insertValue(e,0),ChatRoom.editor.focus()},toggleOnlineAvatar:function(){"none"===$("#chatRoomOnlineCnt").css("display")?($("#chatRoomOnlineCnt").html(Label.onlineAvatarData),setTimeout(function(){$("#toggleAvatarBtn").html(''),$("#chatRoomOnlineCnt").slideDown(200),setTimeout(function(){Util.listenUserCard()},200)},100)):($("#toggleAvatarBtn").html(''),$("#chatRoomOnlineCnt").slideUp(200))},confirmed:!1,delEmoji:function(t){if(!0===ChatRoom.confirmed||confirm("确定要删除该表情包吗?")){ChatRoom.confirmed=!0;var a=ChatRoom.getEmojis();for(let e=0;e
    `;$("#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("
    • "+e.statusText+"
    "),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(/(