forked from Archives/Athou_commafeed
button to mark all entries up to there
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
package com.commafeed.frontend.model.request;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import com.wordnik.swagger.annotations.ApiClass;
|
||||||
|
import com.wordnik.swagger.annotations.ApiProperty;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@ApiClass("Multiple Mark Request")
|
||||||
|
public class MultipleMarkRequest implements Serializable {
|
||||||
|
|
||||||
|
@ApiProperty(value = "list of mark requests", required = true)
|
||||||
|
private List<MarkRequest> requests;
|
||||||
|
|
||||||
|
public List<MarkRequest> getRequests() {
|
||||||
|
return requests;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequests(List<MarkRequest> requests) {
|
||||||
|
this.requests = requests;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ import com.commafeed.backend.services.FeedEntryService;
|
|||||||
import com.commafeed.frontend.model.Entries;
|
import com.commafeed.frontend.model.Entries;
|
||||||
import com.commafeed.frontend.model.Entry;
|
import com.commafeed.frontend.model.Entry;
|
||||||
import com.commafeed.frontend.model.request.MarkRequest;
|
import com.commafeed.frontend.model.request.MarkRequest;
|
||||||
|
import com.commafeed.frontend.model.request.MultipleMarkRequest;
|
||||||
import com.commafeed.frontend.model.request.StarRequest;
|
import com.commafeed.frontend.model.request.StarRequest;
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@@ -55,6 +56,21 @@ public class EntryREST extends AbstractResourceREST {
|
|||||||
return Response.ok(Status.OK).build();
|
return Response.ok(Status.OK).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Path("/markMultiple")
|
||||||
|
@POST
|
||||||
|
@ApiOperation(value = "Mark multiple feed entries", notes = "Mark feed entries as read/unread")
|
||||||
|
public Response markFeedEntries(
|
||||||
|
@ApiParam(value = "Multiple Mark Request", required = true) MultipleMarkRequest req) {
|
||||||
|
Preconditions.checkNotNull(req);
|
||||||
|
Preconditions.checkNotNull(req.getRequests());
|
||||||
|
|
||||||
|
for (MarkRequest r : req.getRequests()) {
|
||||||
|
markFeedEntry(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Response.ok(Status.OK).build();
|
||||||
|
}
|
||||||
|
|
||||||
@Path("/star")
|
@Path("/star")
|
||||||
@POST
|
@POST
|
||||||
@ApiOperation(value = "Mark a feed entry", notes = "Mark a feed entry as read/unread")
|
@ApiOperation(value = "Mark a feed entry", notes = "Mark a feed entry as read/unread")
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ view.entry_author=by
|
|||||||
view.error_while_loading_feed=Error while loading this feed
|
view.error_while_loading_feed=Error while loading this feed
|
||||||
view.keep_unread=Keep unread
|
view.keep_unread=Keep unread
|
||||||
view.no_unread_items=has no unread items.
|
view.no_unread_items=has no unread items.
|
||||||
|
view.mark_up_to_here=Mark as read up to here
|
||||||
|
|
||||||
feedsearch.hint=Type in a subscription...
|
feedsearch.hint=Type in a subscription...
|
||||||
feedsearch.help=Use the return key to select and arrow keys to navigate.
|
feedsearch.help=Use the return key to select and arrow keys to navigate.
|
||||||
|
|||||||
@@ -752,6 +752,29 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.markUpTo = function(entry) {
|
||||||
|
var entries = [];
|
||||||
|
for (var i = 0; i < $scope.entries.length; i++) {
|
||||||
|
var entry = $scope.entries[i];
|
||||||
|
if (!entry.read) {
|
||||||
|
entries.push({
|
||||||
|
id : entry.id,
|
||||||
|
feedId : entry.feedId,
|
||||||
|
read: true
|
||||||
|
});
|
||||||
|
entry.read = true;
|
||||||
|
}
|
||||||
|
if (entry == $scope.current) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EntryService.markMultiple({
|
||||||
|
requests : entries
|
||||||
|
}, function() {
|
||||||
|
CategoryService.refresh();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$scope.star = function(entry, star, event) {
|
$scope.star = function(entry, star, event) {
|
||||||
if (event) {
|
if (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
@@ -241,6 +241,12 @@ function($resource, $http) {
|
|||||||
_method : 'mark'
|
_method : 'mark'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
markMultiple : {
|
||||||
|
method : 'POST',
|
||||||
|
params : {
|
||||||
|
_method : 'markMultiple'
|
||||||
|
}
|
||||||
|
},
|
||||||
star : {
|
star : {
|
||||||
method : 'POST',
|
method : 'POST',
|
||||||
params : {
|
params : {
|
||||||
|
|||||||
@@ -180,6 +180,17 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#feed-accordion a.mark-up-to {
|
||||||
|
color: #333333;
|
||||||
|
position: absolute;
|
||||||
|
right: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#feed-accordion a.mark-up-to:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
#feed-accordion .star {
|
#feed-accordion .star {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding: 0px 5px;
|
padding: 0px 5px;
|
||||||
|
|||||||
@@ -101,6 +101,10 @@
|
|||||||
<i class="icon-buffer"></i>
|
<i class="icon-buffer"></i>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<a ng-click="markUpTo(entry)" class="mark-up-to" title="${view.mark_up_to_here}">
|
||||||
|
<i class="icon-step-forward icon-rotate-90"></i>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user