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
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
             if (searchButton) {
             if (searchButton) {
                 searchButton.addEventListener( 'click', function() {
                 searchButton.addEventListener( 'click', function() {
                     var searchDetails = document.getElementById( 'citizen-search-details' );
                    // Click the search summary button to trigger the dropdown
                     if (searchDetails) {
                     var searchSummary = document.getElementById( 'citizen-search-summary' );
                         searchDetails.open = true;
                     if (searchSummary) {
                        // Focus on the search input
                         searchSummary.click();
                        setTimeout(function() {
                            var searchInput = document.getElementById( 'searchInput' );
                            if (searchInput) {
                                searchInput.focus();
                            }
                        }, 100);
                     }
                     }
                 });
                 });
Line 20: Line 14:
         });
         });
     }
     }
});
$(document).ready(function() {
    $('.event-banner').on('click', function() {
        window.location.href = $(this).data('href');
    });
});
});

Latest revision as of 21:58, 9 January 2026

mw.loader.using( [ 'mediawiki.util' ] ).done( function() {
    if ( mw.config.get( 'wgPageName' ) === 'Main_Page' ) {
        $(document).ready(function() {
            var searchButton = document.getElementById( 'skin-citizen-search-trigger' );
            if (searchButton) {
                searchButton.addEventListener( 'click', function() {
                    // Click the search summary button to trigger the dropdown
                    var searchSummary = document.getElementById( 'citizen-search-summary' );
                    if (searchSummary) {
                        searchSummary.click();
                    }
                });
            }
        });
    }
});
$(document).ready(function() {
    $('.event-banner').on('click', function() {
        window.location.href = $(this).data('href');
    });
});