User:PerfektesChaos/js/redirectResolver

&#x21AA; JavaScript gadget – explain target of redirect links and replace redirect page on source editing.

Please note that there are cases where it is better to keep the current link pointing to a redirect page since that target might be replaced by an advanced page in the future, or the final target might be updated.

Usage

 * If your project has registered this as a gadget, just activate on your Preferences page.
 * Otherwise include the following line into your common.js, global.js etc.:

Functionality
On a rendered wikitext page, MediaWiki will equip with class  all internal links pointing to a redirect page. Within rendered content &#x21AA; will be appended to such links.

It is a button, opening a tiny popup.

To close that popup, click this button again, or click another similar button, or click X within the popup.

Popup
   Wikipedia:SC  Wikipedia:Shortcut   ↯   1.3  <li title="Exit" style="background-color: #FF0000; border-color: transparent; border-radius: 4px; border-style: solid; border-width: 2px; color: #FFFFFF; cursor: pointer; font-weight: bold; line-height: 1.1em; padding-left: 1em; padding-right: 1em; text-align: center; vertical-align: middle; display: inline-block;" lang="en">X</li></ul>


 * Wikipedia:SC
 * Link target in effect on rendered page.
 * Pointing here to redirect page without automatic forwarding.
 * Will be opened in a new browser tab/window.
 * Wikipedia:Shortcut
 * Target of redirect.
 * Might appear after short delay, since MediaWiki server could need time to answer.

Exchanging
On source text editing, exchanging will be done on regular wikitext in double brackets  (may be titled with pipe  ) and most usual syntax.

Templates, comments and any  will prevent this particular link from changing.

Exchanging is in effect for syntax disabled by  comments or       elements.

Opening but not closed  might hide a clickable link within.

Template parameter values cannot be identified as page names of a redirect page, nor results of template transclusion.

Please check via diff page whether result is matching your expectations.

CSS
All relevant elements have selectors prefixed by  and may be subject to personal adaptions.

The following definition for class  will give a pink background to all redirect links and this tool.

One common specification for redirect links only is this one:

Internationalization
A translation of this page may be offered.

Codes
de:User:PerfektesChaos/js/redirectResolver