全站通知:
用户:646195980/Emote.js
刷
历
编
跳到导航
跳到搜索
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:按 Ctrl-F5。
/**
* Emote.js | Inspiration comes from https://wiki.biligame.com/gt/?curid=17435
* Author: 飞小RAN (https://wiki.biligame.com/gt/User:646195980)
* License: See https://wiki.biligame.com/gt/User:646195980#License
**/
(async function() {
'use strict';
const response = await fetch('https://wiki.biligame.com/gt/MediaWiki:Emote.json?action=raw&ctype=application/json');
const emotes = await response.json();
document.querySelectorAll('.comment-text,.comment-text-mobile').forEach(comment=>{
emotes.forEach(emote=>{
comment.innerHTML = comment.innerHTML.replace(emote.text, `<img src="${emote.url}" alt="${emote.text}" title="${emote.title}" class="bili-rich-text-emoji">`);
});
});
})();