user:js/urldecoder
Appearance
< User:Js
urldecoder | |
---|---|
Browsers | * |
Skins | * |
Code | urldecoder.js |
Released | April 24, 2009 |
Updated | July 24, 2010 |
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
- While trying to convert the link into InterWikimedia link, the script will recognize all multilingual projects (Wikipedia, Wiktionary, etc.) and also Meta, MediaWiki, Commons and MediaZilla.
- URL from secure login browsing will be converted to normal link;
- URL will also be percent-decoded from %-sequences into normal chars:
http://…a%26b
→http://…a&b
- this is very useful in non-Latin language projects where most URLs look like
%D1%EB%F3%E6…
- By selecting some text and then pressing the button you can simplify all URLs inside.
Installation
- English Wikipedia:
importScript('user:js/urldecoder.js')
→ your personal js file
- Other Wikimedia 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 outside of article and category namespaces, leading colon will be added for category, file and interwiki links.
- The script also decodes anchors, although in some rare cases the correct decoding is impossible. For example, #2$ и #2.24 produce the same encoded anchor.
- 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 decode existing [[internal links]] in selected text