User:Wifione/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.
// Add [[WP:Reflinks]] launcher in the toolbox on left
$(function () {
mw.util.addPortletLink(
"p-tb",     // toolbox portlet
"http://toolserver.org/~dispenser/cgi-bin/webreflinks.py/" + wgPageName
+ "?client=script&citeweb=on&overwrite=&limit=20&lang=" + wgContentLanguage,
"Reflinks"  // link label 
)});


/* Important tool for Good Article and Featured article reviewers and writers. Provides a complete analysis of the status of all external links */
/** Checklinks toolbox item ***************************************************
* 
*  Description: Adds an item in toolbox portlet that runs the checklinks tool 
*               on the viewed page.
*  Maintainers: [[User:Dispenser]]
*  Installation: Copy and paste following code into you /monobook.js
*  <nowiki>         {{subst:js|User:Dispenser/Link checker/toolbox.js}}
*  </nowiki>
*/
function checklinks(){
mw.util.addPortletLink('p-tb', 'http://toolserver.org/~dispenser/cgi-bin/webchecklinks.py?page=' + wgContentLanguage + ':' + wgPageName, 'Check external links', 't-checklinks');
}
if(wgIsArticle){
$(checklinks);
}
 
importScript('User:Lupin/recent2.js'); 
 
importScript('User:Quarl/wikipage.js');function addToToolbox() {
  if (wgCanonicalNamespace != "Special") {
 
   var pTb = document.getElementById("p-tb");
   var pRef = pTb.cloneNode(true);
   var pStats = pTb.cloneNode(true);
 
   pRef.id="p-refs";
   pRef.innerHTML = "<h5>Reference formatting</h5><div class=pBody><ul></ul></div>";
   pStats.id="p-stats";
   pStats.innerHTML = "<h5>Statistics</h5><div class=pBody><ul></ul></div>";
   pTb.parentNode.insertBefore(pRef, pTb.nextSibling);
   pTb.parentNode.insertBefore(pStats, pRef);
 
   var escPageName = escape(wgPageName).replace(/\+/g, '%2B').replace(/&/g, '%26').replace(/%u2013/g, '%96');
 
   mw.util.addPortletLink("p-refs", "http://tools.wikimedia.de/~verisimilus/Bot/DOI_bot/doibot.php?edit=toolbar&turbo=1&user="+wgUserName+"&page="+escPageName, 'Automatic (fast)', '', "Add DOIs to citations and fix common formatting errors. Turbo mode!");
   mw.util.addPortletLink("p-refs", "http://tools.wikimedia.de/~verisimilus/Bot/DOI_bot/doibot.php?edit=toolbar&slow=1&user="+wgUserName+"&page="+escPageName, 'Automatic (thorough)', '', "Add DOIs to citations and fix common formatting errors");
   //mw.util.addPortletLink("p-refs", "http://tools.wikimedia.de/~verisimilus/Scholar/RefTool.php?user="+wgUserName+"&wgPageName="+escPageName, 'Semi-automatic (experimental)', '', "Improve formatting of references – manually approve automatic improvements");
 
   now = new Date();
   var month = now.getMonth();
   var thisMonth = (now.getDay() > 6);
   if (thisMonth) month++;
   if (month == 0) var month=12;
   else var month =  ((month <10)?'0':'') + month;
   mw.util.addPortletLink("p-stats", "http://stats.grok.se/en/" + now.getFullYear() + month + "/"+wgPageName, 'Traffic stats', '', "Traffic to this page " + (thisMonth?'this':'last') + " month");
   mw.util.addPortletLink("p-stats", "http://wikidashboard.parc.com/wiki/"+wgPageName, 'Edit history stats', '', "Statistics about the edit history of this page");
 
    }
}
$(addToToolbox);