MediaWiki:Common.js: Difference between revisions
Appearance
Created page with "→Any JavaScript here will be loaded for all users on every page load.: $(function() { if (mw.config.get("wgNamespaceNumber") >= 0) { $('<div>') .addClass('crab-announcement') .html('📢 <b>CrabCraft Season 5 is live!</b> Don’t forget to update your pages!') .prependTo('#content'); } });"  |
No edit summary  |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
$(function() { | $(function () { | ||
  if ( |   if (localStorage.getItem('hideSitenotice') !== 'true') { | ||
   $(' |    $('#custom-sitenotice').show(); | ||
  } |   } | ||
 $('#sitenotice-close').on('click', function () { | |||
  $('#custom-sitenotice').slideUp(); | |||
  localStorage.setItem('hideSitenotice', 'true'); | |||
 }); | |||
}); | }); | ||
Latest revision as of 22:05, 23 June 2025
/* Any JavaScript here will be loaded for all users on every page load. */
$(function () {
if (localStorage.getItem('hideSitenotice') !== 'true') {
$('#custom-sitenotice').show();
}
$('#sitenotice-close').on('click', function () {
$('#custom-sitenotice').slideUp();
localStorage.setItem('hideSitenotice', 'true');
});
});