dev

ReferencePopups is a re-implementation of Wikipedia's reference popup gadget, a feature which allows you to hover over a citation and view the contents of the reference in a floating box. The obvious advantage of this is that you can view the references in situ (in position), without having to scroll to the bottom or click the citation and lose your place in the article. You can have a look at the demonstration here.

This gadget includes intelligent color scheme matching so it will try to fit itself into the wiki's color scheme automatically without requiring any custom CSS to fix it. It does this using the colors from the ThemeDesigner; if you have altered the wiki's colors using CSS instead of Theme Designer then this might not work properly.

Installation

Usage Notes

The popups are configurable via the built-in UI. You can trigger them via clicking instead of hovering, customise the hover delay, and turn the animations on and off. It's also possible to disable them entirely on a per user basis for individual users who don't want it.

When popups are disabled, there is a link at the end of the article, just below the categories, that can be clicked to reopen the configuration UI to turn them back on later.

Quick Help on Configuration

The options in the popup configuration are:

Administrator Configuration

Administrators can remove the gadget's configuration link from their wiki by putting Reference Popups into "lockdown" mode. This will force the popups to stay enabled and remove the configuration link from the end of the article, but not from the popup itself.

To enable lockdown, just add this to MediaWiki:Common.js above the aforementioned import:

((window.dev = window.dev || {}).ReferencePopups = dev.ReferencePopups || {}).lockdown = true;

You can also alter the defaults for new users. You can disable the animation by default using:

((window.dev = window.dev || {}).ReferencePopups = dev.ReferencePopups || {}).defaults = { animate: false };

Custom Popups

The popup component of this script is fully reusable and can be repurposed to display anything you want as well as references. A pre-made script and template set is provided if you just want something to drop in and use. Alternatively, if you are capable of writing your own JavaScript, you can instead code against the popups directly to do things like AJAX new content and display it in a popup as certain elements are interacted with.

To use the custom popups, you will need to import the Custom Popup script:

dev:ReferencePopups/custom.js

And you will need to copy these 2 templates onto your wiki to make use of the script:

The templates describe how to use them.

An important thing to note is that the custom popup script will use the user's ReferencePopup configuration even though the gear icon doesn't appear in custom ones. This means that if the popup is in click mode then attaching popups to page elements that already have their own scripts can have strange consequences. Unlike normal popups, custom ones are never sticky and can't be disabled though.

You can also construct custom skins for your custom popups as well. An example of this is on the demo page, you can see the CSS for it over here.

Text above can be found here (edit)