Jump to content

User:Smith609/taxonomy.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.
// @Version 1.0 - Adds a "Update child lists" link to the toolbox.

function addTaxoLinksToToolbox() {
  if (mw.config.get('wgCanonicalNamespace') == "Template") {
   var pTb = document.getElementById("p-tb");
   if( !pTb ) return;
   var escPageName = encodeURIComponent(mw.config.get('wgPageName'));
   mw.util.addPortletLink("p-tb", "http://toolserver.org/~verisimilus/Bot/taxobot/update_child_list.php?page=Template:Taxonomy/"+escPageName, 'Update child list', '', "Update list of taxonomic children");
   mw.util.addPortletLink("p-tb", "http://toolserver.org/~verisimilus/Bot/taxobot_dev/taxobot.php?user=" + encodeURIComponent(mw.config.get('wgUserName')) + "&new_query=T&taxon=" + encodeURIComponent(mw.config.get('wgPageName')), 'Automate taxonomy', '', "Use the taxonomic information in this taxobox to generate 'automatic taxonomy pages'");
    }
}
if (mw.config.get('skin')) {
  addOnloadHook(addTaxoLinksToToolbox);
}