diff options
| author | 2014-08-02 19:57:15 +0200 | |
|---|---|---|
| committer | 2014-08-02 19:57:15 +0200 | |
| commit | 274c8096e3ccc8ea008c1a038134ffddc302fd0d (patch) | |
| tree | bec4006e995fa2e25026631b9a686149ae978956 /app/views/helpers/view | |
| parent | 6bbf7d51cf19203517b5b0d3ba20b1cc30eb7628 (diff) | |
Experimental: Removed lazyload.js and use postpone attribute instead
https://github.com/marienfressinaud/FreshRSS/issues/316
The performance of lazyload.js was not good enough, and not really
needed anyway.
This change mostly affects mainly situations when the content of
articles is shown by default, not so much when they are collapsed
Using HTML5 lazyload and postpone attributes by default on all img,
audio, iframe, video.
http://www.w3.org/TR/resource-priorities/#attr-postpone
Postpone attribute is removed by JavaScript if the user does not want
the lazyload behaviour.
In the case when users do want the lazyload behaviour, in normal view
with articles hidden, we furthermore use the data-original approach to
be sure to support current browsers.
+Corrected some bugs with enclosures, and some images not appearing
before the first scroll.
+Now faster regex processing img and iframe at once (was not practical
with lazyload.js)
Diffstat (limited to 'app/views/helpers/view')
| -rw-r--r-- | app/views/helpers/view/normal_view.phtml | 10 | ||||
| -rw-r--r-- | app/views/helpers/view/reader_view.phtml | 18 |
2 files changed, 9 insertions, 19 deletions
diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 6f172d579..55ef6bdf6 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -92,13 +92,9 @@ if (!empty($this->entries)) { <div class="content <?php echo $content_width; ?>"> <h1 class="title"><a target="_blank" href="<?php echo $item->link (); ?>"><?php echo $item->title (); ?></a></h1> <?php - $author = $item->author (); - echo $author != '' ? '<div class="author">' . Minz_Translate::t ('by_author', $author) . '</div>' : ''; - if ($lazyload) { - echo $hidePosts ? lazyIframe(lazyimg($item->content())) : lazyimg($item->content()); - } else { - echo $item->content(); - } + $author = $item->author(); + echo $author != '' ? '<div class="author">' . Minz_Translate::t('by_author', $author) . '</div>' : '', + $lazyload && $hidePosts ? lazyimg($item->content()) : $item->content(); ?> </div> <ul class="horizontal-list bottom"><?php diff --git a/app/views/helpers/view/reader_view.phtml b/app/views/helpers/view/reader_view.phtml index e37c78cb4..665f72849 100644 --- a/app/views/helpers/view/reader_view.phtml +++ b/app/views/helpers/view/reader_view.phtml @@ -21,19 +21,13 @@ if (!empty($this->entries)) { </a> <h1 class="title"><?php echo $item->title (); ?></h1> - <div class="author"> - <?php $author = $item->author (); ?> - <?php echo $author != '' ? Minz_Translate::t ('by_author', $author) . ' — ' : ''; ?> - <?php echo $item->date (); ?> - </div> + <div class="author"><?php + $author = $item->author(); + echo $author != '' ? Minz_Translate::t('by_author', $author) . ' — ' : '', + $item->date(); + ?></div> - <?php - if ($lazyload) { - echo lazyimg($item->content ()); - } else { - echo $item->content(); - } - ?> + <?php echo $item->content(); ?> </div> </div> </div> |
