Add a shortcut to open the share div. The default shortcut is "s".

This commit is contained in:
Alexis Degrugillier committed 2014-01-03 00:01:29 -05:00
1 parent b4c477ca41
commit 7db271e95e
6 files changed
+24 -1

No files matched your search

+1
View File
@@ -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,
+1
View File
@@ -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',
+1
View File
@@ -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',
+7
View File
@@ -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>
+2 -1
View File
@@ -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') {
+12
View File
@@ -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 navigation
shortcut.add(shortcuts.prev_entry, prev_entry, {