MediaWiki:Common.js

From Weeb's Cafe
Revision as of 19:16, 19 June 2026 by Kirin (talk | contribs)
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */
$.when( mw.loader.using( 'mediawiki.util' ), $.ready ).then( function () {
    var targetDate = new Date(2026, 2, 22); 
    var today = new Date();
    var timeDifference = today.getTime() - targetDate.getTime();
    var daysSince = Math.floor(timeDifference / (1000 * 60 * 60 * 24));
    var $counterItem = $( '<li>' )
        .attr( 'id', 'mw-custom-sidebar-counter' )
        .text( "Days since Mikush's Disappearance: " + daysSince );

    // Replace '#p-navigation ul' with your corrected sidebar ID if different
    $( '#p-Tools ul' ).append( $counterItem );
} );