LLWiki正在建设中,欢迎加入我们

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

来自LLWiki
跳转到导航 跳转到搜索
第7行: 第7行:
*/
*/
"use strict";
"use strict";
/* global mw, $ */
(() => {
(() => {
console.log( 'setInterval: 等待jQuery加载完毕' );
console.log( 'setInterval: 等待jQuery加载完毕' );

2021年1月16日 (六) 04:43的版本

//<nowiki>
// 用于[[Widget:Songposition]],可以使用ES6语法
/**
 * @Function: 鼠标移动至歌曲站位图标上方时提示角色姓名
 * @Dependencies: oojs-ui-core, ext.gadget.site-lib
 * @Author: [[User:Bhsd]]
 */
"use strict";
/* global mw, $ */
(() => {
    console.log( 'setInterval: 等待jQuery加载完毕' );
    const now = Date.now(),
        timer = setInterval(() => {
        if (!window.jQuery) { return; }
        clearInterval(timer);
        console.log(`End setInterval: jQuery加载完毕,用时 ${Date.now() - now} ms`);
        mw.widget = mw.widget || {};
        if (mw.widget.songposition) { return; }
        const $body = $('body');
        mw.loader.using(['oojs-ui-core', 'ext.gadget.site-lib']).then(() => {
            mw.tipsy($body, '.member-symbol', {classes: ['member-popup']});
        });
        mw.widget.songposition = true;
    }, 500);
}) ();
//</nowiki>
// [[category:jQuery小部件]] {{DEFAULTSORT:Songposition}}