diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-14 20:02:05 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-14 20:02:05 +0200 |
commit | c3a0bf654cf542cf2daefd1e3428c8c648007dd1 (patch) | |
tree | 997c1a8d27cb20afa17c5b2c85f8a56698c975b7 /js/build/app.js | |
parent | 975f30899c6a1498cbaa0e1b81008b7b3063b5dc (diff) |
add keyboard shortcuts for reloading and jumping to the next/previous feed
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/js/build/app.js b/js/build/app.js index 4fd50165c..b717aa923 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -1658,6 +1658,20 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) ); }; + var reloadFeed = function (navigationArea) { + navigationArea.find('.active > a:visible').trigger('click'); + }; + + var nextFeed = function (navigationArea) { + navigationArea.find('.active') + .next('li').children('a:visible').trigger('click'); + }; + + var previousFeed = function (navigationArea) { + navigationArea.find('.active').prev('li') + .children('a:visible').trigger('click'); + }; + var onActiveItem = function (scrollArea, callback) { var items = scrollArea.find('.item'); @@ -1771,6 +1785,7 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) if (noInputFocused($(':focus')) && noModifierKey(event)) { var keyCode = event.keyCode; var scrollArea = $('#app-content'); + var navigationArea = $('#app-navigation'); var isCompactMode = $('#app-content-wrapper > .compact').length > 0; // j, n, right arrow @@ -1816,6 +1831,24 @@ app.service('SettingsResource', ["$http", "BASE_URL", function ($http, BASE_URL) event.preventDefault(); openLink(scrollArea); + // r + } else if ([82].indexOf(keyCode) >= 0) { + + event.preventDefault(); + reloadFeed(navigationArea); + + // f + } else if ([70].indexOf(keyCode) >= 0) { + + event.preventDefault(); + nextFeed(navigationArea); + + // d + } else if ([68].indexOf(keyCode) >= 0) { + + event.preventDefault(); + previousFeed(navigationArea); + } } |