diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-05 12:07:04 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-05 12:07:04 +0200 |
commit | a6d1cc915aed37ad6731ab28728d2f4e58f5b6da (patch) | |
tree | eac3b6412d6eb14ad9468358dac9abb22d7f2539 /js/public | |
parent | 54a67849bd6fe0608c9940bfa1b87b24c07ba41e (diff) |
implemented bare itembl methods
Diffstat (limited to 'js/public')
-rw-r--r-- | js/public/app.js | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/js/public/app.js b/js/public/app.js index 448778e9d..718c89a02 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -177,8 +177,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. ]); angular.module('News').controller('ItemController', [ - '$scope', '_ItemController', 'ItemModel', 'FeedModel', 'FeedLoading', function($scope, _ItemController, ItemModel, FeedModel, FeedLoading) { - return new _ItemController($scope, ItemModel, FeedModel, FeedLoading); + '$scope', '_ItemController', 'ItemBl', 'FeedModel', 'FeedLoading', function($scope, _ItemController, ItemBl, FeedModel, FeedLoading) { + return new _ItemController($scope, ItemBl, FeedModel, FeedLoading); } ]); @@ -323,13 +323,13 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. var ItemController; ItemController = (function() { - function ItemController(_$scope, _itemModel, _feedModel, _feedLoading) { + function ItemController(_$scope, _itemBl, _feedModel, _feedLoading) { var _this = this; this._$scope = _$scope; - this._itemModel = _itemModel; + this._itemBl = _itemBl; this._feedModel = _feedModel; this._feedLoading = _feedLoading; - this._$scope.items = this._itemModel.getAll(); + this._$scope.itemBl = this._itemBl; this._$scope.isLoading = function() { return _this._feedLoading.isLoading(); }; @@ -804,20 +804,42 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. (function() { - angular.module('News').factory('ItemBl', function() { - var ItemBl; - ItemBl = (function() { + angular.module('News').factory('ItemBl', [ + 'ItemModel', 'Persistence', 'ActiveFeed', 'FeedType', function(ItemModel, Persistence, ActiveFeed, FeedType) { + var ItemBl; + ItemBl = (function() { - function ItemBl(_itemModel, _persistence) { - this._itemModel = _itemModel; - this._persistence = _persistence; - } + function ItemBl(_itemModel, _persistence, _activeFeed, _feedType) { + this._itemModel = _itemModel; + this._persistence = _persistence; + this._activeFeed = _activeFeed; + this._feedType = _feedType; + } - return ItemBl; + ItemBl.prototype.getAll = function() { + return this._itemModel.getAll(); + }; - })(); - return new ItemBl(); - }); + ItemBl.prototype.noFeedActive = function() { + return this._activeFeed.getType() !== this._feedType.Feed; + }; + + ItemBl.prototype.isKeptUnread = function(itemId) {}; + + ItemBl.prototype.toggleKeepUnread = function(itemId) {}; + + ItemBl.prototype.toggleStarred = function(itemId) {}; + + ItemBl.prototype.setRead = function(itemId) {}; + + ItemBl.prototype.getFeedTitle = function(itemId) {}; + + return ItemBl; + + })(); + return new ItemBl(ItemModel, Persistence, ActiveFeed, FeedType); + } + ]); }).call(this); |