MediaWiki:Common.js: Difference between revisions

mNo edit summary
Tag: Manual revert
mNo edit summary
Line 24: Line 24:
       localStorage.setItem(localStorageKey + index, currentIndex.toString());
       localStorage.setItem(localStorageKey + index, currentIndex.toString());
     });
     });
  });
});
mw.loader.using('mediawiki.user', function () {
  if (mw.user.isAnon()) return; // Do nothing for anonymous users
  // User is logged in — enable dismiss behavior
  $('.maybe-dismissible').addClass('dismissible-notice');
  $('.dismissible-notice .dismiss-button').click(function () {
    $(this).closest('.dismissible-notice').hide();
    // Optional: store dismissal in localStorage or user options if needed
   });
   });
});
});