-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change templates to support CSP on WYSIWYG editors like TinyMCE
- Loading branch information
Showing
25 changed files
with
836 additions
and
3,575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1,434 changes: 749 additions & 685 deletions
1,434
contao/sql/contao51/minimal.sql → contao/sql/contao53/full.sql
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,48 @@ | ||
<?php $this->extend('form_row'); ?> | ||
|
||
<?php $this->block('label'); ?> | ||
<?php if ($this->label): ?> | ||
<label for="ctrl_<?= $this->id ?>"<?php if ($this->class): ?> class="<?= $this->class ?>"<?php endif; ?>> | ||
<span class="invisible"><?= $this->mandatoryField ?> </span><?= $this->label ?><span class="mandatory">*</span> | ||
</label> | ||
<?php endif; ?> | ||
<?php $this->endblock(); ?> | ||
|
||
<?php $this->block('field'); ?> | ||
<?php if ($this->hasErrors()): ?> | ||
<p class="error"><?= $this->getErrorAsString() ?></p> | ||
<?php endif; ?> | ||
|
||
<div class="control"> | ||
<?php if ($this->label): ?> | ||
<label for="ctrl_<?= $this->id ?>" class="label<?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>"> | ||
<span class="invisible"><?= $this->mandatoryField ?> </span><?= $this->label ?><span class="mandatory">*</span> | ||
</label> | ||
<?php endif; ?> | ||
|
||
<input type="text" name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="captcha mandatory input<?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>" value="" aria-describedby="captcha_text_<?= $this->id ?>"<?= $this->getAttributes() ?>> | ||
<span id="captcha_text_<?= $this->id ?>" class="captcha_text<?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>"><?= $this->getQuestion() ?></span> | ||
<input type="hidden" name="<?= $this->name ?>_hash" value="<?= $this->getHash() ?>"> | ||
</div> | ||
<?php if ($this->hasErrors()): ?> | ||
<p class="help is-danger"><?= $this->getErrorAsString() ?></p> | ||
<?php endif; ?> | ||
<?php if (!$this->hasErrors()): ?> | ||
<div style="display:none"> | ||
<label for="ctrl_<?= $this->id ?>_hp">Do not fill in this field</label> | ||
<input type="text" name="<?= $this->name ?>_name" id="ctrl_<?= $this->id ?>_hp" value=""> | ||
</div> | ||
<script> | ||
var e = document.getElementById('ctrl_<?= $this->id ?>'), | ||
p = e.parentNode, f = p.parentNode; | ||
|
||
if ('fieldset' === f.nodeName.toLowerCase() && 1 === f.children.length) { | ||
p = f; | ||
} | ||
|
||
p.style.display = 'none'; | ||
e.value = '<?= $this->getSum() ?>'; | ||
</script> | ||
<?php endif ?> | ||
<input type="text" name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="captcha mandatory<?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>" value="" aria-describedby="captcha_text_<?= $this->id ?>"<?= $this->getAttributes() ?>> | ||
<span id="captcha_text_<?= $this->id ?>" class="captcha_text<?php if ($this->class): ?> <?= $this->class ?><?php endif; ?>"><?= $this->getQuestion() ?></span> | ||
<input type="hidden" name="<?= $this->name ?>_hash" value="<?= $this->hasErrors() ? $this->getHash() : '' ?>"> | ||
|
||
<?php $this->endblock(); ?> | ||
<?php if (!$this->hasErrors()): ?> | ||
<div style="<?= $this->cspInlineStyle('display:none') ?>"> | ||
<label for="ctrl_<?= $this->id ?>_hp">Do not fill in this field</label> | ||
<input type="text" name="<?= $this->name ?>_name" id="ctrl_<?= $this->id ?>_hp" value=""> | ||
</div> | ||
<script<?= $this->attr()->setIfExists('nonce', $this->nonce('script-src')) ?>> | ||
(function() { | ||
var e = document.getElementById('ctrl_<?= $this->id ?>'), | ||
p = e.parentNode, f = p.parentNode; | ||
|
||
if (f.classList.contains('widget-captcha') || 'fieldset' === f.nodeName.toLowerCase() && 1 === f.children.length) { | ||
p = f; | ||
} | ||
|
||
e.required = false; | ||
p.style.display = 'none'; | ||
|
||
setTimeout(() => { | ||
fetch(<?= json_encode($this->getAjaxUrl()) ?>).then(r => r.json()).then(d => { | ||
e.value = d.sum; | ||
e.form.elements[<?= json_encode($this->name.'_hash') ?>].value = d.hash; | ||
document.getElementById('captcha_text_<?= $this->id ?>').textContent = d.question; | ||
}); | ||
}, 5000); | ||
})(); | ||
</script> | ||
<?php endif ?> | ||
|
||
<?php $this->endblock(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters