跳转到内容

User:Jimmy Xu/common.js

维基百科,自由的百科全书

这是本页的一个历史版本,由Jimmy Xu留言 | 贡献2021年8月26日 (四) 18:25编辑。这可能和当前版本存在着巨大的差异。

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
var importScriptRL = function(page) {
    mw.loader.load(mw.config.get('wgScript') + '?title=' + mw.util.wikiUrlencode(page) + '&action=raw&ctype=text/javascript');
};

importScriptRL('User:Bencmq/Mass_rollback.js');
importScriptRL('User:Bencmq/script/CheckUser.js');
importScriptRL('User:Jimmy_Xu/scripts/SummaryByteCounter.js');
importScriptRL('User:Jimmy_Xu/scripts/cactions.js');
importScriptRL('User:Jimmy_Xu/scripts/sig.js');
importScriptRL('User:Jimmy_Xu/scripts/suppresslog.js');
importScriptRL('User:Kegns/prevent.js');
importScriptRL('User:Liangent/Scripts/UndoRange.js');

$(function() {
    if (/\/Wikipedia:(?:CV|%E9%A0%81%E9%9D%A2%E5%AD%98%E5%BB%A2%E8%A8%8E%E8%AB%96\/%E7%96%91%E4%BC%BC%E4%BE%B5%E6%AC%8A)$/.test(document.referrer)) {
        var $d = $('#ca-delete a');
        $d.attr('href', $d.attr('href') + encodeURI('&wpReason=侵犯版权'));
    }

    mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'User:Jimmy_Xu/common.js'), 'common.js', 'n-commonjs', 'common.js');
    mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'm:User:Jimmy_Xu/global.js'), 'global.js', 'n-globaljs', 'global.js');
    mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'User:Jimmy_Xu/common.css'), 'common.css', 'n-commoncss', 'common.css');
    mw.util.addPortletLink('p-navigation', mw.config.get('wgArticlePath').replace('$1', 'm:User:Jimmy_Xu/global.css'), 'global.css', 'n-globalcss', 'global.css');
    mw.util.addPortletLink('p-tb', mw.config.get('wgArticlePath').replace('$1', 'Special:PrefixIndex/' + encodeURIComponent(mw.config.get('wgPageName'))), '前缀索引', 't-prefixindex', '所有具有此前缀的页面', 'i', document.getElementById('t-upload'));

    $('abbr.newpage').each(function() {
        $(this).html('n');
    });
    $('abbr.minoredit').each(function() {
        $(this).html('m');
    });
    $('abbr.botedit').each(function() {
        $(this).html('b');
    });

    $('li#ca-wikilove a').text('友爱');
    $('li#ca-varlang-0 a').text('不');
    $('li#ca-varlang-1 a').text('简');
    $('li#ca-varlang-2 a').text('繁');
    $('li#ca-varlang-3 a').text('陆');
    $('li#ca-varlang-4 a').text('港');
    $('li#ca-varlang-5 a').text('澳');
    $('li#ca-varlang-6 a').text('马');
    $('li#ca-varlang-7 a').text('新');
    $('li#ca-varlang-8 a').text('台');

    if (mw.config.get('wgCanonicalSpecialPageName') === 'CheckUser') {
        if ($('#subedits') && $('#subedits')[0].checked) {
            $('#subipusers')[0].checked = true;
        }
        if ($('#checkuserblocksubmit')[0]) {
            $('#usetag')[0].checked = true;
            $('#blocktag')[0].value = '{' + '{indef}}';
            $('#blockreason')[0].value = '确认为傀儡';
        }
    }
});