<commit_before>/* TODO: make the messages variables passed to the script or use hidden html elements or similar */
(function($) {
$(document).ready(function() {
	$("ul#uldown ul").hide(); /* collapse everything */
	$("ul#uldown li:only-child > ul").show(); /* when there is no choice, don't force the user to click */
	$("ul#uldown li#sourcedl > ul > li:first > ul").show(); /* show the latest version of sources by default */
	/* preselect platform  default to rpm on linux TODO: Change options in html, so that platform here doesn't need any mapping */
	var navplatform = navigator.platform.toLowerCase();
	var platform = "";
	if (navplatform == "win32") {
		platform = "winx86";
	} else if (navplatform == "macintel") {
		platform="macintel" ;
	} else if (navplatform == "macppc") {
		platform = "macpp";
	} else if (navplatform.substring(0,5) == "linux") {
		var ua = navigator.userAgent.toLowerCase();
		var pkgtype = "rpm"
		if (ua.indexOf("buntu") >= 0 || ua.indexOf("debian") >= 0 || ua.indexOf("iceweasel") >= 0 ) {
			pkgtype= "deb";
		}
		if (navplatform == "linux x86_64") {
			platform = pkgtype+"x86_64";
		} else {
			platform = pkgtype+"x86";
		}
	}
	if (platform != "") {
		$("select#platform").val(platform);
		}
	var userLang = ((navigator.language) ? navigator.language : navigator.userLanguage).split("_");
	if ( $("select#lang option[value='"+userLang[0]+"-"+userLang[1]+"']").length) {
		$("select#lang").val(userLang[0]+"-"+userLang[1]);
	} else if ( $("select#lang option[value='"+userLang[0]+"']").length) {
		$("select#lang").val(userLang[0]);
	}

	$("select#platform").change(function () {
		var sel=$(this).val();
		var matches = "";
		if (sel=="winx86") {
			$("select#lang").hide();
		} else {
			$("select#lang").show();
		}
		$("select#lang").trigger("change");
		}).change();

	$("select#lang").change(function () {<commit_msg>default to en-US for non-detected/non-matching language<commit_after>/* TODO: make the messages variables passed to the script or use hidden html elements or similar */
(function($) {
$(document).ready(function() {
	$("ul#uldown ul").hide(); /* collapse everything */
	$("ul#uldown li:only-child > ul").show(); /* when there is no choice, don't force the user to click */
	$("ul#uldown li#sourcedl > ul > li:first > ul").show(); /* show the latest version of sources by default */
	/* preselect platform  default to rpm on linux TODO: Change options in html, so that platform here doesn't need any mapping */
	var navplatform = navigator.platform.toLowerCase();
	var platform = "";
	if (navplatform == "win32") {
		platform = "winx86";
	} else if (navplatform == "macintel") {
		platform="macintel" ;
	} else if (navplatform == "macppc") {
		platform = "macpp";
	} else if (navplatform.substring(0,5) == "linux") {
		var ua = navigator.userAgent.toLowerCase();
		var pkgtype = "rpm"
		if (ua.indexOf("buntu") >= 0 || ua.indexOf("debian") >= 0 || ua.indexOf("iceweasel") >= 0 ) {
			pkgtype= "deb";
		}
		if (navplatform == "linux x86_64") {
			platform = pkgtype+"x86_64";
		} else {
			platform = pkgtype+"x86";
		}
	}
	if (platform != "") {
		$("select#platform").val(platform);
		}
	var userLang = ((navigator.language) ? navigator.language : navigator.userLanguage).split("_");
	if ( $("select#lang option[value='"+userLang[0]+"-"+userLang[1]+"']").length) {
		$("select#lang").val(userLang[0]+"-"+userLang[1]);
	} else if ( $("select#lang option[value='"+userLang[0]+"']").length) {
		$("select#lang").val(userLang[0]);
	} else {
		$("select#lang").val("en-US");
	}

	$("select#platform").change(function () {
		var sel=$(this).val();
		var matches = "";
		if (sel=="winx86") {
			$("select#lang").hide();
		} else {
			$("select#lang").show();
		}
		$("select#lang").trigger("change");
		}).change();

	$("select#lang").change(function () {
{'fraction_non_alphanumeric': 0.21407932755450487, 'fraction_numerical': 0.014184397163120567, 'mean_word_length': 4.4477825464949925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '3841034', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1293, 'n_words': 305}