shortcut to open link in background (fix #179)

This commit is contained in:
Athou
2013-05-26 00:12:16 +02:00
parent cc1d9dc4d2
commit 84fc09311c
3 changed files with 17 additions and 0 deletions

View File

@@ -109,6 +109,7 @@ about.shortcuts.focus_next_entry=set focus on next entry without opening it
about.shortcuts.focus_previous_entry=set focus on previous entry without opening it
about.shortcuts.open_close_current_entry=open/close current entry
about.shortcuts.open_current_entry_in_new_window=open current entry in a new window
about.shortcuts.open_current_entry_in_new_window_background=open current entry in a new window in the background
about.shortcuts.star_unstar=star/unstar current entry
about.shortcuts.mark_current_entry=mark as read/unread current entry
about.shortcuts.mark_all_as_read=mark all entries as read

View File

@@ -759,6 +759,19 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
window.open($scope.current.url);
}
});
Mousetrap.bind('b', function(e) {
if ($scope.current) {
var url = $scope.current.url;
var a = document.createElement('a');
a.href = url;
var evt = document
.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true,
window, 0, 0, 0, 0, 0, true, false,
false, false, 0, null);
a.dispatchEvent(evt);
}
});
Mousetrap.bind('s', function(e) {
$scope.$apply(function() {
if ($scope.current) {

View File

@@ -17,6 +17,9 @@
<dt>v</dt>
<dd>${about.shortcuts.open_current_entry_in_new_window}</dd>
<dt>b</dt>
<dd>${about.shortcuts.open_current_entry_in_new_window_background}</dd>
<dt>s</dt>
<dd>${about.shortcuts.star_unstar}</dd>