User:Aldy/vector.js

// Reduces the length of personal links at the top of the page function shortlinks { document.getElementById('pt-userpage').firstChild.innerHTML = 'Aldy'; document.getElementById('pt-mytalk').firstChild.innerHTML = 'Talk'; document.getElementById('pt-preferences').firstChild.innerHTML = 'Pref'; document.getElementById('pt-newmessages').firstChild.innerHTML = 'Msgs'; document.getElementById('pt-mycontris').firstChild.innerHTML = 'Ctbs'; document.getElementById('pt-logout').firstChild.innerHTML = 'Out'; } addOnloadHook(shortlinks);

// Highlight recent changes hookEvent( 'load', recentChangesHighlights ); function recentChangesHighlights { if ( wgPageName == 'Special:RecentChanges' ) { var targetContent = document.getElementById( 'bodyContent' ); var rows = targetContent.getElementsByTagName( 'li' ); for ( var l = 0; l < rows.length; l++ ) { liHTML = rows[l].innerHTML liText = rows[l].textContent; if ( liHTML.indexOf( '/wiki/Special:Log/' ) != -1 ) { rows[l].style.backgroundColor = '#DDF'; }			if ( liHTML.indexOf( '/wiki/Special:Log/block' ) != -1 || liHTML.indexOf( '/wiki/Special:Log/delete' ) != -1 ) { rows[l].style.backgroundColor = '#FCC'; }			if ( liHTML.indexOf( 'class="newpage"' ) != -1 ) { rows[l].style.backgroundColor = '#DFD'; }			if ( liHTML.indexOf( 'class="minor"' ) != -1 ) { rows[l].style.backgroundColor = '#FEF'; }		}	} }