User:2D/commonsmover.js: Difference between revisions

Content deleted Content added
a miracle this one was working at all...
m Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
(3 intermediate revisions by 3 users not shown)
Line 1:
function movetocommons()
{
var url="http://toolserverbots.wmflabs.org/~magnusrichs/commonshelper.php?interface=en&image=" + encodeURIComponent( mw.config.get('wgTitle') ) + "&lang=en&username=" + encodeURIComponent( mw.config.get('wgUserName') ) + "&tusc_user=" + encodeURIComponent( mw.config.get('wgUserName') );
window.open(url);
}
Line 7:
 
{
if(mw.config.get('wgCanonicalNamespace') == "Image" || mw.config.get('wgCanonicalNamespace') == "File")
{
mw.util.addPortletLink("p-cactions","javascript:movetocommons()","move to commons","ca-mcom");
}
}
 
addOnloadHook$(start);