{* $Id$ *} {if empty($user) || $user eq 'anonymous' || !empty($showantibot)} {$labelclass = 'col-md-3'} {$inputclass = 'col-md-9'} {$captchaclass = 'col-md-4 offset-md-3 mb-3'} {if $form === 'register'} {$labelclass = 'col-sm-4'} {$inputclass = 'col-sm-8'} {$captchaclass = 'col-md-4 offset-md-4 mb-3'} {/if} {if $form === 'moduleSubscribeNL'} {$labelclass = 'col-md-12'} {$inputclass = 'col-md-12'} {$captchaclass = 'col-md-12 mb-3'} {/if}
{if $captchalib->type eq 'recaptcha' || $captchalib->type eq 'recaptcha20' || $captchalib->type eq 'recaptcha30'}
{$captchalib->render()}
{elseif $captchalib->type eq 'questions'}
{else} {* Default captcha *}
{if $captchalib->type eq 'default'} {tr}Anti-Bot verification code image{/tr} {else} {* dumb captcha *} {$captchalib->render()} {/if}
{if $captchalib->type eq 'default'}
{button _id='captchaRegenerate' _class='' href='#antibot' _text="{tr}Try another code{/tr}" _icon_name="refresh" _onclick="generateCaptcha();return false;"}
{/if}
{/if}
{jq rank=1} function antibotVerification(element, rule) { if (!jqueryTiki.validate) return; var form = $(".antibot").parents('form'); if (!form.data("validator")) { form.validate({}); } element.rules( "add", rule); } {/jq} {if $captchalib->type eq 'recaptcha'} {jq rank=1} var existCondition = setInterval(function() { if ($('#recaptcha_response_field').length) { clearInterval(existCondition); antibotVerification($("#recaptcha_response_field"), {required: true}); } }, 100); // wait for captcha to load {/jq} {elseif $captchalib->type eq 'recaptcha20' || $captchalib->type eq 'recaptcha30'} {jq rank=1} var existCondition = setInterval(function() { if ($('#g-recaptcha-response').length) { clearInterval(existCondition); antibotVerification($("#g-recaptcha-response"), {required: true}); } }, 100); // wait for captcha to load {/jq} {if $captchalib->type eq 'recaptcha30' && $form eq ''} {literal} {/literal} {/if} {else} {jq rank=1} antibotVerification($("#antibotcode"), { required: true }); {/jq} {/if} {/if}