PageSourceSearch

https://lamanova.com/css/galleria.classic.js

js lamanova.com collected 2026-10-02 10:19:46 UTC 3,083 bytes, 102 lines download raw bytes

vendor: 3,083 bytes, lines 1-102
1/**
2 * Galleria Classic Theme 2017-02-13
3 * http://galleria.io
4 *
5 * Copyright (c) 2010 - 2017 worse is better UG
6 * Licensed under the MIT license
7 * https://raw.github.com/worseisbetter/galleria/master/LICENSE
8 *
9 */
10
11(function($) {
12
13/*global window, jQuery, Galleria */
14
15Galleria.addTheme({
16    name: 'classic',
17    version: 1.5,
18    author: 'Galleria',
19    css: 'galleria.classic.css',
20    defaults: {
21        transition: 'slide',
22        thumbCrop:  'height',
23
24        // set this to false if you want to show the caption all the time:
25        _toggleInfo: true
26    },
27    init: function(options) {
28
29        Galleria.requires(1.4, 'This version of Classic theme requires Galleria 1.4 or later');
30
31        // add some elements
32        this.addElement('info-link','info-close');
33        this.append({
34            'info' : ['info-link','info-close']
35        });
36
37        // cache some stuff
38        var info = this.$('info-link,info-close,info-text'),
39            touch = Galleria.TOUCH;
40
41        // show loader & counter with opacity
42        this.$('loader,counter').show().css('opacity', 0.4);
43
44        // some stuff for non-touch browsers
45        if (! touch ) {
46            this.addIdleState( this.get('image-nav-left'), { left:-50 });
47            this.addIdleState( this.get('image-nav-right'), { right:-50 });
48            this.addIdleState( this.get('counter'), { opacity:0 });
49        }
50
51        // toggle info
52        if ( options._toggleInfo === true ) {
53            info.bind( 'click:fast', function() {
54                info.toggle();
55            });
56        } else {
57            info.show();
58            this.$('info-link, info-close').hide();
59        }
60
61        // bind some stuff
62        this.bind('thumbnail', function(e) {
63
64            if (! touch ) {
65                // fade thumbnails
66                $(e.thumbTarget).css('opacity', 0.6).parent().hover(function() {
67                    $(this).not('.active').children().stop().fadeTo(100, 1);
68                }, function() {
69                    $(this).not('.active').children().stop().fadeTo(400, 0.6);
70                });
71
72                if ( e.index === this.getIndex() ) {
73                    $(e.thumbTarget).css('opacity',1);
74                }
75            } else {
76                $(e.thumbTarget).css('opacity', this.getIndex() ? 1 : 0.6).bind('click:fast', function() {
77                    $(this).css( 'opacity', 1 ).parent().siblings().children().css('opacity', 0.6);
78                });
79            }
80        });
81
82        var activate = function(e) {
83            $(e.thumbTarget).css('opacity',1).parent().siblings().children().css('opacity', 0.6);
84        };
85
86        this.bind('loadstart', function(e) {
87            if (!e.cached) {
88                this.$('loader').show().fadeTo(200, 0.4);
89            }
90            window.setTimeout(function() {
91                activate(e);
92            }, touch ? 300 : 0);
93            this.$('info').toggle( this.hasInfo() );
94        });
95
96        this.bind('loadfinish', function(e) {
97            this.$('loader').fadeOut(200);
98        });
99    }
100});
101
102}(jQuery));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.