addOnloadHook(startVGRefs); //Initiates the script on page load
function startVGRefs(){ //Begins the script
if(wgCanonicalNamespace == ""){ // Namespace is article
mw.util.addPortletLink('p-tb','javascript:showVGRefs()','Video game sources','tb-vgrefs','Locate references for video game articles'); //Add link in toolbox
}
}
function showVGRefs(){
mw.util.addPortletLink('p-tb','javascript:keepCurWin(wgServer + "/wiki/Wikipedia:WikiProject_Video games/Sources#General")','----General','','Reviews, previews, screenshots, news, credits, summaries, and other features');
mw.util.addPortletLink('p-tb','javascript:keepCurWin(wgServer + "/wiki/Wikipedia:WikiProject_Video games/Sources#Aggregate_sites")','----Aggregators','','Sites that compile review scores from multiple sources to determine a game\'s average rating');
mw.util.addPortletLink('p-tb','javascript:keepCurWin("http://www.gamerankings.com/")','GameRankings','','Aggregator');
mw.util.addPortletLink('p-tb','javascript:keepCurWin("http://www.gamestats.com/")','GameStats','','Aggregator');
mw.util.addPortletLink('p-tb','javascript:keepCurWin("http://www.gametab.com/")','GameTab','','Aggregator');
mw.util.addPortletLink('p-tb','javascript:keepCurWin("http://www.metacritic.com/")','Metacritic','','Aggregator');
mw.util.addPortletLink('p-tb','javascript:keepCurWin("http://games.toptenreviews.com/")','TopTenREVIEWS','','Aggregator');
}
function keepCurWin(url){ //This is necessary so that clicking the VGRefs links doesn't mess up the current window
window.open(url);
}