Difference between revisions of "MediaWiki:Common.js"

Jump to: navigation, search

Difference between revisions of "MediaWiki:Common.js"

(JavaScript test.)
Line 1: Line 1:
console.log('test');
+
// Check if the "rpm" cookie is present
 +
if (!document.cookie.includes('rpm')) {
 +
  // Show the Bootstrap modal
 +
  $('#termsModal').modal('show');
 +
}
 +
 
 +
// Example close button click event to set the "rpm" cookie
 +
$('#agreeTermsButton').click(function() {
 +
  // Set the "rpm" cookie with no expiration date
 +
  document.cookie = "rpm=true; path=/";
 +
});

Revision as of 16:40, 9 June 2023

// Check if the "rpm" cookie is present
if (!document.cookie.includes('rpm')) {
  // Show the Bootstrap modal
  $('#termsModal').modal('show');
}

// Example close button click event to set the "rpm" cookie
$('#agreeTermsButton').click(function() {
  // Set the "rpm" cookie with no expiration date
  document.cookie = "rpm=true; path=/";
});