<commit_before>// <NAME> - http://www.ab-d.fr
Array.prototype.in_array = function(p_val) {
	for(var i = 0, l = this.length; i < l; i++) {
		if(this[i] == p_val) {
			return true;
		}
	}
	return false;
}
//JS code by Astax to foster filtering the results

//Use window variable to store filter values, this is kinda like a JS equivellent of global
window.filter = new Array("All", "All", "All", "All", "All", "All", "All", "All", "All", "All");

//reset all check boxes
function resetBoxes() {
	var toggle = document.getElementById("raceform");
	for (i = 0; i < toggle.races.length; i++) {
		toggle.races[i].checked = true;
	}
}

function racePickf() {
	filterSelect("racePick", 1);
}

function powerPickf() {
	filterSelect("powerPick", 6);
}

function restrictPickf() {
	filterSelect("restrictPick", 7);
}

function filterSelect(selectId, filterId) {
	var option = document.getElementById(selectId);
	var selected = option.options[option.selectedIndex].value;

	window.filter[filterId] = selected;
	applyFilter();
}

function raceToggle() {
	var toggle = document.getElementById("raceform");
	window.filter[1] = new Array();
	for (i = 0; i < toggle.races.length; i++) {
		if (toggle.races[i].checked) {
			window.filter[1].push(toggle.races[i].value);
		}
	}
	applyFilter();
}

function applyFilter() {
	var table = document.getElementById("table");
	for (var i=1; i < table.rows.length; i++) {
		var show = true;
		for (var j=0; j < table.rows[i].cells.length; j++) {
			if (window.filter[j] == "All") {
				continue;
			}
			if( Object.prototype.toString.call( window.filter[j] ) === '[object Array]' ) {
				if (!window.filter[j].in_array(table.rows[i].cells[j].innerHTML)) {
					show = false;
					break;
				}
			} else {
				if (table.rows[i].cells[j].innerHTML != window.filter[j]) {
					show = false;
					break;
				}
			}
		}
		if (show) {
			table.rows[i].style.display="";
		} else {
			table.rows[i].style.display="none";
		}
	}
}<commit_msg>weapon_list.js: a few javascript fixes<commit_after>// <NAME> - http://www.ab-d.fr
Array.prototype.in_array = function(p_val) {
	for(var i = 0, l = this.length; i < l; i++) {
		if(this[i] == p_val) {
			return true;
		}
	}
	return false;
}
//JS code by Astax to foster filtering the results

//Use window variable to store filter values, this is kinda like a JS equivellent of global
window.filter = ["All", "All", "All", "All", "All", "All", "All", "All", "All", "All"];

//reset all check boxes
function resetBoxes() {
	var toggle = document.getElementById("raceform");
	for (var i = 0; i < toggle.races.length; i++) {
		toggle.races[i].checked = true;
	}
}

function racePickf() {
	filterSelect("racePick", 1);
}

function powerPickf() {
	filterSelect("powerPick", 6);
}

function restrictPickf() {
	filterSelect("restrictPick", 7);
}

function filterSelect(selectId, filterId) {
	var option = document.getElementById(selectId);
	var selected = option.options[option.selectedIndex].value;

	window.filter[filterId] = selected;
	applyFilter();
}

function raceToggle() {
	var toggle = document.getElementById("raceform");
	window.filter[1] = [];
	for (var i = 0; i < toggle.races.length; i++) {
		if (toggle.races[i].checked) {
			window.filter[1].push(toggle.races[i].value);
		}
	}
	applyFilter();
}

function applyFilter() {
	var table = document.getElementById("table");
	for (var i=1; i < table.rows.length; i++) {
		var show = true;
		for (var j=0; j < table.rows[i].cells.length; j++) {
			if (window.filter[j] == "All") {
				continue;
			}
			if (Array.isArray(window.filter[j])) {
				if (!window.filter[j].in_array(table.rows[i].cells[j].innerHTML)) {
					show = false;
					break;
				}
			} else {
				if (table.rows[i].cells[j].innerHTML != window.filter[j]) {
					show = false;
					break;
				}
			}
		}
		if (show) {
			table.rows[i].style.display="";
		} else {
			table.rows[i].style.display="none";
		}
	}
}
{'fraction_non_alphanumeric': 0.1823559670781893, 'fraction_numerical': 0.0051440329218107, 'mean_word_length': 3.685542168674699, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3185725', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1389, 'n_words': 322}