MediaWiki:SwitchInfoMode.js

var normalButton = '[Normal]'; var normalColor = '#D7EEFD'; var expertButton = '[Expert]'; var expertColor = '#FFE6E6';

if ($('.infoExpert').length > 0){ $('.statTitle').remove; var $infoNormal = $('.infoNormal'); var $infoExpert = $('.infoExpert'); var $switchNormal = $('.switchNormal').append(''+normalButton+''); var $switchExpert = $('.switchExpert').append(''+expertButton+''); $switchNormal.css('font-weight','bold').css('color','#063B5E'); $switchExpert.css('font-weight','200').css('color','#063B5E');

var stats = ['Life', 'Money', 'Damage', 'Knockback', 'AI', 'Defense', 'Stack', 'Power', 'Drops'];

$('.switchNormal').click(function{		$.each($('.infoNormal'), function(key, value){ var NPCname = $(this).data('npcname'); $.each(stats, function(data, stat){				var npcSelect = '[data-npcname="'+NPCname+'"]';				if ($('.expert' + stat + npcSelect).length > 0){					var expValue = $('.expert' + stat + npcSelect).html;					var normValue = $('.normal' + stat + npcSelect).html;					$('.normal' + stat + npcSelect).html(expValue).css('background',normalColor);					$('.expert' + stat + npcSelect).html(normValue);				}			}); $switchNormal.css('font-weight','bold'); $switchExpert.css('font-weight','200'); });	});	$('.switchExpert').click(function{		$.each($('.infoNormal'), function(key, value){ var NPCname = $(this).data('npcname'); $.each(stats, function(data, stat){				var npcSelect = '[data-npcname="'+NPCname+'"]';				if ($('.expert' + stat + npcSelect).length > 0){ 					var expValue = $('.expert' + stat + npcSelect).html;					var normValue = $('.normal' + stat + npcSelect).html;					$('.normal' + stat + npcSelect).html(expValue).css('background',expertColor);					$('.expert' + stat + npcSelect).html(normValue);				}			}); $switchNormal.css('font-weight','200'); $switchExpert.css('font-weight','bold'); });	}); }