User talk:Js/urldecoder

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

WikEd[edit]

== Excellent script... ==

But, any chance that you can make it work with WikEd so that the user does not have to disable WikEd before use? Thanks. —Preceding unsigned comment added by Ukexpat (talkcontribs) 14:50, 30 April 2009

I've been thinking about it for some time and I don't see an easy way and unfortunately I don't have more time to investigate more. You could ask Cacycle about this feature, some time ago he already added to wikEd the functionality of another script of mine (ajax preview). — AlexSm 17:18, 21 May 2009 (UTC)[reply]

Links and magic words[edit]

Copied from ru:User talk:Alex Smotrov

Very good script!!!!

Do you know if is it difficult to convert a link like

http://en.wikipedia.org/w/index.php?title=Ferengi&curid=177126&diff=304901009&oldid=304764764

(which use some parameters) to a link like

{{fullurl:Ferengi|curid=177126&diff=304901009&oldid=304764764}}

created with magic words fullurl (or possibly also localurl, according to the value of new boolean variables useFullUrl and useLocalUrl?). I think this could be of interest since the resulting links are more readable (because they are shorter than without the magic words).

What do you think? Helder 22:43, 27 августа 2009 (UTC)

It should be fairly easy to implement, but personally I don't like to use templates when not necessary, and I don't think the 2nd line above looks much better than the 1st one. Maybe I could add this conversion as an option. In any case, you should use en:user:js/urldecoder outside of Russian Wikipedia. If you're still interested in this option - please move this discussion to en:user talk:js/urldecoder and let me know. — AlexSm 14:32, 28 августа 2009 (UTC)
hummm... Indeed when we have more than one parameter, the second one is not much better... But for links like
{{fullurl:Test|action=edit}}
it is more interesting. One reason I have for using the fullurl magic word instead of the normal url is that if I need to pass a link as above (which has parameters) to a template, I would need to change the every = signs to {{=}} or some other trick. And with the magic word this is not necessary...
I'm copying this comments to the talk page, because I would like to have the feature as an option if possible... (not necessarily for use in every place). Helder (talk) 12:52, 30 August 2009 (UTC)[reply]

urlDecoderCustom[edit]

Urldecoder was changed to automatically call urlDecoderCustom() function defined in user's monobook.js. This function should accept URL and return some result or null. The code below (add it to your monobook.js) should do the transformation mentioned above, but only on the second click of the same →[[]] button (thus you don't need another button on the toolbar). — AlexSm 18:14, 31 August 2009 (UTC)[reply]

//user-defined for [[user:js/urldecoder]], transforms URL into {{fullurl:...}} on 2nd click
function urlDecoderCustom(url){
 var path, old = window.urlDecoderOldUrl
 urlDecoderOldUrl = url
 if (!old || old != url) return null
 var result = null
 if ((path=wgServer+wgScript+'?title=') && url.indexOf(path) == 0)
  result = url.substring(path.length).match(/^([^&]+)&?(.*)$/)
 else if ((path=wgServer+'/wiki/')  && url.indexOf(path) == 0 )
  result = url.substring(path.length).match(/^([^\?]+)\??(.*)$/)
 else return null
 return '{\{fullurl:' + result[1].replace(/%20|_/g,' ') 
  + (result[2] ? '|' + result[2] : '') + '}}'
}
OMG! I completely forgot to look of this talk page! I'll try this function. Thank you! Helder (talk) 20:24, 14 October 2010 (UTC)[reply]
Cool! It works =D
I've added also "{{FULLPAGENAME}}" when the link points to the current page. Thank you for your help! Helder (talk) 21:11, 14 October 2010 (UTC)[reply]

meta secure link re-written to 'meta.wikipedia' instead of 'meta.wikimedia'[edit]

When re-writing

https://secure.wikimedia.org/wikipedia/meta/wiki/Special:Log?type=rights&page=User:Xeno%40enwiki&limit=1&offset=201108

we get

http://meta.wikipedia.org/wiki/Special:Log?type=rights&page=User:Xeno%40enwiki&limit=1&offset=201108

Note meta.wikipedit, instead of the correct meta.wikimedia. Problem identified by Heymid (talk · contribs) after Department of Redundancy Department (talk · contribs) pointed out the issue here. (Issue only negatively affects users logged in thru non-secure server, see [1]). –xenotalk 14:14, 2 September 2011 (UTC)[reply]

Fixed, although I think it's a bit inconsistent scheme on WMF servers: other projects (wikibooks etc.) use their own domains in secure links (see Secure Portal). — AlexSm 17:03, 3 September 2011 (UTC)[reply]

Bot[edit]

Is there an easy way to run this in a bot? Or to run this as an sript in AWB?

Thanks for the help. Chico (talk) 04:26, 6 February 2012 (UTC)[reply]

The answer is "no" (to my knowledge) unless someone rewrites the code in the programming language that AWB / bot is using. — AlexSm 16:48, 6 February 2012 (UTC)[reply]
Ok, thanks for the answer. I'll try to code it, not sure if I can tough. Chico (talk) 23:10, 6 February 2012 (UTC)[reply]

oldwikisource links[edit]

The script is currently transforming links to the multilingual area of wikisource into normal wikisource links http://wikisource.org/wiki/Lord%27s_Prayer is turned into s:Lord's_Prayer when it should be turned into oldwikisource:Lord's Prayer instead. Chico Venancio (talk) 02:07, 25 April 2012 (UTC)[reply]