diff --git a/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java b/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java index 3f9ca8cf..83786a9c 100644 --- a/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java +++ b/src/main/java/com/commafeed/frontend/rest/resources/FeedREST.java @@ -248,6 +248,19 @@ public class FeedREST extends AbstractResourceREST { return Response.ok(info).build(); } + @Path("/refreshAll") + @GET + @ApiOperation(value = "Queue all feeds of the user for refresh", notes = "Manually add all feeds of the user to the refresh queue") + public Response queueAllForRefresh() { + List subs = feedSubscriptionDAO.findAll(getUser()); + for (FeedSubscription sub : subs) { + Feed feed = sub.getFeed(); + feed.setUrgent(true); + taskGiver.add(feed); + } + return Response.ok(Status.OK).build(); + } + @Path("/refresh") @POST @ApiOperation(value = "Queue a feed for refresh", notes = "Manually add a feed to the refresh queue") @@ -264,7 +277,6 @@ public class FeedREST extends AbstractResourceREST { return Response.ok(Status.OK).build(); } return Response.ok(Status.NOT_FOUND).build(); - } @Path("/mark") diff --git a/src/main/resources/i18n/en.properties b/src/main/resources/i18n/en.properties index 73fe3859..e8a78f07 100644 --- a/src/main/resources/i18n/en.properties +++ b/src/main/resources/i18n/en.properties @@ -31,6 +31,7 @@ toolbar.all=All toolbar.previous_entry=Previous entry toolbar.next_entry=Next entry toolbar.refresh=Refresh +toolbar.refresh_all=Force refresh all my feeds toolbar.sort_by_asc_desc=Sort by date asc/desc toolbar.titles_only=Titles only toolbar.expanded_view=Expanded view diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 56ed4643..009aeea4 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -18,7 +18,8 @@ module.run(['$rootScope', function($rootScope) { $rootScope.$broadcast('markAll', args); }); $rootScope.$on('emitReload', function(event, args) { - $rootScope.$broadcast('reload'); + // args.all + $rootScope.$broadcast('reload', args); }); $rootScope.$on('emitFeedSearch', function(event, args) { $rootScope.$broadcast('feedSearch'); @@ -469,7 +470,12 @@ function($scope, $http, $state, $stateParams, $route, $location, $scope.refresh = function() { $scope.$emit('emitReload'); - + }; + + $scope.refreshAll = function() { + $scope.$emit('emitReload', { + all : true + }); }; var markAll = function(olderThan) { @@ -1140,7 +1146,9 @@ function($scope, $stateParams, $http, $route, $state, $window, EntryService, Set $scope.hasMore = true; $scope.loadMoreEntries(); - if ($scope.selectedType == 'feed'){ + if (args.all) { + FeedService.refreshAll(); + } else if ($scope.selectedType == 'feed') { FeedService.refresh({ id : $stateParams._id }); diff --git a/src/main/webapp/js/services.js b/src/main/webapp/js/services.js index c5d42982..c2b3743e 100644 --- a/src/main/webapp/js/services.js +++ b/src/main/webapp/js/services.js @@ -92,6 +92,12 @@ function($resource, $http) { _method : 'refresh' } }, + refreshAll : { + method : 'GET', + params : { + _method : 'refreshAll' + } + }, subscribe : { method : 'POST', params : { diff --git a/src/main/webapp/templates/_toolbar.html b/src/main/webapp/templates/_toolbar.html index b53f1f83..f1c30085 100644 --- a/src/main/webapp/templates/_toolbar.html +++ b/src/main/webapp/templates/_toolbar.html @@ -9,7 +9,15 @@
- +
+ + + +