Wikipedia:Tools/Navigation popups#Installation

{{Short description|Wikipedia gadget for article previews}}

{{pp-semi-indef}}

{{shortcut|WP:POP|WP:POPUP|WP:POPUPS|WP:NAVPOP|WP:NAVPOPS}}

{{Redirect|WP:POP|WikiProject Pop music|Wikipedia:WikiProject Pop music}}

{{Tool warning|navigation popups}}

File:Navigation popups icon.svg

File:Navigation popups enwiki Vector.png article.]]

File:Hovercard english.png, which is {{strong|NOT}} the same as this tool called Navigation popups.]]

Navigation popups is an opt-in Wikipedia gadget (feature) that offers article previews and several functions through popup windows when hovering over wikilinks. It should not be confused with the default Page Previews and Reference Tooltips, which appear for all registered and unregistered users and serve as more reader-focused popups.

Installation

  • Navigate to and enable:

:: {{myprefs|Gadgets|Browsing|check="{{int:Gadget-Navigation_popups}}"}}

If you encounter difficulties, consider reviewing the § Frequently asked questions.

Features

File:Popups-toggle-size-small.png

File:Popups-toggle-size-large.png

File:Revert popups.jpg

File:Navigation popups quick tour.ogv

  • Mouseover tooltips on articles (including user pages):
  • Preview the first part of the article text when mousing over a link to an article
  • Preview the first image in the article
  • {{small|If there is an infobox with an image, and it is not a Wikidata-powered infobox, the image in the infobox will be taken as the first image.}}
  • {{small|The image shown in the preview can be controlled by adding an image hint to the article, in the form of an invisible HTML comment: {{nowrap|<!-- popup File:Desired_Preview_Image.jpg -->}}.}}
  • Preview selected user information [user/user talk namespace]: pronoun preference, user groups, edit count, account registration date, date of most recent edit
  • Preview selected page information: size, number of links, number of images, number of categories and page age
  • Tells you about redirects, stubs and disambiguation pages
  • One click access to edit page, page history, most recent edit, edits by most recent contributor,{{efn|name=on-selected-browsers-ie|On selected browsers, including Microsoft Internet Explorer}} changes since my edit,{{efn|name=on-selected-browsers-ie}} move page, what links here, related changes, watch or unwatch, protect or unprotect (for administrators), talk page, edit talk page and start new topic in talk page
  • See the Wikidata QID for the target page, if one exists
  • Mouseover on image links:
  • Preview images
  • Preview file descriptions
  • Preview file links
  • Tells you if the image is on Commons
  • Mouseover on user links:
  • One-click access to user page, user space, user talk, edit user talk, new section in user talk, e-mail user, contributions and contributions tree, (for administrators) deleted user contributions, user log, (for administrators) block user, edit counter ([https://tools.wmflabs.org/supercount/index.php?project=en.wikipedia User Analysis Tool]), block log
  • Mouseover on footnotes:
  • Preview contents of footnotes
  • Mouseover on any wikilink:
  • Clear pop-up cache{{efn|name=on-selected-browsers-mff|On selected browsers, including Mozilla Firefox}}
  • Enable/disable previews{{efn|name=on-selected-browsers-mff}}
  • Enable/disable pop-ups{{efn|name=on-selected-browsers-mff}}
  • Preview diffs and access both revisions in watchlist, history and related changes
  • Preview selected wikilinks when editing (use the mouse to select one wikilink)
  • One-click revert of vandalism from history browser (see image)
  • Shortcut keys (optional)
  • Automatically fix links to bypass redirects and disambiguation pages (optional)
  • Should work on all Wikimedia wikis

Installation

You must have a user account to install and use the Navigation popups feature. If you do not have an account, you will need to [{{fullurl:Special:UserLogin|type=signup&returnto={{FULLPAGENAMEE}}}} create one] and log in.

  • Go to {{myprefs|9|Browsing|check={{int:Gadget-Navigation_popups}}}}

=Other wikis or [[m:Special:MyPage/global.js|global.js]]=

Add the following to your user script file (common.js or global.js):

mw.loader.load('https://en.wikipedia.org/w/load.php?modules=ext.gadget.Navigation_popups'); // w:Wikipedia:Tools/Navigation popups

After saving the page, clear your browser's cache (on Internet Explorer {{Keypress|Ctrl|F5}}; on Mozilla Firefox {{Keypress|Shift|Ctrl|R}}; on Opera {{Keypress|F5}}). Assuming that you have not disabled JavaScript in your browser, a popup should appear whenever you hover your mouse over an internal link in Wikipedia. If you use more than one web browser, or more than one PC, you may need to clear the caches for each so that the popup appears.

To install the script on the Commons or Wiktionary, repeat this procedure on those wikis.

To uninstall the script, delete the above lines from the same page and clear your browser's cache.

Usage guide

This tool generates "popup hints" when you hover the mouse pointer over active links and images. These popups provide information about the link's target and give quick access to a number of relevant actions.

If you hold the shift key then you can drag the popup around.

Popups depend on the type of link:

  • Links to ordinary articles: popup provides a preview of the first paragraph and image of the article; the Actions menu allows to view the History and Talk page of the article, to edit and watch the article etc.
  • In the edit box: Highlight a wiki link to get an article popup.
  • Diff links: On history or watchlist pages, hover over diff links like "(cur)" or "(prev)" to get a summary of the difference; the Actions menu allows you to revert or undo the edit.
  • User: links: information about the status of the user; User menu gives access to Talk page, recent contributions etc.
  • Image links: information from image's description page
  • In popups: most of the links in popup windows will open new popups when hovered over.

Configuration (optional)

There are dozens of configurable settings that add or remove various powerful features, explained in depth below.

= Seven optional structures =

There are seven built-in style variations: shortmenus (default), menus, lite, original, nostalgia, fancy, fancy2.

  • To change your selection, see the two popupStructure bits in the #Options just below.
  • For more specific details on each, see /Structure examples.

Popups_shortmenus.png|Shortmenus (default)

Popups_menus.png|Menus

Lite.png|Lite

Original (structure).png|Original

Popups_nostalgia.png|Nostalgia

Fancy.png|Fancy

Fancy2.png|Fancy2

= Changing the appearance of your popups =

By editing your user CSS file, you can change the appearance of the popups. Your user CSS file has exactly the same name as the JavaScript file, but with "css" instead of "js" at the end. So you should edit your current skin's .css page.

Here is an example that makes the text a bit bigger.

.navpopup {font-size: 0.875em !important;}

.popup_menu {margin-top: 1.1em !important;}

Here is an example which gives an orange-flavoured popup with a border and changes the font used. This makes the popups look pretty silly, but it shows the sort of thing you can do if you feel like it.

.navpopup {

background-color: #FFBE20 !important;

font-family: serif !important;

color: #404 !important;

font-size: medium !important;

}

= Options =

There are some options that you can set. To do so, edit your user JavaScript file and add a line of the form window.option = value; where option and value are chosen from the table below. For example, to turn on extensive menus and turn on admin links, you need to add something like this in your JavaScript file:

window.popupStructure = 'menus';

window.popupAdminLinks = true;

class="wikitable sortable" style="border-spacing: 4px" border="1"

|+ Configuration options

Option

!Values
{{Center|1=Default in {{Hilite|1=bold}}}}

!class="unsortable"|Description

{{/General options}}{{/Edit summary options}}{{/Preview options}}{{/Technical options}}{{/Experimental options}}

More options may be added, and requests for more configurability are welcome.

= Advanced customization =

== Adding filters ==

You can define custom filters for articles. These are JavaScript functions which are run after the page statistics are generated, and their output is appended (as HTML) to that part of the popup. (Note that if simplePopups is true or popupSummaryData is false, then nothing will be displayed.)

The way to set this up is to write a filter function which accepts a string (the wikitext of the article) as input, and returns a fragment of HTML. Repeat for as many filters as you want, and then create an array extraPopupFilters which contains all of the functions, in the order in which you want them to be run.

For example, let's say you want to be told whenever the wikitext of an article contains a table written using HTML tags rather than wiki markup. One way to do this is to add the following to your user JavaScript file:

// initialize the array - only do this once

window.extraPopupFilters = [];

// define the function

function popupFilterHtmlTable (wikiText) {

if (/

else return '';

};

// add the function to the array (you can repeat this for lots of functions)

extraPopupFilters.push(popupFilterHtmlTable);

Then when a popup is generated for a page containing an HTML table, you should see <table> in the popup. (It may also appear for other pages, such as this page. Correcting this defect is left as an exercise for the reader.)

== Other examples ==

If you want to enable popupRedlinkRemoval, popupFixRedirs and popupFixDabs features in all pages except the special ones, histories and previews (where those features are obviously useless) you can add these lines to your user JavaScript file:

// Normally features are enabled

var toFix = true;

// In special pages, histories and previews disable them

if ( mw.config.get( 'wgCanonicalNamespace' ) === 'Special' ||

$.inArray( mw.util.getParamValue( 'action' ), [ 'history', 'submit' ] ) !== -1 )

{

toFix = false;

}

//

window.popupRedlinkRemoval = toFix;

window.popupFixRedirs = toFix;

window.popupFixDabs = toFix;

Translations

Please see this page for translations of the script interface and of this page into other languages. You'll also find instructions for creating a translation yourself.

Browser problems

= [[Firefox]] =

If a user on Firefox with the Adblock Plus extension installed cannot see the popup, only the normal tooltip, Adblock Plus may be blocking the operation of navigational popups. This can be solved by adding an exception to the filtering rules – go to the Main Page, click the icon in the browser toolbar, and turn off [Block ads on] This website: en.wikipedia.org.

This tool should not be affected by any browser popup blocking settings.

[[WP:Userboxes|Userboxes]]

{{Usbktop}}

{{Usbk|User:The Anonymouse/Userboxes/Navigation popups}}

{{Usbk|User:UBX/Navigation popups}}

{{Usbkbottom}}

There is also a Navigation popups topicon. {{Tl|Navigation popups topicon}}.

Feedback

Please see {{TALKPAGENAME}}, or the associated [https://phabricator.wikimedia.org/project/profile/2055/ Phabricator project] (for implementation-related discussion).

Notes

{{Notelist}}

= Contributors =

{{Wikipedia technical help}}

{{Wikipedia:Tools/Navigation popups/Navbox}}

Navigation popups

Category:Wikipedia tools

{{ombox|text=The developer of popups ({{u|Lupin}}) has not been active on Wikipedia since 2009.}}