Skip to content

Commit

Permalink
Merge pull request #249 from Sonny812/fix-html-validation
Browse files Browse the repository at this point in the history
Fix html validation errors and warnings
  • Loading branch information
excelwebzone committed Aug 21, 2020
2 parents 00eec1c + 1a7f71c commit 730702d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/Resources/views/Form/ewz_recaptcha_widget.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php if ($attr['options']['size'] == 'invisible' && !isset($attr['options']['callback'])): ?>
<?php $attr['options']['callback'] = 'onReCaptchaSuccess' ?>

<script type="text/javascript">
<script>
var onReCaptchaSuccess = function() {
var errorDivs = document.getElementsByClassName('recaptcha-error');
if (errorDivs.length) {
Expand All @@ -28,7 +28,7 @@
</script>
<?php endif ?>

<script type="text/javascript" src="<?php echo $url_challenge ?>"
<script src="<?php echo $url_challenge ?>"
<?php if (isset($attr['options']['defer']) && $attr['options']['defer']): ?> defer<?php endif ?>
<?php if (isset($attr['options']['async']) && $attr['options']['async']): ?> async<?php endif ?>
></script>
Expand All @@ -43,8 +43,7 @@
<div style="width: 302px; height: 352px; position: relative;">
<div style="width: 302px; height: 352px; position: absolute;">
<iframe src="https://<?php echo $ewz_recaptcha_apihost ?>/recaptcha/api/fallback?k=<?php echo $public_key ?>"
frameborder="0" scrolling="no"
style="width: 302px; height:352px; border-style: none;"
style="width: 302px; height:352px; border-style: none; overflow: hidden;"
>
</iframe>
</div>
Expand All @@ -61,7 +60,7 @@ class="g-recaptcha-response"
<?php else: ?>
<div id="ewz_recaptcha_div"></div>

<script type="text/javascript">
<script>
(function() {
var script = document.createElement('script');
script.type = 'text/javascript';
Expand Down
9 changes: 4 additions & 5 deletions src/Resources/views/Form/ewz_recaptcha_widget.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% set options = attr.options|merge({'callback': 'onReCaptchaSuccess'}) %}
{% set attr = attr|merge({'options': options}) %}

<script type="text/javascript">
<script>
var onReCaptchaSuccess = function() {
var errorDivs = document.getElementsByClassName('recaptcha-error');
if (errorDivs.length) {
Expand All @@ -31,7 +31,7 @@
</script>
{% endif %}

<script type="text/javascript" src="{{ form.vars.url_challenge }}"
<script src="{{ form.vars.url_challenge }}"
{%- if attr.options.defer is defined and attr.options.defer %} defer{% endif -%}
{%- if attr.options.async is defined and attr.options.async %} async{% endif -%}
></script>
Expand All @@ -47,8 +47,7 @@
<div style="width: 302px; height: 352px; position: relative;">
<div style="width: 302px; height: 352px; position: absolute;">
<iframe src="https://{{ form.vars.ewz_recaptcha_apihost }}/recaptcha/api/fallback?k={{ form.vars.public_key }}"
frameborder="0" scrolling="no"
style="width: 302px; height:352px; border-style: none;"
style="width: 302px; height:352px; border-style: none; overflow: hidden;"
>
</iframe>
</div>
Expand All @@ -65,7 +64,7 @@
{% else %}
<div id="ewz_recaptcha_div"></div>

<script type="text/javascript">
<script>
(function() {
var script = document.createElement('script');
script.type = 'text/javascript';
Expand Down

0 comments on commit 730702d

Please sign in to comment.