User:Azliq7/global.js

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // SCRIPTS (MONOBOOK) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function purgeTab { var what; var url;

if (!(what = document.getElementById('ca-history') )) return; if (!(url = what.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return;

addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'), 'purge', 'ca-purge', 'Purge server cache for this page', '0'); }

function whatLinksHereTab { var what; var url;

if (!(what = document.getElementById('t-whatlinkshere') )) return; if (!(url = what.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return;

addPortletLink('p-cactions', url, 'what links here', 'ca-whatlinkshere', 'List of all wiki pages that link here'); }

function userContributionsTab { if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") { var what; var url;

if (!(what = document.getElementById('t-contributions') )) return; if (!(url = what.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return;

addPortletLink('p-cactions', url, 'contributions', 'ca-usercontibutions', 'View the list of contributions of this user', 'j'); } }

function uploadNewVersionTab { if (wgCanonicalNamespace == "File") { var url; url = wgServer; url += wgScript; url += '?title=Special:Upload&wpDestFile='; url += wgTitle.replace(" ", "_"); url += '&wpForReUpload=1';

addPortletLink('p-cactions', url, 'upload new version', 't-upload', 'Upload a new version of this file [u]', 'u'); } }

if(skin == "monobook") { addOnloadHook(purgeTab); addOnloadHook(whatLinksHereTab); addOnloadHook(userContributionsTab); addOnloadHook(uploadNewVersionTab); }

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////