display title texts for images on mobile (fix #585)

This commit is contained in:
Athou
2014-04-21 09:47:26 +02:00
parent 1a9a80c0da
commit 4b46aa08ac
3 changed files with 38 additions and 8 deletions

View File

@@ -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');

View File

@@ -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 = $('<div></div>').html(html);
$('img', wrapper).each(function(i, elem) {
var e = $(elem);
var title = e.attr('title') || e.attr('alt');
if (title) {
var text = $('<span style="font-style: italic;"></span>').text(title);
e.after(text);
}
});
result = wrapper.html();
return result;
};
});
/**
* escapes the url
*/