User:Madminecrafter12/common.js

// Initialises stripes on all zebra tables after page load $(document).ready(function {	$('table.zebra tbody tr:nth-child(even)').addClass('even');	$('table.zebra tbody tr:nth-child(odd)').addClass('odd'); });

// Re do stripes on a table after sort finishes $(document).on('sortEnd.tablesorter', function(event) {	var table = $(event.target);	if(table.hasClass('zebra')) {		$('tbody tr:nth-child(even)',table).addClass('even').removeClass('odd');		$('tbody tr:nth-child(odd)',table).addClass('odd').removeClass('even');	} });

function getImageThumbnailURL(name, store, size) { var encodedName = encodeURIComponent(name.replace(/ /g, "_")); return "https://minecraft.gamepedia.com/media/minecraft.gamepedia.com/thumb/" + store + "/"		+ encodedName + "/"		+ size + "px-" + encodedName; }

function mimicIndicator(id, link, imgName, imgStore, title) { var encodedLink = encodeURIComponent(link.replace(/ /g, "_")); return $(" ") .attr("id", "mw-indicator-" + id) .addClass("mw-indicator") .append($("")			.attr({ "href": "/" + encodedLink, "title": title }).append($(" ") .attr({				"alt": title,				"src": getImageThumbnailURL(imgName, imgStore, 25),				"srcset": getImageThumbnailURL(imgName, imgStore, 38)					+ " 1.5x, "					+ getImageThumbnailURL(imgName, imgStore, 50)					+ " 2x",				"width": "25",				"height": "25"				}) )		); }

/* Include toggle script for showing/hiding patrol requests */ mw.loader.load('/index.php?title=User:Jack_McKalling/patroller-requests/toggle-requests.js&action=raw&ctype=text/javascript');