From f0b1a9358a2e7a79673463d34658ccf5363c86b7 Mon Sep 17 00:00:00 2001 From: IJ Date: Tue, 27 Nov 2018 00:14:28 +0000 Subject: [PATCH 1/9] Add Access Keys in Help Link --- htdocs/main.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 06f67a9b79f..99b82156e42 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1576,6 +1576,11 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if ($mode == 'wiki') $text.=sprintf($helpbaseurl,urlencode(html_entity_decode($helppage))); else $text.=sprintf($helpbaseurl,$helppage); $text.='">'; + $title.='

'; + $title.=''.$langs->trans("KeyboardShortcutsNavigation").'
'; + $title.='Firefox (Windows/Linux): ALT + SHIFT + Access Key
'; + $title.='Chrome (Windows/Linux): ALT + Access Key
'; + $title.='MAC (all browsers): CTRL + Access Key
'; //$text.=img_picto('', 'helpdoc_top').' '; $text.=''; //$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); From 825f41bfda3f4bd9ab25a6b75353e2feb8c46813 Mon Sep 17 00:00:00 2001 From: IJ Date: Tue, 27 Nov 2018 00:22:21 +0000 Subject: [PATCH 2/9] Add Access Keys in Navigation Tooltips --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4d91e8a358a..082e0be1a34 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6683,8 +6683,8 @@ class Form // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers - $previous_ref = $object->ref_previous?'':''; - $next_ref = $object->ref_next?'':''; + $previous_ref = $object->ref_previous?'':''; + $next_ref = $object->ref_next?'':''; } //print "xx".$previous_ref."x".$next_ref; From 0bdbff641914510f385ad0792ffc5b4decd86f0f Mon Sep 17 00:00:00 2001 From: IJ Date: Tue, 27 Nov 2018 00:24:11 +0000 Subject: [PATCH 3/9] Add Access Key Language Strings --- htdocs/langs/en_US/main.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index bd535ae150e..cb0c607e156 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -947,7 +947,8 @@ Annual=Annual Local=Local Remote=Remote LocalAndRemote=Local and Remote -KeyboardShortcut=Keyboard shortcut +AccessKey=Access Key +KeyboardShortcutsNavigation=Keyboard Shortcuts for Navigation: AssignedTo=Assigned to Deletedraft=Delete draft ConfirmMassDraftDeletion=Draft mass delete confirmation From be523a737e0a95ae00ccba86d480a77332ffe0d8 Mon Sep 17 00:00:00 2001 From: IJ Date: Sun, 2 Dec 2018 10:19:37 +0000 Subject: [PATCH 4/9] Undo Access Key Strings from previous commit --- htdocs/langs/en_US/main.lang | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cb0c607e156..a9bba0d4043 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -947,8 +947,6 @@ Annual=Annual Local=Local Remote=Remote LocalAndRemote=Local and Remote -AccessKey=Access Key -KeyboardShortcutsNavigation=Keyboard Shortcuts for Navigation: AssignedTo=Assigned to Deletedraft=Delete draft ConfirmMassDraftDeletion=Draft mass delete confirmation From 34326f9102ec5cba58e517ba8f6d1c8b4f0e7ac7 Mon Sep 17 00:00:00 2001 From: IJ Date: Sun, 2 Dec 2018 10:22:47 +0000 Subject: [PATCH 5/9] Undo Add Access Keys in Help Link ... from previous commit Not relevant anymore as the new code will detect browser and show the relevant string --- htdocs/main.inc.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 99b82156e42..06f67a9b79f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1576,11 +1576,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a if ($mode == 'wiki') $text.=sprintf($helpbaseurl,urlencode(html_entity_decode($helppage))); else $text.=sprintf($helpbaseurl,$helppage); $text.='">'; - $title.='

'; - $title.=''.$langs->trans("KeyboardShortcutsNavigation").'
'; - $title.='Firefox (Windows/Linux): ALT + SHIFT + Access Key
'; - $title.='Chrome (Windows/Linux): ALT + Access Key
'; - $title.='MAC (all browsers): CTRL + Access Key
'; //$text.=img_picto('', 'helpdoc_top').' '; $text.=''; //$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); From 30e84f8f2c880025eb7c981fa8fe96050d1ed583 Mon Sep 17 00:00:00 2001 From: IJ Date: Sun, 2 Dec 2018 10:29:04 +0000 Subject: [PATCH 6/9] Amend Add Access Keys in Navigation Tooltips - based on suggested code by @eldy - Added `classfortooltip` for better display --- htdocs/core/class/html.form.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 082e0be1a34..cc91e2072c4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6683,8 +6683,18 @@ class Form // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers - $previous_ref = $object->ref_previous?'':''; - $next_ref = $object->ref_next?'':''; + $stringforfirstkey = 'CTL +'; + if ($conf->browser->name == 'chrome') + { + $stringforfirstkey = 'ALT +'; + } + if ($conf->browser->name == 'firefox') + { + $stringforfirstkey = 'ALT + SHIFT +'; + } + + $previous_ref = $object->ref_previous?'':''; + $next_ref = $object->ref_next?'':''; } //print "xx".$previous_ref."x".$next_ref; From 292dd5290a3ab9b0618c59ea70861bb3a8a66646 Mon Sep 17 00:00:00 2001 From: aljawaid Date: Fri, 7 Dec 2018 12:39:20 +0000 Subject: [PATCH 7/9] Amend Add Access Keys in Navigation Tooltips - Fix travis --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cc91e2072c4..b40120a2ca0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6684,11 +6684,11 @@ class Form // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers $stringforfirstkey = 'CTL +'; - if ($conf->browser->name == 'chrome') + if ($conf->browser->name == 'chrome') { $stringforfirstkey = 'ALT +'; } - if ($conf->browser->name == 'firefox') + if ($conf->browser->name == 'firefox') { $stringforfirstkey = 'ALT + SHIFT +'; } From c85348c234d2d0852a686cb64ea44adfffd82d3e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Dec 2018 19:26:47 +0100 Subject: [PATCH 8/9] Update main.lang --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index a9bba0d4043..bd535ae150e 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -947,6 +947,7 @@ Annual=Annual Local=Local Remote=Remote LocalAndRemote=Local and Remote +KeyboardShortcut=Keyboard shortcut AssignedTo=Assigned to Deletedraft=Delete draft ConfirmMassDraftDeletion=Draft mass delete confirmation From d5bbb3033c5e6656a35bca04dd46eb327fb2593d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Dec 2018 19:29:15 +0100 Subject: [PATCH 9/9] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b40120a2ca0..c0399db7c6d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6683,14 +6683,18 @@ class Form // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers - $stringforfirstkey = 'CTL +'; + $stringforfirstkey = $langs->trans("KeyboardShortcut"); if ($conf->browser->name == 'chrome') { - $stringforfirstkey = 'ALT +'; + $stringforfirstkey .= ' ALT +'; } if ($conf->browser->name == 'firefox') { - $stringforfirstkey = 'ALT + SHIFT +'; + $stringforfirstkey .= ' ALT + SHIFT +'; + } + else + { + $stringforfirstkey .= ' CTL +'; } $previous_ref = $object->ref_previous?'':'';