summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDave Z <[email protected]>2018-02-07 16:57:32 +0000
committerDave Z <[email protected]>2018-02-07 16:57:32 +0000
commitd92fcaa9c86509265118201d8b9d2ab82f0fdb42 (patch)
tree934747e6d9637501ebe5fa50fde823bf9f694b0a /plugins
parentfc756975abf749fb927550555b533040e94ac6f7 (diff)
af_comics: Workaround for GoComics' lazy loading images in srcset.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/af_comics/init.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php
index 255ae7239..d59a654d7 100755
--- a/plugins/af_comics/init.php
+++ b/plugins/af_comics/init.php
@@ -126,6 +126,15 @@ class Af_Comics extends Plugin {
if ($node) {
$node->removeAttribute("width");
+ if ($node->hasAttribute("srcset") && preg_match("|/transparent\.png$|", $node->getAttribute("srcset"))) {
+ if ($node->hasAttribute("data-srcset")) {
+ $node->setAttribute("srcset", $node->getAttribute("data-srcset"));
+ $node->removeAttribute("data-srcset");
+ } elseif ($node->hasAttribute("src")) {
+ $node->remoteAttribute("srcset");
+ }
+ }
+
$tpl->setVariable('ARTICLE_ID', $article_link, true);
$tpl->setVariable('ARTICLE_LINK', $article_link, true);
$tpl->setVariable('ARTICLE_TITLE', date('l, F d, Y'), true);