Skip to content

Commit

Permalink
Deployed a3db2a0 to v8 with MkDocs 1.6.0 and mike 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
docs-bot committed Jan 7, 2025
1 parent 208db50 commit 09aee55
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 154 deletions.
67 changes: 15 additions & 52 deletions v8/newsletter/subscribe/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2737,58 +2737,21 @@ <h1 id="subscribe-to-our-newsletter">Subscribe to our newsletter<a class="header
We send out newsletters about once a month.
The newsletter includes information about new releases, upcoming events, community spotlights, and other news related to jsPsych.
You can unsubscribe at any time.</p>
<form method="post" name="subscribeform" id="subscribeform" enctype="multipart/form-data">
<input type="email" name="email" placeholder="Email address" id="email" size="40" class="md-input" required>
<input type="hidden" name="htmlemail" value="1">
<input type="hidden" name="list[2]" value="signup" />
<input type="hidden" name="subscribe" value="subscribe"/>
<button class='md-button md-button--primary' onclick="if (checkform()) {submitForm();} return false;" id="subscribe">Subscribe</button>
<div id="result"></div>
</form>

<script type="text/javascript">

function checkform() {
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
const emailInput = document.getElementById("email");
const resultDiv = document.getElementById("result");

if (!re.test(emailInput.value)) {
resultDiv.innerHTML = "Please enter a valid email address";
emailInput.focus();
return false;
}
return true;
}

async function submitForm() {
const emailInput = document.getElementById("email");
const successMessage = 'Thank you for your registration. Please check your email to confirm.';
const url = 'https://mail.jspsych.org/?p=asubscribe&id=6';
const resultDiv = document.getElementById("result");
const subscribeButton = document.querySelector('button#subscribe');

// Disable the subscribe button
subscribeButton.disabled = true;

try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded', // Adjust based on your content type
},
body: new URLSearchParams(new FormData(document.getElementById('subscribeform'))),
});

const data = await response.text();
resultDiv.innerHTML = successMessage;
} catch (error) {
resultDiv.innerHTML = 'An error occurred. Please try again later.';
} finally {
// Re-enable the subscribe button
subscribeButton.disabled = false;
}
}
<div style="text-align: left" class="sender-form-field" data-sender-form-id="m5li9yz5ejr0wrwxrw5"></div>

<script>
(function (s, e, n, d, er) {
s['Sender'] = er;
s[er] = s[er] || function () {
(s[er].q = s[er].q || []).push(arguments)
}, s[er].l = 1 * new Date();
var a = e.createElement(n),
m = e.getElementsByTagName(n)[0];
a.async = 1;
a.src = d;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://cdn.sender.net/accounts_resources/universal.js', 'sender');
sender('06a78af0a32181')
</script>


Expand Down
2 changes: 1 addition & 1 deletion v8/search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 09aee55

Please sign in to comment.