[[Template:catfix]] gadget improvements

Fragment of a discussion from User talk:Kephir
Jump to navigation Jump to search

Exactly. Though I would do it like:

if (mw.config.get('wgNamespaceNumber') === 14) // or mw.config.get('wgNamespaceIds').category for extra readability
jQuery(document).ready(function () {
	var wrapper;
	if (!(wrapper = document.getElementById("catfix")))
		return;
	mw.loader.using(['mediawiki.Title'], function () {
		// ...
	});
});
Keφr20:17, 7 August 2014

That worked, thank you!

CodeCat20:31, 7 August 2014