mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-27 11:29:50 +00:00
website: update livestream page (#7422)
Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
parent
10adabf5f7
commit
3923cb0f2a
@@ -19,6 +19,15 @@ function showLocalTime() {
|
||||
local.removeAttribute('hidden');
|
||||
}
|
||||
|
||||
function setSignupSource() {
|
||||
const field = document.querySelector('input[name="SOURCE"]');
|
||||
if (!field) return;
|
||||
|
||||
const inHash = new URLSearchParams(location.hash.replace(/^#\??/, '')).get('utm_source');
|
||||
const source = inHash ?? new URLSearchParams(location.search).get('utm_source');
|
||||
if (source && /^[\w.-]{1,40}$/.test(source)) field.value = source;
|
||||
}
|
||||
|
||||
function setupRegisterOverlay() {
|
||||
const overlay = document.getElementById('register');
|
||||
const openBtn = document.querySelector('.register-btn');
|
||||
@@ -67,5 +76,6 @@ function trackNavColor() {
|
||||
}
|
||||
|
||||
showLocalTime();
|
||||
setSignupSource();
|
||||
setupRegisterOverlay();
|
||||
trackNavColor();
|
||||
|
||||
@@ -96,6 +96,7 @@ templateEngineOverride: njk
|
||||
|
||||
<form action="https://chat.us2.list-manage.com/subscribe/post?u=ddd892b258ae36e5438e6d4e1&id=6f73f92ffa&f_id=006bf8e3f0" method="post" target="_blank">
|
||||
<input type="email" name="EMAIL" placeholder="Enter your email address" aria-label="Email address" required>
|
||||
<input type="hidden" name="SOURCE" value="livestream_page">
|
||||
<span aria-hidden="true" class="bot-field">
|
||||
<input type="text" name="b_ddd892b258ae36e5438e6d4e1_6f73f92ffa" tabindex="-1" value="">
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user