Fix TINYIB_EXPANDWIDTH

Resolves #211.
This commit is contained in:
Trevor Slocum 2021-05-04 17:12:44 -07:00
parent 7202b733af
commit fbea1d4140

View File

@ -433,12 +433,12 @@ function buildPost($post, $res) {
$dimensions = 'width="' . $post['image_width'] . '" height="' . $post['image_height'] . '"'; $dimensions = 'width="' . $post['image_width'] . '" height="' . $post['image_height'] . '"';
} }
$expandhtml = <<<EOF $expandhtml = <<<EOF
<video $dimensions style="position: static; pointer-events: inherit; display: inline; max-width: $w%; max-height: 100%;" controls autoplay loop> <video $dimensions style="position: static; pointer-events: inherit; display: inline; max-width: {$w}vw; height: auto; max-height: 100%;" controls autoplay loop>
<source src="$direct_link"></source> <source src="$direct_link"></source>
</video> </video>
EOF; EOF;
} else if (in_array(substr($post['file'], -4), array('.jpg', '.png', '.gif'))) { } else if (in_array(substr($post['file'], -4), array('.jpg', '.png', '.gif'))) {
$expandhtml = "<a href=\"$direct_link\" onclick=\"return expandFile(event, '${post['id']}');\"><img src=\"" . ($res == TINYIB_RESPAGE ? "../" : "") . "src/${post["file"]}\" width=\"${post["image_width"]}\" style=\"max-width: $w%;height: auto;\"></a>"; $expandhtml = "<a href=\"$direct_link\" onclick=\"return expandFile(event, '${post['id']}');\"><img src=\"" . ($res == TINYIB_RESPAGE ? "../" : "") . "src/${post["file"]}\" width=\"${post["image_width"]}\" style=\"max-width: {$w}vw;height: auto;\"></a>";
} }
$thumblink = "<a href=\"$direct_link\" target=\"_blank\"" . ((isEmbed($post["file_hex"]) || in_array(substr($post['file'], -4), array('.jpg', '.png', '.gif', 'webm', '.mp4'))) ? " onclick=\"return expandFile(event, '${post['id']}');\"" : "") . ">"; $thumblink = "<a href=\"$direct_link\" target=\"_blank\"" . ((isEmbed($post["file_hex"]) || in_array(substr($post['file'], -4), array('.jpg', '.png', '.gif', 'webm', '.mp4'))) ? " onclick=\"return expandFile(event, '${post['id']}');\"" : "") . ">";