User:Rezonansowy/js/ToCommons.js

// Ported from pl:Wikipedysta:Żbiczek/zuo.js, see there for authorship if (wgCanonicalNamespace == 'Image' || wgCanonicalNamespace == 'File') {

function do_it { if (confirm('Mark file for transfer to commons?')) { var title = encodeURIComponent(mw.config.get('wgPageName')); window.location.href = "//en.wikipedia.org/w/index.php?action=edit&preload=User:Rezonansowy/mtc-nosubst&preloadtitle=Move to Commons&section=new&title=" + title; }   }

function nacommons_onload { mw.util.addPortletLink('p-cactions', 'javascript:do_it(true)', "To commons!", 'nacommons-nazw', "Mark file for transfer to commons"); }

addOnloadHook(nacommons_onload); }