v1.8.0: 新增「发送内容」三选一(只发评论/只发私信不发评论/评论+私信),私信对象明确仅评论区用户;只发私信模式下按增量判断是否记为已处理
This commit is contained in:
1 parent
91c4666998
commit
a320658ac8
4 files changed
+50
-24
No files matched your search
+8
-7
@@ -14,11 +14,11 @@
|
||||
dlQuality: "80",
|
||||
maxN: 3,
|
||||
minPlay: 0,
|
||||
dmEnabled: false,
|
||||
sendWhat: "comment",
|
||||
dmCount: 2,
|
||||
dmText: ""
|
||||
};
|
||||
const FIELDS = ["baseUrl", "apiKey", "model", "keyword", "order", "mode", "customText", "sendMode", "tid", "region", "dlQuality", "maxN", "minPlay", "dmEnabled", "dmCount", "dmText"];
|
||||
const FIELDS = ["baseUrl", "apiKey", "model", "keyword", "order", "mode", "customText", "sendMode", "tid", "region", "dlQuality", "maxN", "minPlay", "sendWhat", "dmCount", "dmText"];
|
||||
|
||||
let settings = Object.assign({}, DEFAULTS);
|
||||
let running = false;
|
||||
@@ -73,9 +73,10 @@
|
||||
}
|
||||
|
||||
function refreshDmVisibility() {
|
||||
const cb = $("dmEnabled"), det = $("dmDetail");
|
||||
if (!cb || !det) return;
|
||||
det.style.display = cb.checked ? "block" : "none";
|
||||
const sel = $("sendWhat"), box = $("dmBox");
|
||||
if (!sel || !box) return;
|
||||
// 选了「只发私信」或「评论+私信」才展开私信设置区
|
||||
box.style.display = (sel.value === "dm" || sel.value === "both") ? "block" : "none";
|
||||
}
|
||||
|
||||
function refreshCustomVisibility() {
|
||||
@@ -339,7 +340,7 @@ function refreshCustomVisibility() {
|
||||
keyword: kw,
|
||||
maxN: Number(settings.maxN) || 3,
|
||||
minPlay: Number(settings.minPlay) || 0,
|
||||
dmEnabled: settings.dmEnabled === true || settings.dmEnabled === "true",
|
||||
sendWhat: ["comment", "dm", "both"].indexOf(settings.sendWhat) >= 0 ? settings.sendWhat : "comment",
|
||||
dmCount: Math.max(1, Math.min(5, Number(settings.dmCount) || 2)),
|
||||
dmText: String(settings.dmText || "").trim()
|
||||
}) });
|
||||
@@ -583,7 +584,7 @@ function refreshCustomVisibility() {
|
||||
: (el.type === "number") ? (Number(el.value) || 0) : el.value;
|
||||
saveField(k, v);
|
||||
if (k === "mode") refreshCustomVisibility();
|
||||
if (k === "dmEnabled") refreshDmVisibility();
|
||||
if (k === "sendWhat") refreshDmVisibility();
|
||||
if (k === "mode" || k === "apiKey" || k === "baseUrl" || k === "model" || k === "customText") refreshModeWarn();
|
||||
});
|
||||
if (el.tagName === "TEXTAREA" || el.type === "text" || el.type === "password") {
|
||||
|
||||
Reference in new issue
Block a user