User:Toranosuke/monobook.js

// // Fuction to add a couple special pages to the toolbox on the side menu. // Mostly so I can find type-o's in my scripts.

function addToolboxItems { addPortletLink ('p-tb', wgArticlePath.replace(/\$1/,'Special:Newpages'), 'New pages'); addPortletLink ('p-tb', wgArticlePath.replace(/\$1/,'Special:Newimages'), 'New images'); } /* Alternating row colors for tables */ function bandedTable { el = document.getElementsByTagName("table"); for (i = 0; i < el.length; i++) { var classes = el[i].className.split(" "); for (j = 0; j < classes.length; j++) { if (classes[j] == "bandedTable") { rows = el[i].getElementsByTagName("tr"); for (k = 0; k < rows.length; k++) { rows[k].className = (k % 2 == 0 ? "even" : "odd"); }			}		}	} }

addOnloadHook(function {	bandedTable	addToolboxItems });

//