diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index c1292161..ece34127 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -682,8 +682,9 @@ module.controller('FeedListCtrl', [ 'FeedService', 'CategoryService', 'AnalyticsService', + 'MobileService', function($scope, $stateParams, $http, $route, $state, $window, $timeout, $location, EntryService, SettingsService, FeedService, - CategoryService, AnalyticsService) { + CategoryService, AnalyticsService, MobileService) { $window = angular.element($window); AnalyticsService.track(); @@ -702,6 +703,7 @@ module.controller('FeedListCtrl', [ $scope.font_size = 0; $scope.settingsService = SettingsService; + $scope.MobileService = MobileService; $scope.$watch('settingsService.settings.readingMode', function(newValue, oldValue) { if (newValue && oldValue && newValue != oldValue) { $scope.$emit('emitReload'); diff --git a/src/main/webapp/js/filters.js b/src/main/webapp/js/filters.js index e9341b4e..87e2c9a1 100644 --- a/src/main/webapp/js/filters.js +++ b/src/main/webapp/js/filters.js @@ -39,6 +39,26 @@ module.filter('iframeHttpsRewrite', function() { }; }); +/** + * inserts title or alt-text after images, if any + */ +module.filter('appendImageTitles', function() { + return function(html) { + var result = html; + var wrapper = $('
').html(html); + $('img', wrapper).each(function(i, elem) { + var e = $(elem); + var title = e.attr('title') || e.attr('alt'); + if (title) { + var text = $('').text(title); + e.after(text); + } + }); + result = wrapper.html(); + return result; + }; +}); + /** * escapes the url */ diff --git a/src/main/webapp/templates/feeds.view.html b/src/main/webapp/templates/feeds.view.html index f13ebc7c..3f943a11 100644 --- a/src/main/webapp/templates/feeds.view.html +++ b/src/main/webapp/templates/feeds.view.html @@ -56,7 +56,9 @@