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; });

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

$('#TierSearch').children('div').on('click', function(e) {	var value = this.children[0].title;	if (tierFilter === value)	{		tierFilter = ;	}	else	{		tierFilter = value	}	var p = document.getElementById("TierSearch");	for(var i=0; i<p.children.length; i++)	{		var c = p.children[i];		if(tierFilter === )		{			c.style.opacity = 1;				} 		else if (c.children[0].title === tierFilter)		{			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; for(var i=0; i -1; validClass = classFilter === '' || child.children["class"].innerText.toUpperCase.indexOf(classFilter.toUpperCase) > -1; validFaction = factionFilter === '' || child.children["faction"].innerText.toUpperCase.indexOf(factionFilter.toUpperCase) > -1; validTier = tierFilter === '' || child.children["tier"].innerText.toUpperCase.indexOf(tierFilter.toUpperCase) > -1; if (validText && validClass && validFaction && validTier) {			child.style.display = ''; }		else {			child.style.display = 'none'; }	} }

/* Skill search function below */

var parsingData = [ {		"type": "priority", "name": "front row", "keywords": ["FRONT ROW"] },	{		"type": "priority", "name": "back row", "keywords": ["BACK ROW"] },		{		"type": "target", "name": "self", "keywords": ["SELF", "OWN"] },	{		"type": "target", "name": "random", "keywords": ["RANDOM", "PARTY HEROES"] },	{		"type": "target", "name": "all", "keywords": ["ALL PARTY HEROES"] },	{		"type": "target", "name": "mage", "keywords": [" MAGE"] },		{		"type": "target", "name": "support", "keywords": ["SUPPORT"] },		{		"type": "target", "name": "ranger", "keywords": ["RANGER"] },		{		"type": "target", "name": "tank", "keywords": ["TANK"] },	{		"type": "target", "name": "assassin", "keywords": ["ASSASSIN"] },		{		"type": "target", "name": "penglai", "keywords": ["PENGLAI"] },   {		"type": "target", "name": "lowest hp", "keywords": ["LOWEST HP"] },   {		"type": "target", "name": "highest hp", "keywords": ["HIGHEST HP"] },   {		"type": "damageType", "name": "true", "keywords": ["TRUE DAMAGE"] },   {		"type": "damageType", "name": "physical", "keywords": ["PHYSICAL DAMAGE"] },   {		"type": "damageType", "name": "magic", "keywords": ["MAGIC DAMAGE"] },   {		"type": "damageType", "name": "elemental", "keywords": ["ELEMENTAL DAMAGE"] },   {		"type": "damageType", "name": "crit", "keywords": ["CRIT DAMAGE"] },   {		"type": "statusEffect", "name": "taunt", "keywords": ["TAUNT"] },   {		"type": "statusEffect", "name": "stun", "keywords": ["STUN"] },   {		"type": "statusEffect", "name": "silence", "keywords": ["SILENCE"] },   {		"type": "statusEffect", "name": "poison", "keywords": ["POISON"] },	   {		"type": "statusEffect", "name": "burn", "keywords": ["BURN"] },   {		"type": "statusEffect", "name": "hidden", "keywords": ["HIDING"] },	   {		"type": "statusEffect", "name": "immune", "keywords": ["IMMUNE"] },   {		"type": "statusEffect", "name": "dispel", "keywords": ["DISPEL"] },   {		"type": "statusEffect", "name": "heal", "keywords": ["CASTS A HEALING", "CASTS A RECOVERY", "CAST A RECOVERY"] },	   {		"type": "statusEffect", "name": "heal down", "keywords": ["HEALING EFFECT ON THE AFFECTED TARGET IS REDUCED"] },   {		"type": "statusEffect", "name": "energy up", "keywords": ["ADDITIONAL ENERGIES", "CAST A ENERGY GRANT"] },	   {		"type": "statusEffect", "name": "energy down", "keywords": ["ENERGY REDUCTION"] },	   {		"type": "statusEffect", "name": "speed up", "keywords": ["INCREASES OWN SPEED"] },	   {		"type": "statusEffect", "name": "speed down", "keywords": ["DECREASING SPEED"] },   {		"type": "statusEffect", "name": "CRIT up", "keywords": ["CRIT CHANCE", "INCREASE OWN CRIT RATE"] },   {		"type": "statusEffect", "name": "CDMG up", "keywords": ["INCREASING THEIR CDMG", "AND CRIT DAMAGE"] },   {		"type": "statusEffect", "name": "ATK up", "keywords": ["INCREASE ATK", "INCREASES ATK", "INCREASING SELF ATK", "INCREASES SELF ATK", "INCREASES THEIR ATK", "INCREASE THEIR ATK", "INCREASE OWN ATK"] },   {		"type": "statusEffect", "name": "MDEF up", "keywords": ["INCREASE THE MAGIC DEFENSE", "INCREASES THE MAGIC DEFENSE", "INCREASES SELF MAGIC DEFENSE"] },   {		"type": "statusEffect", "name": "MRES up", "keywords": ["INCREASE THE MAGIC RESISTANCE","INCREASES THE MAGIC RESISTANCE"] },   {		"type": "statusEffect", "name": "PDEF up", "keywords": ["INCREASE THE PHYSICAL DEFENSE", "INCREASES THE PHYSICAL DEFENSE"] }];

$(function {	var list = document.getElementById("skills");

for(var i=0; i -1) {					if (output.innerText === '') {						output.innerText = data.name; }					else {						output.innerText = output.innerText + ", " + data.name; }

}			}		}	} });