Skip to content

Commit e262dda

Browse files
committed
Improve code, DEV-1111
Signed-off-by: Iman Aboheydary <[email protected]>
1 parent 918d103 commit e262dda

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Model/ExternalVideoReplacer.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ public function replaceIframeSources(string $content): string
2727
if (preg_match('/data-cookieconsent=["\'][^"\']*["\']/', $beforeSrc . $afterSrc)) {
2828
// If data-cookieconsent already exists, just change src to data-cookieblock-src
2929
return '<iframe' . $beforeSrc . ' data-cookieblock-src="' . $iframeUrl . '"' . $afterSrc . '>';
30-
} else {
31-
// Add data-cookieconsent="marketing" and change src to data-cookieblock-src
32-
return '<iframe' . $beforeSrc . ' data-cookieblock-src="' . $iframeUrl
33-
. '" data-cookieconsent="marketing"' . $afterSrc . '>';
3430
}
31+
32+
return '<iframe' . $beforeSrc . ' data-cookieblock-src="' . $iframeUrl
33+
. '" data-cookieconsent="marketing"' . $afterSrc . '>';
3534
}, $content);
3635
}
3736

view/frontend/web/js/fotorama-video-events-mixin.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ define([
88

99
_clickHandler: function (e) {
1010
const blockVideoConsentConfig = window.cookiebotConfig && window.cookiebotConfig.blockVideosUntilConsent;
11-
console.log('blockVideoConsentConfig', blockVideoConsentConfig);
11+
1212
if (!Cookiebot?.consent?.marketing && blockVideoConsentConfig) {
1313
const videoElement = event.target.querySelector('.product-video');
1414
if (!Cookiebot?.consent?.marketing) {
@@ -42,11 +42,8 @@ define([
4242
document.createTextNode(' to view this content.')
4343
);
4444

45-
// Insert the placeholder before the video element
4645
divElement.style.fontSize = "1.4rem";
47-
console.log('paragraphElement', paragraphElement);
4846
divElement.append(paragraphElement);
49-
console.log('divElement', divElement);
5047
paragraphElement.style.zIndex = "1000";
5148
paragraphElement.style.position = "relative";
5249
videoElement.parentNode.insertBefore(divElement, videoElement);

0 commit comments

Comments
 (0)