Comment highlighter is a user script by PleaseStand that highlights your discussion page comments (or those of other users) while reading a discussion page (comments are not highlighted in edit mode). The script adds a tab or menu item (called "Unhighlight") to allow you to turn off the highlighting manually if necessary. For users of slow computers, it is also possible to disable highlighting by default (see "Configuration" below).

Installation

On the English Wikipedia

Add the following code to Special:MyPage/common.js or Special:MyPage/skin.js:

importScript("User:PleaseStand/highlight-comments.js");

Other wikis

If you are not on the English Wikipedia, you will need to use the following code instead.

// install [[Wikipedia:User:PleaseStand/Comment highlighter]] tool
mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:PleaseStand/highlight-comments.js&action=raw&ctype=text/javascript' );

Advanced

Source code

The source code is available at User:PleaseStand/highlight-comments.js. Development takes place on User:PleaseStand/highlight-comments-dev.js.

Configuration

Define a custom highlighter function to change the highlight color or highlight additional users' comments. The highlighter function replaces the script's default settings. Here is a good starting point:

window.highlightCommentsSettings = {
  highlighterFunction: function( hc ) {
    hc.addColorForUsers( '#ff7', [
      mw.config.get( 'wgUserName' ),
      'Example',
      '127.0.0.1',
      'Jimbo Wales'
    ] );
    hc.wrapComments();
    hc.addMenuItem();
  }
};

Any configuration setting that begins with "HighlightCommentsJs" (or any CSS rule beginning with ".mycomment") is for an old version of the script; you can safely remove it.

Adding new features

For security reasons, only Wikipedia administrators (and I) can edit the script's source code. You can copy this script into your user space and make changes there. If you believe other users could benefit from your improvements, including any translations of the script into other languages, please show them to me (e.g. as a diff) on my talk page and propose their addition to the master copy. I prefer that all changes conform to the MediaWiki coding conventions, and if possible, produce readable diffs.

Discussion

Ask questions or propose changes on my talk page or on the talk page of these instructions.