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:
mw.loader.using( [ 'mediawiki.util' ] ).done( function() {
mw.loader.using( [ 'mediawiki.util' ] ).done( function() {
     if ( mw.config.get( 'wgPageName' ) === 'Main_Page' ) {
     if ( mw.config.get( 'wgPageName' ) === 'Main_Page' ) {
         document.getElementById( 'skin-citizen-search-trigger' ).addEventListener( 'click', function() {
         $(document).ready(function() {
            var event = new Event( 'input', { bubbles: true, composed: true } ),
            var searchButton = document.getElementById( 'skin-citizen-search-trigger' );
                checkbox = document.getElementById( 'citizen-search__checkbox' );
            if (searchButton) {
            checkbox.checked = true;
                searchButton.addEventListener( 'click', function() {
            checkbox.dispatchEvent( event );
                    var searchDetails = document.getElementById( 'citizen-search-details' );
         } );
                    if (searchDetails) {
                        searchDetails.open = true;
                        // Focus on the search input
                        setTimeout(function() {
                            var searchInput = document.getElementById( 'searchInput' );
                            if (searchInput) {
                                searchInput.focus();
                            }
                        }, 100);
                    }
                });
            }
         });
     }
     }
} );
});

Revision as of 04:48, 2 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() {
                    var searchDetails = document.getElementById( 'citizen-search-details' );
                    if (searchDetails) {
                        searchDetails.open = true;
                        // Focus on the search input
                        setTimeout(function() {
                            var searchInput = document.getElementById( 'searchInput' );
                            if (searchInput) {
                                searchInput.focus();
                            }
                        }, 100);
                    }
                });
            }
        });
    }
});