<commit_before>/* JS functions available on every page. */

function init_instruction_input() {
	/* Allow search boxes to give instructions that disappear when selected. */
	$('.instruction_input').each(function(index) {
		// Only apply help instruction if blank.
		if ($(this).val() != '')
			return;
		// Input instruction goes in 'help' attribute.
		var orig_text = $(this).attr('help');
		$(this).val(orig_text);

		$(this).focus(function() {  // Remove instruction on focus.
			if ($(this).val() == orig_text) {
				$(this).val('');
			}
		}).blur(function() {  // Restore on blur if nothing entered.
			if ($(this).val() == '') {
				$(this).val(orig_text);
			}
		});
		// Remove on form submit.
		input = $(this);  // Inside form submit handler, $(this) = form.
		input.closest('form').submit(function() {
			if (input.val() == orig_text) {
				input.val('');
			}
		});
	});
}

function init_feed_items() {
	/* Make feed item container divs clickable links. */
	$('.feed_item').click(function() {
		window.location = $(this).attr('href');
	}).hover(function() {
		$(this).addClass('hover')
	}, function() {
		$(this).removeClass('hover')
	});
}	

function init_feed_filter_form() {
	/* Make form submit on change. */
	$('.feed_filter_form #id_radius').change(function() {<commit_msg>Handle instruction inputs that are held over as input values across page reloads.<commit_after>/* JS functions available on every page. */

function init_instruction_input() {
	/* Allow search boxes to give instructions that disappear when selected. */
	$('.instruction_input').each(function(index) {
		// Input instruction goes in 'help' attribute.
		var orig_text = $(this).attr('help');

		// Only apply help instruction if blank.
		if ($(this).val() == '')
			$(this).val(orig_text);

		$(this).focus(function() {  // Remove instruction on focus.
			if ($(this).val() == orig_text) {
				$(this).val('');
			}
		}).blur(function() {  // Restore on blur if nothing entered.
			if ($(this).val() == '') {
				$(this).val(orig_text);
			}
		});
		
		// Remove help on form submit.
		input = $(this);  // Inside form submit handler, $(this) = form.
		input.closest('form').submit(function() {
			if (input.val() == orig_text) {
				input.val('');
			}
		});
	});
}

function init_feed_items() {
	/* Make feed item container divs clickable links. */
	$('.feed_item').click(function() {
		window.location = $(this).attr('href');
	}).hover(function() {
		$(this).addClass('hover')
	}, function() {
		$(this).removeClass('hover')
	});
}	

function init_feed_filter_form() {
	/* Make form submit on change. */
	$('.feed_filter_form #id_radius').change(function() {
{'fraction_non_alphanumeric': 0.1969068276122218, 'fraction_numerical': 0.0, 'mean_word_length': 3.588235294117647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3911335', 'n_tokens_mistral': 922, 'n_tokens_neox': 830, 'n_words': 212}