'use strict';
// ==UserScript==
// @name saltMCBBS
// @namespace http://salt.is.lovely/
// @description salt's MCBBS 拓展
// @author salt
// @match https://*.mcbbs.net/*
// @grant none
// @version 0.1.6
// @license CC BY-NC-SA 4.0
// @run-at document-body
// ==/UserScript==
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
(function () {
const myversion = '0.1.6';
const myhistory = ``;
const myprefix = '[SaltMCBBS]';
const medalLinkPrefix = 'https://www.mcbbs.net/static/image/common/';
const placeholderSpan = '<span style="color:transparent;display:inline">无</span>';
const placeholderSpan2 = '<span style="color:transparent;display:inline">空白</span>';
const noticimgurl = [
'https://s3.ax1x.com/2020/11/28/DynR1S.png',
'https://s3.ax1x.com/2020/11/28/DynW6g.png',
'https://s3.ax1x.com/2020/11/28/DynfXQ.png',
'https://s3.ax1x.com/2020/11/28/Dyn2p8.png',
'https://s3.ax1x.com/2020/11/28/Dyn4mj.png',
'https://s3.ax1x.com/2020/11/28/Dyn50s.png',
'https://s3.ax1x.com/2020/11/28/Dyncff.png',
];
const techprefix = 'saltMCBBS-';
let autoRunLock = true;
let myPriority = 0;
const antiWaterRegExp = [
/^[\s\S]{0,2}([\.\*\s]|\/meme\/)*(\S|\/meme\/)\s*(\2([\.\*\s]|\/meme\/)*)*([\.\*\s]|\/meme\/)*[\s\S]?\s?$/,
/^[\s\S]{0,3}(请?让?我是?来?|可以)?.{0,3}([水氵]{3}|[水氵][一二两亿]?[帖贴下]+|完成每?日?一?水?帖?贴?的?任务)[\s\S]{0,3}$/,
];
class saltMCBBSOriginClass {
constructor() {
this.messagePanel = document.querySelector('#messagePanel') || document.createElement('div');
this.consolePanel = document.querySelector('#consolePanel') || document.createElement('div');
let mg = this.messagePanel;
if (!(mg.hasAttribute('id'))) {
mg.id = 'messagePanel';
mg.className = 'messagePanel';
document.body.append(mg);
}
let cc = this.consolePanel;
if (!(cc.hasAttribute('id'))) {
cc.id = 'consolePanel';
cc.className = 'consolePanel';
}
}
getData(key) {
let temp;
switch (key) {
case 'antiWaterRegExp': temp = antiWaterRegExp;
case 'noticImgUrl': temp = noticimgurl;
default: temp = '';
}
return temp;
}
scrollTo(targetY = 0, steps = 25) {
if (targetY < 0) {
targetY = 0;
}
if (targetY > document.body.offsetHeight - 200) {
targetY = document.body.offsetHeight - 200;
}
var step = (targetY - document.documentElement.scrollTop) / steps;
let safe = 0;
let timer = setInterval(() => {
var diff = Math.abs(targetY - document.documentElement.scrollTop);
if (diff > Math.abs(step)) {
document.documentElement.scrollTop += step;
safe += 1;
}
else {
document.documentElement.scrollTop = targetY;
clearInterval(timer);
}
if (safe > steps + 5) {
document.documentElement.scrollTop = targetY;
clearInterval(timer);
}
}, 20);
}
docReady(callback) {
if (document.readyState != 'loading') {
callback();
}
else {
document.addEventListener('readystatechange', () => {
if (document.readyState == 'interactive') {
callback();
}
});
}
}
saltQuery(selector, callback) {
let elems = document.querySelectorAll(selector);
for (let i = 0; i < elems.length; i++) {
callback(i, elems[i]);
}
}
saltObserver(id, callback, watchAttr = false, watchChildList = true) {
if (!watchAttr && !watchChildList) {
return null;
}
let targetNode = null;
if (typeof id == 'string') {
targetNode = document.getElementById(id);
}
else if (id instanceof Element) {
targetNode = id;
}
if (!targetNode) {
return null;
}
let x = new MutationObserver(callback);
let json = { attributes: watchAttr, childList: watchChildList, subtree: true, };
x.observe(targetNode, json);
return x;
}
write(key, value) {
if (value) {
value = JSON.stringify(value);
}
localStorage.setItem(techprefix + key, value);
}
read(key) {
let value = localStorage.getItem(techprefix + key);
if (value && value != "undefined" && value != "null") {
return JSON.parse(value);
}
return null;
}
readWithDefault(key, defaultValue) {
let value = localStorage.getItem(techprefix + key);
if (value && value != "undefined" && value != "null") {
let temp = JSON.parse(value);
if (typeof defaultValue == 'boolean' && typeof temp == 'string') {
if (temp == 'true') {
temp = true;
}
else {
temp = false;
}
}
return temp;
}
this.write(key, defaultValue);
return defaultValue;
}
randomChoice(arr) {
if (arr.length < 1) {
return null;
}
return arr[Math.floor(Math.random() * arr.length)];
}
formatToStringArray(str, spliter = '\n') {
let arr = [];
let temparr = str.split(spliter);
for (let x of temparr) {
let s = this.Trim(x);
if (s.length > 0) {
arr.push(s);
}
}
return arr;
}
cleanStringArray(arr, test = /^\/\//) {
let fin = [];
for (let s of arr) {
if (!(test.test(s)))
fin.push(s);
}
return fin;
}
Trim(x) {
return x.replace(/^\s+|\s+$/gm, '');
}
obj2a(obj, targetDefault = '_self') {
let as = [];
if (['_self', '_parent', '_blank', '_top'].indexOf(targetDefault) != -1) {
targetDefault = '_self';
}
for (let x of obj) {
let a = document.createElement('a');
a.href = x.url;
if (typeof x.img == 'string' && x.img.length > 2) {
a.innerHTML = `<img src="${x.img}">`;
}
a.innerHTML += x.text;
if (typeof x.target == 'string' && ['_self', '_parent', '_blank', '_top'].indexOf(x.target) != -1) {
a.target = x.target;
}
else {
a.target = targetDefault;
}
if (typeof x.class == 'string' && x.class.length > 0) {
a.className = x.class;
}
if (typeof x.title == 'string' && x.title.length > 0) {
a.title = x.title;
}
as.push(a);
}
return as;
}
addChildren(parent, children) {
for (let i = 0; i < children.length; i++) {
parent.appendChild(children[i]);
}
}
fetchUID(uid, callback, retry = 2, retryTime = 1500) {
if (typeof uid == 'string') {
uid = parseInt(uid);
}
if (uid < 1 || isNaN(uid)) {
return;
}
let obj = this;
fetch('https://www.mcbbs.net/api/mobile/index.php?module=profile&uid=' + uid)
.then(response => {
if (response.ok) {
return response.json();
}
else {
return Promise.reject(Object.assign({}, response.json(), {
status: response.status,
statusText: response.statusText
}));
}
})
.then((data) => { callback(data); })
.catch((error) => {
console.log(error);
if (retry > 0) {
setTimeout(() => { obj.fetchUID(uid, callback, retry - 1, retryTime); }, retryTime);
}
});
}
fetchTID(tid, callback, page = 1, retry = 2, retryTime = 1500) {
if (typeof tid == 'string') {
tid = parseInt(tid);
}
if (tid < 1 || isNaN(tid)) {
return;
}
let obj = this;
fetch('https://www.mcbbs.net/api/mobile/index.php?version=4&module=viewthread&tid=' + tid + '&page=' + page)
.then(response => {
if (response.ok) {
return response.json();
}
else {
return Promise.reject(Object.assign({}, response.json(), {
status: response.status,
statusText: response.statusText
}));
}
})
.then((data) => { callback(data); })
.catch((error) => {
if (retry > 0) {
setTimeout(() => { obj.fetchTID(tid, callback, page, retry - 1, retryTime); }, retryTime);
}
});
}
getUID() {
return typeof window.discuz_uid ? parseInt(window.discuz_uid) : 0;
}
getTID() {
return parseInt((window.tid ? window.tid + '' : null) || (window.location.href.match(/thread-([\d]+)/) || window.location.href.match(/tid\=([\d]+)/) || ['0', '0'])[1]);
}
message(html, callback, type = 0) {
let div = document.createElement('div');
div.innerHTML = html;
div.className = switchType(type);
div.addEventListener('click', () => {
if (callback)
callback(removeDiv);
});
let close = document.createElement('div');
close.className = 'close-button';
close.addEventListener('click', function (ev) {
ev.stopPropagation();
removeDiv();
});
div.appendChild(close);
this.messagePanel.appendChild(div);
function removeDiv() {
div.remove();
}
function switchType(type) {
switch (type) {
case 1:
return 'info';
case 2:
return 'success';
case 3:
return 'warn';
case 4:
return 'error';
default:
return 'normal';
}
}
}
assert(condition, msg = '发生错误') {
if (!condition)
throw new Error(myprefix + ': ' + msg);
}
log(msg) {
let t = typeof msg;
let p = myprefix + ': ';
if (t == 'boolean' || t == 'number' || t == 'string') {
console.log(p + msg);
}
else if (t == 'object') {
console.log(p, msg);
}
else if (msg instanceof Array) {
console.log(p + '[' + msg.join(', ') + ']');
}
else if (t == 'undefined') {
console.log(p + 'undefined');
}
else {
console.log(p);
console.log(msg);
}
}
history() {
this.log(myhistory);
}
version() {
this.log('版本-' + myversion);
}
sleep(time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
}
class saltMCBBS extends saltMCBBSOriginClass {
constructor(autorun = false) {
super();
this.settingPanel = document.createElement('div');
this.links = document.createElement('div');
window.saltMCBBSCSS.setStyle(`body{background-image:var(--bodyimg-day);background-attachment:fixed;background-size:cover}body>div[style]:not([id]):not([class]){float:left}body:hover>.mc_map_wp{transition-delay:0s}body>.mc_map_wp{padding-top:0;margin-top:0;overflow:visible;display:inline-block;margin-left:calc(50% - 565px);transition:0.3s ease;transition-delay:0.5s}body>.mc_map_wp:hover{transition-delay:0s}body>.mc_map_wp>.new_wp{padding-top:0 !important;padding-bottom:0 !important}body>.mc_map_wp>.new_wp h2 img{max-height:74px}body #toptb{opacity:0}.pmwarn{width:auto !important;background-size:16px !important}ul.xl.xl2.o.cl .pmwarn{background:url(template/mcbbs/image/warning.gif) no-repeat 0px 2px}#uhd>.mn>ul .pmwarn a{background:url(template/mcbbs/image/warning.gif) no-repeat 0px 2px !important;background-size:16px !important}.warned{opacity:0.2;transition:0.3s ease}.warned:hover{opacity:0.9}.reported{position:relative}.reported::after{content:"已举报";top:57px;left:400px;font-size:3rem;font-weight:bold;color:#c32;position:absolute;opacity:0.5;pointer-events:none}.reported.warned::after{content:"已制裁";color:#2c4}.pl .blockcode{position:relative}.pl .blockcode>em{top:2px;right:2px;position:absolute;margin:0 0 0 0}.pl .blockcode>em:hover{outline:1px dashed}.pl .blockcode ol{overflow:auto;max-height:45em;max-width:750px;scrollbar-width:thin;scrollbar-color:#eee #999}.pl .blockcode ol::-webkit-scrollbar{width:10px;height:10px}.pl .blockcode ol::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 4px rgba(102,102,102,0.25);background:#999}.pl .blockcode ol::-webkit-scrollbar-track{box-shadow:inset 0 0 4px rgba(187,187,187,0.25);border-radius:10px;background:#eee}.pl .blockcode ol li{color:#444;margin-left:29px;line-height:1.8em;height:1.8em;white-space:pre}.settingPanel{width:40vw;min-width:360px;left:30vw;max-height:80vh;top:10vh;position:fixed;background-color:#fbf2db;background-clip:padding-box;padding:0 8px 8px 8px;border:8px solid;border-radius:8px;border-color:rgba(0,0,0,0.2);box-sizing:border-box;overflow-y:auto;transition:0.3s ease, opacity 0.2s ease;z-index:999999;scrollbar-width:thin;scrollbar-color:#eee #999}.settingPanel::-webkit-scrollbar{width:4px;height:4px}.settingPanel::-webkit-scrollbar-thumb{border-radius:4px;box-shadow:inset 0 0 4px rgba(102,102,102,0.25);background:#999}.settingPanel::-webkit-scrollbar-track{box-shadow:inset 0 0 4px rgba(187,187,187,0.25);border-radius:4px;background:#eee}.settingPanel.visible{opacity:1;top:10vh}.settingPanel.hidden{opacity:0;top:-90vh;transition-timing-function:ease-in}.settingPanel>*{width:100%;box-sizing:border-box;margin-bottom:8px;float:left}.settingPanel>*:first-child{background-color:#fbf2db;position:sticky;top:0}.settingPanel .flb span>a{color:#3a74ad}.settingPanel .flb span>a:hover{color:#6cf}.settingPanel h3{font-size:0.875rem}.settingPanel h3 small{font-size:0.5em;color:grey}.settingPanel h3.half-h3{width:calc(50% - 14px);padding:0 10px 0 0;float:left;text-align:right}.settingPanel textarea{resize:vertical;line-height:1.2em;height:3.6em;min-height:2.4em;max-height:24em;width:calc(100% - 8px);border:none;border-width:0;scrollbar-width:thin;scrollbar-color:#eee #999}.settingPanel textarea::-webkit-scrollbar{width:8px;height:8px}.settingPanel textarea::-webkit-scrollbar-thumb{border-radius:8px;box-shadow:inset 0 0 4px rgba(102,102,102,0.25);background:#999}.settingPanel textarea::-webkit-scrollbar-track{box-shadow:inset 0 0 4px rgba(187,187,187,0.25);border-radius:8px;background:#eee}.settingPanel input{width:calc(50% - 4px);float:left;text-align:center}.settingPanel input[type="range"]{width:calc(100% - 8px)}.messagePanel{position:fixed;width:calc(15rem + 16px);padding:8px;max-height:100vh;bottom:0;right:0;font-size:1rem;color:#000000;box-sizing:content-box}.messagePanel>div{width:100%;min-height:16px;bottom:0;padding:8px;margin:4px 0;border-radius:4px;opacity:0.75;box-sizing:border-box;float:left;transition:0.3s ease;position:relative;z-index:99999}.messagePanel>div.normal{background-color:#efefef}.messagePanel>div.info{background-color:#b7d9ff}.messagePanel>div.warn{background-color:#fff8b7}.messagePanel>div.success{background-color:#b7ffbb}.messagePanel>div.error{background-color:#ffc2b7}.messagePanel>div:hover{opacity:1}.messagePanel>div>.close-button{width:16px;height:16px;top:0;right:0;position:absolute;transition:0.3s ease;transform-origin:50% 50%}.messagePanel>div>.close-button::after{content:"×";font-size:16px;line-height:16px;color:#000000}.messagePanel>div>.close-button:hover{transform:scale(1.2)}textarea.pt{line-height:1.25em;resize:vertical;min-height:5em;max-height:37.5em;scrollbar-width:thin;scrollbar-color:#eee #999}textarea.pt::-webkit-scrollbar{width:8px;height:8px}textarea.pt::-webkit-scrollbar-thumb{border-radius:8px;box-shadow:inset 0 0 4px rgba(102,102,102,0.25);background:#999}textarea.pt::-webkit-scrollbar-track{box-shadow:inset 0 0 4px rgba(187,187,187,0.25);border-radius:8px;background:#eee}
`, 'main');
window.saltMCBBSCSS.setStyle(`body.night-style #saltNewPageHead{--saltNewPageHeadbgcolor-l-t:rgba(68,68,68,0.5);--saltNewPageHeadbgcolor-l:#444;--saltNewPageHeadbgcolor:#363636}body.night-style #saltNewPageHead,body.night-style #saltNewPageHead a{color:#f0f0f0}body.night-style #saltNewPageHead a:hover{color:#6cf}body.night-style #saltNewPageHead .y_search,body.night-style #saltNewPageHead #scbar_type_menu{background-image:none;background-color:#444}body.night-style #saltNewPageHead .y_search{outline:none}body.night-style #saltNewPageHead .y_search .y_search_btn button{box-shadow:none;filter:invert(0.8) hue-rotate(170deg)}body.night-style #saltNewPageHead .y_search .y_search_inp{background-color:#555;background-image:none}body.night-style #saltNewPageHead .y_search .y_search_inp input{background-color:#666}body.night-style #saltNewPageHead .y_search .scbar_type_td{background-color:#555;background-image:none}#toptb{display:none}#saltNewPageHead{position:fixed;width:310px;height:100vh;top:0;left:-340px;padding:10px 30px;background-color:var(--saltNewPageHeadbgcolor-l-t, #fdf6e699);color:#111;transition:0.4s ease;transition-delay:0.4s;overflow-x:hidden;opacity:0.35;z-index:999999}#saltNewPageHead:hover{left:0;background-color:var(--saltNewPageHeadbgcolor-l, #fdf6e6);opacity:1;transition:0.4s ease}#saltNewPageHead::after{content:"saltMCBBS脚本,开发语言: Typescript + SCSS";position:absolute;top:90vh;right:0;color:var(--saltNewPageHeadbgcolor, #fbf2dc);z-index:-1}#saltNewPageHead .y_search,#saltNewPageHead .userinfo,#saltNewPageHead .links,#saltNewPageHead .addons{width:100%;margin:0;margin-bottom:0.75rem;overflow:auto;border-bottom:#ccc;font-size:1rem}#saltNewPageHead .y_search{background-color:transparent;outline:1px solid #ccc;overflow-y:hidden}#saltNewPageHead .y_search,#saltNewPageHead .y_search table{width:100%}#saltNewPageHead .y_search .y_search_btn{opacity:0.5}#saltNewPageHead .y_search .y_search_btn:hover{opacity:0.9}#saltNewPageHead .y_search .y_search_inp{width:calc(100% - 42px);background-image:none}#saltNewPageHead .y_search .y_search_inp input{width:calc(100% - 10px)}#saltNewPageHead .y_search .scbar_type_td{width:48px;background-image:none}#saltNewPageHead #scbar_type_menu{top:var(--top, 322px) !important}#saltNewPageHead .userinfo{overflow-x:hidden}#saltNewPageHead .userinfo>div,#saltNewPageHead .userinfo>span{margin-bottom:0.5rem}#saltNewPageHead .userinfo .username{width:100%;height:100px;font-weight:bold;position:relative}#saltNewPageHead .userinfo .username a{top:2px;position:absolute;font-size:1.75rem}#saltNewPageHead .userinfo .username div{top:calc(8px + 2rem);width:10.2em;position:absolute;color:#999}#saltNewPageHead .userinfo .username img{right:7px;top:4px;position:absolute;border-radius:10%;-webkit-filter:drop-shadow(0 3px 4px #222);filter:drop-shadow(0 3px 4px #222)}#saltNewPageHead .userinfo .thread{width:100%;display:flex;font-size:0.875rem;text-align:center}#saltNewPageHead .userinfo .thread span,#saltNewPageHead .userinfo .thread a{width:100%;display:inline-block}#saltNewPageHead .userinfo .progress{width:95%;height:0.75rem;margin-left:auto;margin-right:auto;outline:1px solid #ccc;background-color:var(--saltNewPageHeadbgcolor, #fbf2dc);position:relative;display:block;transition:0.3s ease}#saltNewPageHead .userinfo .progress>span{height:100%;background-color:var(--progresscolor, #6cf);display:block}#saltNewPageHead .userinfo .progress::after{content:attr(tooltip);display:block;width:140%;left:-20%;top:0;position:absolute;font-size:0.7rem;color:transparent;text-align:center;transition:0.3s ease}#saltNewPageHead .userinfo .progress:hover{transform:translateY(0.5rem)}#saltNewPageHead .userinfo .progress:hover::after{top:-1rem;color:inherit}#saltNewPageHead .userinfo .credit{position:relative;font-size:0.875rem}#saltNewPageHead .userinfo .credit span{width:calc(50% - 4px);display:inline-block;height:1.2rem;line-height:1.2rem;padding-left:1rem;position:relative;box-sizing:border-box}#saltNewPageHead .userinfo .credit span img{left:1px;top:2px;position:absolute}#saltNewPageHead .links a{width:100%;height:1.75rem;line-height:1.75rem;display:inline-block;background-color:#fff0;text-align:center;font-size:1rem;border-bottom:1px solid #eee}#saltNewPageHead .links a:hover{background-color:var(--saltNewPageHeadbgcolor, #fbf2dc)}#saltNewPageHead .links a:last-child{border-bottom:none}#saltNewPageHead .links .showmenu{padding-right:0;background-image:none}#saltNewPageHead .addons a{width:calc(50% - 4px);display:inline-block;height:1.6rem;line-height:1.6rem;text-align:center;font-size:1rem;background-color:#fff0;border:1px solid transparent}#saltNewPageHead .addons a:hover{background-color:var(--saltNewPageHeadbgcolor, #fbf2dc);border-color:#efefef}#saltNewPageHead .addons a img{display:inline-block;vertical-align:middle;max-width:1.5rem;max-height:1.5rem;margin-right:0.5rem}
`, 'pagehead');
window.saltMCBBSCSS.setStyle(`body.night-style{--bodybg:#2b2b2b;--bodybg-l:#2b2b2b;--bodybg-l-t:rgba(43,43,43,0)}body.night-style input,body.night-style button,body.night-style select,body.night-style textarea{background-color:#3d3d3d;background-image:none;border-color:#837c73;color:#eaeaea}body.night-style{background-color:#1c1c1c !important;background-image:var(--bodyimg-night);color:#eaeaea}body.night-style .mc_map_wp{box-shadow:0 0 20px 1px #000}body.night-style .mc_map_border_right,body.night-style .mc_map_border_left,body.night-style .mc_map_border_top,body.night-style .mc_map_border_foot{background-color:#2b2b2b;background-image:none;color:#eaeaea}body.night-style #body_fixed_bg{opacity:0}body.night-style .fl .forum_index_title,body.night-style .sttl,body.night-style .mn .bm_h{background-color:#3d3d3d;padding-left:16px}body.night-style .p_pop,body.night-style .p_pof,body.night-style .sllt{background-color:#3d3d3d;border-color:#837c73;background-image:none}body.night-style .p_pop a:hover,body.night-style .p_pof a:hover,body.night-style .sllt a:hover{background-color:#837c73}body.night-style #pt .z a,body.night-style #pt .z em,body.night-style #pt .z span{color:#eaeaea}body.night-style #nv_right{background-color:#3d3d3d;background-image:none}body.night-style #nv_right a{color:#eaeaea}body.night-style #nv_right a:hover{color:#6cf}body.night-style .m_c,body.night-style .tm_c{background-color:#2b2b2b;color:#eaeaea}body.night-style .m_c .dt th,body.night-style .tm_c .dt th{background-color:#2b2b2b}body.night-style .m_c .px,body.night-style .m_c .pt,body.night-style .m_c .ps,body.night-style .m_c select,body.night-style .tm_c .px,body.night-style .tm_c .pt,body.night-style .tm_c .ps,body.night-style .tm_c select{background-color:#3d3d3d;border-top:none;border-bottom:none;border-left:none;border-right:none;border-width:0px}body.night-style .m_c .o,body.night-style .tm_c .o{background-color:#3d3d3d}body.night-style .m_c a,body.night-style .tm_c a{color:#eaeaea}body.night-style .m_c a:hover,body.night-style .tm_c a:hover{color:#6cf}body.night-style .xi2,body.night-style .xi2 a,body.night-style .xi3 a{color:#69f}body.night-style .nfl .f_c{background-color:#444;border:none}body.night-style .alt>th,body.night-style .alt>td{background-color:#3d3d3d}body.night-style .dt td,body.night-style .dt th{background-color:#3d3d3d}body.night-style .dt td a,body.night-style .dt th a{color:#eaeaea}body.night-style .dt td a:hover,body.night-style .dt th a:hover{color:#6cf}body.night-style .dt tr:not(.alt) td,body.night-style .dt tr:not(.alt) th{background-color:#2b2b2b}body.night-style .bm{background-color:transparent}body.night-style #diy_chart #frame48dS31{border-color:transparent !important}body.night-style #diy_chart .frame{background-color:#3d3d3d;border-color:transparent}body.night-style #diy_chart .frame .column{color:#eaeaea}body.night-style #diy_chart .frame .column a{color:#eaeaea}body.night-style #diy_chart .frame .column a:hover{color:#6cf}body.night-style #diy_chart .frame .column .tab-title.title{background-color:#2b2b2b !important}body.night-style #diy_chart .frame .column .tab-title.title ul{background-color:#3d3d3d !important}body.night-style #diy_chart .frame .column .tab-title.title ul li a{border-color:transparent !important}body.night-style #diy_chart .frame .column .tab-title.title ul li:not(.a) a{background-color:#525252}body.night-style #diy_chart .frame .column .tab-title.title ul li.a a{background-color:#666}body.night-style #diy_chart .frame .column .tb-c>div{background-color:#3d3d3d}body.night-style #diy_chart #tabVpFJkk{background-color:#3d3d3d !important;border-color:transparent !important}body.night-style .mn>.bm>.bm{background-color:#3d3d3d;border-color:transparent}body.night-style .mn>.bm>.bm .bm_h{background-color:#1c1c1c;background-image:none}body.night-style .mn>.bm>.bm .bm_c{background-color:#3d3d3d;border-color:transparent}body.night-style .portal_left_dev{border:none}body.night-style .portal_left_dev .portal_left_title{background-color:#1c1c1c;background-image:none}body.night-style .portal_left_dev .portal_left_title[style*="background"]{background-color:#1c1c1c !important;background-image:none !important}body.night-style .portal_left_dev .portal_left_content{border-color:transparent;background-color:#3d3d3d}body.night-style .portal_left_dev a{color:#eaeaea}body.night-style .portal_left_dev a:hover{color:#6cf}body.night-style #ct .mn .bm,body.night-style #group_sd .bm{border:none}body.night-style #ct .mn .bm .bm_h,body.night-style #group_sd .bm .bm_h{background-color:#1c1c1c;background-image:none}body.night-style #ct .mn .bm .area,body.night-style #ct .mn .bm .bm_c,body.night-style #group_sd .bm .area,body.night-style #group_sd .bm .bm_c{background-color:#3d3d3d;border-color:transparent}body.night-style #ct .mn .bm .area .frame,body.night-style #ct .mn .bm .bm_c .frame,body.night-style #group_sd .bm .area .frame,body.night-style #group_sd .bm .bm_c .frame{background-color:transparent}body.night-style #ct .mn a,body.night-style #group_sd a{color:#eaeaea}body.night-style #ct .mn a:hover,body.night-style #group_sd a:hover{color:#6cf}body.night-style #diy_right .frame{background-color:transparent}body.night-style #diy_right .block{background-color:#3d3d3d !important;border-color:transparent !important}body.night-style #diy_right .block .title{background-color:#1c1c1c;background-image:none}body.night-style #diy_right .block a{color:#eaeaea}body.night-style #diy_right .block a:hover{color:#6cf}body.night-style #diy_right .portal_news,body.night-style #diy_right .portal_game,body.night-style #diy_right .modpack,body.night-style #diy_right .portal_zb,body.night-style #diy_right .portal_note{border-color:transparent}body.night-style .special_user_info{background-color:#3d3d3d;background-image:none}body.night-style .special_user_info .special_info{background-color:transparent;background-image:none}body.night-style .special_user_info .special_info>div{background-color:#525252}body.night-style .special_user_info a{color:#eaeaea}body.night-style .special_user_info a:hover{color:#6cf}body.night-style .portal_block_summary iframe{filter:brightness(0.5)}body.night-style .pgb a{background-color:transparent}body.night-style .pgt .pg a,body.night-style .pgt .pg strong,body.night-style .pgt .pg label,body.night-style .pgs .pg a,body.night-style .pgs .pg strong,body.night-style .pgs .pg label{color:#eaeaea;background-color:transparent}body.night-style .pgt .pg strong,body.night-style .pgs .pg strong{background-color:#3d3d3d}body.night-style .pgbtn,body.night-style .pgbtn a{border:none;box-shadow:none}body.night-style .pgbtn a{background-color:#3d3d3d;color:#eaeaea;border:none}body.night-style #wp .wp{background-color:#2b2b2b;color:#eaeaea}body.night-style #wp .wp table,body.night-style #wp .wp tr,body.night-style #wp .wp td{border-color:#837c73}body.night-style #wp .wp table a,body.night-style #wp .wp tr a,body.night-style #wp .wp td a{color:#eaeaea}body.night-style #wp .wp table a:hover,body.night-style #wp .wp tr a:hover,body.night-style #wp .wp td a:hover{color:#6cf}body.night-style #postlist{background-color:transparent;border:none}body.night-style #postlist>table,body.night-style .plhin,body.night-style #f_pst{border:none;box-shadow:none}body.night-style #postlist>table tr,body.night-style #postlist>table td,body.night-style #postlist>table div,body.night-style .plhin tr,body.night-style .plhin td,body.night-style .plhin div,body.night-style #f_pst tr,body.night-style #f_pst td,body.night-style #f_pst div{border-color:#837c73}body.night-style #postlist>table .ad,body.night-style .plhin .ad,body.night-style #f_pst .ad{background-color:#3d3d3d}body.night-style #postlist>table td.pls,body.night-style .plhin td.pls,body.night-style #f_pst td.pls{background-color:#2b2b2b;border:none}body.night-style #postlist>table td.plc,body.night-style .plhin td.plc,body.night-style #f_pst td.plc{background-color:#3d3d3d;border:none}body.night-style #postlist>table .pls .avatar img,body.night-style .plhin .pls .avatar img,body.night-style #f_pst .pls .avatar img{background-color:#3d3d3d;background-image:none}body.night-style #postlist>table a,body.night-style .plhin a,body.night-style #f_pst a{color:#eaeaea}body.night-style #postlist>table a:hover,body.night-style .plhin a:hover,body.night-style #f_pst a:hover{color:#6cf}body.night-style .plhin .quote{background-color:#525252;color:#eaeaea}body.night-style .plhin .pcb .t_fsz>table table{color:#444;text-shadow:0 0 1px #fff, 0 0 1px #fff, 0 0 1px #fff, 0 0 1px #fff}body.night-style .plhin .pcb .t_fsz>table .spoilerbutton{border:1px solid #525252}body.night-style .plhin .pcb .t_fsz>table .spoilerbody>table{color:#eaeaea;text-shadow:none}body.night-style .plhin.warned{opacity:0.1}body.night-style .plhin.warned:hover{opacity:0.9}body.night-style .plhin .tbn .mt.bbda{background-image:none;background-color:#3d3d3d}body.night-style .plhin .tbn ul{border-top:none;border-bottom:none;border-left:none;border-right:none;border-width:0px}body.night-style #vfastpost{background-color:transparent;background-image:none}body.night-style #vfastpost #vf_l,body.night-style #vfastpost #vf_m,body.night-style #vfastpost #vf_r,body.night-style #vfastpost #vf_b{background-color:#2b2b2b;background-image:none}body.night-style #vfastpost #vf_m input{border-color:transparent;color:#eaeaea !important}body.night-style #vfastpost #vf_l{border-radius:5px 0 0 5px}body.night-style #vfastpost #vf_r{border-radius:0 5px 5px 0}body.night-style #vfastpost #vreplysubmit{background-color:#2b2b2b;background-image:none;box-shadow:none;position:relative}body.night-style #vfastpost #vreplysubmit:after{content:"快速回复";position:absolute;top:0;left:0;width:100%;height:38px;line-height:38px;font-size:1rem}body.night-style #p_btn a,body.night-style #p_btn a i{background-color:#525252;background-image:none}body.night-style .psth{background-color:#525252;background-image:none}body.night-style #postlist.bm{border-color:#837c73}body.night-style #mymodannouncement,body.night-style #myskinannouncement,body.night-style #mytextureannouncement,body.night-style #my16modannouncement,body.night-style .cgtl caption,body.night-style .locked{background-color:#2b2b2b;border:none}body.night-style #fastpostform .pls,body.night-style #fastpostform .plc{border:none}body.night-style #fastposteditor,body.night-style #fastposteditor .bar,body.night-style #fastposteditor .area,body.night-style #fastposteditor .pt{background-color:#2b2b2b;border:none}body.night-style #fastposteditor .fpd a{filter:drop-shadow(0 0 4px #fff) drop-shadow(0 0 4px #fff) drop-shadow(0 0 4px #fff)}body.night-style .pi strong a{border-color:transparent}body.night-style #threadstamp img{filter:drop-shadow(0 0 4px #fff) drop-shadow(0 0 4px #fff) drop-shadow(0 0 4px #fff)}body.night-style .blockcode{filter:invert(0.8) hue-rotate(170deg)}body.night-style .blockcode ol li{color:#222}body.night-style #ct .bm.bml.pbn .bm_c,body.night-style #ct .bm.bmw.fl .bm_c{background-color:#3d3d3d !important}body.night-style #ct #pgt{background-color:transparent !important}body.night-style #ct #thread_types>li a,body.night-style #ct #separatorline th,body.night-style #ct #separatorline td,body.night-style #ct #forumnewshow,body.night-style #ct #f_pst .bm_c{background-color:#3d3d3d !important}body.night-style #ct #threadlist .th,body.night-style #ct #threadlisttableid{background-color:transparent}body.night-style #ct #threadlist .th tr th,body.night-style #ct #threadlist .th tr td,body.night-style #ct #threadlisttableid tr th,body.night-style #ct #threadlisttableid tr td{background-color:transparent;border:none}body.night-style #ct #threadlist .th tr:hover>th,body.night-style #ct #threadlist .th tr:hover>td,body.night-style #ct #threadlisttableid tr:hover>th,body.night-style #ct #threadlisttableid tr:hover>td{background-color:#525252}body.night-style #ct .mn a.bm_h{background-color:#3d3d3d !important;border:none;color:#eaeaea}body.night-style #ct .mn a.bm_h:hover{color:#6cf}body.night-style #ct #waterfall li{background-image:none;background-color:#3d3d3d;transition:0.3 ease}body.night-style #ct #waterfall li:hover{background-color:#525252}body.night-style #ct #waterfall li>*{background-image:none;background-color:transparent}body.night-style #ct .fastpreview .bm_c{background-color:#2b2b2b !important}body.night-style #ct .fastpreview .bm_c .pcb{background-color:#2b2b2b}body.night-style #ct #livethread{border-color:#837c73}body.night-style #ct #livethread #livereplycontentout{background-color:#2b2b2b;scrollbar-width:thin;scrollbar-color:#eee #999}body.night-style #ct #livethread #livereplycontentout::-webkit-scrollbar{width:8px;height:8px}body.night-style #ct #livethread #livereplycontentout::-webkit-scrollbar-thumb{border-radius:8px;box-shadow:inset 0 0 4px rgba(102,102,102,0.25);background:#999}body.night-style #ct #livethread #livereplycontentout::-webkit-scrollbar-track{box-shadow:inset 0 0 4px rgba(187,187,187,0.25);border-radius:8px;background:#eee}body.night-style #ct #livethread #livereplycontent{background-color:#2b2b2b}body.night-style #ct #livethread #livereplycontent>div{background-color:#3d3d3d}body.night-style #ct #livethread #livefastcomment{border-color:#837c73;background-color:#2b2b2b}body.night-style #ct #livethread #livefastcomment textarea{background-color:#3d3d3d;color:#eaeaea !important}body.night-style #ct .appl{border-color:transparent !important}body.night-style #ct .appl .tbn h2{background-color:#1c1c1c;background-image:none}body.night-style #ct .appl .tbn ul{border:none}body.night-style #ct .appl .tbn ul li:hover{background-color:#3d3d3d}body.night-style #ct .appl .tbn a{color:#eaeaea}body.night-style #ct .appl .tbn a:hover{color:#6cf}body.night-style #ct .mn .bm{background-color:transparent}body.night-style #ct .mn .bm .tb.cl,body.night-style #ct .mn .bm .bm_h{background-color:#1c1c1c;background-image:none}body.night-style #ct .mn .bm .tb.cl h3,body.night-style #ct .mn .bm .bm_h h3{color:#eaeaea !important}body.night-style #ct .mn .bm .bm.mtm,body.night-style #ct .mn .bm .bm_c{background-color:#3d3d3d;border-color:transparent}body.night-style #ct .mn .bm ul li{color:#eaeaea}body.night-style #ct .mn .bm ul.buddy li{background-color:#3d3d3d;border:none}body.night-style #ct .mn .bm a{color:#eaeaea}body.night-style #ct .mn .bm a:hover{color:#6cf}body.night-style #ct .mn .bm .bm.bmn.mtm.cl{background-color:transparent !important}body.night-style #ct .mn .bm input,body.night-style #ct .mn .bm select,body.night-style #ct .mn .bm option{background-color:#3d3d3d;background-image:none;border-top:none;border-bottom:none;border-left:none;border-right:none;border-width:0px}body.night-style #ct .mn .bm .nts{background-color:#3d3d3d}body.night-style #ct .mn .bm .nts .ntc_body[style*="color"]{color:#eaeaea !important}body.night-style #ct .mn .bm .pg a,body.night-style #ct .mn .bm .pg strong,body.night-style #ct .mn .bm .pg label{color:#eaeaea;background-color:transparent}body.night-style #ct .mn .bm .pg strong{background-color:#3d3d3d}body.night-style #threadlist .pbw h3 a{color:#69f}body.night-style #threadlist .pbw h3 a:visited{color:#b54dff}body.night-style #threadlist .pbw p{color:#eaeaea}body.night-style #nv>ul{background-color:#2b2b2b;background-image:none;border:none}body.night-style #nv>ul li:first-child>a,body.night-style #nv>ul li:first-child>a:hover{border-left:none}body.night-style #nv>ul li:last-child>a,body.night-style #nv>ul li:last-child>a:hover{border-right:none}body.night-style #nv>ul li>a{background-color:#3d3d3d}body.night-style #nv>ul li>a,body.night-style #nv>ul li>a:hover{border-color:#3d3d3d}body.night-style #nv>ul li>a:hover{background-color:#525252}body.night-style #uhd{background-color:#3d3d3d;border-color:#2b2b2b}body.night-style #uhd ul.tb.cl{border-bottom-color:#2b2b2b}body.night-style #uhd ul.tb.cl li a{background-color:#2b2b2b;border:none;color:#eaeaea}body.night-style #uhd ul.tb.cl li a:hover{color:#6cf}body.night-style #ct{border-color:#2b2b2b}body.night-style .tl{background-color:transparent}body.night-style .tl tr{background-color:transparent}body.night-style .tl tr th,body.night-style .tl tr td{background-color:transparent;border:none}body.night-style .tl tr:hover th,body.night-style .tl tr:hover td{background-color:#525252}body.night-style #typeid_ctrl_menu{background-color:#3d3d3d;border-color:#837c73}body.night-style #typeid_ctrl_menu li{color:#eaeaea}body.night-style #editorbox{background-color:#3d3d3d}body.night-style #editorbox>*{background-color:transparent}body.night-style #editorbox .tb .a a,body.night-style #editorbox .tb .current a{background-color:#525252}body.night-style #editorbox .ftid a{background-color:#525252;color:#eaeaea !important}body.night-style #editorbox #e_controls{background-color:#525252}body.night-style #editorbox #e_controls .b1r a,body.night-style #editorbox #e_controls .b2r a{border:none;border-width:0px}body.night-style #editorbox #e_controls .b1r a:not(.dp),body.night-style #editorbox #e_controls .b2r a:not(.dp){filter:drop-shadow(0 0 4px #fff) drop-shadow(0 0 4px #fff) drop-shadow(0 0 4px #fff)}body.night-style #editorbox #e_controls .b1r a.dp,body.night-style #editorbox #e_controls .b2r a.dp{background-color:#525252;color:#eaeaea}body.night-style #editorbox #e_textarea{background-color:#2b2b2b}body.night-style #editorbox #rstnotice,body.night-style #editorbox #e_bbar,body.night-style #editorbox .area{background-color:#3d3d3d;border-color:#837c73}body.night-style #editorbox .area{background-color:#2b2b2b}body.night-style #editorbox .exfm{background-color:#525252}body.night-style #nav>a,body.night-style #content>*>a,body.night-style li>a,body.night-style #end>a,body.night-style #footer strong>a{color:#eaeaea}body.night-style #nav>a:hover,body.night-style #content>*>a:hover,body.night-style li>a:hover,body.night-style #end>a:hover,body.night-style #footer strong>a:hover{color:#6cf}body.night-style #content p.author{background-color:#3d3d3d}body.night-style .xl label,body.night-style .xl label a{color:#f99}body.night-style a[style*="color"][style*="#333333"],body.night-style font[style*="color"][style*="#333333"]{color:#e0e0e0 !important}body.night-style a[style*="color"][style*="#663399"],body.night-style font[style*="color"][style*="#663399"]{color:#de90df !important}body.night-style a[style*="color"][style*="#8f2a90"],body.night-style font[style*="color"][style*="#8f2a90"]{color:#de90df !important}body.night-style a[style*="color"][style*="#660099"],body.night-style font[style*="color"][style*="#660099"]{color:#bf8cd9 !important}body.night-style a[style*="color"][style*="#660000"],body.night-style font[style*="color"][style*="#660000"]{color:#c66 !important}body.night-style a[style*="color"][style*="#993333"],body.night-style font[style*="color"][style*="#993333"]{color:#f99 !important}body.night-style a[style*="color"][style*="#EE1B2E"],body.night-style font[style*="color"][style*="#EE1B2E"]{color:#f99 !important}body.night-style a[style*="color"][style*="#ff0000"],body.night-style font[style*="color"][style*="#ff0000"]{color:#f99 !important}body.night-style a[style*="color"][style*="#FF0000"],body.night-style font[style*="color"][style*="#FF0000"]{color:#f99 !important}body.night-style a[style*="color"][style*="#EE5023"],body.night-style font[style*="color"][style*="#EE5023"]{color:#d97f26 !important}body.night-style a[style*="color"][style*="#996600"],body.night-style font[style*="color"][style*="#996600"]{color:#e6a219 !important}body.night-style a[style*="color"][style*="#663300"],body.night-style font[style*="color"][style*="#663300"]{color:#d97f26 !important}body.night-style a[style*="color"][style*="#006666"],body.night-style font[style*="color"][style*="#006666"]{color:#6cc !important}body.night-style a[style*="color"][style*="#3C9D40"],body.night-style font[style*="color"][style*="#3C9D40"]{color:#8f8 !important}body.night-style a[style*="color"][style*="#009900"],body.night-style font[style*="color"][style*="#009900"]{color:#9f9 !important}body.night-style a[style*="color"][style*="#3366ff"],body.night-style font[style*="color"][style*="#3366ff"]{color:#6af !important}body.night-style a[style*="color"][style*="#2b65b7"],body.night-style font[style*="color"][style*="#2b65b7"]{color:#6af !important}body.night-style a[style*="color"][style*="#003399"],body.night-style font[style*="color"][style*="#003399"]{color:#6af !important}body.night-style a[style*="color"][style*="#2B65B7"],body.night-style font[style*="color"][style*="#2B65B7"]{color:#6af !important}body.night-style a[style*="color"][style*="#330066"],body.night-style font[style*="color"][style*="#330066"]{color:#b28cd9 !important}body.night-style a[style*="color"][style*="#8F2A90"],body.night-style font[style*="color"][style*="#8F2A90"]{color:#cf61d1 !important}body.night-style a[style*="background-color"][style*="#FFFFFF"],body.night-style font[style*="background-color"][style*="#FFFFFF"]{background-color:transparent !important}body.night-style a[style*="background-color"][style*="Wheat"],body.night-style font[style*="background-color"][style*="Wheat"]{background-color:transparent !important}body.night-style font[color*="#333333"]{color:#e0e0e0 !important}body.night-style font[color*="#660000"]{color:#c66 !important}body.night-style font[color*="#8b0000"]{color:#c66 !important}body.night-style font[color*="#ff0000"]{color:#f99 !important}body.night-style font[color*="red"]{color:#f99 !important}body.night-style font[color*="Red"]{color:#f99 !important}body.night-style font[color*="#000080"]{color:#8af !important}body.night-style font[color*="#0000ff"]{color:#8af !important}body.night-style font[color*="#3366ff"]{color:#8af !important}body.night-style font[color*="#003399"]{color:#8af !important}body.night-style font[color*="blue"]{color:#8af !important}body.night-style font[color*="Blue"]{color:#8af !important}body.night-style font[color*="#339933"]{color:#9f9 !important}body.night-style font[color*="#009900"]{color:#9f9 !important}body.night-style font[color*="#008000"]{color:#9f9 !important}body.night-style font[color*="#006400"]{color:#9f9 !important}body.night-style font[color*="#0640"]{color:#9f9 !important}body.night-style font[color*="green"]{color:#9f9 !important}body.night-style font[color*="Green"]{color:#9f9 !important}body.night-style font[color*="#000000"]{color:#fff !important}body.night-style font[color*="black"]{color:#fff !important}body.night-style font[color*="Black"]{color:#fff !important}body.night-style font[color*="#660099"]{color:#bf8cd9 !important}body.night-style font[color*="#4b0082"]{color:#b54dff !important}body.night-style font[color*="Indigo"]{color:#b54dff !important}body.night-style font[color*="DarkOrchid"]{color:#c57ce9 !important}body.night-style font[color*="Purple"]{color:#ff4dff !important}body.night-style font[color*="#2d76c4"]{color:#5c97d6 !important}body.night-style font[color*="Olive"]{color:#ff3 !important}body.night-style .t_f[style*="background-color"][style*="#FBF2DB"]{background-color:transparent !important}body.night-style .settingPanel{background-color:#2b2b2b;color:#eaeaea}body.night-style .settingPanel textarea{background-color:#3d3d3d;border:none}body.night-style .settingPanel input{border:none;border-width:0px}body.night-style .settingPanel *:first-child{background-color:#2b2b2b}
`, 'night-style');
window.saltMCBBSCSS.setStyle(`p.md_ctrl{position:relative;float:left;min-width:120px;overflow:visible;margin-left:5px;padding-left:10px}p.md_ctrl,p.md_ctrl:hover{max-height:var(--maxHeight, 96px)}p.md_ctrl.salt-expand,p.md_ctrl.salt-expand:hover{max-height:var(--expandHeight, 960px)}p.md_ctrl.expandable{padding-bottom:32px;overflow:hidden}p.md_ctrl .saltExpandHandler{position:absolute;bottom:0;left:0;width:100%;height:32px;color:#3882a7;background-image:linear-gradient(0deg, #e3c99e, #e3c99e, rgba(227,201,158,0));cursor:pointer}p.md_ctrl .saltExpandHandler:after{content:"点击展开";display:block;width:100%;height:32px;line-height:32px;text-align:center}p.md_ctrl.salt-expand .saltExpandHandler:after{content:"点击收起"}p.md_ctrl:not(.expandable) .saltExpandHandler{display:none}p.md_ctrl>a{width:100%}p.md_ctrl>a>img{animation:dropdown 0.5s ease;position:relative;width:35px;height:55px;-webkit-filter:drop-shadow(0 3px 2px #000);filter:drop-shadow(0 3px 2px #000);margin:4.5px;transition:filter 0.5s ease}p.md_ctrl>a>img:hover{animation:pickup 0.5s ease;-webkit-transform:matrix3d(1, 0, 0, 0, 0, 1, 0, -0.001, 0, 0, 1, 0, 0, -1.6, 0, 0.85);transform:matrix3d(1, 0, 0, 0, 0, 1, 0, -0.001, 0, 0, 1, 0, 0, -1.6, 0, 0.85);-webkit-filter:drop-shadow(0 5px 4px rgba(0,0,0,0.75));filter:drop-shadow(0 5px 4px rgba(0,0,0,0.75))}body.night-style p.md_ctrl .saltExpandHandler{color:#6cf;background-image:linear-gradient(0deg, var(--bodybg-l, #313131), var(--bodybg-l, #313131), var(--bodybg-l-t, rgba(49,49,49,0)))}body #append_parent>.tip_4,body .tip_4.aimg_tip,body .pls .tip_4,body .tip_4[id*="attach"],body dd>.tip_4{background-color:#e3c99eee !important;max-height:90px !important;width:140px;margin-top:35px}body .tip_4.aimg_tip,body .tip_4[id*="attach"]{width:200px !important;padding:5px !important;background-image:none !important}body .tip_4[id*="attach"] .tip_c{padding:5px !important;background-image:none !important}body .tip_4.aimg_tip p{pointer-events:auto !important}body #append_parent>.tip_4{margin-top:40px;margin-left:-10px}body .tip_3,body .tip_4{transition:opacity 0.4s ease !important;width:105px;height:165px;padding:0;border:none;border-radius:5px;margin-top:85px;margin-left:44px;pointer-events:none !important;overflow:hidden;background-color:rgba(153,153,153,0.75);box-shadow:0px 10px 25px -4px #000;image-rendering:pixelated}body .tip_3::before,body .tip_4::before{content:"";position:absolute;z-index:-1;top:-7px;left:-7px;width:119px;height:187px;background-size:119px 187px !important;-webkit-filter:saturate(140%);filter:saturate(140%)}body .tip .tip_horn{display:none}body .tip .tip_c{background-image:linear-gradient(142deg, #fff0 0%, #fff4 5%, #fff2 28%, #fff0 29%, #fff0 70%, #fff2 70.5%, #fff2 73%, #fff0 74%, #fff4 75%, #fff2 85%, #fff0 85.1%);padding:20px 15px 0 15px;height:165px;color:#222}body .tip .tip_c>p,body .tip .tip_c>h4{color:#222;text-shadow:0 0 1px #fff, 0 0 1px #fff, 0 0 1px #fff,
0 0 1px #fff, 0 0 1px #fff, 0 0 2px #fff, 0 0 2px #fff,
0 0 2px #fff, 0 0 2px #fff !important}body .tip .tip_c h4{border-bottom:1px solid #fff}body div[id$="_menu"]:before{background-repeat:no-repeat}body div[id$="_101_menu"]:before{background:url(static/image/common/m_a2.png)}body div[id$="_102_menu"]:before{background:url(static/image/common/m_a3.png)}body div[id$="_103_menu"]:before{background:url(static/image/common/m_a6.png)}body div[id$="_11_menu"]:before{background:url(static/image/common/m_d1.png)}body div[id$="_12_menu"]:before{background:url(static/image/common/m_d2.png)}body div[id$="_104_menu"]:before{background:url(static/image/common/m_b1.png)}body div[id$="_105_menu"]:before{background:url(static/image/common/m_b3.png)}body div[id$="_106_menu"]:before{background:url(static/image/common/m_b4.png)}body div[id$="_234_menu"]:before{background:url(static/image/common/m_b5.gif)}body div[id$="_107_menu"]:before{background:url(static/image/common/m_rc1.png)}body div[id$="_108_menu"]:before{background:url(static/image/common/m_rc3.png)}body div[id$="_109_menu"]:before{background:url(static/image/common/m_rc5.png)}body div[id$="_250_menu"]:before{background:url(static/image/common/m_c_10years.png)}body div[id$="_76_menu"]:before{background:url(static/image/common/m_g5.png)}body div[id$="_58_menu"]:before{background:url(static/image/common/m_g3.png)}body div[id$="_59_menu"]:before{background:url(static/image/common/m_g4.png)}body div[id$="_21_menu"]:before{background:url(static/image/common/m_noob.png)}body div[id$="_9_menu"]:before{background:url(static/image/common/m_c2.png)}body div[id$="_2_menu"]:before{background:url(static/image/common/m_c3.png)}body div[id$="_38_menu"]:before{background:url(static/image/common/m_c1.png)}body div[id$="_112_menu"]:before{background:url(static/image/common/m_c4.png)}body div[id$="_251_menu"]:before{background:url(static/image/common/m_c_piglin.png)}body div[id$="_155_menu"]:before{background:url(static/image/common/m_cape_mc2011.png)}body div[id$="_156_menu"]:before{background:url(static/image/common/m_cape_mc2012.png)}body div[id$="_157_menu"]:before{background:url(static/image/common/m_cape_mc2013.png)}body div[id$="_158_menu"]:before{background:url(static/image/common/m_cape_mc2015.png)}body div[id$="_159_menu"]:before{background:url(static/image/common/m_cape_Tr.png)}body div[id$="_180_menu"]:before{background:url(static/image/common/m_cape_cobalt.png)}body div[id$="_181_menu"]:before{background:url(static/image/common/m_cape_maper.png)}body div[id$="_196_menu"]:before{background:url(static/image/common/m_cape_mc2016.png)}body div[id$="_247_menu"]:before{background:url(static/image/common/m_cape_Mojira.png)}body div[id$="_45_menu"]:before{background:url(static/image/common/m_s1.png)}body div[id$="_127_menu"]:before{background:url(static/image/common/m_s2.png)}body div[id$="_78_menu"]:before{background:url(static/image/common/m_p_pc.png)}body div[id$="_113_menu"]:before{background:url(static/image/common/m_p_and.png)}body div[id$="_114_menu"]:before{background:url(static/image/common/m_p_ios.png)}body div[id$="_141_menu"]:before{background:url(static/image/common/m_p_wp.png)}body div[id$="_160_menu"]:before{background:url(static/image/common/m_p_w10.png)}body div[id$="_115_menu"]:before{background:url(static/image/common/m_p_box360.png)}body div[id$="_116_menu"]:before{background:url(static/image/common/m_p_boxone.png)}body div[id$="_117_menu"]:before{background:url(static/image/common/m_p_ps3.png)}body div[id$="_118_menu"]:before{background:url(static/image/common/m_p_ps4.png)}body div[id$="_119_menu"]:before{background:url(static/image/common/m_p_psv.png)}body div[id$="_170_menu"]:before{background:url(static/image/common/m_p_wiiu.png)}body div[id$="_209_menu"]:before{background:url(static/image/common/m_p_switch.png)}body div[id$="_227_menu"]:before{background:url(static/image/common/m_p_3ds.png)}body div[id$="_56_menu"]:before{background:url(static/image/common/m_g1.png)}body div[id$="_57_menu"]:before{background:url(static/image/common/m_g2.png)}body div[id$="_61_menu"]:before{background:url(static/image/common/m_p1.png)}body div[id$="_62_menu"]:before{background:url(static/image/common/m_p2.png)}body div[id$="_63_menu"]:before{background:url(static/image/common/m_p3.png)}body div[id$="_46_menu"]:before{background:url(static/image/common/m_p4.png)}body div[id$="_64_menu"]:before{background:url(static/image/common/m_p5.png)}body div[id$="_65_menu"]:before{background:url(static/image/common/m_p6.png)}body div[id$="_66_menu"]:before{background:url(static/image/common/m_p7.png)}body div[id$="_75_menu"]:before{background:url(static/image/common/m_p8.png)}body div[id$="_85_menu"]:before{background:url(static/image/common/m_p9.png)}body div[id$="_86_menu"]:before{background:url(static/image/common/m_p10.png)}body div[id$="_100_menu"]:before{background:url(static/image/common/m_p11.png)}body div[id$="_175_menu"]:before{background:url(static/image/common/m_p12.png)}body div[id$="_182_menu"]:before{background:url(static/image/common/m_p13.png)}body div[id$="_91_menu"]:before{background:url(static/image/common/m_h1.png)}body div[id$="_93_menu"]:before{background:url(static/image/common/m_h2.png)}body div[id$="_92_menu"]:before{background:url(static/image/common/m_h3.png)}body div[id$="_94_menu"]:before{background:url(static/image/common/m_h4.png)}body div[id$="_95_menu"]:before{background:url(static/image/common/m_h5.png)}body div[id$="_96_menu"]:before{background:url(static/image/common/m_h6.png)}body div[id$="_152_menu"]:before{background:url(static/image/common/m_h7.png)}body div[id$="_183_menu"]:before{background:url(static/image/common/m_h8.png)}body div[id$="_200_menu"]:before{background:url(static/image/common/m_h9.png)}body div[id$="_210_menu"]:before{background:url(static/image/common/m_h10.png)}body div[id$="_70_menu"]:before{background:url(static/image/common/m_arena_v1.png)}body div[id$="_72_menu"]:before{background:url(static/image/common/m_arena_v2.png)}body div[id$="_88_menu"]:before{background:url(static/image/common/m_arena_v3.png)}body div[id$="_111_menu"]:before{background:url(static/image/common/m_arena_v4.png)}body div[id$="_69_menu"]:before{background:url(static/image/common/m_arena_w1.png)}body div[id$="_68_menu"]:before{background:url(static/image/common/m_arena_w2.png)}body div[id$="_73_menu"]:before{background:url(static/image/common/m_arena_w3.png)}body div[id$="_74_menu"]:before{background:url(static/image/common/m_arena_w4.png)}body div[id$="_89_menu"]:before{background:url(static/image/common/m_arena_w5.png)}body div[id$="_90_menu"]:before{background:url(static/image/common/m_arena_w6.png)}body div[id$="_98_menu"]:before{background:url(static/image/common/m_arena_w8.png)}body div[id$="_99_menu"]:before{background:url(static/image/common/m_arena_w7.png)}body div[id$="_120_menu"]:before{background:url(static/image/common/m_arena_v5.png)}body div[id$="_121_menu"]:before{background:url(static/image/common/m_arena_w9.png)}body div[id$="_122_menu"]:before{background:url(static/image/common/m_arena_w10.png)}body div[id$="_123_menu"]:before{background:url(static/image/common/m_arena_i1.png)}body div[id$="_129_menu"]:before{background:url(static/image/common/m_arena_v6.png)}body div[id$="_130_menu"]:before{background:url(static/image/common/m_arena_w11.png)}body div[id$="_131_menu"]:before{background:url(static/image/common/m_arena_w12.png)}body div[id$="_132_menu"]:before{background:url(static/image/common/m_arena_i2.png)}body div[id$="_143_menu"]:before{background:url(static/image/common/m_arena_v7.png)}body div[id$="_144_menu"]:before{background:url(static/image/common/m_arena_v7f.png)}body div[id$="_145_menu"]:before{background:url(static/image/common/m_arena_w13.png)}body div[id$="_146_menu"]:before{background:url(static/image/common/m_arena_w14.png)}body div[id$="_164_menu"]:before{background:url(static/image/common/m_arena_v8.png)}body div[id$="_165_menu"]:before{background:url(static/image/common/m_arena_w15.png)}body div[id$="_166_menu"]:before{background:url(static/image/common/m_arena_w16.png)}body div[id$="_176_menu"]:before{background:url(static/image/common/m_arena_v9.png)}body div[id$="_177_menu"]:before{background:url(static/image/common/m_arena_w17.png)}body div[id$="_178_menu"]:before{background:url(static/image/common/m_arena_w18.png)}body div[id$="_184_menu"]:before{background:url(static/image/common/m_arena_v10.png)}body div[id$="_185_menu"]:before{background:url(static/image/common/m_arena_w19.png)}body div[id$="_186_menu"]:before{background:url(static/image/common/m_arena_w20.png)}body div[id$="_204_menu"]:before{background:url(static/image/common/m_arena_v11.png)}body div[id$="_205_menu"]:before{background:url(static/image/common/m_arena_w21.png)}body div[id$="_206_menu"]:before{background:url(static/image/common/m_arena_w22.png)}body div[id$="_211_menu"]:before{background:url(static/image/common/m_arena_v12.png)}body div[id$="_212_menu"]:before{background:url(static/image/common/m_arena_w23.png)}body div[id$="_213_menu"]:before{background:url(static/image/common/m_arena_w24.png)}body div[id$="_224_menu"]:before{background:url(static/image/common/m_arena_v13.png)}body div[id$="_225_menu"]:before{background:url(static/image/common/m_arena_w25.png)}body div[id$="_226_menu"]:before{background:url(static/image/common/m_arena_w26.png)}body div[id$="_237_menu"]:before{background:url(static/image/common/m_arena14_1.png)}body div[id$="_238_menu"]:before{background:url(static/image/common/m_arena14_2.png)}body div[id$="_239_menu"]:before{background:url(static/image/common/m_arena14_3.png)}body div[id$="_136_menu"]:before{background:url(static/image/common/m_s_v1.png)}body div[id$="_167_menu"]:before{background:url(static/image/common/m_s_bili.png)}body div[id$="_174_menu"]:before{background:url(static/image/common/m_s_v2.png)}body div[id$="_195_menu"]:before{background:url(static/image/common/m_s_v3.png)}body div[id$="_218_menu"]:before{background:url(static/image/common/m_s_bili2.png)}body div[id$="_240_menu"]:before{background:url(static/image/common/m_s_v4.png)}body div[id$="_253_menu"]:before{background:url(static/image/common/m_s_wiki.png)}body div[id$="_254_menu"]:before{background:url(static/image/common/m_s_mcwiki.png)}body div[id$="_124_menu"]:before{background:url(static/image/common/m_pearena_v1.png)}body div[id$="_125_menu"]:before{background:url(static/image/common/m_pearena_w2.png)}body div[id$="_126_menu"]:before{background:url(static/image/common/m_pearena_w1.png)}body div[id$="_133_menu"]:before{background:url(static/image/common/m_pearena_v2.png)}body div[id$="_134_menu"]:before{background:url(static/image/common/m_pearena_w4.png)}body div[id$="_135_menu"]:before{background:url(static/image/common/m_pearena_w3.png)}body div[id$="_147_menu"]:before{background:url(static/image/common/m_pearena_v3.png)}body div[id$="_148_menu"]:before{background:url(static/image/common/m_pearena_w6.png)}body div[id$="_149_menu"]:before{background:url(static/image/common/m_pearena_w5.png)}body div[id$="_161_menu"]:before{background:url(static/image/common/m_pearena_v4.png)}body div[id$="_162_menu"]:before{background:url(static/image/common/m_pearena_w8.png)}body div[id$="_163_menu"]:before{background:url(static/image/common/m_pearena_w7.png)}body div[id$="_171_menu"]:before{background:url(static/image/common/m_pearena_v5.png)}body div[id$="_172_menu"]:before{background:url(static/image/common/m_pearena_w10.png)}body div[id$="_173_menu"]:before{background:url(static/image/common/m_pearena_w9.png)}body div[id$="_190_menu"]:before{background:url(static/image/common/m_pearena_w13.png)}body div[id$="_192_menu"]:before{background:url(static/image/common/m_pearena_v6.png)}body div[id$="_193_menu"]:before{background:url(static/image/common/m_pearena_w11.png)}body div[id$="_194_menu"]:before{background:url(static/image/common/m_pearena_w12.png)}body div[id$="_201_menu"]:before{background:url(static/image/common/m_pearena_v7.png)}body div[id$="_202_menu"]:before{background:url(static/image/common/m_pearena_w16.png)}body div[id$="_203_menu"]:before{background:url(static/image/common/m_pearena_w15.png)}body div[id$="_214_menu"]:before{background:url(static/image/common/m_pearena_v8.png)}body div[id$="_215_menu"]:before{background:url(static/image/common/m_pearena_w18.png)}body div[id$="_216_menu"]:before{background:url(static/image/common/m_pearena_w17.png)}body div[id$="_221_menu"]:before{background:url(static/image/common/m_pearena_v9.png)}body div[id$="_222_menu"]:before{background:url(static/image/common/m_pearena_w20.png)}body div[id$="_223_menu"]:before{background:url(static/image/common/m_pearena_w19.png)}body div[id$="_229_menu"]:before{background:url(static/image/common/m_pearena_v10.png)}body div[id$="_230_menu"]:before{background:url(static/image/common/m_pearena_w22.png)}body div[id$="_231_menu"]:before{background:url(static/image/common/m_pearena_w21.png)}body div[id$="_241_menu"]:before{background:url(static/image/common/m_pearena_v11.png)}body div[id$="_242_menu"]:before{background:url(static/image/common/m_pearena_w24.png)}body div[id$="_243_menu"]:before{background:url(static/image/common/m_pearena_w23.png)}body div[id$="_197_menu"]:before{background:url(static/image/common/m_pofg_v1.png)}body div[id$="_198_menu"]:before{background:url(static/image/common/m_pofg_v2.png)}body div[id$="_199_menu"]:before{background:url(static/image/common/m_pofg_v3.png)}body div[id$="_137_menu"]:before{background:url(static/image/common/m_g_cw.png)}body div[id$="_138_menu"]:before{background:url(static/image/common/m_g_trp.png)}body div[id$="_139_menu"]:before{background:url(static/image/common/m_g_tas.png)}body div[id$="_140_menu"]:before{background:url(static/image/common/m_g_sc.png)}body div[id$="_142_menu"]:before{background:url(static/image/common/m_g_sl.png)}body div[id$="_150_menu"]:before{background:url(static/image/common/m_g_hayo.png)}body div[id$="_151_menu"]:before{background:url(static/image/common/m_g_aa.png)}body div[id$="_153_menu"]:before{background:url(static/image/common/m_g_is.png)}body div[id$="_154_menu"]:before{background:url(static/image/common/m_g_cbl.png)}body div[id$="_168_menu"]:before{background:url(static/image/common/m_g_ntl.png)}body div[id$="_169_menu"]:before{background:url(static/image/common/m_g_tcp.png)}body div[id$="_179_menu"]:before{background:url(static/image/common/m_g_mpw.png)}body div[id$="_207_menu"]:before{background:url(static/image/common/m_g_ud.png)}body div[id$="_217_menu"]:before{background:url(static/image/common/m_g_bs.png)}body div[id$="_219_menu"]:before{background:url(static/image/common/m_g_pcd.png)}body div[id$="_220_menu"]:before{background:url(static/image/common/m_g_gwnw.png)}body div[id$="_228_menu"]:before{background:url(static/image/common/m_g_lw.png)}body div[id$="_232_menu"]:before{background:url(static/image/common/m_g_uel.png)}body div[id$="_233_menu"]:before{background:url(static/image/common/m_g_tgc.png)}body div[id$="_235_menu"]:before{background:url(static/image/common/m_g_nf.png)}body div[id$="_236_menu"]:before{background:url(static/image/common/m_g_mcbk.png)}body div[id$="_244_menu"]:before{background:url(static/image/common/m_g_pos.png)}body div[id$="_245_menu"]:before{background:url(static/image/common/m_g_stc.png)}body div[id$="_246_menu"]:before{background:url(static/image/common/m_g_cps.png)}body div[id$="_248_menu"]:before{background:url(static/image/common/m_g_wiki.png)}body div[id$="_249_menu"]:before{background:url(static/image/common/m_g_rmg.png)}body div[id$="_252_menu"]:before{background:url(static/image/common/m_g_tml.png)}@keyframes pickup{0%{-webkit-transform:matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);transform:matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)}50%{-webkit-transform:matrix3d(1, 0, 0, -0.002, 0, 1, 0, -0.002, 0, 0, 1, 0, 0, -1, 0, 0.92);transform:matrix3d(1, 0, 0, -0.002, 0, 1, 0, -0.002, 0, 0, 1, 0, 0, -1, 0, 0.92)}100%{-webkit-transform:matrix3d(1, 0, 0, 0, 0, 1, 0, -0.001, 0, 0, 1, 0, 0, -1.6, 0, 0.85);transform:matrix3d(1, 0, 0, 0, 0, 1, 0, -0.001, 0, 0, 1, 0, 0, -1.6, 0, 0.85)}}@keyframes dropdown{0%{-webkit-transform:matrix3d(1, 0, 0, 0, 0, 1, 0, -0.001, 0, 0, 1, 0, 0, -1.6, 0, 0.85);transform:matrix3d(1, 0, 0, 0, 0, 1, 0, -0.001, 0, 0, 1, 0, 0, -1.6, 0, 0.85)}50%{-webkit-transform:matrix3d(1, 0, 0, -0.001, 0, 1, 0, -0.002, 0, 0, 1, 0, 0, -1.1, 0, 0.92);transform:matrix3d(1, 0, 0, -0.001, 0, 1, 0, -0.002, 0, 0, 1, 0, 0, -1.1, 0, 0.92)}100%{-webkit-transform:matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);transform:matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)}}
`, 'medal');
window.saltMCBBSCSS.setStyle(`#threadlisttableid>tbody[classified]{--backcolor:transparent;--backcolor-t1:transparent;--backcolor-t2:transparent;--backcolor-t3:transparent;background-image:-webkit-linear-gradient(90deg, var(--backcolor) 0%, var(--backcolor-t1) .2%, var(--backcolor-t2) .5%, var(--backcolor-t3) 45%, transparent 100%);background-image:linear-gradient(90deg, var(--backcolor) 0%, var(--backcolor-t1) .2%, var(--backcolor-t2) .5%, var(--backcolor-t3) 45%, transparent 100%)}#threadlisttableid>tbody[classified].digestpost{--backcolor:#0db1f2;--backcolor-t1:rgba(13,177,242,0.8);--backcolor-t2:rgba(13,177,242,0.08);--backcolor-t3:rgba(13,177,242,0)}#threadlisttableid>tbody[classified].reward{--backcolor:#f2690d;--backcolor-t1:rgba(242,105,13,0.8);--backcolor-t2:rgba(242,105,13,0.08);--backcolor-t3:rgba(242,105,13,0)}#threadlisttableid>tbody[classified].big-reward{--backcolor:#f20d93;--backcolor-t1:rgba(242,13,147,0.8);--backcolor-t2:rgba(242,13,147,0.08);--backcolor-t3:rgba(242,13,147,0)}#threadlisttableid>tbody[classified].great-reward{--backcolor:#f20dd3;--backcolor-t1:rgba(242,13,211,0.8);--backcolor-t2:rgba(242,13,211,0.08);--backcolor-t3:rgba(242,13,211,0)}#threadlisttableid>tbody[classified].solved{--backcolor:#0df2ad;--backcolor-t1:rgba(13,242,173,0.8);--backcolor-t2:rgba(13,242,173,0.08);--backcolor-t3:rgba(13,242,173,0)}#threadlisttableid>tbody[classified].locked{--backcolor:#333;--backcolor-t1:rgba(51,51,51,0.8);--backcolor-t2:rgba(51,51,51,0.08);--backcolor-t3:rgba(51,51,51,0)}#threadlisttableid>tbody[classified].top-1{--backcolor:#0dd7f2;--backcolor-t1:rgba(13,215,242,0.8);--backcolor-t2:rgba(13,215,242,0.08);--backcolor-t3:rgba(13,215,242,0)}#threadlisttableid>tbody[classified].top-2{--backcolor:#2196f3;--backcolor-t1:rgba(33,150,243,0.8);--backcolor-t2:rgba(33,150,243,0.08);--backcolor-t3:rgba(33,150,243,0)}#threadlisttableid>tbody[classified].top-3{--backcolor:#f28f0d;--backcolor-t1:rgba(242,143,13,0.8);--backcolor-t2:rgba(242,143,13,0.08);--backcolor-t3:rgba(242,143,13,0)}#threadlisttableid>tbody[classified].punitive-publicity{--backcolor:crimson;--backcolor-t1:rgba(220,20,60,0.8);--backcolor-t2:rgba(220,20,60,0.08);--backcolor-t3:rgba(220,20,60,0)}
`, 'threadClassify');
if (autorun) {
this.log('运行saltMCBBS主过程');
let ev = new CustomEvent('saltMCBBSload', { detail: { name: 'saltMCBBS', version: myversion } });
this.init();
this.version();
this.history();
window.saltMCBBSCSS.putStyle('', 'main');
let isNight = this.readWithDefault('isNightStyle', false);
this.nightStyle(isNight, false);
this.docReady(() => {
this.movePageHead();
this.warnOP();
this.reasonListOP();
this.medalOP();
this.bugFixOP();
this.animationOP();
this.confiectFixOP();
this.antiSniff();
this.reportRememberOP();
this.lazyLoadImgOP();
this.imgProxyOP();
this.threadClassifyOP();
this.antiWater();
autoRunLock = false;
this.sortSetting();
window.dispatchEvent(ev);
});
}
}
init() {
let obj = this;
let sp = this.settingPanel;
sp.id = techprefix + 'settingPanel';
sp.className = 'settingPanel';
let settingPanelTitle = document.createElement('div');
settingPanelTitle.innerHTML = `<h3 class="flb" style="width:100%;margin-left:-8px;padding-right:0;"><em>SaltMCBBS ${myversion} 设置面板</em>
<span style="float:right">
<a class="sslct_btn" onclick="extstyle('./template/mcbbs/style/winter')" title="冬季"><i style="background:#4d82ff"></i></a>
<a class="sslct_btn" onclick="extstyle('./template/mcbbs/style/default')" title="经典"><i style="background:#70ba5e"></i></a>
<a class="sslct_btn" onclick="extstyle('./template/mcbbs/style/nether')" title="下界"><i style="background:#ae210f"></i></a>
<a href="https://github.com/Salt-lovely/saltMCBBS/releases" target="_blank" title="前往GitHub下载最新版">下载最新版SaltMCBBS</a>
<a href="javascript:;" class="flbc" onclick="saltMCBBS.hideSettingPanel()" title="关闭">关闭</a>
</span></h3>`;
this.addSetting(settingPanelTitle, techprefix + 'settingPanelTitle');
this.hideSettingPanel();
document.body.prepend(sp);
this.addTextareaSetting('昼间模式下的背景图片 <small>一行一个, 填写超链接(URL),随机选择,开头添加“//”暂时禁用这个图片</small>', this.readWithDefault('dayBackgroundImage', []).join('\n'), (el) => {
obj.write('dayBackgroundImage', obj.formatToStringArray(el.value));
obj.updateBackground();
}, '昼间模式下的背景图片', 210);
this.addTextareaSetting('夜间模式下的背景图片 <small>一行一个, 填写超链接(URL),随机选择,开头添加“//”暂时禁用这个图片</small>', this.readWithDefault('nightBackgroundImage', []).join('\n'), (el) => {
obj.write('nightBackgroundImage', obj.formatToStringArray(el.value));
obj.updateBackground();
}, '夜间模式下的背景图片', 211);
let opacity = this.readWithDefault('mcmapwpOpacity', 0.5);
document.body.style.setProperty('--mcmapwpOpacity', opacity + '');
this.addRangeSetting('主体部分的透明度<small> 仅在有背景图片时启用, 当前不透明度: ' + opacity + '</small>', opacity, [0, 1, 0.05], (vl, ev) => {
this.write('mcmapwpOpacity', vl);
this.changeSettingH3('主体部分的透明度', '主体部分的透明度<small> 仅在有背景图片时启用, 当前不透明度: ' + vl + '</small>');
document.body.style.setProperty('--mcmapwpOpacity', vl + '');
}, '主体部分的透明度', 212);
this.updateBackground();
let enableAntiWater = this.readWithDefault('SaltAntiWater', false);
this.addCheckSetting('水帖检测机制<br><small>只会检测页面中的漏网水帖</small>', enableAntiWater, (ck, ev) => {
this.write('SaltAntiWater', ck);
this.message('"水帖检测机制"配置项需要刷新生效<br>点击刷新', () => { location.reload(); }, 3);
}, '水帖检测机制', 41);
if (enableAntiWater) {
this.antiWater();
}
}
movePageHead() {
this.assert(autoRunLock, '不在页面初始运行状态');
let obj = this;
let leftdiv = document.createElement('div');
leftdiv.id = 'saltNewPageHead';
let userinfo = document.createElement('div');
let links = this.links;
let addons = document.createElement('div');
let headlinks = document.querySelectorAll('#toptb .z a');
this.addChildren(links, headlinks);
this.addSideBarLink('SaltMCBBS 设置', () => { window.saltMCBBS.showSettingPanel(); });
links.className = 'links';
let myaddon = [
{ text: '签到', url: 'plugin.php?id=dc_signin', img: 'https://patchwiki.biligame.com/images/mc/3/3f/23qf12ycegf4vgfbj7gehffrur6snkv.png' },
{ text: '任务', url: 'home.php?mod=task', img: 'https://patchwiki.biligame.com/images/mc/9/98/kbezikk5l83s2l2ewht1mhr8fltn0dv.png' },
{ text: '消息', url: 'home.php?mod=space&do=notice&view=mypost', class: 'saltmessage', img: noticimgurl[0] },
{ text: '好友', url: 'home.php?mod=space&do=friend', img: 'https://www.mcbbs.net/template/mcbbs/image/friends.png' },
{ text: '勋章', url: 'home.php?mod=medal', img: 'https://patchwiki.biligame.com/images/mc/2/26/85hl535hwws6snk4dt430lh3k7nyknr.png' },
{ text: '道具', url: 'home.php?mod=magic', img: 'https://www.mcbbs.net/template/mcbbs/image/tools.png' },
{ text: '收藏', url: 'home.php?mod=space&do=favorite&view=me', img: 'https://patchwiki.biligame.com/images/mc/d/dd/hnrqjfj0x2wl46284js23m26fgl3q8l.png' },
{ text: '挖矿', url: 'plugin.php?id=mcbbs_lucky_card:prize_pool', img: 'https://www.mcbbs.net/source/plugin/mcbbs_lucky_card/magic/magic_lucky_card.gif' },
{ text: '宣传', url: 'plugin.php?id=mcbbs_ad:ad_manage', img: 'https://patchwiki.biligame.com/images/mc/4/43/pfmuw066q7ugi0wv4eyfjbeu3sxd3a4.png' },
{ text: '设置', url: 'home.php?mod=spacecp', title: 'SaltMCBBS设置在下面', img: 'https://patchwiki.biligame.com/images/mc/9/90/dr8rvwsbxfgr79liq91icuxkj6nprve.png' },
];
this.addChildren(addons, this.obj2a(myaddon));
addons.className = 'addons';
this.movePageHeadGetUserInfo(userinfo);
userinfo.className = 'userinfo';
leftdiv.appendChild(userinfo);
let searchbox = document.querySelector('.cl.y_search');
if (searchbox instanceof HTMLElement) {
leftdiv.appendChild(searchbox);
}
let searchtype = document.querySelector('#scbar_type_menu');
if (searchtype instanceof HTMLElement) {
leftdiv.appendChild(searchtype);
if (searchbox instanceof HTMLElement) {
searchtype.style.setProperty('--top', Math.floor(Math.max(searchbox.offsetTop, 200) + 25) + 'px');
}
}
leftdiv.appendChild(addons);
leftdiv.appendChild(links);
leftdiv.addEventListener('dblclick', () => { obj.toggleNightStyle(); });
document.body.appendChild(leftdiv);
window.saltMCBBSCSS.putStyle('', 'pagehead');
}
movePageHeadGetUserInfo(el) {
let uid = this.getUID();
if (uid < 1) {
return;
}
this.fetchUID(uid, (data) => {
let variable = data.Variables;
let space = variable.space;
let creaitex = variable.extcredits;
this.messageOp(variable.notice);
let credits = space.credits;
let post = space.posts;
let thread = space.threads;
let digestpost = space.digestposts;
let extcredits = [
'0',
space.extcredits1,
space.extcredits2,
space.extcredits3,
space.extcredits4,
space.extcredits5,
space.extcredits6,
space.extcredits7,
space.extcredits8,
];
let uid = space.uid;
let uname = space.username || '';
let group = space.group;
let lowc = parseInt(group.creditslower), highc = parseInt(group.creditshigher);
let grouptitle = space.group.grouptitle || '';
let progress = Math.round((parseInt(credits) - highc) / (lowc - highc) * 10000) / 100;
let progresstitle = highc + ' -> ' + lowc + ' | 还需: ' + (lowc - parseInt(credits)) + ' | 进度: ' + progress + '%';
el.innerHTML = `
<div class="username">
<a href="https://www.mcbbs.net/?${uid}">${uname}</a>
<div>${space.customstatus}</div>
<img id="settingsaltMCBBS" src="https://www.mcbbs.net/uc_server/avatar.php?uid=${uid}&size=middle" height=100 />
</div>
<div class="thread">
<a href="https://www.mcbbs.net/forum.php?mod=guide&view=my&type=reply" target="_blank">回帖数: ${post}</a>
<a href="https://www.mcbbs.net/forum.php?mod=guide&view=my" target="_blank">主题数: ${thread}</a>
<span>精华帖: ${digestpost}</span>
</div>
<span class="progress" tooltip="${progresstitle}"><span style="width:${progress}%"> </span></span>
<div class="credit">
<span><a href="https://www.mcbbs.net/home.php?mod=spacecp&ac=credit" target="_self">总积分: ${credits}</a></span>
<span><a href="https://www.mcbbs.net/home.php?mod=spacecp&ac=usergroup" target="_self">${grouptitle}</a></span>
<span>${creaitex[1].img}${creaitex[1].title}: ${extcredits[1] + creaitex[1].unit}</span>
<span>${creaitex[2].img}${creaitex[2].title}: ${extcredits[2] + creaitex[2].unit}</span>
<span>${creaitex[3].img}${creaitex[3].title}: ${extcredits[3] + creaitex[3].unit}</span>
<span>${creaitex[4].img}${creaitex[4].title}: ${extcredits[4] + creaitex[4].unit}</span>
<span>${creaitex[5].img}${creaitex[5].title}: ${extcredits[5] + creaitex[5].unit}</span>
<span>${creaitex[6].img}${creaitex[6].title}: ${extcredits[6] + creaitex[6].unit}</span>
<span>${creaitex[7].img}${creaitex[7].title}: ${extcredits[7] + creaitex[7].unit}</span>
<span>${creaitex[8].img}${creaitex[8].title}: ${extcredits[8] + creaitex[8].unit}</span>
</div>
`;
});
}
messageOp(notice) {
let xx = document.querySelector('#saltNewPageHead .addons a.saltmessage');
if (!xx) {
return;
}
let msg = [
parseInt(notice.newmypost),
parseInt(notice.newpm),
parseInt(notice.newprompt),
parseInt(notice.newpush),
], sum = 0;
for (var i in msg) {
sum += msg[i];
}
if (sum > 6) {
sum = 6;
}
if (sum > 0) {
xx.setAttribute('title', `新回复: ${msg[0]} | 新私信: ${msg[1]} | 新通知: ${msg[2]} | 新推送: ${msg[3]}`);
}
let img = document.querySelector('#saltNewPageHead .addons a.saltmessage img');
if (img) {
img.setAttribute('src', noticimgurl[sum]);
}
}
warnOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
this.saltQuery('#postlist .plhin:not([warnOP])', (i, el) => {
var _a;
if (el.querySelector('.plc .pi a[title*="受到警告"]')) {
if (el.parentElement) {
el.parentElement.classList.add('warned');
}
else {
el.classList.add('warned');
}
}
else {
for (let td of Array.from(el.querySelectorAll('.rate td.xg1,.rate td.xw1'))) {
if (((_a = td.textContent) === null || _a === void 0 ? void 0 : _a.indexOf('人气 -')) == 0
|| td.textContent == '-10' || td.textContent == '-15' || td.textContent == '-20') {
if (el.parentElement) {
el.parentElement.classList.add('warned');
}
else {
el.classList.add('warned');
}
}
}
}
let uid = '0';
let uname = el.querySelector('.authi .xw1');
if (uname) {
uid = (/uid=(\d+)/.exec(uname.getAttribute('href') || '') || ['', '0'])[1];
}
if (uid != '0') {
let a = el.querySelector('.favatar ul.xl');
if (!a) {
a = document.createElement('ul');
a.className = 'xl xl2 o cl';
let f = el.querySelector('.pls.favatar');
if (f) {
f.appendChild(a);
}
}
let li = document.createElement('li');
li.className = 'pmwarn';
li.appendChild(addWarnBtn(uid));
a.appendChild(li);
}
el.setAttribute('warnOP', '');
});
this.saltQuery('#uhd:not([warnOP])', (i, el) => {
let uid = window.discuz_uid;
let uname = el.querySelector('.h .avt a');
if (uname) {
console.log(uname);
uid = (/uid=(\d+)/.exec(uname.getAttribute('href') || '') || ['', '0'])[1];
}
let a = el.querySelector('.mn ul');
let li = document.createElement('li');
li.className = 'pmwarn';
li.appendChild(addWarnBtn(uid));
if (a) {
a.appendChild(li);
}
else {
let div = document.createElement('div');
div.className = 'mn';
let ul = document.createElement('ul');
ul.appendChild(li);
div.appendChild(ul);
el.prepend(div);
}
el.setAttribute('warnOP', '');
});
function addWarnBtn(uid, text = '查看警告记录') {
let a = document.createElement('a');
a.href = 'forum.php?mod=misc&action=viewwarning&tid=19&uid=' + uid;
a.title = text;
a.textContent = text;
a.className = 'xi2';
a.setAttribute('onclick', 'showWindow(\'viewwarning\', this.href)');
return a;
}
}
reasonListOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
this.saltObserver('append_parent', () => {
let rateUl = document.querySelector('.reasonselect:not([done])');
if (rateUl) {
let rateReasonList = this.cleanStringArray(this.readWithDefault('rateReasonList', []));
rateUl.setAttribute('done', '');
for (let rea of rateReasonList) {
let li = document.createElement('li');
li.textContent = rea;
li.onmouseover = function () { li.className = 'xi2 cur1'; };
li.onmouseout = function () { li.className = ''; };
li.onclick = function () {
let r = document.getElementById('reason');
if (r instanceof HTMLInputElement) {
r.value = li.textContent || '';
}
};
rateUl.appendChild(li);
}
}
let reportUl = document.querySelector('#report_reasons:not([done])');
if (reportUl) {
let reportReasonList = this.cleanStringArray(this.readWithDefault('reportReasonList', []));
reportUl.setAttribute('done', '');
let qita = reportUl.querySelector('input[value="其他"]');
let qitaP = null;
let qitabr = null;
if (qita) {
qitaP = qita.parentElement;
if (qitaP) {
qitabr = qitaP.nextElementSibling;
}
}
for (let rea of reportReasonList) {
let br = document.createElement('br');
let label = document.createElement('label');
label.innerHTML = `<input type="radio" name="report_select" class="pr" onclick="$('report_other').style.display='none';$('report_msg').style.display='none';$('report_message').value='${rea}'" value="${rea}">${rea}`;
reportUl.appendChild(label);
reportUl.appendChild(br);
}
if (qitaP) {
reportUl.appendChild(qitaP);
}
if (qitabr) {
reportUl.appendChild(qitabr);
}
}
});
let rateReasonList = this.readWithDefault('rateReasonList', []);
this.addTextareaSetting('自定义评分理由<small> 评分时可供选择的理由,一行一个,开头添加“//”暂时禁用</small>', rateReasonList.join('\n'), (el, e) => {
this.write('rateReasonList', this.formatToStringArray(el.value));
}, '自定义评分理由', 101);
let reportReasonList = this.readWithDefault('reportReasonList', []);
this.addTextareaSetting('自定义举报理由<small> 举报时可供选择的理由,一行一个,开头添加“//”暂时禁用</small>', reportReasonList.join('\n'), (el, e) => {
this.write('reportReasonList', this.formatToStringArray(el.value));
}, '自定义举报理由', 102);
}
bugFixOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
window.saltMCBBSCSS.putStyle(`#threadlist table{border-collapse:collapse}#threadlist table td,#threadlist table th{border-bottom:0px;}#threadlist table tr{border-bottom:1px solid #CFB78E;}`, 'threadListBugFix');
}
medalOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
let obj = this;
let enable = this.readWithDefault('saltMedalFunction', true);
let blur = this.readWithDefault('saltMedalBlur', true);
window.saltMCBBSCSS.setStyle('div.tip[id$="_menu"]:before{image-rendering:auto;filter:blur(3px)}', 'saltMedalBlurCSS');
this.addCheckSetting('启用勋章栏功能<br><small> 特别的勋章样式(会被MCBBS Extender覆盖)</small>', enable, (ck, ev) => {
this.write('saltMedalFunction', ck);
enable = ck;
if (enable) {
window.saltMCBBSCSS.putStyle('', 'medal');
setTimeout(sub, 500);
}
else {
window.saltMCBBSCSS.delStyle('medal');
}
}, '启用勋章栏功能', 50);
this.addCheckSetting('勋章大图高斯模糊<br><small>不再使用默认的等比放大</small>', blur, (ck, ev) => {
this.write('saltMedalBlur', ck);
if (ck) {
window.saltMCBBSCSS.putStyle('', 'saltMedalBlurCSS');
}
else {
window.saltMCBBSCSS.delStyle('saltMedalBlurCSS');
}
}, '勋章大图高斯模糊', 51);
this.addInputSetting('勋章栏高度<br><small> 64像素/行, 可以输入小数(会被MCBBS Extender覆盖)</small>', this.readWithDefault('medalLine', 3) + '', (el, e) => {
let line = parseFloat(el.value);
if (isNaN(line)) {
return;
}
if (line < 0.5) {
line = 0.5;
}
if (line > 25) {
line = 25;
}
this.write('medalLine', line);
if (enable) {
sub();
}
else {
this.message('使用勋章栏高度控制功能前,需要先启用勋章栏功能', (f) => { f(); }, 3);
}
}, '勋章栏高度', 52);
if (enable) {
window.saltMCBBSCSS.putStyle('', 'medal');
sub();
}
if (blur) {
window.saltMCBBSCSS.putStyle('', 'saltMedalBlurCSS');
}
this.saltObserver('postlist', () => {
if (document.querySelector('p.md_ctrl:not([saltMedalFunction-checked])')) {
sub();
}
});
function sub() {
return __awaiter(this, void 0, void 0, function* () {
let line = obj.readWithDefault('medalLine', 2.5);
let style = 'p.md_ctrl,p.md_ctrl:hover{--maxHeight:calc(64px * ' + line + ');}';
window.saltMCBBSCSS.putStyle(style, 'medalLine');
addBtn();
heightCheck();
setTimeout(() => {
addBtn();
heightCheck();
}, 500);
function heightCheck() {
obj.saltQuery('p.md_ctrl', (i, el) => {
if (!(el instanceof HTMLElement)) {
return;
}
if (el.scrollHeight > el.offsetHeight + 3) {
el.addClass('expandable');
}
else {
el.removeClass('expandable');
}
});
}
function addBtn() {
obj.saltQuery('p.md_ctrl:not([saltMedalFunction-checked])', (i, el) => {
if (!(el instanceof HTMLElement)) {
return;
}
el.setAttribute('saltMedalFunction-checked', '');
let img = el.querySelectorAll('a img');
if (img.length < 1) {
return;
}
let a = el.querySelector('a');
if (!a) {
return;
}
el.style.setProperty('--expandHeight', (a.offsetHeight + 96) + 'px');
let div = document.createElement('div');
div.addClass('saltExpandHandler');
div.addEventListener('click', () => {
el.toggleClass('salt-expand');
});
el.appendChild(div);
});
}
});
}
}
antiSniff() {
let enable = this.readWithDefault('saltAntiSniff', true), tellme = this.readWithDefault('saltAntiSniffRecat', true);
let obj = this;
this.addCheckSetting('反嗅探措施<br><small>屏蔽一些坛友的部分探针</small>', enable, (ck, ev) => {
this.write('saltAntiSniff', ck);
if (ck)
sub();
}, '反嗅探措施', 31);
this.addCheckSetting('处理探针后是否通知<br><small>右下角的提示可能会有点烦人</small>', tellme, (ck, ev) => {
this.write('saltAntiSniffRecat', ck);
tellme = ck;
}, '处理探针后是否通知', 32);
if (enable)
sub();
function sub() {
return __awaiter(this, void 0, void 0, function* () {
obj.saltQuery('img:not([saltAntiSniff-check-done])', (i, el) => {
if (el instanceof HTMLImageElement) {
el.setAttribute('saltAntiSniff-check-done', '');
if (el.hasAttribute('src')) {
if (el.src.indexOf('home.php?') != -1 &&
!/\&additional\=removevlog(\&|$)/.test(el.src)) {
if (tellme)
obj.message('侦测到<img>探针: <br>' + el.src + '<br>类型: Discuz!访客探针', (f) => { f(); });
console.log(el);
el.src += '&additional=removevlog';
}
}
if (el.hasAttribute('file')) {
if ((el.getAttribute('file') || '').indexOf('home.php?') != -1 &&
!/\&additional\=removevlog(\&|$)/.test((el.getAttribute('file') || ''))) {
if (tellme)
obj.message('侦测到<img>探针: <br>' + (el.getAttribute('file') || '') + '<br>类型: Discuz!访客探针', (f) => { f(); });
console.log(el);
el.setAttribute('file', (el.getAttribute('file') || '') + '&additional=removevlog');
}
}
}
});
obj.saltQuery('a.notabs:not([saltAntiSniff-check-done])', (i, el) => {
if (el instanceof HTMLAnchorElement && el.hasAttribute('href')) {
el.setAttribute('saltAntiSniff-check-done', '');
el.addEventListener('mouseout', () => {
obj.log('已处理访客探针: ' + el.href);
fetch(el.href + '&view=admin&additional=removevlog');
});
}
});
});
}
}
reportRememberOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
let obj = this;
let saveKey = 'saltReportRemember';
let numSaveKey = 'saltReportRememberLength';
main();
function main() {
if (obj.getUID() < 1) {
obj.message('未检测到UID<br>点击重试', (f) => {
f();
main();
});
return;
}
saveKey += '-' + obj.getUID();
check();
obj.addInputSetting('帖子举报历史记录长度<br><small>建议在4w以内, 设为 0 关闭此功能</small>', '' + obj.readWithDefault(numSaveKey, 1024), (el, ev) => {
let len = parseInt(el.value);
if (isNaN(len)) {
return;
}
if (len < 0) {
len = 0;
}
if (len > 1048576) {
len = 1048576;
}
obj.write(numSaveKey, len);
}, '举报记录功能', 61);
let obs = obj.saltObserver('append_parent', () => {
let reportBtn = document.querySelector('#report_submit[fwin]:not([done])');
if (reportBtn) {
reportBtn.setAttribute('done', '');
let pid = ((reportBtn.getAttribute('fwin') || '0').match(/\d+/) || ['0'])[0];
if (pid != '0') {
reportBtn.addEventListener('click', () => {
obj.log('检测到举报: pid-' + pid);
push(pid);
check();
});
}
}
});
}
function push(pid) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof pid == 'string') {
pid = parseInt(pid);
if (isNaN(pid) || pid < 1) {
return;
}
}
else if (typeof pid == 'number') {
if (pid < 1) {
return;
}
}
else if (typeof pid == 'bigint') {
if (pid < 1) {
return;
}
}
let pidList = obj.readWithDefault(saveKey, []);
pidList.push(pid);
obj.write(saveKey, pidList);
obj.log('已记录举报: pid-' + pid);
});
}
function remove(pid) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof pid == 'string') {
pid = parseInt(pid);
if (isNaN(pid) || pid < 1) {
return;
}
}
else if (typeof pid == 'number') {
if (pid < 1) {
return;
}
}
else if (typeof pid == 'bigint') {
if (pid < 1) {
return;
}
}
let pidList = obj.readWithDefault(saveKey, []);
let inedx = pidList.indexOf(pid);
if (inedx != -1) {
pidList.splice(inedx, 1);
}
check();
});
}
function check() {
return __awaiter(this, void 0, void 0, function* () {
let pidList = cut(obj.readWithDefault(saveKey, []), obj.readWithDefault(numSaveKey, 1024));
for (let div of Array.from(document.querySelectorAll('#postlist > div.reported'))) {
if (!(div instanceof HTMLElement)) {
continue;
}
let pid = parseInt(((div.getAttribute('id') || '0').match(/\d+/) || ['0'])[0]);
if (pidList.indexOf(pid) == -1) {
div.removeClass('reported');
}
}
for (let div of Array.from(document.querySelectorAll('#postlist > div:not(.reported)'))) {
if (!(div instanceof HTMLElement)) {
continue;
}
let pid = parseInt(((div.getAttribute('id') || '0').match(/\d+/) || ['0'])[0]);
if (pidList.indexOf(pid) != -1) {
div.addClass('reported');
}
}
});
}
function cut(list, len) {
let newlist = list;
let diff = newlist.length - len;
if (diff < 1) {
return newlist;
}
newlist = newlist.slice(diff);
return newlist;
}
}
lazyLoadImgOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
let enable = this.readWithDefault('lazyLoadImgEnable', true), obj = this;
this.addCheckSetting('另一种图片懒加载<br><small>一种更友好的图片懒加载方式</small>', enable, (ck, ev) => {
obj.write('lazyLoadImgEnable', ck);
obj.message('图片懒加载模式切换需要刷新生效', (f) => { f(); }, 3);
}, '另一种图片懒加载', 45);
if (!enable) {
return;
}
let imgs;
if (window.lazyload) {
imgs = HTMLImgFliter(window.lazyload.imgs || []);
window.lazyload.imgs = [];
}
else {
imgs = HTMLImgFliter([
...Array.from(document.querySelectorAll('.t_fsz .t_f img:not([src]):not([lazyloaded])')),
...Array.from(document.querySelectorAll('.t_fsz .t_f img[src*="static/image/common/none.gif"]:not([lazyloaded])')),
...Array.from(document.querySelectorAll('.t_fsz .pattl img[src*="static/image/common/none.gif"]:not([lazyloaded])')),
]);
}
let obs = new IntersectionObserver((entries) => {
let img = entries[0].target;
obs.unobserve(img);
if (!(img instanceof HTMLImageElement)) {
return;
}
img.setAttribute('src', img.getAttribute('file') || '');
img.setAttribute('alt', '图片加载中, 请稍作等待......');
obj.log('加载图片: ' + (img.getAttribute('file') || ''));
setTimeout(() => {
if (!(img.hasAttribute('loaded')) && img.hasAttribute('lazyloadthumb')) {
window.thumbImg(img);
}
}, 500);
setTimeout(() => {
if (!(img.hasAttribute('loaded')) && img.hasAttribute('lazyloadthumb')) {
window.thumbImg(img);
}
}, 1500);
setTimeout(() => {
if (!(img.hasAttribute('loaded')) && img.hasAttribute('lazyloadthumb')) {
window.thumbImg(img);
}
}, 5000);
setTimeout(() => {
if (!(img.hasAttribute('loaded')) && img.hasAttribute('lazyloadthumb')) {
window.thumbImg(img);
}
}, 10000);
});
for (let img of imgs) {
img.setAttribute('lazyloaded', 'true');
img.src = '';
img.style.maxHeight = '750px';
img.addEventListener('load', () => {
img.setAttribute('loaded', '');
if (img.hasAttribute('lazyloadthumb')) {
window.thumbImg(img);
}
});
img.addEventListener('error', () => {
if (img.hasAttribute('waitRetry'))
img.alt = '加载失败, 点击重试或等待自动重载......';
img.setAttribute('waitRetry', '');
});
img.addEventListener('click', () => {
if (!(img.hasAttribute('loaded')) && img.hasAttribute('waitRetry')) {
img.alt = '图片重新加载中......';
img.removeAttribute('waitRetry');
img.numAttribute('retry').add(1);
img.src = img.getAttribute('file') || img.getAttribute('src') || '';
}
});
obs.observe(img);
obj.log('劫持图片: ' + (img.getAttribute('file') || ''));
}
function HTMLImgFliter(elems) {
let imgs = [];
for (let el of elems)
if (el instanceof HTMLImageElement)
imgs.push(el);
return imgs;
}
}
imgProxyOP() {
let enableProxy = this.readWithDefault('LoadImgProxyEnable', true), enableAntiASL = this.readWithDefault('antiAntiStealingLinkEnable', true), obj = this, cssSelector = window.location.href.indexOf('action=printable') == -1 ? '.t_fsz .t_f img, .img img' : 'body > img, body > * > img';
this.addCheckSetting('启用代理加载图片<br><small>访问imgur等现在访问困难的图床</small>', enableProxy, (ck, ev) => {
enableProxy = ck;
obj.write('LoadImgProxyEnable', ck);
obj.message('代理加载配置需要刷新页面生效', (f) => { f(); }, 3);
}, '启用代理加载图片', 47);
this.addCheckSetting('启用反反盗链功能<br><small>访问微博、贴吧等后来启用反盗链的图床</small>', enableProxy, (ck, ev) => {
enableAntiASL = ck;
obj.write('antiAntiStealingLinkEnable', ck);
obj.message('反反盗链配置需要刷新页面生效', (f) => { f(); }, 3);
}, '启用反反盗链功能', 46);
function handler() {
obj.saltQuery(cssSelector, (i, img) => {
if (img instanceof HTMLImageElement) {
if (enableProxy) {
addProxy(img);
}
if (enableAntiASL) {
antiAntiStealingLink(img);
}
}
});
}
handler();
obj.saltObserver('ct', handler);
function addProxy(img) {
if (img.hasAttribute('proxyed')) {
return;
}
let src = '', attr = 'src';
let proxy = obj.randomChoice([
'https://saltproxy.saltlovely.workers.dev/',
'https://public-cdrl-proxy.moushu.workers.dev/',
]);
let needProxyWebSite = ['imgur.com/', 'i.loli.net/'];
src = img.getAttribute(attr) || '';
if (src.indexOf('static/image/common/none.gif') != -1 || src.length < 4) {
attr = 'file';
src = img.getAttribute(attr) || '';
}
for (let s of needProxyWebSite) {
if (src.indexOf(s) != -1) {
obj.log('检查到需要代理的图床: ' + s + '\n - 链接: ' + src);
src = proxy + src;
img.setAttribute(attr, src);
img.setAttribute('proxyed', '');
return;
}
}
}
function antiAntiStealingLink(img) {
if (img.hasAttribute('referrerpolicy')) {
return;
}
let src = img.src;
let antiStealingLinkWebSite = ['sinaimg.cn', 'tiebapic.baidu.com', 'qpic.cn'];
for (let s of antiStealingLinkWebSite) {
if (src.indexOf(s) != -1) {
img.setAttribute('referrerpolicy', 'no-referrer');
obj.log('检查到需要反反盗链的图床: ' + s + '\n - 链接: ' + src);
}
}
}
}
threadClassifyOP() {
let enable = this.readWithDefault('threadClassifyEnable', true), obj = this;
this.addCheckSetting('帖子分类高亮<br><small>按照帖子的类型进行高亮</small>', enable, (ck, ev) => {
obj.write('threadClassifyEnable', ck);
enable = ck;
if (enable) {
fullCheck();
window.saltMCBBSCSS.putStyle('', 'threadClassify');
}
else {
disable();
window.saltMCBBSCSS.delStyle('threadClassify');
}
}, '帖子分类高亮', 43);
if (enable) {
fullCheck();
window.saltMCBBSCSS.putStyle('', 'threadClassify');
}
let threadlisttableid = document.querySelector('#threadlisttableid');
if (threadlisttableid) {
this.saltObserver(threadlisttableid, () => {
if (enable) {
fullCheck();
}
});
}
function fullCheck() {
return __awaiter(this, void 0, void 0, function* () {
obj.saltQuery('#threadlisttableid > tbody:not([classified])', (i, el) => {
var _a, _b, _c, _d, _e;
if (!(el instanceof HTMLElement)) {
return;
}
el.setAttribute('classified', '');
el.setAttribute('type', ((_a = el.querySelector('th > em a')) === null || _a === void 0 ? void 0 : _a.textContent) || '');
el.setAttribute('author', (((_b = el.querySelector('.by cite')) === null || _b === void 0 ? void 0 : _b.textContent) || '').replace(/^\s|\s$/g, ''));
let title = ((_c = el.querySelector('.icn a')) === null || _c === void 0 ? void 0 : _c.getAttribute('title')) || '';
let thread = ((_d = el.querySelector('th a.s.xst')) === null || _d === void 0 ? void 0 : _d.textContent) || '';
if (title.indexOf('全局置顶') != -1) {
el.addClass('top-3');
}
else if (title.indexOf('分类置顶') != -1) {
el.addClass('top-2');
}
else if (title.indexOf('本版置顶') != -1) {
el.addClass('top-1');
}
if (title.indexOf('辩论') != -1) {
el.addClass('debate');
}
if (el.querySelector('img[alt="新人帖"]')) {
el.addClass('newbie');
}
if (title.indexOf('悬赏') != -1) {
el.addClass('reward');
let pirce = parseInt(((((_e = el.querySelector('a[title="只看进行中的"]')) === null || _e === void 0 ? void 0 : _e.textContent) || '').match(/\d+/) || ['30'])[0]);
if (pirce >= 100) {
el.addClass('big-reward');
}
if (pirce >= 500) {
el.addClass('great-reward');
}
}
if (el.querySelector('th a[title="只看已解决的"]')) {
el.addClass('solved');
}
if (title.indexOf('关闭的主题') != -1) {
el.addClass('locked');
}
if (el.querySelector('th img[src$="hot_3.gif"]')) {
el.addClass('hot-3');
}
if (el.querySelector('th img[src$="hot_2.gif"]')) {
el.addClass('hot-2');
}
if (el.querySelector('th img[src$="hot_1.gif"]')) {
el.addClass('hot-1');
}
if (el.querySelector('th img[src$="recommend_3.gif"]')) {
el.addClass('rec-3');
}
if (el.querySelector('th img[src$="recommend_2.gif"]')) {
el.addClass('rec-2');
}
if (el.querySelector('th img[src$="recommend_1.gif"]')) {
el.addClass('rec-1');
}
if (el.querySelector('th img[alt="推荐"]')) {
el.addClass('recommend');
}
if (el.querySelector('th img[alt="版主推荐"]')) {
el.addClass('moderator-recommend');
}
if (el.querySelector('th img[alt="优秀"]')) {
el.addClass('excellent');
}
if (el.querySelector('th img[alt="digest"]')) {
el.addClass('digestpost');
}
if (el.querySelector('th img[alt="attach_img"]')) {
el.addClass('pic');
}
if (el.querySelector('th img[alt="attachment"]')) {
el.addClass('file');
}
if (el.querySelector('th img[alt="agree"]')) {
el.addClass('good');
}
if (el.querySelector('th img[alt="disagree"]')) {
el.addClass('bad');
}
if (/[\[【]\s?.*晒尸\s?[】\]]|^(剽窃|转账)晒尸/.test(thread)) {
el.addClass('punitive-publicity');
}
});
});
}
function disable() {
return __awaiter(this, void 0, void 0, function* () {
obj.saltQuery('#threadlisttableid > tbody[classified]', (i, el) => {
if (!(el instanceof HTMLElement)) {
return;
}
el.removeAttribute('classified');
el.removeAttribute('type');
el.removeAttribute('author');
el.removeClass('top-1 top-2 top-3 debate newbie reward big-reward great-reward solved locked hot-1 hot-2 hot-3 rec-1 rec-2 rec-3 recommend moderator-recommend excellent digestpost file pic good bad punitive-publicity');
});
});
}
}
animationOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
window.saltMCBBSCSS.setStyle(`
.plhin td.pls{
overflow:visible;
}
.plhin td.pls > div.favatar{
position:sticky;top:0;
}
div.tip[id^="g_up"] {
left: 20px !important;
top: 160px !important;
}`, 'userInfoSticky');
userInfoSticky(this.readWithDefault('userInfoSticky', true));
this.addCheckSetting('层主信息栏跟随页面<br><small>帖子页面左侧层主信息跟随页面滚动</small>', this.readWithDefault('userInfoSticky', true), (ck, ev) => {
this.write('userInfoSticky', ck);
userInfoSticky(ck);
}, '左侧用户信息跟随', 22);
function userInfoSticky(b) {
if (b) {
window.saltMCBBSCSS.putStyle('', 'userInfoSticky');
}
else {
window.saltMCBBSCSS.delStyle('userInfoSticky');
}
}
window.saltMCBBSCSS.setStyle(`#scrolltop {
visibility: visible !important;
overflow: hidden;
width: 100px;
margin-left: -1px;
opacity: 1;
transition: 0.3s ease;
}
#scrolltop:not([style]) {
display: none;
}
#scrolltop[style*="hidden"] {
opacity: 0 !important;
pointer-events: none;
}
#scrolltop[style*="hidden"] .scrolltopa {
margin-left: -40px;
}`, 'scrollTopAnime');
scrollTopAnime(this.readWithDefault('scrollTopAnime', true));
this.addCheckSetting('回到顶部按钮动画<br><small>兼容MCBBS Extender</small>', this.readWithDefault('scrollTopAnime', true), (ck, ev) => {
this.write('scrollTopAnime', ck);
scrollTopAnime(ck);
}, '回到顶部按钮动画', 23);
function scrollTopAnime(b) {
if (b) {
window.saltMCBBSCSS.putStyle('', 'scrollTopAnime');
}
else {
window.saltMCBBSCSS.delStyle('scrollTopAnime');
}
}
}
confiectFixOP() {
this.assert(autoRunLock, '不在页面初始运行状态');
let obj = this;
let enabled = this.readWithDefault('saltMCBBSconfiectFix', true);
this.addCheckSetting('冲突修复功能<br><small>尝试修复与其他脚本的冲突</small>', enabled, (ck, ev) => {
this.write('saltMCBBSconfiectFix', ck);
sub(ck);
}, '冲突修复功能', 21);
sub(enabled);
function sub(enabled) {
if (!enabled) {
return;
}
let links = obj.links;
let ul = document.querySelector('.user_info_menu_btn');
if (!ul || !(ul instanceof HTMLElement)) {
return;
}
let a = ul.querySelectorAll('a'), othersArchor = [];
for (let i = 4; i < a.length; i++) {
othersArchor.push(a[i]);
}
if (othersArchor.length > 0) {
obj.addChildren(links, othersArchor);
obj.log(othersArchor);
}
}
window.addEventListener('load', () => { sub(enabled); });
}
antiWater(RegExps = antiWaterRegExp, ignoreWarned = true, callback) {
return __awaiter(this, void 0, void 0, function* () {
let obj = this;
let queryStr = ignoreWarned ? '#postlist > div:not(.warned)' : '#postlist > div';
this.saltQuery(queryStr, (i, el) => {
if (!(el instanceof HTMLElement)) {
return;
}
let td = el.querySelector('td[id^="postmessage"]');
if (!(td instanceof HTMLElement)) {
return;
}
let tempEl = document.createElement('div');
tempEl.innerHTML = td.innerHTML;
for (let img of Array.from(tempEl.querySelectorAll('img[smilieid]'))) {
if (img instanceof HTMLImageElement) {
img.replaceWith('/meme/');
}
}
for (let font0 of Array.from(tempEl.querySelectorAll('font[style*="font-size:0px"]'))) {
if (font0 instanceof HTMLImageElement) {
font0.remove();
}
}
let t = tempEl.textContent || '';
for (let aw of RegExps) {
if (aw.test(t)) {
if (callback) {
callback(el, td, t);
}
else {
if (el.hasClass('reported')) {
obj.message('该疑似水帖已被您举报:<br><span>' + tempEl.innerHTML + '</span>', () => {
obj.scrollTo(el.offset().top - 20);
}, 1);
}
else {
obj.message('发现未制裁的疑似水帖:<br><span>' + tempEl.innerHTML + '</span>', () => {
obj.scrollTo(el.offset().top - 20);
});
}
}
}
}
tempEl = null;
});
});
}
updateBackground() {
let dbg = this.readWithDefault('dayBackgroundImage', []);
putDayImg(this.randomChoice(this.cleanStringArray(dbg)));
let nbg = this.readWithDefault('nightBackgroundImage', []);
putNightImg(this.randomChoice(this.cleanStringArray(nbg)));
function putDayImg(link) {
if (typeof link == 'string' && link.length > 0) {
window.saltMCBBSCSS.putStyle(`
body{--bodyimg-day:url('${link}');}
body:not(.night-style) #body_fixed_bg{opacity:0}
body:not(.night-style) .mc_map_wp,
body:not(.night-style) #scrolltop
{opacity:var(--mcmapwpOpacity,0.5)}
body:not(.night-style):hover .mc_map_wp,
body:not(.night-style):hover #scrolltop
{opacity:1}`, 'setBackgroundImage-day');
}
else {
window.saltMCBBSCSS.delStyle('setBackgroundImage-day');
}
}
function putNightImg(link) {
if (typeof link == 'string' && link.length > 0) {
window.saltMCBBSCSS.putStyle(`
body{--bodyimg-night:url('${link}');}
body.night-style #body_fixed_bg{opacity:0}
body.night-style .mc_map_wp,
body.night-style #scrolltop
{opacity:var(--mcmapwpOpacity,0.5)}
body.night-style:hover .mc_map_wp,
body.night-style:hover #scrolltop
{opacity:1}`, 'setBackgroundImage-night');
}
else {
window.saltMCBBSCSS.delStyle('setBackgroundImage-night');
}
}
}
hideSettingPanel() {
this.settingPanel.classList.remove('visible');
this.settingPanel.classList.add('hidden');
}
showSettingPanel() {
this.settingPanel.classList.remove('hidden');
this.settingPanel.classList.add('visible');
}
addSetting(div, id, priority) {
if (typeof id == 'string' && id.length > 0) {
div.setAttribute('name', id);
}
if (!priority) {
priority = myPriority;
myPriority += 500;
}
div.setAttribute('priority', priority + '');
this.settingPanel.appendChild(div);
}
addTextareaSetting(h3, textarea, callback, id, priority) {
let newsetting = document.createElement('div');
newsetting.innerHTML = '<h3>' + h3 + '</h3>';
let textareaEl = document.createElement('textarea');
textareaEl.value = textarea;
textareaEl.addEventListener('change', function (e) { callback(this, e); });
newsetting.appendChild(textareaEl);
this.addSetting(newsetting, id || h3, priority);
}
addInputSetting(h3, text, callback, id, priority) {
let newsetting = document.createElement('div');
newsetting.innerHTML = '<h3 class="half-h3">' + h3 + '</h3>';
let inputEl = document.createElement('input');
inputEl.value = text;
inputEl.addEventListener('change', function (e) { callback(this, e); });
newsetting.appendChild(inputEl);
this.addSetting(newsetting, id || h3, priority);
}
addCheckSetting(h3, checked, callback, id, priority) {
let newsetting = document.createElement('div');
newsetting.innerHTML = '<h3 class="half-h3">' + h3 + '</h3>';
let inputEl = document.createElement('input');
inputEl.type = 'checkbox';
inputEl.checked = checked;
inputEl.addEventListener('click', function (e) { callback(this.checked, e); });
newsetting.appendChild(inputEl);
this.addSetting(newsetting, id || h3, priority);
}
addRangeSetting(h3, value, range, callback, id, priority) {
let rg = [0, 0, 0];
if (range instanceof Array) {
rg[0] = range[0] || 0;
rg[1] = range[1] || 100;
rg[2] = range[2] || 1;
}
else {
rg[0] = range.min || 0;
rg[1] = range.max || 100;
rg[2] = range.step || 1;
}
if (rg[0] > rg[1]) {
let temp = rg[0];
rg[0] = rg[1];
rg[1] = temp;
}
let newsetting = document.createElement('div');
newsetting.innerHTML = '<h3>' + h3 + '</h3>';
let inputEl = document.createElement('input');
inputEl.type = 'range';
inputEl.min = rg[0] + '';
inputEl.max = rg[1] + '';
inputEl.step = rg[2] + '';
inputEl.value = value + '';
inputEl.addEventListener('change', function (ev) {
callback(parseFloat(this.value), ev);
});
newsetting.appendChild(inputEl);
this.addSetting(newsetting, id || h3, priority);
}
delSetting(id) {
if (!(typeof id == 'string' && id.length > 0)) {
return;
}
let div = this.settingPanel.children;
for (let x of div) {
if (x.hasAttribute('name') && x.getAttribute('name') == id) {
this.log('已找到配置项: ' + id);
this.settingPanel.removeChild(x);
return;
}
}
}
sortSetting() {
let divs = Array.from(document.querySelectorAll('#saltMCBBS-settingPanel > *'));
for (let div of divs) {
if (!div.hasAttribute('priority')) {
div.setAttribute('priority', '99999999');
}
else if (isNaN(parseInt(div.getAttribute('priority') || ''))) {
div.setAttribute('priority', '99999998');
}
}
divs.sort((a, b) => {
return parseInt(a.getAttribute('priority') || '') - parseInt(b.getAttribute('priority') || '');
});
this.addChildren(this.settingPanel, divs);
}
changeSettingH3(id, html) {
if (!(typeof id == 'string' && id.length > 0)) {
return;
}
let div = this.settingPanel.children;
for (let x of div) {
if (x.hasAttribute('name') && x.getAttribute('name') == id) {
this.log('已找到配置项: ' + id);
let h3 = x.querySelector('h3');
if (h3)
h3.innerHTML = html;
return;
}
}
}
addSideBarLink(a, callback) {
let links = this.links;
if (typeof a == 'string') {
let anchor = document.createElement('a');
anchor.textContent = a;
anchor.href = 'javascript: void(0);';
if (typeof callback == 'function') {
anchor.addEventListener('click', (ev) => { callback(ev); });
}
else if (typeof callback == 'string') {
anchor.href = callback;
}
links.appendChild(anchor);
}
else if (a instanceof HTMLElement) {
links.appendChild(a);
}
}
nightStyle(night = true, log = false) {
if (night) {
window.saltMCBBSCSS.putStyle('', 'night-style');
document.body.classList.add('night-style');
}
else {
document.body.classList.remove('night-style');
}
if (log) {
this.write('isNightStyle', night);
}
}
toggleNightStyle() {
let isnight = this.readWithDefault('isNightStyle', false);
this.nightStyle(!isnight, true);
}
}
class saltMCBBSCSS {
constructor() {
this.styles = {};
}
setStyle(css, key) {
if (typeof css != 'string' || typeof key != 'string') {
return false;
}
this.styles[key] = css;
return true;
}
getStyle(key) {
if (typeof key != 'string') {
return '';
}
if (this.styles[key])
return this.styles[key];
else
return '';
}
putStyle(css, key) {
let status = 0;
if (typeof css == 'string' && css.length > 2) {
status += 1;
}
if (typeof key == 'string' && key.length > 0) {
status += 2;
}
switch (status) {
case 0:
return false;
case 1:
let s = document.createElement('style');
s.textContent = css;
document.head.appendChild(s);
break;
case 2:
let c = this.getStyle(key);
if (c.length > 0) {
let x = this.getStyleElement(key);
if (!x) {
let s = document.createElement('style');
s.textContent = c;
this.setStyleElement(key, s);
document.head.appendChild(s);
}
else {
if (x.textContent != c)
x.textContent = c;
}
}
else {
return false;
}
break;
case 3:
let x = this.getStyleElement(key);
if (!x) {
this.styles[key] = css;
let s = document.createElement('style');
s.textContent = css;
this.setStyleElement(key, s);
document.head.appendChild(s);
}
else {
this.styles[key] = css;
if (x.textContent != css)
x.textContent = css;
}
break;
}
return true;
}
delStyle(key) {
if (typeof key != 'string') {
return false;
}
let el = this.getStyleElement(key);
if (el) {
el.remove();
return true;
}
else {
return false;
}
}
replaceStyle(css, key) {
if (typeof css != 'string' || typeof key != 'string') {
return false;
}
let el = this.getStyleElement(key);
if (el) {
this.styles[key] = css;
el.textContent = css;
}
else {
this.putStyle(css, key);
}
return true;
}
getStyleElement(key) {
if (typeof key != 'string') {
return null;
}
return document.querySelector(`style[${techprefix + key}]`);
}
setStyleElement(key, el) {
if (typeof key != 'string' || !(el instanceof Element)) {
return false;
}
el.setAttribute(techprefix + key, '');
return true;
}
}
(function () {
if (!HTMLElement.prototype.addClass) {
HTMLElement.prototype.addClass = function (classes) {
let cls = String(classes).replace(/\s+/gm, ',').split(',');
for (let c of cls) {
this.classList.add(c);
}
};
}
if (!HTMLElement.prototype.toggleClass) {
HTMLElement.prototype.toggleClass = function (classes) {
var cls = String(classes).replace(/\s+/gm, ',').split(',');
for (var c of cls) {
if (this.classList.contains(c))
this.classList.remove(c);
else
this.classList.add(c);
}
};
}
if (!HTMLElement.prototype.hasClass) {
HTMLElement.prototype.hasClass = function (OneClass) {
return this.classList.contains(OneClass);
};
}
if (!HTMLElement.prototype.removeClass) {
HTMLElement.prototype.removeClass = function (classes) {
var cls = String(classes).replace(/\s+/gm, ',').split(',');
for (var c of cls) {
this.classList.remove(c);
}
};
}
if (!HTMLElement.prototype.offset) {
HTMLElement.prototype.offset = function () {
if (!this.getClientRects().length)
return { top: 0, left: 0 };
var rect = this.getBoundingClientRect();
var win = this.ownerDocument.defaultView || { pageYOffset: 0, pageXOffset: 0 };
return {
top: rect.top + win.pageYOffset,
left: rect.left + win.pageXOffset
};
};
}
if (!HTMLElement.prototype.numAttribute) {
HTMLElement.prototype.numAttribute = function (key) {
let value;
if (this.hasAttribute(key)) {
value = parseInt(this.getAttribute(key) || '');
}
else {
value = 0;
this.setAttribute(key, value + '');
}
if (isNaN(value)) {
value = 0;
this.setAttribute(key, value + '');
}
return {
value: value,
set: (num) => {
this.setAttribute(key, num + '');
return this.numAttribute(key);
},
add: (num) => {
this.setAttribute(key, (value + num) + '');
return this.numAttribute(key);
}
};
};
}
})();
window['saltMCBBSCSS'] = new saltMCBBSCSS();
window['saltMCBBS'] = new saltMCBBS(true);
window['saltMCBBSOriginClass'] = saltMCBBSOriginClass;
})();