diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/images.tmpl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/templates/images.tmpl b/templates/images.tmpl index a54bef2..7de8bd3 100644 --- a/templates/images.tmpl +++ b/templates/images.tmpl @@ -2,12 +2,17 @@ #def header: images #extends templates.base #def head +<script type="text/javascript" src="${settings.virtual_root}s/jquery-2.1.0.min.js"></script> +<script type="text/javascript" src="${settings.virtual_root}s/jquery.lazyload.min.js"></script> <script type="text/javascript"> function thumb_onerror(img) { var no_thumb = '${settings.virtual_root}s/no-thumbnail.png'; if(img.src != no_thumb) img.src = no_thumb; } + \$(function() { + \$('img.lazy').lazyload(); + }); </script> #end def #def content @@ -15,7 +20,7 @@ #if len($files) <div class="image-list"> #for file in $files - <div class="image">$file.image_html</div> + <div class="image"><a href="${settings.virtual_root}f/${file.hash}${file.ext}" title="$file.filename"><img class="lazy" data-original="${settings.virtual_root}t/$file.hash" alt="$file.filename" onerror="thumb_onerror(this)" /><noscript><img src="${settings.virtual_root}t/$file.hash" alt="$file.filename" /></noscript></a></div> #end for </div> #else |