User:R'n'B/dabcolorizer

From Wikipedia, the free encyclopedia

dabcolorizer.js is a script to allow a user to highlight links to disambiguation pages while viewing any Wikipedia article. Mercury is a disambiguation page; if you have installed the script and the style definitions correctly, that link should be highlighted.

Installation[edit]

First, edit your common.js file.

To run dabcolorizer automatically on all pages[1] every time they are loaded, insert the following line into this file:

importScript("User:R'n'B/dabcolorizer.js");

Or, to install a Toolbox link so that you can run the script only on selected page, insert the following line instead:

mw.util.addPortletLink('p-tb', "/wiki/User:R'n'B/dabcolorizer.js", 'Dabcolorizer', 't-dabcolor', "Invoke dabcolorizer on this page");

Save changes and follow the instructions to clear your browser cache.

Important: Nothing will happen until you complete the next step.

Second, edit your common.css file to create the styles needed to display the disambiguation links. These are the ones I am currently using, but (if you know what you are doing) you can modify these according to your own aesthetic preferences:

.dabpagelink {  /* incorrect links to disambiguation pages */
    color: #C04800;
}
.intdablink {   /* intentional links to disambiguation pages */
    color: #C04800;
    background-color: #DADEF2;
}

Once you save these changes and load a new page, you should see links to disambiguation pages in a distinctive color.

  1. ^ Dabcolorizer only works when displaying Wikipedia content pages, including edit previews; it does not work on Special: pages, on history pages, or other non-content pages. Also, due to technical limitations, when viewing an old version of a page, only those links that still exist in the current version will be highlighted.

Compatibility[edit]

If you are able to test on a browser not listed below, please let me know the results.

  • Works on Mozilla Firefox 4.
  • Works on Google Chrome.
  • Works on Microsoft Internet Explorer 8.
  • Appears to work, possibly with some problems, on Opera.

Cautions[edit]

This is an alpha release; there may be bugs!

The highlighter is invoked after the page text has been loaded; depending on server load and page size, there may be a significant delay (10 - 20 seconds or even more) before the highlighting appears.

Feedback[edit]

Please leave any messages on my talk page.