User:Js/urldecoder

urlDecoder button

 [http://meta.wikime…
 [[meta:Page]]

urldecoder
Browsers *
Skins *
Code urldecoder.js
Released April 24, 2009; 17 years ago (2009-04-24)
Updated March 7, 2015; 11 years ago (2015-03-07)
Developer   AlexSm

urldecoder is a userscript for easy pasting of links into wikicode.

How to use it:

  • paste any URL
  • (if desired) type a blank space and then the link name (what will be displayed):
http://de.wikipedia.org/wiki/Ding this page|
  • select (highlight) the text you want decoded
  • press the urlDecoder button button to get this:
[[:de:Ding|this page]]

The script will:

  • automatically add brackets to form an external link,
  • make it an internal link (if possible) using most Interwikimedia prefixes,
  • percent-decode URL: a %26 ba & b
    which is mostly useful in non-Latin wikis where most URLs look like %D1%EB%F3%E6…
  • convert (now outdated) secure.wikimedia.org links to normal.

The script will simplify all URLs inside the text you select; it is not limited to processing a single url.

Installation

Add this to your js file:

// [[user:js/urldecoder]]
importScript('user:js/urldecoder.js');

For other MediaWiki projects:

mw.loader.load('//en.wikipedia.org/w/index.php?title=user:js/urldecoder.js&action=raw&ctype=text/javascript');

Notes

  • When converting URL to a local internal link the script will add a leading colon if:
    the link is category, file or interwiki,
    and the page is not article or category.
  • The script also decodes anchors, although in some rare cases the correct decoding is simply impossible. For example, #2$ и #2.24 produce the same encoded anchor.
  • It works with both old and new toolbar.
  • It is a gadget in Russian Wikipedia.

Optional parameters

urlDecoderKey = 'c' //accesskey (works only in old toolbar)
urlDecoderIntLinks = true //also try to simplify existing [[internal links]] in selected text

See also

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.