Jump to content

User:Anomie/highlightme.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* If you want to use this script, simply add the following line to your monobook.js:

importScript('User:Anomie/highlightme.js'); // Linkback: [[User:Anomie/highlightme.js]]

* (Please keep the comment so I can see how many people use this).
*/
$(document).ready(function(){
    var $node=$('#wikiPreview, #bodyContent');

    $node.find( 'a' ).not( $node.find( '.autocomment a, a.ext-discussiontools-init-timestamplink' ) ).each( function( i, a ) {
        if(/\/User(?:(?:[ _]|%20)talk)?:Anomie/i.test(a.href) && a.href.replace(/#.*/,'')!=location.href.replace(/#.*/,'')) a.style.color='#0cc';
    })
    $node.find( 'a.mw-changeslist-title' ).each( function( i, a ) {
        if(/\/User:(?:AnomieBOT|AnomieBOT_II|AnomieBOT_III|MedcabBot|MediationBot)\/shutoff\//i.test(a.href)) a.style.color='#f00';
    });

    if(window.AJAXPreview) AJAXPreview.AddOnLoadHook(arguments.callee);
});