Jump to content

User:Nardog/SymmetricalChanges.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nardog (talk | contribs) at 13:23, 7 July 2022 (Created page with '(mw.config.exists('wgDiffNewId') || mw.config.get('wgAction') !== 'view' || [-1, 14].includes(mw.config.get('wgNamespaceNumber'))) && $(function symmetricalChanges() { if (!document.getElementById('p-tb')) return; mw.hook('wikipage.diff').add($diff => { $diff.find('.diff-deletedline:not(.diff-empty) ~ .diff-addedline:not(.diff-empty)') .parent().addClass('symmetricalchange'); }); mw.loader.using('mediawiki.util', () => { mw.util.addPortletLink('p...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
(mw.config.exists('wgDiffNewId') || mw.config.get('wgAction') !== 'view' ||
[-1, 14].includes(mw.config.get('wgNamespaceNumber'))) &&
$(function symmetricalChanges() {
	if (!document.getElementById('p-tb')) return;
	mw.hook('wikipage.diff').add($diff => {
		$diff.find('.diff-deletedline:not(.diff-empty) ~ .diff-addedline:not(.diff-empty)')
			.parent().addClass('symmetricalchange');
	});
	mw.loader.using('mediawiki.util', () => {
		mw.util.addPortletLink('p-tb', '#', 'Toggle symmetrical changes', 't-symmetricalchanges').firstElementChild.addEventListener('click', e => {
			e.preventDefault();
			document.body.classList.toggle('symmetricalchanges-enabled');
		});
	});
});