Skip to content

Commit

Permalink
Modify setTimeOut in order to avoid CSP errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ail3ngrimaldi committed Sep 25, 2024
1 parent fc68031 commit 54945bb
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 63 deletions.
40 changes: 20 additions & 20 deletions landings/a/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,26 @@ document.addEventListener('DOMContentLoaded', function() {
});
let telegram = document.getElementById("telegram");
telegram.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://t.me/+573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:a:click-telegram')
setTimeout(() => {
newWindow.location = redirectUrl.toString();
}, 200)
});
let whatsapp = document.getElementById("whatsapp");
whatsapp.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://api.whatsapp.com/send?phone=573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:a:click-whatsapp')
setTimeout(() => {
newWindow.location = redirectUrl.toString();
}, 200)
});
telegram.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://t.me/+573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:a:click-telegram');
setTimeout(function() {
newWindow.location = redirectUrl.toString();
}, 200);
});
let whatsapp = document.getElementById("whatsapp");
whatsapp.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://api.whatsapp.com/send?phone=573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:a:click-whatsapp');
setTimeout(function() {
newWindow.location = redirectUrl.toString();
}, 200);
});
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
Expand Down
43 changes: 21 additions & 22 deletions landings/b/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -140,28 +140,27 @@ document.addEventListener('DOMContentLoaded', function() {
ctas.forEach((cta) => {
cta.addEventListener('click', handleCtaClick);
});
let telegram = document.getElementById("telegram");
telegram.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://t.me/+573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:b:click-telegram')
setTimeout(() => {
newWindow.location = redirectUrl.toString();
}, 200)
});
let whatsapp = document.getElementById("whatsapp");
whatsapp.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://api.whatsapp.com/send?phone=573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:b:click-whatsapp')
setTimeout(() => {
newWindow.location = redirectUrl.toString();
}, 200)
});
let telegram = document.getElementById("telegram");
telegram.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://t.me/+573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:b:click-telegram');
setTimeout(function() {
newWindow.location = redirectUrl.toString();
}, 200);
});
let whatsapp = document.getElementById("whatsapp");
whatsapp.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://api.whatsapp.com/send?phone=573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:b:click-whatsapp');
setTimeout(function() {
newWindow.location = redirectUrl.toString();
}, 200);
});
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
Expand Down
41 changes: 20 additions & 21 deletions landings/c/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -148,27 +148,26 @@ document.addEventListener('DOMContentLoaded', function() {
cta.addEventListener('click', handleCtaClick);
});
let telegram = document.getElementById("telegram");
telegram.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://t.me/+573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:c:click-telegram')
setTimeout(() => {
newWindow.location = redirectUrl.toString();
}, 200)
});
let whatsapp = document.getElementById("whatsapp");
whatsapp.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://api.whatsapp.com/send?phone=573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:c:click-whatsapp')
setTimeout(() => {
newWindow.location = redirectUrl.toString();
}, 200)
});
telegram.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://t.me/+573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:c:click-telegram');
setTimeout(function() {
newWindow.location = redirectUrl.toString();
}, 200);
});
let whatsapp = document.getElementById("whatsapp");
whatsapp.addEventListener('click', (event) => {
event.preventDefault();
let redirectUrl = new URL('https://api.whatsapp.com/send?phone=573107887042');
const newWindow = window.open(redirectUrl, '_blank');
amplitude.track('landing:c:click-whatsapp');
setTimeout(function() {
newWindow.location = redirectUrl.toString();
}, 200);
});
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
Expand Down

0 comments on commit 54945bb

Please sign in to comment.