User:Pediapress/collection.js

function addArticle { window.location.href = 'http://pediapress.com/api/add-article/?return=1&base_url=' + mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '&title=' + mw.config.get('wgTitle'); }

function addCategory { window.location.href = 'http://pediapress.com/api/add-category/?return=1&base_url=' + mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '&title=' + mw.config.get('wgTitle'); } function addPediaPressLinks { if (mw.config.get('wgNamespaceNumber') == 14) { addPortletLink ('p-personal', 'javascript:addCategory', 'add category'); } else { addPortletLink ('p-personal', 'javascript:addArticle', 'add article'); } addPortletLink ('p-personal', 'http://pediapress.com/collection/', 'my collection'); } addOnloadHook(addPediaPressLinks);