User:Gary/history username highlighter.js

/*	HISTORY USERNAME HIGHLIGHTER BEGINS if (typeof(unsafeWindow) != 'undefined') {	mw = unsafeWindow.mw; }

mw.util.addCSS('a.highlight-history-username { background-color: #D1DCFF; }'); $('#histlegend').prepend(' Highlight username Username:   ');

$('#highlight-username-submit').click(function {	var matched = false;	$('.mw-userlink').each(function {		var needleClean = $.trim($('#highlight-username').val.toLowerCase); var stackClean = $.trim($(this).text.toLowerCase); if (stackClean.indexOf(needleClean) != -1) {			$(this).addClass('highlight-history-username'); matched = true; }	});	if (!matched) alert('No matches');	return false; });

$('#highlight-username-reset').click(function {	$('.mw-userlink').each(function {		$(this).removeClass('highlight-history-username'); });	return false; }); /*	HISTORY USERNAME HIGHLIGHTER ENDS