<commit_before><?php
	define('JAVASCRIPT', true);
	require_once "common.php";
?>
<!-- --><script>
$(function(){
	// Scan AJAX responses for errors.
	$(document).ajaxComplete(function(event, request){
		var response = request.responseText
		if (isError(response))
			alert(response.replace(/(HEY_JAVASCRIPT_THIS_IS_AN_ERROR_JUST_SO_YOU_KNOW|<([^>]+)>\n?)/gm, ""))
	})<?php echo "\n\n\n\n\n"; # Balance out the line numbers in this script and in the output to help debugging. ?>

	// Handle typing "\ct" to insert a <tab>
	$("textarea").keyup(function(event){
		if ($(this).val().match(/([^\\]|^)\\ct/gm))
			$(this).val($(this).val().replace(/([^\\]|^)\\ct/gm, "	"))
	})

	// Automated PNG fixing.
	$.ifixpng("<?php echo $config->chyrp_url; ?>/admin/images/icons/pixel.gif")
	$("img[@src$=.png]").ifixpng()

	// "Help" links should open in popup windows.
	$(".help").livequery("click", function(){
		window.open($(this).attr("href"), "help", "status=0, scrollbars=1, location=0, menubar=0, "+
		                                          "toolbar=0, resizable=1, height=450, width=400")
		return false
	})

	// Auto-expand input fields
	$(".expand").expand()

	// Checkbox toggling.
	togglers()

	if ($.browser.safari)
		$("code, .code").each(function(){
			$(this).css({
				fontFamily: "Monaco, monospace",
				fontSize: "9px"
			})

			if ($(this).parent().parent().parent().hasClass("split") && $(this).attr("type") == "text") {
				$(this).css("margin-top", "2px")
				$(this).parent().css("margin-top", "-2px")
			}
		})

	if (/(edit|write)_/.test(Route.action))
		Write.init()

	if (Route.action == "delete_group")
		$("form.confirm").submit(function(){
			if (!confirm("<?php echo __("You are a member of this group. Are you sure you want to delete it?"); ?>"))
				return false
		})

	if (Route.action == "manage_pages")
		Manage.pages.init()

	if (Route.action == "modules" || Route.action == "feathers")
		Extend.init()

	// Remove things that only exist for JS-disabled users.
	$(".js_disabled").remove()
	$(".js_enabled").css("display", "block")
})

function togglers() {
	var all_checked = true

	$(document.createElement("label")).attr("for", "toggle").text("<?php echo __("Toggle All"); ?>").appendTo("#toggler")
	$(document.createElement("input")).attr({
		type: "checkbox",
		name: "toggle",
		id: "toggle"
	}).prependTo("#toggler, .toggler")

	$("#toggle").click(function(){
		$("form#new_group, form#group_edit, table").find(":checkbox").not("#toggle").each(function(){
			this.checked = document.getElementById("toggle").checked
		})

		$(this).parent().parent().find(":checkbox").not("#toggle").each(function(){
			this.checked = document.getElementById("toggle").checked
		})
	})

	// Some checkboxes are already checked when the page is loaded
	$("form#new_group, form#group_edit, table").find(":checkbox").not("#toggle").each(function(){
		if (!all_checked) return
		all_checked = this.checked
	})<commit_msg>Fixed checkbox wonkiness in FF3. [#208 state:resolved]<commit_after><?php
	define('JAVASCRIPT', true);
	require_once "common.php";
?>
<!-- --><script>
$(function(){
	// Scan AJAX responses for errors.
	$(document).ajaxComplete(function(event, request){
		var response = request.responseText
		if (isError(response))
			alert(response.replace(/(HEY_JAVASCRIPT_THIS_IS_AN_ERROR_JUST_SO_YOU_KNOW|<([^>]+)>\n?)/gm, ""))
	})<?php echo "\n\n\n\n\n"; # Balance out the line numbers in this script and in the output to help debugging. ?>

	// Handle typing "\ct" to insert a <tab>
	$("textarea").keyup(function(event){
		if ($(this).val().match(/([^\\]|^)\\ct/gm))
			$(this).val($(this).val().replace(/([^\\]|^)\\ct/gm, "	"))
	})

	// Automated PNG fixing.
	$.ifixpng("<?php echo $config->chyrp_url; ?>/admin/images/icons/pixel.gif")
	$("img[@src$=.png]").ifixpng()

	// "Help" links should open in popup windows.
	$(".help").livequery("click", function(){
		window.open($(this).attr("href"), "help", "status=0, scrollbars=1, location=0, menubar=0, "+
		                                          "toolbar=0, resizable=1, height=450, width=400")
		return false
	})

	// Auto-expand input fields
	$(".expand").expand()

	// Checkbox toggling.
	togglers()

	if ($.browser.safari)
		$("code, .code").each(function(){
			$(this).css({
				fontFamily: "Monaco, monospace",
				fontSize: "9px"
			})

			if ($(this).parent().parent().parent().hasClass("split") && $(this).attr("type") == "text") {
				$(this).css("margin-top", "2px")
				$(this).parent().css("margin-top", "-2px")
			}
		})

	if (/(edit|write)_/.test(Route.action))
		Write.init()

	if (Route.action == "delete_group")
		$("form.confirm").submit(function(){
			if (!confirm("<?php echo __("You are a member of this group. Are you sure you want to delete it?"); ?>"))
				return false
		})

	if (Route.action == "manage_pages")
		Manage.pages.init()

	if (Route.action == "modules" || Route.action == "feathers")
		Extend.init()

	// Remove things that only exist for JS-disabled users.
	$(".js_disabled").remove()
	$(".js_enabled").css("display", "block")
})

function togglers() {
	var all_checked = true

	$(document.createElement("label")).attr("for", "toggle").text("<?php echo __("Toggle All"); ?>").appendTo("#toggler")
	$(document.createElement("input")).attr({
		type: "checkbox",
		name: "toggle",
		id: "toggle",
		"class": "checkbox"
	}).appendTo("#toggler, .toggler")

	$("#toggle").click(function(){
		$("form#new_group, form#group_edit, table").find(":checkbox").not("#toggle").each(function(){
			this.checked = document.getElementById("toggle").checked
		})

		$(this).parent().parent().find(":checkbox").not("#toggle").each(function(){
			this.checked = document.getElementById("toggle").checked
		})
	})

	// Some checkboxes are already checked when the page is loaded
	$("form#new_group, form#group_edit, table").find(":checkbox").not("#toggle").each(function(){
		if (!all_checked) return
		all_checked = this.checked
	})
{'fraction_non_alphanumeric': 0.22827737472583096, 'fraction_numerical': 0.005736460266576683, 'mean_word_length': 4.236749116607774, 'pattern_counts': {'":': 7, '<': 21, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5485153', 'n_tokens_mistral': 2187, 'n_tokens_neox': 1986, 'n_words': 404}