User:Hans Adler/vector.js

mathJax={}; mathJax.fontDir="http://cdn.mathjax.org/mathjax/latest/fonts"; importScript('User:Nageh/mathJax.js'); //see http://en.wikipedia.org/w/index.php?&oldid=436335399

importScript('User:Hans Adler/editor.js'); importScript('User:Hans Adler/superwatchlist.js'); importScript('User:Amalthea/userhighlighter.js'); importScript('User:Anomie/linkclassifier.js'); // Linkback: User:Anomie/linkclassifier.js importStylesheet('User:Anomie/linkclassifier.css'); // Linkback: User:Anomie/linkclassifier.css importScript('User:AndyZ/peerreviewer.js'); importScript('User:Dr_pda/prosesize.js'); importScript('User:js/watchlist.js'); importScript('User:Barticus88/WhatLinksHere.js'); importScript('User:Alex Smotrov/histcomb.js'); importScript('User:ais523/highlightmyname2.js');

// from User:Misza13/watchlistSorter.js

addOnloadHook(function{ if (location.href.indexOf('Special:Watchlist') == -1) return; //Are we on a watchlist?  //days = document.getElementById('bodyContent').getElementsByTagName('ul');  days = document.evaluate( //Hell knows how it works - found in "Dive into Greasemonkey" "//ul[@class='special']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (d = 0; d < days.snapshotLength; d++) { //For each day    day = days.snapshotItem(d);    newday = document.createElement('ul'); //This will replace the old listing    while ((diffs = day.getElementsByTagName('li')).length > 0) { //Are there any diffs left?      //Try to extract the namespace      As = diffs[0].getElementsByTagName('a');      if (As[0].innerHTML == 'diff')        pagename = As[2].innerHTML;      else        pagename = As[1].innerHTML;      if (pagename.indexOf(':') == -1)        namespace = 'Main';      else        namespace = pagename.split(':')[0]; //This will fail for articles which contain ":" in name      hdrs = newday.getElementsByTagName('h5'); //Get the list of namespace headers      hdr = null;      for (j=0; j<hdrs.length; j++) //Find the header        if (hdrs[j].innerHTML==namespace) {          hdr = hdrs[j]; break;        }      if (hdr==null) { //Not found? Make a new one! hdr = document.createElement('h5'); hdr.innerHTML = namespace; newday.appendChild(hdr); namespacesub = document.createElement('ul'); namespacesub.className = "special"; newday.appendChild(namespacesub); }     hdr.nextSibling.appendChild(diffs[0]); //Move the diff }   newday.appendChild(document.createElement('hr')); //For readablility day.parentNode.replaceChild(newday,day); } });

// from User:Ilmari Karonen/rollbacksummary.js // Prompt for an edit summary when clicking a rollback link addOnloadHook(function {    var serverRe = mw.config.get('wgServer').replace(/([^A-Za-z0-9_])/g, "\\$1");     var scriptRe = mw.config.get('wgScript').replace(/([^A-Za-z0-9_])/g, "\\$1");     var rollbackRe = new RegExp ("^(" + serverRe + ")?" + scriptRe + "\\?([^#]*&)?action=rollback(&|$)");   var promptSummary = function  {        var summary = prompt("Enter rollback summary (or leave as \"default\" to use default summary):", "default");        if (summary == null || summary == "") return false;        if (summary == "default") return true;        this.href = this.href.replace("?", "?summary=" + encodeURIComponent(summary) + "&notminor=true&");        return true;    };    var links = document.getElementsByTagName("a");    for (var i = 0; i < links.length; i++) {        if (rollbackRe.test(links[i].href)) links[i].onclick = promptSummary;    } });

// from Wikipedia:WikiProject User scripts/Scripts/User tabs addOnloadHook(function { if (mw.config.get('wgTitle').indexOf("/") != -1 || document.title.indexOf("- History -") != -1)  //no subpages or history     return;  if (mw.config.get('wgCanonicalNamespace') == "User" || mw.config.get('wgCanonicalNamespace') == "User_talk") {     var username = encodeURIComponent( mw.config.get('wgTitle') );     addPortletLink("p-cactions", "http://toolserver.org/~interiot/cgi-bin/count_edits?user=" + username + "&dbname=enwiki_p", "Edit count", "ca-editcount", "Edit count from Interiot's Tool3");     addPortletLink("p-cactions", mw.config.get('wgServer') + "/w/index.php?title=Special:Log&type=block&page=User:" + username, "Blocks received", "ca-blog", "Blocks received by this user");     addPortletLink("p-cactions", mw.config.get('wgServer') + "/w/index.php?title=Special:Prefixindex&from=" + username + "&namespace=2", "Userspace", "", "List of pages in this user's userspace"); } });

addOnloadHook(function { if(mw.config.get('wgCanonicalNamespace') == "Category")  {    addPortletLink('p-cactions', 'http://toolserver.org/~daniel/WikiSense/CategoryIntersect.php?wikilang=en&wikifam=.wikipedia.org&basecat=' + mw.config.get('wgTitle'), 'catscan', 'ca-catscan', 'CatScan category search');  } });

importScript('User:Pyrospirit/metadata/projectbanners.js'); //User:Pyrospirit/metadata/projectbanners.js

// from User:Gary King/expand hidden templates.js :

if (typeof(unsafeWindow) != 'undefined') {	var addPortletLink = unsafeWindow.addPortletLink; var collapseTable = unsafeWindow.collapseTable; var expandHiddenTemplates = expandHiddenTemplates; var toggleNavigationBar = unsafeWindow.toggleNavigationBar; var wgAction = unsafeWindow.mw.config.get('wgAction'); } if (typeof(expandHiddenTemplates) == 'undefined') expandHiddenTemplates = {}; expandHiddenTemplatesMain = function {	if (mw.config.get('wgAction') != 'view' && mw.config.get('wgAction') != 'submit' && mw.config.get('wgAction') != 'edit' && mw.config.get('wgAction') != 'purge') return; // .collapseButton var buttons = document.getElementsByClassName('collapseButton'); for (var i = 0; i < buttons.length; i++) eval(buttons[i].childNodes[1].href); // .NavToggle var toggles = document.getElementsByClassName('NavToggle'); for (var i = 0; i < toggles.length; i++) eval(toggles[i].href); if (buttons.length == 0 && toggles.length == 0) alert('There are no templates to expand on this page.'); else {		var nodeText = document.getElementById('t-expand-hidden-templates').firstChild.firstChild.firstChild; if (nodeText.nodeValue == 'Expand templates') nodeText.nodeValue = 'Collapse templates'; else nodeText.nodeValue = 'Expand templates'; } } expandHiddenTemplatesPortletLink = function {	if (addPortletLink) {		if (typeof(expandHiddenTemplates) == 'undefined') expandHiddenTemplates = {}; if (typeof(expandHiddenTemplates.addTab) == 'undefined') expandHiddenTemplates.addTab = false; if (typeof(expandHiddenTemplates.addToNavigation) == 'undefined') expandHiddenTemplates.addToNavigation = false; if (expandHiddenTemplates.addTab) addPortletLink('p-cactions', 'javascript:expandHiddenTemplatesMain', 'Expand templates', 't-expand-hidden-templates', 'Expands or hides all collapsible templates'); if (expandHiddenTemplates.addToNavigation) addPortletLink('p-navigation', 'javascript:expandHiddenTemplatesMain', 'Expand templates', 't-expand-hidden-templates', 'Expands or hides all collapsible templates'); if (!expandHiddenTemplates.addTab && !expandHiddenTemplates.addToNavigation) addPortletLink('p-tb', 'javascript:expandHiddenTemplatesMain', 'Expand templates', 't-expand-hidden-templates', 'Expands or hides all collapsible templates'); } } if (typeof(unsafeWindow) == 'undefined') addOnloadHook(expandHiddenTemplatesPortletLink); else expandHiddenTemplatesPortletLink; if (typeof(unsafeWindow) != 'undefined') unsafeWindow.expandHiddenTemplatesMain = expandHiddenTemplatesMain;