Jump to content

User:Happy-melon/vector.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.
//Import global .js
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Happy-melon/global.js&action=raw&ctype=text/javascript');
//importScript('MediaWiki:Common.js/shuffle.js');

if( mw.config.get('wgAction')=='view' && mw.config.get('wgNamespaceNumber')==10 ){ addOnloadHook( function(){
    try{
        var banner = document.getElementsByClassName('wpb')[0];
        var projectlink = banner.getElementsByClassName('wpb-project_link')[0].innerHTML;
        projectlink = projectlink.replace(/Wikipedia\:/,'');
        var bannername = banner.getElementsByClassName('wpb-banner_name')[0].innerHTML;
        bannername = bannername.replace(/Template\:/,'');
        if( bannername != projectlink ){
            var movelink = document.getElementById('ca-move').getElementsByTagName('a')[0];
            movelink.setAttribute(
                'href',
                '/w/index.php?title=Special:MovePage&target='+mw.config.get('wgPageName')+'&wpNewTitle=Template:'+escape(projectlink)+'&wpReason=More+descriptive+title&wpMovesubpages=1');
        }
    } catch(err) {
        return false;
    }
})}

var gw_sites = [ [ 'en' , 'wiki'          ] ,
                 [ ''   , 'mediawikiwiki' ] ,
                 [ ''   , 'metawiki'      ] ,
                 [ 'en' , 'wikibooks'     ] ,
                 [ ''   , 'commonswiki'   ] ,
                 [ 'es' , 'wiki'          ] ,
               ]
/*
$( function(){
if ( document.getElementById('citeselect') && document.getElementById('wpDiff') ) {
    var button = document.getElementById('citeselect').previousSibling;
    var dest = document.getElementById('wpDiff');
    dest.parentNode.appendChild( button );
}
})
/**/