User:Nardog/RefRenamer.js

mw.config.get('wgNamespaceNumber') % 2 === 0 && mw.config.get('wgArticleId') && mw.config.get('wgPageContentModel') === 'wikitext' && $.when($.ready, mw.loader.using('mediawiki.util')).then(function refRenamer {	if (!document.getElementById('p-tb')) return;	let messages = Object.assign({ portlet: 'RefRenamer', loading: 'Loading RefRenamer...' }, window.refrenamerMessages);	let clicked;	mw.util.addPortletLink('p-tb', '#', messages.portlet, 't-refrenamer').firstElementChild.addEventListener('click', e => { e.preventDefault; if (clicked) { if (window.refRenamer) window.refRenamer; return; }		clicked = true; mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/RefRenamer-core.js&action=raw&ctype=text/javascript'); mw.notify(messages.loading, {			autoHideSeconds: 'long',			tag: 'refrenamer'		}); }); });