User:Bendono/monobook.js

$(function { addPortletLink ('p-tb', '/wiki/User:Bendono/References', 'References');  addPortletLink ('p-tb', 'http://en.wikipedia.org/w/index.php?title=Special%3APrefixindex&from=Bendono&namespace=2', 'Subpages');  addPortletLink ('p-tb', '/wiki/Special:MyPage/monobook.js', 'My monobook');

//Add tab to non-edit pages. //if (!document.forms.editform) //{ //  addTab; //}

//Add only to edit pages. if (document.forms.editform) {   addSpecialEditTools; } });

function addSpecialEditTools { editingTools = document.getElementById('toolbar');

if (editingTools != null) {   txtButton = "  ";

editingTools.innerHTML = editingTools.innerHTML + txtButton; } }

// Add tab function addTab { mw.util.addPortletLink("p-cactions", "javascript:toggle", "Toggle", "", "[TODO]", ""); }

// function toggle { //var childNodes = document.childNodes; //var contentDiv = document.getElementById('content'); //var childNodes = contentDiv.childNodes;

processNode(document);

//var txt = "";

//for (i = 0; i < childNodes.length; i++) //{ // var node = childNodes[i]; // txt += "Name: " + node.nodeName + /*", Value: " + node.textContent +*/ "\n"; //}

//alert(txt);

//var s = prompt("Search regexp:"); // if(s){ //     var r = prompt("Replace /"+s+"/ with:"); //     if(!r && r != '') return; //     var txt = document.editform.wpTextbox1; //    txt.value = txt.value.replace(new RegExp(s, "mg"), r); }

function processNode(node) {  //document.write(node.nodeName); //document.write(" ");

if (node.nodeType == 1) {   var original = node.textContent; if (original != null) {     //var foo = original.toLowerCase; node.textContent = original.toLowerCase; } }

//var casechanged=sometext.toLowerCase;

var childNodes = node.childNodes;

for (i = 0; i < childNodes.length; i++) {    var node = childNodes[i]; processNode(node); } }