Difference between revisions of "MediaWiki:Common.js"
Difference between revisions of "MediaWiki:Common.js"
| Line 1: | Line 1: | ||
| − | // | + | // Terms Modal |
$(document).ready(function() { | $(document).ready(function() { | ||
| Line 13: | Line 13: | ||
$('#agreeTermsButton').click(function() { | $('#agreeTermsButton').click(function() { | ||
termsModal.modal('hide'); | termsModal.modal('hide'); | ||
| − | // Set the " | + | // Set the "rpmTermsAgreement" cookie with no expiration date |
document.cookie = "rpmTermsAgreement=true; path=/"; | document.cookie = "rpmTermsAgreement=true; path=/"; | ||
}); | }); | ||
}) | }) | ||
Revision as of 17:12, 9 June 2023
// Terms Modal
$(document).ready(function() {
const termsModal = $('#termsModal')
// Check if the "rpmTermsAgreement" cookie is present
if (!document.cookie.includes('rpmTermsAgreement')) {
// Show the Bootstrap modal
termsModal.modal('show');
}
// Example close button click event to set the "rpm" cookie
$('#agreeTermsButton').click(function() {
termsModal.modal('hide');
// Set the "rpmTermsAgreement" cookie with no expiration date
document.cookie = "rpmTermsAgreement=true; path=/";
});
})
