User:Willowisp/vector-2022.js

From bg3.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.
/**
 * Toggle spoiler content's display on the wiki.
 * 
 * @author Willowisp
 * 
 */
 
 if ($(".spoiler")[0]) {
	$("#spoilerButton").removeClass("spoiler-button-hidden");
	$("#spoilerButtonActOne").removeClass("spoiler-button-hidden");
	$("#spoilerButtonActTwo").removeClass("spoiler-button-hidden");
	$("#spoilerButtonActThree").removeClass("spoiler-button-hidden");
}

function spoilerToggle() {
		$(".spoiler").toggleClass("spoiler-hidden");
}

function updateSpoilerButton() {
	$("#spoilerButton").toggleClass("spoiler-button-on");
	$("#spoilerButtonActOne").toggleClass("spoiler-button-active");
	$("#spoilerButtonActTwo").toggleClass("spoiler-button-active");
	$("#spoilerButtonActThree").toggleClass("spoiler-button-active");
	if ($("#spoilerButton").hasClass("spoiler-button-on")) {
	$("#spoilerButton").attr("aria-label", "Disable hide spoilers");		
	} else {
	$("#spoilerButton").attr("aria-label", "Enable hide spoilers");		
	}
}

function updateSpoilerButtonActOne() {
	$("#spoilerButtonActOne").toggleClass("spoiler-button-on");
}

function updateSpoilerButtonActTwo() {
	$("#spoilerButtonActTwo").toggleClass("spoiler-button-on");
}

function updateSpoilerButtonActThree() {
	$("#spoilerButtonActThree").toggleClass("spoiler-button-on");
}

function spoilerToggleActOne() {
		$(".spoiler-act-one").toggleClass("spoiler-hidden-allowed");
}

function spoilerToggleActTwo() {
		$(".spoiler-act-two").toggleClass("spoiler-hidden-allowed");
}

function spoilerToggleActThree() {
		$(".spoiler-act-three").toggleClass("spoiler-hidden-allowed");
}