helialprofile.png
Welcome to IOPWiki, Commander. You can contribute to this wiki without an account. Learn how to contribute and join our Discord server.

MediaWiki:Gadget-artTab.js

Welcome to IOP Wiki. This website is maintained by the Girls' Frontline community and is free to edit by anyone.
Revision as of 07:17, 26 December 2017 by Pianoforte (talk | contribs)
Jump to navigation Jump to search

Note: After saving, 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: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
$(document).ready(function() { 
	function artTabSwitch(evt, artTabName) {
	    var i, tabcontent, tablinks;
	    tabcontent = document.getElementsByClassName("artTabContent");
	    for (i = 0; i < tabcontent.length; i++) {
	        tabcontent[i].style.display = "none";
	    }
	    tablinks = document.getElementsByClassName("artTabLinks");
	    for (i = 0; i < tablinks.length; i++) {
	        tablinks[i].className = tablinks[i].className.replace(" active", "");
	    }
	    document.getElementById(artTabName).style.display = "block";
	    evt.currentTarget.className += " active";
	}


    if (document.getElementById("artTab")) {
	var artTabDiv = document.getElementById("artTab");
	buttonsStr =   '<div style="position:absolute;top:0;left:0">' +
                       '<button class="artTabLinks" id="defaultArtTab" onclick="artTabSwitch(event, \'fullart\')">Normal</button>' +
                       '<button class="artTabLinks" onclick="artTabSwitch(event, \'fullart_D\')">Damaged</button>' +
                    '</div>'
        if (document.getElementById ("defaultArtTab") === null)  { 
	    	artTabDiv.insertAdjacentHTML( 'afterbegin', buttonsStr);
        }

	document.getElementById("defaultArtTab").click();
    }
});