// ==UserScript==
// @name 深色模式
// @namespace https://greasyfork.org/zh-CN/users/1196880-ling2ling4
// @version 1.3.1
// @author Ling2Ling4
// @description 设置页面为深色模式, 可定时开关
// @license AGPL-3.0-or-later
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAAEECAYAAADOCEoKAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgAElEQVR4nO2dd3hT1R+H33MzuiilbJCy9wbZe4OAOFgqgiggKoobUfmhuFBARUAEAZEpMlUEZA8BmSJT2cgQ2S3dGff8/mjBAqXJTZPepL0vDw+kueecb5PcT874DoEPkVJGAM2A6kAFoCJQBIgEwnw5toFBgBMPRAP/AH8Bh4F9wCYhRIyvBhXe7lBKWQZ4HLgPqAOYvD2GgUEOxgnsAlYAs4UQx73ZuVcEQUppAnoCzwGNvNWvgYFBhkhgKzAR+F4I4cxsh5m6cVOFoC8wFCibWWMMDAw85hjwMfBtZoTBY0GQUtYnRZlqe9qHgYGB1/kdeE4Isd2TxorWBlLKECnleFKmKoYYGBj4F7WBrVLK8VLKEK2NNc0QpJTlgUVAVa0DGRgYZDkHgK5CiCPuNnB7hiClbA3swBADA4NAoSqwPfXedQu3ZghSyu7AbMDqoWEGPiYuPp4LFy5w7tw/rNm4mTy5Qvn3wgWuXLnKlcuXib52jZiYGOISEkhITCIxKZHkZBsOFBwqSGECYUEIMCuSIIsJxWQhMjyUyIhwCuXPhzUkhODQMAoUKEDpksUpU6okZUuXIiqqGLnDw/V+CQzujg14XAixwNWFLgUhVQy+w/An0B0pJafPnuXY8eP8efgIP/+ynouXr3L50mX+vXAJu1MFxQRCQQAmBRQBAolApvSBQJX//avKzNtlNUHZqKKUvKcopUoVJ87u5LFuXShbtgylShRHCOMU2g9wAo+6EoUM3ykpZStSHCCMmYEObN+5i/WbNvP7Hwf468hRzp6/wLWY64CScuNr3xP2GYoAiyJwSolDBUU6kE4b5UsWpXLFiijWYIpHRfFs/z6UK2ucUOuEDbhPCLHubhfcVRBSNxB3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zGPdr1s5/vc5km3GsiItVouZsiWL07pFE/r16UkNQwR8xQQhxAu3//BughAK7ASMd8OHnPr7NN/MWcDq9Zs5dPgY12Nzppt0eFgIlcqWon2bFvR74lFKRBmFfH3MHqChEOIOL7u7OiJJKSsA24EIHxpmkIbZ85ewcu0mdv+xn7/P/kNCQvbycRBCoAhBgXx5KV2yOPfWqELLZg156P779DYtJxFDyr7BsfSezNAzUUrZClgBWH1gmIELfv5lDes2beX3vQc4fuo0ly5fC7glRlhIECWj7qFe7ep06tCaKhXLU7FCeb3NyqnYgPuEEOvudoFLV2UpZQ9gLkY0pO5IKVn361a279rLgT8Pc+zE35z/9wLXomNITExC1SlfriIEISHBROaJoGjhQpQtVZyqlStQv05NWjZtlFKjwkBvnMBjQoj5GV3k1jslpewJzMSYKfgt165F8+eRoxw9dpJTZ85y7p9/uXDxMpcuXyY6Jpa4hAQSEpOwJduwORw4HE5UKbldQ4RIucFNJhMWi5mQ4CBCQoIJCwkhT0Ru8ufPS+GC+bmnaGFKRBWjQplSVKpQnsjIPPr84gbuYAN6uxID0BDMJKVsAyzE2FPIViz4YTkLflwGQPcHOtH9wY46W2TgZWKAbkKINe5crGkul7rRuAio4oFhBgYGWctBoKsQ4rC7DTQ5H6V2XA/4krRFCQ0MDPwJlZR7tJ4WMYBM5D9I9WicCNTytA8DAwOvswd47nYPRHfx2D05dcB6wEDgjKf9GBgYeIUzpNyL9TwVA/BShiQppRV4NNWgBt7q18DAwCW/AZOB74QQmXZS8fqNK6UsA/QBOpKynDD8FwwMvIeTlGXBcmCmEOK4Nzv36Td5aor3ZsC9pMRFlAIKAZFAmC/HNjAIcOKBaOBf4CRwCNgNbBJCRPtq0P8DUfJWKWbPwTgAAAAASUVORK5CYII=
// @match *://*/*
// @run-at document-start
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_registerMenuCommand
// @grant GM_notification
// @noframes
// @compatible chrome
// @compatible edge
// @compatible firefox
// ==/UserScript==
(() => {
"use strict";
function verify_time1(newVal, oldVal, base) {
const arr = newVal.trim().split(/:|:/);
if (2 === arr.length && 2 === arr[0].length && 2 === arr[1].length) {
const a = +arr[0],
b = +arr[1];
if (a >= 0 && a <= 24 && b >= 0 && b <= 59) return newVal;
}
return oldVal;
}
function getNumVerifyFn(min, max, rangeLimit = [1, 1]) {
return (newVal, oldVal, base) => {
if (!(newVal = +newVal) && 0 !== newVal) return oldVal;
if (!1 !== min && !1 !== max) {
if (rangeLimit[0] && newVal >= min) {
if (rangeLimit[1] && newVal <= max) return newVal;
if (!rangeLimit[1] && newVal < max) return newVal;
}
if (!rangeLimit[0] && newVal > min) {
if (rangeLimit[1] && newVal <= max) return newVal;
if (!rangeLimit[1] && newVal < max) return newVal;
}
} else {
if (!1 === min) {
if (rangeLimit[1] && newVal <= max) return newVal;
if (!rangeLimit[1] && newVal < max) return newVal;
}
if (!1 === max) {
if (rangeLimit[0] && newVal >= min) return newVal;
if (!rangeLimit[0] && newVal > min) return newVal;
}
}
return oldVal;
};
}
const keyBase = "ll_pageDarkMode_",
info = {
keyBase,
settingsArea: null,
isDarkMode: !1,
isCanRun: !0,
timer: null,
interval: 5e3,
cssDom: null,
btnHoverTxt: "点击切换深色模式",
otherSettings: {
oldDarkMode: {
value: !1,
base: !1,
key: keyBase + "oldDarkMode",
valType: "boolean",
},
},
settings: {
btnPosition: {
value: !1,
base: !1,
key: keyBase + "btnPosition",
groupTitle3: "按钮设置",
desc: "模式切换按钮的位置",
type: "基础设置",
valType: "boolean",
compType: "radio",
valueText: { true: "左下", false: "右下" },
},
isHiddenBtn: {
value: !1,
base: !1,
key: keyBase + "isHiddenBtn",
desc: "是否隐藏按钮, 隐藏后鼠标移入时会重新显示",
type: "基础设置",
valType: "boolean",
compType: "radio",
valueText: { true: "隐藏", false: "显示" },
},
btnSize: {
value: "30",
base: "30",
key: keyBase + "btnSize",
desc: "按钮的大小",
type: "基础设置",
valType: "number",
compType: "textarea",
verify: getNumVerifyFn(20, 60),
},
isAutoStartStop: {
value: !0,
base: !0,
key: keyBase + "isAutoStartStop",
groupTitle3: "定时开关",
desc: "是否开启定时开关功能",
type: "基础设置",
valType: "boolean",
compType: "radio",
valueText: { true: "开启", false: "关闭" },
},
startTime: {
value: "0",
base: "0",
key: keyBase + "startTime",
valType: "string",
type: "基础设置",
desc: "深色模式的自动开启时间, 0表示关闭, 按照24小时制书写, 格式为 xx:xx, 如: 20:00",
compType: "textarea",
verify: (newVal, oldVal, base) =>
0 == +newVal ? newVal : verify_time1(newVal, oldVal),
},
stopTime: {
value: "0",
base: "0",
key: keyBase + "stopTime",
valType: "string",
type: "基础设置",
desc: "深色模式的自动关闭时间, 0表示关闭, 按照24小时制书写",
compType: "textarea",
verify: (newVal, oldVal, base) =>
0 == +newVal ? newVal : verify_time1(newVal, oldVal),
},
startStopWay: {
value: !0,
base: !0,
key: keyBase + "startStopWay",
desc: "定时开关深色模式的方式",
type: "基础设置",
valType: "boolean",
compType: "radio",
valueText: {
true: "仅在设定时刻进行开关",
false: "根据设定时间段任意时刻都可开关",
},
},
isShowTips: {
value: !0,
base: !0,
key: keyBase + "isShowTips",
desc: "定时开关时是否进行弹窗提示",
type: "基础设置",
valType: "boolean",
compType: "radio",
valueText: { true: "弹窗提示", false: "关闭弹窗" },
},
onlyColor: {
value: !1,
base: !1,
key: keyBase + "onlyColor",
desc: "深色模式下是否仅调整颜色而不使页面变成深色 (此时'颜色反转'设置将失效)",
type: "颜色设置",
valType: "boolean",
compType: "radio",
valueText: { true: "自定义颜色", false: "深色+自定义颜色" },
},
invert: {
value: 1,
base: 1,
key: keyBase + "invert",
valType: "number",
type: "颜色设置",
title: "颜色反转",
desc: "颜色反转的程度, 深色效果主要与该设置相关. 默认1, 浏览器默认0, 取值范围0-1",
compType: "textarea",
verify: getNumVerifyFn(0, 1),
},
brightness: {
value: 0.9,
base: 0.9,
key: keyBase + "brightness",
valType: "number",
type: "颜色设置",
title: "亮度",
desc: "亮度的大小. 默认0.9, 浏览器默认1, 取值范围0-∞",
compType: "textarea",
verify: getNumVerifyFn(0, !1),
},
contrast: {
value: 1,
base: 1,
key: keyBase + "contrast",
valType: "number",
type: "颜色设置",
title: "对比度",
desc: "对比度的强弱. 默认1, 取值范围0-∞",
compType: "textarea",
verify: getNumVerifyFn(0, !1),
},
grayscale: {
value: 0,
base: 0,
key: keyBase + "grayscale",
valType: "number",
type: "颜色设置",
title: "灰度",
desc: "灰度的程度. 默认0, 取值范围0-1",
compType: "textarea",
verify: getNumVerifyFn(0, 1),
},
hueRotate: {
value: 0,
base: 0,
key: keyBase + "hueRotate",
valType: "number",
type: "颜色设置",
title: "色调",
desc: "色调的旋转变化. 默认0, 取值范围0-360",
compType: "textarea",
verify: getNumVerifyFn(0, 360),
},
saturate: {
value: 1,
base: 1,
key: keyBase + "saturate",
valType: "number",
type: "颜色设置",
title: "饱和度",
desc: "饱和度的高低. 默认1, 取值范围0-∞",
compType: "textarea",
verify: getNumVerifyFn(0, !1),
},
sepia: {
value: 0.2,
base: 0.2,
key: keyBase + "sepia",
valType: "number",
type: "颜色设置",
title: "深褐色",
desc: "深褐色的程度. 默认0.2, 浏览器默认0, 取值范围0-1",
compType: "textarea",
verify: getNumVerifyFn(0, 1),
},
autoDarkMode: {
value: !0,
base: !0,
key: keyBase + "autoDarkMode",
desc: "'刷新页面/打开新页面'后是否自动恢复页面的深色模式",
type: "其他设置",
valType: "boolean",
compType: "radio",
valueText: { true: "自动恢复", false: "手动开关" },
groupTitle3: "自动恢复",
},
autoDarkModeWay: {
value: !0,
base: !0,
key: keyBase + "autoDarkModeWay",
title: "自动恢复显示模式的方式",
desc: "左选项: 可使同一时间段内打开的每个页面都是相同显示模式\n右选项: 可使同一个页面打开后是上一次该页面的显示模式",
type: "其他设置",
valType: "boolean",
compType: "radio",
valueText: {
true: "恢复上一次使用的显示模式",
false: "恢复当前网页上一次的显示模式",
},
},
website: {
value:
"*www.baidu.com*\n*www.bilibili.com*\n*message.bilibili.com*\n*space.bilibili.com*\n*weibo.com*\n*www.zhihu.com*\n*www.douyin.com*",
base: "*www.baidu.com*\n*www.bilibili.com*\n*message.bilibili.com*\n*space.bilibili.com*\n*weibo.com*\n*www.zhihu.com*\n*www.douyin.com*",
key: keyBase + "website",
valType: "string",
type: "其他设置",
title: "应用的网站",
desc: "以下网站可启用深色模式, 支持*通配符, 多个网站请换行书写, 仅书写*表示所有网站都可启用\n【示例】*www.bilibili.com* 可匹配B站",
compType: "textarea",
compH: "110px",
},
onlyColorWebsite: {
value: "",
base: "",
key: keyBase + "onlyColorWebsite",
valType: "string",
type: "其他设置",
title: "不变为深色的网站",
desc: '以下网站即使启用深色模式后也不会变为深色, 而是采用"自定义颜色"模式, 支持*通配符, 多个网站请换行书写',
compType: "textarea",
compH: "110px",
},
noneInvertNodes: {
value:
'// B站\n.h .h-inner, .h-inner .avatar-container, bili-user-profile, .bili-im .avatar, .owner .to-top, #bilibili-player [role="comment"],\n// 百度\n#content_left h3.t, .cr-content [class*="opr-toplist"], .cr-content [class*="tag-common"]',
base: '// B站\n.h .h-inner, .h-inner .avatar-container, bili-user-profile, .bili-im .avatar, .owner .to-top, #bilibili-player [role="comment"],\n// 百度\n#content_left h3.t, .cr-content [class*="opr-toplist"], .cr-content [class*="tag-common"]',
key: keyBase + "noneInvertNodes",
valType: "string",
type: "其他设置",
title: "不反转的元素",
desc: "不进行颜色反转的元素, 每项用 , 分隔, 可书写css选择器. 以//开头表示行注释\n【可选】\nh1, h2, h3, h4, p, span, ul, li, i, svg, a, img, input, textarea, button, select, option, label, audio, video, ....",
compType: "textarea",
compH: "110px",
verify: (newVal) => {
"," ===
(newVal = newVal.trim().replaceAll(",", ","))[
newVal.length - 1
] && (newVal = newVal.slice(0, -1));
return newVal
.split("\n")
.map((item, i) => {
const t = item;
return (
(item = item.trim()),
0 === i
? "/" === item[0] && "/" === item[1]
? item
: t
: "/" === item[0] && "/" === item[1]
? ",\n" + item
: "\n" + t
);
})
.join("")
.replaceAll(", ,", ",")
.replaceAll(",,", ",");
},
},
},
};
function getCssHtml(isDark) {
const settings = info.settings,
r = parseInt(settings.btnSize.value / 5),
btnCss = `#${info.keyBase}btn{\nbackground:#ffffff;padding:${
r - 2
}px;border-radius:${r}px;position:fixed;${
settings.btnPosition.value ? "left" : "right"
}:-${
settings.btnSize.value / 2
}px;bottom:20px;z-index:1000;transition:ease 0.3s all,ease 0.5s 2s opacity;cursor:pointer;box-sizing:border-box;\n${
settings.isHiddenBtn.value ? "opacity:0" : ""
}}\n#${info.keyBase}btn.dark{background:#ababab}\n#${
info.keyBase
}btn:hover {${
settings.btnPosition.value ? "left:0" : "right:0"
};bottom:20px;\n${
settings.isHiddenBtn.value
? "transition:ease 0.3s opacity;opacity:1"
: ""
}\n}\n #${info.keyBase}btn svg{display:block;fill:#addeee}\n #${
info.keyBase
}btn.dark svg{fill:#ffffff}`;
if (!isDark) return btnCss;
const onlyColorflag =
verifyWebsite(settings.onlyColorWebsite.value) ||
settings.onlyColor.value,
invertText = onlyColorflag ? "" : `invert(${settings.invert.value})`,
selectorArr = settings.noneInvertNodes.value
.split("\n")
.filter((item) => "/" !== (item = item.trim())[0] && "/" !== item[1]),
nonoFilter = onlyColorflag
? ""
: 'img,video,input,iframe,canvas,object,svg image,\n[style*="background:url"],\n[style*="background: url"],\n[style*="background-image:url"],\n[style*="background-image: url"],\n[background]{filter:invert(1)}',
otherCss = onlyColorflag
? ""
: `${selectorArr.join("")}{filter:invert(1)}`;
return `html {\nbackground-color:#fff;\nfilter:${invertText} brightness(${settings.brightness.value}) contrast(${settings.contrast.value}) grayscale(${settings.grayscale.value}) hue-rotate(${settings.hueRotate.value}deg) saturate(${settings.saturate.value}) sepia(${settings.sepia.value});\n}\n${nonoFilter}${otherCss}${btnCss}`;
}
function matchUrlWithWildcard(url, pattern) {
return new RegExp("^" + pattern.replace(/\*/g, ".*") + "$").test(url);
}
function setValue_setValue({
value,
base,
key,
verification = null,
getValue = null,
setValue = null,
getVal = null,
setVal = null,
} = {}) {
getValue && (getVal = getValue), setValue && (setVal = setValue);
let newVal = value,
oldVal = getVal ? getVal(key) : localStorage.getItem(key);
return (
void 0 !== base &&
null == oldVal &&
((oldVal = base),
"string" != typeof base && (base = JSON.stringify(base)),
setVal ? setVal(key, base) : localStorage.setItem(key, base)),
null !== newVal &&
("function" != typeof verification ||
((newVal = verification(newVal, oldVal, base)), null !== newVal)) &&
newVal !== oldVal &&
("string" != typeof newVal && (newVal = JSON.stringify(newVal)),
setVal ? setVal(key, newVal) : localStorage.setItem(key, newVal),
!0)
);
}
function getValue({
base,
key,
valType = "string",
isReSet = !0,
getValue = null,
setValue = null,
getVal = null,
setVal = null,
} = {}) {
getValue && (getVal = getValue), setValue && (setVal = setValue);
let val = getVal ? getVal(key) : localStorage.getItem(key);
return (
void 0 !== base &&
null == val &&
((val = base),
isReSet &&
("string" != typeof base && (base = JSON.stringify(base)),
setVal ? setVal(key, base) : localStorage.setItem(key, base))),
(valType = valType.toLowerCase()),
"string" == typeof val
? "string" === valType
? val
: "boolean" === valType || "number" === valType
? JSON.parse(val)
: "object" === valType
? val
? JSON.parse(val)
: {}
: "array" === valType
? val
? JSON.parse(val)
: []
: val
: val
);
}
function getData(settings, getVal = null, setVal = null) {
(getVal = getVal || localStorage.getItem),
(setVal = setVal || localStorage.setItem);
for (const valName in settings) {
const setting = settings[valName];
setting.value = getValue({
base: setting.base,
key: setting.key,
valType: setting.valType,
getVal,
setVal,
});
}
return settings;
}
function setDarkMode(isDark = !0, modeTxt = "") {
if (
(((isDark) => {
let dom = info.cssDom,
isAdd = !1;
if (!dom) {
const id = info.keyBase + "css";
(dom = document.head.querySelector("#" + id)),
dom ||
((dom = document.createElement("style")),
(dom.id = id),
(info.cssDom = dom),
(isAdd = !0));
}
dom.isDark !== isDark &&
((dom.innerHTML = getCssHtml(isDark)),
(info.isDarkMode = isDark),
(dom.isDark = isDark),
isAdd && document.head.appendChild(dom));
})(isDark),
document.body)
)
document.body.appendChild(info.cssDom);
else {
const bodyObserver = new MutationObserver(() => {
document.body &&
(bodyObserver.disconnect(), document.body.appendChild(info.cssDom));
});
bodyObserver.observe(document, { childList: !0, subtree: !0 });
}
let logText, txt1;
txt1 = isDark ? "开启" : "关闭";
const settings = info.settings;
modeTxt ||
(settings.onlyColor.value &&
(modeTxt = `'${settings.onlyColor.valueText.true}'模式`),
verifyWebsite(settings.onlyColorWebsite.value) &&
(modeTxt = `'${settings.onlyColor.valueText.true}'模式`)),
(logText = `${txt1}${(modeTxt = modeTxt || "深色模式")}`),
console.log(logText),
setValue_setValue({
value: isDark,
base: info.otherSettings.oldDarkMode.base,
key: info.otherSettings.oldDarkMode.key,
getValue: GM_getValue,
setValue: GM_setValue,
}),
setValue_setValue({
value: isDark,
base: info.otherSettings.oldDarkMode.base,
key: info.otherSettings.oldDarkMode.key,
});
}
function setStartStopTimer() {
const settings = info.settings;
if (!settings.isAutoStartStop.value) return;
const startTime = settings.startTime.value,
stopTime = settings.stopTime.value;
if (0 == +startTime && 0 == +stopTime) return;
const autoStartStop = () => {
const f = (function isNeedDarkMode() {
const settings = info.settings,
startTime = settings.startTime.value,
stopTime = settings.stopTime.value;
if (0 == +startTime && 0 == +stopTime) return -1;
const t = new Date(),
curT = 60 * t.getHours() + t.getMinutes();
let startT, stopT;
if (0 != +startTime) {
const tArr1 = startTime.trim().replace(":", ":").split(":");
startT = 60 * +tArr1[0] + +tArr1[1];
}
if (0 != +stopTime) {
const tArr2 = stopTime.trim().replace(":", ":").split(":");
stopT = 60 * +tArr2[0] + +tArr2[1];
}
if (settings.startStopWay.value)
return curT === startT || (curT !== stopT && -1);
if (0 == +startTime) return !(curT >= stopT) && -1;
if (0 == +stopTime) return curT >= startT || -1;
const f = (function isTimeInRange(t, startTime, stopTime, rangeLimit) {
const curH = t.getHours(),
curMin = t.getMinutes(),
startText = startTime.trim().replace(":", ":"),
stopText = stopTime.trim().replace(":", ":"),
tArr1 = startText.split(":"),
tArr2 = stopText.split(":"),
h1 = +tArr1[0],
h2 = +tArr2[0],
startT = 60 * h1 + +tArr1[1],
stopT = 60 * h2 + +tArr2[1],
curT = 60 * curH + curMin;
if (startT < stopT)
if (rangeLimit[0]) {
if (rangeLimit[1]) {
if (curT >= startT && curT <= stopT) return !0;
} else if (curT >= startT && curT < stopT) return !0;
} else if (rangeLimit[1]) {
if (curT > startT && curT <= stopT) return !0;
} else if (curT > startT && curT < stopT) return !0;
if (startT > stopT)
if (rangeLimit[0]) {
if (rangeLimit[1]) {
if (
(curT >= startT && curT < 1440) ||
(curT <= stopT && curT >= 0)
)
return !0;
} else if (
(curT >= startT && curT < 1440) ||
(curT < stopT && curT >= 0)
)
return !0;
} else if (rangeLimit[1]) {
if (
(curT > startT && curT < 1440) ||
(curT <= stopT && curT >= 0)
)
return !0;
} else if (
(curT > startT && curT < 1440) ||
(curT < stopT && curT >= 0)
)
return !0;
return !1;
})(t, startTime, stopTime, [1, 0]);
return f;
})();
-1 !== f &&
(settings.isShowTips.value &&
GM_notification({
title: "深色模式",
text: `定时${f ? "开启" : "关闭"}深色模式`,
timeout: 3e3,
}),
setDarkMode(f));
};
autoStartStop(),
info.timer && clearInterval(info.timer),
(info.timer = setInterval(autoStartStop, info.interval));
}
function verifyWebsite(websiteText, url) {
if (!websiteText) return !1;
url = url || location.href;
return websiteText
.trim()
.split("\n")
.some((item) => matchUrlWithWildcard(url, item));
}
function updateShow() {
getData(info.settings, GM_getValue, GM_setValue),
info.cssDom
? (info.cssDom.innerHTML = getCssHtml(info.isDarkMode))
: info.isDarkMode
? (setDarkMode(!1), setDarkMode(!0))
: setDarkMode(!1),
createDarkModeBtn(),
setStartStopTimer();
}
function createDarkModeBtn() {
const settings = info.settings;
if (info.modeBtn) {
const btn = info.modeBtn;
return (
(btn.style.width = settings.btnSize.value + "px"),
(btn.style.height = settings.btnSize.value + "px"),
void (info.isDarkMode
? btn.classList.add("dark")
: btn.classList.remove("dark"))
);
}
const html = `<div id="${info.keyBase}btn" style="width:${
settings.btnSize.value
}px;height:${settings.btnSize.value}px" title="${
info.btnHoverTxt
}" class="${
info.isDarkMode ? "dark" : ""
}">\n <svg t="1723482089223" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6752"><path d="M505.565962 845.481164c-14.545274 0-26.317389 11.770068-26.317389 26.316366l0 61.937654c0 14.546298 11.771091 26.316366 26.317389 26.316366 14.520715 0 26.317389-11.770068 26.317389-26.316366l0-61.937654C531.883351 857.251232 520.086677 845.481164 505.565962 845.481164z" p-id="6753"></path><path d="M735.426117 803.899116c-7.248078-12.595876-23.362081-16.936741-35.929304-9.611915-12.591783 7.247054-16.909112 23.334451-9.611915 35.925211l30.969339 53.635571c4.856611 8.458649 13.697977 13.160741 22.795169 13.160741 4.471848 0 8.994861-1.1328 13.157671-3.523243 12.593829-7.270591 16.884552-23.38664 9.612938-35.953863L735.426117 803.899116z" p-id="6754"></path><path d="M931.462932 674.318876l-53.66013-30.994921c-12.567223-7.29515-28.680203-2.979868-35.927257 9.613962-7.272637 12.593829-2.981914 28.682249 9.611915 35.953863l53.661154 30.969339c4.111644 2.416026 8.634658 3.545756 13.107529 3.545756 9.097192 0 17.937534-4.726651 22.820752-13.156648C948.348508 697.653327 944.057785 681.56593 931.462932 674.318876z" p-id="6755"></path><path d="M306.006927 794.288225c-12.567223-7.353478-28.705785-2.983961-35.953863 9.611915l-30.968315 53.633524c-7.272637 12.567223-2.955308 28.682249 9.636474 35.953863 4.112668 2.390443 8.635681 3.523243 13.107529 3.523243 9.098215 0 17.939581-4.703115 22.821775-13.160741l30.993898-53.635571C322.89148 817.621653 318.59871 801.535279 306.006927 794.288225z" p-id="6756"></path><path d="M127.675356 643.323954l-53.609988 30.994921C61.472562 681.56593 57.155233 697.653327 64.42787 710.249203c4.857635 8.429996 13.696953 13.156648 22.795169 13.156648 4.471848 0 8.995885-1.12973 13.158694-3.545756l53.609988-30.969339c12.591783-7.270591 16.909112-23.360034 9.636474-35.953863C156.355559 640.344087 140.268162 636.028804 127.675356 643.323954z" p-id="6757"></path><path d="M932.954913 63.947428 90.024851 63.947428c-14.520715 0-26.315342 11.796674-26.315342 26.317389 0 14.546298 11.794627 26.316366 26.315342 26.316366L425.177074 116.581182l0.051165 107.373473c-96.322789 35.773761-162.089655 128.910998-162.089655 232.943376 0 136.955208 111.409392 248.364601 248.337995 248.364601 136.955208 0 248.363577-111.408369 248.363577-248.364601 0-49.085952-14.314007-96.578616-41.377386-137.288806-8.017604-12.07706-24.364921-15.366989-36.494169-7.349385-12.103666 8.070816-15.393595 24.388457-7.350408 36.494169 21.330818 32.04688 32.587186 69.440535 32.587186 108.144022 0 107.939361-87.789439 195.729823-195.7288 195.729823-107.913778 0-195.704241-87.790462-195.704241-195.729823 0-87.123266 58.492182-164.5548 142.247748-188.328249 10.743692-3.03308 18.401092-12.516058 19.069311-23.64349l0.61603-128.34511 455.248462 0c14.546298 0 26.316366-11.770068 26.316366-26.316366C959.271278 75.744101 947.50121 63.947428 932.954913 63.947428z" p-id="6758"></path></svg>\n</div>`;
document.body.insertAdjacentHTML("beforeend", html);
const btn = document.body.querySelector(`#${info.keyBase}btn`);
(info.modeBtn = btn),
btn.addEventListener("click", () => {
btn.classList.toggle("dark");
setDarkMode(btn.classList.contains("dark"));
});
}
const baseCfg = {
state: "",
isEditing: !1,
hasSelectedPage: !1,
param: {
id: "ll_edit_wrap",
box: document.body,
classBase: "ll_edit_",
w: "500px",
h: "",
contentH: "450px",
bg: "rgba(0, 0, 0, 0.15)",
color: "#333",
fontSize: "15px",
fontFamily:
"PingFang SC, HarmonyOS_Regular, Helvetica Neue, Microsoft YaHei, sans-serif",
zIndex: 11e3,
resetTt: "重置所有设置为默认值",
isShowMenu: !1,
isScrollStyle: !0,
isResetBtn: !0,
isOnlyResetCurPage: !1,
showPage: void 0,
isIntervalRun: !1,
interval: 1e3,
page: [],
callback: {
resetBefore: null,
reset: null,
confirmBefore: null,
finished: null,
interval: null,
cancelBefore: null,
cancelled: null,
},
},
},
cfg = {
version: "v1.2.2",
isEditing: baseCfg.isEditing,
hasSelectedPage: baseCfg.hasSelectedPage,
timer: null,
interval: 1e3,
param: {},
tempParam: {},
allData: {},
oldData: {},
lastData: {},
baseData: {},
controls: {},
doms: { page: [] },
editText: {},
};
const css = function getCss() {
const param = cfg.param,
cBase = (param.page, param.classBase),
baseStart = `#${param.id} .${cBase}`,
fSize = param.fontSize ? param.fontSize : "14px",
css = `#${
param.id
} {\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n z-index: ${
param.zIndex || 11e3
};\n background: ${
param.bg || "rgba(0, 0, 0, 0.12)"
};\n display: none;\n}\n${baseStart}box {\n text-align: initial;\n letter-spacing: 1px;\n position: relative;\n width: ${
param.w || "450px"
};\n ${
param.h ? "max-height:" + param.h : ""
};\n margin: auto;\n color: ${
param.color || "#333"
};\n background: #fff;\n font-size: ${fSize};\n line-height: normal;\n font-family: ${
param.fontFamily ||
"PingFang SC, HarmonyOS_Regular, Helvetica Neue, Microsoft YaHei, sans-serif"
};\n border: 3px solid #dfedfe;\n border-radius: 10px;\n box-sizing: border-box;\n padding: 14px 8px 10px 15px;\n overflow: hidden;\n overflow-y: auto;\n}\n${baseStart}menu {\n font-weight: bold;\n font-size: ${
parseInt(fSize) + 1
}px;\n display: flex;\n flex-wrap: wrap;\n gap: 0 8px;\n}\n${baseStart}menu-item {\n margin-bottom: 8px;\n border: 1px solid #dfedfe;\n color: #9ecaff;\n background: #eef6ff;\n border-radius: 6px;\n padding: 6px 10px;\n cursor: pointer;\n}\n${baseStart}menu-item:hover {\n color: #65aaff;\n background: #dfedfe;\n border: 1px solid #dfedfe;\n}\n${baseStart}menu-item.active {\n color: #65aaff;\n background: #dfedfe;\n border: 1px solid #dfedfe;\n}\n${baseStart}page-box {\n max-height: ${
param.contentH || ""
};\n padding-right: 7px;\n margin-bottom: 8px;\n overflow: hidden;\n overflow-y: auto;\n}\n${baseStart}page {\n display: none;\n}\n${baseStart}page.curPage {\n display: block;\n}\n${baseStart}comp {\n margin-bottom: 8px;\n}\n${baseStart}comp:last-child {\n margin-bottom: 2px;\n}\n${baseStart}tt {\n font-weight: bold;\n font-size: ${
parseInt(fSize) + 6
}px;\n margin-top: 4px;\n}\n${baseStart}tt2 {\n font-weight: bold;\n font-size: ${
parseInt(fSize) + 4
}px;\n margin-top: 3px;\n margin-bottom: 7px;\n}\n${baseStart}tt3 {\n font-weight: bold;\n font-size: ${
parseInt(fSize) + 2
}px;\n margin-top: 2px;\n margin-bottom: 6px;\n}\n${baseStart}desc {\n line-height: 1.5;\n}\n${baseStart}comp-tt {\n font-weight: bold;\n font-size: ${
parseInt(fSize) + 1
}px;\n line-height: 1.5;\n}\n${baseStart}comp-desc {\n line-height: 1.5;\n}\n${baseStart}rd-arr {\n line-height: 22px;\n}\n${baseStart}rd-arr label {\n margin-right: 6px;\n cursor: pointer;\n}\n${baseStart}rd-arr input {\n vertical-align: -2px;\n cursor: pointer;\n}\n${baseStart}rd-arr span {\n color: #666;\n margin-left: 2px;\n}\n#${
param.id
} textarea {\n width: 100%;\n max-width: 100%;\n max-height: 300px;\n border-radius: 6px;\n line-height: normal;\n padding: 5px 7px;\n outline-color: #cee4ff;\n border: 1px solid #aaa;\n box-sizing: border-box;\n font-size: ${
parseInt(fSize) - 2
}px;\n font-family: PingFang SC, HarmonyOS_Regular, Helvetica Neue, Microsoft YaHei, sans-serif;\n /* 保留空格 */\n white-space: pre-wrap;\n /* 允许词内换行 */\n word-break: break-all;\n letter-spacing: 1px;\n overflow: hidden;\n overflow-y: auto;\n}\n#${
param.id
} textarea::placeholder {\n color: #bbb;\n}\n${baseStart}ta-desc {\n margin-bottom: 3px;\n}\n${baseStart}btn-box {\n display: flex;\n justify-content: flex-end;\n}\n${baseStart}btn-box button {\n font-size: 16px;\n line-height: normal;\n color: #65aaff;\n background: #dfedfe;\n outline: none;\n border: none;\n border-radius: 6px;\n padding: 8px 16px;\n box-sizing: border-box;\n cursor: pointer;\n}\n${baseStart}btn-box .${cBase}reset-btn {\n position: absolute;\n left: 15px;\n bottom: 10px;\n color: #888;\n background: #f4f4f4;\n margin-right: 15px;\n}\n${baseStart}btn-box .${cBase}reset-btn:hover {\n color: #666;\n background: #eee;\n}\n${baseStart}btn-box .${cBase}cancel-btn {\n color: #888;\n background: #f4f4f4;\n margin-right: 15px;\n}\n${baseStart}btn-box .${cBase}cancel-btn:hover {\n color: #666;\n background: #eee;\n}\n${baseStart}btn-box .${cBase}confirm-btn {\n margin-right: 7px;\n}\n${baseStart}btn-box .${cBase}confirm-btn:hover {\n background: #cee4ff;\n}\n`;
return param.isScrollStyle
? css +
"\n.ll-scroll-style-1::-webkit-scrollbar,\n.ll-scroll-style-1 ::-webkit-scrollbar {\n width: 8px;\n}\n.ll-scroll-style-1-size-2::-webkit-scrollbar,\n.ll-scroll-style-1 .ll-scroll-style-1-size-2::-webkit-scrollbar {\n width: 10px;\n}\n.ll-scroll-style-1-size-3::-webkit-scrollbar,\n.ll-scroll-style-1 .ll-scroll-style-1-size-3::-webkit-scrollbar {\n width: 12px;\n}\n.ll-scroll-style-1::-webkit-scrollbar-thumb,\n.ll-scroll-style-1 ::-webkit-scrollbar-thumb {\n border-radius: 10px;\n -webkit-box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.05);\n opacity: 0.2;\n background: #daedff;\n}\n.ll-scroll-style-1::-webkit-scrollbar-track,\n.ll-scroll-style-1 ::-webkit-scrollbar-track {\n -webkit-box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.08);\n border-radius: 0;\n background: #fff;\n border-radius: 5px;\n}"
: css;
};
const editArea_html = function getHTML() {
function getCompHTML({ info, active = "", id }) {
let type = info.type;
if (
((type = {
menuTitle: "mtt",
title: "tt",
title2: "tt2",
title3: "tt3",
desc: "ds",
radio: "rd",
checkbox: "cb",
textarea: "ta",
mtt: "mtt",
tt: "tt",
tt2: "tt2",
tt3: "tt3",
ds: "ds",
rd: "rd",
cb: "cb",
ta: "ta",
}[type]),
(id = 0 === id ? "0" : id || ""),
0 === info.value && (info.value = "0"),
!type)
)
return console.log("不存在的组件类型"), !1;
let title = "",
desc = "",
ctrlTt = "";
switch (
(["tt", "tt2", "tt3", "ds", "mtt"].includes(type) ||
((title = info.title
? `<div class="${cBase}comp-tt ${cBase}${type}-tt" title="${
info.tt || ""
}">${info.title}</div>`
: ""),
(desc = info.desc
? `<div class="${cBase}comp-desc ${cBase}${type}-desc">${info.desc}</div>`
: "")),
type)
) {
case "mtt":
return (
(info.value = info.value || ""),
info.value
? `<div class="${cBase}menu-item ${active || ""}" title="${
info.tt || ""
}">${info.value}</div>`
: ""
);
case "tt":
case "tt2":
case "tt3":
return (
(info.value = info.value || ""),
info.value
? `<div class="${cBase}${type} ${cBase}comp" title="${
info.tt || ""
}">${info.value}</div>`
: ""
);
case "ds":
return (
(info.value = info.value || ""),
info.value
? `<div class="${cBase}desc ${cBase}comp" title="${
info.descTt || ""
}">${info.value}</div>`
: ""
);
case "rd":
const name = info.name || info.id + new Date().getTime();
(ctrlTt = info.ctrlTt || ""),
ctrlTt && (ctrlTt = `title="${ctrlTt}"`);
let radio = `<div class="${cBase}rd ${cBase}rd-arr" ${ctrlTt}>`;
if (void 0 === info.value && info.radioList[0]) {
const obj = info.radioList[0];
info.value = void 0 === obj.value ? obj.text : obj.value;
}
return (
info.radioList.forEach((item, i) => {
void 0 === item.value && (info.radioList[i].value = item.text),
void 0 === item.text && (info.radioList[i].text = item.value);
const value = item.value;
let tt = item.tt || "";
tt && (tt = `title="${tt}"`);
let selected = "";
info.value + "" == item.value + "" && (selected = "checked"),
(radio += `<label ${tt}><input ${selected} type="radio" name="${name}" data-val="${value}" data-cpid="${id}"><span>${item.text}</span></label>`);
}),
(radio += "</div>"),
`<div class="${cBase}comp ${cBase}ctrl ${cBase}rd-box" data-type="${type}" data-cpid="${id}">${title}${desc}${radio}</div>`
);
case "cb":
const name2 = info.name || new Date().getTime();
if (
((ctrlTt = info.ctrlTt || ""),
ctrlTt && (ctrlTt = `title="${ctrlTt}"`),
void 0 === info.value && info.radioList[0])
) {
const obj = info.radioList[0];
info.value = void 0 === obj.value ? obj.text : obj.value;
}
let checkbox = `<div class="${cBase}cb ${cBase}rd-arr" ${ctrlTt}>`;
return (
info.radioList.forEach((item, i) => {
void 0 === item.value && (info.radioList[i].value = item.text),
void 0 === item.text && (info.radioList[i].text = item.value);
const value = item.value;
let tt = item.tt || "";
tt && (tt = `title="${tt}"`);
let selected = "";
info.value.includes(value) && (selected = "checked"),
(checkbox += `<label ${tt}><input ${selected} type="checkbox" name="${name2}" data-val="${value}" data-cpid="${id}"><span>${item.text}</span></label>`);
}),
(checkbox += "</div>"),
`<div class="${cBase}comp ${cBase}ctrl ${cBase}cb-box" data-type="${type}" data-cpid="${id}">${title}${desc}${checkbox}</div>`
);
case "ta":
const taH = `height:${info.height || "30px"};`,
style = `style="${
info.width ? "width:" + info.width + ";" : ""
}${taH}${
info.fontSize ? "font-size:" + info.fontSize + ";" : ""
}${
info.fontFamily ? "font-family:" + info.fontFamily + ";" : ""
}"`,
textarea = `<textarea class="${cBase}ta" ${style} data-cpid="${id}" placeholder="${
info.ph || ""
}" title="${info.ctrlTt || "拖动右下角可调节宽高"}"></textarea>`;
return `<div class="${cBase}comp ${cBase}ctrl ${cBase}ta-box" data-type="${type}" data-cpid="${id}">${title}${desc}${textarea}</div>`;
}
}
const param = cfg.param,
page = param.page,
cBase = param.classBase,
isMenu = 1 !== page.length;
let menu = `<div class="${cBase}menu">`,
pageHTML = `<div class="${cBase}page-box ll-scroll-style-1 ll-scroll-style-1-size-2">`;
page.forEach((curPage, index) => {
let pgid = curPage.id || index;
(pgid += ""), (cfg.allData[pgid] = {}), (cfg.baseData[pgid] = {});
let pageFlag = "";
if (
(cfg.hasSelectedPage ||
((void 0 === param.showPage || pgid === param.showPage + "") &&
((pageFlag = "curPage"), (cfg.hasSelectedPage = !0))),
(pageHTML += `<div class="${cBase}page ${pageFlag}" data-pgid="${pgid}">`),
curPage.components)
) {
let compIndex = 0;
if (isMenu || param.isShowMenu) {
let curMenu = curPage.components.find(
(item) => "menuTitle" === item.type
);
curMenu || (curMenu = { type: "menuTitle", value: pgid }),
(menu += getCompHTML({
info: curMenu,
active: pageFlag ? "active" : "",
}));
}
curPage.components.forEach((item) => {
const cpid = item.id || compIndex;
"menuTitle" !== item.type &&
(pageHTML += getCompHTML({ info: item, id: cpid })),
["title", "title2", "title3", "desc", "menuTitle"].includes(
item.type
) ||
((item.base = void 0 === item.base ? item.value : item.base),
(cfg.allData[pgid][cpid] = item.value),
(cfg.baseData[pgid][cpid] = item.base),
compIndex++);
});
}
pageHTML += "</div>";
}),
(pageHTML += "</div>"),
isMenu || param.isShowMenu ? (menu += "</div>") : (menu = "");
const resetBtn = param.isResetBtn
? `<button class="${cBase}reset-btn" title="${
param.resetTt || "重置所有设置为默认值"
}">重置</button>`
: "",
btnBox = `<div class="${cBase}btn-box">\n${resetBtn}\n<button class="${cBase}cancel-btn">取 消</button>\n<button class="${cBase}confirm-btn">确 认</button>\n</div>`;
return `<div class="${cBase}box ll-scroll-style-1 ll-scroll-style-1-size-3" data-version="${cfg.version}">\n${menu}\n${pageHTML}\n${btnBox}\n</div>`;
},
baseParam = baseCfg.param,
controls = cfg.controls,
doms = cfg.doms;
function createEditEle({
id = baseParam.id,
box = baseParam.box,
classBase = baseParam.classBase,
w = baseParam.w,
h = baseParam.h,
contentH = baseParam.contentH,
bg = baseParam.bg,
color = baseParam.color,
fontSize = baseParam.fontSize,
fontFamily = baseParam.fontFamily,
zIndex = baseParam.zIndex,
resetTt = baseParam.resetTt,
isShowMenu = baseParam.isShowMenu,
isScrollStyle = baseParam.isScrollStyle,
isResetBtn = baseParam.isResetBtn,
isOnlyResetCurPage = baseParam.isOnlyResetCurPage,
showPage = baseParam.showPage,
isIntervalRun = baseParam.isIntervalRun,
interval = baseParam.interval,
page = [],
callback = baseParam.callback,
} = {}) {
(cfg.state = baseCfg.state),
(cfg.isEditing = baseCfg.isEditing),
(cfg.hasSelectedPage = baseCfg.hasSelectedPage),
(cfg.param = { ...baseParam });
const param = cfg.param;
(box = box || document.body),
(param.id = id),
(param.box = box),
(param.classBase = classBase),
(param.w = w),
(param.h = h),
(param.contentH = contentH),
(param.bg = bg),
(param.color = color),
(param.fontSize = fontSize),
(param.fontFamily = fontFamily),
(param.zIndex = zIndex),
(param.resetTt = resetTt),
(param.isShowMenu = isShowMenu),
(param.isScrollStyle = isScrollStyle),
(param.isResetBtn = isResetBtn),
(param.isOnlyResetCurPage = isOnlyResetCurPage),
(param.showPage = showPage),
(param.isIntervalRun = isIntervalRun),
(param.interval = interval),
(param.page = page),
(param.callback = callback),
(cfg.interval = interval),
(cfg.callback = callback);
const html = editArea_html();
return (
box.querySelector(`#${param.classBase}${param.id}-css`) ||
(function addCss(cssText, box = document.body, id = "") {
const style = document.createElement("style");
return (
id && (style.id = id),
box.appendChild(style),
(style.innerHTML = cssText),
style
);
})(css(), box, param.classBase + param.id + "-css"),
(doms.wrap = (function createEle({
className = "",
id = "",
title = "",
css,
box = document.body,
type = "div",
} = {}) {
const ele = document.createElement(type);
return (
id && (ele.id = id),
className && (ele.className = className),
title && (ele.title = title),
css && (ele.style.cssText = css),
box.appendChild(ele),
ele
);
})({ className: id, id })),
(doms.wrap.innerHTML = html),
(function getDoms() {
const param = cfg.param,
cBase = param.classBase;
(doms.box = doms.wrap.querySelector(`.${cBase}box`)),
(doms.cancel = doms.box.querySelector(`.${cBase}cancel-btn`)),
(doms.confirm = doms.box.querySelector(`.${cBase}confirm-btn`));
const isMenu = 1 !== param.page.length;
(isMenu || param.isShowMenu) &&
((doms.menu = doms.box.querySelector(`.${cBase}menu`)),
(doms.menus = [].slice.call(
doms.menu.querySelectorAll(`.${cBase}menu-item`)
)));
const pages = [].slice.call(doms.box.querySelectorAll(`.${cBase}page`));
(doms.page = []),
param.isResetBtn &&
(doms.reset = doms.box.querySelector(`.${cBase}reset-btn`));
pages.forEach((curPage, index) => {
cfg.hasSelectedPage ||
(curPage.classList.add("curPage"),
(isMenu || param.isShowMenu) &&
doms.menus[0].classList.add("active"),
(cfg.hasSelectedPage = !0));
const page = {},
pgid = curPage.dataset.pgid;
(page.pgid = curPage.pgid = pgid),
(page.controls = [].slice.call(
curPage.querySelectorAll(`.${cBase}ctrl`)
)),
(page.ele = curPage),
doms.page.push(page),
(isMenu || param.isShowMenu) &&
(doms.menus[index].settingsPage = curPage);
const ctrls = {};
(controls[pgid] = ctrls),
page.controls.forEach((item, i) => {
const cpid = item.dataset.cpid,
cType = item.dataset.type;
let dom;
(item.cpid = cpid),
"rd" === cType || "cb" === cType
? ((dom = [].slice.call(item.querySelectorAll("input"))),
(dom.compType = cType))
: "ta" === cType &&
((dom = item.querySelector("textarea")),
(dom.compType = cType),
(dom.value = cfg.allData[pgid][cpid])),
(ctrls[cpid] = dom);
});
});
})(),
cfg.timer && clearInterval(cfg.timer),
(function bindEvents() {
const param = cfg.param;
function menuHandle(e) {
const dom = e.target,
cBase = param.classBase;
if (dom.classList.contains(`${cBase}menu-item`)) {
const old = doms.menu.querySelector(".active");
old.classList.remove("active"),
old.settingsPage.classList.remove("curPage"),
dom.classList.add("active"),
dom.settingsPage.classList.add("curPage");
}
}
function cancelEdit(e) {
const cBase = param.classBase;
if (
(e.stopPropagation(),
e.target.className !== `${cBase}wrap` &&
e.target.className !== `${cBase}cancel-btn`)
)
return;
const callback = cfg.callback;
!1 !== runCallback(callback.cancelBefore) &&
(showEditArea(!1),
setCompValue(cfg.oldData),
param.isIntervalRun &&
(setCompValue(cfg.oldData), (cfg.allData = cfg.oldData)),
runCallback(callback.cancelled));
}
function confirmEdit() {
const callback = cfg.callback,
data = getAllData();
(cfg.allData = data),
!1 !== runCallback(callback.confirmBefore, data) &&
(showEditArea(!1),
(cfg.state = "finished"),
runCallback(callback.finished, data),
(cfg.state = ""));
}
function resetEdit() {
const callback = cfg.callback,
data = getAllData();
!1 !== runCallback(callback.resetBefore, data) &&
(!(function resetEditData(isOnlyPage = !1) {
const param = cfg.param;
if (param.isResetBtn)
if (isOnlyPage) {
const data = getAllData(),
curMenu = doms.menu.querySelector(".active");
(data[curMenu.innerText] = cfg.baseData[curMenu.innerText]),
setCompValue(data);
} else setCompValue(cfg.baseData);
})(param.isOnlyResetCurPage),
runCallback(callback.reset, data));
}
doms.menu && doms.menu.addEventListener("click", menuHandle),
doms.wrap.addEventListener("click", cancelEdit),
doms.cancel.addEventListener("click", cancelEdit),
doms.confirm.addEventListener("click", confirmEdit),
doms.reset && doms.reset.addEventListener("click", resetEdit);
})(),
(cfg.state = "created"),
cfg
);
}
function getAllData() {
function getCompItem(pgid, cpid) {
if (!controls[pgid]) return;
const ctrl = controls[pgid][cpid];
if (ctrl) {
if (!Array.isArray(ctrl)) return ctrl.value;
if ("rd" === ctrl.compType) {
const result = ctrl.find((item) => item.checked).dataset.val;
return "false" !== result && ("true" === result || result);
}
if ("cb" === ctrl.compType) {
return ctrl
.filter((item) => item.checked)
.map((item) => {
const value = item.dataset.val;
return "false" !== value && ("true" === value || value);
});
}
}
}
const data = {};
if (0 === arguments.length) {
for (const key in controls) {
const page = controls[key];
data[key] = {};
for (const key2 in page) data[key][key2] = getCompItem(key, key2);
}
return data;
}
if (1 === arguments.length) {
const ctrls = arguments[0];
for (const pgid in ctrls) {
data[pgid] = {};
controls[pgid].forEach((cpid) => {
data[pgid][cpid] = getCompItem(pgid, cpid);
});
}
return cfg.allData;
}
return getCompItem(arguments[0], arguments[1]);
}
function setCompValue() {
function setCompItem(pgid, cpid, value) {
if (!controls[pgid]) return;
const ctrl = controls[pgid][cpid];
if (ctrl)
if (Array.isArray(ctrl)) {
if ("rd" === ctrl.compType) {
const selected = ctrl.find((item) => item.checked);
selected && (selected.checked = !1);
const select = ctrl.find((item) => item.dataset.val === value + "");
select && (select.checked = !0);
} else if ("cb" === ctrl.compType) {
if (
(ctrl
.filter((item) => item.checked)
.forEach((item) => {
item.checked = !1;
}),
Array.isArray(value))
)
value.forEach((val) => {
const select = ctrl.find(
(item) => item.dataset.val === val + ""
);
select && (select.checked = !0);
});
else {
const select = ctrl.find(
(item) => item.dataset.val === value + ""
);
select && (select.checked = !0);
}
}
} else ctrl.value = value;
}
if (1 === arguments.length) {
const data = arguments[0];
for (const key in data) {
const pageData = data[key];
for (const key2 in pageData) {
setCompItem(key, key2, pageData[key2]);
}
}
} else {
setCompItem(arguments[0], arguments[1], arguments[2]);
}
}
function showEditArea(isShow = !0, callback = null) {
if (
(cfg.param.isIntervalRun &&
(cfg.timer && clearInterval(cfg.timer),
(cfg.timer = setInterval(() => {
const data = getAllData(),
oldType = cfg.state;
(cfg.state = "interval"),
runCallback(cfg.callback.interval, data),
(cfg.state = oldType),
(cfg.lastData = data);
}, cfg.interval))),
(cfg.state = "created"),
isShow)
) {
if (((cfg.oldData = getAllData()), "function" == typeof callback)) {
if (!1 === callback(cfg.oldData, cfg.oldData, cfg.baseData)) return;
}
cfg.state = "show";
}
(cfg.isEditing = isShow),
(doms.wrap.style.display = isShow ? "block" : "none"),
isShow &&
!doms.box.style.top &&
(doms.box.style.top =
window.innerHeight / 2 - doms.box.clientHeight / 2 + "px"),
callback && (cfg.callback = callback);
}
function runCallback(callback, data) {
let result;
if (callback) {
data || (data = getAllData());
const func = callback;
Array.isArray(func)
? func.curFn
? ((result = func[curFn](data, cfg.oldData, cfg.baseData)),
(func.curFn = null))
: func.forEach((fn) => {
result = fn(data, cfg.oldData, cfg.baseData);
})
: "function" == typeof callback &&
(result = func(data, cfg.oldData, cfg.baseData));
}
return result;
}
function toPageObj({ settings, param = {}, otherPageName = "无分类" } = {}) {
param = { ...param };
const pageArr = [],
menuList = [];
let isOtherType = !1;
for (let key in settings) {
const item = settings[key];
item.type
? menuList.includes(item.type) || menuList.push(item.type)
: isOtherType || (isOtherType = !0);
}
return (
isOtherType && menuList.push(otherPageName),
menuList.forEach((menuTt) => {
const components = [],
page = { id: menuTt, components },
arr = [];
for (let key in settings) {
const item = settings[key];
menuTt === otherPageName
? item.type || arr.push(item)
: item.type === menuTt && arr.push(item);
}
arr.forEach((item) => {
let desc = item.desc || item.txt || "";
desc && (desc = desc.replaceAll("\n", "<br>").trim());
let comp,
base = item.base;
if (
(Array.isArray(base) && (base = base.join(", ")), item.groupTitle1)
) {
const comp = {
id: item.key + "-gTt1",
type: "title",
value: item.groupTitle1,
};
components.push(comp);
}
if (item.groupTitle2) {
const comp = {
id: item.key + "-gTt2",
type: "title2",
value: item.groupTitle2,
};
components.push(comp);
}
if (item.groupTitle3) {
const comp = {
id: item.key + "-gTt3",
type: "title3",
value: item.groupTitle3,
};
components.push(comp);
}
if (item.groupDesc) {
const comp = {
id: item.key + "-gDesc",
type: "desc",
value: item.groupDesc,
};
components.push(comp);
}
if (
(["menuTitle", "title", "desc", "title2", "title3"].includes(
item.compType
)
? ((comp = { ...item }),
(comp.type = comp.compType),
(comp.desc = desc))
: (comp = {
id: item.key,
type: item.compType,
tt: item.tt || "",
title: item.title || "",
desc,
descTt: item.descTt || "",
name: item.key,
value: item.value,
base: item.base,
}),
"textarea" === comp.type)
)
(comp.ph = base),
(comp.width = item.compW),
(comp.height = item.compH),
(comp.ctrlTt = "默认: " + base);
else if ("radio" === comp.type || "checkbox" === comp.type) {
let str = "默认: ";
if ("checkbox" === comp.type) {
let arr = item.base;
Array.isArray(arr) || (arr = arr.split(/,|,/)),
arr.forEach((val, i) => {
0 !== i && (str += ", "), (val = val.trim());
let valTxt = item.valueText[val];
void 0 === valTxt && (valTxt = val), (str += valTxt);
});
} else {
let val = item.valueText[item.base];
void 0 === val && (val = item.base), (str += val);
}
comp.ctrlTt = str;
}
if (item.valueText) {
comp.radioList = [];
for (let key in item.valueText) {
const rd = { text: item.valueText[key], value: key };
comp.radioList.push(rd);
}
}
components.push(comp);
}),
pageArr.push(page);
}),
(param.page = pageArr),
param
);
}
function saveDatas({
allData,
settings,
keyBase = "",
verifyFn = {},
getValue,
setValue,
}) {
for (const pageName in allData) {
const page = allData[pageName];
for (const key in page) {
const value = page[key],
item = settings[key.replace(keyBase, "")];
if (!item) return void console.log("设置的数据对应的对象获取失败");
let verify;
for (const name in verifyFn)
if (settings[name].key === key) {
verify = settings[name].verify || verifyFn[name];
break;
}
setValue_setValue({
value,
base: item.base,
key,
verification: verify,
getValue,
setValue,
});
}
}
}
function finishedSettings({
allData,
settings,
keyBase = "",
verifyFn = {},
isForcedUpdate = !1,
isRefreshPage = !1,
callback = null,
getValue,
setValue,
} = {}) {
if (!isForcedUpdate) {
if (
!(function isValueChange(type = "auto") {
const param = cfg.param,
curData = getAllData(),
curDataStr = JSON.stringify(curData);
let oldDataStr;
return (
"auto" === type &&
("interval" === cfg.state &&
param.isIntervalRun &&
(type = "interval_current"),
"finished" === cfg.state && (type = "auto")),
(oldDataStr =
"interval_current" === type
? JSON.stringify(cfg.lastData)
: "base_current" === type
? JSON.stringify(cfg.baseData)
: JSON.stringify(cfg.oldData)),
"{}" !== oldDataStr && curDataStr !== oldDataStr
);
})()
)
return;
}
saveDatas({ allData, settings, keyBase, verifyFn, getValue, setValue }),
callback && "function" == typeof callback && callback(allData),
isRefreshPage && history.go(0);
}
function showSettings() {
const settings = info.settings;
info.settingsArea = (function createEdit({
settings,
param = {},
oldEditCfg,
updateDataFn,
isNewEdit = !0,
isSyncOtherPage = !0,
otherPageName = "无分类",
} = {}) {
let oldSettings, curSettings;
updateDataFn &&
isSyncOtherPage &&
((oldSettings = JSON.stringify(settings)),
(settings = updateDataFn() || settings),
(curSettings = JSON.stringify(settings)));
const editInfo = { settings, param, otherPageName };
if (oldEditCfg) {
if (isNewEdit)
return (
oldEditCfg.doms.wrap.remove(), createEditEle(toPageObj(editInfo))
);
isSyncOtherPage &&
updateDataFn &&
oldSettings !== curSettings &&
(oldEditCfg.doms.wrap.remove(),
(oldEditCfg = createEditEle(toPageObj(editInfo)))),
isSyncOtherPage &&
!updateDataFn &&
(oldEditCfg.doms.wrap.remove(),
(oldEditCfg = createEditEle(toPageObj(editInfo))));
} else oldEditCfg = createEditEle(toPageObj(editInfo));
return oldEditCfg;
})({
settings,
param: {
bg: "rgba(0, 0, 0, 0)",
resetTt: "重置当前页的所有设置为默认值",
isOnlyResetCurPage: !0,
isIntervalRun: !0,
},
oldEditCfg: info.settingsArea,
updateDataFn: () => getData(settings, GM_getValue, GM_setValue),
});
showEditArea(!0, {
resetBefore: () => confirm("是否重置当前页的所有设置为默认值?"),
confirmBefore: () => {},
finished: (data, oldData) => {
console.log(data),
finishedSettings({
allData: data,
settings,
keyBase: info.keyBase,
verifyFn: settings,
callback: updateShow,
getValue: GM_getValue,
setValue: GM_setValue,
});
const f1 = verifyWebsite(
oldData[settings.website.type][
settings.website.key.repeat(info.keyBase, "")
]
),
f2 = verifyWebsite(settings.website.value);
if (f1 && !f2)
return (
setDarkMode(!1),
info.modeBtn && info.modeBtn.remove(),
void (info.timer && clearInterval(info.timer))
);
!f1 && f2 && (setStartStopTimer(), createDarkModeBtn());
},
interval: (data, oldData) => {
finishedSettings({
allData: data,
settings,
keyBase: info.keyBase,
verifyFn: settings,
callback: updateShow,
getValue: GM_getValue,
setValue: GM_setValue,
});
},
cancelled: (data, oldData) => {
saveDatas({
allData: oldData,
settings,
keyBase: info.keyBase,
verifyFn: settings,
getValue: GM_getValue,
setValue: GM_setValue,
}),
getData(settings, GM_getValue, GM_setValue),
updateShow();
},
});
}
const settings = info.settings;
function page_darkMode_bindEvents() {
const urlChangeHandle = () => {
const id = info.keyBase + "css",
dom = document.body.querySelector("#" + id);
(dom && dom.isDark) || (info.isDarkMode = !1);
};
let _wr = function (type) {
let orig = history[type];
return function () {
let rv = orig.apply(this, arguments),
e = new Event(type);
return (e.arguments = arguments), window.dispatchEvent(e), rv;
};
};
(history.pushState = _wr("pushState")),
(history.replaceState = _wr("replaceState")),
window.addEventListener("popstate", urlChangeHandle),
window.addEventListener("replaceState", urlChangeHandle),
window.addEventListener("pushState", urlChangeHandle);
}
!(function main() {
if (
(getData(settings, GM_getValue, GM_setValue),
(function getOtherData() {
const settings = info.otherSettings,
autoWay = info.settings.autoDarkModeWay.value;
for (const valName in settings) {
const setting = settings[valName];
setting.value = getValue({
base: setting.base,
key: setting.key,
valType: setting.valType,
getVal: autoWay ? GM_getValue : null,
setVal: autoWay ? GM_setValue : null,
});
}
})(),
(function registerMenu(f) {
let urlTxt = "*" + location.host + "*";
verifyWebsite(settings.website.value)
? GM_registerMenuCommand("当前网站: 已启用✔️", () => {
const urlList = settings.website.value.trim().split("\n"),
i = urlList.indexOf("*");
-1 !== i && urlList.splice(i, 1);
let index = urlList.indexOf(urlTxt);
-1 !== index
? urlList.splice(index, 1)
: urlList
.filter((item) => matchUrlWithWildcard(location.href, item))
.map((item) => urlList.indexOf(item))
.forEach((item) => {
let i = urlList.indexOf(item);
urlList.splice(i, 1);
});
const urlListTxt = urlList.join("\n");
GM_setValue(settings.website.key, urlListTxt), history.go(0);
})
: GM_registerMenuCommand("当前网站: 已禁用❌", () => {
const urlList = settings.website.value.trim().split("\n"),
i = urlList.indexOf("*");
-1 !== i && urlList.splice(i, 1), urlList.push(urlTxt);
const urlListTxt = Array.from(new Set(urlList)).join("\n");
GM_setValue(settings.website.key, urlListTxt), history.go(0);
}),
GM_registerMenuCommand("设置", () => {
showSettings();
});
})(),
verifyWebsite(settings.website.value))
)
if (
(settings.autoDarkMode.value
? info.otherSettings.oldDarkMode.value && setDarkMode(!0)
: (setValue_setValue({
value: !1,
base: !1,
key: info.keyBase + "oldDarkMode",
}),
setValue_setValue({
value: !1,
base: !1,
key: info.keyBase + "oldDarkMode",
getValue: GM_getValue,
setValue: GM_setValue,
})),
setDarkMode(info.isDarkMode),
document.body)
)
setStartStopTimer(), createDarkModeBtn(), page_darkMode_bindEvents();
else {
const bodyObserver = new MutationObserver(() => {
document.body &&
(bodyObserver.disconnect(),
setStartStopTimer(),
createDarkModeBtn(),
page_darkMode_bindEvents());
});
bodyObserver.observe(document, { childList: !0, subtree: !0 });
}
})();
})();