oupala/apaxy

lightGallery integration for display images in colorobox-like mode

Closed this issue · 14 comments

lightGallery very nice work with apaxy.

Just add this in header.html:

<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.3.9/css/lightgallery.min.css" /> 

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.3.9/js/lightgallery.min.js"></script>

<script type="text/javascript">
$(document).ready(function () {
    var imageSelector = [
        '.indexcolname a:contains(".jpg"):not(:contains(".json"))',
        '.indexcolname a:contains(".jpeg"):not(:contains(".json"))',
        '.indexcolname a:contains(".png"):not(:contains(".json"))',
    ].join(', ');

    var $table = $('table'),
        $images = $table.find(imageSelector);

    if ($table.length && $images.length) {
        $table.lightGallery({
            selector: imageSelector,
            mode: 'lg-fade',
            download: true
        });
    }
});
</script>

Nice work @UksusoFF with this script added to header.html. Thanks , i really like it!
I'm wondering if is there any way to add a zoom functionality to the script for photos that are at high resolution?
Anyway it's an improvement!

Thanks a lot! it worked, but now that i found such interesting info about lightGallery i was wondering if i can activate the Thumbnails plugin. While i've tried a lot of things i couldn't manage to make it work. This is what i used

    if ($table.length && $images.length) {
        $table.lightGallery({                      
            selector: imageSelector,
            mode: 'lg-fade',
            download: true,                        
<------>    zoom: true,                            
<------>    fullScreen: true,                      
<------>    autoplay: false,                       
<------>    actualSize: true,                      
<------>    progressBar: true,                     
<------>    fourceAutoplay: false,                 
<------>    thumbnail: true,
<------>    animateThumb: false,
<------>    showThumbByDefault: false
        });
    }
}); 

The gallery button does show up, and rise the gallery Thumbs but no image is displayed in Thumbs, and when i verified the source i saw this:
<img src="undefined">
What am i missing here? Any help will be appreciated!
Thanks again @UksusoFF for your time

Zoom and thumbnail functions is separate plugin file. Did you include this? http://sachinchoolur.github.io/lightGallery/docs/#include-files

@oupala which help needed?

I don't think that really need include this feature to master. Maybe just create readme section with helpful snippets and link to this and other optional issues.

I would have proposed to turn this issue into a pull request.

But if you don't think this should be included into master, it could be included in documentation.

Does anyone has an opinion about that?

I tested this feature and I like it.

The question is: is apaxy an image viewer or a file viewer? I think you have already answered this question is this post:

I don't think that really need include this feature to master.

But, if we find an elegant solution to integrate it to the code, while only enabling it for those who want to it could be a great thing.

Main problem is that we don't like external resources (as in #59) as they leads to problems:

Some advantages [of not linking external resources]: No cross-site requests, no leaking of HTTP Referers to font provider, works on LAN-only setups, no dependency on an external service, only 1 connection initiated.

So if we choose not to link external resources, we have only two choices:

  • statically copying the resources
  • a (bash) script that build a version of apaxy that embeds external resource (that become statically linked at build time)

None of these solution are satisfying myself...

(but I like this feature, so...) (but I also like the simplicity of apaxy) (big dilemma for me)

I think this is a really nice feature, but I don't think that's what apaxy was meant to be. Even #109, the pull request I'm working on pushes what I imagine the original vision for apaxy being. But hey, I love the feature, and wouldn't mind seeing this at all.

I think we have to think about a very very simple way to make apaxy modular. LightGallery could be one of this module.

I'm not see easy ways how use modules.

Probably we can use SSI. But it's required module enable and still have issues with remote files.

So apaxy should use with npm package manager for use local versions required third-party.

But this can complicate quick start installation for some users.

I don't see an easy way either.

It might be commented directive that you need to uncomment to enable feature. And a shell script that downloads required libraries. This makes apaxy easy to use for beginner, and powerful for advanced users that have possibility (and knowledge) to execute a shell script.

See branch feature/lightgallery in this repo.

Now that there is a branch to explore lightgallery, let's close this issue.