User:PeterL/vector.js

importScript('User:MordantMaenad/scripts/hotstubcat.js'); importScript('User:PeterL/exasperation.js'); importScript('MediaWiki:Gadget-HotCat.js'); importScript('MediaWiki:Gadget-UTCLiveClock.js'); importScript('MediaWiki:Gadget-subpages.js'); importScript('MediaWiki:Gadget-smileybox.js'); importScript('MediaWiki:Gadget-userrights.js'); //importScript('MediaWiki:Gadget-smileylist.js'); function gettoken_api { var api = sajax_init_object; api.open('GET', wgServer + wgScriptPath + '/api.php?format=json&action=query&prop=info&indexpageids=1&intoken=edit&titles=Whatever', false); api.send(null); if(api.status==200) { var response = eval('(' + api.responseText + ')'); var token = response['query']['pages'][response['query']['pageids'][0]]['edittoken']; } else { alert('The token query returned an error.'); } return token; }

function botrollback { var rollbacklinks = getElementsByClassName(document.getElementById('bodyContent'),"*","mw-rollback-link"); var botrblinks = new Array; for (var j = 0; j< rollbacklinks.length; j++) { var rbbs = document.createElement('span'); var rba = rollbacklinks[j].getElementsByTagName('a')[0]; var rbba = document.createElement('a'); rbba.innerHTML = "as bot"; rbba.href = rba.href + '&bot=1'; if ( rollbacklinks[j].innerHTML[0] == "[" ) { rbbs.appendChild(document.createTextNode("[")); var blue_hack = document.createElement('a'); blue_hack.innerHTML = "rollback"; blue_hack.className = "mw-rollback-link"; blue_hack.href = rba.href; rbbs.appendChild(blue_hack); rbbs.appendChild(document.createTextNode(" | ")); }     rbbs.appendChild(rbba); if ( rollbacklinks[j].innerHTML[rollbacklinks[j].innerHTML.length-1] == "]" ) rbbs.appendChild(document.createTextNode("]")); if (rollbacklinks[j].nextSibling == undefined) { rollbacklinks[j].parentNode.appendChild(document.createTextNode(" ")); rollbacklinks[j].parentNode.appendChild(rbbs); rollbacklinks[j].parentNode.removeChild(rollbacklinks[j]); } else { rollbacklinks[j].parentNode.insertBefore(rbbs,rollbacklinks[j].nextSibling); rollbacklinks[j].parentNode.insertBefore(document.createTextNode(rbbs.nextSibling.textContent),rbbs); }     botrblinks.push(rbbs); } for (var j = 0; j< botrblinks.length; j++) { botrblinks[j].className = "mw-rollback-link"; } } addOnloadHook(botrollback);

addOnloadHook(function {    mw.util.addPortletLink("p-navigation", "/wiki/User:Capturebot2/console", "Console", "n-Console", "Capturebot console");    mw.util.addPortletLink("p-navigation", "/wiki/WIGO", "WIGO", "n-WIGO", "List of WIGOs");    mw.util.addPortletLink("p-navigation", "/wiki/RationalWiki:Kitzmiller_v._Dover_annotated_transcript", "KvD", "n-KvD", "Kitzmiller v. Dover annotated transcript main page");    mw.util.addPortletLink("p-tb", "/wiki/User:PeterL/vector.js", "v.js", "t-vector_js", "Vector.js");    mw.util.addPortletLink("p-tb", "/wiki/User:PeterL/vector.css", "v.css", "t-vector_css", "Vector.css"); });

/* function PostCP{ if (wgCanonicalSpecialPageName == "Recentchanges"){ var recent = getElementsByClassName(document.getElementById('bodyContent'),"ul","special"); var x; for (x=0;x=1;i=i-1) {    var bads=list[i].getElementsByTagName("a"); var j=0; for (j=0;j 0) {           parent.removeChild(list[i]); }    }   }  }  } } addOnloadHook(PostCP);

function Headcutoff{ if (wgCanonicalSpecialPageName == "Recentchanges"){ var recent = getElementsByClassName(document.getElementById('bodyContent'),"ul","special"); var x; for (x=0;x=1;i=i-1) {    var bads=list[i].getElementsByTagName("a"); var j=0; for (j=0;j 0) {           parent.removeChild(list[i]); }    }   }  }  } } addOnloadHook(Headcutoff);

function goaway{ if (wgCanonicalSpecialPageName == "Recentchanges"){ var recent = getElementsByClassName(document.getElementById('bodyContent'),"ul","special"); var x; for (x=0;x=1;i=i-1) {    var bads=list[i].getElementsByTagName("a"); var j=0; for (j=0;j 0) {           parent.removeChild(list[i]); }    }   }  }  } } addOnloadHook(goaway);

function Robbegone{ if (wgCanonicalSpecialPageName == "Recentchanges"){ var recent = getElementsByClassName(document.getElementById('bodyContent'),"ul","special"); var x; for (x=0;x=1;i=i-1) {    var bads=list[i].getElementsByTagName("a"); var j=0; for (j=0;j 0) {           parent.removeChild(list[i]); }    }   }  }  } } addOnloadHook(Robbegone);

function Bricksandmortar{ if (wgCanonicalSpecialPageName == "Recentchanges"){ var recent = getElementsByClassName(document.getElementById('bodyContent'),"ul","special"); var x; for (x=0;x=1;i=i-1) {    var bads=list[i].getElementsByTagName("a"); var j=0; for (j=0;j 0) {           parent.removeChild(list[i]); }    }   }  }  } } addOnloadHook(Bricksandmortar);

function blocklog{ if (wgCanonicalSpecialPageName == "Watchlist"){ var wlist = getElementsByClassName(document.getElementById('bodyContent'),"ul","special"); var x; for (x=0;x=0;i=i-1) {    var bads=list[i].getElementsByTagName("a"); var j=0; for (j=0;j 0) {           parent.removeChild(list[i]); }    }   }  }  } } addOnloadHook(blocklog);