more keyboard shortcuts goodness

This commit is contained in:
Athou
2013-04-21 08:07:06 +02:00
parent 201468c085
commit e5e827e585
2 changed files with 71 additions and 19 deletions

View File

@@ -378,8 +378,8 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
$scope.mark(entry, true);
}
};
$scope.noop = function(event){
$scope.noop = function(event) {
if (!event.ctrlKey && event.which != 2) {
event.preventDefault();
event.stopPropagation();
@@ -438,7 +438,6 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
openNextEntry(e);
});
});
Mousetrap.bind('shift+space', function(e) {
$scope.$apply(function() {
openPreviousEntry(e);
@@ -449,6 +448,30 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
openPreviousEntry(e);
});
});
Mousetrap.bind('o', function(e) {
$scope.$apply(function() {
if ($scope.current) {
$scope.entryClicked($scope.current, e);
}
});
});
Mousetrap.bind('enter', function(e) {
$scope.$apply(function() {
if ($scope.current) {
$scope.entryClicked($scope.current, e);
}
});
});
Mousetrap.bind('r', function(e) {
$scope.$apply(function() {
$scope.$emit('emitReload');
});
});
Mousetrap.bind('v', function(e) {
if ($scope.current) {
window.open($scope.current.url);
}
});
$scope.$on('markAll', function(event, args) {
var service = $scope.selectedType == 'feed' ? FeedService

View File

@@ -1,19 +1,48 @@
<div>
<h3>CommaFeed</h3>
<p>
CommaFeed is an open-source project. Sources are hosted on <a href="https://github.com/Athou/commafeed" target="_blank">GitHub</a>.
</p>
<p>
If you encounter an issue, please report it on the <a href="https://github.com/Athou/commafeed/issues" target="_blank">issues page</a> of the GitHub project.
</p>
<h3>REST API</h3>
<p>
CommaFeed is built on top of JAX-RS and AngularJS. As such, a REST API is available.
</p>
<p>
The documentation about the API is available <a href="api" target="_blank">here</a>.
</p>
<ul class="nav nav-tabs">
<li class="active">
<a href="#about" data-toggle="tab">About</a>
</li>
<li>
<a href="#shortcuts" data-toggle="tab">Keyboard shortcuts</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="about">
<h3>CommaFeed</h3>
<p>
CommaFeed is an open-source project. Sources are hosted on <a href="https://github.com/Athou/commafeed" target="_blank">GitHub</a>.
</p>
<p>
If you encounter an issue, please report it on the <a href="https://github.com/Athou/commafeed/issues" target="_blank">issues page</a> of the GitHub project.
</p>
<h3>REST API</h3>
<p>
CommaFeed is built on top of JAX-RS and AngularJS. As such, a REST API is available.
</p>
<p>
The documentation about the API is available <a href="api" target="_blank">here</a>.
</p>
</div>
<div class="tab-pane active" id="shortcuts">
<dl class="dl-horizontal">
<dt>k, space</dt>
<dd>open next entry</dd>
<dt>j, shift+space</dt>
<dd>open previous entry</dd>
<dt>o, enter</dt>
<dd>open/close current entry</dd>
<dt>v</dt>
<dd>open current entry in a new window</dd>
<dt>mouse middleclick</dt>
<dd>open entry in new tab and mark as read</dd>
</dl>
</div>
</div>
</div>