From d648b26345e6e9d58d59e72adc0a438d6c750279 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 4 May 2013 16:44:22 +0200 Subject: use 99 as maximum unread count to display, permanently display delete button for active feed --- js/app/services/unreadcountformatter.coffee | 4 ++-- js/public/app.js | 4 ++-- js/tests/controllers/feedcontrollerSpec.coffee | 6 +++--- js/tests/services/unreadcountformaterSpec.coffee | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'js') diff --git a/js/app/services/unreadcountformatter.coffee b/js/app/services/unreadcountformatter.coffee index 76993ef5c..bb746514b 100644 --- a/js/app/services/unreadcountformatter.coffee +++ b/js/app/services/unreadcountformatter.coffee @@ -23,6 +23,6 @@ License along with this library. If not, see . angular.module('News').factory 'unreadCountFormatter', -> return (unreadCount) -> - if unreadCount > 999 - unreadCount = '999+' + if unreadCount > 99 + unreadCount = '99+' return unreadCount \ No newline at end of file diff --git a/js/public/app.js b/js/public/app.js index 546044de7..d71e77cbe 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -3236,8 +3236,8 @@ License along with this library. If not, see . (function() { angular.module('News').factory('unreadCountFormatter', function() { return function(unreadCount) { - if (unreadCount > 999) { - unreadCount = '999+'; + if (unreadCount > 99) { + unreadCount = '99+'; } return unreadCount; }; diff --git a/js/tests/controllers/feedcontrollerSpec.coffee b/js/tests/controllers/feedcontrollerSpec.coffee index 69098b646..684cf1368 100644 --- a/js/tests/controllers/feedcontrollerSpec.coffee +++ b/js/tests/controllers/feedcontrollerSpec.coffee @@ -91,15 +91,15 @@ describe 'FeedController', -> expect(@$window.document.title).toBe('News (5) | ownCloud') - it 'should show 999+ if in window title when more than 999 unread count', => + it 'should show 99+ if in window title when more than 99 unread count', => item = {id: 3, unreadCount: 1, faviconLink: 'test', url: 'hi'} - item1 = {id: 5, unreadCount: 999, faviconLink: 'test', url: 'his'} + item1 = {id: 5, unreadCount: 99, faviconLink: 'test', url: 'his'} @FeedModel.add(item) @FeedModel.add(item1) @scope.getTotalUnreadCount() - expect(@$window.document.title).toBe('News (999+) | ownCloud') + expect(@$window.document.title).toBe('News (99+) | ownCloud') it 'should move a feed if moveFeedToFolder is broadcasted', => diff --git a/js/tests/services/unreadcountformaterSpec.coffee b/js/tests/services/unreadcountformaterSpec.coffee index f4dabb8cc..5b151fca7 100644 --- a/js/tests/services/unreadcountformaterSpec.coffee +++ b/js/tests/services/unreadcountformaterSpec.coffee @@ -27,9 +27,9 @@ describe 'unreadCountFormatter', -> beforeEach inject (@unreadCountFormatter) => - it 'should return the normal count if its below 999', => - expect(@unreadCountFormatter(999)).toBe(999) + it 'should return the normal count if its below 99', => + expect(@unreadCountFormatter(99)).toBe(99) - it 'should set the count to 999+ if the count is over 999', => - expect(@unreadCountFormatter(1000)).toBe('999+') \ No newline at end of file + it 'should set the count to 99+ if the count is over 99', => + expect(@unreadCountFormatter(100)).toBe('99+') \ No newline at end of file -- cgit v1.2.3