MCBBS Wiki欢迎您共同参与编辑!在参与编辑之前请先阅读Wiki方针

如果在编辑的过程中遇到了什么问题,可以去讨论板提问。

为了您能够无阻碍地参与编辑 未验证/绑定过邮箱的用户,请尽快绑定/验证

MCBBS Wiki GitHub群组已上线!

您可以在回声洞中发表吐槽!

服务器状态监控。点击进入

本站由MCBBS用户自行搭建,与MCBBS及东银河系漫游指南(北京)科技有限公司没有从属关系。点此了解 MCBBS Wiki 不是什么>>

MediaWiki:HanziConverter.js:修订间差异

跳到导航 跳到搜索
删除3字节 、​ 2021年4月15日 (星期四)
处理一个因加载时序问题导致的小问题
(.)
(处理一个因加载时序问题导致的小问题)
第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, HanziConverter = window.HanziConverterFunction;
     const log = console.log, time = console.time, timeEnd = console.timeEnd;
     /**开关功能 */
     /**开关功能 */
     function userSwitch() {
     function userSwitch() {
第117行: 第117行:
         }, 1500);
         }, 1500);
         // 整活
         // 整活
         log(HanziConverter(prefix + ' 一只忧郁的台湾乌龟', type));
         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 = HanziConverter(node.textContent, type);
                     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_ = HanziConverter(_temp, type);
                 let _temp_ = window.HanziConverterFunction(_temp, type);
                 if (_temp_ != _temp)
                 if (_temp_ != _temp)
                     n.setAttribute(attr, _temp_);
                     n.setAttribute(attr, _temp_);
我们提供服务需要使用Cookie。您使用我们的服务,即表示您同意我们使用Cookie。

导航菜单