diff --git a/src/main/resources/i18n/en.properties b/src/main/resources/i18n/en.properties index 73f0233c..b128891f 100644 --- a/src/main/resources/i18n/en.properties +++ b/src/main/resources/i18n/en.properties @@ -49,6 +49,10 @@ view.error_while_loading_feed=Error while loading this feed view.keep_unread=Keep unread view.no_unread_items=has no unread items. +feedsearch.hint=Type in a subscription... +feedsearch.help=Use the return key to select and arrow keys to navigate. +feedsearch.result_prefix=Your subscriptions: + settings.general=General settings.general.language=Language settings.general.language.contribute=Contribute with translations diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 16c711cb..cc019c31 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -556,6 +556,26 @@ function($scope, $http, $state, $stateParams, $route, $location, }; }]); +module.controller('FeedCtrl', ['$scope', '$state', 'CategoryService', +function($scope, $state, CategoryService) { + $scope.CategoryService = CategoryService; + $scope.feedSearchModal = false; + + $scope.goToFeed = function(id) { + $state.transitionTo('feeds.view', {_type : 'feed', _id : id}); + $scope.feedSearchModal=false; + $scope.feedFilter=''; + }; + + Mousetrap.bind('g u', function(e) { + $scope.$apply(function() { + $scope.feedSearchModal = true; + }); + return false; + }); + +}]); + module.controller('FeedListCtrl', ['$scope', '$stateParams', '$http', '$route', '$window', 'EntryService', 'SettingsService', 'FeedService', 'CategoryService', 'AnalyticsService', function($scope, $stateParams, $http, $route, $window, EntryService, SettingsService, FeedService, CategoryService, AnalyticsService) { diff --git a/src/main/webapp/js/services.js b/src/main/webapp/js/services.js index 85158671..fb98443f 100644 --- a/src/main/webapp/js/services.js +++ b/src/main/webapp/js/services.js @@ -131,6 +131,27 @@ function($resource, $http) { } return array; }; + var traverse = function(fn, category, parentName) { + var subs = []; + fn(category, parentName); + var children = category.children; + for ( var c = 0; c < children.length; c++) { + traverse(fn, children[c], category.name); + } + return subs; + }; + var flatfeeds = function(category) { + // TODO: This is a bit silly: We flatten the hierarchical list of + // subscriptions which was build from the flat list of subscriptions + // in CategoryREST.getSubscriptions(). It would be nice to have + // direct access to feedSubscriptionDAO.findAll(). + var subs = []; + var cb = function(category) { + subs.push.apply(subs, category.feeds); + }; + traverse(cb, category); + return subs; + }; var actions = { get : { method : 'GET', @@ -178,11 +199,13 @@ function($resource, $http) { var res = $resource('rest/category/:_method', {}, actions); res.subscriptions = {}; res.flatCategories = {}; + res.feeds = []; res.init = function(callback) { res.get(function(data) { res.subscriptions = data; res.flatCategories = flatten(data); + res.feeds = flatfeeds(data); if (callback) callback(data); }); diff --git a/src/main/webapp/sass/generic/_misc.scss b/src/main/webapp/sass/generic/_misc.scss index 47f163c7..6e81179e 100644 --- a/src/main/webapp/sass/generic/_misc.scss +++ b/src/main/webapp/sass/generic/_misc.scss @@ -59,4 +59,8 @@ .favicon { width: 16px; height: 16px; +} + +.item-filter-dialog .modal-body { + overflow: hidden; } \ No newline at end of file diff --git a/src/main/webapp/templates/feeds.html b/src/main/webapp/templates/feeds.html index e85d5324..41ef504b 100644 --- a/src/main/webapp/templates/feeds.html +++ b/src/main/webapp/templates/feeds.html @@ -1,4 +1,4 @@ -
+
+
+ + +
\ No newline at end of file