<commit_before>﻿var MINER_COUNT = 2;
var SCREEN_COUNT_MAX = 8;

function boxOfficeLostFocus(oldValue, newValue) {

	if (oldValue != newValue) {
		clearWeights();

		clearMoviePicksPosters('bonusOnMovieList');
		clearMoviePicksPosters('bonusOffMovieList');

		clickPicks2();
	}
}

function clearMoviePicksPosters(movieListId) {

	for (var movieCount = 0; movieCount < SCREEN_COUNT_MAX; movieCount++) {
		var image = $('#' + movieListId + 'MoviePosterId0' + movieCount);

		if (image != null) {
			//console.log(image.attr('src'));

			image.attr('src', '/Images/MooveePosterRecalculate.jpg');
			image.attr('style', 'border-radius: 3px; box-shadow: 2px 4px 8px 0px grey;');
		}
	}
}

function clearWeights() {
	logit("clearWeights");

	for (idx = MINER_COUNT; idx <= 7; idx++) {
		$("#weightId" + idx).val(0);

		logit("#weightId" + idx + " = " + $("#weightId" + idx).val());
	}
}

function clickPasteBoxOffice() {
	var boValues = $("#pasteAreaId").val();
	var splitValues = boValues.split("\n");

	for (idx = 0; idx < 15 && idx < splitValues.length; idx++) {

		logit(idx + " = " + splitValues[idx]);

		if (idx < splitValues.length) {
			$("#boId" + (idx + 1)).val(splitValues[idx].trim());
		}
		else {
			$("#boId" + (idx + 1)).val("0");
		}
	}

	clearWeights();

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	clickPicks();
}

function clickMorePicks() {

	logit("clickPicks");

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	var url = "/Home/MorePicks?" + parameters;

	var baseUrl = parseBaseUrl();

	logit(baseUrl + url);

	window.location.href = baseUrl + url;
}

function clickPicks() {

	logit("clickPicks");

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	var url = "/Home/Index2?" + parameters;

	var baseUrl = parseBaseUrl();

	logit(baseUrl + url);

	window.location.href = baseUrl + url;

	logit(window.location.href);
}

function clickPicks2() {
	logit("clickPicks2");

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	var url = "/Home/Calculate?" + parameters;

	var baseUrl = parseBaseUrl();

	logit(baseUrl + url);

	calculate(url);
}

function clickTracking() {

	var parameters = parseBoxOfficeAndWeights();

	var url = "/Home/Tracking?" + parameters;

	var baseUrl = parseBaseUrl();

	window.location.href = baseUrl + url;
}

function parseBaseUrl() {
	var baseUrl = window.location.href;

	if (baseUrl != null) {
		var slashIdx = baseUrl.indexOf("/", "https://".length);

		if (slashIdx > 0) {
			baseUrl = baseUrl.substring(0, slashIdx);
		}
	}

	return baseUrl;
}

function parseBoxOfficeAndWeights() {

	var boList = "";
	var weightList = "";
	var weightTotal = 0;

	// The values should be synchronized so the values can be pulled from one set of fields.

	for (idx = 1; idx <= 15; idx++) {<commit_msg>Added navigateTo().<commit_after>﻿var MINER_COUNT = 2;
var SCREEN_COUNT_MAX = 8;

function boxOfficeLostFocus(oldValue, newValue) {

	if (oldValue != newValue) {
		clearWeights();

		clearMoviePicksPosters('bonusOnMovieList');
		clearMoviePicksPosters('bonusOffMovieList');

		clickPicks2();
	}
}

function clearMoviePicksPosters(movieListId) {

	for (var movieCount = 0; movieCount < SCREEN_COUNT_MAX; movieCount++) {
		var image = $('#' + movieListId + 'MoviePosterId0' + movieCount);

		if (image != null) {
			//console.log(image.attr('src'));

			image.attr('src', '/Images/MooveePosterRecalculate.jpg');
			image.attr('style', 'border-radius: 3px; box-shadow: 2px 4px 8px 0px grey;');
		}
	}
}

function clearWeights() {
	logit("clearWeights");

	for (idx = MINER_COUNT; idx <= 7; idx++) {
		$("#weightId" + idx).val(0);

		logit("#weightId" + idx + " = " + $("#weightId" + idx).val());
	}
}

function clickPasteBoxOffice() {
	var boValues = $("#pasteAreaId").val();
	var splitValues = boValues.split("\n");

	for (idx = 0; idx < 15 && idx < splitValues.length; idx++) {

		logit(idx + " = " + splitValues[idx]);

		if (idx < splitValues.length) {
			$("#boId" + (idx + 1)).val(splitValues[idx].trim());
		}
		else {
			$("#boId" + (idx + 1)).val("0");
		}
	}

	clearWeights();

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	clickPicks();
}

function clickMorePicks() {

	logit("clickPicks");

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	var url = "/Home/MorePicks?" + parameters;

	var baseUrl = parseBaseUrl();

	logit(baseUrl + url);

	window.location.href = baseUrl + url;
}

function clickPicks() {

	logit("clickPicks");

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	var url = "/Home/Index2?" + parameters;

	var baseUrl = parseBaseUrl();

	logit(baseUrl + url);

	window.location.href = baseUrl + url;

	logit(window.location.href);
}

function clickPicks2() {
	logit("clickPicks2");

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	var url = "/Home/Calculate?" + parameters;

	var baseUrl = parseBaseUrl();

	logit(baseUrl + url);

	calculate(url);
}

function clickTracking() {

	var parameters = parseBoxOfficeAndWeights();

	var url = "/Home/Tracking?" + parameters;

	var baseUrl = parseBaseUrl();

	window.location.href = baseUrl + url;
}

function navigateTo(relativeUrl) {

	logit("navigateTo");

	var parameters = parseBoxOfficeAndWeights();

	logit(parameters);

	var url = relativeUrl +'?' + parameters;

	var baseUrl = parseBaseUrl();

	logit(baseUrl + url);

	window.location.href = baseUrl + url;

	logit(window.location.href);
}

function parseBaseUrl() {
	var baseUrl = window.location.href;

	if (baseUrl != null) {
		var slashIdx = baseUrl.indexOf("/", "https://".length);

		if (slashIdx > 0) {
			baseUrl = baseUrl.substring(0, slashIdx);
		}
	}

	return baseUrl;
}

function parseBoxOfficeAndWeights() {

	var boList = "";
	var weightList = "";
	var weightTotal = 0;

	// The values should be synchronized so the values can be pulled from one set of fields.

	for (idx = 1; idx <= 15; idx++) {
{'fraction_non_alphanumeric': 0.16512215669755687, 'fraction_numerical': 0.009098567818028643, 'mean_word_length': 4.2811387900355875, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1063719', 'n_tokens_mistral': 2282, 'n_tokens_neox': 2050, 'n_words': 453}