summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-26 12:08:07 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-26 12:08:07 +0200
commit01210ea081498b511b29ac76f7b55e5032d45e50 (patch)
treef8543d26b5c833f10d85e1966812b2d230eb9835 /js
parentf987751d8c5c7a3ee660411afb9d01e6a822aed5 (diff)
format unread count properly
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/feedcontroller.coffee5
-rw-r--r--js/app/services/businesslayer/feedbusinesslayer.coffee5
-rw-r--r--js/app/services/businesslayer/itembusinesslayer.coffee2
-rw-r--r--js/app/services/persistence.coffee2
-rw-r--r--js/public/app.js6
-rw-r--r--js/tests/services/persistenceSpec.coffee2
6 files changed, 12 insertions, 10 deletions
diff --git a/js/app/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee
index 2d1147b23..41e4fa07d 100644
--- a/js/app/controllers/feedcontroller.coffee
+++ b/js/app/controllers/feedcontroller.coffee
@@ -55,8 +55,9 @@ ActiveFeed, FeedType, $window) ->
# the title is some kind of exception since its always there
# and it has nothing to do with the body structure
if count > 0
- count = @_unreadCountFormatter(count)
- @_$window.document.title = 'News (' + count + ') | ownCloud'
+ titleCount = @_unreadCountFormatter(count)
+ @_$window.document.title =
+ 'News (' + titleCount + ') | ownCloud'
else
@_$window.document.title = 'News | ownCloud'
return count
diff --git a/js/app/services/businesslayer/feedbusinesslayer.coffee b/js/app/services/businesslayer/feedbusinesslayer.coffee
index 804b68423..796a6a6eb 100644
--- a/js/app/services/businesslayer/feedbusinesslayer.coffee
+++ b/js/app/services/businesslayer/feedbusinesslayer.coffee
@@ -26,7 +26,7 @@ angular.module('News').factory 'FeedBusinessLayer',
'ItemModel', 'FeedModel', 'NewLoading', '_ExistsError', 'Utils', '$rootScope',
'UndoQueue', 'NewestItem',
(_BusinessLayer, ShowAll, Persistence, ActiveFeed, FeedType, ItemModel,
-FeedModel, NewLoading, _ExistsError, Utils, $rootScope, UndoQueue, NewestItem) ->
+FeedModel, NewLoading, _ExistsError, Utils, $rootScope, UndoQueue, NewestItem)->
class FeedBusinessLayer extends _BusinessLayer
@@ -185,7 +185,8 @@ FeedModel, NewLoading, _ExistsError, Utils, $rootScope, UndoQueue, NewestItem) -
url: url
folderId: 0
unreadCount: 0
- faviconLink: 'url('+@_utils.imagePath('core', 'loading.gif')+')'
+ faviconLink: 'url(' +
+ @_utils.imagePath('core', 'loading.gif') + ')'
@_feedModel.add(feed)
diff --git a/js/app/services/businesslayer/itembusinesslayer.coffee b/js/app/services/businesslayer/itembusinesslayer.coffee
index 6d12661ff..7a2063a97 100644
--- a/js/app/services/businesslayer/itembusinesslayer.coffee
+++ b/js/app/services/businesslayer/itembusinesslayer.coffee
@@ -109,7 +109,7 @@ StarredBusinessLayer, NewestItem) ->
size = @_itemModel.size()
if size != 0
@_persistence.getItems @_activeFeed.getType(),
- @_activeFeed.getId(),
+ @_activeFeed.getId(),
size,
@_newestItem.getId(),
callback
diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee
index 8eea196db..92ced046b 100644
--- a/js/app/services/persistence.coffee
+++ b/js/app/services/persistence.coffee
@@ -69,7 +69,7 @@ $rootScope) ->
loading.decrease()
params =
- data:
+ data:
limit: @_config.itemBatchSize
offset: offset
id: id
diff --git a/js/public/app.js b/js/public/app.js
index 80a678995..e38c84d59 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -425,12 +425,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this._$scope.starredBusinessLayer = this._starredBusinessLayer;
this._$scope.unreadCountFormatter = this._unreadCountFormatter;
this._$scope.getTotalUnreadCount = function() {
- var count;
+ var count, titleCount;
count = _this._subscriptionsBusinessLayer.getUnreadCount(0);
if (count > 0) {
- count = _this._unreadCountFormatter(count);
- _this._$window.document.title = 'News (' + count + ') | ownCloud';
+ titleCount = _this._unreadCountFormatter(count);
+ _this._$window.document.title = 'News (' + titleCount + ') | ownCloud';
} else {
_this._$window.document.title = 'News | ownCloud';
}
diff --git a/js/tests/services/persistenceSpec.coffee b/js/tests/services/persistenceSpec.coffee
index 91d732c5e..b0a057d16 100644
--- a/js/tests/services/persistenceSpec.coffee
+++ b/js/tests/services/persistenceSpec.coffee
@@ -60,7 +60,7 @@ describe 'Persistence', ->
onSuccess: ->
@Persistence.getItems(params.data.type, params.data.id,
- params.data.offset, params.data.newestItemId,
+ params.data.offset, params.data.newestItemId,
params.onSuccess)
expected =