<commit_before>{* $Id$ *}
{* ==> put in this file what is not displayed in the layout (javascript, debug..)*}
<div id="bootstrap-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
		</div>
	</div>
</div>
{if (! isset($display) or $display eq '')}
	{if count($phpErrors)}
		{if ($prefs.error_reporting_adminonly eq 'y' and $tiki_p_admin eq 'y') or $prefs.error_reporting_adminonly eq 'n'}
		{button _ajax="n" _id="show-errors-button" _onclick="flip('errors');return false;" _text="{tr}Show php error messages{/tr}"}
		<div id="errors" class="alert alert-warning" style="display:{if (isset($smarty.session.tiki_cookie_jar.show_errors) and $smarty.session.tiki_cookie_jar.show_errors eq 'y') or $prefs.javascript_enabled ne 'y'}block{else}none{/if};">
			&nbsp;{listfilter selectors='#errors>div'}
			{foreach item=err from=$phpErrors}
				{$err}
			{/foreach}
		</div>
		{/if}
	{/if}

	{if $tiki_p_admin eq 'y' and $prefs.feature_debug_console eq 'y'}
		{* Include debugging console.*}
		{debugger}
	{/if}

{/if}
{*needs to be in the footer.tpl so that it runs at the end rather than in antibot.tpl where it breaks tracker validation*}
{jq}
if ($("#antibotcode").parents('form').data("validator")) {
    $( "#antibotcode" ).rules( "add", {
        required: true,
        remote: {
            url: "validate-ajax.php",
            type: "post",
            data: {
                validator: "captcha",
                parameter: function() {
                    return $jq("#captchaId").val();
                },
                input: function() {
                    return $jq("#antibotcode").val();
                }
            }
        }
    });
} else {
    var form = $("#antibotcode").parents('form');
    $("form[name="+ form.attr('name') +"]").validate({
        rules: {
            "captcha[input]": {
                required: true,
                remote: {
                    url: "validate-ajax.php",
                    type: "post",
                    data: {
                        validator: "captcha",
                        parameter: function() {
                            return $jq("#captchaId").val();
                        },
                        input: function() {
                            return $jq("#antibotcode").val();
                        }
                    }
                }
            }
        },
        messages: {
            "captcha[input]": { required: "This field is required"},
        },
        submitHandler: function(){form.submit();}
    });
}<commit_msg>[FIX] antibot: Trailing comma not allowed in JS (not sure this JS is really needed here, just looks wrong...)<commit_after>{* $Id$ *}
{* ==> put in this file what is not displayed in the layout (javascript, debug..)*}
<div id="bootstrap-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
		</div>
	</div>
</div>
{if (! isset($display) or $display eq '')}
	{if count($phpErrors)}
		{if ($prefs.error_reporting_adminonly eq 'y' and $tiki_p_admin eq 'y') or $prefs.error_reporting_adminonly eq 'n'}
		{button _ajax="n" _id="show-errors-button" _onclick="flip('errors');return false;" _text="{tr}Show php error messages{/tr}"}
		<div id="errors" class="alert alert-warning" style="display:{if (isset($smarty.session.tiki_cookie_jar.show_errors) and $smarty.session.tiki_cookie_jar.show_errors eq 'y') or $prefs.javascript_enabled ne 'y'}block{else}none{/if};">
			&nbsp;{listfilter selectors='#errors>div'}
			{foreach item=err from=$phpErrors}
				{$err}
			{/foreach}
		</div>
		{/if}
	{/if}

	{if $tiki_p_admin eq 'y' and $prefs.feature_debug_console eq 'y'}
		{* Include debugging console.*}
		{debugger}
	{/if}

{/if}
{*needs to be in the footer.tpl so that it runs at the end rather than in antibot.tpl where it breaks tracker validation*}
{jq}
if ($("#antibotcode").parents('form').data("validator")) {
    $( "#antibotcode" ).rules( "add", {
        required: true,
        remote: {
            url: "validate-ajax.php",
            type: "post",
            data: {
                validator: "captcha",
                parameter: function() {
                    return $jq("#captchaId").val();
                },
                input: function() {
                    return $jq("#antibotcode").val();
                }
            }
        }
    });
} else {
    var form = $("#antibotcode").parents('form');
    $("form[name="+ form.attr('name') +"]").validate({
        rules: {
            "captcha[input]": {
                required: true,
                remote: {
                    url: "validate-ajax.php",
                    type: "post",
                    data: {
                        validator: "captcha",
                        parameter: function() {
                            return $jq("#captchaId").val();
                        },
                        input: function() {
                            return $jq("#antibotcode").val();
                        }
                    }
                }
            }
        },
        messages: {
            "captcha[input]": { required: "This field is required"}
        },
        submitHandler: function(){form.submit();}
    });
}
{'fraction_non_alphanumeric': 0.16353837576658614, 'fraction_numerical': 0.00037167812674224123, 'mean_word_length': 1.9669239250275634, 'pattern_counts': {'":': 4, '<': 19, '<?xml version=': 0, '>': 23, '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': '1030883', 'n_tokens_mistral': 1702, 'n_tokens_neox': 1580, 'n_words': 374}