Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Wikipedia:Tools/Navigation popups

Page semi-protected
From Wikipedia, the free encyclopedia
<Wikipedia:Tools
(Redirected fromWikipedia:Pop-ups)
Wikipedia gadget for article previews

"WP:POP" redirects here. For the genre, seeWikipedia:WikiProject Pop music.
Not to be confused withmw:Page Previews ormw:Reference Tooltips.
Shortcuts
You take full responsibility for any actions taken using navigation popups. You must read andunderstand all relevantWikipedia policies and abide by them when using this tool; failure to do so may result in beingblocked from editing.
Navigation popups Icon
Navigation popups in action. In this screenshot, the user is hovering the mouse over a link to theencyclopedia article.
An example ofPage Previews, which isNOT the same as this tool called Navigation popups.

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

Installation

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

Features

Small image preview for an article (Classic skin screenshot, but works fine with Vector/Monobook).
Click to enlarge preview.
Reverting using popups – hover over history item and select revert. Click to enlarge preview.
Navigation popups quick tour
  • Mouseovertooltips 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
      • 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.
      • 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:<!-- 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,[a] changes since my edit,[a] 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 (User Analysis Tool), block log
  • Mouseover on footnotes:
    • Preview contents of footnotes
  • Mouseover on any wikilink:
    • Clear pop-up cache[b]
    • Enable/disable previews[b]
    • Enable/disable pop-ups[b]
  • 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 tocreate one and log in.

Other wikis orglobal.js

Add the following to your user script file (common.js orglobal.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 (onInternet ExplorerCtrl+F5; onMozilla Firefox⇧ Shift+Ctrl+R; onOperaF5). 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.

Touninstall 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 twopopupStructure bits in the#Options just below.
  • For more specific details on each, see/Structure examples.
  • Shortmenus (default)
    Shortmenus (default)
  • Menus
    Menus
  • Lite
    Lite
  • Original
    Original
  • Nostalgia
    Nostalgia
  • Fancy
    Fancy
  • Fancy2
    Fancy2

Changing the appearance of your popups

By editing your userCSS 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 edityour 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 youruser JavaScript file and add a line of the formwindow.option =value; whereoption andvalue 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;

Do not place apostrophes around the valuestrue,false,null and numbers.

Configuration options
OptionValues
Default inbold
Description
General[edit]
Basic
popupDelay0.5, a decimal numberThe number of seconds before popups appear.
popupHideDelay0.5, a decimal numberThe approximate number of seconds between the mouse leaving a popup and its disappearance.
simplePopupstrue,falseIf you just want the links or find the amount of bandwidth consumed too great, then set this totrue. No data will be downloaded and the popups will just consist of a list of links unless you set one of the following options totrue:popupUserInfo,popupPreviewDiffs,popupPreviewHistory,popupCategoryMembers,imagePopupsForImages.
popupStructure'original','fancy','fancy2','menus','shortmenus','lite','nostalgia'Select the structure of the popups –view example screenshots. The'original' setting, which is the default ifsimplePopups istrue (or ifyour browser is known not to support menus), has all the navigation links in the popup itself;'nostalgia','fancy' andfancy2 are variants of this. The'shortmenus' setting, which is the default ifsimplePopups is nottrue, puts the navigation links in popup menus which appear when you mouseover the links beside the popup title.'menus' is a more extensive version of'shortmenus' with more links. Finally,'lite' is a very simple structure, with just the preview and no navigation links at all.

Note that to set this variable, you need to include the single quotes, e.g.popupStructure='fancy';.

popupActionsMenutrue,falseWhen using menus, you can either have the title link in the popup generating a menu (if this is set tofalse) or a separate "actions" menu (if this is set totrue, the default).
popupAdminLinkstrue,falseLinks to block people, delete pages and protect or unprotect pages are by default only available to administrators. Use this variable to override the default behavior.
popupShortcutKeystrue,falseIf this variable is set totrue then you can focus some of the links in the popups quickly by pressing keys. When you hover the mouse over a link with a shortcut, the shortcut key appears at the end of the popup hint. For example, in Firefox or Opera, to quickly edit an article in a new tab you can type 'e Control-Enter'. Pressing escape should hide the popup, too.
popupHistoricalLinkstrue,falseWhen hovering over links to old revisions and diff links, extra links such as "editOld" are generated if this istrue. Otherwise, you get the same links as when hovering over an ordinary link.
popupOnlyArticleLinkstrue,falseIftrue, then popups are only generated for links in the article. Otherwise, many other links (such as Edit, Help) get popups too.
popupMaxWidth350, an integer orfalseThe maximum width of the popup in pixels. Setting this tofalse means the popup will expand to accommodate its contents.
popupInitialWidthan integer orfalseThe initial width of the popup in pixels. Setting this tofalse means the popup will initially be the size needed to accommodate its initial contents.
popupTocLinkstrue,falseWhether or not to create popups for the Table of content items. Settrue to create popups for table of content.
popupSubpopupstrue,falseIf this istrue then popups are generated for links in previews.
popupDragHandlefalse,'popupTopLinks', ...The name of an element by which the popup can be dragged without holding the shift key. Iffalse, then the popup can be dragged using the shift key instead.
popupAllDabsStubstrue,falseIf this variable is set tofalse then only pages that look like stubs or disambiguation pages in the article namespace are treated specially. (Setting this totrue can lead to lots of false positives).
popupAdjustDiffDatestrue,falseIf true, then dates in history, diff and user contributions previews are adjusted according to the settings in your user preferences.
popupModifierfalse,'ctrl','shift','alt','meta'Lets popups only appear when pushing a modifier key while hovering over the links. This prevents unintentional popups that hide page content.
Images
popupImagestrue,falseIf this isfalse then images are never displayed.
imagePopupsForImagestrue,falseBy default, preview images are loaded even when hovering over visible images. Setting this tofalse turns that off. IfsimplePopups is set totrue, then the default value for this option isfalse.
popupThumbAction"imagepage","sizetoggle","linkfull"This controls what happens when you click the image in a preview."imagepage" takes you to the image page (and will generate a subpopup when you hover over the image), unless the popup is generated for the image page;"sizetoggle" means the image size is toggled on click, and"linkfull" means that the image links directly to the full size version.
Redirs, Dabs, Reversion
popupFixRedirstrue,falseIf this variable is set totrue then you can automatically "fix" links to redirect pages by clicking on the "Redirects" link.Note: You probably don't want to "fix" such links every time you come across them, and you definitely don't want to go on a hunt for them to "fix" them. See theAbout fixing redirects subpage.
popupRedirAutoClick'wpDiff','wpPreview','wpSave'The button which is automatically pressed when fixing redirects. If set to'wpSave' you do not need to confirm the change.
popupFixDabstrue,falseIf this variable is set totrue then you can automatically "fix" links to disambiguation pages by clicking one of the links at the very bottom of the popup.
popupDabsAutoClick'wpDiff','wpPreview','wpSave'The button which is automatically pressed when fixing (or removing) links to disambiguation pages. If set to'wpSave' you do not need to confirm the change.
popupRedlinkRemovaltrue,falseIf this variable is set totrue then you can automatically remove links to non-existent pages (so-called "red links") by selecting "Remove this link".
popupRedlinkAutoClick'wpDiff','wpPreview','wpSave'The button which is automatically pressed when removing red links. If set to'wpSave' you do not need to confirm the change.
popupWatchDisambiggedPagestrue,false,nullIf this variable is set totrue then fixed dab pages will always be watched; if it'sfalse, then they'll always be unwatched. If it'snull, then the page will be watched or unwatched according to the settings in your user preferences.
popupWatchRedirredPagestrue,false,nullIf this variable is set totrue then fixed redirect pages will always be watched; if it'sfalse, then they'll always be unwatched. If it'snull, then the page will be watched or unwatched according to the settings in your user preferences.
Navlinks
popupNavLinkstrue,falseIf this istrue then navigation links are displayed. Iffalse, then these are switched off.
popupLastEditLinktrue,falseWhether the popup should contain a "most recent edit" link.
popupEditCounterTool"supercount","custom"The edit counter tool to use or a custom url defined bypopupEditCounterUrl.
popupEditCounterUrl""The url for a custom edit counter. You can use replaceable parameters in this url: $1 will be replaced with the username, and $2 with the database name (for example, enwiki_p).
Previews, etc.
popupPreviewstrue,falseIf this istrue and you haven't setsimplePopups, then a preview of the first part of the article will appear. (Reports of pages for which this is done badly are most welcome). Iffalse, then this is switched off.
popupSummaryDatatrue,falseIf this istrue summary data for the target page is displayed. Iffalse, then this is switched off.
popupUserInfotrue,falseIf set totrue show user info when the target page is in a user's or user talk's namespace. IfsimplePopups is set totrue, then the default value for this option isfalse.
popupLastModifiedtrue,falseIf true then the age of the page is displayed in the summary data. This is the amount of time that has elapsed since the article was edited.
Diffs
popupDiffDatestrue,falseIftrue, the dates of the revisions being compared are shown when previewing diffs.
Misc.
popupOnEditSelectiontrue,false,'cursor',boxpreviewIf this istrue then popups are generated for selected wikilinks when editing.
popupImageLinkstrue,falseIftrue, pages linking to an image should appear in the preview. This currently does not work for commons images.
popupShowGendertrue,falseIftrue, a gender symbol is displayed in popups showing user info.
Edit summaries[edit]
popupRevertSummaryPrompttrue,falseIf true, you will be given the chance to change the default revert summary with each reversion.
popupRevertSummarya stringThe edit summary used when revertingand not using a queried revert summary (see below). The first %s appearing in this string is replaced with the revision ID of the page being reverted to.
popupExtendedRevertSummarya stringdefault: 'Revert to revision dated %s by %s, oldid %s usingpopups'
popupRevertToPreviousSummarya stringdefault: 'Revert to the revision prior to revision %s usingpopups'
popupQueriedRevertSummarya stringThe edit summary used when reverting and using the query interface to get information about the reversion. A $1, $2, $3 in the string are replaced with the revision ID, the timestamp and the editor corresponding to the revision being reverted to.
popupQueriedRevertToPreviousSummarya stringThe edit summary used when reverting using diff links such as those found on user contributions pages and using the query interface to get information about the reversion. A $1, $2, $3 in the string are replaced with the revision ID, the timestamp and the editor corresponding to the revision immediately after the revision being reverted to.
popupFixDabsSummarya stringThe edit summary used when disambiguating links. The first %s appearing in this string is replaced with the disambiguation page, and the second %s is replaced with the target page.
popupFixRedirsSummarya stringThe edit summary used when fixing redirects. The first %s appearing in this string is replaced with the redirect page, and the second %s is replaced with the target page.
popupRedlinkSummarya stringThe edit summary used when removing red links. The first %s appearing in this string is replaced with the red link name.
popupRmDabLinkSummarya stringdefault: 'Remove link to dab page%s usingpopups'
Preview options[edit]
popupHistoryPreviewLimit25, an integerPreview at most this many edits from the top of the page's history.
popupCategoryMemberstrue,falseWhether or not to preview members of categories. IfsimplePopups is set totrue, then the default value for this option isfalse.
popupPreviewDiffstrue,falseShow previews for diff links. IfsimplePopups is set totrue, then the default value for this option isfalse.
popupPreviewHistorytrue,falseWhether or not to generate special previews for links to history pages. IfsimplePopups is set totrue, then the default value for this option isfalse.
popupContribsPreviewLimit25, an integerPreview at most this many user contributions.
popupPreviewKillTemplatestrue,falseIftrue, templates referred to in an article are simply deleted from previews; otherwise, they're shown as raw wikitext.
popupPreviewRawTemplatestrue,falseIftrue, template pages (that is, pages in the Template: namespace) are previewed entirely as raw wikitext; otherwise, an attempt is made to render them in the preview.
popupPreviewFirstParOnlytrue,falseIftrue, previews are restricted to the first paragraph of the article.
popupMaxPreviewSentences5, an integerThe maximum number of sentences to extract from something approximating the beginning of an article for the preview.
popupMaxPreviewCharacters600, an integerThe maximum number of characters to extract from something approximating the beginning of an article for the preview.
Technical options[edit]
removeTitlestrue,falseThe titles (the default popup hints) of links are moved to the main link of the popup if this istrue. If this isfalse then they're not.
popupAppendRedirNavLinkstrue,falseIftrue, then a new set of navigation links is generated for the target of redirects; iffalse, then you're warned about the redirect but no navigation links are generated. This does nothing ifpopupNavLinks isfalse.
popupNavLinkSeparatorstring,
' &sdot; '
HTML inserted between the navigation links. This defaults to' &sdot; '.
popupLazyDownloadstrue,falseIf true, then downloads are not performed before the popup is shown. If false, then they are started as soon as you mouseover a link.
popupLazyPreviewstrue,falseIf true, then previews are not generated before the popup is shown. If false, then they are generated as soon as the necessary data is available.
Experimental and/or undocumented options[edit]
popupReviewtrue,falseShow an "accept this version as reviewed" link.
popupSetupMenutrue,falseAdditional menu to disable or reset popups itself
popupSimplifyMainLinktrue,falseShows only the subpage part of a title, for popups outside of mainspace
popupDebuggingtrue,false
popupActiveNavlinkstrue,false
popupModifierAction'enable','disable'
popupDraggabletrue,false
popupNeverGetThumbstrue,false
popupImageSize60, an integer
popupImageSizeLarge200, an integer
popupMinorRevertstrue,falseMark reverts/edits as minor changes
popupDabWiktionary'last','first'Determine position of the option to disambiguate the link to point to wiktionary instead.
popupPreviewCutHeadingstrue,false
popupPreviewButtontrue,false
popupPreviewButtonEvent'click'
popupDiffMaxLines100, an integerMaximum number of lines to process for the diff
popupDiffContextLines2, an integerNumber of lines before and after each change to include in the diff
popupDiffContextCharacters40, an integer
popupDiffDatePrinter'toLocaleString', a string
popupHistoryLimit50, an integerThe maximum amount of history to search through for the changes since my last edit. NOTE: misnomer
popupFiltersarraydefault:[popupFilterStubDetect, popupFilterDisambigDetect, popupFilterPageSize, popupFilterCountLinks, popupFilterCountImages, popupFilterCountCategories, popupFilterLastModified]
extraPopupFilters[], an array
popupRevDelUrlstringdefault:'//en.wikipedia.org/wiki/Wikipedia:Revision_deletion' Determines where to link to when showing revision deleted versions in the history
popupNewWindowstrue,falseShould links inside the previewed content be opened in a new window.
popupLinksNewWindowstringdefault:{'lastContrib': true, 'sinceMe': true}

Allow lastContrib or sinceMe links to open in a separate window. NOTE: not functional right now.

popupDabRegexpstringdefault:'disambiguation\\}\\}|\\{\\{\\s*(d(ab|isamb(ig(uation)?)?)|(((geo|hn|road?|school|number)dis)|[234][lc][acw]|(road|ship)index))\\s*(\\|[^}]*)?\\}\\}|is a .*disambiguation.*page'
popupAnchorRegexp'anchors?', a string
popupStubRegexpstringdefault:'(sect)?stub[}][}]|This .*-related article is a .*stub'
popupImageVarsRegexpstringdefault:'image|image_(?:file|skyline|name|flag|seal) |cover|badge|logo'

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 arrayextraPopupFilters 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 toyour user JavaScript file:

// initialize the array - only do this oncewindow.extraPopupFilters=[];// define the functionfunctionpopupFilterHtmlTable(wikiText){if(/<table/i.test(wikiText))return'&lt;table&gt;';elsereturn'';};// 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 enablepopupRedlinkRemoval,popupFixRedirs andpopupFixDabs features in all pages except thespecial ones,histories andpreviews (where those features are obviously useless) you can add these lines to your user JavaScript file:

// Normally features are enabledvartoFix=true;// In special pages, histories and previews disable themif(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 seethis 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 theAdblock 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 theMain 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.

Userboxes

CodeResult
{{User:The Anonymouse/Userboxes/Navigation popups}}
This user usesNavigation popups for a variety of tasks.
Usage
{{User:UBX/Navigation popups}}
This user watches over Wikipedia with the help ofNavigation popups!
Usage

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

Feedback

Please seeWikipedia talk:Tools/Navigation popups, or the associatedPhabricator project (for implementation-related discussion).

Notes

  1. ^abOn selected browsers, including Microsoft Internet Explorer
  2. ^abcOn selected browsers, including Mozilla Firefox

Credits and external links

This tool was primarily written byLupin, who is currently no longer active on Wikipedia.It depends on some other people's work:

Older versions of the tool usedoverlib by Erik Bosrup.

Contributors

General
technical help
Special
page
-related
Wikitext
Links anddiffs
Media files: images,
videos and sounds
Other graphics
Templates and
Lua modules
Data structure
HTML andCSS
Customisation
and tools
Automated editing
Navigation popups
Info
misc.
Code
The developer of popups (Lupin) has not been active on Wikipedia since 2009.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Wikipedia:Tools/Navigation_popups&oldid=1308706610"
Categories:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp