@@ -9,45 +9,6 @@ $viewModel = $block->getData('view_model');
99
1010// Only add scripts if video blocking is enabled
1111if ($ viewModel && $ viewModel ->isBlockVideosUntilConsentEnabled ()) {
12- $ addRequiredAttributesScript = '
13- document.addEventListener("DOMContentLoaded", function() {
14- const videoIframes = document.querySelectorAll(".pagebuilder-video-container iframe");
15-
16- videoIframes.forEach((iframe) => {
17- if (!Cookiebot?.consent?.marketing) {
18- iframe.setAttribute("data-cookieblock-src", iframe.src);
19- iframe.setAttribute("data-cookieconsent", "marketing");
20- iframe.removeAttribute("src");
21- iframe.closest("[data-content-type=\"video\"]").setAttribute("data-content-type", "image");
22- }
23- });
24- });
25-
26- addEventListener("CookiebotOnAccept", () => {
27- const videoIframes = document.querySelectorAll(".pagebuilder-video-container iframe");
28-
29- videoIframes.forEach((iframe) => {
30- if (Cookiebot?.consent?.marketing) {
31- if (iframe.closest("[data-content-type=\"image\"]")) {
32- iframe.closest("[data-content-type=\"image\"]").setAttribute("data-content-type", "video");
33- }
34- }
35- });
36- });
37-
38- addEventListener("CookiebotOnDecline", () => {
39- const videoIframes = document.querySelectorAll(".pagebuilder-video-container iframe");
40-
41- videoIframes.forEach((iframe) => {
42- if (!Cookiebot?.consent?.marketing) {
43- if (iframe.closest("[data-content-type=\"video\"]")) {
44- iframe.closest("[data-content-type=\"video\"]").setAttribute("data-content-type", "image");
45- }
46- }
47- });
48- });
49- ' ;
50-
5112 $ placeholderScript = '
5213 document.addEventListener("DOMContentLoaded", function() {
5314 ((document, selector, consentType) => {
0 commit comments