diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-12 12:25:58 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-12 12:25:58 +0200 |
commit | e8767f75116ff7ef2b7a349480151c9f66bbade0 (patch) | |
tree | 5879fe01fa8113a299daaba4d2c6cfa84769a104 /js/public | |
parent | e9eaa93826c75097d95d21a556e1b1aae6610bcd (diff) |
implement clientside update requests, fix #27
Diffstat (limited to 'js/public')
-rw-r--r-- | js/public/app.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/js/public/app.js b/js/public/app.js index 4f44689c3..e11c2e976 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -41,14 +41,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return $provide.value('Config', config = { markReadTimeout: 500, scrollTimeout: 500, - feedUpdateInterval: 6000000, + feedUpdateInterval: 600000, itemBatchSize: 20 }); }); angular.module('News').run([ - 'Persistence', function(Persistence) { - return Persistence.init(); + 'Persistence', 'Config', 'FeedBl', function(Persistence, Config, FeedBl) { + Persistence.init(); + return setInterval(function() { + return FeedBl.updateFeeds(); + }, Config.feedUpdateInterval); } ]); @@ -800,6 +803,22 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return this._feedModel.removeByUrlHash(urlHash); }; + FeedBl.prototype.updateFeeds = function() { + var feed, _i, _len, _ref, _results; + + _ref = this._feedModel.getAll(); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + feed = _ref[_i]; + if (angular.isDefined(feed.id)) { + _results.push(this._persistence.updateFeed(feed.id)); + } else { + _results.push(void 0); + } + } + return _results; + }; + return FeedBl; })(_Bl); |