// ==UserScript==
// @name highlight thread topic starter
// @description highlight topic starter
// @namespace gamer_lz
// @author Covenant
// @version 1.0
// @license MIT
// @homepage
// @match https://*.gamer.com.tw/*
// @icon data:image/x-icon;base64,AAABAAIAICAAAAEACACoCAAAJgAAABAQAAABAAgAaAUAAM4IAAAoAAAAIAAAAEAAAAABAAgAAAAAAIAEAAAAAAAAAAAAAAABAAAAAAAA////APb29gDw8PAA4+PjAN3d3ADMzMwAxsbGALu7uwCysrIAqqqqAKOjowCZmZkAiIiIAHh4dgBvb28AZmZmAFhYWABSUlEASkpKAEFBQQAzMzMAJycoAAUFBQAAAAAAAgH+AFpNLABwaT8AkIAtAK6aLwCzokkAoJZjAMGzZQDPxpYA49y3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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XFxcXFwkOFxcXFxcXFxcXFxcXFxcXFxcXFxcXCA8SEAwXFwwODBcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXCBISEw4MDwgXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFw4QFxcXFxcXFxcXFxcXChEREQoXFxcJCQ4OEhIRERMXFw4QEQkXFxcXFxcXFxcXFxcKEREREREREwkXCQkJERAQCgoREBcXFxcXFxcXFxcXFxcXChcKFwoXFxcXFxcJChERERERDBcMCRcMEhcXFxcXFxcXFxcXFxcXFxcRFxcXCQoRERERDBMSEhEcFxcXFxcXFxcXFxcXFxcXFwoRCRcXAwoREREREBocFxcXFxcXFxcXFxcXCRECFxcXChMTEREREBERHBERCRcXFxcXFxcXFxcXFxcXChEJCQkREREREREREREcAgsPCRIXFxcXFxcXFxcXFxcXChERERERERERERERExwXFwwSCRIXFxcXFxcXFxcXFxcNERERERERERERERERHBcKEgoSFxcXFxcXFxcXFxcXChEREREREREREREREREUERcXFxcXFxcXFxcXFxcXCg0NERERERERERERERERDQ0cCBIXFxcXFxcXFwoKDRERERERERERERERERENDQ0cHBwdIRcXFwoTEhEQERESEhINDQ0NDQ0NDQ0NDQ0cHBwdFxcXFxcXFxcXFxcXFxchHBwcHBweHh4eHBwcHBwhFxcXFxcXFxcXFxcXFxchHBwcHBwcHBwcHBwcHCEXFxcXFxcXFxcXFx8fHhwcHBwcHBwcHBweHyEhFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxf////////wf///w7///4////8f////H////j////4////+P////h/3//8f9///D8///4Mf///AP///8//BwBh/+AIAf/6vwCT//3AA//8YA//HAAf/4AAB//AAMP/wACH/4AAf/4AAB/gAAAcAAAA//wAA//wAB/8AAH///////ygAAAAQAAAAIAAAAAEACAAAAAAAQAEAAAAAAAAAAAAAAAEAAAAAAAD///8A////APDw8ADj4+MA3d3cAMzMzADGxsYAu7u7ALKysgCqqqoAo6OjAJmZmQCIiIgA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFxcXFxcXFxcGDAgIFxcXFxcXFxcXFxcEERcXFwgXFxcXFxcXFxcEEAUXFxcXFxcXFxcXFxcXCBAXFxcXFxcXFxcXFxcXFwgQFxcXFxcGFxcXFxcXFxcEEAwXFxcMFxcXFxcXFxcXFwgSDA8OBBcXFwwXFxcXFxcXCBAPFxcXBhcXCgwLDA0NDQoIEQ8IBQ0XFxcGFwkXFw0PDxEREwwXFxcXFxcXFwwKFw8RHBEJFxcXFxcXDAkXDxEREREXEgcSFxcXFxcMEREREREPFwgSFwYODRERERERDxwcHBwPFxcXFyEfHxwcHBwcICEXFxcXIRwcHBwcHCAhFxcXFxcXF/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;
var div_toast_container_top_center;
function create_style(textContent,id,class_name){
let style=create_node("style",class_name,isAppendChild,document.body);
style.type='text/css';
style.id=id;
style.textContent=textContent;
return style;
}
const font_family_default="font-family: 'Noto Sans','DejaVu Sans','Segoe UI','Arial','color_emoji','Noto Sans CJK JP','Meiryo','Yu Gothic','Microsoft JhengHei','Noto Sans Symbols','Noto Sans Symbols2','symbol_emoji','emoji_back',sans-serif;";
const font_family_panel="font-family: 'Noto Sans Mono','Noto Mono','DejaVu Sans Mono','Cascadia Mono','Consolas','Monaco','Courier New','Noto Sans CJK JP','Meiryo','Yu Gothic','Microsoft JhengHei','Noto Sans Symbols','Noto Sans Symbols2','symbol_emoji','color_emoji','emoji_back',monospace;";
const font_family_code="font-family: 'Firple Slim','Noto Sans Mono','Noto Mono','DejaVu Sans Mono','Cascadia Code','Consolas','Monaco','Courier New','color_emoji','Noto Sans CJK JP','Meiryo','Yu Gothic','Microsoft JhengHei','Noto Sans Symbols','Noto Sans Symbols2','symbol_emoji','emoji_back',monospace;";
const font_family_condensed="font-family: 'Noto Sans','DejaVu Sans','Firple Slim','Segoe UI','sans-serif-condensed-light','color_emoji','Noto Sans CJK JP','Meiryo','Yu Gothic','Microsoft JhengHei','Noto Sans Symbols','Noto Sans Symbols2','symbol_emoji','emoji_back',sans-serif;";
const font_family_panel_cond="font-family: 'Noto Sans Mono','Firple Slim','DejaVu Sans Mono','Noto Mono','Cascadia Mono','Consolas','Monaco','Courier New','Noto Sans CJK JP','Meiryo','Yu Gothic','Microsoft JhengHei','Noto Sans Symbols','Noto Sans Symbols2','symbol_emoji','color_emoji','emoji_back',monospace;";
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_emoji';src: local('Segoe UI Symbol'),local('NotoSansSymbols-Regular-Subsetted');}\n@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`;
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;}
.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;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{box-shadow: 0rem 0rem 0.5rem DarkRed;}
.toast_container{position: fixed;z-index: 999999;pointer-events: none;}
.alert.alert.alert.alert.alert{color: DarkRed;}
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;}
a.vote-result-more{outline-style: dashed;outline-color: #707070;outline-width: 1px ;outline-offset: 2px;border-radius: 4px;}
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;}
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_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{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;
//let params=new URLSearchParams(obj_url.search);
return [obj_url,params];
}
//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",is_lz?"feature":"raise"];
if(!is_side)ary_class_i.push("user_mark_1_5rem");
create_i(is_lz?"\uE838":"\uE5D8",ary_class_i,isAppendChild,div_mark);
}
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_c_post__header__tools(is_appendChild,node,refNode){
let url=fn_url(document.location);
let div_c_post__header__tools=create_div(["c-post__header__tools","sans"],is_appendChild,node,refNode);
let btn_loadpic=create_btn("",["ef-btn","ef-bounce","btn-loadpic","tippy-title-icon","is-cancel"],isAppendChild,div_c_post__header__tools);
btn_loadpic.title="關閉圖片影片(裝飾用)";btn_loadpic.type="button";
let div_loadpic=create_div("ef-btn__effect",isAppendChild,btn_loadpic);
create_i("圖",["icon-font","sans"],isAppendChild,div_loadpic);
if(url[0].pathname.search(new RegExp("/Co.php", "i"))==0){
let btn_jumptowhole=create_btn("",["ef-btn","ef-bounce","btn-loadpic","tippy-title-icon"],isAppendChild,div_c_post__header__tools);
btn_jumptowhole.title="看整串主題(裝飾用)";btn_loadpic.type="button";
let div_jumptowhole=create_div("ef-btn__effect",isAppendChild,btn_jumptowhole);
create_i("串",["icon-font","sans"],isAppendChild,div_jumptowhole);
}
}
function fn_create_toast(innerText,toast_class){
let div_toast=create_node("div",["toast","toast-"+toast_class],isAppendChild,div_toast_container_top_center);
let div_toast_message=create_node("div",["toast-message"],isAppendChild,div_toast);
div_toast_message.innerText=innerText;
return div_toast;
}
function main_00(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)return;
fn_create_b_mark(isLZ,isSide,isSenior,isAppendChild,lzl[n]);
}
}
}
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, '*');}
}
}
}
}
(function(){
'use strict';
let url=fn_url(document.location);
let is_dark=false;
if(document.documentElement.getAttribute("data-theme")!=null){
if(document.documentElement.getAttribute("data-theme").search(new RegExp("dark", "i"))==0)is_dark=true;
}
if(url[0].host.search(new RegExp("forum.gamer.com.tw", "i"))==0){//哈啦區
if(url[0].pathname.search(new RegExp("/C.php", "i"))==0||url[0].pathname.search(new RegExp("/Co.php", "i"))==0){//哈啦區的文
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:")!=0){
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(( () => {main_00(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);//標記完整編輯器按鈕
for(let i=0; i<c_post.length; i++){//還原關閉圖片影片按鈕(裝飾用)
let c_post__header=c_post[i].querySelectorAll('div.c-post__header');
//c_post__header=c_post__header.length==1?c_post__header[0]:c_post__header;//投票會多出一個c-post__header
let h1_c_post__header__title=c_post__header[0].querySelectorAll('h1');
if(h1_c_post__header__title.length==1)fn_create_c_post__header__tools(!isAppendChild,c_post__header[0],h1_c_post__header__title[0]);
}
}
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","闇黑模式",[],isAppendChild,a_dark);
fn_create_BH_menu__switch_box(is_dark,isAppendChild,a_dark);
}
}
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('/');
let userid_login=is_login?ary_tmp.pop().replace(/_s.png/i, ""):null;
topbar_member_home[0].href+="?owner="+userid_login;
}
//div_toast_container_top_center=create_node("div",["toast_container","toast-top-center"],isAppendChild,document.body);
//div_toast_container_top_center.id="toast-container";
//fn_create_toast("1","success");fn_create_toast("2","info");fn_create_toast("3","warning");fn_create_toast("4","error");
})();