summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-05 11:22:38 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-05 11:22:38 +0200
commitf8451ca565c07cfe42d5cf5a9d3d02cba4f2d773 (patch)
tree18ad7d2e5bb804e28e3e5be122349d0bbbdbebc5 /js
parent76b3dcd712b9bce4b94be58a07c8dbe584ee8f2f (diff)
bring back show all button
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/controllers.coffee7
-rw-r--r--js/app/controllers/feedcontroller.coffee4
-rw-r--r--js/app/services/bl/feedbl.coffee4
-rw-r--r--js/public/app.js14
-rw-r--r--js/tests/controllers/feedcontrollerSpec.coffee11
-rw-r--r--js/tests/services/bl/feedblSpec.coffee7
6 files changed, 38 insertions, 9 deletions
diff --git a/js/app/controllers/controllers.coffee b/js/app/controllers/controllers.coffee
index 6598ac692..77c178fef 100644
--- a/js/app/controllers/controllers.coffee
+++ b/js/app/controllers/controllers.coffee
@@ -30,11 +30,12 @@ angular.module('News').controller 'SettingsController',
angular.module('News').controller 'FeedController',
['$scope', '_FeedController', 'Persistence', 'FolderBl', 'FeedBl',
-'unreadCountFormatter',
-($scope, _FeedController, Persistence, FolderBl, FeedBl, unreadCountFormatter)->
+'SubscriptionsBl', 'StarredBl', 'unreadCountFormatter',
+($scope, _FeedController, Persistence, FolderBl, FeedBl, SubscriptionsBl,
+StarredBl, unreadCountFormatter)->
return new _FeedController($scope, Persistence, FolderBl, FeedBl,
- unreadCountFormatter)
+ SubscriptionsBl, StarredBl, unreadCountFormatter)
]
angular.module('News').controller 'ItemController',
diff --git a/js/app/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee
index 1438b4fbb..7785f3de6 100644
--- a/js/app/controllers/feedcontroller.coffee
+++ b/js/app/controllers/feedcontroller.coffee
@@ -26,7 +26,7 @@ angular.module('News').factory '_FeedController', ->
class FeedController
constructor: (@$scope, @_persistence, @_folderBl, @_feedBl,
- @_unreadCountFormatter) ->
+ @_subscriptionsBl, @_starredBl, @_unreadCountFormatter) ->
@_isAddingFolder = false
@_isAddingFeed = false
@@ -34,6 +34,8 @@ angular.module('News').factory '_FeedController', ->
# bind internal stuff to scope
@$scope.folderBl = @_folderBl
@$scope.feedBl = @_feedBl
+ @$scope.subscriptionsBl = @_subscriptionsBl
+ @$scope.starredBl = @_starredBl
@$scope.unreadCountFormatter = @_unreadCountFormatter
diff --git a/js/app/services/bl/feedbl.coffee b/js/app/services/bl/feedbl.coffee
index ad51fa339..02adb0f15 100644
--- a/js/app/services/bl/feedbl.coffee
+++ b/js/app/services/bl/feedbl.coffee
@@ -98,6 +98,10 @@ angular.module('News').factory 'FeedBl',
@_persistence.userSettingsReadHide()
+ isShowAll: ->
+ return @_showAll.getShowAll()
+
+
getAll: ->
return @_feedModel.getAll()
diff --git a/js/public/app.js b/js/public/app.js
index 20d687649..944f99b7f 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -171,8 +171,8 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
]);
angular.module('News').controller('FeedController', [
- '$scope', '_FeedController', 'Persistence', 'FolderBl', 'FeedBl', 'unreadCountFormatter', function($scope, _FeedController, Persistence, FolderBl, FeedBl, unreadCountFormatter) {
- return new _FeedController($scope, Persistence, FolderBl, FeedBl, unreadCountFormatter);
+ '$scope', '_FeedController', 'Persistence', 'FolderBl', 'FeedBl', 'SubscriptionsBl', 'StarredBl', 'unreadCountFormatter', function($scope, _FeedController, Persistence, FolderBl, FeedBl, SubscriptionsBl, StarredBl, unreadCountFormatter) {
+ return new _FeedController($scope, Persistence, FolderBl, FeedBl, SubscriptionsBl, StarredBl, unreadCountFormatter);
}
]);
@@ -214,17 +214,21 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
var FeedController;
FeedController = (function() {
- function FeedController($scope, _persistence, _folderBl, _feedBl, _unreadCountFormatter) {
+ function FeedController($scope, _persistence, _folderBl, _feedBl, _subscriptionsBl, _starredBl, _unreadCountFormatter) {
var _this = this;
this.$scope = $scope;
this._persistence = _persistence;
this._folderBl = _folderBl;
this._feedBl = _feedBl;
+ this._subscriptionsBl = _subscriptionsBl;
+ this._starredBl = _starredBl;
this._unreadCountFormatter = _unreadCountFormatter;
this._isAddingFolder = false;
this._isAddingFeed = false;
this.$scope.folderBl = this._folderBl;
this.$scope.feedBl = this._feedBl;
+ this.$scope.subscriptionsBl = this._subscriptionsBl;
+ this.$scope.starredBl = this._starredBl;
this.$scope.unreadCountFormatter = this._unreadCountFormatter;
this.$scope.isAddingFolder = function() {
return _this._isAddingFolder;
@@ -642,6 +646,10 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}
};
+ FeedBl.prototype.isShowAll = function() {
+ return this._showAll.getShowAll();
+ };
+
FeedBl.prototype.getAll = function() {
return this._feedModel.getAll();
};
diff --git a/js/tests/controllers/feedcontrollerSpec.coffee b/js/tests/controllers/feedcontrollerSpec.coffee
index 755e84440..b5216db60 100644
--- a/js/tests/controllers/feedcontrollerSpec.coffee
+++ b/js/tests/controllers/feedcontrollerSpec.coffee
@@ -31,11 +31,12 @@ describe '_FeedController', ->
beforeEach inject (@_FeedController, @FolderBl, @FeedBl, $rootScope,
- @unreadCountFormatter) =>
+ @unreadCountFormatter, @SubscriptionsBl, @StarredBl) =>
@scope = $rootScope.$new()
@controller = new @_FeedController(@scope, @persistence, @FolderBl,
- @FeedBl, @unreadCountFormatter)
+ @FeedBl, @SubscriptionsBl, @StarredBl,
+ @unreadCountFormatter)
@@ -59,6 +60,12 @@ describe '_FeedController', ->
expect(@scope.folderBl).toBe(@FolderBl)
+ it 'should make SubscriptionsBl available', =>
+ expect(@scope.subscriptionsBl).toBe(@SubscriptionsBl)
+
+ it 'should make StarredBl available', =>
+ expect(@scope.starredBl).toBe(@StarredBl)
+
it 'should not add folders that have no name', =>
@persistence.createFolder = jasmine.createSpy('create')
@scope.addFolder(' ')
diff --git a/js/tests/services/bl/feedblSpec.coffee b/js/tests/services/bl/feedblSpec.coffee
index 27b681a32..8cd8100a3 100644
--- a/js/tests/services/bl/feedblSpec.coffee
+++ b/js/tests/services/bl/feedblSpec.coffee
@@ -179,3 +179,10 @@ describe 'FeedBl', ->
expect(@FeedBl.getAll()).toContain(item1)
expect(@FeedBl.getAll()).toContain(item2)
+
+ it 'should retunr if ShowAll is set', =>
+ @persistence.userSettingsReadShow = jasmine.createSpy('Show All')
+ expect(@FeedBl.isShowAll()).toBe(false)
+ @FeedBl.setShowAll(true)
+
+ expect(@FeedBl.isShowAll()).toBe(true) \ No newline at end of file