Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$(function moveHistory() {
	if (!document.getElementById('p-tb')) return;
	mw.loader.using('mediawiki.util', () => {
		let clicked;
		mw.util.addPortletLink('p-tb', '#', 'Move history', 't-movehistory').firstElementChild.addEventListener('click', e => {
			e.preventDefault();
			if (clicked) {
				if (window.moveHistoryDialog) window.moveHistoryDialog.open();
				return;
			}
			clicked = true;
			mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/MoveHistory-core.js&action=raw&ctype=text/javascript');
			mw.loader.using([
				'mediawiki.api', 'mediawiki.util', 'mediawiki.Title', 'oojs-ui-windows',
				'oojs-ui-widgets', 'mediawiki.widgets', 'mediawiki.widgets.DateInputWidget',
				'oojs-ui.styles.icons-interactions', 'mediawiki.interface.helpers.styles'
			]);
		});
	});
});