feat(/): add live image preview when user hovers the image file name (only when the number of files in current folder less than 500 files) (#244)

Co-authored-by: Prasath Mani <prasathmani@users.noreply.github.com>
This commit is contained in:
Nguyen The Anh 2020-01-14 21:14:52 +09:00 committed by Prasath Mani
parent 4905e5c61c
commit 0319b7b102

View file

@ -1870,9 +1870,12 @@ $all_files_size = 0;
<label class="custom-control-label" for="<?php echo $ik ?>"></label>
</div>
</td><?php endif; ?>
<td>
<td class="file-name-col">
<div class="filename"><a href="<?php echo $filelink ?>" title="File info"><i class="<?php echo $img ?>"></i> <?php echo fm_convert_win($f) ?>
</a><?php echo($is_link ? ' &rarr; <i>' . readlink($path . '/' . $f) . '</i>' : '') ?></div>
<?php if ($num_files < 500 && in_array(strtolower(pathinfo($f, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg'))): ?>
<img src="<?php echo fm_enc(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f) ?>" alt="" class="live-preview-img">
<?php endif; ?>
</td>
<td><span title="<?php printf('%s bytes', $filesize_raw) ?>">
<?php echo $filesize; ?>