MediaWiki:Common.js:修订间差异

此后如竟没有炬火,我便是唯一的光。
跳转到导航 跳转到搜索
无编辑摘要
(暂时置于此)
第23行: 第23行:
continue;
continue;
choose.firstChild.style.display = 'none';
choose.firstChild.style.display = 'none';
choose.children[Math.floor(Math.random() * choose.children.length)].display = 'initial';
choose.children[Math.floor(Math.random() * choose.children.length)].style.display = 'initial';
}
}
});
});

2024年1月23日 (二) 18:02的版本

/* 这个文件内的JavaScript源码将为所有PC用户在每次页面载入时加载 */
/* 原版大部分功能已改为使用 Gadgets 进行模块化加载*/
/* 这些源码执行和希顶WIKI相同的 “知识共享署名-相同方式共享 4.0” 协议 */

/* 这里的代码将运行并在大多数PC端的主题里进行一定程度的页面调整 */
/* 需要注意MeadiaWiki的代码预处理器仅支持较旧的JavaScript语法,如for of语句在此环境下不可用 */
/* 需要在dom加载完后执行或需等待局部加载完毕执行的函数请在本文件末尾的指定位置调用 */
$(function() {
    //全文转希顶文字
    document.getElementById('ca-varlang-3')
        .firstChild.innerHTML = '全文转希顶<small>不建议</small>';
    if(document.querySelector("#p-variants-label > span")
        .innerText == '新加坡简体')
        document.querySelector("#p-variants-label > span")
        .innerText = '全文转希顶';

    // 处理选择
    var chooses = document.getElementsByClassName('choose-container');
    for (var i = 0; i < chooses.length; ++i) {
        var choose = chooses[i];
        if (!choose.firstChild)
            continue;
        choose.firstChild.style.display = 'none';
        choose.children[Math.floor(Math.random() * choose.children.length)].style.display = 'initial';
    }
});