User:Xiplus/js/log-move-whatlinkshere.js

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

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。

javascript:
(function() {

    if (mw.config.get('wgCanonicalSpecialPageName') !== 'Log') {
        return;
    }

    mw.loader.using(['mediawiki.util']).done(function() {

        $('li.mw-logline-move>a.new:not(.mw-userlink)').each(function(_, e) {
            $(document.createTextNode(")")).insertAfter(e);
            var url = mw.config.get('wgScript') + '?' + $.param({
                title: 'Special:WhatLinksHere',
                target: mw.util.getParamValue('title', e.href),
            })
            $('<a href="' + url + '">連入</a>').insertAfter(e);
            $(document.createTextNode(" (")).insertAfter(e);
        });

    });

}
)();