Explorar o código

Merge pull request #1295 from Alkarex/Remove-resource-priorities

W3C resource-priorities have been abandonned
Alexandre Alapetite %!s(int64=9) %!d(string=hai) anos
pai
achega
d6ca6e085e
Modificáronse 4 ficheiros con 6 adicións e 11 borrados
  1. 2 0
      CHANGELOG.md
  2. 1 1
      app/Models/Feed.php
  3. 3 4
      lib/lib_rss.php
  4. 0 6
      p/scripts/main.js

+ 2 - 0
CHANGELOG.md

@@ -30,6 +30,8 @@
 * Extensions
 	* Allow extensions for default accout in anonymous mode [#1288](https://github.com/FreshRSS/FreshRSS/pull/1288)
 	* Trigger a `freshrss:load-more` JavaScript event to help extensions [#1278](https://github.com/FreshRSS/FreshRSS/issues/1278)
+* Mics.
+	* Removed *resource-priorities* attributes (`defer`, `lazyload`), deprecated by W3C [#1222](https://github.com/FreshRSS/FreshRSS/pull/1222)
 
 
 ## 2016-08-29 FreshRSS 1.5.0

+ 1 - 1
app/Models/Feed.php

@@ -309,7 +309,7 @@ class FreshRSS_Feed extends Minz_Model {
 					$elinks[$elink] = '1';
 					$mime = strtolower($enclosure->get_type());
 					if (strpos($mime, 'image/') === 0) {
-						$content .= '<p class="enclosure"><img lazyload="" src="' . $elink . '" alt="" /></p>';
+						$content .= '<p class="enclosure"><img src="' . $elink . '" alt="" /></p>';
 					} elseif (strpos($mime, 'audio/') === 0) {
 						$content .= '<p class="enclosure"><audio preload="none" src="' . $elink . '" controls="controls"></audio> <a download="" href="' . $elink . '">💾</a></p>';
 					} elseif (strpos($mime, 'video/') === 0) {

+ 3 - 4
lib/lib_rss.php

@@ -182,10 +182,9 @@ function customSimplePie() {
 		'onmouseover', 'onmousemove', 'onmouseout', 'onfocus', 'onblur',
 		'onkeypress', 'onkeydown', 'onkeyup', 'onselect', 'onchange', 'seamless', 'sizes', 'srcset')));
 	$simplePie->add_attributes(array(
-		'img' => array('lazyload' => '', 'postpone' => ''),	//http://www.w3.org/TR/resource-priorities/
-		'audio' => array('lazyload' => '', 'postpone' => '', 'preload' => 'none'),
-		'iframe' => array('lazyload' => '', 'postpone' => '', 'sandbox' => 'allow-scripts allow-same-origin'),
-		'video' => array('lazyload' => '', 'postpone' => '', 'preload' => 'none'),
+		'audio' => array('preload' => 'none'),
+		'iframe' => array('sandbox' => 'allow-scripts allow-same-origin'),
+		'video' => array('preload' => 'none'),
 	));
 	$simplePie->set_url_replacements(array(
 		'a' => 'href',

+ 0 - 6
p/scripts/main.js

@@ -1027,12 +1027,6 @@ freshrssLoadMoreEvent.initEvent('freshrss:load-more', true, true);
 function init_load_more(box) {
 	box_load_more = box;
 
-	if (!context.does_lazyload) {
-		$('img[postpone], audio[postpone], iframe[postpone], video[postpone]').each(function () {
-			this.removeAttribute('postpone');
-		});
-	}
-
 	document.body.dispatchEvent(freshrssLoadMoreEvent);
 
 	var $next_link = $("#load_more");