fix: 管理员编辑跳过邮箱校验 + 返回顶部 rAF 丝滑滚动 + admin.js 正则笔误 + 页面标题污染
- artalk.js: beforeSubmit 在编辑态跳过昵称/邮箱校验(管理员改评论不再被拦) - floating-tools.js: 返回顶部/去评论改 rAF + easeInOutCubic 自绘,原生 smooth 不可靠 - admin.js: 修 5 处 //s //n 正则笔误(整脚本 SyntaxError 致后台全灰),需 wrangler deploy - artalk.html: 显式传 pageTitle(不再读 document.title,PJAX 竞态致文章页标题被记成「留言」) - artalk.js: conf 缓存合并前剔除 pageKey/pageTitle/pageThumb,杜绝跨页串值
This commit is contained in:
1 parent
e8c991274a
commit
437cd339ad
4 files changed
+59
-10
No files matched your search
@@ -714,7 +714,7 @@ async function viewSettings() {
|
||||
if (/ip_region:[\s\S]*?enabled:\s*(true|false)/.test(v)) {
|
||||
v = v.replace(/(ip_region:[\s\S]*?enabled:\s*)(true|false)/, '$1' + on);
|
||||
} else {
|
||||
v += (v.endsWith('\n') ? '' : '\n') + 'ip_region://n enabled: ' + on + '\n';
|
||||
v += (v.endsWith('\n') ? '' : '\n') + 'ip_region:\n enabled: ' + on + '\n';
|
||||
}
|
||||
t.value = v;
|
||||
toast('已切换为 ' + (on ? '显示' : '隐藏') + ',保存后生效');
|
||||
@@ -722,7 +722,7 @@ async function viewSettings() {
|
||||
|
||||
// 人机验证快捷开关(自研「一键验证」):读写 yaml 里的 human_check.enabled,
|
||||
// 保存时由服务端同步到 KV(评论提交时读 KV,不占 D1 额度)
|
||||
var hcOn = /human_check:[\s\S]*?enabled://s*true/.test(original);
|
||||
var hcOn = /human_check:[\s\S]*?enabled:\s*true/.test(original);
|
||||
var hcRow = document.createElement('div');
|
||||
hcRow.style.cssText = 'display:flex;align-items:center;gap:8px;margin-bottom:10px;padding:10px 12px;' +
|
||||
'background:var(--surface);border:1px solid var(--line);border-radius:6px';
|
||||
@@ -736,10 +736,10 @@ async function viewSettings() {
|
||||
var on = this.checked;
|
||||
var t = $('#yamlTxt');
|
||||
var v = t.value;
|
||||
if (/human_check:[\s\S]*?enabled://s*(true|false)/.test(v)) {
|
||||
v = v.replace(/(human_check:[\s\S]*?enabled://s*)(true|false)/, '$1' + on);
|
||||
if (/human_check:[\s\S]*?enabled:\s*(true|false)/.test(v)) {
|
||||
v = v.replace(/(human_check:[\s\S]*?enabled:\s*)(true|false)/, '$1' + on);
|
||||
} else {
|
||||
v += (v.endsWith('\n') ? '' : '\n') + 'human_check://n enabled: ' + on + '\n';
|
||||
v += (v.endsWith('\n') ? '' : '\n') + 'human_check:\n enabled: ' + on + '\n';
|
||||
}
|
||||
t.value = v;
|
||||
toast('人机验证已' + (on ? '开启' : '关闭') + ',保存后生效');
|
||||
|
||||
Reference in new issue
Block a user