// ==UserScript== // @name S1 User Marker // @namespace http://tampermonkey.net/ // @version 1.0 // @description Mark certain user // @ogirin_author 冰箱研会长、masakahaha // @author Nanachi // @match https://bbs.saraba1st.com/2b/* // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @license GPL-V3 // @downloadURL none // ==/UserScript== function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } function Blockbutton_Appender(HtmlDiv, Block_Target, Origin_Name,PostNumber) { var Block_status = ''; var status_text = GM_getValue(Origin_Name,null) ? '取消标记' : '标记此人'; if (GM_getValue(Origin_Name,null)) { Block_Target.style='color:red'; Block_Target.innerText = Block_Target.innerText + '#' + GM_getValue(Origin_Name); } function buttonClick(){ console.log('test'); console.log(Origin_Name); if (GM_getValue(Origin_Name,null)) { console.log('1'); GM_deleteValue(Origin_Name); window.location.reload(); } else { console.log('2'); var tag = prompt("输入自定义标签",""); if (tag != undefined && tag != "") { console.log(Origin_Name); // blockedList.set(Block_Target, tag); GM_setValue(Origin_Name, tag); window.location.reload(); } } } var StrPostNumber = PostNumber.toString(); HtmlDiv.innerHTML = HtmlDiv.innerHTML.concat(`