MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ var classFilter = ''; var factionFilter = ''; var tierFilter = '';

$(function {	$('#HeroSearch').html(''); });

$('#ClassSearch').children('div').on('click', function(e) {	var value = this.children[0].title;	if (classFilter === value)	{		classFilter = ;	}	else	{		classFilter = value	}	var p = document.getElementById("ClassSearch");	for(var i=0; i<p.children.length; i++)	{		var c = p.children[i];		if(classFilter === )		{			c.style.opacity = 1;				} 		else if (c.children[0].title === classFilter)		{			c.style.opacity = 1;		}		else		{			c.style.opacity = 0.5;			}	}	FilterHeroes; });

function FilterHeroes {	var heroes = document.getElementById("HeroList"); var filter = document.getElementById("HeroSearchBox").value.toUpperCase; alert(filter + "\n" +classFilter +"\n" + factionFilter +"\n" + tierFilter); for(var i=0; i -1; validClass = classFilter === '' || child.children["class"].innerText !== classFilter; validFaction = factionFilter === '' || child.children["faction"].innerText !== factionFilter; validTier = tierFilter === '' || child.children["tier"].innerText !== tierFilter; if (validText && validClass && validFaction && validTier) {			child.style.display = ''; }		else {			child.style.display = 'none'; }	} }