16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
标签:移动版网页编辑 移动版编辑 |
小 (// 使用Wikiplus小工具快速编辑) |
||
(未显示同一用户的10个中间版本) | |||
/* global mw, $ */
(() => {
const
if (!window.jQuery) { return; }▼
mw.widget = mw.widget || {};
if (mw.widget.songposition) { return; }
const targets = ['.member-symbol', '.member-graph'],
map = new Map(),
$
$body = $('body').on('mouseenter focus', target, function() {▼
$label.children( 'div' ).html( map.get(this) );▼
});▼
mw.hook( 'wikipage.content' ).add($content => { // 更新图片对应关系
if ($content.find( '.member-symbol-image' ).length === 0) { return; }
console.log('Hook: wikipage.content, 开始更新songposition的图片映射');
$content.find( target ).each(function() { map.set(this, $(this).next().find( '
});
mw.loader.using(['oojs-ui-core', 'ext.gadget.site-lib']).then(() => {
const $label = $('<div>', {html: '<div>'});
▲ $label.children( 'div' ).html( map.get(this) );
▲ });
mw.tipsy($body, t, {id: `${t.slice(1)}-popup`}, $label);
}
});
mw.widget.songposition = true;
}
else { window.addEventListener('jquery', main); }
}) ();
//</nowiki>
|