Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/static/js/frontend/integration/turnstile.js
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
export const mount = () => {
2
+
if (!window.turnstile) {
3
+
return
4
+
}
5
+
6
+
if (window.WPDEF) {
7
+
const widgets = document.querySelectorAll('div[id^="wpdef_turnstile_"]')
8
+
if (widgets.length) {
9
+
widgets.forEach((widget) => {
10
+
turnstile.render(`#${widget.id}`, {
11
+
sitekey: WPDEF.options.sitekey,
12
+
theme: WPDEF.options.theme,
13
+
size: WPDEF.options.size,
14
+
language: WPDEF.options.lang,
15
+
'response-field-name': 'wpdef-turnstile-response'
16
+
})
17
+
})
18
+
19
+
return
20
+
}
21
+
}
22
+
23
+
const forms = document.querySelectorAll('.ct-popup .cf-turnstile')
24
+
25
+
if (!forms.length) {
26
+
return
27
+
}
28
+
29
+
forms.forEach((form) => {
30
+
turnstile.remove(form)
31
+
turnstile.render(form)
32
+
turnstile.reset(form)
33
+
})
34
+
}
35
+