summaryrefslogtreecommitdiffstats
path: root/js/public
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-18 16:08:22 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-18 16:08:22 +0200
commitfd8a57477e76ee670338885f5a79fbda1f1391bd (patch)
treee61e98023a339cd95ab263a5a896d54358b4fc28 /js/public
parentdaa2c7dea555b334ffb7516f8af64ad1d090f39b (diff)
show unread count in title, fix #64
Diffstat (limited to 'js/public')
-rw-r--r--js/public/app.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/js/public/app.js b/js/public/app.js
index 6e3967a24..f5a062f63 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -314,11 +314,11 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
(function() {
angular.module('News').controller('FeedController', [
- '$scope', '_ExistsError', 'Persistence', 'FolderBusinessLayer', 'FeedBusinessLayer', 'SubscriptionsBusinessLayer', 'StarredBusinessLayer', 'unreadCountFormatter', 'ActiveFeed', 'FeedType', function($scope, _ExistsError, Persistence, FolderBusinessLayer, FeedBusinessLayer, SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter, ActiveFeed, FeedType) {
+ '$scope', '_ExistsError', 'Persistence', 'FolderBusinessLayer', 'FeedBusinessLayer', 'SubscriptionsBusinessLayer', 'StarredBusinessLayer', 'unreadCountFormatter', 'ActiveFeed', 'FeedType', '$window', function($scope, _ExistsError, Persistence, FolderBusinessLayer, FeedBusinessLayer, SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter, ActiveFeed, FeedType, $window) {
var FeedController;
FeedController = (function() {
- function FeedController(_$scope, _persistence, _folderBusinessLayer, _feedBusinessLayer, _subscriptionsBusinessLayer, _starredBusinessLayer, _unreadCountFormatter, _activeFeed, _feedType) {
+ function FeedController(_$scope, _persistence, _folderBusinessLayer, _feedBusinessLayer, _subscriptionsBusinessLayer, _starredBusinessLayer, _unreadCountFormatter, _activeFeed, _feedType, _$window) {
var _this = this;
this._$scope = _$scope;
@@ -330,6 +330,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this._unreadCountFormatter = _unreadCountFormatter;
this._activeFeed = _activeFeed;
this._feedType = _feedType;
+ this._$window = _$window;
this._isAddingFolder = false;
this._isAddingFeed = false;
this._$scope.folderBusinessLayer = this._folderBusinessLayer;
@@ -337,6 +338,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this._$scope.subscriptionsBusinessLayer = this._subscriptionsBusinessLayer;
this._$scope.starredBusinessLayer = this._starredBusinessLayer;
this._$scope.unreadCountFormatter = this._unreadCountFormatter;
+ this._$scope.getTotalUnreadCount = function() {
+ var count;
+
+ count = _this._subscriptionsBusinessLayer.getUnreadCount(0);
+ if (count > 0) {
+ _this._$window.document.title = 'News (' + count + ') | ownCloud';
+ } else {
+ _this._$window.document.title = 'News | ownCloud';
+ }
+ return count;
+ };
this._$scope.isAddingFolder = function() {
return _this._isAddingFolder;
};
@@ -410,7 +422,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
return FeedController;
})();
- return new FeedController($scope, Persistence, FolderBusinessLayer, FeedBusinessLayer, SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter, ActiveFeed, FeedType);
+ return new FeedController($scope, Persistence, FolderBusinessLayer, FeedBusinessLayer, SubscriptionsBusinessLayer, StarredBusinessLayer, unreadCountFormatter, ActiveFeed, FeedType, $window);
}
]);