Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
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 () {
document.addEventListener('DOMContentLoaded', function () {
     $( '#open-search-button' ).on( 'click', function () {
     const btn = document.querySelector('.citizen-search-toggle');
        if ( window.citizen && citizen.ui && citizen.ui.search ) {
 
            citizen.ui.search.open();
    // If the search button exists, create a hotkey to open it
         }
    if (btn) {
     } );
        document.addEventListener('keydown', function (e) {
} );
            // Change this to any combo you want
            if (e.altKey && e.shiftKey && e.key.toLowerCase() === 'f') {
                e.preventDefault();
                btn.click(); // Opens the Citizen search overlay
            }
         });
     }
});

Revision as of 03:00, 8 November 2025

/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', function () {
    const btn = document.querySelector('.citizen-search-toggle');

    // If the search button exists, create a hotkey to open it
    if (btn) {
        document.addEventListener('keydown', function (e) {
            // Change this to any combo you want
            if (e.altKey && e.shiftKey && e.key.toLowerCase() === 'f') {
                e.preventDefault();
                btn.click(); // Opens the Citizen search overlay
            }
        });
    }
});