“User:Bhsd/widget/songposition.js”的版本间差异

无编辑摘要
标签移动版网页编辑 移动版编辑
/* global mw, $ */
(() => {
const timermain = setInterval(() => {
if (!window.jQuery) { return; }
clearInterval(timer);
mw.widget = mw.widget || {};
if (mw.widget.songposition) { return; }
console.log('End setInterval: jQuery加载完毕,开始执行Widget:Songposition');
const target = '.member-symbol',
map = new Map(),
$label = $('<div>', {html: '<div>'}),
$body = $(' document.body' ).on('mouseenter focus', target, function() {
$label.children( 'div' ).html( map.get(this) );
});
});
mw.loader.using(['oojs-ui-core', 'ext.gadget.site-lib']).then(() => {
mw.tipsy($body, target, {classes: ['member-popup', 'mw-tipsy']}, $label);
});
mw.widget.songposition = true;
}, 500);
if (!window.jQuery) { returnmain(); }
else { window.addEventListener('jquery', main); }
}) ();
//</nowiki>
16,874

个编辑