From d9f1aca951fb83d870d8abbcc30244441dd2a442 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 16 Sep 2013 20:20:23 +0200 Subject: version bump --- CHANGELOG | 3 +++ appinfo/info.xml | 2 +- appinfo/version | 2 +- js/app/controllers/feedcontroller.coffee | 9 +++++++-- js/app/directives/translate.coffee | 7 +++---- js/public/app.js | 19 +++++++++++-------- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ba4f9df01..04dde23e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +owncloud-news (1.603) +* Fix JavaScript errors which prevented the translation elements from being removed + owncloud-news (1.602) * Remove removed class from container * Go back to allow feeds per url from input diff --git a/appinfo/info.xml b/appinfo/info.xml index bea430ab0..d1b69d89a 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,6 +5,6 @@ An RSS/Atom feed reader. Requires the App Framework app and backgroundjobs need to be enabled. See the README.rst in the apps top directory AGPL Alessandro Cosentino, Bernhard Posselt, Jan-Christoph Borchardt. Powered by SimplePie (Ryan Parman, Geoffrey Sneddon, Ryan McCue and contributors). - 1.602 + 1.603 5.0.6 diff --git a/appinfo/version b/appinfo/version index 941cb68c0..86def1b20 100644 --- a/appinfo/version +++ b/appinfo/version @@ -1 +1 @@ -1.602 \ No newline at end of file +1.603 \ No newline at end of file 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