mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-31 22:20:12 +00:00
43 lines
No EOL
918 B
JavaScript
43 lines
No EOL
918 B
JavaScript
NEWSBLUR.Models.Feed = Backbone.Model.extend({
|
|
|
|
is_social: function() {
|
|
return false;
|
|
}
|
|
|
|
});
|
|
|
|
NEWSBLUR.Collections.Feeds = Backbone.Collection.extend({
|
|
|
|
model: NEWSBLUR.Models.Feed,
|
|
|
|
url: '/reader/feeds',
|
|
|
|
fetch: function(options) {
|
|
options = _.extend({
|
|
data: {
|
|
v: 2
|
|
},
|
|
silent: true
|
|
}, options);
|
|
return Backbone.Collection.prototype.fetch.call(this, options);
|
|
},
|
|
|
|
parse: function(data) {
|
|
return data.feeds;
|
|
},
|
|
|
|
has_chosen_feeds: function() {
|
|
return this.any(function(feed) {
|
|
return feed.get('active');
|
|
});
|
|
},
|
|
|
|
deselect: function() {
|
|
this.chain().select(function(feed) {
|
|
return feed.get('selected');
|
|
}).each(function(feed){
|
|
feed.set('selected', false);
|
|
});
|
|
}
|
|
|
|
}); |