keyboard shortcut for marking all entries as read

This commit is contained in:
Athou
2013-05-07 08:03:23 +02:00
parent 2100e114f4
commit f27288bbd2
2 changed files with 23 additions and 11 deletions

View File

@@ -530,6 +530,20 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
}
};
$scope.markAll = function() {
var service = $scope.selectedType == 'feed' ? FeedService
: CategoryService;
service.mark({
id : $scope.selectedId,
olderThan : $scope.timestamp,
read : true
}, function() {
CategoryService.init(function() {
$scope.$emit('emitReload');
});
});
};
$scope.star = function(entry, star, event) {
if (event) {
event.preventDefault();
@@ -671,6 +685,11 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
}
});
});
Mousetrap.bind('shift+a', function(e) {
$scope.$apply(function() {
$scope.markAll();
});
});
Mousetrap.bind('?', function(e) {
$scope.$apply(function() {
$scope.shortcutsModal = true;
@@ -678,17 +697,7 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
});
$scope.$on('markAll', function(event, args) {
var service = $scope.selectedType == 'feed' ? FeedService
: CategoryService;
service.mark({
id : $scope.selectedId,
olderThan : $scope.timestamp,
read : true
}, function() {
CategoryService.init(function() {
$scope.$emit('emitReload');
});
});
$scope.markAll();
});
$scope.$on('reload', function(event, args) {

View File

@@ -16,6 +16,9 @@
<dt>m</dt>
<dd>mark as read/unread current entry</dd>
<dt>shift+a</dt>
<dd>mark all entries as read</dd>
<dt>mouse middleclick</dt>
<dd>open entry in new tab and mark as read</dd>