mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
show shortcuts on '?' keypress (#52)
This commit is contained in:
@@ -431,22 +431,23 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
|
||||
}
|
||||
};
|
||||
|
||||
Mousetrap.bind('space', function(e) {
|
||||
$scope.$apply(function() {
|
||||
openNextEntry(e);
|
||||
});
|
||||
});
|
||||
|
||||
Mousetrap.bind('j', function(e) {
|
||||
$scope.$apply(function() {
|
||||
openNextEntry(e);
|
||||
});
|
||||
});
|
||||
Mousetrap.bind('shift+space', function(e) {
|
||||
Mousetrap.bind('k', function(e) {
|
||||
$scope.$apply(function() {
|
||||
openPreviousEntry(e);
|
||||
});
|
||||
});
|
||||
Mousetrap.bind('k', function(e) {
|
||||
Mousetrap.bind('space', function(e) {
|
||||
$scope.$apply(function() {
|
||||
openNextEntry(e);
|
||||
});
|
||||
});
|
||||
Mousetrap.bind('shift+space', function(e) {
|
||||
$scope.$apply(function() {
|
||||
openPreviousEntry(e);
|
||||
});
|
||||
@@ -475,6 +476,11 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
|
||||
window.open($scope.current.url);
|
||||
}
|
||||
});
|
||||
Mousetrap.bind('?', function(e) {
|
||||
$scope.$apply(function() {
|
||||
$scope.shortcutsModal = true;
|
||||
});
|
||||
});
|
||||
|
||||
$scope.$on('markAll', function(event, args) {
|
||||
var service = $scope.selectedType == 'feed' ? FeedService
|
||||
|
||||
16
src/main/webapp/templates/_shortcuts.html
Normal file
16
src/main/webapp/templates/_shortcuts.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<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>
|
||||
@@ -45,22 +45,7 @@
|
||||
</div>
|
||||
<div class="tab-pane" id="shortcuts">
|
||||
<h3>Keyboard Shortcuts</h3>
|
||||
<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 ng-include="'templates/_shortcuts.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<div>
|
||||
|
||||
<div class="entrylist-header" ui-if="name">
|
||||
<h3><span>{{name}} </span><span ng-show="name && selectedType == 'category'"> »</span></h3>
|
||||
</div>
|
||||
@@ -39,5 +38,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="no-entries" ng-show="name && entries.length == 0 && !busy">"{{name}}" has no unread items.</div>
|
||||
<div modal="shortcutsModal" close="shortcutsModal=false" options="shortcutsOpts">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" ng-click="shortcutsModal=false">×</button>
|
||||
<h4>Keyboard shortcuts</h4>
|
||||
</div>
|
||||
<div ng-include="'templates/_shortcuts.html'"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user