<commit_before>
$(document).ready(function(){
	if(document.getElementById("loginDialog")){
		Dialogs.init("loginDialog");

	}

	$('#forgotPassButton').click(function(e){
		e.preventDefault();
		e.stopPropagation();
		F.API.Auth.sendPassword($('#txtUserName').val(), function(response){
			if(response.status == "201"){
				if(document.getElementById("message")){
					$("#message")
						.text('E-mail sent!')
						.removeClass("")
						.addClass("info")
						.show();
				}
			}
			else{
				F.Net.goToURL("login.html?msg=psent");
			}
		});
	});

	$("#demoLoginSelect").change(function(){
		if(this.value !== "other"){
			$("#userName")
				.hide();
			var username =  $("#demoLoginSelect :selected").text();

			$("#txtUserName").val(username);
			$("#txtPasswd").val($(this).val());
		}
		else{
			$("#userName")
				.show()
			$("#F_login_fields :text, #F_login_fields :password")
					.val("");
		}
	})
	$("#btnLogin").click(function(evt){
		evt.preventDefault();
		var userName = $("#txtUserName").val()
		var passwd = $("#txtPasswd").val();

		F.API.Auth.login(userName, passwd, function(loginInfo){
			if(loginInfo.canRunSim){
                var location = window.location.href.replace('login.html', '');
                window.location.assign(location);
			}
			else if(loginInfo.userGroups && loginInfo.userGroups.length > 0){
				var str = "<select id=\"group_selected\">";

				for(i=0;i<loginInfo.userGroups.length;i++){
					var group = loginInfo.userGroups[i];
					if(group.description) var groupLabel = group.description + ", (" + group.name + ")";
					else var groupLabel = group.name
					str += "<option value=\""+group.name+"\">"+groupLabel+"</option>";
				}
				str += "</select><p style=\"padding-top:12px;\"><input class=\"leave_group\" type=\"submit\" value=\"&laquo; Log out\" /><input class=\"join_group\" style=\"float: right;\" type=\"submit\" value=\"Log in &raquo;\" /></p>";
				var dialogHeader = "Choose the code for your class and section:";

				Dialogs.show(str,null,{
					icon: "",<commit_msg>Fix a bug that was preventing autocomplete from working in Chrome<commit_after>
$(document).ready(function(){
	if(document.getElementById("loginDialog")){
		Dialogs.init("loginDialog");

	}

	$('#forgotPassButton').click(function(e){
		e.preventDefault();
		e.stopPropagation();
		F.API.Auth.sendPassword($('#txtUserName').val(), function(response){
			if(response.status == "201"){
				if(document.getElementById("message")){
					$("#message")
						.text('E-mail sent!')
						.removeClass("")
						.addClass("info")
						.show();
				}
			}
			else{
				F.Net.goToURL("login.html?msg=psent");
			}
		});
	});

	$("#demoLoginSelect").change(function(){
		if(this.value !== "other"){
			$("#userName")
				.hide();
			var username =  $("#demoLoginSelect :selected").text();

			$("#txtUserName").val(username);
			$("#txtPasswd").val($(this).val());
		}
		else{
			$("#userName")
				.show()
			$("#F_login_fields :text, #F_login_fields :password")
					.val("");
		}
	})
	$("#login, form:has(#btnLogin)").submit(function(evt){
		evt.preventDefault();
		var userName = $("#txtUserName").val()
		var passwd = $("#txtPasswd").val();

		F.API.Auth.login(userName, passwd, function(loginInfo){
			if(loginInfo.canRunSim){
                var location = window.location.href.replace('login.html', '');
                window.location.assign(location);
			}
			else if(loginInfo.userGroups && loginInfo.userGroups.length > 0){
				var str = "<select id=\"group_selected\">";

				for(i=0;i<loginInfo.userGroups.length;i++){
					var group = loginInfo.userGroups[i];
					if(group.description) var groupLabel = group.description + ", (" + group.name + ")";
					else var groupLabel = group.name
					str += "<option value=\""+group.name+"\">"+groupLabel+"</option>";
				}
				str += "</select><p style=\"padding-top:12px;\"><input class=\"leave_group\" type=\"submit\" value=\"&laquo; Log out\" /><input class=\"join_group\" style=\"float: right;\" type=\"submit\" value=\"Log in &raquo;\" /></p>";
				var dialogHeader = "Choose the code for your class and section:";

				Dialogs.show(str,null,{
					icon: "",
{'fraction_non_alphanumeric': 0.2195709809592673, 'fraction_numerical': 0.003374307061942637, 'mean_word_length': 3.6839729119638824, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '1254743', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1346, 'n_words': 227}