<commit_before>
/* Module-specific javascript can be placed here */

$(document).ready(function() {
	$('#et_save').unbind('click').click(function() {
		if (!$(this).hasClass('inactive')) {
			disableButtons();

			<?php if (isset($elements)) { foreach ($elements as $element) {
				foreach ($element['fields'] as $field) {
					if ($field['type'] == 'EyeDraw' && @$field['extra_report']) {?>
			if ($('#<?php echo $element['class_name']?>_<?php echo $field['name']?>2').length >0) {
				$('#<?php echo $element['class_name']?>_<?php echo $field['name']?>2').val(ed_drawing_edit_<?php echo $field['eyedraw_class']?>.report());
			}
					<?php }
				}
			} }?>

			return true;
		}
		return false;
	});

	$('#et_cancel').unbind('click').click(function() {
		if (!$(this).hasClass('inactive')) {
			disableButtons();

			if (m = window.location.href.match(/\/update\/[0-9]+/)) {
				window.location.href = window.location.href.replace('/update/','/view/');
			} else {
				window.location.href = '/patient/episodes/'+et_patient_id;
			}
		}
		return false;
	});

	$('#et_deleteevent').unbind('click').click(function() {
		if (!$(this).hasClass('inactive')) {
			disableButtons();
			$('#deleteForm').submit();
		}
		return false;
	});

	$('#et_canceldelete').unbind('click').click(function() {<commit_msg>bugfix for event deletion issue.<commit_after>
/* Module-specific javascript can be placed here */

$(document).ready(function() {
	$('#et_save').unbind('click').click(function() {
		if (!$(this).hasClass('inactive')) {
			disableButtons();

			<?php if (isset($elements)) { foreach ($elements as $element) {
				foreach ($element['fields'] as $field) {
					if ($field['type'] == 'EyeDraw' && @$field['extra_report']) {?>
			if ($('#<?php echo $element['class_name']?>_<?php echo $field['name']?>2').length >0) {
				$('#<?php echo $element['class_name']?>_<?php echo $field['name']?>2').val(ed_drawing_edit_<?php echo $field['eyedraw_class']?>.report());
			}
					<?php }
				}
			} }?>

			return true;
		}
		return false;
	});

	$('#et_cancel').unbind('click').click(function() {
		if (!$(this).hasClass('inactive')) {
			disableButtons();

			if (m = window.location.href.match(/\/update\/[0-9]+/)) {
				window.location.href = window.location.href.replace('/update/','/view/');
			} else {
				window.location.href = '/patient/episodes/'+et_patient_id;
			}
		}
		return false;
	});

	$('#et_deleteevent').unbind('click').click(function() {
		if (!$(this).hasClass('inactive')) {
			disableButtons();
			$('#et_deleteevent').click();
		}
		return false;
	});

	$('#et_canceldelete').unbind('click').click(function() {
{'fraction_non_alphanumeric': 0.24638233054074637, 'fraction_numerical': 0.003808073115003808, 'mean_word_length': 4.3394308943089435, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '5449803', 'n_tokens_mistral': 1011, 'n_tokens_neox': 897, 'n_words': 140}