// ==UserScript== // @name MT论坛 // @namespace http://tampermonkey.net/ // @description MT论坛效果增强,如自动签到、自动展开帖子、滚动加载评论、显示uid、屏蔽用户、手机版小黑屋、今日签到之星、今日签到排名、帖外预览图片、搜索框清空按钮修复、个人空间正确进入、康哥图床-帖子内(20MB)、Hello图床-帖子内(20MB)、Z4A图床-帖子内(50MB)、康哥图床-聊天内(20MB)、Hello图床-聊天内(20MB)、Z4A图床-聊天内(50MB)、付费主题白嫖提醒等 // @version 2.4.7 // @author WhiteSevs // @icon https://bbs.binmt.cc/favicon.ico // @match *://bbs.binmt.cc/* // @compatible edge Beta/Dev/Candy 测试通过 // @compatible 火狐 测试通过 // @compatible Yandex 测试通过 // @compatible Kiwi 测试通过 // @license GPL-3.0-only // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_setClipboard // @grant GM_xmlhttpRequest // @run-at document-start // @supportURL https://github.com/893177236/Monkey_script // @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.4.1/jquery.min.js // @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/nanogallery2/3.0.5/jquery.nanogallery2.min.js // @require https://greasyfork.org/scripts/441331-md5/code/md5.js?version=1026891 // @downloadURL none // ==/UserScript== (function () { 'use strict'; const log = { success: (str) => { console.log("%c" + str, "color: #00a5ff"); }, error: (str) => { console.trace("%c" + str, "color: #f20000"); } } function tryCatch(func, params, errorFunc) { // 捕获错误 try { func(params); } catch (error) { console.log("%c" + (func.name + "出现错误"), "color: #f20000"); console.log("%c" + ("错误原因:" + error), "color: #f20000"); window.eval(errorFunc); } } let mt_config = { dom_obj: { beauty_select: function () { //下拉列表对象 return document.getElementsByClassName("beauty-select")[0]; }, combobox_switch: function () { //复选框对象 return document.getElementsByClassName("whitesevcheckbox")[0]; }, comiis_verify: function () { //帖子内各个人的信息节点【list】 return document.getElementsByClassName("comiis_verify"); }, comiis_formlist: function () { //导航中最新、热门、精华、恢复、抢沙发的各个帖子【list】 return document.getElementsByClassName("forumlist_li"); }, comiis_mmlist: function () { return document.getElementsByClassName("comiis_mmlist"); }, comiis_postli: function () { //帖子内评论,包括帖子内容主体,第一个就是主体【list】 return document.getElementsByClassName("comiis_postli comiis_list_readimgs nfqsqi") }, post_bottom_controls: function () { // 帖子底部一栏控件 return document.getElementsByClassName("comiis_znalist_bottom b_t cl") }, post_list_of_comments: function () { //帖子内评论列表 return $(".comiis_postlist.kqide"); }, post_next_commect: function () { //帖子内评论下一页的按钮 return document.querySelector("div.comiis_page.bg_f>a:nth-child(3)"); } }, rexp: { search_url: /bbs.binmt.cc\/search.php/g, //搜索页 chat_url: /home.php\?mod=space&do=pm&subop=view/g, // 聊天页 home_url: /home.php\?mod=spacecp&ac=profile&op=info/g, //个人空间页 home_url_brief: /home.php\?mod=space/g, //个人空间页简略url home_kmisign_url: /bbs.binmt.cc\/(forum.php\?mod=guide&view=hot(|&mobile=2)|k_misign-sign.html)/g, //主页和签到页链接 home_space_url: /bbs\.binmt\.cc\/home\.php\?mod=space/g, //【我的】 个人信息页链接 home_space_pc_uid_url: /space-uid-(.*?).html/, //PC 个人空间链接uid reply_forum: /bbs.binmt.cc\/forum.php\?mod=post&action=reply/g, // 回复的界面url sign_url: "", navigation_url: "", community_url: /forum.php\?forumlist/, //社区 forum_post: /(bbs.binmt.cc\/thread-|bbs.binmt.cc\/forum.php\?mod=viewthread)/g, //帖子链接 forum_post_pc: /.*:\/\/bbs.binmt.cc\/thread.*/, //帖子链接-PC forum_guide_url: /bbs.binmt.cc\/forum.php\?mod=guide/g, // 导航链接 forum_post_reply: /forum.php\?mod=post&action=reply/g, //帖子中回复的链接 forum_post_page: '&page=(.*)', //帖子链接的当前所在页 page forum_post_pc_page: 'thread-(.*?)-', //PC帖子链接的当前所在页 page forum_plate_text: /休闲灌水|求助问答|逆向教程|资源共享|综合交流|编程开发|玩机教程|建议反馈/g, //各版块名称 plate_url: /bbs.binmt.cc\/forum-[0-9]{1,2}-[0-9]{1,2}.html/g, // 板块链接 formhash: /formhash=(.*)&/, //论坛账号的凭证 font_special: /
| ||<\/font>|||||align=".*?"/g, //帖子内特殊字体格式 forum_post_guide_url: /bbs.binmt.cc\/page-[1-5].html|bbs.binmt.cc\/forum.php\?mod=guide/g, //帖子链接和导航链接 mt_uid: /uid=(\d+)/, nologin: /member.php\?mod=logging&action=login(|&mobile=2)/g, //未登录 pc_useragent: 'Windows', //pc识别 k_misign_sign: "bbs.binmt.cc\/k_misign-sign.html", post_forum: /forum.php\?mod=post&action=newthread/, // 发布帖子 edit_forum: /forum.php\?mod=post&action=edit/, // 编辑帖子 } } // mt全屏遮罩调用 // popup.open(''); // 关闭方式 // popup.close() let utils = { dateStringFormatToStamp(datastring) { let date = datastring; date = date.substring(0, 19); date = date.replace(/-/g, '/'); let timestamp = new Date(date).getTime(); // let newDate = new Date(timestamp); return timestamp; }, timeStringFormatToStamp(timestring) { let today = new Date(); let date = today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate() + " " + timestring; date = date.substring(0, 19); date = date.replace(/-/g, '/'); let timestamp = new Date(date).getTime(); // let newDate = new Date(timestamp); return timestamp }, listCompareDescByValue(propertyName) { // json根据 字段(int)降序 return function (object1, object2) { var value1 = object1[propertyName]; var value2 = object2[propertyName]; if (value2 < value1) { return -1; } else if (value2 > value1) { return 1; } else { return 0; } } }, listCompareAscByValue(propertyName) { // json根据 字段(int)升 return function (object1, object2) { var value1 = object1[propertyName]; var value2 = object2[propertyName]; if (value2 > value1) { //-1表示前对象小,1表示后对象小,0表示相等 return -1; } else if (value2 < value1) { return 1; } else { return 0; } } }, listToStringByValue(_list_, propertyName) { // json根据 字段(int)合并 let content = ""; Array.from(_list_).forEach((item) => { content = content + item[propertyName]; }) return content } } async function compatiblePartialFunction() { // 兼容部分函数 GM_xmlhttpRequest x浏览器进行了兼容,调用方式为GM.xmlHttpRequest,但会检测是否同源请求,所以不可修改headers if (typeof GM_xmlhttpRequest == "undefined") { if (typeof GM != "undefined" && typeof GM.xmlHttpRequest != "undefined") { GM_xmlhttpRequest = GM.xmlHttpRequest; } else { GM_xmlhttpRequest = () => { console.log("GM_xmlhttpRequest不兼容"); popup.open("GM_xmlhttpRequest不兼容", "alert"); } } } if (typeof $ == "undefined") { await loadNetworkResource("https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.4.1/jquery.min.js"); } var loadNetworkResource = []; window.GM_asyncLoadScript = (url) => { // 异步执行跨域js资源 if (loadNetworkResource.indexOf(url) != -1) { console.log("已加载该js:", url); return } return new Promise(res => { GM_xmlhttpRequest({ url: url, method: "GET", async: false, timeout: 10000, onload: (r) => { let execStatus = false; try { eval(r.responseText); execStatus = true; loadNetworkResource = loadNetworkResource.concat(url); } catch (error) { log.error("执行JS失败" + error); execStatus = false; } try { window.eval(r.responseText); execStatus = true; loadNetworkResource = loadNetworkResource.concat(url); } catch (error) { log.error("执行JS失败" + error); execStatus = false; } res(execStatus); }, onerror: () => { log.error("网络异常,加载JS失败", url); popup.open("网络异常,加载JS失败"); res(false); } }) }) } window.GM_asyncLoadStyleSheet = (url) => { // 异步添加跨域css资源 if (loadNetworkResource.indexOf(url) != -1) { console.log("已加载该css:", url); return } loadNetworkResource = loadNetworkResource.concat(url); GM_xmlhttpRequest({ url: url, method: "GET", async: false, timeout: 10000, onload: (r) => { GM_addStyle(r.responseText); }, onerror: () => { popup.open("网络异常,加载CSS失败"); } }) } if (typeof GM_getValue == "undefined") { window.GM_getValue = (key) => { window.localStorage.getItem(key); } } if (typeof GM_setValue == "undefined") { window.GM_setValue = (key, value) => { window.localStorage.setItem(key, value); } } if (typeof GM_deleteValue == "undefined") { window.GM_deleteValue = (key) => { window.localStorage.removeItem(key); } } if (typeof GM_addStyle == "undefined") { window.GM_addStyle = (styleText) => { let cssDOM = document.createElement("style"); cssDOM.setAttribute("type", "text/css"); cssDOM.innerHTML = styleText; document.head.appendChild(cssDOM); } } if (typeof GM_setClipboard == "undefined") { window.GM_setClipboard = (text) => { let clipBoardDOM = document.createElement("input"); clipBoardDOM.type = "text"; clipBoardDOM.setAttribute("style", "opacity:0;position:absolute;"); clipBoardDOM.id = "whitesevClipBoardInput"; document.body.append(clipBoardDOM); $("#whitesevClipBoardInput").val(text); $("#whitesevClipBoardInput").removeAttr("disabled").select(); document.execCommand('copy'); $('#whitesevClipBoardInput').remove(); } } log.success(`当前jQuery版本:${$.fn.jquery}`); if (typeof $.nanogallery2 == "undefined") { await loadNetworkResource("https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/nanogallery2/3.0.5/jquery.nanogallery2.min.js"); } if (typeof hex_md5 == "undefined") { await loadNetworkResource("https://greasyfork.org/scripts/441331-md5/code/md5.js?version=1026891"); } } async function loadCheckboxTipResource() { // 加载checkbox值变化的显示的提示的资源 await GM_asyncLoadScript("https://whitesev.gitee.io/static_resource/ios_loading/js/iosOverlay.js"); await GM_asyncLoadStyleSheet("https://whitesev.gitee.io/static_resource/ios_loading/css/iosOverlay.css"); } function repairPCNoLoadResource() { // 修复电脑版未加载的js资源 GM_asyncLoadScript("https://cdn2.bbs.binmt.cc/static/js/smilies.js?x6L"); GM_asyncLoadScript("https://cdn2.bbs.binmt.cc/static/js/common.js?x6L"); } function latestReleaseForumPost() { // 最新发表 var ele = document.createElement('li'); var url = window.location.href; ele.id = "latest_publication"; ele.innerHTML = '最新发表<\/a>'; document.getElementsByClassName("wp comiis_nvbox cl")[0].children[1].appendChild(ele); if (url == 'https:\/\/bbs.binmt.cc\/forum.php?mod=guide&view=newthread') { document.getElementById("mn_forum_10").children[0].style = "background: url("; ele.style.cssText = 'background: url("https:\/\/cdn2.bbs.binmt.cc\/template\/comiis_mi\/img\/nv_a.png") repeat-x 50% -50px;'; } } function removeForumPostFontStyle() { // 移除帖子内的字体style if (GM_getValue("v1") && location.href.match(mt_config.rexp.forum_post)) { var rule = mt_config.rexp.font_special; var h_content = document.getElementsByClassName("comiis_a comiis_message_table cl"); h_content[0].innerHTML = h_content[0].innerHTML.replace(rule, ''); } } function autoSignIn() { //mt签到 function getFormHash() { // 获取账号的formhash return document.querySelector("input[name=formhash]") ? document.querySelector("input[name=formhash]").value : document.querySelector("div[class=sidenv_exit]>a").href.match(mt_config.rexp.formhash)[1]; } function getLocalTime() { // 获取当前时间 let GM_myDate = new Date; let GM_year = GM_myDate.getFullYear(); //获取当前年 let GM_mon = GM_myDate.getMonth() + 1; //获取当前月 let GM_date = GM_myDate.getDate(); let GM_alldate = GM_year.toString() + GM_mon.toString() + GM_date.toString(); GM_alldate = parseInt(GM_alldate); return GM_alldate } if (!GM_getValue("v17")) { console.log("尚未开启每日签到"); return; } if (GM_getValue("mt_sign") == getLocalTime()) { console.log("今日已签到"); return; } if ((document.querySelector("div[class=comiis_dlq]>a") != null) || (document.getElementsByClassName("sidenv_user")[0].href.match(mt_config.rexp.nologin) != null)) { console.log("当前账号尚未登录"); return; } let mtFormHash = getFormHash(); if (mtFormHash == null) { console.log("获取账号formhash失败"); return; } $.get("/k_misign-sign.html?operation=qiandao&format=button&formhash=" + mtFormHash + "&inajax=1&ajaxtarget=midaben_sign", function (data, status) { console.log(data.responseText); GM_setValue("mt_sign", getLocalTime()); window.location.reload(); }); } function searchHistory() { // 搜索历史 if (GM_getValue("v19") && location.href.match(mt_config.rexp.search_url)) { function search_event() { // 搜索历史事件 //搜索界面增加关闭按钮事件,清空input内容 //点击搜索保存搜索记录 $("#scform_submit").click(function () { let getsearchtext = $("#scform_srchtxt").val(); if ((getsearchtext != null) && (getsearchtext != "")) { let search_history_array = new Array(getsearchtext); let has_history = GM_getValue("search_history"); if (has_history != null) { if ($.inArray(getsearchtext, has_history) != -1) { console.log("已有该搜索历史记录") search_history_array = has_history } else { console.log("无该记录,追加"); search_history_array = search_history_array.concat(has_history); } } else { console.log("空记录,添加") } GM_setValue("search_history", search_history_array); } }) } function add_search_history() { //搜索界面添加搜索历史记录 $("#scform_srchtxt").attr("list", "search_history"); var search_history_list = GM_getValue("search_history"); var dom_datalist = document.createElement("datalist"); dom_datalist.id = "search_history"; var option_text = ""; if (search_history_list) { for (var i = 0; i < search_history_list.length; i++) { option_text = option_text + '
  • 今日最先
  • `)[0]); let getMaxPage = (urlextra) => { return new Promise(res => { GM_xmlhttpRequest({ url: "https://bbs.binmt.cc/k_misign-sign.html?operation=" + urlextra, async: false, dataType: 'html', headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53" }, onload: function (resp) { let last_url = $(resp.responseText).find("#J_list_detail .pg .last")[0].href; let last_page = last_url.match(/page=([0-9]*)/)[1]; res(last_page); // console.log(data); // $("#ranklist").html(data); // $('#ranklist').attr('listtype', listtype); }, onerror: function (resp) { console.log(resp); res(0); } }) }) } let getPagePeople = (page) => { return new Promise(res => { GM_xmlhttpRequest({ url: "https://bbs.binmt.cc/k_misign-sign.html?operation=list&op=&page=" + page, async: false, dataType: 'html', headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53" }, onload: function (resp) { let peoples = $(resp.responseText).find("#J_list_detail tbody tr"); let ret_array = []; if (peoples.length == 2 && peoples[0].textContent.indexOf("暂无内容") != -1) { res(ret_array); return; } for (let i = 1; i <= peoples.length - 2; i++) { let people = peoples[i]; let ret_json = {}; let user_name = people.children[0].getElementsByTagName("a")[0].textContent; let space_url = people.children[0].getElementsByTagName("a")[0].href; let uid = space_url.match(/space-uid-([0-9]*)/)[1]; let sign_all_days = people.children[1].textContent; let sign_month_days = people.children[2].textContent; let sign_time = people.children[3].textContent; let sign_reward = people.children[5].textContent; ret_json["user"] = user_name; ret_json["uid"] = uid; ret_json["avatar"] = "https://avatar-bbs.mt2.cn/uc_server/avatar.php?uid=" + uid + "&size=small"; ret_json["days"] = sign_all_days; ret_json["monthDays"] = sign_month_days; ret_json["time"] = sign_time; ret_json["reward"] = sign_reward; ret_array = ret_array.concat(ret_json); } res(ret_array) }, onerror: function (resp) { console.log(resp); res({}); } }) }) } function changeRankList(data, listtype) { $("#ranklist").html(data); $('#ranklist').attr('listtype', listtype); } ajaxlist = async (listtype) => { listtype = listtype; if (listtype == 'today') { loadingdelay = false; urlextra = 'list&op=today'; } else if (listtype == 'month') { loadingdelay = false; urlextra = 'list&op=month'; } else if (listtype == 'zong') { loadingdelay = false; urlextra = 'list&op=zong'; } else if (listtype == 'calendar') { loadingdelay = true; urlextra = 'calendar'; } else { loadingdelay = false; urlextra = 'list'; } //alert(loadingdelay); if (listtype == 'todayLatest') { loadingdelay = false; urlextra = 'list&op=&page=0'; let maxPage = await getMaxPage(urlextra); let latestPeople = await getPagePeople(maxPage); latestPeople.reverse(); if (latestPeople.length < 10) { let latestPeople_2 = await getPagePeople(maxPage - 1); latestPeople_2.reverse(); latestPeople = latestPeople.concat(latestPeople_2); latestPeople.reverse(); } let peopleHTML = ''; latestPeople.reverse(); console.log(latestPeople); latestPeople.forEach(people => { peopleHTML = peopleHTML + `

    ` + people["user"] + `` + people["time"] + `总天数 ` + people["days"] + `天

    月天数 ` + people["monthDays"] + ` 天 , 上次奖励 ` + people["reward"] + `

    ` }) let latestHTML = `
  • ` + peopleHTML + `
    ` changeRankList(latestHTML, listtype) } else { $.ajax({ type: 'GET', url: "plugin.php?id=k_misign:sign&operation=" + urlextra, async: false, dataType: 'html', success: function (data) { // console.log(data); data = data.replace(`今日排行`, `今日排行
  • 今日最先
  • `); changeRankList(data, listtype); }, complete: function (XHR, TS) { XHR = null } }); } } } } const blackHome = { showBlackHomeView: async () => { // 显示小黑屋界面 $.NZ_MsgBox.alert({ title: "小黑屋名单", content: "获取中", type: "", location: "center", buttons: { confirm: { text: "确定" } } }); let blacklistret = await blackHome.getBlackList(''); if (blacklistret == {}) { return }; let blacklist = window.eval('(' + blacklistret + ')'); let blackContent = ''; function sortByProperTyName(data, propertyname) { let _list_ = []; $.each(data, function (index, value) { let date = value["dateline"].match(/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}[\s]*[0-9]{1,2}:[0-9]{1,2})/g)[0]; date = date.substring(0, 19); date = date.replace(/-/g, '/'); let timestamp = new Date(date).getTime(); value["time"] = timestamp; _list_ = _list_.concat(value); }); function compareDesc(propertyName) { return function (object1, object2) { var value1 = object1[propertyName]; var value2 = object2[propertyName]; if (value2 < value1) { return -1; } else if (value2 > value1) { return 1; } else { return 0; } } } _list_.sort(compareDesc("time")); return _list_; } let newBlacklist = sortByProperTyName(blacklist["data"], "time"); $.each(newBlacklist, function (index, value) { let blackreson = (value["reason"] == "") ? "无" : value["reason"]; blackContent = blackContent + `

    操作时间: ` + value["dateline"] + `

    操作行为: ` + value["action"] + `

    过期时间: ` + value["groupexpiry"] + `

    操作人员: ` + value["operator"] + `

    操作理由: ` + blackreson + `
    `; // console.log(value); }) let mainBlackContent = '' + blackContent + "
    "; $(".msgcon").html(mainBlackContent); $(".NZ-MsgBox-alert.NZ-MsgBox--motion").css("top", "100px"); $(".msgcon").css("height", "400px"); }, insertMobileBlackHomeButton: async function () { // 插入手机版查看小黑屋的按钮 if ((window.location.href.match(mt_config.rexp.home_space_url) != null) && (GM_getValue("v30"))) { // @require https://cdn.bootcdn.net/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shCore.js // @require https://cdn.bootcdn.net/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushJScript.js // gitee需要公开仓库,那我只能引用资源站的js和css了 // 主页 https://www.jq22.com/jquery-info24191 // https://gitee.com/whitesev/static_resource/raw/master/NZ_MsgBox/Js/NZ-Plugin/Js/NZ-MsgBox.min.js // https://gitee.com/whitesev/static_resource/raw/master/NZ_MsgBox/Js/NZ-Plugin/Js/NZ-Drag.min.js // https://gitee.com/whitesev/static_resource/raw/master/NZ_MsgBox/Js/NZ-Plugin/Css/NZ-MsgBox.min.css // 不需要加载的 // https://gitee.com/whitesev/static_resource/raw/master/NZ_MsgBox/Js/spin/spin.js // https://gitee.com/whitesev/static_resource/raw/master/NZ_MsgBox/Js/spin/spin.css // https://cdn.bootcdn.net/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCoreRDark.min.css // https://gitee.com/whitesev/static_resource/raw/master/NZ_MsgBox/Css/fontawesome-free-5.11.2-web/css/all.min.css // https://gitee.com/whitesev/static_resource/raw/master/NZ_MsgBox/Css/animate.min.css await GM_asyncLoadScript("https://www.jq22.com/demo/NZ-Plugin-MsgBox202201130154/Js/NZ-Plugin/Js/NZ-MsgBox.min.js"); await GM_asyncLoadScript("https://www.jq22.com/demo/NZ-Plugin-MsgBox202201130154/Js/NZ-Plugin/Js/NZ-Drag.min.js"); await GM_asyncLoadStyleSheet("https://www.jq22.com/demo/NZ-Plugin-MsgBox202201130154/Js/NZ-Plugin/Css/NZ-MsgBox.min.css") let black_home_ele = document.createElement("a"); black_home_ele.setAttribute("href", "javascript:;"); black_home_ele.className = "comiis_flex comiis_styli bg_f b_t cl blacklist"; black_home_ele.innerHTML = `
    小黑屋
    `; GM_addStyle(` .NZ-MsgBox-alert .msgcontainer .msgtitle { text-align: center !important; } #autolist .k_misign_lu img { width: 40px; height: 40px; -moz-border-radius: 20px; -webkit-border-radius: 20px; border-radius: 20px; } .k_misign_lc .f_c{ margin: 5px 0px; }`) black_home_ele.onclick = () => { blackHome.showBlackHomeView(); } Array.from(document.querySelectorAll(".comiis_myinfo_list.bg_f.cl")).forEach((ele) => { if (ele.innerText.match(/消息提醒|资料设置|我的积分|我的勋章|我的道具/)) { ele.append(black_home_ele); return; } }) } }, getBlackList: async (cid) => { // 获取黑名单列表 return new Promise(res => { GM_xmlhttpRequest({ url: "https://bbs.binmt.cc/forum.php?mod=misc&action=showdarkroom&cid=" + cid + "&t=&ajaxdata=json", timeout: 5000, method: "GET", async: false, headers: { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53", }, onload: (r) => { res(r.responseText); }, onerror: (r) => { console.log(r); res({}); } }) }) } } const quickUBB = { code: { "rainbow1": { "key": "转普通彩虹", "value": "", "isFunc": true, "num": 1 }, "rainbow2": { "key": "转黑白彩虹", "value": "", "isFunc": true, "num": 2 }, "rainbow3": { "key": "转黑红彩虹", "value": "", "isFunc": true, "num": 3 }, "rainbow4": { "key": "转蓝绿彩虹", "value": "", "isFunc": true, "num": 4 }, "size": { "key": "size", "value": "[size=][/size]", "tagL": "=", "tagR": "]", "L": "[size=]", "R": "[/size]", "cursorL": "[size=", "cursorLength": 6 }, "color": { "key": "color", "value": "[color=][/color]", "tagL": "=", "tagR": "]", "L": "[color=]", "R": "[/color]", "cursorL": "[color=", "cursorLength": 7 }, "b": { "key": "加粗", "value": "[b][/b]", "tagL": "]", "tagR": "[", "L": "[b]", "R": "[/b]", "cursorR": "[/b]", "cursorLength": 4 }, "u": { "key": "下划线", "value": "[u][/u]", "tagL": "]", "tagR": "[", "L": "[u]", "R": "[/u]", "cursorR": "[/u]", "cursorLength": 4 }, "i": { "key": "倾斜", "value": "[i][/i]", "tagL": "]", "tagR": "[", "L": "[i]", "R": "[/i]", "cursorR": "[/i]", "cursorLength": 4 }, "s": { "key": "中划线", "value": "[s][/s]", "tagL": "]", "tagR": "[", "L": "[s]", "R": "[/s]", "cursorR": "[/s]", "cursorLength": 4 }, "lineFeed": { "key": "换行", "value": "[*]", "L": "", "R": "[*]", "cursorL": "[*]", "cursorLength": 3 }, "longHorizontalLine": { "key": "长横线", "value": "[hr]", "L": "", "R": "[hr]", "cursorL": "[hr]", "cursorLength": 4 }, "link": { "key": "链接", "value": "[url=][/url]", "tagL": "=", "tagR": "]", "L": "[url=]", "R": "[/url]", "cursorL": "[url=", "cursorLength": 5 }, "hide": { "key": "隐藏", "value": "[hide][/hide]", "tagL": "]", "tagR": "[", "L": "[hide]", "R": "[/hide]", "cursorR": "[/hide]", "cursorLength": 7 }, "quote": { "key": "引用", "value": "[quote][/quote]", "tagL": "]", "tagR": "[", "L": "[quote]", "R": "[/quote]", "cursorR": "[/quote]", "cursorLength": 8 } }, insertQuickReplyUBB: () => { // 快捷回复 if (GM_getValue("v31") && (window.location.href.match(mt_config.rexp.forum_post) != null)) { quickUBB.jqueryExtraFunction(); $(".comiis_post_ico .comiis_pictitle").after($(`插入`)); $(".comiis_post_ico.comiis_minipost_icot.f_c.cl").on("click", "a", (e) => { $("#comiis_post_tab div.bg_f").hide() e.currentTarget.style.display = ""; if (e.currentTarget.className != "comiis_pictitle") { e.currentTarget.style.display = "block"; } }) let message_ele = $("#needmessage"); let fastpostsubmitline_ele = $("#fastpostsubmitline"); if (message_ele && fastpostsubmitline_ele) { $("#comiis_post_tab").append($(` `)); $.each(quickUBB.code, function (index, value) { let ubbs = $(`
  • ${value["key"]}
  • `); ubbs.on("click", (e) => { $.each($("#comiis_post_tab div.comiis_post_urlico ul li.quickUBBs a.comiis_xifont"), (i, v) => { v.className = "comiis_xifont f_d"; if (v == e.target) { v.className = "comiis_xifont f_0"; } }); let userInput = prompt(`请输入需要${value["key"]}的文字`, value["value"]); if (value["isFunc"]) { userInput = quickUBB.set_rainbow(value["num"], userInput); } if (userInput != null && userInput.trim()) { comiis_addsmilies(userInput); } }) $("#comiis_post_tab div.comiis_post_urlico ul").append(ubbs[0]); }) } else { console.log("未找到快捷回复框"); } } }, insertReplayUBB: () => { // 具体回复 if (!GM_getValue("v35")) { console.log("v35未开启"); return; } if (window.location.href.match(mt_config.rexp.reply_forum) == null) { console.log("未在回复界面"); return; } let insertDOM = $(".comiis_post_urlico"); if (!insertDOM) { console.log("未找到插入元素"); return; } let parentEle = $(".comiis_post_urlico > ul")[0]; let contentEle = $("#comiis_post_qydiv > ul"); quickUBB.jqueryExtraFunction(); $.each(quickUBB.code, function (key, value) { let ubbs = $(`
  • ${value["key"]}
  • `); ubbs.on("click", (e) => { let bottomEle = $(`#comiis_post_qydiv li[data-key='${value.key}']`); if (!bottomEle.length) { console.log("未找到该元素"); return } let contentIndex = 7 + Object.keys(quickUBB.code).indexOf(key); $("#comiis_post_qydiv ul li").hide().eq(contentIndex).fadeIn(); $.each($("#comiis_post_tab div.comiis_post_urlico ul li a.comiis_xifont"), (i, v) => { v.className = "comiis_xifont f_d"; if (v == e.target) { v.className = "comiis_xifont f_0"; } }); }) parentEle.append(ubbs[0]); let ubbs_content = document.createElement("li"); ubbs_content.setAttribute("style", "display: none;"); ubbs_content.setAttribute("data-key", value["key"]); ubbs_content.innerHTML = `
    `; contentEle.append(ubbs_content); $(`.comiis_sendbtn[data-keyI="${key}"]`).on("click", () => { let text = $(`#comiis_input_${key}`).val(); if (text == '') { popup.open('请输入需要插入的内容', 'alert'); return; } if (quickUBB.code[key]["isFunc"]) { text = quickUBB.set_rainbow(quickUBB.code[key]["num"], text); } if (quickUBB.code[key].hasOwnProperty("L")) { text = quickUBB.code[key]['L'] + text + quickUBB.code[key]['R']; } $("#needmessage").insertAtCaret(text); // if (quickUBB.code[key]["tagL"] != undefined || quickUBB.code[key]["tagR"] != undefined) { // $("#needmessage").moveCursorInCenterByText(quickUBB.code[key]["tagL"], quickUBB.code[key]["tagR"]); // } if (quickUBB.code[key].hasOwnProperty("cursorL")) { $("#needmessage").moveCursorToCenterByTextWithLeft(quickUBB.code[key]["cursorL"], quickUBB.code[key]["cursorLength"]); } if (quickUBB.code[key].hasOwnProperty("cursorR")) { $("#needmessage").moveCursorToCenterByTextWithRight(quickUBB.code[key]["cursorR"], quickUBB.code[key]["cursorLength"]); } }) }); }, set_rainbow: (num, text) => { if (text == "") { return ''; } var wr_text = text; var wr_code, wr_rgb, r, g, b, i, j, istep var wr_rgb1, wr_rgb2, r1, g1, b1, r2, g2, b2 r1 = g1 = b1 = r2 = g2 = b2 = 0; r = 0; g = 0; b = 0; istep = 0; wr_code = ''; if (num == 1) { istep = 40; r = 255; i = 1; j = 0; do { if (wr_text.charCodeAt(j) != 32) { if (g + istep < 256) { if (i == 1) g += istep; } else if (i == 1) { i = 2; g = 255; } if (r - istep > -1) { if (i == 2) r -= istep; } else if (i == 2) { i = 3; r = 0; } if (b + istep < 256) { if (i == 3) b += istep; } else if (i == 3) { i = 4; b = 255; } if (g - istep > -1) { if (i == 4) g -= istep; } else if (i == 4) { i = 5; g = 0; } if (r + istep < 256) { if (i == 5) r += istep; } else if (i == 5) { i = 6; r = 255; } if (b - istep > -1) { if (i == 6) b -= istep; } else if (i == 6) { i = 1; b = 0; } wr_rgb = ''; wr_rgb += parseInt(r).toString(16).length == 1 ? 0 + parseInt(r).toString(16) : parseInt(r).toString(16); wr_rgb += parseInt(g).toString(16).length == 1 ? 0 + parseInt(g).toString(16) : parseInt(g).toString(16); wr_rgb += parseInt(b).toString(16).length == 1 ? 0 + parseInt(b).toString(16) : parseInt(b).toString(16); wr_rgb = wr_rgb.toUpperCase(); wr_code += '[color=#' + wr_rgb + ']' + wr_text.charAt(j) + '[/color]'; } else { wr_code += wr_text.charAt(j); } j++; } while (j < wr_text.length); } else if (num == 2) { istep = 255 / wr_text.length; for (i = 1; i < wr_text.length + 1; i++) { if (wr_text.charCodeAt(i - 1) != 32) { r += istep; g += istep; b += istep; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; wr_rgb = ''; wr_rgb += parseInt(r).toString(16).length == 1 ? 0 + parseInt(r).toString(16) : parseInt(r).toString(16); wr_rgb += parseInt(g).toString(16).length == 1 ? 0 + parseInt(g).toString(16) : parseInt(g).toString(16); wr_rgb += parseInt(b).toString(16).length == 1 ? 0 + parseInt(b).toString(16) : parseInt(b).toString(16); wr_rgb = wr_rgb.toUpperCase(); wr_code += '[color=#' + wr_rgb + ']' + wr_text.charAt(i - 1) + '[/color]'; } else { wr_code += wr_text.charAt(i - 1); } } } else if (num == 3) { istep = 255 / wr_text.length; for (i = 1; i < wr_text.length + 1; i++) { if (wr_text.charCodeAt(i - 1) != 32) { r += istep; g = 29; b = 36; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; wr_rgb = ''; wr_rgb += parseInt(r).toString(16).length == 1 ? 0 + parseInt(r).toString(16) : parseInt(r).toString(16); wr_rgb += parseInt(g).toString(16).length == 1 ? 0 + parseInt(g).toString(16) : parseInt(g).toString(16); wr_rgb += parseInt(b).toString(16).length == 1 ? 0 + parseInt(b).toString(16) : parseInt(b).toString(16); wr_rgb = wr_rgb.toUpperCase(); wr_code += '[color=#' + wr_rgb + ']' + wr_text.charAt(i - 1) + '[/color]'; } else { wr_code += wr_text.charAt(i - 1); } } } else if (num == 4) { istep = 255 / wr_text.length; for (i = 1; i < wr_text.length + 1; i++) { if (wr_text.charCodeAt(i - 1) != 32) { r = 0; g = 174; b += istep; if (r > 255) r = 255; if (g > 255) g = 255; if (b > 255) b = 255; wr_rgb = ''; wr_rgb += parseInt(r).toString(16).length == 1 ? 0 + parseInt(r).toString(16) : parseInt(r).toString(16); wr_rgb += parseInt(g).toString(16).length == 1 ? 0 + parseInt(g).toString(16) : parseInt(g).toString(16); wr_rgb += parseInt(255 - b).toString(16).length == 1 ? 0 + parseInt(255 - b).toString(16) : parseInt(255 - b).toString(16); wr_rgb = wr_rgb.toUpperCase(); wr_code += '[color=#' + wr_rgb + ']' + wr_text.charAt(i - 1) + '[/color]'; } else { wr_code += wr_text.charAt(i - 1); } } } return wr_code; }, jqueryExtraFunction: () => { $.fn.extend({ insertAtCaret: function (myValue) { var $t = $(this)[0]; if (document.selection) { this.focus(); var sel = document.selection.createRange(); sel.text = myValue; this.focus(); } else if ($t.selectionStart || $t.selectionStart == '0') { var startPos = $t.selectionStart; var endPos = $t.selectionEnd; var scrollTop = $t.scrollTop; $t.value = $t.value.substring(0, startPos) + myValue + $t.value.substring(endPos, $t.value.length); this.focus(); $t.selectionStart = startPos + myValue.length; $t.selectionEnd = startPos + myValue.length; $t.scrollTop = scrollTop; } else { this.value += myValue; this.focus(); } }, selectRange: function (start, end) { if (end === undefined) { end = start; } return this.each(function () { if ('selectionStart' in this) { this.selectionStart = start; this.selectionEnd = end; } else if (this.setSelectionRange) { this.setSelectionRange(start, end); } else if (this.createTextRange) { var range = this.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } }); }, getCursorPosition: function () { var el = $(this)[0]; var pos = 0; if ('selectionStart' in el) { pos = el.selectionStart; } else if ('selection' in document) { el.focus(); var Sel = document.selection.createRange(); var SelLength = document.selection.createRange().text.length; Sel.moveStart('character', -el.value.length); pos = Sel.text.length - SelLength; } return pos; }, moveCursorInCenterByText: function (leftTextFlag, rightTextFlag) { var el = $(this)[0]; var el_text = el.value; for (let i = el.selectionStart - 1; i > 0; i--) { let LText = el_text[i - 1]; let currentText = el_text[i]; if (LText == leftTextFlag && currentText == rightTextFlag) { this.selectRange(i); break; } } }, moveCursorToCenterByTextWithLeft: function (leftMatchText, _length_) { var el = $(this)[0]; var el_text = el.value; for (let i = el.selectionStart - 1; i > 0; i--) { let lTexts = el_text.substring(i - _length_, i); if (lTexts == leftMatchText) { this.selectRange(i); break; } } }, moveCursorToCenterByTextWithRight: function (rightMatchText, _length_) { var el = $(this)[0]; var el_text = el.value; for (let i = el.selectionStart - 1; i > 0; i--) { let rTexts = el_text.substring(i, i + _length_); if (rTexts == rightMatchText) { this.selectRange(i + _length_); break; } } } }); } } function blacklistShieldUsersOrBlocks() { // 黑名单-屏蔽用户或板块 if (location.href.match(mt_config.rexp.home_space_url) != null) { var white_space_ele = document.createElement("div"); var black_list_ele = document.createElement("div"); white_space_ele.className = "styli_h cl"; black_list_ele.setAttribute("id", "blacklistallmain"); black_list_ele.className = "comiis_myinfo_list bg_f cl"; black_list_ele.innerHTML = `
  • 保存
  • `; GM_addStyle(` #blacklistallmain{ height: 232px; } #blacklistallmain li.comiis_styli{ height: 180px; } #blacklistallmain #blacklistuid{ width: 90%; resize: none; opacity: 0.7; height: 70% !important; line-height: inherit; -webkit-appearance: none; border: none !important; font-size: 14px; vertical-align: middle; background-color: transparent; border-bottom: 3px solid #efefef !important; } #blacklistallmain #blacklistplate{ width: 90%; resize: none; opacity: 0.7; height: 30% !important; line-height: inherit; -webkit-appearance: none; border: none !important; font-size: 14px; vertical-align: middle; background-color: transparent; } #blacklistsave{ text-align: center; background: transparent !important; border-color: transparent !important; } `); let mt_commis_menu = document.getElementsByClassName("comiis_myinfo cl")[0]; mt_commis_menu.appendChild(white_space_ele); mt_commis_menu.appendChild(black_list_ele); mt_commis_menu.appendChild(white_space_ele); document.getElementById("blacklistuid").textContent = GM_getValue("blacklistuid") ? GM_getValue("blacklistuid") : ""; document.getElementById("blacklistplate").textContent = GM_getValue("blacklistuid") ? GM_getValue("blacklistuid") : ""; document.getElementById("blacklistsave").onclick = () => { let blackListUIDValue = document.getElementById("blacklistuid").value; let blackListPlateValue = document.getElementById("blacklistplate").value; GM_setValue("blacklistuid", blackListUIDValue); GM_setValue("blacklistplate", blackListPlateValue); popup.open("保存成功", "alert"); // iosOverlay({ // text: "保存成功", // duration: 2000, // icon: "https://www.helloimg.com/images/2022/05/24/ZoDS05.png" // }); } } } function identifyLinks() { // 识别链接 if (GM_getValue("v2")) { /*TEXT link to Clickable Hyperlink From Via*/ var clearLink, excludedTags, filter, linkMixInit, linkPack, linkify, observePage, observer, setLink, url_regexp, xpath; url_regexp = /((https?:\/\/|www\.)[\x21-\x7e]+[\w\/]|(\w[\w._-]+\.(com|cn|org|net|info|tv|cc))(\/[\x21-\x7e]*[\w\/])?|ed2k:\/\/[\x21-\x7e]+\|\/|thunder:\/\/[\x21-\x7e]+=)/gi; clearLink = function (a) { var b; a = null != (b = a.originalTarget) ? b : a.target; if (null != a && "a" === a.localName && -1 !== a.className.indexOf("texttolink") && (b = a.getAttribute("href"), 0 !== b.indexOf("http") && 0 !== b.indexOf("ed2k://") && 0 !== b.indexOf("thunder://"))) return a.setAttribute("href", "http://" + b) }; document.addEventListener("mouseover", clearLink); setLink = function (a) { if (null != a && a.hasOwnProperty("className") && typeof (a.parentNode.className) === "string" && -1 === a.parentNode.className.indexOf("texttolink") && "#cdata-section" !== a.nodeName) { var b = a.textContent.replace(url_regexp, '$1'); if (a.textContent.length !== b.length) { var c = document.createElement("span"); c.innerHTML = b; return a.parentNode.replaceChild(c, a) } } }; excludedTags = "a svg canvas applet input button area pre embed frame frameset head iframe img option map meta noscript object script style textarea code".split(" "); xpath = "//text()[not(ancestor::" + excludedTags.join(") and not(ancestor::") + ")]"; filter = new RegExp("^(" + excludedTags.join("|") + ")$", "i"); linkPack = function (a, b) { var c, d; if (b + 1E4 < a.snapshotLength) { var e = c = b; for (d = b + 1E4; b <= d ? c <= d : c >= d; e = b <= d ? ++c : --c) setLink(a.snapshotItem(e)); setTimeout(function () { return linkPack(a, b + 1E4) }, 15) } else for (e = c = b, d = a.snapshotLength; b <= d ? c <= d : c >= d; e = b <= d ? ++c : --c) setLink(a.snapshotItem(e)) }; linkify = function (a) { a = document.evaluate(xpath, a, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); return linkPack(a, 0) }; observePage = function (a) { for (a = document.createTreeWalker(a, NodeFilter.SHOW_TEXT, { acceptNode: function (a) { if (!filter.test(a.parentNode.localName)) return NodeFilter.FILTER_ACCEPT } }, !1); a.nextNode();) setLink(a.currentNode) }; observer = new window.MutationObserver(function (a) { var b, c; var d = 0; for (b = a.length; d < b; d++) { var e = a[d]; if ("childList" === e.type) { var g = e.addedNodes; var f = 0; for (c = g.length; f < c; f++) e = g[f], observePage(e) } } }); linkMixInit = function () { if (window === window.top && "" !== window.document.title) return linkify(document.body), observer.observe(document.body, { childList: !0, subtree: !0 }) }; var clearlinkF = function (a) { var url = a.getAttribute("href"); if (0 !== url.indexOf("http") && 0 !== url.indexOf("ed2k://") && 0 !== url.indexOf("thunder://")) return a.setAttribute("href", "http://" + url) }, clearlinkE = function () { for (var a = document.getElementsByClassName("texttolink"), b = 0; b < a.length; b++) clearlinkF(a[b]) }; setTimeout(clearlinkE, 2500); setTimeout(linkMixInit, 1100); } } function detectUserOnlineStatus() { // 探测用户在线状态 if (window.location.href.match(mt_config.rexp.forum_post_pc)) { var quanju = []; var cishu = 0; for (var sss = document.getElementsByClassName("pls favatar"), ll = 0; ll < sss.length; ll++) { var sendmessage = sss[ll].getElementsByClassName("comiis_o cl") if (sendmessage.length == 0) {} else { var sendmessageurl = sendmessage[0].getElementsByTagName('a')[1].href; let xhr = new XMLHttpRequest(); xhr.open("GET", sendmessageurl, false); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { let pattern = /正在.*]/g; let str = xhr.responseText; let newstr = str.match(pattern)[0]; quanju.push(newstr); } } xhr.send(); if (quanju[cishu].match('离线')) { cishu = cishu + 1; var imi2 = document.createElement('img'); imi2.src = 'https:\/\/cdn2.bbs.binmt.cc\/static\/image\/smiley\/doge\/54.png'; imi2.smilied = '1353'; imi2.border = "0"; imi2.style = 'float:right'; sss[ll].insertAdjacentElement('afterbegin', imi2); } else { cishu = cishu + 1; var imi = document.createElement('img'); imi.src = 'https:\/\/cdn2.bbs.binmt.cc\/static\/image/smiley\/doge\/35.png'; imi.smilied = '1384'; imi.border = "0"; imi.style = 'float:right'; sss[ll].insertAdjacentElement('afterbegin', imi); } } } } } function commentsAddReviews() { // 评论区添加点评功能 if (GM_getValue("v6") && location.href.match(mt_config.rexp.forum_post)) { var hongbao = document.getElementsByClassName("bottom_zhan y"); if (hongbao.length == 0) {} else { var cishu2 = 0; var replyhref = hongbao[cishu2].getElementsByTagName('a')[0].href; var page = replyhref.match(mt_config.rexp.forum_post_page)[1]; //console.log(page); for (cishu2 = 0; cishu2 < hongbao.length; cishu2++) { if (hongbao[cishu2].children.length == 1) { var rewardhref = hongbao[cishu2].getElementsByTagName('a')[0].href.replace('mod=post&', 'mod=misc&'); rewardhref = rewardhref.replace("action=reply&", "action=comment&"); var reviews_href = rewardhref + '&extra=page%3D1&page=' + page; let reviews_pid = hongbao[cishu2].parentElement.parentElement.id.replace("pid", "&pid="); reviews_href = reviews_href + reviews_pid; //console.log(rewardhref) var oa = document.createElement('a'); var ob = document.createElement('i'); var lm = document.getElementsByClassName("bottom_zhan y")[cishu2]; oa.href = reviews_href; oa.className = "f_c dialog"; ob.style = "content: url(https://s1.ax1x.com/2020/04/26/Jcq8VU.png);height: 15px;"; ob.className = "comiis_font mt_review"; ob.innerHTML = ""; oa.appendChild(ob); let review_username = hongbao[cishu2].parentElement.parentElement.getElementsByClassName("top_user f_b")[0].text; oa.onclick = function () { let click_time = Date.now(); var mt_interval = setInterval(function () { let run_time = parseInt((Date.now() - click_time) / 1000); if (run_time >= 5) { console.log("超时"); clearInterval(mt_interval); } else if (document.querySelector("div[id=ntcmsg_popmenu]>div>span.f_c") != null) { console.log("存在,清理定时器"); console.log("点评用户:", review_username); console.log("该对象出现用时:", run_time); try { document.querySelector("div[id=ntcmsg_popmenu]>div>span.f_c").innerText = "点评 " + review_username; } catch (err) { console.log("修改点评失败", err); } clearInterval(mt_interval); } }, 100) } lm.insertAdjacentElement('afterBegin', oa); } else { console.log("已有点评按钮,无需再次添加"); } } } } } function modifyForumPostFontColor() { //字体颜色改为黑色 if (GM_getValue("v3") && location.href.match(mt_config.rexp.forum_post)) { var hide = document.getElementsByTagName('font'); var i = 0; for (i = 0; i < hide.length; i++) { hide[i].removeAttribute('color'); hide[i].removeAttribute('style'); hide[i].removeAttribute('size'); } var content = document.getElementsByClassName("comiis_message bg_f view_all cl message"); var rule = /
    | ||<\/font>|||||align=".*?"/g; var j = 0, k = 1; for (j = 0; j < content.length; j++ & k++) { content[j].innerHTML = content[j].innerHTML.replace(rule, ''); } } } function collectionForumPost() { // 悬浮按钮-添加收藏帖子功能 var own_formhash = document.querySelector("#scform > input[type=hidden]:nth-child(1)").value; var collect_href_id = window.location.href.match(mt_config.rexp.forum_post_pc_page)[1]; var collect_href = 'https:\/\/bbs.binmt.cc\/home.php?mod=spacecp&ac=favorite&type=thread&id=' + collect_href_id + '&formhash=' + own_formhash; var new_collect = document.createElement('span'); var old_Suspended = document.getElementById("scrolltop"); new_collect.innerHTML = '<\/a>'; old_Suspended.insertAdjacentElement('afterBegin', new_collect); } function quickReply() { //快捷回复 document.querySelector("#scrolltop > span:nth-child(2) > a").onclick = function () { showWindow('reply', this.href); var a = document.querySelector("#postsubmit"); setTimeout( 'document.querySelector("#moreconf").innerHTML=document.querySelector("#moreconf").innerHTML+\'