MediaWiki:Common.js: Difference between revisions

From The Reed and Rite
mNo edit summary
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 9: Line 9:


$(document).ready(function() {
$(document).ready(function() {
     $('#ooui-php-2').on('change', function() { // Dropdown ID is ooui-php-2
     $('#ooui-php-2').on('change', function() {
         var selectedBook = $(this).val();
         console.log("Dropdown changed!");
         var bookDates = {
         console.log("Selected value: " + $(this).val());
            'Book 1': '2024-12-15',
            'Book 2': '2025-01-15',
            'Book 3': '2025-02-15'
        };
        if (bookDates[selectedBook]) {
            $('#mw-input-date').val(bookDates[selectedBook]); // Date input ID is mw-input-date
        }
     });
     });
});
});

Revision as of 20:34, 23 March 2025

/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.load( 'ext.cite.styles' );

$(document).ready(function() {
  $('.dismissible-notice .dismiss-button').click(function() {
    $(this).closest('.dismissible-notice').hide();
  });
});

$(document).ready(function() {
    $('#ooui-php-2').on('change', function() {
        console.log("Dropdown changed!");
        console.log("Selected value: " + $(this).val());
    });
});