16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
(支持多种目标) |
小 |
||
target = targets.join(),
map = new Map(),
$
$body = $( '#bodyContent' ).on('mouseenter', target, function() {▼
$label.children( 'div' ).html( map.get(this) );▼
});▼
mw.hook( 'wikipage.content' ).add($content => { // 更新图片对应关系
if ($content.find( '.member-symbol-image' ).length === 0) { return; }
mw.loader.using(['oojs-ui-core', 'ext.gadget.site-lib']).then(() => {
for (const t of targets) {
const $label = $('<div>', {html: '<div>'});
▲ $label.children( 'div' ).html( map.get(this) );
▲ });
mw.tipsy($body, t, {id: `${t}-popup`}, $label);
}
|