(mw.config.exists('wgDiffNewId') || mw.config.get('wgAction') !== 'view' ||
mw.config.get('wgNamespaceNumber') === -1) &&
(function diffFontSwitcher() {
mw.loader.addStyleTag('.diff-lineno{cursor:pointer}');
$(document.body).on('click keydown', '.diff-lineno', function (e) {
if (e.type === 'keydown' &&
(e.which !== 13 && e.which !== 32 || e.ctrlKey || e.shiftKey || e.metaKey || e.altKey)
) {
return;
}
e.preventDefault();
this.closest('.diff').classList.toggle('difffontswitcher-enabled');
});
mw.hook('wikipage.diff').add($diff => {
$diff.find('.diff-lineno').attr({
tabindex: 0,
role: 'button'
});
});
})();