Jump to content

User:Enterprisey/ipv6-subnet-link.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$(function() {
    if (mw.config.get('wgCanonicalSpecialPageName') === 'Contributions') {
        var a = mw.config.get('wgRelevantUserName');
        if (a && (a.split(':').length === 8) && (a.indexOf('/') < 0)) {
            mw.loader.using(['mediawiki.util'], function() {
                var b = 'Special:Contribs/' + a.split(':').slice(0, 4).join(':') + '::/64';
                $('.mw-contributions-user-tools').first().after('<p><a href="' + mw.util.getUrl(b) + '" title="' + b + '">' + b + '</a></p>');
            });
        }
    }
});