highlight thread topic starter

highlight topic starter

目前為 2023-12-25 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         highlight thread topic starter
// @description  highlight topic starter
// @namespace    gamer_lz
// @author       Covenant
// @version      1.0.0.7
// @license      MIT
// @homepage
// @match        https://*.gamer.com.tw/*
// @icon         data:image/x-icon;base64,AAABAAIAICAAAAEACACoCAAAJgAAABAQAAABAAgAaAUAAM4IAAAoAAAAIAAAAEAAAAABAAgAAAAAAIAEAAAAAAAAAAAAAAABAAAAAAAA////APb29gDw8PAA4+PjAN3d3ADMzMwAxsbGALu7uwCysrIAqqqqAKOjowCZmZkAiIiIAHh4dgBvb28AZmZmAFhYWABSUlEASkpKAEFBQQAzMzMAJycoAAUFBQAAAAAAAgH+AFpNLABwaT8AkIAtAK6aLwCzokkAoJZjAMGzZQDPxpYA49y3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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0NDQoIEQ8IBQ0XFxcGFwkXFw0PDxEREwwXFxcXFxcXFwwKFw8RHBEJFxcXFxcXDAkXDxEREREXEgcSFxcXFxcMEREREREPFwgSFwYODRERERERDxwcHBwPFxcXFyEfHxwcHBwcICEXFxcXIRwcHBwcHCAhFxcXFxcXF/8P///+d////H////z////8+////Hf///4H//9/Hf//gAH//9YD///8g///8gj///gJ//8AA///wA///wB///8=
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_registerMenuCommand
// @run-at       document-end
// @noframes
// ==/UserScript==
const isAppendChild=true,isLZ=true,isSide=true,isSenior=true;
const strIsNotFound=-1,strIsFoundFirst=0;
var intervalID_toast;
function create_style(textContent,id,class_name){let style=create_style_iframes(textContent,id,class_name,document.body);return style;}
const str_font_sans_en="'Noto Sans','Segoe UI','Roboto','Liberation Sans','Arial',";
const str_font_serif_en="'Noto Serif','Times New Roman','Liberation Serif',";
const str_font_mono="'Noto Sans Mono','Noto Mono','Cascadia Mono','Consolas','Droid Sans Mono','Liberation Mono','Monaco','Courier New',";
const str_font_code="'Noto Sans Mono','Noto Mono','Cascadia Code','Consolas','Droid Sans Mono','Liberation Mono','Monaco','Courier New',";
const str_font_sans_ja="'Noto Sans CJK JP','Meiryo','Yu Gothic','Microsoft JhengHei',";
const str_font_sans_ja_Yu_Gothic="'Noto Sans CJK JP','Yu Gothic','Microsoft JhengHei',";
const str_font_serif_ja="'Noto Serif CJK JP','Yu Mincho','MS Mincho','MOESongUN','TW-Sung','TW-Sung-Ext-B','TW-Sung-Plus','SimSun','SimSun-ExtB',";
const str_font_kaishotai_ja="'HGSeikaishotaiPRO','manga_kana','TW-MOE-Std-Kai','TW-Kai','TW-Kai-Ext-B','TW-Kai-Plus','BiauKai','UD Digi Kyokasho NK-R','DFKai-SB','Yu Mincho','HiraMaruProN-W4',";
const str_font_emoji_end="'symbol_sans','symbol2_sans','emoji_back',";
const str_font_symbol_end="'symbol_sans','symbol2_sans','color_emoji','emoji_back',";
const str_font_sans_zh="'Noto Sans CJK JP','Microsoft JhengHei','Yu Gothic',";
const str_font_serif_zh="'Noto Serif CJK JP','MOESongUN','TW-Sung','TW-Sung-Ext-B','TW-Sung-Plus','PMingLiU','PMingLiU-ExtB','Yu Mincho','MS Mincho',";
const str_font_flag="'flag_patch','flag_white_patch',";
const str_font_icon="'FontAwesome','Material Icons',";
const font_family_default="font-family: 'emoji_patch',"+str_font_sans_en+str_font_flag+"'color_emoji',"+str_font_sans_ja+str_font_icon+str_font_emoji_end+"sans-serif;";
const font_family_serif_2="font-family: 'emoji_patch','sans_kana',"+str_font_serif_en+str_font_flag+"'color_emoji',"+str_font_serif_ja+str_font_icon+str_font_emoji_end+"serif;";
const font_family_panel="font-family: "+str_font_mono+str_font_flag+str_font_sans_ja+str_font_icon+str_font_symbol_end+"monospace;";
const font_family_code="font-family: 'emoji_patch','Firple Slim',"+str_font_code+str_font_flag+"'color_emoji',"+str_font_sans_ja+str_font_icon+str_font_emoji_end+"monospace;";
const font_family_submit="font-family: 'emoji_patch','Firple Slim',"+str_font_mono+str_font_flag+"'color_emoji',"+str_font_sans_ja+str_font_emoji_end+"monospace;";
const font_family_condensed="font-family: 'emoji_patch','Noto Sans','Firple Slim','Segoe UI','sans-serif-condensed-light','Arial','Liberation Sans Narrow',"+str_font_flag+"'color_emoji',"+str_font_sans_ja_Yu_Gothic+str_font_icon+str_font_emoji_end+"sans-serif;";
const font_family_panel_cond="font-family: 'Noto Sans Mono','Firple Slim','Noto Mono','Cascadia Mono','Consolas','Droid Sans Mono','Liberation Mono','Monaco','Courier New',"+str_font_flag+str_font_sans_ja+str_font_icon+str_font_symbol_end+"monospace;";
const font_family_txt="font-family: 'kaiti_bpmf','manga_kana','emoji_patch','Roboto','Arial','Segoe UI','Liberation Sans',"+str_font_flag+"'color_emoji',"+str_font_sans_zh+str_font_emoji_end+"sans-serif;";
const font_family_monoserif="font-family: 'kaiti_bpmf','Cutive Mono','Courier New','Liberation Mono',"+str_font_flag+str_font_sans_ja+str_font_icon+str_font_symbol_end+"monospace;";
const font_family_serif_zh="font-family: 'emoji_patch','sans_bpmf','sans_kana',"+str_font_serif_en+str_font_flag+"'color_emoji',"+str_font_serif_zh+str_font_emoji_end+"serif;";
const font_family_mono_kaishotai="font-family: 'emoji_patch',"+str_font_mono+str_font_flag+str_font_kaishotai_ja+str_font_symbol_end+"cursive;";
const u_r_kana="U+3041-3096,U+30A1-30FE,U+32D0-32FE,U+FF65-FF9F,U+3001-3002,U+3005-3006,U+3031-3035,U+3099-309F,U+31F0-31FF,U+3300-3357,U+FE11-FE12,U+FE45-FE46,U+FE51,U+FE61,U+FE64,U+1F200-1F202,U+1F213";
const u_r_bpmf="U+3105-3129,U+302D-302F,U+02C7,U+02C9-02CB,U+02D9,U+FF0C,U+3001-3002,U+FF0E,U+22EF,U+FF1A";
const font_face_default=`
@font-face{font-family: 'color_emoji';src: local('Twemoji Mozilla'),/*url('file:///C:/Program Files/Mozilla Firefox/fonts/TwemojiMozilla.ttf'),*/local('Noto Color Emoji'),local('Segoe UI Emoji'),local('Apple Color Emoji');}
@font-face{font-family: 'symbol_sans';src: local('Segoe UI Symbol'),local('NotoSansSymbols-Regular'),local('NotoSansSymbols-Regular-Subsetted'),local('Noto Sans Symbols'),local('Apple Symbols'),local('Meiryo');}
@font-face{font-family: 'symbol2_sans';src: local('NotoSansSymbols2-Regular'),local('NotoSansSymbols-Regular-Subsetted2'),local('Symbola');}
@font-face{font-family: 'emoji_back';src: local('Noto Color Emoji'),local('Toss Face Font Web'),local('Segoe UI Emoji');}
@font-face{font-family: 'old_google';src: local('Noto Color Emoji'),local('NotoColorEmoji');}\n@font-face{font-family: 'old_samsung';src: local('SamsungColorEmoji');}
@font-face{font-family: 'DroidSans_Mono';src: local('DroidSansMono');}\n@font-face{font-family: 'Cutive_Mono';src: local('Cutive Mono');}
@font-face{font-family: 'Roboto_Regular';src: local('Roboto');}\n@font-face{font-family: 'Noto_Serif';src: local('NotoSerif');}
@font-face{font-family: 'Dancing_Script';src: local('DancingScript');}\n@font-face{font-family: 'Coming_Soon';src: local('ComingSoon');}\n@font-face{font-family: 'Carrois_GothicSC';src: local('CarroisGothicSC-Regular');}
@font-face{font-family: 'manga_kana';src: local('Yu Mincho'),local('Yu Mincho Light'),local('MS Mincho'),local('Noto Serif CJK JP'),local('NotoSerifCJKjp-Regular'),local('HiraMinProN-W3'),local('PMingLiU'),local('SimSun');unicode-range: `+u_r_kana+`;}
@font-face{font-family: 'kaiti_bpmf';src: local('PMingLiU'),local('Noto Serif CJK JP'),local('NotoSerifCJKjp-Regular'),local('BiauKai'),local('LiSong Pro');unicode-range: `+u_r_bpmf+`;}\n`;
var style_font_face=create_style(font_face_default,"gm_font_face_gamer_default",["user_gm_font_face","css_gamer_default"]);
var style_user_css=create_style(".mono,.user_btn_panel,.user_btn_panel_12px,.user_a_panel_12px{"+font_family_panel+"font-weight: 100;}\n.sans,.user_details,.span_title{"+font_family_default+"font-weight: 100;}","gm_user_css_gamer_default",["user_gm_css","css_gamer_default"]);
style_user_css.textContent+=`
.code,textarea#source,span.hideip{`+font_family_code+`font-weight: 300;}\n.sans_condensed{`+font_family_condensed+`font-weight: 400;font-stretch: ultra-condensed;}\n.submit{`+font_family_submit+`}
.user_mark_fix{left: auto;}
.user_btn_panel,.user_btn_panel_12px,a.user_a_panel_12px{color: #FFFFFF;background: #303030;border-color: #707070;border-width: 0.15rem;border-radius: 4px;border-style: outset;}
.user_btn_panel,.user_btn_panel_12px,.user_a_panel_12px{min-height: 1em;line-height: 1.5em;padding: 0.1rem 0.5rem;margin-top: 1px;margin-bottom: 1px;}
.user_btn_panel,.user_btn_panel_12px{padding-left: 5px;padding-right: 5px;margin-right: 2px;margin-left: 3px;}
.user_btn_panel_12px,.user_a_panel_12px{font-size: 0.75rem;}
.user_btn_panel{min-width: 7em;}\n.user_btn_panel_12px{min-width: 5em;}
.user_btn_panel:active,.user_btn_panel_12px:active{border-style: inset;}
.user_a_panel_12px{display: inline-block;text-align: center;min-width: 3em;}
a.user_a_panel_alpha{background: #30303080;}
.span_title{display: inline-block;min-width: 0.5em;min-height: 0.75em;padding: 4px 6px;border-radius: 3px;background: rgba(17,126,150,.1);color: #117E96;font-size: 0.75rem;}
.span_ridge,.span_groove{font-weight: 100;background: #117E96;color: #FFFFFF;}
.span_ridge,.span_groove{min-width: 5em; min-height: 1em;display: inline-block;padding-top: 2px;padding-bottom: 2px;text-align: center;}
.span_ridge,.span_groove{border-color: #117E96;border-width: 0.15rem;border-radius: 4px;}
.span_ridge{border-style: ridge;padding-left: 2px;padding-right: 3px;}\n.span_groove{border-style: groove;padding-right: 1px;}
.user_details{border-style: dashed;border-color: #707070; border-width: 1px;border-radius: 4px;padding: 2px;box-shadow: 3px 3px 4px black;}
.user_details>div{box-shadow: 3px 3px 4px black;}
details>summary{cursor: pointer;box-shadow: 3px 3px 4px black;}
.inline_block{display: inline-block;}
.text_align_l{text-align: left;}
.f_s_0_75rem{font-size: 0.75rem;}
.user_details>summary{list-style-type: "📷";}
[open].user_details>summary{list-style-type: "📸";font-style: italic;max-width: 90%;}
[open].user_details>summary::marker{font-style: normal;}
.box_shadow_DarkRed,#anonymous_1{box-shadow: 0rem 0rem 0.5rem DarkRed;}
.toast_container{position: fixed;z-index: 999999;pointer-events: none;}
.cursor_copy.cursor_copy{cursor: copy;}
.alert.alert.alert.alert.alert{color: DarkRed;}
font[face="Courier New"]{`+font_family_monoserif+`}
font[face="微軟正黑體"]{`+font_family_txt+`}\nfont[face="新細明體"],font[face="細明體"]{`+font_family_serif_zh+`}
font[face="MS Mincho"]{`+font_family_serif_2+`}\nfont[face="標楷體"]{`+font_family_mono_kaishotai+`}
input[type="text"]#shareurl,form input,form textarea,form div>p{`+font_family_code+`font-weight: 100;padding: 0.1rem;}\n#shareurl{font-size: 0.75rem;min-width: 32em;}
.option{position:relative;}/*基準設為relative,相對者設為absolute*/
a.vote-result-more,a.edittime,.outline{outline-style: dashed;outline-color: #707070;outline-width: 1px ;outline-offset: 2px;border-radius: 4px;}
#anonymous_1:before{background-color: DarkRed;}
div.user_mark_1_5rem{width: 60px;height: 60px;}\ndiv.user_mark_1_5rem::before{top: -40px;left: -40px;width: 80px;height: 80px;}
i.material-icons.user_mark_1_5rem{top: 4px;left: 4px;font-size: 1.5rem;}
.material_icons_100.material_icons_100{font-weight: 100;}
textarea[name="source"][name="source"]/*textarea#source*/{font-size: 0.75rem;background-color: #000000 !important;color: #FFFFFF;}\n`;
function create_div(class_name,is_appendChild,node,refNode){
    let div=create_node("div",class_name,is_appendChild,node,refNode);
    div.style.backgroundSize='contain';
    div.style.backgroundRepeat='no-repeat';
    div.lang='ja';
    return div;
}
function create_a(innerText,url,class_name,is_appendChild,node,refNode){
    let anchor=create_node_text("a",innerText,class_name,is_appendChild,node,refNode);
    anchor.href=url;
    anchor.title=innerText;
    if(url.search(new RegExp("javascript", "i"))!=0||url.indexOf(":")!=10)anchor.target="_blank";
    return anchor;
}
function create_btn(innerText,class_name,is_appendChild,node,refNode){
    let btn=create_node_text("button",innerText,class_name,is_appendChild,node,refNode);
    return btn;
}
function create_i(innerText,class_name,is_appendChild,node,refNode){
    var italic=create_node_text("i",innerText,class_name,is_appendChild,node,refNode);
    return italic;
}
function create_style_iframes(textContent,id,class_name,node){
    let style=create_node("style",class_name,isAppendChild,node);
    style.type='text/css';
    style.id=id;
    style.textContent=textContent;
    return style;
}
function create_node(tagname,class_name,is_appendChild,node,refNode){
    let element=document.createElement(tagname);
    element.id="";
    if(Array.isArray(class_name)){
        for(let i=0; i<class_name.length; i++){element.classList.add(class_name[i]);}
    }else if(typeof class_name==='string'){element.classList.add(class_name);}
    if(is_appendChild){node.appendChild(element);}
    else{if(refNode==undefined){node.insertBefore(element,node.firstChild);}else{node.insertBefore(element,refNode);}}return element;
}
function create_node_text(tagname,innerText,class_name,is_appendChild,node,refNode){
    let element=create_node(tagname,class_name,is_appendChild,node,refNode);
    element.innerText=innerText;
    element.lang='ja';
    return element;
}
function fn_url(url){
    let obj_url=new URL(url);
    let params=obj_url.searchParams;
    return [obj_url,params];
}
async function fn_clipboard_w_baha(str,toast_pos){
    try{
        fn_setTimeout_toast("成功複製"+str,"info",toast_pos);
        await navigator.clipboard.writeText(str);
    }catch(e){alert(e.message);}
    finally{}
}
//console.log("break");
function fn_create_b_mark(is_lz,is_side,is_senior,is_appendChild,node,refNode){//!isSenior red
    let ary_class_div=["b-mark"];//div背景顏色,在側邊,等級決定顏色,主文是樓主/吃樓決定顏色,主文會字體符號放大和位置修復
    ary_class_div=ary_class_div.concat(is_side?[is_senior?"b-mark--update":"b-mark--feature"]:[is_lz?"b-mark--update":"b-mark--feature","user_mark_fix","user_mark_1_5rem"]);
    let div_mark=create_div(ary_class_div,is_appendChild,node,refNode);
    div_mark.title=is_lz?"樓主":"吃樓";
    let ary_class_i=["material-icons","material_icons_100",is_lz?"feature":"raise"];
    if(!is_side)ary_class_i.push("user_mark_1_5rem");
    create_i(is_lz?"\uE029":"\uE5D8",ary_class_i,isAppendChild,div_mark);//Material Icons
}
function fn_create_BH_menu__switch_box(is_on,is_appendChild,node,refNode){
    let div_switch_box=create_div(["BH-menu__switch-box"],is_appendChild,node,refNode);
    if(is_on)div_switch_box.classList.add("is-on");
    let input_themeSwitch=create_node("input","BH-menu__switch-box__switch-input",isAppendChild,div_switch_box);
    input_themeSwitch.id="themeSwitch";input_themeSwitch.type="checkbox";
    let lbl_option=create_node("label","BH-menu__switch-box__option",isAppendChild,div_switch_box);
    lbl_option.setAttribute("for", "themeSwitch");
    create_node_text("span","ON",["BH-menu__switch-box__active-state","mono"],isAppendChild,lbl_option);
    create_div("BH-menu__switch-box__icon",isAppendChild,lbl_option);
    create_node_text("span","OFF",["BH-menu__switch-box__inactive-state","mono"],isAppendChild,lbl_option);
    return div_switch_box;
}
function fn_create_toast_info(innerText,toast_class,div_toast_container){
    let div_toast=create_node("div",["toast","toast-"+toast_class],isAppendChild,div_toast_container);
    let div_toast_message=create_node("div",["toast-message"],isAppendChild,div_toast);
    div_toast_message.innerText=innerText;
    return div_toast;
}
function fn_setTimeout_toast(innerText,toast_class,toast_pos){
    //toast_class: success/info/warning/error;toast_pos: toast-top-center/toast-top-left/toast-top-right/toast-bottom-center/toast-bottom-left/toast-bottom-right/
    let div_toast_container;
    if(document.querySelectorAll('.toast_container.'+toast_pos).length!=0){
        div_toast_container=document.querySelectorAll('.toast_container.'+toast_pos)[0];
    }else{
        div_toast_container=create_node("div",["toast_container",toast_pos,"code"],isAppendChild,document.body);
        div_toast_container.id="toast-container";
        intervalID_toast=window.setInterval(( ()=>{
            if(div_toast_container.children.length==0){
                div_toast_container.remove();clearInterval(intervalID_toast);
            }
        }),1000);
    }
    let div_toast=fn_create_toast_info(innerText,toast_class,div_toast_container);
    window.setTimeout(( ()=>{div_toast.remove();}), 5000);
}
function fn_setInterval_lzl_b_mark(lz){
    let lzl=document.querySelectorAll('div.c-reply__item');//留言裡標記樓主
    for(let n = 0; n < lzl.length; n++){
        let div_reply_content=lzl[n].querySelectorAll('div>div.reply-content')[0];
        let content__user=div_reply_content.querySelectorAll('a.reply-content__user')[0].href;
        let name=content__user.replace(/https:\/\/home.gamer.com.tw\//i, '');
        if(name.toLowerCase()==lz){
            if(lzl[n].querySelectorAll(".b-mark").length>0)continue;
            fn_create_b_mark(isLZ,isSide,isSenior,isAppendChild,lzl[n]);
        }
    }
}
function fn_setInterval_iframe_editor(iframe){
    window.setInterval(( ()=>{
        let body_editor=iframe[0].contentWindow.document.body;//console.log("iframes_editor");
        if(body_editor.querySelectorAll('.user_gm_css_iframes').length==0){
            let style_user_css=create_style_iframes("body{background-color: #7F7F7F;cursor: n-resize;"+font_family_code+"}","gm_user_css_gamer_iframes",["user_gm_css_iframes","css_iframes"],body_editor);
            style_user_css.textContent+=`hr{border-color: #000000;}
@font-face{font-family: 'color_emoji';src: local('Twemoji Mozilla'),local('Noto Color Emoji'),local('Segoe UI Emoji'),local('Apple Color Emoji');}
@font-face{font-family: 'symbol_sans';src: local('Segoe UI Symbol'),local('NotoSansSymbols-Regular'),local('NotoSansSymbols-Regular-Subsetted'),local('Noto Sans Symbols'),local('Apple Symbols'),local('Meiryo');}
@font-face{font-family: 'symbol2_sans';src: local('NotoSansSymbols2-Regular'),local('NotoSansSymbols-Regular-Subsetted2'),local('Symbola');}`;
        }
    }), 3000);
}
function main_01(){
    let c_post=document.querySelectorAll('.c-post');
    for(let i = 0; i < c_post.length; i++){
        let a_floor=c_post[i].querySelectorAll('a.floor')[0];
        let c_reply__item=c_post[i].querySelectorAll('div.c-reply__item');//留言
        for(let i = 0; i < c_reply__item.length; i++){
            let comment_floor=c_reply__item[i].querySelectorAll('div.edittime')[0];
            if(comment_floor.querySelectorAll('a').length==1)continue;
            let lzl_floor=comment_floor.innerText;
            comment_floor.innerText="";
            let floor_href=a_floor.href;
            let url_floor=fn_url(floor_href);
            url_floor[0].searchParams.delete('subbsn');
            url_floor[0].searchParams.delete('bPage');
            let Commendcontent=c_reply__item[i].id.replace(new RegExp("Commendcontent_", "i"), "comment");
            create_a(lzl_floor,url_floor[0].toString()+"#"+Commendcontent,[],isAppendChild,comment_floor);
        }
    }
    let add_demonstratio_c=document.querySelectorAll('#add-demonstratio_c');
    if(add_demonstratio_c.length==1){
        if(add_demonstratio_c[0].title=="發文稱號"){
            add_demonstratio_c[0].classList.add("alert");
        }else{add_demonstratio_c[0].classList.remove("alert");}
    }
}
function main_02(){
    let btn_last_reply=document.querySelectorAll('button[last-reply]');
    if(btn_last_reply.length>0){
        btn_last_reply[0].classList.add("box_shadow_DarkRed");
    }
    let c_post=document.querySelectorAll('.c-post');
    for(let i=0; i<c_post.length; i++){//
        let edittime=c_post[i].querySelectorAll('a.edittime');
        if(edittime.length==1){
            let hideip=edittime[0].getAttribute("data-hideip");
            if(hideip.search(new RegExp("BAHAMUT", "i"))==-1){
                let c_post__header__info=c_post[i].querySelectorAll('.c-post__header__info')[0];
                let span_ip=create_node_text("span","",["hideip","span_title"],isAppendChild,c_post__header__info);
                if(document.querySelectorAll('#gm_user_css_c_post_title_alert').length!=0){
                    create_a(hideip.replace(/xxx/i, '*'),"https://\u0069\u0070info.io/#"+hideip.replace(/xxx/i, '1'),[],isAppendChild,span_ip);
                }else{
                    span_ip.textContent=hideip.replace(/xxx/i, '*');
                    span_ip.title="點擊複製";
                    span_ip.addEventListener('click',()=>{fn_clipboard_w_baha(span_ip.textContent.replace("*", '1'),"toast-top-center");});
                }
            }
        }
    }
}
(function(){
    'use strict';
    let url=fn_url(document.location);
    let is_dark=false;
    let userid_login="";
    if(document.documentElement.getAttribute("data-theme")!=null){
        if(document.documentElement.getAttribute("data-theme").search(new RegExp("dark", "i"))==0)is_dark=true;
    }
    let topbar_member_home=document.querySelectorAll('a.topbar_member-home');
    let is_login=topbar_member_home.length==1?true:false;
    if(is_login){//添加右上角小屋鏈接的owner參數
        let ary_tmp=fn_url(topbar_member_home[0].querySelectorAll('img')[0].src)[0].pathname.split('/');
        userid_login=is_login?ary_tmp.pop().replace(/_s.png/i, ""):null;
        topbar_member_home[0].href+="?owner="+userid_login;
    }
    if(url[0].host.search(new RegExp("forum.gamer.com.tw", "i"))==strIsFoundFirst){//哈啦區
        if(url[0].pathname.search(new RegExp("/C.php", "i"))==strIsFoundFirst||url[0].pathname.search(new RegExp("/Co.php", "i"))==strIsFoundFirst){//哈啦區的文
            let c_post=document.querySelectorAll('.c-post');//樓層位置
            let c_section__side=document.querySelectorAll('.c-section__side');//用戶等級位置
            if(c_post.length>0&&url[0].pathname=="/C.php"&&(url[1].get('page')==null||url[1].get('page')=="1")&&url[1].get('s_author')==null){//需要判斷是不是第一頁
                if(document.querySelectorAll('.c-disable__title.is-except').length==0){//沒有首篇已刪
                    let post__header__title=c_post[0].querySelectorAll('h1')[0].innerText;//標題
                    let lz=c_post[0].querySelectorAll('.userid')[0].innerText.toLowerCase();//樓主id
                    if(post__header__title.search("RE:")!=strIsFoundFirst){
                        for(let i=0; i<c_post.length; i++){
                            let userid=c_post[i].querySelectorAll('.userid')[0].innerText;//各樓層id
                            if(userid.toLowerCase()==lz){
                                let userlevel=c_post[i].parentNode.querySelectorAll('div.userlevel')[0];
                                if(userlevel.classList.contains('senior')||userlevel.classList.contains('master')){//紅色等級
                                    fn_create_b_mark(isLZ,!isSide,isSenior,isAppendChild,c_post[i]);
                                    fn_create_b_mark(isLZ,isSide,isSenior,isAppendChild,c_section__side[i]);
                                }else{
                                    fn_create_b_mark(isLZ,!isSide,!isSenior,isAppendChild,c_post[i]);
                                    fn_create_b_mark(isLZ,isSide,!isSenior,isAppendChild,c_section__side[i]);
                                }
                            }
                        }
                        let timeoutID=window.setInterval(( () => {fn_setInterval_lzl_b_mark(lz);} ), 1000);
                    }else{//標題有"RE:",視為吃樓
                        let floor=c_post[0].querySelectorAll('div>a.floor')[0].innerText;
                        if(floor=="樓主"){//在&last=1的情況下,需要檢測是不是第一頁
                            let userlevel=c_post[0].parentNode.querySelectorAll('div.userlevel')[0];
                            if(userlevel.classList.contains('senior')||userlevel.classList.contains('master')){//紅色等級
                                fn_create_b_mark(!isLZ,!isSide,isSenior,isAppendChild,c_post[0]);
                                fn_create_b_mark(!isLZ,isSide,isSenior,isAppendChild,c_section__side[0]);
                            }else{
                                fn_create_b_mark(!isLZ,!isSide,!isSenior,isAppendChild,c_post[0]);
                                fn_create_b_mark(!isLZ,isSide,!isSenior,isAppendChild,c_section__side[0]);
                            }
                        }
                    }
                }
            }
            let timeoutID = window.setInterval(( () => main_01() ), 5000);//添加留言直達車傳送門的鏈接
            window.setTimeout(( () => main_02() ), 1000);//標記完整編輯器按鈕
        }
        if(url[0].pathname.search(new RegExp("/C.php", "i"))==strIsFoundFirst){//哈啦區的文,不包含co單樓層
            let div_jumpfloor=document.querySelectorAll('.jumpfloor');
            div_jumpfloor=div_jumpfloor.length==1?div_jumpfloor[0]:div_jumpfloor;
            if(url[1].get('s_author')==null){
                window.setTimeout(( () => {create_a("s_author","https://"+url[0].host+url[0].pathname+url[0].search+"&s_author="+userid_login,["usertitle","code"],!isAppendChild,div_jumpfloor,div_jumpfloor.firstChild);}),100);
            }
            if(url[1].get('last')==null){
                window.setTimeout(( () => {create_a("看最後一樓","https://"+url[0].host+url[0].pathname+url[0].search+"&last=1#down",["usertitle","code"],!isAppendChild,div_jumpfloor,div_jumpfloor.firstChild);}),100);
            }
        }
        let li_dropList=document.querySelectorAll('.BH-menu-forumA-right.dropList');//添加回闇黑模式按鈕,因為沒登入就沒按鈕
        for(let i=0; i<li_dropList.length; i++){
            let dropList_dl=li_dropList[i].querySelectorAll('dl');
            let dropList_dd=create_node("dd",["code"],isAppendChild,dropList_dl[0]);
            let a_dark=create_a("","javascript:Util.Theme.Dark.toggle();",[],isAppendChild,dropList_dd);
            create_node_text("span","闇黑模式\uE51C",[],isAppendChild,a_dark);
            fn_create_BH_menu__switch_box(is_dark,isAppendChild,a_dark);
        }
    }else if(url[0].host.search(new RegExp("home.gamer.com.tw", "i"))==strIsFoundFirst){
        if(url[0].pathname.search(new RegExp("/profile/index.php", "i"))==strIsFoundFirst){//新版小屋
            let ul_main_nav=document.querySelectorAll('nav.main-nav>ul');
            if(ul_main_nav.length!=0){
                let li_showdress=create_node("li",[],isAppendChild,ul_main_nav[0]);
                let a_showdress=create_a("査看勇者裝備一覽","https://avatar1.gamer.com.tw/showdress.php?uid="+url[1].get('owner'),["sans_condensed"],isAppendChild,li_showdress);
                a_showdress.title="不知道這個頁面什麼時候會被移除";
            }
        }
    }
    window.setTimeout(( ()=>{//字體測試區
        if(document.querySelectorAll('.css_emoji_cdn_752e3').length!=0){
            style_user_css.textContent+=`div.content-edit{`+font_family_mono_kaishotai+`font-size: 1.5rem;}
body,textarea,.c-section{`+font_family_txt+`}
.b-list__main__title{`+font_family_txt.replace(/;/i,' !important;')+`}
font[face="Courier New"]{`+font_family_code+`}\n`;
            if(url[0].host.search(new RegExp("home.gamer.com.tw", "i"))==strIsFoundFirst&&(url[0].pathname!="/"&&url[0].pathname.search("/index.php")==strIsNotFound&&url[0].pathname.search("/artwork.php")==strIsNotFound)){
                style_user_css.textContent+="body,.c-section,.b-list__main__title{font-weight: 400;}";//排除掉創作大廳,剩下的都視為小屋(不准確但夠用)
            }else{style_user_css.textContent+="body,.c-section,.c-article,.b-list__main__title{font-weight: 100;}";}
            //iframe發文回文編輯器
            let iframe_editor=document.querySelectorAll('iframe#editor');
            if(iframe_editor.length>0){
                fn_setInterval_iframe_editor(iframe_editor);
            }
        }
    }),1000);
})();