-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
1 lines (1 loc) · 17.9 KB
/
index.html
1
<!doctypehtml><html lang=zh-CN><title>QQ跑团记录着色器</title><meta content="text/html; charset=utf-8"http-equiv=Content-Type><meta content="width=device-width,initial-scale=0.8"name=viewport><meta content=QQ跑团记录着色器 name=Description><meta content=#D1EAF7 name=theme-color><script src=https://unpkg.zhimg.com/jquery@3.5.1/dist/jquery.min.js></script><script src=https://unpkg.zhimg.com/bootstrap@4.5.0/dist/js/bootstrap.bundle.min.js></script><link href=https://unpkg.zhimg.com/bootstrap@4.5.0/dist/css/bootstrap.min.css rel=stylesheet><link href=color-picker.min.css rel=stylesheet><script src=color-picker.min.js></script><script src=https://cdn.jsdelivr.net/npm/docx@6.0.3/build/index.min.js></script><script src=https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js></script><link href=favicon.ico rel="shortcut icon"><script src="https://www.googletagmanager.com/gtag/js?id=UA-124322134-3"async></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-124322134-3")</script><script src=https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js async data-ad-client=ca-pub-6328033898902108></script><style>body{background-color:#d1eaf7;transition:background-color 1.5s ease}#div_page{margin:50px}#div_nav{margin:10px}#div_names{margin-bottom:20px;margin-left:50px;margin-right:50px;margin-top:20px}.button_player{text-align:left;width:100%}#textarea_log_input{height:300px;text-align:left}#div_log_output{float:left;width:100%}#textarea_log_output{height:300px;width:100%}.button_controller,.button_filter{height:50px;width:155px}#div_log_view{background-color:#d1eaf7;float:left;overflow:auto;width:100%}.div_center{text-align:center}.div_italic{font-style:italic}#div_button{margin:10px}.input_name{background:0 0;border:0;height:34px;width:inherit}</style><body><!--[if lt IE 10]><div id=div_browser_warning style=background-color:#979797><h2 style="color:#fff;text-align:center;margin:10px 0 10px 0;padding:15px">你的浏览器已严重过时, 请升级到新版本IE或使用Chrome浏览器</h2></div><![endif]--><div id=div_nav><nav class="bg-light navbar navbar-expand-md navbar-light"><a href=# class=navbar-brand><img alt=""height=30 src=favicon.ico width=30> </a><a href=# class=navbar-brand>Dice! Logpainter</a> <button class=navbar-toggler aria-controls=navbarSupportedContent aria-expanded=false aria-label="Toggle navigation"data-target=#navbarSupportedContent data-toggle=collapse type=button><span class=navbar-toggler-icon></span></button><div class="collapse navbar-collapse"id=navbarSupportedContent><ul class="mr-auto navbar-nav"><li class=nav-item><a href=https://kokona.tech class=nav-link>Dice! 主站</a><li class=nav-item><a href=https://github.com/w4123/logpainter class=nav-link>本项目GitHub</a><li class=nav-item><a href=https://github.com/w4123/trpglogger class=nav-link>跑团记录器</a></ul></div></nav></div><div id=div_page><div><div class=div_center><h3 id=header_title>QQ跑团记录着色器</h3><h5 id=header_version>v2.6 by 风羽(溯洄改)</h5></div><div class=div_italic><a href=http://aligo.github.io/log-colourer.js>前辈的mirc版传送门</a><br><a href=javascript:void(0); id=specialMode1>艾德琳的文本着色器</a> <a href=javascript:void(0); id=defaultMode>QQ跑团记录着色器</a></div><h6>将QQ聊天记录的【文本】复制到下面这个文本框中,然后点击按钮【Analyze】</h6></div><div><textarea class=form-control id=textarea_log_input></textarea></div><div class=div_center id=div_button><div><button class="btn btn-info button_filter"id=button_log_command style=margin-bottom:2px>指令过滤 On</button> <button class="btn btn-info button_filter"id=button_log_other style=margin-bottom:2px>(开头内容过滤 On</button> <button class="btn btn-info button_filter"id=button_log_pic_text style=margin-bottom:2px>[图片]过滤 On</button> <button class="btn btn-info button_filter"id=button_log_time style=margin-bottom:2px>显示时间 On</button> <button class="btn btn-info button_filter"id=button_log_nname style=margin-bottom:2px>人名头衔过滤 On</button></div><br><div><button class="btn button_controller btn-success"id=button_log_analyze style=margin-bottom:2px>Analyze</button> <button class="btn button_controller btn-warning"id=button_log_clear style=margin-bottom:2px>清除输入</button> <button class="btn button_controller btn-success"id=button_palette style=margin-bottom:2px;display:none>使用调色盘</button> <button class="btn button_controller btn-success"id=button_share style=margin-bottom:2px;display:none>分享到Dice!论坛</button> <button class="btn btn-info button_controller"id=button_download_txt style=margin-bottom:2px;display:none>下载为txt文档</button> <button class="btn btn-info button_controller"id=button_download_docx style=margin-bottom:2px;display:none>下载为docx文档</button></div></div><br><div class=div_center></div><div id=div_names></div><div id=div_log><h6>复制预览部分内容可得TXT文本(双击以选中所有文本),输出部分为论坛用代码</h6><ul class="nav nav-tabs"role=tablist><li class=nav-item role=presentation style=background-color:#f6ffbe;border-radius:5px;width:50%><a href=#div_log_view class="nav-link active show"aria-controls=div_log_view data-toggle=tab role=tab>预览</a><li class=nav-item role=presentation style=background-color:#f6ffbe;border-radius:5px;width:50%><a href=#div_log_output class=nav-link aria-controls=div_log_output data-toggle=tab role=tab>输出</a></ul><div class=tab-content style=display:flex><div class="active show fade tab-pane"id=div_log_view role=tabpanel style=background-color:#fff></div><div class="fade tab-pane"id=div_log_output role=tabpanel><textarea class=form-control id=textarea_log_output></textarea></div></div></div></div><script id=html_player_grid type=html/template><div class="col-sm-2"><input type="text" class="font-control input_name" name="&id" value="&name" placeholder="删除消息请点右边开关"></div><div class="col-sm-2" style="min-width: 150px">&select</div><div class="col-sm-1" style="min-width: 80px"><button style="text-align: center" type="button" class="btn btn-success button_player" name="&id">On</button></div><div class="col-sm-1"></div></script><div class="div_center container-fluid"><script src=https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js async></script><ins class=adsbygoogle data-ad-client=ca-pub-6328033898902108 data-ad-format=auto data-ad-slot=7844798489 data-full-width-responsive=true style=display:block></ins><script>(adsbygoogle=window.adsbygoogle||[]).push({})</script></div><div class=div_footer><footer class="container-fluid foot-wrap"><p style=text-align:center;margin-top:20px;color:#878b91>原作者:风羽 Copyright ©2017-2019 hina.moe<br>修改: 溯洄 Copyright ©2018-2021 kokona.tech</footer></div><script>!function(t,e,n){t("#specialMode1").click(function(){t("body").css("background-color","#f0e4f7"),t("#div_log_view").css("background-color","#ffffff"),t("#header_title").fadeOut("fast",function(){t("#header_title").text("艾德琳的文本着色器"),t("#header_title").fadeIn()}),t("#header_version").fadeOut("slow",function(){t("#header_version").text("v1.2 by 风羽(溯洄改)"),t("#header_version").fadeIn()}),t("#specialMode1").hide(),t("#defaultMode").show(),v=1,f=!0,t("#button_palette").text("使用论坛颜色"),t("#div_log_view").css("background-color","#ffffff"),o=[],a=[],t("html,body").animate({scrollTop:1},"fast"),t("#div_log").fadeOut("fast"),t("#button_palette").hide(),t("#button_share").hide(),t("#button_download_txt").hide(),t("#button_download_docx").hide(),t("#div_names").html("")}),t("#defaultMode").click(function(){t("body").css("background-color","#D1EAF7"),t("#div_log_view").css("background-color",""),t("#header_title").fadeOut("fast",function(){t("#header_title").text("QQ跑团记录着色器"),t("#header_title").fadeIn()}),t("#header_version").fadeOut("slow",function(){t("#header_version").text("v2.6 by 风羽(溯洄改)"),t("#header_version").fadeIn()}),t("#defaultMode").hide(),t("#specialMode1").show(),v=0,f=!1,t("#button_palette").text("使用调色盘"),t("#div_log_view").css("background-color",""),o=[],a=[],t("html,body").animate({scrollTop:1},"fast"),t("#div_log").fadeOut("fast"),t("#button_palette").hide(),t("#button_share").hide(),t("#button_download_txt").hide(),t("#button_download_docx").hide(),t("#div_names").html("")}),t("#button_download_txt").click(function(){saveAs(new Blob([m]),"download.txt")}),t("#button_download_docx").click(function(){const t=new docx.Document({sections:[{children:g}]});docx.Packer.toBlob(t).then(t=>{saveAs(t,"download.docx")})}),t(n).ready(function(){t("#div_log").hide(),t("#button_palette").hide(),t("#button_share").hide(),t("#button_download_txt").hide(),t("#button_download_docx").hide(),t("#defaultMode").hide();var n=function(t){for(var n=e.location.search.substring(1).split("&"),o=0;o<n.length;o++){var a=n[o].split("=");if(a[0]==t)return a[1]}return!1}("s3");n?t.ajax({url:"https://dicelogger.s3-accelerate.amazonaws.com/"+n,tryCount:0,retryLimit:3,success:function(e){t("#textarea_log_input").val(e),t("#button_log_analyze").click()},error:function(e,n,o){if("timeout"===n)return this.tryCount++,this.tryCount<=this.retryLimit?void t.ajax(this):void 0;t("#textarea_log_input").val("获取跑团日志失败! 请刷新重试!")}}):""!==t("#textarea_log_input").val()&&t("#button_log_analyze").click()}),t("#button_log_command").click(function(){(c=!c)?(t(this).addClass("btn-info"),t(this).text("指令过滤 On"),t(this).removeClass("btn-warning")):(t(this).removeClass("btn-info"),t(this).text("指令过滤 Off"),t(this).addClass("btn-warning"))}),t("#button_log_other").click(function(){(d=!d)?(t(this).addClass("btn-info"),t(this).text("(开头内容过滤 On"),t(this).removeClass("btn-warning")):(t(this).removeClass("btn-info"),t(this).text("(开头内容过滤 Off"),t(this).addClass("btn-warning"))}),t("#button_log_pic_text").click(function(){(u=!u)?(t(this).addClass("btn-info"),t(this).text("[图片]过滤 On"),t(this).removeClass("btn-warning")):(t(this).removeClass("btn-info"),t(this).text("[图片]过滤 Off"),t(this).addClass("btn-warning"))}),t("#button_log_time").click(function(){(h=!h)?(t(this).addClass("btn-info"),t(this).text("显示时间 On"),t(this).removeClass("btn-warning")):(t(this).removeClass("btn-info"),t(this).text("显示时间 Off"),t(this).addClass("btn-warning"))}),t("#button_log_nname").click(function(){(_=!_)?(t(this).addClass("btn-info"),t(this).text("人名头衔过滤 On"),t(this).removeClass("btn-warning")):(t(this).removeClass("btn-info"),t(this).text("人名头衔过滤 Off"),t(this).addClass("btn-warning"))}),t("#button_log_clear").click(function(){t("html,body").animate({scrollTop:1},"fast"),o=[],a=[],t("#div_log").fadeOut("fast"),t("#button_palette").hide(),t("#button_share").hide(),t("#button_download_txt").hide(),t("#button_download_docx").hide(),t("#textarea_log_input").val(""),t("#div_names").html("")}),t("#div_log_view").dblclick(function(){!function(t){var e;(e=document.createRange()).selectNode(document.getElementById(t));var n=window.getSelection();n.removeAllRanges(),n.addRange(e)}(this.id)}),t("#textarea_log_output").click(function(){t(this).select()}),t("#button_palette").click(function(){f=!f,O(),f?(t(this).text("使用论坛颜色"),t("#div_log_view").css("background-color","#ffffff"),t("#button_share").hide()):(t(this).text("使用调色盘"),t("#div_log_view").css("background-color",""),t("#button_share").fadeTo("slow",.7),T())}),t("#button_share").click(function(){s=t("#textarea_log_output").val(),!f&&s&&window.open("https://forum.kokona.tech/composer?title=%E8%B7%91%E5%9B%A2%E8%AE%B0%E5%BD%95%E5%88%86%E4%BA%AB&tag=water&content="+encodeURIComponent(s))});var o=[],a=[],i="red;green;pink;orange;purple;black;blue;yellow;beige;brown;teal;navy;maroon;limegreen;white;fuchsia;silver".split(";"),l="红色;绿色;粉红;橘色;紫色;黑色;蓝色;黄色;米色;棕色;蓝绿;深蓝;紫红;莱姆;白色;桃红;灰色".split(";"),r="silver",c=!0,d=!0,u=!0,h=!0,f=!1,_=!0,v=0,g=[],m="";function b(t,e){this.name=t,this.color=i[e],this.valid=!0}function p(t,e,n){this.time=t,this.player=e,this.content=n}function w(t){for(var e=0;e<o.length;e++)if(o[e].name==t)return!0;return!1}function x(t,e){o[o.length]=new b(t,e)}function y(t){for(var e=0;e<o.length;e++)if(o[e].name==t)return o[e];return null}function k(){t("select").change(function(){var e=t(this).val(),n=parseInt(t(this).attr("name"));t(this).css("background-color",e),E(n,e)}),t(".input_name").change(function(){var e=t(this).val(),n=parseInt(t(this).attr("name"));o[n].name=e,T()}),function(){for(var e=0;e<o.length;e++){var n="#select_"+e,a=i[e];o[e].color=a,t(n).val(a),t(n).css("background-color",a)}}()}function C(e,n){return f?t("#html_player_grid").html().replace(/&name/g,n).replace(/&id/g,e).replace("&select",function(t){return'<input class = "form-control palette" name = "'+t+'" id ="palette_'+t+'" type="text">'}(e)):t("#html_player_grid").html().replace(/&name/g,n).replace(/&id/g,e).replace("&select",function(t){var e="";e+='<select name ="'+t+'" id ="select_'+t+'" class="form-control">';for(var n=0;n<l.length;n++)e+='<option value="'+i[n]+'" style="background-color:'+i[n]+';">'+l[n]+"</option>";return e+="</select>"}(e))}function O(){var n,a='<div class="div_center div_italic" style="color:red"><p>出现的PC名字 (点击可以修改)</p><br></div>';for(n=0;n<o.length;n++)n%2==0&&(a+='<div class="row">'),a+=C(n,o[n].name),n%2==1&&(a+="</div>");n%2==0&&(a+="</div>"),t("#div_names").html(a),f?(t(".palette").each(function(){var n=new e.CP(this);n.on("change",function(e){var n="#"+e;this.source.value=n,t(this.source).css("background-color",n),E(this.source.name,n)}),t(this).click(function(){t(this).select()}),t(this).change(function(){n.set(e.CP.parse(t(this).val()))})}),t(".input_name").change(function(){var e=t(this).val(),n=parseInt(t(this).attr("name"));o[n].name=e,T()})):k(),t("#button_palette").fadeTo("slow",.7),t("#button_share").fadeTo("slow",.7),t("#button_download_txt").fadeTo("slow",1),t("#button_download_docx").fadeTo("slow",1),t(".button_player").click(function(){var e,n=parseInt(t(this).attr("name"));(o[e=n].valid=!o[e].valid,T(),o[e].valid)?(t(this).addClass("btn-success"),t(this).text("On"),t(this).removeClass("btn-default")):(t(this).removeClass("btn-success"),t(this).text("Off"),t(this).addClass("btn-default"))})}function E(t,e){o[t].color=e,o[t].valid&&T()}function T(){switch(v){case 1:!function(){for(var e="",n="",o=0;o<a.length;o++){var i=a[o].player.color,l=a[o].player.name,s=a[o].content;0==a[o].player.valid&&"旁白"!=l&&(l="",i=y("旁白").color,s=a[o].player.name+":"+a[o].content),"旁白"==l?l="":""!=l&&(l+=":"),e+="[color="+i+"]"+l,e+=s,e+="[/color]\n",n+='<span style="color:'+i+';">'+l,n+=s,n+="</span><br>"}f&&(e="调色盘模式下的颜色不兼容论坛代码,请双击全选预览中的文字,复制粘贴到Word中保存"),t("#textarea_log_output").val(e),t("#div_log_view").html(n)}();break;default:!function(){g=[],m="";for(var e="",n="",o=0;o<a.length;o++)if(0!=a[o].player.valid){var i=a[o].player.color,l=a[o].player.name;h&&(e+="[color="+r+"]"+a[o].time+"[/color] "),e+="[color="+i+"]<"+a[o].player.name+"> ",e+=a[o].content,e+="[/color]\n",h&&(n+='<span style="color:'+r+';">'+a[o].time+"</span> "),n+='<span style="color:'+i+';"><'+l+"> ",n+=a[o].content,n+="</span><br>";var s=[];h&&s.push(new docx.TextRun({text:a[o].time+" ",color:r})),s.push(new docx.TextRun({text:"<"+a[o].player.name+"> "+a[o].content,color:i})),g.push(new docx.Paragraph({children:s})),h&&(m+=a[o].time+" "),m+="<"+a[o].player.name+"> "+a[o].content+"\n"}f&&(e="调色盘模式下的颜色不兼容论坛代码,请双击全选预览中的文字,复制粘贴到Word中保存"),t("#textarea_log_output").val(e),t("#div_log_view").html(n)}()}}t("#button_log_analyze").click(function(){var e;switch(""!==t("#textarea_log_input").val()&&t("html,body").animate({scrollTop:t("#div_names").offset().top},500),v){case 1:e=function(){o=[],a=[],t("#div_names").html(""),t("#div_log").hide();var e,n,i=/(.+?)[::](.*)/,l=t("#textarea_log_input").val().split("\n"),s=0;x("旁白",0);for(var r=0;r<l.length;r++){var c,d=l[r].match(i);null!=d?(e=d[1].trim(),n=d[2],""!=e&&(w(e)||(x(e,s),s++)),c=new p("",y(e),n),a[a.length]=c):(c=new p("",y("旁白"),l[r]),a[a.length]=c)}return o.length}();break;default:e=function(){o=[],a=[],t("#div_names").html(""),t("#div_log").hide();for(var e=/\d{4}(?:-|\/)\d{1,2}(?:-|\/)\d{1,2} (\d{1,2}:\d{2}:\d{2}) (AM|PM)? ?([^\(]*)/,n=/(.*?)(\([0-9]+\))? +\d{4}(?:-|\/)\d{1,2}(?:-|\/)\d{1,2} +(\d{1,2}:\d{2}:\d{2}).*/,i=/(.*?)(\([0-9]+\))? +(\d{1,2}:\d{2}:\d{2}).*/,l=/^([\.。!!][rR]|[\/\.、。!!][mM][eE]|[\.。!!][hH][eE][lL][pP]|[\.。!!][lL][oO][gG]|[\.。!!][wW]|[\.。!!][sS][cC]|[\.。!!][eE][nN]|[\.。!!][sS][eE][tT]|[\.。!!][sS][tT]|[\.。!!][cC][oO][cC]|[\.。!!][dD][nN][dD]|[\.。!!][tTlL][iI]|[\.。!!][jJ][rR][rR][pP]|[\.。!!][rR][uU][lL][eE][sS]|[\.。!!][nN]|[\.。!!][bB][oO][tT]|[\.。!!][oO][bB]|[\.。!!][wW][eE][lL][cC][oO][mM][eE]).*/,s=/^(\(|().*/,r=/\[图片\]/,h=t("#textarea_log_input").val().split("\n"),f="",v="",g=0,m=0;m<h.length;m++)if(0!=h[m].length){var b=h[m].match(e),k=h[m].match(n),C=h[m].match(i);if(null!=b||null!=k||null!=C)null!=b?(f=b[3].trim(),v=b[1]):null!=k?(f=k[1].trim(),v=k[3]):null!=C&&(f=C[1].trim(),v=C[3]),_&&0==f.indexOf("【")&&-1!=f.indexOf("】")&&(f=f.substr(f.indexOf("】")+1)),""!=f&&"系统消息"!=f&&(w(f)||(x(f,g),g++));else{if(""==f)continue;if("系统消息"==f)continue;if(c&&null!=h[m].match(l))continue;if(d&&null!=h[m].match(s))continue;if(u&&(h[m]=h[m].replace(r,""),0==h[m].length))continue;8!=v.length&&(v=" "+v);var O=new p(v,y(f),h[m]);a[a.length]=O}}return o.length}()}e>0?(O(),T(),t("#div_log").show()):(t("#div_log").hide(),t("#button_palette").hide(),t("#button_share").hide(),t("#button_download_txt").hide(),t("#button_download_docx").hide(),t("#defaultMode").hide(),t("#div_names").html('<div class="div_center div_italic" style="color:red"><p>无法识别聊天记录文本,请确认输入格式正确</p></div>'))})}(jQuery,window,document);</script>