Jump to content

User:Nardog/ExamineMore.js

From Wikipedia, the free encyclopedia
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.
// Makes navigation links work on [[Special:AbuseFilter/examine]] (T292764).

if (mw.config.get('wgCanonicalSpecialPageName') === 'AbuseFilter' &&
	mw.config.get('wgTitle').endsWith('/examine')
) {
	$(document.body).on('click', '.mw-pager-navigation-bar > a', function (e) {
		e.preventDefault();
		let form = document.querySelector('#mw-content-text form');
		form.reset();
		new URLSearchParams(this.search).forEach((v, n) => {
			if (n === 'title') return;
			let input = form.elements[n];
			if (input) {
				input.value = v;
			} else {
				$('<input>').attr({
					type: 'hidden',
					name: n
				}).val(v).appendTo(form);
			}
		});
		form.submit();
	});
}