User:Pppery/common.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// Cleanup UI of unwanted block links (this can't be done in CSS since there is often stray HTML text to remove)
$("a[href*=\"/wiki/Special:Block/\"]").each(function() {
	if($(this).parents(".mw-parser-output").length){
		return;
	}
	var parent = $(this).parent();
	if (parent.is("span:not(.mw-usertoollinks)")) {
		var p = parent;
		parent = p.parent();
		p.remove();
	} else {
		$(this).remove();
	}
	parent = parent[0];
	var h = parent.innerHTML;
	h = h.replace(/ *\|? +\)/, ")");
	h = h.replace(/\| +\|/, "|");
	h = h.replace(/ +$/,"");
	if (parent.innerHTML != h) {
		parent.innerHTML = h;
	}
});
importScript("w:User:Frietjes/findargdups.js")