16,874
个编辑
LLWiki正在建设中,欢迎加入我们!
小 |
小 |
||
/*global mw, $, OO*/
(() => {
let popup, label;
function main($content) {▼
function prepare() {
mw.loader.using( 'oojs-ui-core' ).then(() => {
popup.$element.appendTo( 'body' );
$content.find( '.member-symbol' ).each(function() { this.dataset.title = this.title; })▼
.removeAttr( 'title' ).attr('tabIndex', -1).on('mouseenter focus', function() {▼
const self = $(this);▼
label.text( self.data('title') );▼
popup.setFloatableContainer( self ).toggle(true);▼
}).on('mouseleave blur', () => { popup.toggle(false); });▼
});
}
▲ function main($content) {
▲
}
console.log( 'setInterval: 等待jQuery加载完毕' );
clearInterval(jqueryTimer);
console.log(`End setInterval: jQuery加载完毕,用时 ${Date.now() - timerStart} ms`);
prepare();
mw.hook( 'wikipage.content' ).add($content => { main($content); });
}, 500);
|