From d9f1aca951fb83d870d8abbcc30244441dd2a442 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 16 Sep 2013 20:20:23 +0200 Subject: version bump --- js/app/controllers/feedcontroller.coffee | 9 +++++++-- js/app/directives/translate.coffee | 7 +++---- js/public/app.js | 19 +++++++++++-------- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'js') diff --git a/js/app/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee index 07fb22238..6ccc494fa 100644 --- a/js/app/controllers/feedcontroller.coffee +++ b/js/app/controllers/feedcontroller.coffee @@ -54,11 +54,16 @@ ActiveFeed, FeedType, $window) -> # dont do this for other dom elements # the title is some kind of exception since its always there # and it has nothing to do with the body structure + if @_$scope.translations and @_$scope.translations.appName + appName = @_$scope.translations.appName + else + appName = '' + if count > 0 titleCount = @_unreadCountFormatter(count) - title = @_$scope.translations.appName + ' (' + titleCount + ') | ownCloud' + title = appName + ' (' + titleCount + ') | ownCloud' else - title = @_$scope.translations.appName + ' | ownCloud' + title = appName + ' | ownCloud' # only update title when it changed to prevent highlighting the # tab diff --git a/js/app/directives/translate.coffee b/js/app/directives/translate.coffee index c3e2dfd47..29cb8153f 100644 --- a/js/app/directives/translate.coffee +++ b/js/app/directives/translate.coffee @@ -26,7 +26,6 @@ angular.module('News').directive 'newsTranslate', -> directive = restrict: 'E' link: (scope, element, attributes) -> - $element = $(element) - scope.translations or= scope.translations - scope.translations[attributes.key] = $element.text() - $element.remove() + scope.translations = scope.translations || {} + scope.translations[attributes.key] = element.text() + element.remove() diff --git a/js/public/app.js b/js/public/app.js index 751834832..9ec1a71de 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -508,11 +508,9 @@ License along with this library. If not, see . return directive = { restrict: 'E', link: function(scope, element, attributes) { - var $element; - $element = $(element); - scope.translations || (scope.translations = scope.translations); - scope.translations[attributes.key] = $element.text(); - return $element.remove(); + scope.translations = scope.translations || {}; + scope.translations[attributes.key] = element.text(); + return element.remove(); } }; }); @@ -682,13 +680,18 @@ License along with this library. If not, see . this._$scope.starredBusinessLayer = this._starredBusinessLayer; this._$scope.unreadCountFormatter = this._unreadCountFormatter; this._$scope.getTotalUnreadCount = function() { - var count, title, titleCount; + var appName, count, title, titleCount; count = _this._subscriptionsBusinessLayer.getUnreadCount(0); + if (_this._$scope.translations && _this._$scope.translations.appName) { + appName = _this._$scope.translations.appName; + } else { + appName = ''; + } if (count > 0) { titleCount = _this._unreadCountFormatter(count); - title = _this._$scope.translations.appName + ' (' + titleCount + ') | ownCloud'; + title = appName + ' (' + titleCount + ') | ownCloud'; } else { - title = _this._$scope.translations.appName + ' | ownCloud'; + title = appName + ' | ownCloud'; } if (_this._$window.document.title !== title) { _this._$window.document.title = title; -- cgit v1.2.3