Guild Wars 2 Wiki:Popups

From Guild Wars 2 Wiki
Jump to navigationJump to search

Popups are provided by the Popups extension, and provide page previews when hovering over any wiki link. They can provide a quick reminder of what a sentence is talking about without having to visit the page and return to it, speeding up the browsing experience of using a wiki.

This page serves to document any quirks of setting up the popups.

Required extensions[edit]

List of helper templates[edit]

Extended popups[edit]

Extended popup functionality is supported by the wikipopupExtended script held within MediaWiki:Common.js, alongside additional CSS within MediaWiki:Common.css. The following enhancements are provided by this script:

  • All popups have their page title added as a header.
  • Skills and traits have their top-right icon properties (recharge, activation, etc) added as icons, plus all of their skill facts (such as damage, range, etc) added as list elements.
  • Skills and traits which have facts split by game mode have a button to change the displayed facts.

Useful notes[edit]

  • The most likely image to be extracted by the extension PageImages is one of the first four images in an article which has a major dimension (either width or height) between 400-600px, and the major dimension is approximately twice the value of the other minor dimension, 200-300px. The extracted page image can be found in the Basic information section in "Page information" (in the right tool bar or by appending ?action=info to the URL of any page).
  • Images with a ratio (width/height) of 0.4 to 3.1 are allowed, while images with a ratio of 0.6 to 2.1 are preferred. This means that a first listed image with an allowed but not preferred ratio (e.g. 0.5) might not be weighted over a second listed image with a preferred ratio (e.g. 1).
  • The extension Popups, using the extracted page image in the preview, distinguishes between two image types:
    • Portraits (height > width) are displayed to the right, and have the maximum width of 203px and the exact height of 250px. As an example, hover the following link: Eir Stegalkin.
    • Landscape (width > heigth) are displayed above, and have the exact width of 320px and the maximum height of 200px. Example: Kiriel Rock.
  • This means that portrait images with a height less than 250px and landscape images with a width less than 320px are not displayed in the page preview even if they have been extraced by the page images extension.
  • Popup information is cached, so if you edit an article the preview of the page will not update immediately, even after updating the wiki cache of both pages and clearing your own cache. You just need to wait (or you can edit the page and add/remove a link - since this is the only time the image is recalculated).
  • There is a blacklist page available - each image to avoid using must be separately linked on MediaWiki:Pageimages-blacklist.
  • By default the following element types are excluded:
    • table
    • div
    • script
    • input
    • style
    • sup.reference
    • ol.references
  • By default the following element classes are excluded:
    • .mw-editsection
    • .error
    • .nomobile
    • .noprint
    • .noexcerpt
    • .sortkey
  • This means, for example, that text can be intentionally excluded with the class noexcerpt.
  • The template Template:TOCright seems to inconsistently block the TextExtracts for unknown reasons, while sometimes after purging the page it works fine, soon afterwards it "forgets" the extracted text again. This can be avoided by placing the template below the first paragraph.
  • Popups are abandoned/destroyed after the mouse leaves the area over the link. The popup creation event can be stimulated with the "mouseenter" event (as noted here), e.g. $($0).trigger('mouseenter');

Known issues[edit]

  • None?

See also[edit]

  • Special:Version lists the currently installed versions of Extension:Popups, Extension:TextExtracts and Extension:PageImages.