Jump to content

📢 Please make sure to read our Style Guide before editing. For questions, suggestions, or technical issues, please contact Noah. ✖

MediaWiki:Common.js: Difference between revisions

From CrabCraft Wiki
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 (mw.config.get("wgNamespaceNumber") >= 0) {
   if (localStorage.getItem('hideSitenotice') !== 'true') {
     $('<div>')
     $('#custom-sitenotice').show();
      .addClass('crab-announcement')
      .html('📢 <b>CrabCraft Season 5 is live!</b> Don’t forget to update your pages!')
      .prependTo('#content');
   }
   }
  $('#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');
  });
});