A free, self-hostable news aggregator…
Add a shortcut to open the share div. The default shortcut is "s".
Alexis Degrugillier7db271e95eba
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.phpindex d44420f56..c29e74603 100644--- a/app/Models/Configuration.php+++ b/app/Models/Configuration.php@@ -33,6 +33,7 @@ class FreshRSS_Configuration {'prev_entry' => 'k','collapse_entry' => 'c','load_more' => 'm',+ 'auto_share' => 's',),'topline_read' => true,'topline_favorite' => true,diff --git a/app/i18n/en.php b/app/i18n/en.phpindex 28aa1296a..06bbf48e6 100644--- a/app/i18n/en.php+++ b/app/i18n/en.php@@ -123,6 +123,7 @@ return array ('next_page' => 'Skip to the next page','previous_page' => 'Skip to the previous page','collapse_article' => 'Collapse current article',+ 'auto_share' => 'Share current article','file_to_import' => 'File to import','import' => 'Import',diff --git a/app/i18n/fr.php b/app/i18n/fr.phpindex 39aeaf29a..cb689610b 100644--- a/app/i18n/fr.php+++ b/app/i18n/fr.php@@ -123,6 +123,7 @@ return array ('next_page' => 'Passer à la page suivante','previous_page' => 'Passer à la page précédente','collapse_article' => 'Refermer l’article courant',+ 'auto_share' => 'Partager l’article courant','file_to_import' => 'Fichier à importer','import' => 'Importer',diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtmlindex 2e564a7b6..b0867f711 100644--- a/app/views/configure/shortcut.phtml+++ b/app/views/configure/shortcut.phtml@@ -68,6 +68,13 @@</div></div>+ <div class="form-group">+ <label class="group-name" for="auto_share_shortcut"><?php echo Minz_Translate::t ('auto_share'); ?></label>+ <div class="group-controls">+ <input type="text" id="auto_share_shortcut" name="shortcuts[auto_share]" list="keys" value="<?php echo $s['auto_share']; ?>" />+ </div>+ </div>+<div class="form-group form-actions"><div class="group-controls"><button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtmlindex 8419b9391..92c068f7e 100644--- a/app/views/helpers/javascript_vars.phtml+++ b/app/views/helpers/javascript_vars.phtml@@ -18,7 +18,8 @@'prev_entry:"', $s['prev_entry'], '",','next_entry:"', $s['next_entry'], '",','collapse_entry:"', $s['collapse_entry'], '",',- 'load_more:"', $s['load_more'], '"',+ 'load_more:"', $s['load_more'], '",',+ 'auto_share:"', $s['auto_share'], '"',"},\n";if (Minz_Request::param ('output') === 'global') {diff --git a/p/scripts/main.js b/p/scripts/main.jsindex ef05eb2fb..43b0384e8 100644--- a/p/scripts/main.js+++ b/p/scripts/main.js@@ -220,6 +220,13 @@ function collapse_entry() {$(".flux.current").toggleClass("active");}+function auto_share() {+ var share = $(".flux.current.active").find('.dropdown-target[id^="dropdown-share"]');+ if (share.length) {+ window.location.replace('/i/#' + share.attr('id'));+ }+}+function inMarkViewport(flux, box_to_follow, relative_follow) {var top = flux.position().top;if (relative_follow) {@@ -338,6 +345,11 @@ function init_shortcuts() {}, {'disable_in_input': true});+ shortcut.add(shortcuts.auto_share, function () {+ auto_share();+ }, {+ 'disable_in_input': true+ });// Touches de navigationshortcut.add(shortcuts.prev_entry, prev_entry, {