3,389
个编辑
MCBBS Wiki欢迎您共同参与编辑!在参与编辑之前请先阅读Wiki方针。
如果在编辑的过程中遇到了什么问题,可以去讨论板提问。
为了您能够无阻碍地参与编辑 未验证/绑定过邮箱的用户,请尽快绑定/验证。
MCBBS Wiki GitHub群组已上线!
您可以在回声洞中发表吐槽!
服务器状态监控。点击进入
本站由MCBBS用户自行搭建,与MCBBS及东银河系漫游指南(北京)科技有限公司没有从属关系。点此了解 MCBBS Wiki 不是什么>>
Salt lovely(留言 | 贡献) 小 (.) |
Salt lovely(留言 | 贡献) 小 (处理一个因加载时序问题导致的小问题) |
||
| 第22行: | 第22行: | ||
const ignoreElements = ['TEXTAREA', 'STYLE', 'SCRIPT', 'INPUT']; | const ignoreElements = ['TEXTAREA', 'STYLE', 'SCRIPT', 'INPUT']; | ||
const scanAttributes = ['title', 'placeholder']; | const scanAttributes = ['title', 'placeholder']; | ||
const log = console.log, time = console.time, timeEnd = console.timeEnd | const log = console.log, time = console.time, timeEnd = console.timeEnd; | ||
/**开关功能 */ | /**开关功能 */ | ||
function userSwitch() { | function userSwitch() { | ||
| 第117行: | 第117行: | ||
}, 1500); | }, 1500); | ||
// 整活 | // 整活 | ||
log( | log(window.HanziConverterFunction(prefix + ' 一只忧郁的台湾乌龟', type)); | ||
} | } | ||
/** */ | /** */ | ||
| 第138行: | 第138行: | ||
let node = nodes[i]; | let node = nodes[i]; | ||
if (typeof node.textContent == 'string') { | if (typeof node.textContent == 'string') { | ||
let _temp = | let _temp = window.HanziConverterFunction(node.textContent, type); | ||
if (node.textContent != _temp) // 防止过于频繁的写入 | if (node.textContent != _temp) // 防止过于频繁的写入 | ||
node.textContent = _temp; | node.textContent = _temp; | ||
| 第183行: | 第183行: | ||
let n = nodes[i]; | let n = nodes[i]; | ||
if (n instanceof HTMLElement && (_temp = (_a = n.getAttribute(attr)) !== null && _a !== void 0 ? _a : '').length > 0) { | if (n instanceof HTMLElement && (_temp = (_a = n.getAttribute(attr)) !== null && _a !== void 0 ? _a : '').length > 0) { | ||
let _temp_ = | let _temp_ = window.HanziConverterFunction(_temp, type); | ||
if (_temp_ != _temp) | if (_temp_ != _temp) | ||
n.setAttribute(attr, _temp_); | n.setAttribute(attr, _temp_); | ||