Jump to content

User:Hu12/monobook.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.
/* <pre><nowiki> */

// [[User:Lupin/popups.js]] - please include this line 
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'  
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
popupAdminLinks=true;

//</nowiki>[[Category:Wikipedia administrators who use VoA script|{{PAGENAME}}]]
// Call function to load when needed.
if (window.addEventListener) window.addEventListener("load",myLoadFuncs,false);
else if (window.attachEvent) window.attachEvent("onload",myLoadFuncs);
else
{
    window.previousLoadFunction = window.onload;
    window.onload = function()
    {
        window.previousLoadFunction();
        myLoadFuncs();
    }
}

// Load custom functions.
function myLoadFuncs()
{
// Add more toolbox links
 addToolBoxLinks();
// Add navbar links
 addNavBarLinks();
// Load custom tabs
 add_tabs();
}

// Add more personal links to the tollbox section.
function addToolBoxLinks()
{
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
    addlilink(tb, '/wiki/Wikipedia:Template messages/User_talk_namespace', 'Talk templates', '');
    addlilink(tb, '/wiki/Wikipedia:Template_messages', 'Templates', '');
    addlilink(tb, '/wiki/WP:CSD', 'SD criteria', '');
    addlilink(tb, '/wiki/Special:Log', 'Log', '');
    addlilink(tb, '/wiki/Special:Log/delete', 'Delete log', '');
    addlilink(tb, '/wiki/Special:Log/block', 'Block log', '');
    addlilink(tb, '/wiki/Special:Ipblocklist', 'IPBlocklist', '');
    addlilink(tb, '/wiki/Category:Wikipedia spam cleanup', 'Spam cleanup', '');
    addlilink(tb, 'http://tools.wikimedia.de/~erwin85/contribs.php', 'MultiUsr contrbs', '');
    addlilink(tb, 'http://toolserver.org/~tparis/rangecontribs/', 'IP Range Contribs ', '');
    addlilink(tb, 'http://wikipedia.ramselehof.de/wikiblame.php', 'Wikiblame', '');
    addlilink(tb, 'http://en.wikipedia.org/wiki/Special:AbuseLog?title=Special%3AAbuseLog&wpSearchUser=&wpSearchFilter=80&wpSearchTitle=', 'Edit filter log', '');
    addlilink(tb, 'http://toolserver.org/~seth/grep_regexp_from_url.cgi', 'search spamlists', '');
    addlilink(tb, 'http://wikiscanner.virgil.gr/', 'wikiscanner', '');
    addlilink(tb, 'http://toolserver.org/~eagle/crosswiki.php?search=&totalwikis=57', 'X-wiki link Srch', '');
    addlilink(tb, 'http://tools.wikimedia.de/~eagle/spamArchiveSearch.php', 'Anti Spam search', '');
    addlilink(tb, 'http://toolserver.org/~tparis/blame/', 'history search', '');
}

function addNavBarLinks()
{   
    var navbar = document.getElementById('p-navigation').getElementsByTagName('ul')[0];
    var afdtime = new Date();
    var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
    addlilink(navbar, '/wiki/Wikipedia:Articles_for_deletion/Log/' + afdtime.getUTCFullYear()
        + '_' + months[afdtime.getUTCMonth()] + '_' + afdtime.getUTCDate(), 'Todays AfD', '');
    afdtime.setUTCDate(afdtime.getUTCDate() - 5);
    addlilink(navbar, '/wiki/Wikipedia:Articles_for_deletion/Log/' + afdtime.getUTCFullYear()
        + '_' + months[afdtime.getUTCMonth()] + '_' + afdtime.getUTCDate(), '5-day old AfD', '');
    var username=document.getElementById("pt-userpage").textContent;
    addlilink(navbar, '/wiki/User:COIBot/Poke', 'COIBot/Poke', '');
    addlilink(navbar, '/wiki/User_talk:XLinkBot/RevertList', 'XLinkBot-RevertList', '');
    addlilink(navbar, '/wiki/MediaWiki_talk:Spam-blacklist', 'Spam-blacklist', '');
    addlilink(navbar, '/wiki/MediaWiki_talk:Spam-whitelist', 'Spam-whitelist', '');
    addlilink(navbar, '/wiki/Wikipedia_talk:WikiProject_Spam', 'WikiProject Spam', '');
    addlilink(navbar, '/w/index.php?title=Special%3ALinksearch&target=*.', 'Link Search', '');
}
//Mass rollback function
function rollbackEverythingButton() {
  var hasRollback = getElementsByClassName(document, "span", "mw-rollback-link");
  if (hasRollback[0] && (document.title.indexOf("User contributions") != -1) ) {
    mw.util.addPortletLink('p-cactions', 'javascript:rollbackEverything()', "rollback all", "ca-rollbackeverything", "rollback all edits displayed here");
  }
}
$(rollbackEverythingButton);
function rollbackEverything() {
    for (var i in document.links) {
      if (document.links[i].href.indexOf('action=rollback') != -1) {
        window.open(document.links[i].href);
      }
    }
}
//<nowiki> Helper tools
mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');
//</nowiki>
//<nowiki> Admin rollback tools [[Category:Wikipedia administrators who use VoA script|{{PAGENAME}}]]
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Specialadmin/monobook.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//</nowiki>[[Category:Wikipedia administrators who use VoA script|{{PAGENAME}}]]
// Diff page links
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Revert/monobook.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//
//<nowiki> History tools
mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/History/monobook.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');

//</nowiki>[[Category:Wikipedians who use VoA script|{{PAGENAME}}]]
/**** End ****/

/* </nowiki></pre> */