MediaWiki:Common.js

From Ace Combat Wiki
Jump to navigation Jump to search

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.
/* These codes are run on every page load for all users. */

/*** dev:Tooltips ***/
window.tooltips_config = {
	offsetX: 5,
	offsetY: 5,
};

/*** RosaVision ***/
var rosaVisionGlobalDateCheck = new Date();
if(rosaVisionGlobalDateCheck.getMonth() == 3 && rosaVisionGlobalDateCheck.getDate() == 1){
	if(localStorage.getItem("aprilFoolsRosa") == "off"){
		$("body").append("<div id='aprilFoolsRosaImage' style='display:none'></div><div id='aprilFoolsRosaButton' style='display:block'></div>");
	} else {
		$("body").append("<div id='aprilFoolsRosaImage'></div><div id='aprilFoolsRosaButton'></div>");
	}
	$("#aprilFoolsRosaButton").html("<span role='button' aria-disabled='false' style='border:none' class='mw-ui-button mw-ui-progressive'>Enable RosaVision™</span>");
	function aprilFoolsRosaToggle(x){
		localStorage.setItem("aprilFoolsRosa", x);
		$("#aprilFoolsRosaImage, #aprilFoolsRosaButton").toggle();
	}
	$("#aprilFoolsRosaImage").click(function(){
		aprilFoolsRosaToggle("off");
	});
	$("#aprilFoolsRosaButton span").click(function(){
		aprilFoolsRosaToggle("on");
	});
}