User:Armbrust/highlightredirects.js

Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
if (mw.config.get('wgAction') != 'edit' && mw.config.get( 'wgCanonicalNamespace' ) != 'Special')
{
var highlightRedirects = {
 
 tab_redirects : null,
 
 run : function()
 {
  mw.util.addCSS('a.mw-redirect { color:green} a.mw-redirect:visited { color:darkgreen}');
 },
 
 install : function()
 {
  with(highlightRedirects)
  {
   mw.util.addPortletLink('p-cactions', 'javascript:highlightRedirects.run();', 'redirects') ||
   mw.util.addPortletLink('views', 'javascript:highlightRedirects.run();', 'redirects');
  }
 }
 
};
 
//
// Hook up installation function
//
$(function () {
	mw.loader.using('mediawiki.util').then(highlightRedirects.install);
});
}