Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of spaceless twig filter #77

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions Resources/views/Form/karser_recaptcha3_widget.html.twig
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{% block karser_recaptcha3_widget %}
{% apply spaceless %}
{%- set type = type|default('hidden') -%}
{{ block('form_widget_simple') }}
{%- set type = type|default('hidden') -%}
{{ block('form_widget_simple') }}

{% if form.vars.enabled -%}
{% set validJsId = id | replace({'-':'_'}) %}
<script type="text/javascript" {% if form.vars.script_nonce_csp is defined %}nonce="{{ form.vars.script_nonce_csp }}"{% endif %}>
var recaptchaCallback_{{ validJsId }} = function() {
grecaptcha.execute('{{ form.vars.site_key }}', {action: '{{ form.vars.action_name }}'}).then(function(token) {
document.getElementById('{{ id }}').value = token;
});
setTimeout(recaptchaCallback_{{ validJsId }}, 100000);
};
</script>
<script type="text/javascript" src="https://{{ form.vars.host }}/recaptcha/api.js?render={{ form.vars.site_key }}&hl={{ form.vars.locale }}&onload=recaptchaCallback_{{ validJsId }}" async defer{% if form.vars.script_nonce_csp is defined %} nonce="{{ form.vars.script_nonce_csp }}"{% endif %}></script>
{%- endif %}
{% endapply %}
{% if form.vars.enabled -%}
{% set validJsId = id | replace({'-':'_'}) %}
<script type="text/javascript" {% if form.vars.script_nonce_csp is defined %}nonce="{{ form.vars.script_nonce_csp }}"{% endif %}>
var recaptchaCallback_{{ validJsId }} = function() {
grecaptcha.execute('{{ form.vars.site_key }}', {action: '{{ form.vars.action_name }}'}).then(function(token) {
document.getElementById('{{ id }}').value = token;
});
setTimeout(recaptchaCallback_{{ validJsId }}, 100000);
};
</script>
<script type="text/javascript" src="https://{{ form.vars.host }}/recaptcha/api.js?render={{ form.vars.site_key }}&hl={{ form.vars.locale }}&onload=recaptchaCallback_{{ validJsId }}" async defer{% if form.vars.script_nonce_csp is defined %} nonce="{{ form.vars.script_nonce_csp }}"{% endif %}></script>
{%- endif %}
{% endblock %}
Loading