Added shortcut key tooltip to search toggle (#120)

This commit is contained in:
alistair3149 2020-06-09 00:55:31 -04:00 committed by GitHub
parent d3b41789d4
commit ffb0916c6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -252,8 +252,13 @@ class CitizenTemplate extends BaseTemplate {
*/
private function buildSearchbox() : array {
$config = $this->config;
$toggleMsg = $this->getMsg( 'citizen-search-toggle' )->text();
$accessKey = Linker::accesskey( 'search' );
$props = [
'msg-citizen-search-toggle' => $this->getMsg( 'citizen-search-toggle' )->text(),
'msg-citizen-search-toggle' => $toggleMsg,
'msg-citizen-search-toggle-shortcut' => $toggleMsg . ' [alt-shift-' . $accessKey . ']',
'form-action' => $config->get( 'Script' ),
'html-input' => $this->makeSearchInput( [ 'id' => 'searchInput' ] ),
'msg-search' => $this->getMsg( 'search' )->text(),

View file

@ -1,4 +1,5 @@
{{!
string msg-citizen-search-toggle-shortcut message with shortcut key for search toggle
string msg-citizen-search-toggle tooltip message for search toggle
string form-action action attribute of the search form
string page-title page title of the search page
@ -12,7 +13,7 @@
id="search-toggle"
class="mw-checkbox-hack"
role="button"
title="{{msg-citizen-search-toggle}}"
title="{{msg-citizen-search-toggle-shortcut}}"
aria-labelledby="search-toggle-label"
aria-controls="searchform">
<label