<commit_before><?php
$protected = array();
$entity = $this->entity->getRawData();

foreach ($this->protectedKeys as $key) {
	$protected[$key] = $entity[$key];
	unset($entity[$key]);
}
foreach ($this->hiddenKeys as $key) {
	unset($entity[$key]);
}

print '<div class="form_protect">';
foreach ($protected as $k => $v) {
	print '<span class="label label-info">' . $k . '</span>'
		. '<span id="form' . $k . '"class="label label-inverse">' . $v . '</span>';
}
print '<span id="form_type" class="hidden">' . $this->type . '</span>';
print '<span id="form_coll" class="hidden">' . $this->collectionName . '</span>';
print '</div>';
?>
<script type="text/javascript">
	var entityJson = <?php echo json_encode($entity); ?>;
	var _jsonData = entityJson;
	var opt = {
		change: function(data) {
			/* called on every change */
			_jsonData = data;
		},
		propertyclick: function(path) { /* called when a property is clicked with the JS path to that property */
			jsonPath = JSON.parse(path);
			var protectedKeys = <?php echo json_encode($this->protectedKeys); ?>;
			for (p in jsonPath) {
				if ($.inArray(jsonPath[p], protectedKeys) !== -1) {
					$('input[title="' + jsonPath[p] + '"]').attr('disabled', 'disabled');
				}
			}
		}
	};
	/* opt.propertyElement = '<textarea>'; */ // element of the property field, <input> is default
	/* opt.valueElement = '<textarea>'; */  // element of the value field, <input> is default
	var _jsonEditor = $('#jsondiv').jsonEditor(entityJson, opt);
	$('#save').unbind();
	$('#save').click(function saveClick() {
		$(this).attr('disabled', 'disabled');<commit_msg>"Save changes" button is disabled after saving on admin panel - fixed<commit_after><?php
$protected = array();
$entity = $this->entity->getRawData();

foreach ($this->protectedKeys as $key) {
	$protected[$key] = $entity[$key];
	unset($entity[$key]);
}
foreach ($this->hiddenKeys as $key) {
	unset($entity[$key]);
}

print '<div class="form_protect">';
foreach ($protected as $k => $v) {
	print '<span class="label label-info">' . $k . '</span>'
		. '<span id="form' . $k . '"class="label label-inverse">' . $v . '</span>';
}
print '<span id="form_type" class="hidden">' . $this->type . '</span>';
print '<span id="form_coll" class="hidden">' . $this->collectionName . '</span>';
print '</div>';
?>
<script type="text/javascript">
	var entityJson = <?php echo json_encode($entity); ?>;
	var _jsonData = entityJson;
	var opt = {
		change: function(data) {
			/* called on every change */
			_jsonData = data;
		},
		propertyclick: function(path) { /* called when a property is clicked with the JS path to that property */
			jsonPath = JSON.parse(path);
			var protectedKeys = <?php echo json_encode($this->protectedKeys); ?>;
			for (p in jsonPath) {
				if ($.inArray(jsonPath[p], protectedKeys) !== -1) {
					$('input[title="' + jsonPath[p] + '"]').attr('disabled', 'disabled');
				}
			}
		}
	};
	/* opt.propertyElement = '<textarea>'; */ // element of the property field, <input> is default
	/* opt.valueElement = '<textarea>'; */  // element of the value field, <input> is default
	var _jsonEditor = $('#jsondiv').jsonEditor(entityJson, opt);
	$('#save').unbind();
	$('#save').removeAttr("disabled");
	$('#save').click(function saveClick() {
		$(this).attr('disabled', 'disabled');
{'fraction_non_alphanumeric': 0.2178549664838513, 'fraction_numerical': 0.0006093845216331506, 'mean_word_length': 4.36437908496732, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 55, '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': '649980', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1057, 'n_words': 280}