MediaWiki:Common.js: Difference between revisions

From The Reed and Rite
mNo edit summary
Tag: Reverted
mNo edit summary
Tag: Reverted
Line 10: Line 10:
$(document).ready(function() {
$(document).ready(function() {
     $('#ooui-php-2').on('change', function() {
     $('#ooui-php-2').on('change', function() {
         var selectedBook = $(this).val();
         console.log("Dropdown changed. Value: " + $(this).val());
        var bookDates = {
            'Book 1': '2024-12-15',
            'Book 2': '2025-01-15',
            'Book 3': '2025-02-15'
        };
        if (bookDates[selectedBook]) {
            $('#mw-input-date').val(bookDates[selectedBook]);
        }
     });
     });
});
});

Revision as of 20:39, 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. Value: " + $(this).val());
    });
});