MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
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. */ | ||
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 | |||
} | |||
}); | |||
} | |||
}); | |||
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
}
});
}
});