user:js/urldecoder
Appearance
< User:Js
urldecoder | |
---|---|
Browsers | * |
Skins | * |
Code | urldecoder.js |
Released | April 24, 2009 |
Updated | September 3, 2011 |
Developer | AlexSm |
urldecoder is a userscript for easy pasting links into wikicode:
paste any URL and type the link name (if needed)
http://de.wikipedia.org/wiki/Ding this page|
[[:de:Ding|this page]]
the script will automatically add brackets to form an external link and, if possible, will convert it into internal link.
Features
- The script recognizes most Interwikimedia links.
- Secure links are converted to normal.
- URLs are percent-decoded:
http://…a%26b
→http://…a&b
- this is very useful in non-Latin language projects where most URLs look like
%D1%EB%F3%E6…
- this is very useful in non-Latin language projects where most URLs look like
- You can select some text and press the button to simplify all URLs inside.
Installation
Add this to your js file:
// [[user:js/urldecoder]]
importScript('user:js/urldecoder.js');
For other MediaWiki projects:
importScriptURI('http://en.wikipedia.org/w/index.php?title=user:js/urldecoder.js&action=raw&ctype=text/javascript');
Notes
- When converting http: link to internal a leading colon will be added 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.
- The script works with both old and new toolbar.
- This script 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