User:AttemptToCallNil/common.js

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

function mimicIndicator(id, link, imgName, imgVersion, 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, imgVersion, imgStore, 25),				"srcset": getImageThumbnailURL(imgName, imgVersion, imgStore, 38)					+ " 1.5x, "					+ getImageThumbnailURL(imgName, imgVersion, imgStore, 50)					+ " 2x",				"width": "25",				"height": "25"				}) )		); }

$(function {	var protectionLevel = mw.config.get("wgRestrictionEdit")[0];	if (protectionLevel === "autoconfirmed") {		mimicIndicator( "protection-semi", "Minecraft Wiki:Autoconfirmed users", "Semi-protected page lock.png", "9967a44951b07711a04093d7048aa663", "9/9b", "This page is semi-protected so that only registered users can edit it." ).appendTo($(".mw-indicators"));	} else if (protectionLevel === "directoreditprotected") {		mimicIndicator( "protection-director", "Minecraft Wiki:Directors", "Director-protected page lock.png", "017cec521e6ee47f81964c702128ca86", "8/85",			"This page is directors-only protected so that only directors can edit it." ).appendTo($(".mw-indicators"));	} else if (protectionLevel === "sysop") {		mimicIndicator( "protection-full", "Minecraft Wiki:Administrators", "Fully-protected page lock.png", "66270912f04127c6e8988323bfa3c17b", "4/49",			"This page is fully protected so that only administrators can edit it." ).appendTo($(".mw-indicators"));	} });