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

MediaWiki:Citizen.js: Difference between revisions

MediaWiki interface page
Make the search bar on Template:Home/nav activate search.
 
Simulate key press instead of using function because it doesn't work
 
Line 4: Line 4:
var searchInput = document.getElementById('home-search');
var searchInput = document.getElementById('home-search');
searchInput.onclick = function() {
searchInput.onclick = function() {
document.getElementById('citizen-search-details').click();
document.dispatchEvent(new KeyboardEvent('keydown', {'key': '/'}));
};
};

Latest revision as of 14:01, 4 May 2025

/* All JavaScript here will be loaded for users of the Citizen skin */

// Make the search bar on Template:Home/nav activate search.
var searchInput = document.getElementById('home-search');
searchInput.onclick = function() {
	document.dispatchEvent(new KeyboardEvent('keydown', {'key': '/'}));
};
Cookies help us deliver our services. By using our services, you agree to our use of cookies.