完善哔哩哔哩评论发布与自动回执
分别处理纯文字原评论回复和双图顶层评论,完善相册匹配、最新评论核对与待核对恢复,并记录真机验收结果。
This commit is contained in:
+32
-6
@@ -370,6 +370,16 @@
|
||||
<option>匹配评论并回复</option>
|
||||
</select></dd>
|
||||
</div>
|
||||
<div id="bilibili-comment-scope-field" hidden>
|
||||
<dt><label for="bilibili-comment-scope">评论发布位置</label></dt>
|
||||
<dd>
|
||||
<select id="bilibili-comment-scope" class="control settings-input" aria-describedby="bilibili-comment-scope-hint">
|
||||
<option value="REPLY_TO_ORIGINAL">回复原评论(仅文字)</option>
|
||||
<option value="VIDEO_COMMENT">发布视频评论(可带图片)</option>
|
||||
</select>
|
||||
<p class="hint" id="bilibili-comment-scope-hint">将话术作为文字回复发到命中的原评论下。已绑定的图片会保留。</p>
|
||||
</dd>
|
||||
</div>
|
||||
<div><dt><label id="reply-limit-label" for="replies-per-video">每条视频回复上限</label></dt><dd><input id="replies-per-video" class="control settings-input" type="number" inputmode="numeric" min="1" max="100" value="1" required></dd></div>
|
||||
</dl>
|
||||
<p class="hint" id="reply-scope-hint">达到回复上限或找不到更多匹配评论时,进入下一个视频。</p>
|
||||
@@ -476,6 +486,9 @@
|
||||
const byId = id => document.getElementById(id);
|
||||
const scope = byId("search-scope");
|
||||
const platformPicker = byId("target-platform");
|
||||
const replyMode = byId("reply-mode");
|
||||
const bilibiliScopeField = byId("bilibili-comment-scope-field");
|
||||
const bilibiliScope = byId("bilibili-comment-scope");
|
||||
const typePicker = byId("content-type");
|
||||
const rulePicker = byId("keyword-rule");
|
||||
const phrasePicker = byId("reply-phrase");
|
||||
@@ -667,13 +680,23 @@
|
||||
redrawLibrary();
|
||||
});
|
||||
}
|
||||
platformPicker.addEventListener("change", () => {
|
||||
function updateCommentSettings() {
|
||||
const unit = platformPicker.selectedOptions[0].dataset.unit;
|
||||
const showBilibiliScope = platformPicker.value === "bilibili" && replyMode.selectedIndex === 1;
|
||||
const videoComment = showBilibiliScope && bilibiliScope.value === "VIDEO_COMMENT";
|
||||
const operation = videoComment ? "发布" : "回复";
|
||||
bilibiliScopeField.hidden = !showBilibiliScope;
|
||||
byId("bilibili-comment-scope-hint").textContent = videoComment
|
||||
? "根据匹配结果在当前视频发布评论,话术绑定的图片会随正文发送。"
|
||||
: "将话术作为文字回复发到命中的原评论下。已绑定的图片会保留。";
|
||||
byId("content-limit-label").textContent = `单次任务${unit}上限`;
|
||||
byId("reply-limit-label").textContent = `每条${unit}回复上限`;
|
||||
byId("reply-scope-hint").textContent = `达到回复上限或找不到更多匹配评论时,进入下一个${unit}。`;
|
||||
byId("reply-limit-label").textContent = `每条${unit}${videoComment ? "评论发布" : "回复"}上限`;
|
||||
byId("reply-scope-hint").textContent = `达到${operation}上限或找不到更多匹配评论时,进入下一个${unit}。`;
|
||||
byId("content-scope-hint").textContent = `按内容类型搜索${unit},按关键词匹配评论。每个关键词可配置多条话术。`;
|
||||
});
|
||||
}
|
||||
for (const picker of [platformPicker, replyMode, bilibiliScope]) {
|
||||
picker.addEventListener("change", updateCommentSettings);
|
||||
}
|
||||
byId("save-preview").addEventListener("click", () => {
|
||||
const status = byId("library-status");
|
||||
const invalid = [byId("video-limit"), byId("replies-per-video")].find(input => !input.validity.valid);
|
||||
@@ -686,9 +709,11 @@
|
||||
const searchTypes = selectedType ? [selectedType] : types;
|
||||
const type = byId("task-content-type");
|
||||
const progress = byId("task-progress");
|
||||
byId("task-mode").textContent = `${platform.text} · ${byId("reply-mode").value}`;
|
||||
const modeLabel = bilibiliScopeField.hidden ? replyMode.value : bilibiliScope.selectedOptions[0].text;
|
||||
const confirmedLabel = !bilibiliScopeField.hidden && bilibiliScope.value === "VIDEO_COMMENT" ? "已确认发布评论" : "已确认回复";
|
||||
byId("task-mode").textContent = `${platform.text} · ${modeLabel}`;
|
||||
byId("task-scope").textContent = `内容类型 ${searchTypes.length} 个 · 单次 ${limit} 个${unit}`;
|
||||
byId("task-summary").textContent = `已处理${unit} 0 / ${limit} · 已确认回复 0 条`;
|
||||
byId("task-summary").textContent = `已处理${unit} 0 / ${limit} · ${confirmedLabel} 0 条`;
|
||||
progress.max = limit;
|
||||
progress.setAttribute("aria-label", `已处理 0 个${unit},共 ${limit} 个`);
|
||||
type.hidden = searchTypes.length === 0;
|
||||
@@ -700,6 +725,7 @@
|
||||
invalid?.focus({ preventScroll: true });
|
||||
status.scrollIntoView({ block: "nearest", inline: "nearest" });
|
||||
});
|
||||
updateCommentSettings();
|
||||
redrawLibrary();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user