lightgallery-rails 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +1 -0
- data/lib/lightgallery/rails.rb +7 -0
- data/lib/lightgallery/rails/engine.rb +6 -0
- data/lib/lightgallery/rails/version.rb +5 -0
- data/vendor/assets/fonts/lightgallery/lg.eot +0 -0
- data/vendor/assets/fonts/lightgallery/lg.svg +47 -0
- data/vendor/assets/fonts/lightgallery/lg.ttf +0 -0
- data/vendor/assets/fonts/lightgallery/lg.woff +0 -0
- data/vendor/assets/images/lightgallery/loading.gif +0 -0
- data/vendor/assets/images/lightgallery/video-play.png +0 -0
- data/vendor/assets/images/lightgallery/vimeo-play.png +0 -0
- data/vendor/assets/images/lightgallery/youtube-play.png +0 -0
- data/vendor/assets/javascripts/lightgallery.autoplay.js +206 -0
- data/vendor/assets/javascripts/lightgallery.autoplay.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.fullscreen.js +116 -0
- data/vendor/assets/javascripts/lightgallery.fullscreen.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.hash.js +100 -0
- data/vendor/assets/javascripts/lightgallery.hash.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.js +1364 -0
- data/vendor/assets/javascripts/lightgallery.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.pager.js +105 -0
- data/vendor/assets/javascripts/lightgallery.pager.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.share.js +94 -0
- data/vendor/assets/javascripts/lightgallery.share.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.thumbnail.js +473 -0
- data/vendor/assets/javascripts/lightgallery.thumbnail.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.video.js +317 -0
- data/vendor/assets/javascripts/lightgallery.video.min.js +4 -0
- data/vendor/assets/javascripts/lightgallery.zoom.js +531 -0
- data/vendor/assets/javascripts/lightgallery.zoom.min.js +4 -0
- data/vendor/assets/stylesheets/lg-fb-comment-box.scss +57 -0
- data/vendor/assets/stylesheets/lg-transitions.css +779 -0
- data/vendor/assets/stylesheets/lightgallery.scss +978 -0
- metadata +104 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c0ca1996bfe26b5d5bf59f6c8f9fe8efcfc3093a
|
4
|
+
data.tar.gz: c4948e5246e43e474857baedca6b77a504193f7a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 20f9449c2836232a0a0fbbb377f5ce38f0da6eaea2f0e0ffbd48e0e8ce46dc9b6b6068fd091c468e17fee2faf42b1a8e2b426db99bb9d059535c51a9e386e21b
|
7
|
+
data.tar.gz: 18af3d6397d4124f7eb2c0fbcd3741ba5eeb072e438039b29281c16f45c40e503d3ca49aad363759ad059f79e52217a98ed5bbdef792135b2ab410ff6cb5cdf0
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
Binary file
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4
|
+
<metadata>
|
5
|
+
<json>
|
6
|
+
<![CDATA[
|
7
|
+
{
|
8
|
+
"fontFamily": "lg",
|
9
|
+
"majorVersion": 1,
|
10
|
+
"minorVersion": 0,
|
11
|
+
"fontURL": "https://github.com/sachinchoolur/lightGallery",
|
12
|
+
"copyright": "sachin",
|
13
|
+
"license": "MLT",
|
14
|
+
"licenseURL": "http://opensource.org/licenses/MIT",
|
15
|
+
"version": "Version 1.0",
|
16
|
+
"fontId": "lg",
|
17
|
+
"psName": "lg",
|
18
|
+
"subFamily": "Regular",
|
19
|
+
"fullName": "lg",
|
20
|
+
"description": "Font generated by IcoMoon."
|
21
|
+
}
|
22
|
+
]]>
|
23
|
+
</json>
|
24
|
+
</metadata>
|
25
|
+
<defs>
|
26
|
+
<font id="lg" horiz-adv-x="1024">
|
27
|
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
28
|
+
<missing-glyph horiz-adv-x="1024" />
|
29
|
+
<glyph unicode=" " horiz-adv-x="512" d="" />
|
30
|
+
<glyph unicode="" glyph-name="pause_circle_outline" data-tags="pause_circle_outline" d="M554 256.667v340h86v-340h-86zM512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM384 256.667v340h86v-340h-86z" />
|
31
|
+
<glyph unicode="" glyph-name="play_circle_outline" data-tags="play_circle_outline" d="M512 84.667q140 0 241 101t101 241-101 241-241 101-241-101-101-241 101-241 241-101zM512 852.667q176 0 301-125t125-301-125-301-301-125-301 125-125 301 125 301 301 125zM426 234.667v384l256-192z" />
|
32
|
+
<glyph unicode="" glyph-name="stack-2" data-tags="stack-2" d="M384 853.334h426.667q53 0 90.5-37.5t37.5-90.5v-426.667q0-53-37.5-90.5t-90.5-37.5h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 53 37.5 90.5t90.5 37.5zM170.667 675.334v-547.333q0-17.667 12.5-30.167t30.167-12.5h547.333q-13.333-37.667-46.333-61.5t-74.333-23.833h-426.667q-53 0-90.5 37.5t-37.5 90.5v426.667q0 41.333 23.833 74.333t61.5 46.333zM810.667 768h-426.667q-17.667 0-30.167-12.5t-12.5-30.167v-426.667q0-17.667 12.5-30.167t30.167-12.5h426.667q17.667 0 30.167 12.5t12.5 30.167v426.667q0 17.667-12.5 30.167t-30.167 12.5z" />
|
33
|
+
<glyph unicode="" glyph-name="clear" data-tags="clear" d="M810 664.667l-238-238 238-238-60-60-238 238-238-238-60 60 238 238-238 238 60 60 238-238 238 238z" />
|
34
|
+
<glyph unicode="" glyph-name="arrow-left" data-tags="arrow-left" d="M426.667 768q17.667 0 30.167-12.5t12.5-30.167q0-18-12.667-30.333l-225.667-225.667h665q17.667 0 30.167-12.5t12.5-30.167-12.5-30.167-30.167-12.5h-665l225.667-225.667q12.667-12.333 12.667-30.333 0-17.667-12.5-30.167t-30.167-12.5q-18 0-30.333 12.333l-298.667 298.667q-12.333 13-12.333 30.333t12.333 30.333l298.667 298.667q12.667 12.333 30.333 12.333z" />
|
35
|
+
<glyph unicode="" glyph-name="arrow-right" data-tags="arrow-right" d="M597.333 768q18 0 30.333-12.333l298.667-298.667q12.333-12.333 12.333-30.333t-12.333-30.333l-298.667-298.667q-12.333-12.333-30.333-12.333-18.333 0-30.5 12.167t-12.167 30.5q0 18 12.333 30.333l226 225.667h-665q-17.667 0-30.167 12.5t-12.5 30.167 12.5 30.167 30.167 12.5h665l-226 225.667q-12.333 12.333-12.333 30.333 0 18.333 12.167 30.5t30.5 12.167z" />
|
36
|
+
<glyph unicode="" glyph-name="vertical_align_bottom" data-tags="vertical_align_bottom" d="M170 128.667h684v-86h-684v86zM682 384.667l-170-172-170 172h128v426h84v-426h128z" />
|
37
|
+
<glyph unicode="" glyph-name="apps" data-tags="apps" d="M682 84.667v172h172v-172h-172zM682 340.667v172h172v-172h-172zM426 596.667v172h172v-172h-172zM682 768.667h172v-172h-172v172zM426 340.667v172h172v-172h-172zM170 340.667v172h172v-172h-172zM170 84.667v172h172v-172h-172zM426 84.667v172h172v-172h-172zM170 596.667v172h172v-172h-172z" />
|
38
|
+
<glyph unicode="" glyph-name="fullscreen" data-tags="fullscreen" d="M598 724.667h212v-212h-84v128h-128v84zM726 212.667v128h84v-212h-212v84h128zM214 512.667v212h212v-84h-128v-128h-84zM298 340.667v-128h128v-84h-212v212h84z" />
|
39
|
+
<glyph unicode="" glyph-name="fullscreen_exit" data-tags="fullscreen_exit" d="M682 596.667h128v-84h-212v212h84v-128zM598 128.667v212h212v-84h-128v-128h-84zM342 596.667v128h84v-212h-212v84h128zM214 256.667v84h212v-212h-84v128h-128z" />
|
40
|
+
<glyph unicode="" glyph-name="zoom_in" data-tags="zoom_in" d="M512 512.667h-86v-86h-42v86h-86v42h86v86h42v-86h86v-42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
|
41
|
+
<glyph unicode="" glyph-name="zoom_out" data-tags="zoom_out" d="M298 554.667h214v-42h-214v42zM406 340.667q80 0 136 56t56 136-56 136-136 56-136-56-56-136 56-136 136-56zM662 340.667l212-212-64-64-212 212v34l-12 12q-76-66-180-66-116 0-197 80t-81 196 81 197 197 81 196-81 80-197q0-104-66-180l12-12h34z" />
|
42
|
+
<glyph unicode="" glyph-name="share" data-tags="share" d="M768 252.667c68 0 124-56 124-124s-56-126-124-126-124 58-124 126c0 10 0 20 2 28l-302 176c-24-22-54-34-88-34-70 0-128 58-128 128s58 128 128 128c34 0 64-12 88-34l300 174c-2 10-4 20-4 30 0 70 58 128 128 128s128-58 128-128-58-128-128-128c-34 0-64 14-88 36l-300-176c2-10 4-20 4-30s-2-20-4-30l304-176c22 20 52 32 84 32z" />
|
43
|
+
<glyph unicode="" glyph-name="facebook-with-circle" data-tags="facebook-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM628.429 612.659h-73.882c-8.755 0-18.483-11.52-18.483-26.829v-53.35h92.416l-13.978-76.083h-78.438v-228.403h-87.194v228.403h-79.104v76.083h79.104v44.749c0 64.205 44.544 116.378 105.677 116.378h73.882v-80.947z" />
|
44
|
+
<glyph unicode="" glyph-name="google-with-circle" data-tags="google+-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM483.686 249.805c-30.874-15.002-64.102-16.589-76.954-16.589-2.458 0-3.84 0-3.84 0s-1.178 0-2.765 0c-20.070 0-119.962 4.608-119.962 95.59 0 89.395 108.8 96.41 142.131 96.41h0.87c-19.251 25.702-15.258 51.61-15.258 51.61-1.69-0.102-4.147-0.205-7.168-0.205-12.544 0-36.762 1.997-57.549 15.411-25.498 16.384-38.4 44.288-38.4 82.893 0 109.107 119.142 113.51 120.32 113.613h118.989v-2.611c0-13.312-23.91-15.923-40.192-18.125-5.53-0.819-16.64-1.894-19.763-3.482 30.157-16.128 35.021-41.421 35.021-79.104 0-42.906-16.794-65.587-34.611-81.51-11.059-9.882-19.712-17.613-19.712-28.006 0-10.189 11.878-20.582 25.702-32.717 22.579-19.917 53.555-47.002 53.555-92.723 0-47.258-20.326-81.050-60.416-100.454zM742.4 460.8h-76.8v-76.8h-51.2v76.8h-76.8v51.2h76.8v76.8h51.2v-76.8h76.8v-51.2zM421.018 401.92c-2.662 0-5.325-0.102-8.038-0.307-22.733-1.69-43.725-10.189-58.88-24.013-15.053-13.619-22.733-30.822-21.658-48.179 2.304-36.403 41.37-57.702 88.832-54.323 46.694 3.379 77.824 30.31 75.571 66.714-2.15 34.202-31.898 60.109-75.827 60.109zM465.766 599.808c-12.39 43.52-32.358 56.422-63.386 56.422-3.328 0-6.707-0.512-9.933-1.382-13.466-3.84-24.166-15.053-30.106-31.744-6.093-16.896-6.451-34.509-1.229-54.579 9.472-35.891 34.97-61.901 60.672-61.901 3.379 0 6.758 0.41 9.933 1.382 28.109 7.885 45.722 50.79 34.048 91.802z" />
|
45
|
+
<glyph unicode="" glyph-name="pinterest-with-circle" data-tags="pinterest-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM545.638 344.32c-31.539 2.406-44.749 18.022-69.427 32.973-13.568-71.219-30.157-139.52-79.309-175.206-15.206 107.725 22.221 188.518 39.629 274.381-29.645 49.92 3.533 150.323 66.099 125.645 76.954-30.515-66.662-185.6 29.747-205.005 100.659-20.173 141.773 174.694 79.36 237.978-90.214 91.494-262.502 2.099-241.306-128.87 5.12-32 38.246-41.728 13.21-85.914-57.702 12.8-74.957 58.317-72.704 118.989 3.533 99.328 89.242 168.909 175.155 178.483 108.698 12.083 210.688-39.885 224.819-142.182 15.821-115.405-49.101-240.282-165.274-231.27z" />
|
46
|
+
<glyph unicode="" glyph-name="twitter-with-circle" data-tags="twitter-with-circle" d="M512 952.32c-271.462 0-491.52-220.058-491.52-491.52s220.058-491.52 491.52-491.52 491.52 220.058 491.52 491.52-220.058 491.52-491.52 491.52zM711.936 549.683c0.205-4.198 0.256-8.397 0.256-12.493 0-128-97.331-275.507-275.405-275.507-54.682 0-105.574 15.974-148.378 43.52 7.526-0.922 15.258-1.28 23.091-1.28 45.363 0 87.091 15.411 120.218 41.421-42.342 0.819-78.080 28.774-90.419 67.174 5.888-1.075 11.93-1.69 18.176-1.69 8.806 0 17.408 1.178 25.498 3.379-44.288 8.909-77.67 48.026-77.67 94.925v1.178c13.056-7.219 28.006-11.622 43.878-12.134-26.010 17.408-43.059 47.002-43.059 80.64 0 17.715 4.762 34.406 13.107 48.691 47.77-58.573 119.040-97.075 199.526-101.222-1.69 7.117-2.509 14.49-2.509 22.118 0 53.402 43.315 96.819 96.819 96.819 27.802 0 52.992-11.776 70.656-30.618 22.067 4.403 42.752 12.39 61.44 23.501-7.219-22.579-22.528-41.574-42.547-53.606 19.61 2.406 38.246 7.578 55.603 15.309-12.954-19.405-29.389-36.506-48.282-50.125z" />
|
47
|
+
</font></defs></svg>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,206 @@
|
|
1
|
+
/*! lg-autoplay - v1.0.4 - 2017-03-28
|
2
|
+
* http://sachinchoolur.github.io/lightGallery
|
3
|
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
4
|
+
|
5
|
+
(function (root, factory) {
|
6
|
+
if (typeof define === 'function' && define.amd) {
|
7
|
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
8
|
+
define(['jquery'], function (a0) {
|
9
|
+
return (factory(a0));
|
10
|
+
});
|
11
|
+
} else if (typeof exports === 'object') {
|
12
|
+
// Node. Does not work with strict CommonJS, but
|
13
|
+
// only CommonJS-like environments that support module.exports,
|
14
|
+
// like Node.
|
15
|
+
module.exports = factory(require('jquery'));
|
16
|
+
} else {
|
17
|
+
factory(jQuery);
|
18
|
+
}
|
19
|
+
}(this, function ($) {
|
20
|
+
|
21
|
+
|
22
|
+
(function() {
|
23
|
+
|
24
|
+
'use strict';
|
25
|
+
|
26
|
+
var defaults = {
|
27
|
+
autoplay: false,
|
28
|
+
pause: 5000,
|
29
|
+
progressBar: true,
|
30
|
+
fourceAutoplay: false,
|
31
|
+
autoplayControls: true,
|
32
|
+
appendAutoplayControlsTo: '.lg-toolbar'
|
33
|
+
};
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Creates the autoplay plugin.
|
37
|
+
* @param {object} element - lightGallery element
|
38
|
+
*/
|
39
|
+
var Autoplay = function(element) {
|
40
|
+
|
41
|
+
this.core = $(element).data('lightGallery');
|
42
|
+
|
43
|
+
this.$el = $(element);
|
44
|
+
|
45
|
+
// Execute only if items are above 1
|
46
|
+
if (this.core.$items.length < 2) {
|
47
|
+
return false;
|
48
|
+
}
|
49
|
+
|
50
|
+
this.core.s = $.extend({}, defaults, this.core.s);
|
51
|
+
this.interval = false;
|
52
|
+
|
53
|
+
// Identify if slide happened from autoplay
|
54
|
+
this.fromAuto = true;
|
55
|
+
|
56
|
+
// Identify if autoplay canceled from touch/drag
|
57
|
+
this.canceledOnTouch = false;
|
58
|
+
|
59
|
+
// save fourceautoplay value
|
60
|
+
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
61
|
+
|
62
|
+
// do not allow progress bar if browser does not support css3 transitions
|
63
|
+
if (!this.core.doCss()) {
|
64
|
+
this.core.s.progressBar = false;
|
65
|
+
}
|
66
|
+
|
67
|
+
this.init();
|
68
|
+
|
69
|
+
return this;
|
70
|
+
};
|
71
|
+
|
72
|
+
Autoplay.prototype.init = function() {
|
73
|
+
var _this = this;
|
74
|
+
|
75
|
+
// append autoplay controls
|
76
|
+
if (_this.core.s.autoplayControls) {
|
77
|
+
_this.controls();
|
78
|
+
}
|
79
|
+
|
80
|
+
// Create progress bar
|
81
|
+
if (_this.core.s.progressBar) {
|
82
|
+
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
83
|
+
}
|
84
|
+
|
85
|
+
// set progress
|
86
|
+
_this.progress();
|
87
|
+
|
88
|
+
// Start autoplay
|
89
|
+
if (_this.core.s.autoplay) {
|
90
|
+
_this.$el.one('onSlideItemLoad.lg.tm', function() {
|
91
|
+
_this.startlAuto();
|
92
|
+
});
|
93
|
+
}
|
94
|
+
|
95
|
+
// cancel interval on touchstart and dragstart
|
96
|
+
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
97
|
+
if (_this.interval) {
|
98
|
+
_this.cancelAuto();
|
99
|
+
_this.canceledOnTouch = true;
|
100
|
+
}
|
101
|
+
});
|
102
|
+
|
103
|
+
// restore autoplay if autoplay canceled from touchstart / dragstart
|
104
|
+
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
105
|
+
if (!_this.interval && _this.canceledOnTouch) {
|
106
|
+
_this.startlAuto();
|
107
|
+
_this.canceledOnTouch = false;
|
108
|
+
}
|
109
|
+
});
|
110
|
+
|
111
|
+
};
|
112
|
+
|
113
|
+
Autoplay.prototype.progress = function() {
|
114
|
+
|
115
|
+
var _this = this;
|
116
|
+
var _$progressBar;
|
117
|
+
var _$progress;
|
118
|
+
|
119
|
+
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
120
|
+
|
121
|
+
// start progress bar animation
|
122
|
+
if (_this.core.s.progressBar && _this.fromAuto) {
|
123
|
+
_$progressBar = _this.core.$outer.find('.lg-progress-bar');
|
124
|
+
_$progress = _this.core.$outer.find('.lg-progress');
|
125
|
+
if (_this.interval) {
|
126
|
+
_$progress.removeAttr('style');
|
127
|
+
_$progressBar.removeClass('lg-start');
|
128
|
+
setTimeout(function() {
|
129
|
+
_$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
130
|
+
_$progressBar.addClass('lg-start');
|
131
|
+
}, 20);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
136
|
+
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
137
|
+
_this.cancelAuto();
|
138
|
+
}
|
139
|
+
|
140
|
+
_this.fromAuto = false;
|
141
|
+
|
142
|
+
});
|
143
|
+
};
|
144
|
+
|
145
|
+
// Manage autoplay via play/stop buttons
|
146
|
+
Autoplay.prototype.controls = function() {
|
147
|
+
var _this = this;
|
148
|
+
var _html = '<span class="lg-autoplay-button lg-icon"></span>';
|
149
|
+
|
150
|
+
// Append autoplay controls
|
151
|
+
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
152
|
+
|
153
|
+
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
154
|
+
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
155
|
+
_this.cancelAuto();
|
156
|
+
_this.core.s.fourceAutoplay = false;
|
157
|
+
} else {
|
158
|
+
if (!_this.interval) {
|
159
|
+
_this.startlAuto();
|
160
|
+
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
});
|
164
|
+
};
|
165
|
+
|
166
|
+
// Autostart gallery
|
167
|
+
Autoplay.prototype.startlAuto = function() {
|
168
|
+
var _this = this;
|
169
|
+
|
170
|
+
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
171
|
+
_this.core.$outer.addClass('lg-show-autoplay');
|
172
|
+
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
173
|
+
|
174
|
+
_this.interval = setInterval(function() {
|
175
|
+
if (_this.core.index + 1 < _this.core.$items.length) {
|
176
|
+
_this.core.index++;
|
177
|
+
} else {
|
178
|
+
_this.core.index = 0;
|
179
|
+
}
|
180
|
+
|
181
|
+
_this.fromAuto = true;
|
182
|
+
_this.core.slide(_this.core.index, false, false, 'next');
|
183
|
+
}, _this.core.s.speed + _this.core.s.pause);
|
184
|
+
};
|
185
|
+
|
186
|
+
// cancel Autostart
|
187
|
+
Autoplay.prototype.cancelAuto = function() {
|
188
|
+
clearInterval(this.interval);
|
189
|
+
this.interval = false;
|
190
|
+
this.core.$outer.find('.lg-progress').removeAttr('style');
|
191
|
+
this.core.$outer.removeClass('lg-show-autoplay');
|
192
|
+
this.core.$outer.find('.lg-progress-bar').removeClass('lg-start');
|
193
|
+
};
|
194
|
+
|
195
|
+
Autoplay.prototype.destroy = function() {
|
196
|
+
|
197
|
+
this.cancelAuto();
|
198
|
+
this.core.$outer.find('.lg-progress-bar').remove();
|
199
|
+
};
|
200
|
+
|
201
|
+
$.fn.lightGallery.modules.autoplay = Autoplay;
|
202
|
+
|
203
|
+
})();
|
204
|
+
|
205
|
+
|
206
|
+
}));
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/*! lg-autoplay - v1.0.4 - 2017-03-28
|
2
|
+
* http://sachinchoolur.github.io/lightGallery
|
3
|
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
4
|
+
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),!(this.core.$items.length<2)&&(this.core.s=a.extend({},b,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};c.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),a.progress(),a.core.s.autoplay&&a.$el.one("onSlideItemLoad.lg.tm",function(){a.startlAuto()}),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},c.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},c.prototype.controls=function(){var b=this,c='<span class="lg-autoplay-button lg-icon"></span>';a(this.core.s.appendAutoplayControlsTo).append(c),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},c.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+1<a.core.$items.length?a.core.index++:a.core.index=0,a.fromAuto=!0,a.core.slide(a.core.index,!1,!1,"next")},a.core.s.speed+a.core.s.pause)},c.prototype.cancelAuto=function(){clearInterval(this.interval),this.interval=!1,this.core.$outer.find(".lg-progress").removeAttr("style"),this.core.$outer.removeClass("lg-show-autoplay"),this.core.$outer.find(".lg-progress-bar").removeClass("lg-start")},c.prototype.destroy=function(){this.cancelAuto(),this.core.$outer.find(".lg-progress-bar").remove()},a.fn.lightGallery.modules.autoplay=c}()});
|
@@ -0,0 +1,116 @@
|
|
1
|
+
/*! lg-fullscreen - v1.0.0 - 2016-09-20
|
2
|
+
* http://sachinchoolur.github.io/lightGallery
|
3
|
+
* Copyright (c) 2016 Sachin N; Licensed GPLv3 */
|
4
|
+
|
5
|
+
(function (root, factory) {
|
6
|
+
if (typeof define === 'function' && define.amd) {
|
7
|
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
8
|
+
define([], function () {
|
9
|
+
return (factory());
|
10
|
+
});
|
11
|
+
} else if (typeof exports === 'object') {
|
12
|
+
// Node. Does not work with strict CommonJS, but
|
13
|
+
// only CommonJS-like environments that support module.exports,
|
14
|
+
// like Node.
|
15
|
+
module.exports = factory();
|
16
|
+
} else {
|
17
|
+
factory();
|
18
|
+
}
|
19
|
+
}(this, function () {
|
20
|
+
|
21
|
+
(function($, window, document, undefined) {
|
22
|
+
|
23
|
+
'use strict';
|
24
|
+
|
25
|
+
var defaults = {
|
26
|
+
fullScreen: true
|
27
|
+
};
|
28
|
+
|
29
|
+
var Fullscreen = function(element) {
|
30
|
+
|
31
|
+
// get lightGallery core plugin data
|
32
|
+
this.core = $(element).data('lightGallery');
|
33
|
+
|
34
|
+
this.$el = $(element);
|
35
|
+
|
36
|
+
// extend module defalut settings with lightGallery core settings
|
37
|
+
this.core.s = $.extend({}, defaults, this.core.s);
|
38
|
+
|
39
|
+
this.init();
|
40
|
+
|
41
|
+
return this;
|
42
|
+
};
|
43
|
+
|
44
|
+
Fullscreen.prototype.init = function() {
|
45
|
+
var fullScreen = '';
|
46
|
+
if (this.core.s.fullScreen) {
|
47
|
+
|
48
|
+
// check for fullscreen browser support
|
49
|
+
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
50
|
+
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
51
|
+
return;
|
52
|
+
} else {
|
53
|
+
fullScreen = '<span class="lg-fullscreen lg-icon"></span>';
|
54
|
+
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
55
|
+
this.fullScreen();
|
56
|
+
}
|
57
|
+
}
|
58
|
+
};
|
59
|
+
|
60
|
+
Fullscreen.prototype.requestFullscreen = function() {
|
61
|
+
var el = document.documentElement;
|
62
|
+
if (el.requestFullscreen) {
|
63
|
+
el.requestFullscreen();
|
64
|
+
} else if (el.msRequestFullscreen) {
|
65
|
+
el.msRequestFullscreen();
|
66
|
+
} else if (el.mozRequestFullScreen) {
|
67
|
+
el.mozRequestFullScreen();
|
68
|
+
} else if (el.webkitRequestFullscreen) {
|
69
|
+
el.webkitRequestFullscreen();
|
70
|
+
}
|
71
|
+
};
|
72
|
+
|
73
|
+
Fullscreen.prototype.exitFullscreen = function() {
|
74
|
+
if (document.exitFullscreen) {
|
75
|
+
document.exitFullscreen();
|
76
|
+
} else if (document.msExitFullscreen) {
|
77
|
+
document.msExitFullscreen();
|
78
|
+
} else if (document.mozCancelFullScreen) {
|
79
|
+
document.mozCancelFullScreen();
|
80
|
+
} else if (document.webkitExitFullscreen) {
|
81
|
+
document.webkitExitFullscreen();
|
82
|
+
}
|
83
|
+
};
|
84
|
+
|
85
|
+
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
86
|
+
Fullscreen.prototype.fullScreen = function() {
|
87
|
+
var _this = this;
|
88
|
+
|
89
|
+
$(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() {
|
90
|
+
_this.core.$outer.toggleClass('lg-fullscreen-on');
|
91
|
+
});
|
92
|
+
|
93
|
+
this.core.$outer.find('.lg-fullscreen').on('click.lg', function() {
|
94
|
+
if (!document.fullscreenElement &&
|
95
|
+
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {
|
96
|
+
_this.requestFullscreen();
|
97
|
+
} else {
|
98
|
+
_this.exitFullscreen();
|
99
|
+
}
|
100
|
+
});
|
101
|
+
|
102
|
+
};
|
103
|
+
|
104
|
+
Fullscreen.prototype.destroy = function() {
|
105
|
+
|
106
|
+
// exit from fullscreen if activated
|
107
|
+
this.exitFullscreen();
|
108
|
+
|
109
|
+
$(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg');
|
110
|
+
};
|
111
|
+
|
112
|
+
$.fn.lightGallery.modules.fullscreen = Fullscreen;
|
113
|
+
|
114
|
+
})(jQuery, window, document);
|
115
|
+
|
116
|
+
}));
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/*! lg-fullscreen - v1.0.0 - 2016-09-20
|
2
|
+
* http://sachinchoolur.github.io/lightGallery
|
3
|
+
* Copyright (c) 2016 Sachin N; Licensed GPLv3 */
|
4
|
+
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return b()}):"object"==typeof exports?module.exports=b():b()}(this,function(){!function(a,b,c,d){"use strict";var e={fullScreen:!0},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.init(),this};f.prototype.init=function(){var a="";if(this.core.s.fullScreen){if(!(c.fullscreenEnabled||c.webkitFullscreenEnabled||c.mozFullScreenEnabled||c.msFullscreenEnabled))return;a='<span class="lg-fullscreen lg-icon"></span>',this.core.$outer.find(".lg-toolbar").append(a),this.fullScreen()}},f.prototype.requestFullscreen=function(){var a=c.documentElement;a.requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen&&a.webkitRequestFullscreen()},f.prototype.exitFullscreen=function(){c.exitFullscreen?c.exitFullscreen():c.msExitFullscreen?c.msExitFullscreen():c.mozCancelFullScreen?c.mozCancelFullScreen():c.webkitExitFullscreen&&c.webkitExitFullscreen()},f.prototype.fullScreen=function(){var b=this;a(c).on("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg",function(){b.core.$outer.toggleClass("lg-fullscreen-on")}),this.core.$outer.find(".lg-fullscreen").on("click.lg",function(){c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement||c.msFullscreenElement?b.exitFullscreen():b.requestFullscreen()})},f.prototype.destroy=function(){this.exitFullscreen(),a(c).off("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg")},a.fn.lightGallery.modules.fullscreen=f}(jQuery,window,document)});
|
@@ -0,0 +1,100 @@
|
|
1
|
+
/*! lg-hash - v1.0.2 - 2017-06-03
|
2
|
+
* http://sachinchoolur.github.io/lightGallery
|
3
|
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
4
|
+
|
5
|
+
(function (root, factory) {
|
6
|
+
if (typeof define === 'function' && define.amd) {
|
7
|
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
8
|
+
define(['jquery'], function (a0) {
|
9
|
+
return (factory(a0));
|
10
|
+
});
|
11
|
+
} else if (typeof exports === 'object') {
|
12
|
+
// Node. Does not work with strict CommonJS, but
|
13
|
+
// only CommonJS-like environments that support module.exports,
|
14
|
+
// like Node.
|
15
|
+
module.exports = factory(require('jquery'));
|
16
|
+
} else {
|
17
|
+
factory(jQuery);
|
18
|
+
}
|
19
|
+
}(this, function ($) {
|
20
|
+
|
21
|
+
(function() {
|
22
|
+
|
23
|
+
'use strict';
|
24
|
+
|
25
|
+
var defaults = {
|
26
|
+
hash: true
|
27
|
+
};
|
28
|
+
|
29
|
+
var Hash = function(element) {
|
30
|
+
|
31
|
+
this.core = $(element).data('lightGallery');
|
32
|
+
|
33
|
+
this.core.s = $.extend({}, defaults, this.core.s);
|
34
|
+
|
35
|
+
if (this.core.s.hash) {
|
36
|
+
this.oldHash = window.location.hash;
|
37
|
+
this.init();
|
38
|
+
}
|
39
|
+
|
40
|
+
return this;
|
41
|
+
};
|
42
|
+
|
43
|
+
Hash.prototype.init = function() {
|
44
|
+
var _this = this;
|
45
|
+
var _hash;
|
46
|
+
|
47
|
+
// Change hash value on after each slide transition
|
48
|
+
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
49
|
+
if (history.replaceState) {
|
50
|
+
history.replaceState(null, null, '#lg=' + _this.core.s.galleryId + '&slide=' + index);
|
51
|
+
} else {
|
52
|
+
window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index;
|
53
|
+
}
|
54
|
+
});
|
55
|
+
|
56
|
+
// Listen hash change and change the slide according to slide value
|
57
|
+
$(window).on('hashchange.lg.hash', function() {
|
58
|
+
_hash = window.location.hash;
|
59
|
+
var _idx = parseInt(_hash.split('&slide=')[1], 10);
|
60
|
+
|
61
|
+
// it galleryId doesn't exist in the url close the gallery
|
62
|
+
if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) {
|
63
|
+
_this.core.slide(_idx, false, false);
|
64
|
+
} else if (_this.core.lGalleryOn) {
|
65
|
+
_this.core.destroy();
|
66
|
+
}
|
67
|
+
|
68
|
+
});
|
69
|
+
};
|
70
|
+
|
71
|
+
Hash.prototype.destroy = function() {
|
72
|
+
|
73
|
+
if (!this.core.s.hash) {
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
|
77
|
+
// Reset to old hash value
|
78
|
+
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
|
79
|
+
if (history.replaceState) {
|
80
|
+
history.replaceState(null, null, this.oldHash);
|
81
|
+
} else {
|
82
|
+
window.location.hash = this.oldHash;
|
83
|
+
}
|
84
|
+
} else {
|
85
|
+
if (history.replaceState) {
|
86
|
+
history.replaceState(null, document.title, window.location.pathname + window.location.search);
|
87
|
+
} else {
|
88
|
+
window.location.hash = '';
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
this.core.$el.off('.lg.hash');
|
93
|
+
|
94
|
+
};
|
95
|
+
|
96
|
+
$.fn.lightGallery.modules.hash = Hash;
|
97
|
+
|
98
|
+
})();
|
99
|
+
|
100
|
+
}));
|