diff options
| author | 2014-10-04 15:39:07 +0200 | |
|---|---|---|
| committer | 2014-10-04 15:39:07 +0200 | |
| commit | 099f5ab760602e9b08b804cecd1eb41442cd1b62 (patch) | |
| tree | aa1b7a53827407f2c079c83dcabc9243b6ba1041 | |
| parent | 0a60a1a71e32fa29518705a4f194c8025d8164bf (diff) | |
| parent | 38a6f0c4b29e5a53c21f345dd839a4fa0b2a6f47 (diff) | |
Merge pull request #654 from aledeg/new-shortcut
Add a shortcut to close drop-down lists
| -rw-r--r-- | app/Models/Configuration.php | 1 | ||||
| -rw-r--r-- | app/i18n/en.php | 1 | ||||
| -rw-r--r-- | app/i18n/fr.php | 1 | ||||
| -rw-r--r-- | app/views/configure/shortcut.phtml | 7 | ||||
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 3 | ||||
| -rw-r--r-- | p/scripts/main.js | 6 |
6 files changed, 18 insertions, 1 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 95f819779..feba3d2f6 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -47,6 +47,7 @@ class FreshRSS_Configuration { 'focus_search' => 'a', 'user_filter' => 'u', 'help' => 'f1', + 'close_dropdown' => 'escape', ), 'topline_read' => true, 'topline_favorite' => true, diff --git a/app/i18n/en.php b/app/i18n/en.php index 28104196e..0456049a9 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -191,6 +191,7 @@ return array ( 'user_filter' => 'Access user filters', 'user_filter_help' => 'If there is only one user filter, it is used. Else filters are accessible by their number.', 'help' => 'Display documentation', + 'close_dropdown' => 'Close drop-down lists', 'file_to_import' => 'File to import<br />(OPML, Json or Zip)', 'file_to_import_no_zip' => 'File to import<br />(OPML or Json)', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index c72fc3e93..adc79d0e2 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -191,6 +191,7 @@ return array ( 'user_filter' => 'Accéder aux filtres utilisateur', 'user_filter_help' => 'S’il n’y a qu’un filtre utilisateur, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', 'help' => 'Afficher la documentation', + 'close_dropdown' => 'Fermer les listes déroulantes', 'file_to_import' => 'Fichier à importer<br />(OPML, Json ou Zip)', 'file_to_import_no_zip' => 'Fichier à importer<br />(OPML ou Json)', diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index a4029b676..44727e62b 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -112,6 +112,13 @@ </div> <div class="form-group"> + <label class="group-name" for="close_dropdown_shortcut"><?php echo Minz_Translate::t ('close_dropdown'); ?></label> + <div class="group-controls"> + <input type="text" id="help_shortcut" name="shortcuts[close_dropdown]" list="keys" value="<?php echo $s['close_dropdown']; ?>" /> + </div> + </div> + + <div class="form-group"> <label class="group-name" for="help_shortcut"><?php echo Minz_Translate::t ('help'); ?></label> <div class="group-controls"> <input type="text" id="help_shortcut" name="shortcuts[help]" list="keys" value="<?php echo $s['help']; ?>" /> diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 71798369d..4f7e3db0c 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -28,7 +28,8 @@ echo ',shortcuts={', 'auto_share:"', $s['auto_share'], '",', 'focus_search:"', $s['focus_search'], '",', 'user_filter:"', $s['user_filter'], '",', - 'help:"', $s['help'], '"', + 'help:"', $s['help'], '",', + 'close_dropdown:"', $s['close_dropdown'], '"', "},\n"; if (Minz_Request::param ('output') === 'global') { diff --git a/p/scripts/main.js b/p/scripts/main.js index 02d16ca64..79a34ec29 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -661,6 +661,12 @@ function init_shortcuts() { 'disable_in_input': true }); + shortcut.add(shortcuts.close_dropdown, function () { + window.location.hash = null; + }, { + 'disable_in_input': true + }); + } function init_stream(divStream) { |
