<commit_before>/**
 * $Id: GZ 2010-12-19 exp$
 * Used by regions.php.
 * 
 * TODO: some functions here, shall not use the Get-comand but rather modify the DOM directly.
 */

/**
 * prepare species string for $_GET
 */
function prepareSpecies(site) {
	var project_str = "projects";
	// var project_selects = document.getElementsByName(project_str);
	var src_sel = document.getElementById(project_str + "0");
	var tar_sel = document.getElementById(project_str + "1");

	if (src_sel.selectedIndex >= 0) {
		var src_val = src_sel[src_sel.selectedIndex].value;
	} else {
		if (site == null) {
			// XXX
		}
		var src_val = "NULL";
	}

	if (tar_sel.selectedIndex >= 0) {
		var tar_val = tar_sel[tar_sel.selectedIndex].value;
	} else {
		if (site == null) {
		// XXX
			site = "regions.php";
		}
		var tar_val = "NULL";
	}

	if (site == null) {
		site = "regions.php";
	}
	var proj_arg = project_str + "[]=";
	return site + "?" + proj_arg + src_val + "&" + proj_arg + tar_val;

	// var species_str = "species";
	// var species_select = document.getElementsByName(species_str)[0];
	// var expr = /(\w.+)\s(\w.+)/;
	// expr.exec(species_select[species_select.selectedIndex].value);
	// if (site == null) {
	// site = "regions.php";
	// }
	// return site + "?" + species_str + "=" + RegExp.$1 + "+" + RegExp.$2;
}<commit_msg>regions javascript update<commit_after>/**
 * $Id: GZ 2010-12-19 exp$
 * Used by regions.php.
 * 
 * TODO: some functions here, shall not use the Get-comand but rather modify the DOM directly.
 */

/**
 * prepare species string for $_GET
 */
function prepareSpecies(site) {
	var project_str = "projects";
	// var project_selects = document.getElementsByName(project_str);
	var src_sel = document.getElementById(project_str + "0");
	var tar_sel = document.getElementById(project_str + "1");

	var proj_null = false;
	if (src_sel.selectedIndex >= 0) {
		var src_val = src_sel[src_sel.selectedIndex].value;
	} else {
		proj_null = true;
		var src_val = "NULL";
	}

	if (tar_sel.selectedIndex >= 0) {
		var tar_val = tar_sel[tar_sel.selectedIndex].value;
	} else {
		proj_null = true;
		var tar_val = "NULL";
	}

	if (site == null) {
		site = "regions.php";
	}else if(proj_null){
		alert("All projectssdlgmnldsfng");
		site = "regions.php";
	}
	var proj_arg = project_str + "[]=";
	return site + "?" + proj_arg + src_val + "&" + proj_arg + tar_val;

	// var species_str = "species";
	// var species_select = document.getElementsByName(species_str)[0];
	// var expr = /(\w.+)\s(\w.+)/;
	// expr.exec(species_select[species_select.selectedIndex].value);
	// if (site == null) {
	// site = "regions.php";
	// }
	// return site + "?" + species_str + "=" + RegExp.$1 + "+" + RegExp.$2;
}
{'fraction_non_alphanumeric': 0.1726698848867434, 'fraction_numerical': 0.011139992573338284, 'mean_word_length': 3.4974958263772953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6701712', 'n_tokens_mistral': 1054, 'n_tokens_neox': 983, 'n_words': 221}