MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
Line 9: Line 9:
$('html').removeClass('mw-mmv-lightbox-linger');
$('html').removeClass('mw-mmv-lightbox-linger');
}, 20)
}, 20)
});
function tipIt() {
document.querySelectorAll('.tooltip-label').forEach(function(el) {
tippy(el, {
content: el.nextElementSibling.innerHTML,
allowHTML: true,
interactive: true,
arrow: false
});
});
}
mw.loader.using('wavu.tippy', function () {
if (document.readyState === "loading") {
  document.addEventListener("DOMContentLoaded", tipIt);
} else {
  tipIt();
}
});
});

Revision as of 13:42, 24 January 2024

/* Any JavaScript here will be loaded for all users on every page load. */

$(document).on('mmv-setup-overlay', function () {
	$('html').addClass('mw-mmv-lightbox-linger');
});

$(document).on('mmv-cleanup-overlay', function () {
	setTimeout(function () {
		$('html').removeClass('mw-mmv-lightbox-linger');
	}, 20)
});

function tipIt() {
	document.querySelectorAll('.tooltip-label').forEach(function(el) {
		tippy(el, {
			content: el.nextElementSibling.innerHTML,
			allowHTML: true,
			interactive: true,
			arrow: false
		});
	});
}

mw.loader.using('wavu.tippy', function () {
	if (document.readyState === "loading") {
	  document.addEventListener("DOMContentLoaded", tipIt);
	} else {
	  tipIt();
	}
});