slabs-rails 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +32 -0
- data/assets/images/ajax-loader.gif +0 -0
- data/assets/images/arrow1-blue.png +0 -0
- data/assets/images/arrow1.png +0 -0
- data/assets/images/arrow2-blue.png +0 -0
- data/assets/images/arrow2.png +0 -0
- data/assets/images/arrow3-blue.png +0 -0
- data/assets/images/arrow3.png +0 -0
- data/assets/images/arrow4-blue.png +0 -0
- data/assets/images/arrow4.png +0 -0
- data/assets/images/btn-play.png +0 -0
- data/assets/images/circle1-blue.png +0 -0
- data/assets/images/circle1.png +0 -0
- data/assets/images/circle2-blue.png +0 -0
- data/assets/images/circle2.png +0 -0
- data/assets/images/circle3-blue.png +0 -0
- data/assets/images/circle3.png +0 -0
- data/assets/images/circle4-blue.png +0 -0
- data/assets/images/circle4.png +0 -0
- data/assets/javascripts/slabs-sprockets.js +4 -0
- data/assets/javascripts/slabs.js +3401 -0
- data/assets/javascripts/slabs.min.js +7 -0
- data/assets/javascripts/slabs/ekko-lightbox.js +446 -0
- data/assets/javascripts/slabs/slabs.headers.js +51 -0
- data/assets/javascripts/slabs/slabs.js +4 -0
- data/assets/javascripts/slabs/slick.js +2892 -0
- data/assets/stylesheets/_slabs-mincer.scss +18 -0
- data/assets/stylesheets/_slabs-sprockets.scss +5 -0
- data/assets/stylesheets/_slabs.scss +40 -0
- data/assets/stylesheets/slabs/_backgrounds.scss +5 -0
- data/assets/stylesheets/slabs/_buttons.scss +25 -0
- data/assets/stylesheets/slabs/_mixins.scss +7 -0
- data/assets/stylesheets/slabs/_sweet_hacks.scss +19 -0
- data/assets/stylesheets/slabs/_typo.scss +27 -0
- data/assets/stylesheets/slabs/_variables.scss +114 -0
- data/assets/stylesheets/slabs/_wells.scss +9 -0
- data/assets/stylesheets/slabs/commons/_headers.scss +37 -0
- data/assets/stylesheets/slabs/commons/ekko-lightbox.scss +127 -0
- data/assets/stylesheets/slabs/commons/slick.scss +312 -0
- data/assets/stylesheets/slabs/contents/_content-1.scss +45 -0
- data/assets/stylesheets/slabs/contents/_content-10.scss +18 -0
- data/assets/stylesheets/slabs/contents/_content-11.scss +18 -0
- data/assets/stylesheets/slabs/contents/_content-12.scss +42 -0
- data/assets/stylesheets/slabs/contents/_content-13.scss +64 -0
- data/assets/stylesheets/slabs/contents/_content-2.scss +11 -0
- data/assets/stylesheets/slabs/contents/_content-3.scss +23 -0
- data/assets/stylesheets/slabs/contents/_content-4.scss +54 -0
- data/assets/stylesheets/slabs/contents/_content-5.scss +27 -0
- data/assets/stylesheets/slabs/contents/_content-6.scss +63 -0
- data/assets/stylesheets/slabs/contents/_content-7.scss +71 -0
- data/assets/stylesheets/slabs/contents/_content-8.scss +22 -0
- data/assets/stylesheets/slabs/contents/_content-9.scss +46 -0
- data/assets/stylesheets/slabs/footers/_footer-1.scss +60 -0
- data/assets/stylesheets/slabs/footers/_footer-2.scss +29 -0
- data/assets/stylesheets/slabs/headers/_header-1.scss +97 -0
- data/assets/stylesheets/slabs/headers/_header-2.scss +134 -0
- data/assets/stylesheets/slabs/mixins/_backgrounds.scss +12 -0
- data/assets/stylesheets/slabs/mixins/_breakpoints.scss +108 -0
- data/assets/stylesheets/slabs/mixins/_buttons.scss +28 -0
- data/assets/stylesheets/slabs/mixins/_transitions.scss +128 -0
- data/assets/stylesheets/slabs/people/_people-1.scss +52 -0
- data/assets/stylesheets/slabs/people/_people-2.scss +51 -0
- data/lib/slabs-rails.rb +51 -0
- data/lib/slabs-rails/engine.rb +11 -0
- data/slabs-rails.gemspec +20 -0
- metadata +139 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5d78997ccb257a32b9bff08684d7b171ae3c81bb
|
4
|
+
data.tar.gz: f749835a2bcd39c3f42a9c2f57e7d2150e5b514b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d1d19a2aa754fb9d7a536cf28ab5561094c1521da1727339e4504fc557e3986d712b126f1b14de2146b39780e70120f95129158a22b9d256b807804d880f7e64
|
7
|
+
data.tar.gz: 1f94396e5d68eda27a0bef8ed1cca3c66a52b75211dc61dbe6f257ad8f09637d92eec02fbd8974911817a21e5f84c34bff78dab9c8594678cdf5d7c9379bf742
|
data/.gitignore
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Boltech
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
Slabs for Rails Asset Pipeline
|
2
|
+
=======
|
3
|
+
|
4
|
+
[Slabs](http://github.com/Boltech/slabs/) is an amazing extension for [Bootstrap](http://github.com/twbs/bootstrap), ready to help developers to create websites.
|
5
|
+
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
`slabs` is easy to drop into Rails with the asset pipeline.
|
10
|
+
|
11
|
+
In your Gemfile you need to add the `slabs-rails` gem, and ensure that the `sass-rails` gem is present - it is added to new Rails applications by default.
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'sass-rails', '>= 3.2'
|
15
|
+
gem 'bootstrap-sass', '~> 3.3.6'
|
16
|
+
gem 'slabs-rails'
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Import Bootstrap and Bolt Framework into a Sass file (for example, `application.css.scss`) to get all the styles, mixins and variables!
|
22
|
+
We recommend against using `//= require` directives, since none of your other stylesheets will be [able to access][antirequire] the Bootstrap and Bolt BS mixins or variables.
|
23
|
+
|
24
|
+
```scss
|
25
|
+
@import "bootstrap";
|
26
|
+
@import "slabs";
|
27
|
+
```
|
28
|
+
|
29
|
+
## Credits
|
30
|
+
|
31
|
+
<!-- feel free to make these link wherever you wish -->
|
32
|
+
* [Jorge Najera](https://twitter.com/JNajera)
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,3401 @@
|
|
1
|
+
/*!
|
2
|
+
* Slabs v1.0.0 (https://github.com/Boltech/slabs)
|
3
|
+
* Copyright 2016-2016 Boltech
|
4
|
+
* Licensed under the license
|
5
|
+
*/
|
6
|
+
window.slabs = {
|
7
|
+
name: 'Slabs',
|
8
|
+
version: '1.0.0'
|
9
|
+
};
|
10
|
+
|
11
|
+
var checkNavScroll;
|
12
|
+
|
13
|
+
slabs.headers = slabs.headers || {};
|
14
|
+
|
15
|
+
slabs.headers.header2 = function() {
|
16
|
+
return $('.header-2').slick({
|
17
|
+
dots: true,
|
18
|
+
infinite: true,
|
19
|
+
autoplaySpeed: 8000,
|
20
|
+
speed: 500,
|
21
|
+
prevArrow: '<i class="slick_prev fa fa-angle-left"></i>',
|
22
|
+
nextArrow: '<i class="slick_next fa fa-angle-right"></i>',
|
23
|
+
autoplay: true,
|
24
|
+
fade: true
|
25
|
+
});
|
26
|
+
};
|
27
|
+
|
28
|
+
(function($) {
|
29
|
+
return $(function() {
|
30
|
+
|
31
|
+
/* implementing headers */
|
32
|
+
var header, headerNumber;
|
33
|
+
for (header in slabs.headers) {
|
34
|
+
header = header;
|
35
|
+
headerNumber = header.slice(6);
|
36
|
+
if (jQuery('.header-' + headerNumber).length !== 0) {
|
37
|
+
slabs.headers[header]();
|
38
|
+
}
|
39
|
+
return;
|
40
|
+
}
|
41
|
+
});
|
42
|
+
})(jQuery);
|
43
|
+
|
44
|
+
checkNavScroll = function() {
|
45
|
+
var startY;
|
46
|
+
startY = $('.navbar-transparent').height() * 2;
|
47
|
+
if ($(window).scrollTop() > startY) {
|
48
|
+
$('.navbar-transparent').addClass('scrolled');
|
49
|
+
} else {
|
50
|
+
$('.navbar-transparent').removeClass('scrolled');
|
51
|
+
}
|
52
|
+
};
|
53
|
+
|
54
|
+
$(function() {
|
55
|
+
if ($('.navbar-transparent').length > 0) {
|
56
|
+
console.log("Starting!!!");
|
57
|
+
return $(window).on('scroll load resize', function() {
|
58
|
+
checkNavScroll();
|
59
|
+
});
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
|
64
|
+
/*
|
65
|
+
Lightbox for Bootstrap 3 by @ashleydw
|
66
|
+
https://github.com/ashleydw/lightbox
|
67
|
+
|
68
|
+
License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
|
69
|
+
*/
|
70
|
+
|
71
|
+
(function() {
|
72
|
+
"use strict";
|
73
|
+
var $, EkkoLightbox;
|
74
|
+
|
75
|
+
$ = jQuery;
|
76
|
+
|
77
|
+
EkkoLightbox = function(element, options) {
|
78
|
+
var content, footer, header;
|
79
|
+
this.options = $.extend({
|
80
|
+
title: null,
|
81
|
+
footer: null,
|
82
|
+
remote: null
|
83
|
+
}, $.fn.ekkoLightbox.defaults, options || {});
|
84
|
+
this.$element = $(element);
|
85
|
+
content = '';
|
86
|
+
this.modal_id = this.options.modal_id ? this.options.modal_id : 'ekkoLightbox-' + Math.floor((Math.random() * 1000) + 1);
|
87
|
+
header = '<div class="modal-header"' + (this.options.title || this.options.always_show_close ? '' : ' style="display:none"') + '><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title">' + (this.options.title || " ") + '</h4></div>';
|
88
|
+
footer = '<div class="modal-footer"' + (this.options.footer ? '' : ' style="display:none"') + '>' + this.options.footer + '</div>';
|
89
|
+
$(document.body).append('<div id="' + this.modal_id + '" class="ekko-lightbox modal fade" tabindex="-1"><div class="modal-dialog"><div class="modal-content">' + header + '<div class="modal-body"><div class="ekko-lightbox-container"><div></div></div></div>' + footer + '</div></div></div>');
|
90
|
+
this.modal = $('#' + this.modal_id);
|
91
|
+
this.modal_dialog = this.modal.find('.modal-dialog').first();
|
92
|
+
this.modal_content = this.modal.find('.modal-content').first();
|
93
|
+
this.modal_body = this.modal.find('.modal-body').first();
|
94
|
+
this.modal_header = this.modal.find('.modal-header').first();
|
95
|
+
this.modal_footer = this.modal.find('.modal-footer').first();
|
96
|
+
this.lightbox_container = this.modal_body.find('.ekko-lightbox-container').first();
|
97
|
+
this.lightbox_body = this.lightbox_container.find('> div:first-child').first();
|
98
|
+
this.showLoading();
|
99
|
+
this.modal_arrows = null;
|
100
|
+
this.border = {
|
101
|
+
top: parseFloat(this.modal_dialog.css('border-top-width')) + parseFloat(this.modal_content.css('border-top-width')) + parseFloat(this.modal_body.css('border-top-width')),
|
102
|
+
right: parseFloat(this.modal_dialog.css('border-right-width')) + parseFloat(this.modal_content.css('border-right-width')) + parseFloat(this.modal_body.css('border-right-width')),
|
103
|
+
bottom: parseFloat(this.modal_dialog.css('border-bottom-width')) + parseFloat(this.modal_content.css('border-bottom-width')) + parseFloat(this.modal_body.css('border-bottom-width')),
|
104
|
+
left: parseFloat(this.modal_dialog.css('border-left-width')) + parseFloat(this.modal_content.css('border-left-width')) + parseFloat(this.modal_body.css('border-left-width'))
|
105
|
+
};
|
106
|
+
this.padding = {
|
107
|
+
top: parseFloat(this.modal_dialog.css('padding-top')) + parseFloat(this.modal_content.css('padding-top')) + parseFloat(this.modal_body.css('padding-top')),
|
108
|
+
right: parseFloat(this.modal_dialog.css('padding-right')) + parseFloat(this.modal_content.css('padding-right')) + parseFloat(this.modal_body.css('padding-right')),
|
109
|
+
bottom: parseFloat(this.modal_dialog.css('padding-bottom')) + parseFloat(this.modal_content.css('padding-bottom')) + parseFloat(this.modal_body.css('padding-bottom')),
|
110
|
+
left: parseFloat(this.modal_dialog.css('padding-left')) + parseFloat(this.modal_content.css('padding-left')) + parseFloat(this.modal_body.css('padding-left'))
|
111
|
+
};
|
112
|
+
this.modal.on('show.bs.modal', this.options.onShow.bind(this)).on('shown.bs.modal', (function(_this) {
|
113
|
+
return function() {
|
114
|
+
_this.modal_shown();
|
115
|
+
return _this.options.onShown.call(_this);
|
116
|
+
};
|
117
|
+
})(this)).on('hide.bs.modal', this.options.onHide.bind(this)).on('hidden.bs.modal', (function(_this) {
|
118
|
+
return function() {
|
119
|
+
if (_this.gallery) {
|
120
|
+
$(document).off('keydown.ekkoLightbox');
|
121
|
+
}
|
122
|
+
_this.modal.remove();
|
123
|
+
return _this.options.onHidden.call(_this);
|
124
|
+
};
|
125
|
+
})(this)).modal('show', options);
|
126
|
+
return this.modal;
|
127
|
+
};
|
128
|
+
|
129
|
+
EkkoLightbox.prototype = {
|
130
|
+
modal_shown: function() {
|
131
|
+
var video_id;
|
132
|
+
if (!this.options.remote) {
|
133
|
+
return this.error('No remote target given');
|
134
|
+
} else {
|
135
|
+
this.gallery = this.$element.data('gallery');
|
136
|
+
if (this.gallery) {
|
137
|
+
if (this.options.gallery_parent_selector === 'document.body' || this.options.gallery_parent_selector === '') {
|
138
|
+
this.gallery_items = $(document.body).find('*[data-gallery="' + this.gallery + '"]');
|
139
|
+
} else {
|
140
|
+
this.gallery_items = this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-gallery="' + this.gallery + '"]');
|
141
|
+
}
|
142
|
+
this.gallery_index = this.gallery_items.index(this.$element);
|
143
|
+
$(document).on('keydown.ekkoLightbox', this.navigate.bind(this));
|
144
|
+
if (this.options.directional_arrows && this.gallery_items.length > 1) {
|
145
|
+
this.lightbox_container.append('<div class="ekko-lightbox-nav-overlay"><a href="#" class="' + this.strip_stops(this.options.left_arrow_class) + '"></a><a href="#" class="' + this.strip_stops(this.options.right_arrow_class) + '"></a></div>');
|
146
|
+
this.modal_arrows = this.lightbox_container.find('div.ekko-lightbox-nav-overlay').first();
|
147
|
+
this.lightbox_container.find('a' + this.strip_spaces(this.options.left_arrow_class)).on('click', (function(_this) {
|
148
|
+
return function(event) {
|
149
|
+
event.preventDefault();
|
150
|
+
return _this.navigate_left();
|
151
|
+
};
|
152
|
+
})(this));
|
153
|
+
this.lightbox_container.find('a' + this.strip_spaces(this.options.right_arrow_class)).on('click', (function(_this) {
|
154
|
+
return function(event) {
|
155
|
+
event.preventDefault();
|
156
|
+
return _this.navigate_right();
|
157
|
+
};
|
158
|
+
})(this));
|
159
|
+
}
|
160
|
+
}
|
161
|
+
if (this.options.type) {
|
162
|
+
if (this.options.type === 'image') {
|
163
|
+
return this.preloadImage(this.options.remote, true);
|
164
|
+
} else if (this.options.type === 'youtube' && (video_id = this.getYoutubeId(this.options.remote))) {
|
165
|
+
return this.showYoutubeVideo(video_id);
|
166
|
+
} else if (this.options.type === 'vimeo') {
|
167
|
+
return this.showVimeoVideo(this.options.remote);
|
168
|
+
} else if (this.options.type === 'instagram') {
|
169
|
+
return this.showInstagramVideo(this.options.remote);
|
170
|
+
} else if (this.options.type === 'url') {
|
171
|
+
return this.loadRemoteContent(this.options.remote);
|
172
|
+
} else if (this.options.type === 'video') {
|
173
|
+
return this.showVideoIframe(this.options.remote);
|
174
|
+
} else {
|
175
|
+
return this.error("Could not detect remote target type. Force the type using data-type=\"image|youtube|vimeo|instagram|url|video\"");
|
176
|
+
}
|
177
|
+
} else {
|
178
|
+
return this.detectRemoteType(this.options.remote);
|
179
|
+
}
|
180
|
+
}
|
181
|
+
},
|
182
|
+
strip_stops: function(str) {
|
183
|
+
return str.replace(/\./g, '');
|
184
|
+
},
|
185
|
+
strip_spaces: function(str) {
|
186
|
+
return str.replace(/\s/g, '');
|
187
|
+
},
|
188
|
+
isImage: function(str) {
|
189
|
+
return str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
|
190
|
+
},
|
191
|
+
isSwf: function(str) {
|
192
|
+
return str.match(/\.(swf)((\?|#).*)?$/i);
|
193
|
+
},
|
194
|
+
getYoutubeId: function(str) {
|
195
|
+
var match;
|
196
|
+
match = str.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);
|
197
|
+
if (match && match[2].length === 11) {
|
198
|
+
return match[2];
|
199
|
+
} else {
|
200
|
+
return false;
|
201
|
+
}
|
202
|
+
},
|
203
|
+
getVimeoId: function(str) {
|
204
|
+
if (str.indexOf('vimeo') > 0) {
|
205
|
+
return str;
|
206
|
+
} else {
|
207
|
+
return false;
|
208
|
+
}
|
209
|
+
},
|
210
|
+
getInstagramId: function(str) {
|
211
|
+
if (str.indexOf('instagram') > 0) {
|
212
|
+
return str;
|
213
|
+
} else {
|
214
|
+
return false;
|
215
|
+
}
|
216
|
+
},
|
217
|
+
navigate: function(event) {
|
218
|
+
event = event || window.event;
|
219
|
+
if (event.keyCode === 39 || event.keyCode === 37) {
|
220
|
+
if (event.keyCode === 39) {
|
221
|
+
return this.navigate_right();
|
222
|
+
} else if (event.keyCode === 37) {
|
223
|
+
return this.navigate_left();
|
224
|
+
}
|
225
|
+
}
|
226
|
+
},
|
227
|
+
navigateTo: function(index) {
|
228
|
+
var next, src;
|
229
|
+
if (index < 0 || index > this.gallery_items.length - 1) {
|
230
|
+
return this;
|
231
|
+
}
|
232
|
+
this.showLoading();
|
233
|
+
this.gallery_index = index;
|
234
|
+
this.$element = $(this.gallery_items.get(this.gallery_index));
|
235
|
+
this.updateTitleAndFooter();
|
236
|
+
src = this.$element.attr('data-remote') || this.$element.attr('href');
|
237
|
+
this.detectRemoteType(src, this.$element.attr('data-type') || false);
|
238
|
+
if (this.gallery_index + 1 < this.gallery_items.length) {
|
239
|
+
next = $(this.gallery_items.get(this.gallery_index + 1), false);
|
240
|
+
src = next.attr('data-remote') || next.attr('href');
|
241
|
+
if (next.attr('data-type') === 'image' || this.isImage(src)) {
|
242
|
+
return this.preloadImage(src, false);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
},
|
246
|
+
navigate_left: function() {
|
247
|
+
if (this.gallery_items.length === 1) {
|
248
|
+
return;
|
249
|
+
}
|
250
|
+
if (this.gallery_index === 0) {
|
251
|
+
this.gallery_index = this.gallery_items.length - 1;
|
252
|
+
} else {
|
253
|
+
this.gallery_index--;
|
254
|
+
}
|
255
|
+
this.options.onNavigate.call(this, 'left', this.gallery_index);
|
256
|
+
return this.navigateTo(this.gallery_index);
|
257
|
+
},
|
258
|
+
navigate_right: function() {
|
259
|
+
if (this.gallery_items.length === 1) {
|
260
|
+
return;
|
261
|
+
}
|
262
|
+
if (this.gallery_index === this.gallery_items.length - 1) {
|
263
|
+
this.gallery_index = 0;
|
264
|
+
} else {
|
265
|
+
this.gallery_index++;
|
266
|
+
}
|
267
|
+
this.options.onNavigate.call(this, 'right', this.gallery_index);
|
268
|
+
return this.navigateTo(this.gallery_index);
|
269
|
+
},
|
270
|
+
detectRemoteType: function(src, type) {
|
271
|
+
var video_id;
|
272
|
+
type = type || false;
|
273
|
+
if (type === 'image' || this.isImage(src)) {
|
274
|
+
this.options.type = 'image';
|
275
|
+
return this.preloadImage(src, true);
|
276
|
+
} else if (type === 'youtube' || (video_id = this.getYoutubeId(src))) {
|
277
|
+
this.options.type = 'youtube';
|
278
|
+
return this.showYoutubeVideo(video_id);
|
279
|
+
} else if (type === 'vimeo' || (video_id = this.getVimeoId(src))) {
|
280
|
+
this.options.type = 'vimeo';
|
281
|
+
return this.showVimeoVideo(video_id);
|
282
|
+
} else if (type === 'instagram' || (video_id = this.getInstagramId(src))) {
|
283
|
+
this.options.type = 'instagram';
|
284
|
+
return this.showInstagramVideo(video_id);
|
285
|
+
} else if (type === 'video') {
|
286
|
+
this.options.type = 'video';
|
287
|
+
return this.showVideoIframe(video_id);
|
288
|
+
} else {
|
289
|
+
this.options.type = 'url';
|
290
|
+
return this.loadRemoteContent(src);
|
291
|
+
}
|
292
|
+
},
|
293
|
+
updateTitleAndFooter: function() {
|
294
|
+
var caption, footer, header, title;
|
295
|
+
header = this.modal_content.find('.modal-header');
|
296
|
+
footer = this.modal_content.find('.modal-footer');
|
297
|
+
title = this.$element.data('title') || "";
|
298
|
+
caption = this.$element.data('footer') || "";
|
299
|
+
if (title || this.options.always_show_close) {
|
300
|
+
header.css('display', '').find('.modal-title').html(title || " ");
|
301
|
+
} else {
|
302
|
+
header.css('display', 'none');
|
303
|
+
}
|
304
|
+
if (caption) {
|
305
|
+
footer.css('display', '').html(caption);
|
306
|
+
} else {
|
307
|
+
footer.css('display', 'none');
|
308
|
+
}
|
309
|
+
return this;
|
310
|
+
},
|
311
|
+
showLoading: function() {
|
312
|
+
this.lightbox_body.html('<div class="modal-loading">' + this.options.loadingMessage + '</div>');
|
313
|
+
return this;
|
314
|
+
},
|
315
|
+
showYoutubeVideo: function(id) {
|
316
|
+
var height, rel, width;
|
317
|
+
if ((this.$element.attr('data-norelated') != null) || this.options.no_related) {
|
318
|
+
rel = "&rel=0";
|
319
|
+
} else {
|
320
|
+
rel = "";
|
321
|
+
}
|
322
|
+
width = this.checkDimensions(this.$element.data('width') || 560);
|
323
|
+
height = width / (560 / 315);
|
324
|
+
return this.showVideoIframe('//www.youtube.com/embed/' + id + '?badge=0&autoplay=1&html5=1' + rel, width, height);
|
325
|
+
},
|
326
|
+
showVimeoVideo: function(id) {
|
327
|
+
var height, width;
|
328
|
+
width = this.checkDimensions(this.$element.data('width') || 560);
|
329
|
+
height = width / (500 / 281);
|
330
|
+
return this.showVideoIframe(id + '?autoplay=1', width, height);
|
331
|
+
},
|
332
|
+
showInstagramVideo: function(id) {
|
333
|
+
var height, width;
|
334
|
+
width = this.checkDimensions(this.$element.data('width') || 612);
|
335
|
+
this.resize(width);
|
336
|
+
height = width + 80;
|
337
|
+
this.lightbox_body.html('<iframe width="' + width + '" height="' + height + '" src="' + this.addTrailingSlash(id) + 'embed/" frameborder="0" allowfullscreen></iframe>');
|
338
|
+
this.options.onContentLoaded.call(this);
|
339
|
+
if (this.modal_arrows) {
|
340
|
+
return this.modal_arrows.css('display', 'none');
|
341
|
+
}
|
342
|
+
},
|
343
|
+
showVideoIframe: function(url, width, height) {
|
344
|
+
height = height || width;
|
345
|
+
this.resize(width);
|
346
|
+
this.lightbox_body.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="' + width + '" height="' + height + '" src="' + url + '" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>');
|
347
|
+
this.options.onContentLoaded.call(this);
|
348
|
+
if (this.modal_arrows) {
|
349
|
+
this.modal_arrows.css('display', 'none');
|
350
|
+
}
|
351
|
+
return this;
|
352
|
+
},
|
353
|
+
loadRemoteContent: function(url) {
|
354
|
+
var disableExternalCheck, width;
|
355
|
+
width = this.$element.data('width') || 560;
|
356
|
+
this.resize(width);
|
357
|
+
disableExternalCheck = this.$element.data('disableExternalCheck') || false;
|
358
|
+
if (!disableExternalCheck && !this.isExternal(url)) {
|
359
|
+
this.lightbox_body.load(url, $.proxy((function(_this) {
|
360
|
+
return function() {
|
361
|
+
return _this.$element.trigger('loaded.bs.modal');
|
362
|
+
};
|
363
|
+
})(this)));
|
364
|
+
} else {
|
365
|
+
this.lightbox_body.html('<iframe width="' + width + '" height="' + width + '" src="' + url + '" frameborder="0" allowfullscreen></iframe>');
|
366
|
+
this.options.onContentLoaded.call(this);
|
367
|
+
}
|
368
|
+
if (this.modal_arrows) {
|
369
|
+
this.modal_arrows.css('display', 'none');
|
370
|
+
}
|
371
|
+
return this;
|
372
|
+
},
|
373
|
+
isExternal: function(url) {
|
374
|
+
var match;
|
375
|
+
match = url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);
|
376
|
+
if (typeof match[1] === "string" && match[1].length > 0 && match[1].toLowerCase() !== location.protocol) {
|
377
|
+
return true;
|
378
|
+
}
|
379
|
+
if (typeof match[2] === "string" && match[2].length > 0 && match[2].replace(new RegExp(":(" + {
|
380
|
+
"http:": 80,
|
381
|
+
"https:": 443
|
382
|
+
}[location.protocol] + ")?$"), "") !== location.host) {
|
383
|
+
return true;
|
384
|
+
}
|
385
|
+
return false;
|
386
|
+
},
|
387
|
+
error: function(message) {
|
388
|
+
this.lightbox_body.html(message);
|
389
|
+
return this;
|
390
|
+
},
|
391
|
+
preloadImage: function(src, onLoadShowImage) {
|
392
|
+
var img;
|
393
|
+
img = new Image();
|
394
|
+
if ((onLoadShowImage == null) || onLoadShowImage === true) {
|
395
|
+
img.onload = (function(_this) {
|
396
|
+
return function() {
|
397
|
+
var image;
|
398
|
+
image = $('<img />');
|
399
|
+
image.attr('src', img.src);
|
400
|
+
image.addClass('img-responsive');
|
401
|
+
_this.lightbox_body.html(image);
|
402
|
+
if (_this.modal_arrows) {
|
403
|
+
_this.modal_arrows.css('display', 'block');
|
404
|
+
}
|
405
|
+
return image.load(function() {
|
406
|
+
if (_this.options.scale_height) {
|
407
|
+
_this.scaleHeight(img.height, img.width);
|
408
|
+
} else {
|
409
|
+
_this.resize(img.width);
|
410
|
+
}
|
411
|
+
return _this.options.onContentLoaded.call(_this);
|
412
|
+
});
|
413
|
+
};
|
414
|
+
})(this);
|
415
|
+
img.onerror = (function(_this) {
|
416
|
+
return function() {
|
417
|
+
return _this.error('Failed to load image: ' + src);
|
418
|
+
};
|
419
|
+
})(this);
|
420
|
+
}
|
421
|
+
img.src = src;
|
422
|
+
return img;
|
423
|
+
},
|
424
|
+
scaleHeight: function(height, width) {
|
425
|
+
var border_padding, factor, footer_height, header_height, margins, max_height;
|
426
|
+
header_height = this.modal_header.outerHeight(true) || 0;
|
427
|
+
footer_height = this.modal_footer.outerHeight(true) || 0;
|
428
|
+
if (!this.modal_footer.is(':visible')) {
|
429
|
+
footer_height = 0;
|
430
|
+
}
|
431
|
+
if (!this.modal_header.is(':visible')) {
|
432
|
+
header_height = 0;
|
433
|
+
}
|
434
|
+
border_padding = this.border.top + this.border.bottom + this.padding.top + this.padding.bottom;
|
435
|
+
margins = parseFloat(this.modal_dialog.css('margin-top')) + parseFloat(this.modal_dialog.css('margin-bottom'));
|
436
|
+
max_height = $(window).height() - border_padding - margins - header_height - footer_height;
|
437
|
+
factor = Math.min(max_height / height, 1);
|
438
|
+
this.modal_dialog.css('height', 'auto').css('max-height', max_height);
|
439
|
+
return this.resize(factor * width);
|
440
|
+
},
|
441
|
+
resize: function(width) {
|
442
|
+
var width_total;
|
443
|
+
width_total = width + this.border.left + this.padding.left + this.padding.right + this.border.right;
|
444
|
+
this.modal_dialog.css('width', 'auto').css('max-width', width_total);
|
445
|
+
this.lightbox_container.find('a').css('line-height', function() {
|
446
|
+
return $(this).parent().height() + 'px';
|
447
|
+
});
|
448
|
+
return this;
|
449
|
+
},
|
450
|
+
checkDimensions: function(width) {
|
451
|
+
var body_width, width_total;
|
452
|
+
width_total = width + this.border.left + this.padding.left + this.padding.right + this.border.right;
|
453
|
+
body_width = document.body.clientWidth;
|
454
|
+
if (width_total > body_width) {
|
455
|
+
width = this.modal_body.width();
|
456
|
+
}
|
457
|
+
return width;
|
458
|
+
},
|
459
|
+
close: function() {
|
460
|
+
return this.modal.modal('hide');
|
461
|
+
},
|
462
|
+
addTrailingSlash: function(url) {
|
463
|
+
if (url.substr(-1) !== '/') {
|
464
|
+
url += '/';
|
465
|
+
}
|
466
|
+
return url;
|
467
|
+
}
|
468
|
+
};
|
469
|
+
|
470
|
+
$.fn.ekkoLightbox = function(options) {
|
471
|
+
return this.each(function() {
|
472
|
+
var $this;
|
473
|
+
$this = $(this);
|
474
|
+
options = $.extend({
|
475
|
+
remote: $this.attr('data-remote') || $this.attr('href'),
|
476
|
+
gallery_parent_selector: $this.attr('data-parent'),
|
477
|
+
type: $this.attr('data-type')
|
478
|
+
}, options, $this.data());
|
479
|
+
new EkkoLightbox(this, options);
|
480
|
+
return this;
|
481
|
+
});
|
482
|
+
};
|
483
|
+
|
484
|
+
$.fn.ekkoLightbox.defaults = {
|
485
|
+
gallery_parent_selector: 'document.body',
|
486
|
+
left_arrow_class: '.glyphicon .glyphicon-chevron-left',
|
487
|
+
right_arrow_class: '.glyphicon .glyphicon-chevron-right',
|
488
|
+
directional_arrows: true,
|
489
|
+
type: null,
|
490
|
+
always_show_close: true,
|
491
|
+
no_related: false,
|
492
|
+
scale_height: true,
|
493
|
+
loadingMessage: 'Loading...',
|
494
|
+
onShow: function() {},
|
495
|
+
onShown: function() {},
|
496
|
+
onHide: function() {},
|
497
|
+
onHidden: function() {},
|
498
|
+
onNavigate: function() {},
|
499
|
+
onContentLoaded: function() {}
|
500
|
+
};
|
501
|
+
|
502
|
+
}).call(this);
|
503
|
+
|
504
|
+
|
505
|
+
$(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
|
506
|
+
event.preventDefault();
|
507
|
+
$(this).ekkoLightbox();
|
508
|
+
});
|
509
|
+
|
510
|
+
/*
|
511
|
+
_ _ _ _
|
512
|
+
___| (_) ___| | __ (_)___
|
513
|
+
/ __| | |/ __| |/ / | / __|
|
514
|
+
\__ \ | | (__| < _ | \__ \
|
515
|
+
|___/_|_|\___|_|\_(_)/ |___/
|
516
|
+
|__/
|
517
|
+
|
518
|
+
Version: 1.5.9
|
519
|
+
Author: Ken Wheeler
|
520
|
+
Website: http://kenwheeler.github.io
|
521
|
+
Docs: http://kenwheeler.github.io/slick
|
522
|
+
Repo: http://github.com/kenwheeler/slick
|
523
|
+
Issues: http://github.com/kenwheeler/slick/issues
|
524
|
+
|
525
|
+
*/
|
526
|
+
/* global window, document, define, jQuery, setInterval, clearInterval */
|
527
|
+
(function(factory) {
|
528
|
+
'use strict';
|
529
|
+
if (typeof define === 'function' && define.amd) {
|
530
|
+
define(['jquery'], factory);
|
531
|
+
} else if (typeof exports !== 'undefined') {
|
532
|
+
module.exports = factory(require('jquery'));
|
533
|
+
} else {
|
534
|
+
factory(jQuery);
|
535
|
+
}
|
536
|
+
|
537
|
+
}(function($) {
|
538
|
+
'use strict';
|
539
|
+
var Slick = window.Slick || {};
|
540
|
+
|
541
|
+
Slick = (function() {
|
542
|
+
|
543
|
+
var instanceUid = 0;
|
544
|
+
|
545
|
+
function Slick(element, settings) {
|
546
|
+
|
547
|
+
var _ = this, dataSettings;
|
548
|
+
|
549
|
+
_.defaults = {
|
550
|
+
accessibility: true,
|
551
|
+
adaptiveHeight: false,
|
552
|
+
appendArrows: $(element),
|
553
|
+
appendDots: $(element),
|
554
|
+
arrows: true,
|
555
|
+
asNavFor: null,
|
556
|
+
prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>',
|
557
|
+
nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>',
|
558
|
+
autoplay: false,
|
559
|
+
autoplaySpeed: 3000,
|
560
|
+
centerMode: false,
|
561
|
+
centerPadding: '50px',
|
562
|
+
cssEase: 'ease',
|
563
|
+
customPaging: function(slider, i) {
|
564
|
+
return $('<button type="button" data-role="none" role="button" tabindex="0" />').text(i + 1);
|
565
|
+
},
|
566
|
+
dots: false,
|
567
|
+
dotsClass: 'slick-dots',
|
568
|
+
draggable: true,
|
569
|
+
easing: 'linear',
|
570
|
+
edgeFriction: 0.35,
|
571
|
+
fade: false,
|
572
|
+
focusOnSelect: false,
|
573
|
+
infinite: true,
|
574
|
+
initialSlide: 0,
|
575
|
+
lazyLoad: 'ondemand',
|
576
|
+
mobileFirst: false,
|
577
|
+
pauseOnHover: true,
|
578
|
+
pauseOnFocus: true,
|
579
|
+
pauseOnDotsHover: false,
|
580
|
+
respondTo: 'window',
|
581
|
+
responsive: null,
|
582
|
+
rows: 1,
|
583
|
+
rtl: false,
|
584
|
+
slide: '',
|
585
|
+
slidesPerRow: 1,
|
586
|
+
slidesToShow: 1,
|
587
|
+
slidesToScroll: 1,
|
588
|
+
speed: 500,
|
589
|
+
swipe: true,
|
590
|
+
swipeToSlide: false,
|
591
|
+
touchMove: true,
|
592
|
+
touchThreshold: 5,
|
593
|
+
useCSS: true,
|
594
|
+
useTransform: true,
|
595
|
+
variableWidth: false,
|
596
|
+
vertical: false,
|
597
|
+
verticalSwiping: false,
|
598
|
+
waitForAnimate: true,
|
599
|
+
zIndex: 1000
|
600
|
+
};
|
601
|
+
|
602
|
+
_.initials = {
|
603
|
+
animating: false,
|
604
|
+
dragging: false,
|
605
|
+
autoPlayTimer: null,
|
606
|
+
currentDirection: 0,
|
607
|
+
currentLeft: null,
|
608
|
+
currentSlide: 0,
|
609
|
+
direction: 1,
|
610
|
+
$dots: null,
|
611
|
+
listWidth: null,
|
612
|
+
listHeight: null,
|
613
|
+
loadIndex: 0,
|
614
|
+
$nextArrow: null,
|
615
|
+
$prevArrow: null,
|
616
|
+
slideCount: null,
|
617
|
+
slideWidth: null,
|
618
|
+
$slideTrack: null,
|
619
|
+
$slides: null,
|
620
|
+
sliding: false,
|
621
|
+
slideOffset: 0,
|
622
|
+
swipeLeft: null,
|
623
|
+
$list: null,
|
624
|
+
touchObject: {},
|
625
|
+
transformsEnabled: false,
|
626
|
+
unslicked: false
|
627
|
+
};
|
628
|
+
|
629
|
+
$.extend(_, _.initials);
|
630
|
+
|
631
|
+
_.activeBreakpoint = null;
|
632
|
+
_.animType = null;
|
633
|
+
_.animProp = null;
|
634
|
+
_.breakpoints = [];
|
635
|
+
_.breakpointSettings = [];
|
636
|
+
_.cssTransitions = false;
|
637
|
+
_.focussed = false;
|
638
|
+
_.interrupted = false;
|
639
|
+
_.hidden = 'hidden';
|
640
|
+
_.paused = true;
|
641
|
+
_.positionProp = null;
|
642
|
+
_.respondTo = null;
|
643
|
+
_.rowCount = 1;
|
644
|
+
_.shouldClick = true;
|
645
|
+
_.$slider = $(element);
|
646
|
+
_.$slidesCache = null;
|
647
|
+
_.transformType = null;
|
648
|
+
_.transitionType = null;
|
649
|
+
_.visibilityChange = 'visibilitychange';
|
650
|
+
_.windowWidth = 0;
|
651
|
+
_.windowTimer = null;
|
652
|
+
|
653
|
+
dataSettings = $(element).data('slick') || {};
|
654
|
+
|
655
|
+
_.options = $.extend({}, _.defaults, settings, dataSettings);
|
656
|
+
|
657
|
+
_.currentSlide = _.options.initialSlide;
|
658
|
+
|
659
|
+
_.originalSettings = _.options;
|
660
|
+
|
661
|
+
if (typeof document.mozHidden !== 'undefined') {
|
662
|
+
_.hidden = 'mozHidden';
|
663
|
+
_.visibilityChange = 'mozvisibilitychange';
|
664
|
+
} else if (typeof document.webkitHidden !== 'undefined') {
|
665
|
+
_.hidden = 'webkitHidden';
|
666
|
+
_.visibilityChange = 'webkitvisibilitychange';
|
667
|
+
}
|
668
|
+
|
669
|
+
_.autoPlay = $.proxy(_.autoPlay, _);
|
670
|
+
_.autoPlayClear = $.proxy(_.autoPlayClear, _);
|
671
|
+
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
|
672
|
+
_.changeSlide = $.proxy(_.changeSlide, _);
|
673
|
+
_.clickHandler = $.proxy(_.clickHandler, _);
|
674
|
+
_.selectHandler = $.proxy(_.selectHandler, _);
|
675
|
+
_.setPosition = $.proxy(_.setPosition, _);
|
676
|
+
_.swipeHandler = $.proxy(_.swipeHandler, _);
|
677
|
+
_.dragHandler = $.proxy(_.dragHandler, _);
|
678
|
+
_.keyHandler = $.proxy(_.keyHandler, _);
|
679
|
+
|
680
|
+
_.instanceUid = instanceUid++;
|
681
|
+
|
682
|
+
// A simple way to check for HTML strings
|
683
|
+
// Strict HTML recognition (must start with <)
|
684
|
+
// Extracted from jQuery v1.11 source
|
685
|
+
_.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
|
686
|
+
|
687
|
+
|
688
|
+
_.registerBreakpoints();
|
689
|
+
_.init(true);
|
690
|
+
|
691
|
+
}
|
692
|
+
|
693
|
+
return Slick;
|
694
|
+
|
695
|
+
}());
|
696
|
+
|
697
|
+
Slick.prototype.activateADA = function() {
|
698
|
+
var _ = this;
|
699
|
+
|
700
|
+
_.$slideTrack.find('.slick-active').attr({
|
701
|
+
'aria-hidden': 'false'
|
702
|
+
}).find('a, input, button, select').attr({
|
703
|
+
'tabindex': '0'
|
704
|
+
});
|
705
|
+
|
706
|
+
};
|
707
|
+
|
708
|
+
Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
|
709
|
+
|
710
|
+
var _ = this;
|
711
|
+
|
712
|
+
if (typeof(index) === 'boolean') {
|
713
|
+
addBefore = index;
|
714
|
+
index = null;
|
715
|
+
} else if (index < 0 || (index >= _.slideCount)) {
|
716
|
+
return false;
|
717
|
+
}
|
718
|
+
|
719
|
+
_.unload();
|
720
|
+
|
721
|
+
if (typeof(index) === 'number') {
|
722
|
+
if (index === 0 && _.$slides.length === 0) {
|
723
|
+
$(markup).appendTo(_.$slideTrack);
|
724
|
+
} else if (addBefore) {
|
725
|
+
$(markup).insertBefore(_.$slides.eq(index));
|
726
|
+
} else {
|
727
|
+
$(markup).insertAfter(_.$slides.eq(index));
|
728
|
+
}
|
729
|
+
} else {
|
730
|
+
if (addBefore === true) {
|
731
|
+
$(markup).prependTo(_.$slideTrack);
|
732
|
+
} else {
|
733
|
+
$(markup).appendTo(_.$slideTrack);
|
734
|
+
}
|
735
|
+
}
|
736
|
+
|
737
|
+
_.$slides = _.$slideTrack.children(this.options.slide);
|
738
|
+
|
739
|
+
_.$slideTrack.children(this.options.slide).detach();
|
740
|
+
|
741
|
+
_.$slideTrack.append(_.$slides);
|
742
|
+
|
743
|
+
_.$slides.each(function(index, element) {
|
744
|
+
$(element).attr('data-slick-index', index);
|
745
|
+
});
|
746
|
+
|
747
|
+
_.$slidesCache = _.$slides;
|
748
|
+
|
749
|
+
_.reinit();
|
750
|
+
|
751
|
+
};
|
752
|
+
|
753
|
+
Slick.prototype.animateHeight = function() {
|
754
|
+
var _ = this;
|
755
|
+
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
|
756
|
+
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
|
757
|
+
_.$list.animate({
|
758
|
+
height: targetHeight
|
759
|
+
}, _.options.speed);
|
760
|
+
}
|
761
|
+
};
|
762
|
+
|
763
|
+
Slick.prototype.animateSlide = function(targetLeft, callback) {
|
764
|
+
|
765
|
+
var animProps = {},
|
766
|
+
_ = this;
|
767
|
+
|
768
|
+
_.animateHeight();
|
769
|
+
|
770
|
+
if (_.options.rtl === true && _.options.vertical === false) {
|
771
|
+
targetLeft = -targetLeft;
|
772
|
+
}
|
773
|
+
if (_.transformsEnabled === false) {
|
774
|
+
if (_.options.vertical === false) {
|
775
|
+
_.$slideTrack.animate({
|
776
|
+
left: targetLeft
|
777
|
+
}, _.options.speed, _.options.easing, callback);
|
778
|
+
} else {
|
779
|
+
_.$slideTrack.animate({
|
780
|
+
top: targetLeft
|
781
|
+
}, _.options.speed, _.options.easing, callback);
|
782
|
+
}
|
783
|
+
|
784
|
+
} else {
|
785
|
+
|
786
|
+
if (_.cssTransitions === false) {
|
787
|
+
if (_.options.rtl === true) {
|
788
|
+
_.currentLeft = -(_.currentLeft);
|
789
|
+
}
|
790
|
+
$({
|
791
|
+
animStart: _.currentLeft
|
792
|
+
}).animate({
|
793
|
+
animStart: targetLeft
|
794
|
+
}, {
|
795
|
+
duration: _.options.speed,
|
796
|
+
easing: _.options.easing,
|
797
|
+
step: function(now) {
|
798
|
+
now = Math.ceil(now);
|
799
|
+
if (_.options.vertical === false) {
|
800
|
+
animProps[_.animType] = 'translate(' +
|
801
|
+
now + 'px, 0px)';
|
802
|
+
_.$slideTrack.css(animProps);
|
803
|
+
} else {
|
804
|
+
animProps[_.animType] = 'translate(0px,' +
|
805
|
+
now + 'px)';
|
806
|
+
_.$slideTrack.css(animProps);
|
807
|
+
}
|
808
|
+
},
|
809
|
+
complete: function() {
|
810
|
+
if (callback) {
|
811
|
+
callback.call();
|
812
|
+
}
|
813
|
+
}
|
814
|
+
});
|
815
|
+
|
816
|
+
} else {
|
817
|
+
|
818
|
+
_.applyTransition();
|
819
|
+
targetLeft = Math.ceil(targetLeft);
|
820
|
+
|
821
|
+
if (_.options.vertical === false) {
|
822
|
+
animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
|
823
|
+
} else {
|
824
|
+
animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
|
825
|
+
}
|
826
|
+
_.$slideTrack.css(animProps);
|
827
|
+
|
828
|
+
if (callback) {
|
829
|
+
setTimeout(function() {
|
830
|
+
|
831
|
+
_.disableTransition();
|
832
|
+
|
833
|
+
callback.call();
|
834
|
+
}, _.options.speed);
|
835
|
+
}
|
836
|
+
|
837
|
+
}
|
838
|
+
|
839
|
+
}
|
840
|
+
|
841
|
+
};
|
842
|
+
|
843
|
+
Slick.prototype.getNavTarget = function() {
|
844
|
+
|
845
|
+
var _ = this,
|
846
|
+
asNavFor = _.options.asNavFor;
|
847
|
+
|
848
|
+
if ( asNavFor && asNavFor !== null ) {
|
849
|
+
asNavFor = $(asNavFor).not(_.$slider);
|
850
|
+
}
|
851
|
+
|
852
|
+
return asNavFor;
|
853
|
+
|
854
|
+
};
|
855
|
+
|
856
|
+
Slick.prototype.asNavFor = function(index) {
|
857
|
+
|
858
|
+
var _ = this,
|
859
|
+
asNavFor = _.getNavTarget();
|
860
|
+
|
861
|
+
if ( asNavFor !== null && typeof asNavFor === 'object' ) {
|
862
|
+
asNavFor.each(function() {
|
863
|
+
var target = $(this).slick('getSlick');
|
864
|
+
if(!target.unslicked) {
|
865
|
+
target.slideHandler(index, true);
|
866
|
+
}
|
867
|
+
});
|
868
|
+
}
|
869
|
+
|
870
|
+
};
|
871
|
+
|
872
|
+
Slick.prototype.applyTransition = function(slide) {
|
873
|
+
|
874
|
+
var _ = this,
|
875
|
+
transition = {};
|
876
|
+
|
877
|
+
if (_.options.fade === false) {
|
878
|
+
transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
|
879
|
+
} else {
|
880
|
+
transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
|
881
|
+
}
|
882
|
+
|
883
|
+
if (_.options.fade === false) {
|
884
|
+
_.$slideTrack.css(transition);
|
885
|
+
} else {
|
886
|
+
_.$slides.eq(slide).css(transition);
|
887
|
+
}
|
888
|
+
|
889
|
+
};
|
890
|
+
|
891
|
+
Slick.prototype.autoPlay = function() {
|
892
|
+
|
893
|
+
var _ = this;
|
894
|
+
|
895
|
+
_.autoPlayClear();
|
896
|
+
|
897
|
+
if ( _.slideCount > _.options.slidesToShow ) {
|
898
|
+
_.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );
|
899
|
+
}
|
900
|
+
|
901
|
+
};
|
902
|
+
|
903
|
+
Slick.prototype.autoPlayClear = function() {
|
904
|
+
|
905
|
+
var _ = this;
|
906
|
+
|
907
|
+
if (_.autoPlayTimer) {
|
908
|
+
clearInterval(_.autoPlayTimer);
|
909
|
+
}
|
910
|
+
|
911
|
+
};
|
912
|
+
|
913
|
+
Slick.prototype.autoPlayIterator = function() {
|
914
|
+
|
915
|
+
var _ = this,
|
916
|
+
slideTo = _.currentSlide + _.options.slidesToScroll;
|
917
|
+
|
918
|
+
if ( !_.paused && !_.interrupted && !_.focussed ) {
|
919
|
+
|
920
|
+
if ( _.options.infinite === false ) {
|
921
|
+
|
922
|
+
if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {
|
923
|
+
_.direction = 0;
|
924
|
+
}
|
925
|
+
|
926
|
+
else if ( _.direction === 0 ) {
|
927
|
+
|
928
|
+
slideTo = _.currentSlide - _.options.slidesToScroll;
|
929
|
+
|
930
|
+
if ( _.currentSlide - 1 === 0 ) {
|
931
|
+
_.direction = 1;
|
932
|
+
}
|
933
|
+
|
934
|
+
}
|
935
|
+
|
936
|
+
}
|
937
|
+
|
938
|
+
_.slideHandler( slideTo );
|
939
|
+
|
940
|
+
}
|
941
|
+
|
942
|
+
};
|
943
|
+
|
944
|
+
Slick.prototype.buildArrows = function() {
|
945
|
+
|
946
|
+
var _ = this;
|
947
|
+
|
948
|
+
if (_.options.arrows === true ) {
|
949
|
+
|
950
|
+
_.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
|
951
|
+
_.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
|
952
|
+
|
953
|
+
if( _.slideCount > _.options.slidesToShow ) {
|
954
|
+
|
955
|
+
_.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
|
956
|
+
_.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
|
957
|
+
|
958
|
+
if (_.htmlExpr.test(_.options.prevArrow)) {
|
959
|
+
_.$prevArrow.prependTo(_.options.appendArrows);
|
960
|
+
}
|
961
|
+
|
962
|
+
if (_.htmlExpr.test(_.options.nextArrow)) {
|
963
|
+
_.$nextArrow.appendTo(_.options.appendArrows);
|
964
|
+
}
|
965
|
+
|
966
|
+
if (_.options.infinite !== true) {
|
967
|
+
_.$prevArrow
|
968
|
+
.addClass('slick-disabled')
|
969
|
+
.attr('aria-disabled', 'true');
|
970
|
+
}
|
971
|
+
|
972
|
+
} else {
|
973
|
+
|
974
|
+
_.$prevArrow.add( _.$nextArrow )
|
975
|
+
|
976
|
+
.addClass('slick-hidden')
|
977
|
+
.attr({
|
978
|
+
'aria-disabled': 'true',
|
979
|
+
'tabindex': '-1'
|
980
|
+
});
|
981
|
+
|
982
|
+
}
|
983
|
+
|
984
|
+
}
|
985
|
+
|
986
|
+
};
|
987
|
+
|
988
|
+
Slick.prototype.buildDots = function() {
|
989
|
+
|
990
|
+
var _ = this,
|
991
|
+
i, dot;
|
992
|
+
|
993
|
+
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
994
|
+
|
995
|
+
_.$slider.addClass('slick-dotted');
|
996
|
+
|
997
|
+
dot = $('<ul />').addClass(_.options.dotsClass);
|
998
|
+
|
999
|
+
for (i = 0; i <= _.getDotCount(); i += 1) {
|
1000
|
+
dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
_.$dots = dot.appendTo(_.options.appendDots);
|
1004
|
+
|
1005
|
+
_.$dots.find('li').first().addClass('slick-active').attr('aria-hidden', 'false');
|
1006
|
+
|
1007
|
+
}
|
1008
|
+
|
1009
|
+
};
|
1010
|
+
|
1011
|
+
Slick.prototype.buildOut = function() {
|
1012
|
+
|
1013
|
+
var _ = this;
|
1014
|
+
|
1015
|
+
_.$slides =
|
1016
|
+
_.$slider
|
1017
|
+
.children( _.options.slide + ':not(.slick-cloned)')
|
1018
|
+
.addClass('slick-slide');
|
1019
|
+
|
1020
|
+
_.slideCount = _.$slides.length;
|
1021
|
+
|
1022
|
+
_.$slides.each(function(index, element) {
|
1023
|
+
$(element)
|
1024
|
+
.attr('data-slick-index', index)
|
1025
|
+
.data('originalStyling', $(element).attr('style') || '');
|
1026
|
+
});
|
1027
|
+
|
1028
|
+
_.$slider.addClass('slick-slider');
|
1029
|
+
|
1030
|
+
_.$slideTrack = (_.slideCount === 0) ?
|
1031
|
+
$('<div class="slick-track"/>').appendTo(_.$slider) :
|
1032
|
+
_.$slides.wrapAll('<div class="slick-track"/>').parent();
|
1033
|
+
|
1034
|
+
_.$list = _.$slideTrack.wrap(
|
1035
|
+
'<div aria-live="polite" class="slick-list"/>').parent();
|
1036
|
+
_.$slideTrack.css('opacity', 0);
|
1037
|
+
|
1038
|
+
if (_.options.centerMode === true || _.options.swipeToSlide === true) {
|
1039
|
+
_.options.slidesToScroll = 1;
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
$('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
|
1043
|
+
|
1044
|
+
_.setupInfinite();
|
1045
|
+
|
1046
|
+
_.buildArrows();
|
1047
|
+
|
1048
|
+
_.buildDots();
|
1049
|
+
|
1050
|
+
_.updateDots();
|
1051
|
+
|
1052
|
+
|
1053
|
+
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
|
1054
|
+
|
1055
|
+
if (_.options.draggable === true) {
|
1056
|
+
_.$list.addClass('draggable');
|
1057
|
+
}
|
1058
|
+
|
1059
|
+
};
|
1060
|
+
|
1061
|
+
Slick.prototype.buildRows = function() {
|
1062
|
+
|
1063
|
+
var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
|
1064
|
+
|
1065
|
+
newSlides = document.createDocumentFragment();
|
1066
|
+
originalSlides = _.$slider.children();
|
1067
|
+
|
1068
|
+
if(_.options.rows > 1) {
|
1069
|
+
|
1070
|
+
slidesPerSection = _.options.slidesPerRow * _.options.rows;
|
1071
|
+
numOfSlides = Math.ceil(
|
1072
|
+
originalSlides.length / slidesPerSection
|
1073
|
+
);
|
1074
|
+
|
1075
|
+
for(a = 0; a < numOfSlides; a++){
|
1076
|
+
var slide = document.createElement('div');
|
1077
|
+
for(b = 0; b < _.options.rows; b++) {
|
1078
|
+
var row = document.createElement('div');
|
1079
|
+
for(c = 0; c < _.options.slidesPerRow; c++) {
|
1080
|
+
var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
|
1081
|
+
if (originalSlides.get(target)) {
|
1082
|
+
row.appendChild(originalSlides.get(target));
|
1083
|
+
}
|
1084
|
+
}
|
1085
|
+
slide.appendChild(row);
|
1086
|
+
}
|
1087
|
+
newSlides.appendChild(slide);
|
1088
|
+
}
|
1089
|
+
|
1090
|
+
_.$slider.empty().append(newSlides);
|
1091
|
+
_.$slider.children().children().children()
|
1092
|
+
.css({
|
1093
|
+
'width':(100 / _.options.slidesPerRow) + '%',
|
1094
|
+
'display': 'inline-block'
|
1095
|
+
});
|
1096
|
+
|
1097
|
+
}
|
1098
|
+
|
1099
|
+
};
|
1100
|
+
|
1101
|
+
Slick.prototype.checkResponsive = function(initial, forceUpdate) {
|
1102
|
+
|
1103
|
+
var _ = this,
|
1104
|
+
breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
|
1105
|
+
var sliderWidth = _.$slider.width();
|
1106
|
+
var windowWidth = window.innerWidth || $(window).width();
|
1107
|
+
|
1108
|
+
if (_.respondTo === 'window') {
|
1109
|
+
respondToWidth = windowWidth;
|
1110
|
+
} else if (_.respondTo === 'slider') {
|
1111
|
+
respondToWidth = sliderWidth;
|
1112
|
+
} else if (_.respondTo === 'min') {
|
1113
|
+
respondToWidth = Math.min(windowWidth, sliderWidth);
|
1114
|
+
}
|
1115
|
+
|
1116
|
+
if ( _.options.responsive &&
|
1117
|
+
_.options.responsive.length &&
|
1118
|
+
_.options.responsive !== null) {
|
1119
|
+
|
1120
|
+
targetBreakpoint = null;
|
1121
|
+
|
1122
|
+
for (breakpoint in _.breakpoints) {
|
1123
|
+
if (_.breakpoints.hasOwnProperty(breakpoint)) {
|
1124
|
+
if (_.originalSettings.mobileFirst === false) {
|
1125
|
+
if (respondToWidth < _.breakpoints[breakpoint]) {
|
1126
|
+
targetBreakpoint = _.breakpoints[breakpoint];
|
1127
|
+
}
|
1128
|
+
} else {
|
1129
|
+
if (respondToWidth > _.breakpoints[breakpoint]) {
|
1130
|
+
targetBreakpoint = _.breakpoints[breakpoint];
|
1131
|
+
}
|
1132
|
+
}
|
1133
|
+
}
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
if (targetBreakpoint !== null) {
|
1137
|
+
if (_.activeBreakpoint !== null) {
|
1138
|
+
if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
|
1139
|
+
_.activeBreakpoint =
|
1140
|
+
targetBreakpoint;
|
1141
|
+
if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
|
1142
|
+
_.unslick(targetBreakpoint);
|
1143
|
+
} else {
|
1144
|
+
_.options = $.extend({}, _.originalSettings,
|
1145
|
+
_.breakpointSettings[
|
1146
|
+
targetBreakpoint]);
|
1147
|
+
if (initial === true) {
|
1148
|
+
_.currentSlide = _.options.initialSlide;
|
1149
|
+
}
|
1150
|
+
_.refresh(initial);
|
1151
|
+
}
|
1152
|
+
triggerBreakpoint = targetBreakpoint;
|
1153
|
+
}
|
1154
|
+
} else {
|
1155
|
+
_.activeBreakpoint = targetBreakpoint;
|
1156
|
+
if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
|
1157
|
+
_.unslick(targetBreakpoint);
|
1158
|
+
} else {
|
1159
|
+
_.options = $.extend({}, _.originalSettings,
|
1160
|
+
_.breakpointSettings[
|
1161
|
+
targetBreakpoint]);
|
1162
|
+
if (initial === true) {
|
1163
|
+
_.currentSlide = _.options.initialSlide;
|
1164
|
+
}
|
1165
|
+
_.refresh(initial);
|
1166
|
+
}
|
1167
|
+
triggerBreakpoint = targetBreakpoint;
|
1168
|
+
}
|
1169
|
+
} else {
|
1170
|
+
if (_.activeBreakpoint !== null) {
|
1171
|
+
_.activeBreakpoint = null;
|
1172
|
+
_.options = _.originalSettings;
|
1173
|
+
if (initial === true) {
|
1174
|
+
_.currentSlide = _.options.initialSlide;
|
1175
|
+
}
|
1176
|
+
_.refresh(initial);
|
1177
|
+
triggerBreakpoint = targetBreakpoint;
|
1178
|
+
}
|
1179
|
+
}
|
1180
|
+
|
1181
|
+
// only trigger breakpoints during an actual break. not on initialize.
|
1182
|
+
if( !initial && triggerBreakpoint !== false ) {
|
1183
|
+
_.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
|
1184
|
+
}
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
};
|
1188
|
+
|
1189
|
+
Slick.prototype.changeSlide = function(event, dontAnimate) {
|
1190
|
+
|
1191
|
+
var _ = this,
|
1192
|
+
$target = $(event.currentTarget),
|
1193
|
+
indexOffset, slideOffset, unevenOffset;
|
1194
|
+
|
1195
|
+
// If target is a link, prevent default action.
|
1196
|
+
if($target.is('a')) {
|
1197
|
+
event.preventDefault();
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
// If target is not the <li> element (ie: a child), find the <li>.
|
1201
|
+
if(!$target.is('li')) {
|
1202
|
+
$target = $target.closest('li');
|
1203
|
+
}
|
1204
|
+
|
1205
|
+
unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
|
1206
|
+
indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
|
1207
|
+
|
1208
|
+
switch (event.data.message) {
|
1209
|
+
|
1210
|
+
case 'previous':
|
1211
|
+
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
|
1212
|
+
if (_.slideCount > _.options.slidesToShow) {
|
1213
|
+
_.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
|
1214
|
+
}
|
1215
|
+
break;
|
1216
|
+
|
1217
|
+
case 'next':
|
1218
|
+
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
|
1219
|
+
if (_.slideCount > _.options.slidesToShow) {
|
1220
|
+
_.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
|
1221
|
+
}
|
1222
|
+
break;
|
1223
|
+
|
1224
|
+
case 'index':
|
1225
|
+
var index = event.data.index === 0 ? 0 :
|
1226
|
+
event.data.index || $target.index() * _.options.slidesToScroll;
|
1227
|
+
|
1228
|
+
_.slideHandler(_.checkNavigable(index), false, dontAnimate);
|
1229
|
+
$target.children().trigger('focus');
|
1230
|
+
break;
|
1231
|
+
|
1232
|
+
default:
|
1233
|
+
return;
|
1234
|
+
}
|
1235
|
+
|
1236
|
+
};
|
1237
|
+
|
1238
|
+
Slick.prototype.checkNavigable = function(index) {
|
1239
|
+
|
1240
|
+
var _ = this,
|
1241
|
+
navigables, prevNavigable;
|
1242
|
+
|
1243
|
+
navigables = _.getNavigableIndexes();
|
1244
|
+
prevNavigable = 0;
|
1245
|
+
if (index > navigables[navigables.length - 1]) {
|
1246
|
+
index = navigables[navigables.length - 1];
|
1247
|
+
} else {
|
1248
|
+
for (var n in navigables) {
|
1249
|
+
if (index < navigables[n]) {
|
1250
|
+
index = prevNavigable;
|
1251
|
+
break;
|
1252
|
+
}
|
1253
|
+
prevNavigable = navigables[n];
|
1254
|
+
}
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
return index;
|
1258
|
+
};
|
1259
|
+
|
1260
|
+
Slick.prototype.cleanUpEvents = function() {
|
1261
|
+
|
1262
|
+
var _ = this;
|
1263
|
+
|
1264
|
+
if (_.options.dots && _.$dots !== null) {
|
1265
|
+
|
1266
|
+
$('li', _.$dots)
|
1267
|
+
.off('click.slick', _.changeSlide)
|
1268
|
+
.off('mouseenter.slick', $.proxy(_.interrupt, _, true))
|
1269
|
+
.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
1270
|
+
|
1271
|
+
}
|
1272
|
+
|
1273
|
+
_.$slider.off('focus.slick blur.slick');
|
1274
|
+
|
1275
|
+
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
1276
|
+
_.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
|
1277
|
+
_.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
|
1278
|
+
}
|
1279
|
+
|
1280
|
+
_.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
|
1281
|
+
_.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
|
1282
|
+
_.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
|
1283
|
+
_.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
|
1284
|
+
|
1285
|
+
_.$list.off('click.slick', _.clickHandler);
|
1286
|
+
|
1287
|
+
$(document).off(_.visibilityChange, _.visibility);
|
1288
|
+
|
1289
|
+
_.cleanUpSlideEvents();
|
1290
|
+
|
1291
|
+
if (_.options.accessibility === true) {
|
1292
|
+
_.$list.off('keydown.slick', _.keyHandler);
|
1293
|
+
}
|
1294
|
+
|
1295
|
+
if (_.options.focusOnSelect === true) {
|
1296
|
+
$(_.$slideTrack).children().off('click.slick', _.selectHandler);
|
1297
|
+
}
|
1298
|
+
|
1299
|
+
$(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
|
1300
|
+
|
1301
|
+
$(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
|
1302
|
+
|
1303
|
+
$('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
|
1304
|
+
|
1305
|
+
$(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
|
1306
|
+
$(document).off('ready.slick.slick-' + _.instanceUid, _.setPosition);
|
1307
|
+
|
1308
|
+
};
|
1309
|
+
|
1310
|
+
Slick.prototype.cleanUpSlideEvents = function() {
|
1311
|
+
|
1312
|
+
var _ = this;
|
1313
|
+
|
1314
|
+
_.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
|
1315
|
+
_.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
1316
|
+
|
1317
|
+
};
|
1318
|
+
|
1319
|
+
Slick.prototype.cleanUpRows = function() {
|
1320
|
+
|
1321
|
+
var _ = this, originalSlides;
|
1322
|
+
|
1323
|
+
if(_.options.rows > 1) {
|
1324
|
+
originalSlides = _.$slides.children().children();
|
1325
|
+
originalSlides.removeAttr('style');
|
1326
|
+
_.$slider.empty().append(originalSlides);
|
1327
|
+
}
|
1328
|
+
|
1329
|
+
};
|
1330
|
+
|
1331
|
+
Slick.prototype.clickHandler = function(event) {
|
1332
|
+
|
1333
|
+
var _ = this;
|
1334
|
+
|
1335
|
+
if (_.shouldClick === false) {
|
1336
|
+
event.stopImmediatePropagation();
|
1337
|
+
event.stopPropagation();
|
1338
|
+
event.preventDefault();
|
1339
|
+
}
|
1340
|
+
|
1341
|
+
};
|
1342
|
+
|
1343
|
+
Slick.prototype.destroy = function(refresh) {
|
1344
|
+
|
1345
|
+
var _ = this;
|
1346
|
+
|
1347
|
+
_.autoPlayClear();
|
1348
|
+
|
1349
|
+
_.touchObject = {};
|
1350
|
+
|
1351
|
+
_.cleanUpEvents();
|
1352
|
+
|
1353
|
+
$('.slick-cloned', _.$slider).detach();
|
1354
|
+
|
1355
|
+
if (_.$dots) {
|
1356
|
+
_.$dots.remove();
|
1357
|
+
}
|
1358
|
+
|
1359
|
+
|
1360
|
+
if ( _.$prevArrow && _.$prevArrow.length ) {
|
1361
|
+
|
1362
|
+
_.$prevArrow
|
1363
|
+
.removeClass('slick-disabled slick-arrow slick-hidden')
|
1364
|
+
.removeAttr('aria-hidden aria-disabled tabindex')
|
1365
|
+
.css('display','');
|
1366
|
+
|
1367
|
+
if ( _.htmlExpr.test( _.options.prevArrow )) {
|
1368
|
+
_.$prevArrow.remove();
|
1369
|
+
}
|
1370
|
+
}
|
1371
|
+
|
1372
|
+
if ( _.$nextArrow && _.$nextArrow.length ) {
|
1373
|
+
|
1374
|
+
_.$nextArrow
|
1375
|
+
.removeClass('slick-disabled slick-arrow slick-hidden')
|
1376
|
+
.removeAttr('aria-hidden aria-disabled tabindex')
|
1377
|
+
.css('display','');
|
1378
|
+
|
1379
|
+
if ( _.htmlExpr.test( _.options.nextArrow )) {
|
1380
|
+
_.$nextArrow.remove();
|
1381
|
+
}
|
1382
|
+
|
1383
|
+
}
|
1384
|
+
|
1385
|
+
|
1386
|
+
if (_.$slides) {
|
1387
|
+
|
1388
|
+
_.$slides
|
1389
|
+
.removeClass('slick-slide slick-active slick-center slick-visible slick-current')
|
1390
|
+
.removeAttr('aria-hidden')
|
1391
|
+
.removeAttr('data-slick-index')
|
1392
|
+
.each(function(){
|
1393
|
+
$(this).attr('style', $(this).data('originalStyling'));
|
1394
|
+
});
|
1395
|
+
|
1396
|
+
_.$slideTrack.children(this.options.slide).detach();
|
1397
|
+
|
1398
|
+
_.$slideTrack.detach();
|
1399
|
+
|
1400
|
+
_.$list.detach();
|
1401
|
+
|
1402
|
+
_.$slider.append(_.$slides);
|
1403
|
+
}
|
1404
|
+
|
1405
|
+
_.cleanUpRows();
|
1406
|
+
|
1407
|
+
_.$slider.removeClass('slick-slider');
|
1408
|
+
_.$slider.removeClass('slick-initialized');
|
1409
|
+
_.$slider.removeClass('slick-dotted');
|
1410
|
+
|
1411
|
+
_.unslicked = true;
|
1412
|
+
|
1413
|
+
if(!refresh) {
|
1414
|
+
_.$slider.trigger('destroy', [_]);
|
1415
|
+
}
|
1416
|
+
|
1417
|
+
};
|
1418
|
+
|
1419
|
+
Slick.prototype.disableTransition = function(slide) {
|
1420
|
+
|
1421
|
+
var _ = this,
|
1422
|
+
transition = {};
|
1423
|
+
|
1424
|
+
transition[_.transitionType] = '';
|
1425
|
+
|
1426
|
+
if (_.options.fade === false) {
|
1427
|
+
_.$slideTrack.css(transition);
|
1428
|
+
} else {
|
1429
|
+
_.$slides.eq(slide).css(transition);
|
1430
|
+
}
|
1431
|
+
|
1432
|
+
};
|
1433
|
+
|
1434
|
+
Slick.prototype.fadeSlide = function(slideIndex, callback) {
|
1435
|
+
|
1436
|
+
var _ = this;
|
1437
|
+
|
1438
|
+
if (_.cssTransitions === false) {
|
1439
|
+
|
1440
|
+
_.$slides.eq(slideIndex).css({
|
1441
|
+
zIndex: _.options.zIndex
|
1442
|
+
});
|
1443
|
+
|
1444
|
+
_.$slides.eq(slideIndex).animate({
|
1445
|
+
opacity: 1
|
1446
|
+
}, _.options.speed, _.options.easing, callback);
|
1447
|
+
|
1448
|
+
} else {
|
1449
|
+
|
1450
|
+
_.applyTransition(slideIndex);
|
1451
|
+
|
1452
|
+
_.$slides.eq(slideIndex).css({
|
1453
|
+
opacity: 1,
|
1454
|
+
zIndex: _.options.zIndex
|
1455
|
+
});
|
1456
|
+
|
1457
|
+
if (callback) {
|
1458
|
+
setTimeout(function() {
|
1459
|
+
|
1460
|
+
_.disableTransition(slideIndex);
|
1461
|
+
|
1462
|
+
callback.call();
|
1463
|
+
}, _.options.speed);
|
1464
|
+
}
|
1465
|
+
|
1466
|
+
}
|
1467
|
+
|
1468
|
+
};
|
1469
|
+
|
1470
|
+
Slick.prototype.fadeSlideOut = function(slideIndex) {
|
1471
|
+
|
1472
|
+
var _ = this;
|
1473
|
+
|
1474
|
+
if (_.cssTransitions === false) {
|
1475
|
+
|
1476
|
+
_.$slides.eq(slideIndex).animate({
|
1477
|
+
opacity: 0,
|
1478
|
+
zIndex: _.options.zIndex - 2
|
1479
|
+
}, _.options.speed, _.options.easing);
|
1480
|
+
|
1481
|
+
} else {
|
1482
|
+
|
1483
|
+
_.applyTransition(slideIndex);
|
1484
|
+
|
1485
|
+
_.$slides.eq(slideIndex).css({
|
1486
|
+
opacity: 0,
|
1487
|
+
zIndex: _.options.zIndex - 2
|
1488
|
+
});
|
1489
|
+
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
};
|
1493
|
+
|
1494
|
+
Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
|
1495
|
+
|
1496
|
+
var _ = this;
|
1497
|
+
|
1498
|
+
if (filter !== null) {
|
1499
|
+
|
1500
|
+
_.$slidesCache = _.$slides;
|
1501
|
+
|
1502
|
+
_.unload();
|
1503
|
+
|
1504
|
+
_.$slideTrack.children(this.options.slide).detach();
|
1505
|
+
|
1506
|
+
_.$slidesCache.filter(filter).appendTo(_.$slideTrack);
|
1507
|
+
|
1508
|
+
_.reinit();
|
1509
|
+
|
1510
|
+
}
|
1511
|
+
|
1512
|
+
};
|
1513
|
+
|
1514
|
+
Slick.prototype.focusHandler = function() {
|
1515
|
+
|
1516
|
+
var _ = this;
|
1517
|
+
|
1518
|
+
_.$slider
|
1519
|
+
.off('focus.slick blur.slick')
|
1520
|
+
.on('focus.slick blur.slick',
|
1521
|
+
'*:not(.slick-arrow)', function(event) {
|
1522
|
+
|
1523
|
+
event.stopImmediatePropagation();
|
1524
|
+
var $sf = $(this);
|
1525
|
+
|
1526
|
+
setTimeout(function() {
|
1527
|
+
|
1528
|
+
if( _.options.pauseOnFocus ) {
|
1529
|
+
_.focussed = $sf.is(':focus');
|
1530
|
+
_.autoPlay();
|
1531
|
+
}
|
1532
|
+
|
1533
|
+
}, 0);
|
1534
|
+
|
1535
|
+
});
|
1536
|
+
};
|
1537
|
+
|
1538
|
+
Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
|
1539
|
+
|
1540
|
+
var _ = this;
|
1541
|
+
return _.currentSlide;
|
1542
|
+
|
1543
|
+
};
|
1544
|
+
|
1545
|
+
Slick.prototype.getDotCount = function() {
|
1546
|
+
|
1547
|
+
var _ = this;
|
1548
|
+
|
1549
|
+
var breakPoint = 0;
|
1550
|
+
var counter = 0;
|
1551
|
+
var pagerQty = 0;
|
1552
|
+
|
1553
|
+
if (_.options.infinite === true) {
|
1554
|
+
while (breakPoint < _.slideCount) {
|
1555
|
+
++pagerQty;
|
1556
|
+
breakPoint = counter + _.options.slidesToScroll;
|
1557
|
+
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
|
1558
|
+
}
|
1559
|
+
} else if (_.options.centerMode === true) {
|
1560
|
+
pagerQty = _.slideCount;
|
1561
|
+
} else if(!_.options.asNavFor) {
|
1562
|
+
pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
|
1563
|
+
}else {
|
1564
|
+
while (breakPoint < _.slideCount) {
|
1565
|
+
++pagerQty;
|
1566
|
+
breakPoint = counter + _.options.slidesToScroll;
|
1567
|
+
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
|
1568
|
+
}
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
return pagerQty - 1;
|
1572
|
+
|
1573
|
+
};
|
1574
|
+
|
1575
|
+
Slick.prototype.getLeft = function(slideIndex) {
|
1576
|
+
|
1577
|
+
var _ = this,
|
1578
|
+
targetLeft,
|
1579
|
+
verticalHeight,
|
1580
|
+
verticalOffset = 0,
|
1581
|
+
targetSlide;
|
1582
|
+
|
1583
|
+
_.slideOffset = 0;
|
1584
|
+
verticalHeight = _.$slides.first().outerHeight(true);
|
1585
|
+
|
1586
|
+
if (_.options.infinite === true) {
|
1587
|
+
if (_.slideCount > _.options.slidesToShow) {
|
1588
|
+
_.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
|
1589
|
+
verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
|
1590
|
+
}
|
1591
|
+
if (_.slideCount % _.options.slidesToScroll !== 0) {
|
1592
|
+
if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
|
1593
|
+
if (slideIndex > _.slideCount) {
|
1594
|
+
_.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
|
1595
|
+
verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
|
1596
|
+
} else {
|
1597
|
+
_.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
|
1598
|
+
verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
|
1599
|
+
}
|
1600
|
+
}
|
1601
|
+
}
|
1602
|
+
} else {
|
1603
|
+
if (slideIndex + _.options.slidesToShow > _.slideCount) {
|
1604
|
+
_.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
|
1605
|
+
verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
|
1606
|
+
}
|
1607
|
+
}
|
1608
|
+
|
1609
|
+
if (_.slideCount <= _.options.slidesToShow) {
|
1610
|
+
_.slideOffset = 0;
|
1611
|
+
verticalOffset = 0;
|
1612
|
+
}
|
1613
|
+
|
1614
|
+
if (_.options.centerMode === true && _.options.infinite === true) {
|
1615
|
+
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
|
1616
|
+
} else if (_.options.centerMode === true) {
|
1617
|
+
_.slideOffset = 0;
|
1618
|
+
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
|
1619
|
+
}
|
1620
|
+
|
1621
|
+
if (_.options.vertical === false) {
|
1622
|
+
targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
|
1623
|
+
} else {
|
1624
|
+
targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
|
1625
|
+
}
|
1626
|
+
|
1627
|
+
if (_.options.variableWidth === true) {
|
1628
|
+
|
1629
|
+
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
|
1630
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
|
1631
|
+
} else {
|
1632
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
|
1633
|
+
}
|
1634
|
+
|
1635
|
+
if (_.options.rtl === true) {
|
1636
|
+
if (targetSlide[0]) {
|
1637
|
+
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
|
1638
|
+
} else {
|
1639
|
+
targetLeft = 0;
|
1640
|
+
}
|
1641
|
+
} else {
|
1642
|
+
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
|
1643
|
+
}
|
1644
|
+
|
1645
|
+
if (_.options.centerMode === true) {
|
1646
|
+
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
|
1647
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
|
1648
|
+
} else {
|
1649
|
+
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
|
1650
|
+
}
|
1651
|
+
|
1652
|
+
if (_.options.rtl === true) {
|
1653
|
+
if (targetSlide[0]) {
|
1654
|
+
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
|
1655
|
+
} else {
|
1656
|
+
targetLeft = 0;
|
1657
|
+
}
|
1658
|
+
} else {
|
1659
|
+
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
|
1660
|
+
}
|
1661
|
+
|
1662
|
+
targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
|
1663
|
+
}
|
1664
|
+
}
|
1665
|
+
|
1666
|
+
return targetLeft;
|
1667
|
+
|
1668
|
+
};
|
1669
|
+
|
1670
|
+
Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
|
1671
|
+
|
1672
|
+
var _ = this;
|
1673
|
+
|
1674
|
+
return _.options[option];
|
1675
|
+
|
1676
|
+
};
|
1677
|
+
|
1678
|
+
Slick.prototype.getNavigableIndexes = function() {
|
1679
|
+
|
1680
|
+
var _ = this,
|
1681
|
+
breakPoint = 0,
|
1682
|
+
counter = 0,
|
1683
|
+
indexes = [],
|
1684
|
+
max;
|
1685
|
+
|
1686
|
+
if (_.options.infinite === false) {
|
1687
|
+
max = _.slideCount;
|
1688
|
+
} else {
|
1689
|
+
breakPoint = _.options.slidesToScroll * -1;
|
1690
|
+
counter = _.options.slidesToScroll * -1;
|
1691
|
+
max = _.slideCount * 2;
|
1692
|
+
}
|
1693
|
+
|
1694
|
+
while (breakPoint < max) {
|
1695
|
+
indexes.push(breakPoint);
|
1696
|
+
breakPoint = counter + _.options.slidesToScroll;
|
1697
|
+
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
|
1698
|
+
}
|
1699
|
+
|
1700
|
+
return indexes;
|
1701
|
+
|
1702
|
+
};
|
1703
|
+
|
1704
|
+
Slick.prototype.getSlick = function() {
|
1705
|
+
|
1706
|
+
return this;
|
1707
|
+
|
1708
|
+
};
|
1709
|
+
|
1710
|
+
Slick.prototype.getSlideCount = function() {
|
1711
|
+
|
1712
|
+
var _ = this,
|
1713
|
+
slidesTraversed, swipedSlide, centerOffset;
|
1714
|
+
|
1715
|
+
centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
|
1716
|
+
|
1717
|
+
if (_.options.swipeToSlide === true) {
|
1718
|
+
_.$slideTrack.find('.slick-slide').each(function(index, slide) {
|
1719
|
+
if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
|
1720
|
+
swipedSlide = slide;
|
1721
|
+
return false;
|
1722
|
+
}
|
1723
|
+
});
|
1724
|
+
|
1725
|
+
slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
|
1726
|
+
|
1727
|
+
return slidesTraversed;
|
1728
|
+
|
1729
|
+
} else {
|
1730
|
+
return _.options.slidesToScroll;
|
1731
|
+
}
|
1732
|
+
|
1733
|
+
};
|
1734
|
+
|
1735
|
+
Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
|
1736
|
+
|
1737
|
+
var _ = this;
|
1738
|
+
|
1739
|
+
_.changeSlide({
|
1740
|
+
data: {
|
1741
|
+
message: 'index',
|
1742
|
+
index: parseInt(slide)
|
1743
|
+
}
|
1744
|
+
}, dontAnimate);
|
1745
|
+
|
1746
|
+
};
|
1747
|
+
|
1748
|
+
Slick.prototype.init = function(creation) {
|
1749
|
+
|
1750
|
+
var _ = this;
|
1751
|
+
|
1752
|
+
if (!$(_.$slider).hasClass('slick-initialized')) {
|
1753
|
+
|
1754
|
+
$(_.$slider).addClass('slick-initialized');
|
1755
|
+
|
1756
|
+
_.buildRows();
|
1757
|
+
_.buildOut();
|
1758
|
+
_.setProps();
|
1759
|
+
_.startLoad();
|
1760
|
+
_.loadSlider();
|
1761
|
+
_.initializeEvents();
|
1762
|
+
_.updateArrows();
|
1763
|
+
_.updateDots();
|
1764
|
+
_.checkResponsive(true);
|
1765
|
+
_.focusHandler();
|
1766
|
+
|
1767
|
+
}
|
1768
|
+
|
1769
|
+
if (creation) {
|
1770
|
+
_.$slider.trigger('init', [_]);
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
if (_.options.accessibility === true) {
|
1774
|
+
_.initADA();
|
1775
|
+
}
|
1776
|
+
|
1777
|
+
if ( _.options.autoplay ) {
|
1778
|
+
|
1779
|
+
_.paused = false;
|
1780
|
+
_.autoPlay();
|
1781
|
+
|
1782
|
+
}
|
1783
|
+
|
1784
|
+
};
|
1785
|
+
|
1786
|
+
Slick.prototype.initADA = function() {
|
1787
|
+
var _ = this;
|
1788
|
+
_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
|
1789
|
+
'aria-hidden': 'true',
|
1790
|
+
'tabindex': '-1'
|
1791
|
+
}).find('a, input, button, select').attr({
|
1792
|
+
'tabindex': '-1'
|
1793
|
+
});
|
1794
|
+
|
1795
|
+
_.$slideTrack.attr('role', 'listbox');
|
1796
|
+
|
1797
|
+
_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
|
1798
|
+
$(this).attr({
|
1799
|
+
'role': 'option',
|
1800
|
+
'aria-describedby': 'slick-slide' + _.instanceUid + i + ''
|
1801
|
+
});
|
1802
|
+
});
|
1803
|
+
|
1804
|
+
if (_.$dots !== null) {
|
1805
|
+
_.$dots.attr('role', 'tablist').find('li').each(function(i) {
|
1806
|
+
$(this).attr({
|
1807
|
+
'role': 'presentation',
|
1808
|
+
'aria-selected': 'false',
|
1809
|
+
'aria-controls': 'navigation' + _.instanceUid + i + '',
|
1810
|
+
'id': 'slick-slide' + _.instanceUid + i + ''
|
1811
|
+
});
|
1812
|
+
})
|
1813
|
+
.first().attr('aria-selected', 'true').end()
|
1814
|
+
.find('button').attr('role', 'button').end()
|
1815
|
+
.closest('div').attr('role', 'toolbar');
|
1816
|
+
}
|
1817
|
+
_.activateADA();
|
1818
|
+
|
1819
|
+
};
|
1820
|
+
|
1821
|
+
Slick.prototype.initArrowEvents = function() {
|
1822
|
+
|
1823
|
+
var _ = this;
|
1824
|
+
|
1825
|
+
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
1826
|
+
_.$prevArrow
|
1827
|
+
.off('click.slick')
|
1828
|
+
.on('click.slick', {
|
1829
|
+
message: 'previous'
|
1830
|
+
}, _.changeSlide);
|
1831
|
+
_.$nextArrow
|
1832
|
+
.off('click.slick')
|
1833
|
+
.on('click.slick', {
|
1834
|
+
message: 'next'
|
1835
|
+
}, _.changeSlide);
|
1836
|
+
}
|
1837
|
+
|
1838
|
+
};
|
1839
|
+
|
1840
|
+
Slick.prototype.initDotEvents = function() {
|
1841
|
+
|
1842
|
+
var _ = this;
|
1843
|
+
|
1844
|
+
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
1845
|
+
$('li', _.$dots).on('click.slick', {
|
1846
|
+
message: 'index'
|
1847
|
+
}, _.changeSlide);
|
1848
|
+
}
|
1849
|
+
|
1850
|
+
if ( _.options.dots === true && _.options.pauseOnDotsHover === true ) {
|
1851
|
+
|
1852
|
+
$('li', _.$dots)
|
1853
|
+
.on('mouseenter.slick', $.proxy(_.interrupt, _, true))
|
1854
|
+
.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
1855
|
+
|
1856
|
+
}
|
1857
|
+
|
1858
|
+
};
|
1859
|
+
|
1860
|
+
Slick.prototype.initSlideEvents = function() {
|
1861
|
+
|
1862
|
+
var _ = this;
|
1863
|
+
|
1864
|
+
if ( _.options.pauseOnHover ) {
|
1865
|
+
|
1866
|
+
_.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
|
1867
|
+
_.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
|
1868
|
+
|
1869
|
+
}
|
1870
|
+
|
1871
|
+
};
|
1872
|
+
|
1873
|
+
Slick.prototype.initializeEvents = function() {
|
1874
|
+
|
1875
|
+
var _ = this;
|
1876
|
+
|
1877
|
+
_.initArrowEvents();
|
1878
|
+
|
1879
|
+
_.initDotEvents();
|
1880
|
+
_.initSlideEvents();
|
1881
|
+
|
1882
|
+
_.$list.on('touchstart.slick mousedown.slick', {
|
1883
|
+
action: 'start'
|
1884
|
+
}, _.swipeHandler);
|
1885
|
+
_.$list.on('touchmove.slick mousemove.slick', {
|
1886
|
+
action: 'move'
|
1887
|
+
}, _.swipeHandler);
|
1888
|
+
_.$list.on('touchend.slick mouseup.slick', {
|
1889
|
+
action: 'end'
|
1890
|
+
}, _.swipeHandler);
|
1891
|
+
_.$list.on('touchcancel.slick mouseleave.slick', {
|
1892
|
+
action: 'end'
|
1893
|
+
}, _.swipeHandler);
|
1894
|
+
|
1895
|
+
_.$list.on('click.slick', _.clickHandler);
|
1896
|
+
|
1897
|
+
$(document).on(_.visibilityChange, $.proxy(_.visibility, _));
|
1898
|
+
|
1899
|
+
if (_.options.accessibility === true) {
|
1900
|
+
_.$list.on('keydown.slick', _.keyHandler);
|
1901
|
+
}
|
1902
|
+
|
1903
|
+
if (_.options.focusOnSelect === true) {
|
1904
|
+
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
|
1905
|
+
}
|
1906
|
+
|
1907
|
+
$(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
|
1908
|
+
|
1909
|
+
$(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
|
1910
|
+
|
1911
|
+
$('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
|
1912
|
+
|
1913
|
+
$(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
|
1914
|
+
$(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
|
1915
|
+
|
1916
|
+
};
|
1917
|
+
|
1918
|
+
Slick.prototype.initUI = function() {
|
1919
|
+
|
1920
|
+
var _ = this;
|
1921
|
+
|
1922
|
+
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
1923
|
+
|
1924
|
+
_.$prevArrow.show();
|
1925
|
+
_.$nextArrow.show();
|
1926
|
+
|
1927
|
+
}
|
1928
|
+
|
1929
|
+
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
1930
|
+
|
1931
|
+
_.$dots.show();
|
1932
|
+
|
1933
|
+
}
|
1934
|
+
|
1935
|
+
};
|
1936
|
+
|
1937
|
+
Slick.prototype.keyHandler = function(event) {
|
1938
|
+
|
1939
|
+
var _ = this;
|
1940
|
+
//Dont slide if the cursor is inside the form fields and arrow keys are pressed
|
1941
|
+
if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
|
1942
|
+
if (event.keyCode === 37 && _.options.accessibility === true) {
|
1943
|
+
_.changeSlide({
|
1944
|
+
data: {
|
1945
|
+
message: _.options.rtl === true ? 'next' : 'previous'
|
1946
|
+
}
|
1947
|
+
});
|
1948
|
+
} else if (event.keyCode === 39 && _.options.accessibility === true) {
|
1949
|
+
_.changeSlide({
|
1950
|
+
data: {
|
1951
|
+
message: _.options.rtl === true ? 'previous' : 'next'
|
1952
|
+
}
|
1953
|
+
});
|
1954
|
+
}
|
1955
|
+
}
|
1956
|
+
|
1957
|
+
};
|
1958
|
+
|
1959
|
+
Slick.prototype.lazyLoad = function() {
|
1960
|
+
|
1961
|
+
var _ = this,
|
1962
|
+
loadRange, cloneRange, rangeStart, rangeEnd;
|
1963
|
+
|
1964
|
+
function loadImages(imagesScope) {
|
1965
|
+
|
1966
|
+
$('img[data-lazy]', imagesScope).each(function() {
|
1967
|
+
|
1968
|
+
var image = $(this),
|
1969
|
+
imageSource = $(this).attr('data-lazy'),
|
1970
|
+
imageToLoad = document.createElement('img');
|
1971
|
+
|
1972
|
+
imageToLoad.onload = function() {
|
1973
|
+
|
1974
|
+
image
|
1975
|
+
.animate({ opacity: 0 }, 100, function() {
|
1976
|
+
image
|
1977
|
+
.attr('src', imageSource)
|
1978
|
+
.animate({ opacity: 1 }, 200, function() {
|
1979
|
+
image
|
1980
|
+
.removeAttr('data-lazy')
|
1981
|
+
.removeClass('slick-loading');
|
1982
|
+
});
|
1983
|
+
_.$slider.trigger('lazyLoaded', [_, image, imageSource]);
|
1984
|
+
});
|
1985
|
+
|
1986
|
+
};
|
1987
|
+
|
1988
|
+
imageToLoad.onerror = function() {
|
1989
|
+
|
1990
|
+
image
|
1991
|
+
.removeAttr( 'data-lazy' )
|
1992
|
+
.removeClass( 'slick-loading' )
|
1993
|
+
.addClass( 'slick-lazyload-error' );
|
1994
|
+
|
1995
|
+
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
|
1996
|
+
|
1997
|
+
};
|
1998
|
+
|
1999
|
+
imageToLoad.src = imageSource;
|
2000
|
+
|
2001
|
+
});
|
2002
|
+
|
2003
|
+
}
|
2004
|
+
|
2005
|
+
if (_.options.centerMode === true) {
|
2006
|
+
if (_.options.infinite === true) {
|
2007
|
+
rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
|
2008
|
+
rangeEnd = rangeStart + _.options.slidesToShow + 2;
|
2009
|
+
} else {
|
2010
|
+
rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
|
2011
|
+
rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
|
2012
|
+
}
|
2013
|
+
} else {
|
2014
|
+
rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
|
2015
|
+
rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
|
2016
|
+
if (_.options.fade === true) {
|
2017
|
+
if (rangeStart > 0) rangeStart--;
|
2018
|
+
if (rangeEnd <= _.slideCount) rangeEnd++;
|
2019
|
+
}
|
2020
|
+
}
|
2021
|
+
|
2022
|
+
loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
|
2023
|
+
loadImages(loadRange);
|
2024
|
+
|
2025
|
+
if (_.slideCount <= _.options.slidesToShow) {
|
2026
|
+
cloneRange = _.$slider.find('.slick-slide');
|
2027
|
+
loadImages(cloneRange);
|
2028
|
+
} else
|
2029
|
+
if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
|
2030
|
+
cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
|
2031
|
+
loadImages(cloneRange);
|
2032
|
+
} else if (_.currentSlide === 0) {
|
2033
|
+
cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
|
2034
|
+
loadImages(cloneRange);
|
2035
|
+
}
|
2036
|
+
|
2037
|
+
};
|
2038
|
+
|
2039
|
+
Slick.prototype.loadSlider = function() {
|
2040
|
+
|
2041
|
+
var _ = this;
|
2042
|
+
|
2043
|
+
_.setPosition();
|
2044
|
+
|
2045
|
+
_.$slideTrack.css({
|
2046
|
+
opacity: 1
|
2047
|
+
});
|
2048
|
+
|
2049
|
+
_.$slider.removeClass('slick-loading');
|
2050
|
+
|
2051
|
+
_.initUI();
|
2052
|
+
|
2053
|
+
if (_.options.lazyLoad === 'progressive') {
|
2054
|
+
_.progressiveLazyLoad();
|
2055
|
+
}
|
2056
|
+
|
2057
|
+
};
|
2058
|
+
|
2059
|
+
Slick.prototype.next = Slick.prototype.slickNext = function() {
|
2060
|
+
|
2061
|
+
var _ = this;
|
2062
|
+
|
2063
|
+
_.changeSlide({
|
2064
|
+
data: {
|
2065
|
+
message: 'next'
|
2066
|
+
}
|
2067
|
+
});
|
2068
|
+
|
2069
|
+
};
|
2070
|
+
|
2071
|
+
Slick.prototype.orientationChange = function() {
|
2072
|
+
|
2073
|
+
var _ = this;
|
2074
|
+
|
2075
|
+
_.checkResponsive();
|
2076
|
+
_.setPosition();
|
2077
|
+
|
2078
|
+
};
|
2079
|
+
|
2080
|
+
Slick.prototype.pause = Slick.prototype.slickPause = function() {
|
2081
|
+
|
2082
|
+
var _ = this;
|
2083
|
+
|
2084
|
+
_.autoPlayClear();
|
2085
|
+
_.paused = true;
|
2086
|
+
|
2087
|
+
};
|
2088
|
+
|
2089
|
+
Slick.prototype.play = Slick.prototype.slickPlay = function() {
|
2090
|
+
|
2091
|
+
var _ = this;
|
2092
|
+
|
2093
|
+
_.autoPlay();
|
2094
|
+
_.options.autoplay = true;
|
2095
|
+
_.paused = false;
|
2096
|
+
_.focussed = false;
|
2097
|
+
_.interrupted = false;
|
2098
|
+
|
2099
|
+
};
|
2100
|
+
|
2101
|
+
Slick.prototype.postSlide = function(index) {
|
2102
|
+
|
2103
|
+
var _ = this;
|
2104
|
+
|
2105
|
+
if( !_.unslicked ) {
|
2106
|
+
|
2107
|
+
_.$slider.trigger('afterChange', [_, index]);
|
2108
|
+
|
2109
|
+
_.animating = false;
|
2110
|
+
|
2111
|
+
_.setPosition();
|
2112
|
+
|
2113
|
+
_.swipeLeft = null;
|
2114
|
+
|
2115
|
+
if ( _.options.autoplay ) {
|
2116
|
+
_.autoPlay();
|
2117
|
+
}
|
2118
|
+
|
2119
|
+
if (_.options.accessibility === true) {
|
2120
|
+
_.initADA();
|
2121
|
+
}
|
2122
|
+
|
2123
|
+
}
|
2124
|
+
|
2125
|
+
};
|
2126
|
+
|
2127
|
+
Slick.prototype.prev = Slick.prototype.slickPrev = function() {
|
2128
|
+
|
2129
|
+
var _ = this;
|
2130
|
+
|
2131
|
+
_.changeSlide({
|
2132
|
+
data: {
|
2133
|
+
message: 'previous'
|
2134
|
+
}
|
2135
|
+
});
|
2136
|
+
|
2137
|
+
};
|
2138
|
+
|
2139
|
+
Slick.prototype.preventDefault = function(event) {
|
2140
|
+
|
2141
|
+
event.preventDefault();
|
2142
|
+
|
2143
|
+
};
|
2144
|
+
|
2145
|
+
Slick.prototype.progressiveLazyLoad = function( tryCount ) {
|
2146
|
+
|
2147
|
+
tryCount = tryCount || 1;
|
2148
|
+
|
2149
|
+
var _ = this,
|
2150
|
+
$imgsToLoad = $( 'img[data-lazy]', _.$slider ),
|
2151
|
+
image,
|
2152
|
+
imageSource,
|
2153
|
+
imageToLoad;
|
2154
|
+
|
2155
|
+
if ( $imgsToLoad.length ) {
|
2156
|
+
|
2157
|
+
image = $imgsToLoad.first();
|
2158
|
+
imageSource = image.attr('data-lazy');
|
2159
|
+
imageToLoad = document.createElement('img');
|
2160
|
+
|
2161
|
+
imageToLoad.onload = function() {
|
2162
|
+
|
2163
|
+
image
|
2164
|
+
.attr( 'src', imageSource )
|
2165
|
+
.removeAttr('data-lazy')
|
2166
|
+
.removeClass('slick-loading');
|
2167
|
+
|
2168
|
+
if ( _.options.adaptiveHeight === true ) {
|
2169
|
+
_.setPosition();
|
2170
|
+
}
|
2171
|
+
|
2172
|
+
_.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
|
2173
|
+
_.progressiveLazyLoad();
|
2174
|
+
|
2175
|
+
};
|
2176
|
+
|
2177
|
+
imageToLoad.onerror = function() {
|
2178
|
+
|
2179
|
+
if ( tryCount < 3 ) {
|
2180
|
+
|
2181
|
+
/**
|
2182
|
+
* try to load the image 3 times,
|
2183
|
+
* leave a slight delay so we don't get
|
2184
|
+
* servers blocking the request.
|
2185
|
+
*/
|
2186
|
+
setTimeout( function() {
|
2187
|
+
_.progressiveLazyLoad( tryCount + 1 );
|
2188
|
+
}, 500 );
|
2189
|
+
|
2190
|
+
} else {
|
2191
|
+
|
2192
|
+
image
|
2193
|
+
.removeAttr( 'data-lazy' )
|
2194
|
+
.removeClass( 'slick-loading' )
|
2195
|
+
.addClass( 'slick-lazyload-error' );
|
2196
|
+
|
2197
|
+
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
|
2198
|
+
|
2199
|
+
_.progressiveLazyLoad();
|
2200
|
+
|
2201
|
+
}
|
2202
|
+
|
2203
|
+
};
|
2204
|
+
|
2205
|
+
imageToLoad.src = imageSource;
|
2206
|
+
|
2207
|
+
} else {
|
2208
|
+
|
2209
|
+
_.$slider.trigger('allImagesLoaded', [ _ ]);
|
2210
|
+
|
2211
|
+
}
|
2212
|
+
|
2213
|
+
};
|
2214
|
+
|
2215
|
+
Slick.prototype.refresh = function( initializing ) {
|
2216
|
+
|
2217
|
+
var _ = this, currentSlide, lastVisibleIndex;
|
2218
|
+
|
2219
|
+
lastVisibleIndex = _.slideCount - _.options.slidesToShow;
|
2220
|
+
|
2221
|
+
// in non-infinite sliders, we don't want to go past the
|
2222
|
+
// last visible index.
|
2223
|
+
if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
|
2224
|
+
_.currentSlide = lastVisibleIndex;
|
2225
|
+
}
|
2226
|
+
|
2227
|
+
// if less slides than to show, go to start.
|
2228
|
+
if ( _.slideCount <= _.options.slidesToShow ) {
|
2229
|
+
_.currentSlide = 0;
|
2230
|
+
|
2231
|
+
}
|
2232
|
+
|
2233
|
+
currentSlide = _.currentSlide;
|
2234
|
+
|
2235
|
+
_.destroy(true);
|
2236
|
+
|
2237
|
+
$.extend(_, _.initials, { currentSlide: currentSlide });
|
2238
|
+
|
2239
|
+
_.init();
|
2240
|
+
|
2241
|
+
if( !initializing ) {
|
2242
|
+
|
2243
|
+
_.changeSlide({
|
2244
|
+
data: {
|
2245
|
+
message: 'index',
|
2246
|
+
index: currentSlide
|
2247
|
+
}
|
2248
|
+
}, false);
|
2249
|
+
|
2250
|
+
}
|
2251
|
+
|
2252
|
+
};
|
2253
|
+
|
2254
|
+
Slick.prototype.registerBreakpoints = function() {
|
2255
|
+
|
2256
|
+
var _ = this, breakpoint, currentBreakpoint, l,
|
2257
|
+
responsiveSettings = _.options.responsive || null;
|
2258
|
+
|
2259
|
+
if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
|
2260
|
+
|
2261
|
+
_.respondTo = _.options.respondTo || 'window';
|
2262
|
+
|
2263
|
+
for ( breakpoint in responsiveSettings ) {
|
2264
|
+
|
2265
|
+
l = _.breakpoints.length-1;
|
2266
|
+
currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
|
2267
|
+
|
2268
|
+
if (responsiveSettings.hasOwnProperty(breakpoint)) {
|
2269
|
+
|
2270
|
+
// loop through the breakpoints and cut out any existing
|
2271
|
+
// ones with the same breakpoint number, we don't want dupes.
|
2272
|
+
while( l >= 0 ) {
|
2273
|
+
if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
|
2274
|
+
_.breakpoints.splice(l,1);
|
2275
|
+
}
|
2276
|
+
l--;
|
2277
|
+
}
|
2278
|
+
|
2279
|
+
_.breakpoints.push(currentBreakpoint);
|
2280
|
+
_.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
|
2281
|
+
|
2282
|
+
}
|
2283
|
+
|
2284
|
+
}
|
2285
|
+
|
2286
|
+
_.breakpoints.sort(function(a, b) {
|
2287
|
+
return ( _.options.mobileFirst ) ? a-b : b-a;
|
2288
|
+
});
|
2289
|
+
|
2290
|
+
}
|
2291
|
+
|
2292
|
+
};
|
2293
|
+
|
2294
|
+
Slick.prototype.reinit = function() {
|
2295
|
+
|
2296
|
+
var _ = this;
|
2297
|
+
|
2298
|
+
_.$slides =
|
2299
|
+
_.$slideTrack
|
2300
|
+
.children(_.options.slide)
|
2301
|
+
.addClass('slick-slide');
|
2302
|
+
|
2303
|
+
_.slideCount = _.$slides.length;
|
2304
|
+
|
2305
|
+
if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
|
2306
|
+
_.currentSlide = _.currentSlide - _.options.slidesToScroll;
|
2307
|
+
}
|
2308
|
+
|
2309
|
+
if (_.slideCount <= _.options.slidesToShow) {
|
2310
|
+
_.currentSlide = 0;
|
2311
|
+
}
|
2312
|
+
|
2313
|
+
_.registerBreakpoints();
|
2314
|
+
|
2315
|
+
_.setProps();
|
2316
|
+
_.setupInfinite();
|
2317
|
+
_.buildArrows();
|
2318
|
+
_.updateArrows();
|
2319
|
+
_.initArrowEvents();
|
2320
|
+
_.buildDots();
|
2321
|
+
_.updateDots();
|
2322
|
+
_.initDotEvents();
|
2323
|
+
_.cleanUpSlideEvents();
|
2324
|
+
_.initSlideEvents();
|
2325
|
+
|
2326
|
+
_.checkResponsive(false, true);
|
2327
|
+
|
2328
|
+
if (_.options.focusOnSelect === true) {
|
2329
|
+
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
|
2330
|
+
}
|
2331
|
+
|
2332
|
+
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
|
2333
|
+
|
2334
|
+
_.setPosition();
|
2335
|
+
_.focusHandler();
|
2336
|
+
|
2337
|
+
_.paused = !_.options.autoplay;
|
2338
|
+
_.autoPlay();
|
2339
|
+
|
2340
|
+
_.$slider.trigger('reInit', [_]);
|
2341
|
+
|
2342
|
+
};
|
2343
|
+
|
2344
|
+
Slick.prototype.resize = function() {
|
2345
|
+
|
2346
|
+
var _ = this;
|
2347
|
+
|
2348
|
+
if ($(window).width() !== _.windowWidth) {
|
2349
|
+
clearTimeout(_.windowDelay);
|
2350
|
+
_.windowDelay = window.setTimeout(function() {
|
2351
|
+
_.windowWidth = $(window).width();
|
2352
|
+
_.checkResponsive();
|
2353
|
+
if( !_.unslicked ) { _.setPosition(); }
|
2354
|
+
}, 50);
|
2355
|
+
}
|
2356
|
+
};
|
2357
|
+
|
2358
|
+
Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
|
2359
|
+
|
2360
|
+
var _ = this;
|
2361
|
+
|
2362
|
+
if (typeof(index) === 'boolean') {
|
2363
|
+
removeBefore = index;
|
2364
|
+
index = removeBefore === true ? 0 : _.slideCount - 1;
|
2365
|
+
} else {
|
2366
|
+
index = removeBefore === true ? --index : index;
|
2367
|
+
}
|
2368
|
+
|
2369
|
+
if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
|
2370
|
+
return false;
|
2371
|
+
}
|
2372
|
+
|
2373
|
+
_.unload();
|
2374
|
+
|
2375
|
+
if (removeAll === true) {
|
2376
|
+
_.$slideTrack.children().remove();
|
2377
|
+
} else {
|
2378
|
+
_.$slideTrack.children(this.options.slide).eq(index).remove();
|
2379
|
+
}
|
2380
|
+
|
2381
|
+
_.$slides = _.$slideTrack.children(this.options.slide);
|
2382
|
+
|
2383
|
+
_.$slideTrack.children(this.options.slide).detach();
|
2384
|
+
|
2385
|
+
_.$slideTrack.append(_.$slides);
|
2386
|
+
|
2387
|
+
_.$slidesCache = _.$slides;
|
2388
|
+
|
2389
|
+
_.reinit();
|
2390
|
+
|
2391
|
+
};
|
2392
|
+
|
2393
|
+
Slick.prototype.setCSS = function(position) {
|
2394
|
+
|
2395
|
+
var _ = this,
|
2396
|
+
positionProps = {},
|
2397
|
+
x, y;
|
2398
|
+
|
2399
|
+
if (_.options.rtl === true) {
|
2400
|
+
position = -position;
|
2401
|
+
}
|
2402
|
+
x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
|
2403
|
+
y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
|
2404
|
+
|
2405
|
+
positionProps[_.positionProp] = position;
|
2406
|
+
|
2407
|
+
if (_.transformsEnabled === false) {
|
2408
|
+
_.$slideTrack.css(positionProps);
|
2409
|
+
} else {
|
2410
|
+
positionProps = {};
|
2411
|
+
if (_.cssTransitions === false) {
|
2412
|
+
positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
|
2413
|
+
_.$slideTrack.css(positionProps);
|
2414
|
+
} else {
|
2415
|
+
positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
|
2416
|
+
_.$slideTrack.css(positionProps);
|
2417
|
+
}
|
2418
|
+
}
|
2419
|
+
|
2420
|
+
};
|
2421
|
+
|
2422
|
+
Slick.prototype.setDimensions = function() {
|
2423
|
+
|
2424
|
+
var _ = this;
|
2425
|
+
|
2426
|
+
if (_.options.vertical === false) {
|
2427
|
+
if (_.options.centerMode === true) {
|
2428
|
+
_.$list.css({
|
2429
|
+
padding: ('0px ' + _.options.centerPadding)
|
2430
|
+
});
|
2431
|
+
}
|
2432
|
+
} else {
|
2433
|
+
_.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
|
2434
|
+
if (_.options.centerMode === true) {
|
2435
|
+
_.$list.css({
|
2436
|
+
padding: (_.options.centerPadding + ' 0px')
|
2437
|
+
});
|
2438
|
+
}
|
2439
|
+
}
|
2440
|
+
|
2441
|
+
_.listWidth = _.$list.width();
|
2442
|
+
_.listHeight = _.$list.height();
|
2443
|
+
|
2444
|
+
|
2445
|
+
if (_.options.vertical === false && _.options.variableWidth === false) {
|
2446
|
+
_.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
|
2447
|
+
_.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
|
2448
|
+
|
2449
|
+
} else if (_.options.variableWidth === true) {
|
2450
|
+
_.$slideTrack.width(5000 * _.slideCount);
|
2451
|
+
} else {
|
2452
|
+
_.slideWidth = Math.ceil(_.listWidth);
|
2453
|
+
_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
|
2454
|
+
}
|
2455
|
+
|
2456
|
+
var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
|
2457
|
+
if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
|
2458
|
+
|
2459
|
+
};
|
2460
|
+
|
2461
|
+
Slick.prototype.setFade = function() {
|
2462
|
+
|
2463
|
+
var _ = this,
|
2464
|
+
targetLeft;
|
2465
|
+
|
2466
|
+
_.$slides.each(function(index, element) {
|
2467
|
+
targetLeft = (_.slideWidth * index) * -1;
|
2468
|
+
if (_.options.rtl === true) {
|
2469
|
+
$(element).css({
|
2470
|
+
position: 'relative',
|
2471
|
+
right: targetLeft,
|
2472
|
+
top: 0,
|
2473
|
+
zIndex: _.options.zIndex - 2,
|
2474
|
+
opacity: 0
|
2475
|
+
});
|
2476
|
+
} else {
|
2477
|
+
$(element).css({
|
2478
|
+
position: 'relative',
|
2479
|
+
left: targetLeft,
|
2480
|
+
top: 0,
|
2481
|
+
zIndex: _.options.zIndex - 2,
|
2482
|
+
opacity: 0
|
2483
|
+
});
|
2484
|
+
}
|
2485
|
+
});
|
2486
|
+
|
2487
|
+
_.$slides.eq(_.currentSlide).css({
|
2488
|
+
zIndex: _.options.zIndex - 1,
|
2489
|
+
opacity: 1
|
2490
|
+
});
|
2491
|
+
|
2492
|
+
};
|
2493
|
+
|
2494
|
+
Slick.prototype.setHeight = function() {
|
2495
|
+
|
2496
|
+
var _ = this;
|
2497
|
+
|
2498
|
+
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
|
2499
|
+
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
|
2500
|
+
_.$list.css('height', targetHeight);
|
2501
|
+
}
|
2502
|
+
|
2503
|
+
};
|
2504
|
+
|
2505
|
+
Slick.prototype.setOption =
|
2506
|
+
Slick.prototype.slickSetOption = function() {
|
2507
|
+
|
2508
|
+
/**
|
2509
|
+
* accepts arguments in format of:
|
2510
|
+
*
|
2511
|
+
* - for changing a single option's value:
|
2512
|
+
* .slick("setOption", option, value, refresh )
|
2513
|
+
*
|
2514
|
+
* - for changing a set of responsive options:
|
2515
|
+
* .slick("setOption", 'responsive', [{}, ...], refresh )
|
2516
|
+
*
|
2517
|
+
* - for updating multiple values at once (not responsive)
|
2518
|
+
* .slick("setOption", { 'option': value, ... }, refresh )
|
2519
|
+
*/
|
2520
|
+
|
2521
|
+
var _ = this, l, item, option, value, refresh = false, type;
|
2522
|
+
|
2523
|
+
if( $.type( arguments[0] ) === 'object' ) {
|
2524
|
+
|
2525
|
+
option = arguments[0];
|
2526
|
+
refresh = arguments[1];
|
2527
|
+
type = 'multiple';
|
2528
|
+
|
2529
|
+
} else if ( $.type( arguments[0] ) === 'string' ) {
|
2530
|
+
|
2531
|
+
option = arguments[0];
|
2532
|
+
value = arguments[1];
|
2533
|
+
refresh = arguments[2];
|
2534
|
+
|
2535
|
+
if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
|
2536
|
+
|
2537
|
+
type = 'responsive';
|
2538
|
+
|
2539
|
+
} else if ( typeof arguments[1] !== 'undefined' ) {
|
2540
|
+
|
2541
|
+
type = 'single';
|
2542
|
+
|
2543
|
+
}
|
2544
|
+
|
2545
|
+
}
|
2546
|
+
|
2547
|
+
if ( type === 'single' ) {
|
2548
|
+
|
2549
|
+
_.options[option] = value;
|
2550
|
+
|
2551
|
+
|
2552
|
+
} else if ( type === 'multiple' ) {
|
2553
|
+
|
2554
|
+
$.each( option , function( opt, val ) {
|
2555
|
+
|
2556
|
+
_.options[opt] = val;
|
2557
|
+
|
2558
|
+
});
|
2559
|
+
|
2560
|
+
|
2561
|
+
} else if ( type === 'responsive' ) {
|
2562
|
+
|
2563
|
+
for ( item in value ) {
|
2564
|
+
|
2565
|
+
if( $.type( _.options.responsive ) !== 'array' ) {
|
2566
|
+
|
2567
|
+
_.options.responsive = [ value[item] ];
|
2568
|
+
|
2569
|
+
} else {
|
2570
|
+
|
2571
|
+
l = _.options.responsive.length-1;
|
2572
|
+
|
2573
|
+
// loop through the responsive object and splice out duplicates.
|
2574
|
+
while( l >= 0 ) {
|
2575
|
+
|
2576
|
+
if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
|
2577
|
+
|
2578
|
+
_.options.responsive.splice(l,1);
|
2579
|
+
|
2580
|
+
}
|
2581
|
+
|
2582
|
+
l--;
|
2583
|
+
|
2584
|
+
}
|
2585
|
+
|
2586
|
+
_.options.responsive.push( value[item] );
|
2587
|
+
|
2588
|
+
}
|
2589
|
+
|
2590
|
+
}
|
2591
|
+
|
2592
|
+
}
|
2593
|
+
|
2594
|
+
if ( refresh ) {
|
2595
|
+
|
2596
|
+
_.unload();
|
2597
|
+
_.reinit();
|
2598
|
+
|
2599
|
+
}
|
2600
|
+
|
2601
|
+
};
|
2602
|
+
|
2603
|
+
Slick.prototype.setPosition = function() {
|
2604
|
+
|
2605
|
+
var _ = this;
|
2606
|
+
|
2607
|
+
_.setDimensions();
|
2608
|
+
|
2609
|
+
_.setHeight();
|
2610
|
+
|
2611
|
+
if (_.options.fade === false) {
|
2612
|
+
_.setCSS(_.getLeft(_.currentSlide));
|
2613
|
+
} else {
|
2614
|
+
_.setFade();
|
2615
|
+
}
|
2616
|
+
|
2617
|
+
_.$slider.trigger('setPosition', [_]);
|
2618
|
+
|
2619
|
+
};
|
2620
|
+
|
2621
|
+
Slick.prototype.setProps = function() {
|
2622
|
+
|
2623
|
+
var _ = this,
|
2624
|
+
bodyStyle = document.body.style;
|
2625
|
+
|
2626
|
+
_.positionProp = _.options.vertical === true ? 'top' : 'left';
|
2627
|
+
|
2628
|
+
if (_.positionProp === 'top') {
|
2629
|
+
_.$slider.addClass('slick-vertical');
|
2630
|
+
} else {
|
2631
|
+
_.$slider.removeClass('slick-vertical');
|
2632
|
+
}
|
2633
|
+
|
2634
|
+
if (bodyStyle.WebkitTransition !== undefined ||
|
2635
|
+
bodyStyle.MozTransition !== undefined ||
|
2636
|
+
bodyStyle.msTransition !== undefined) {
|
2637
|
+
if (_.options.useCSS === true) {
|
2638
|
+
_.cssTransitions = true;
|
2639
|
+
}
|
2640
|
+
}
|
2641
|
+
|
2642
|
+
if ( _.options.fade ) {
|
2643
|
+
if ( typeof _.options.zIndex === 'number' ) {
|
2644
|
+
if( _.options.zIndex < 3 ) {
|
2645
|
+
_.options.zIndex = 3;
|
2646
|
+
}
|
2647
|
+
} else {
|
2648
|
+
_.options.zIndex = _.defaults.zIndex;
|
2649
|
+
}
|
2650
|
+
}
|
2651
|
+
|
2652
|
+
if (bodyStyle.OTransform !== undefined) {
|
2653
|
+
_.animType = 'OTransform';
|
2654
|
+
_.transformType = '-o-transform';
|
2655
|
+
_.transitionType = 'OTransition';
|
2656
|
+
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
|
2657
|
+
}
|
2658
|
+
if (bodyStyle.MozTransform !== undefined) {
|
2659
|
+
_.animType = 'MozTransform';
|
2660
|
+
_.transformType = '-moz-transform';
|
2661
|
+
_.transitionType = 'MozTransition';
|
2662
|
+
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
|
2663
|
+
}
|
2664
|
+
if (bodyStyle.webkitTransform !== undefined) {
|
2665
|
+
_.animType = 'webkitTransform';
|
2666
|
+
_.transformType = '-webkit-transform';
|
2667
|
+
_.transitionType = 'webkitTransition';
|
2668
|
+
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
|
2669
|
+
}
|
2670
|
+
if (bodyStyle.msTransform !== undefined) {
|
2671
|
+
_.animType = 'msTransform';
|
2672
|
+
_.transformType = '-ms-transform';
|
2673
|
+
_.transitionType = 'msTransition';
|
2674
|
+
if (bodyStyle.msTransform === undefined) _.animType = false;
|
2675
|
+
}
|
2676
|
+
if (bodyStyle.transform !== undefined && _.animType !== false) {
|
2677
|
+
_.animType = 'transform';
|
2678
|
+
_.transformType = 'transform';
|
2679
|
+
_.transitionType = 'transition';
|
2680
|
+
}
|
2681
|
+
_.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
|
2682
|
+
};
|
2683
|
+
|
2684
|
+
|
2685
|
+
Slick.prototype.setSlideClasses = function(index) {
|
2686
|
+
|
2687
|
+
var _ = this,
|
2688
|
+
centerOffset, allSlides, indexOffset, remainder;
|
2689
|
+
|
2690
|
+
allSlides = _.$slider
|
2691
|
+
.find('.slick-slide')
|
2692
|
+
.removeClass('slick-active slick-center slick-current')
|
2693
|
+
.attr('aria-hidden', 'true');
|
2694
|
+
|
2695
|
+
_.$slides
|
2696
|
+
.eq(index)
|
2697
|
+
.addClass('slick-current');
|
2698
|
+
|
2699
|
+
if (_.options.centerMode === true) {
|
2700
|
+
|
2701
|
+
centerOffset = Math.floor(_.options.slidesToShow / 2);
|
2702
|
+
|
2703
|
+
if (_.options.infinite === true) {
|
2704
|
+
|
2705
|
+
if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
|
2706
|
+
|
2707
|
+
_.$slides
|
2708
|
+
.slice(index - centerOffset, index + centerOffset + 1)
|
2709
|
+
.addClass('slick-active')
|
2710
|
+
.attr('aria-hidden', 'false');
|
2711
|
+
|
2712
|
+
} else {
|
2713
|
+
|
2714
|
+
indexOffset = _.options.slidesToShow + index;
|
2715
|
+
allSlides
|
2716
|
+
.slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2)
|
2717
|
+
.addClass('slick-active')
|
2718
|
+
.attr('aria-hidden', 'false');
|
2719
|
+
|
2720
|
+
}
|
2721
|
+
|
2722
|
+
if (index === 0) {
|
2723
|
+
|
2724
|
+
allSlides
|
2725
|
+
.eq(allSlides.length - 1 - _.options.slidesToShow)
|
2726
|
+
.addClass('slick-center');
|
2727
|
+
|
2728
|
+
} else if (index === _.slideCount - 1) {
|
2729
|
+
|
2730
|
+
allSlides
|
2731
|
+
.eq(_.options.slidesToShow)
|
2732
|
+
.addClass('slick-center');
|
2733
|
+
|
2734
|
+
}
|
2735
|
+
|
2736
|
+
}
|
2737
|
+
|
2738
|
+
_.$slides
|
2739
|
+
.eq(index)
|
2740
|
+
.addClass('slick-center');
|
2741
|
+
|
2742
|
+
} else {
|
2743
|
+
|
2744
|
+
if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
|
2745
|
+
|
2746
|
+
_.$slides
|
2747
|
+
.slice(index, index + _.options.slidesToShow)
|
2748
|
+
.addClass('slick-active')
|
2749
|
+
.attr('aria-hidden', 'false');
|
2750
|
+
|
2751
|
+
} else if (allSlides.length <= _.options.slidesToShow) {
|
2752
|
+
|
2753
|
+
allSlides
|
2754
|
+
.addClass('slick-active')
|
2755
|
+
.attr('aria-hidden', 'false');
|
2756
|
+
|
2757
|
+
} else {
|
2758
|
+
|
2759
|
+
remainder = _.slideCount % _.options.slidesToShow;
|
2760
|
+
indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
|
2761
|
+
|
2762
|
+
if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
|
2763
|
+
|
2764
|
+
allSlides
|
2765
|
+
.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
|
2766
|
+
.addClass('slick-active')
|
2767
|
+
.attr('aria-hidden', 'false');
|
2768
|
+
|
2769
|
+
} else {
|
2770
|
+
|
2771
|
+
allSlides
|
2772
|
+
.slice(indexOffset, indexOffset + _.options.slidesToShow)
|
2773
|
+
.addClass('slick-active')
|
2774
|
+
.attr('aria-hidden', 'false');
|
2775
|
+
|
2776
|
+
}
|
2777
|
+
|
2778
|
+
}
|
2779
|
+
|
2780
|
+
}
|
2781
|
+
|
2782
|
+
if (_.options.lazyLoad === 'ondemand') {
|
2783
|
+
_.lazyLoad();
|
2784
|
+
}
|
2785
|
+
|
2786
|
+
};
|
2787
|
+
|
2788
|
+
Slick.prototype.setupInfinite = function() {
|
2789
|
+
|
2790
|
+
var _ = this,
|
2791
|
+
i, slideIndex, infiniteCount;
|
2792
|
+
|
2793
|
+
if (_.options.fade === true) {
|
2794
|
+
_.options.centerMode = false;
|
2795
|
+
}
|
2796
|
+
|
2797
|
+
if (_.options.infinite === true && _.options.fade === false) {
|
2798
|
+
|
2799
|
+
slideIndex = null;
|
2800
|
+
|
2801
|
+
if (_.slideCount > _.options.slidesToShow) {
|
2802
|
+
|
2803
|
+
if (_.options.centerMode === true) {
|
2804
|
+
infiniteCount = _.options.slidesToShow + 1;
|
2805
|
+
} else {
|
2806
|
+
infiniteCount = _.options.slidesToShow;
|
2807
|
+
}
|
2808
|
+
|
2809
|
+
for (i = _.slideCount; i > (_.slideCount -
|
2810
|
+
infiniteCount); i -= 1) {
|
2811
|
+
slideIndex = i - 1;
|
2812
|
+
$(_.$slides[slideIndex]).clone(true).attr('id', '')
|
2813
|
+
.attr('data-slick-index', slideIndex - _.slideCount)
|
2814
|
+
.prependTo(_.$slideTrack).addClass('slick-cloned');
|
2815
|
+
}
|
2816
|
+
for (i = 0; i < infiniteCount; i += 1) {
|
2817
|
+
slideIndex = i;
|
2818
|
+
$(_.$slides[slideIndex]).clone(true).attr('id', '')
|
2819
|
+
.attr('data-slick-index', slideIndex + _.slideCount)
|
2820
|
+
.appendTo(_.$slideTrack).addClass('slick-cloned');
|
2821
|
+
}
|
2822
|
+
_.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
|
2823
|
+
$(this).attr('id', '');
|
2824
|
+
});
|
2825
|
+
|
2826
|
+
}
|
2827
|
+
|
2828
|
+
}
|
2829
|
+
|
2830
|
+
};
|
2831
|
+
|
2832
|
+
Slick.prototype.interrupt = function( toggle ) {
|
2833
|
+
|
2834
|
+
var _ = this;
|
2835
|
+
|
2836
|
+
if( !toggle ) {
|
2837
|
+
_.autoPlay();
|
2838
|
+
}
|
2839
|
+
_.interrupted = toggle;
|
2840
|
+
|
2841
|
+
};
|
2842
|
+
|
2843
|
+
Slick.prototype.selectHandler = function(event) {
|
2844
|
+
|
2845
|
+
var _ = this;
|
2846
|
+
|
2847
|
+
var targetElement =
|
2848
|
+
$(event.target).is('.slick-slide') ?
|
2849
|
+
$(event.target) :
|
2850
|
+
$(event.target).parents('.slick-slide');
|
2851
|
+
|
2852
|
+
var index = parseInt(targetElement.attr('data-slick-index'));
|
2853
|
+
|
2854
|
+
if (!index) index = 0;
|
2855
|
+
|
2856
|
+
if (_.slideCount <= _.options.slidesToShow) {
|
2857
|
+
|
2858
|
+
_.setSlideClasses(index);
|
2859
|
+
_.asNavFor(index);
|
2860
|
+
return;
|
2861
|
+
|
2862
|
+
}
|
2863
|
+
|
2864
|
+
_.slideHandler(index);
|
2865
|
+
|
2866
|
+
};
|
2867
|
+
|
2868
|
+
Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
|
2869
|
+
|
2870
|
+
var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
|
2871
|
+
_ = this, navTarget;
|
2872
|
+
|
2873
|
+
sync = sync || false;
|
2874
|
+
|
2875
|
+
if (_.animating === true && _.options.waitForAnimate === true) {
|
2876
|
+
return;
|
2877
|
+
}
|
2878
|
+
|
2879
|
+
if (_.options.fade === true && _.currentSlide === index) {
|
2880
|
+
return;
|
2881
|
+
}
|
2882
|
+
|
2883
|
+
if (_.slideCount <= _.options.slidesToShow) {
|
2884
|
+
return;
|
2885
|
+
}
|
2886
|
+
|
2887
|
+
if (sync === false) {
|
2888
|
+
_.asNavFor(index);
|
2889
|
+
}
|
2890
|
+
|
2891
|
+
targetSlide = index;
|
2892
|
+
targetLeft = _.getLeft(targetSlide);
|
2893
|
+
slideLeft = _.getLeft(_.currentSlide);
|
2894
|
+
|
2895
|
+
_.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
|
2896
|
+
|
2897
|
+
if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
|
2898
|
+
if (_.options.fade === false) {
|
2899
|
+
targetSlide = _.currentSlide;
|
2900
|
+
if (dontAnimate !== true) {
|
2901
|
+
_.animateSlide(slideLeft, function() {
|
2902
|
+
_.postSlide(targetSlide);
|
2903
|
+
});
|
2904
|
+
} else {
|
2905
|
+
_.postSlide(targetSlide);
|
2906
|
+
}
|
2907
|
+
}
|
2908
|
+
return;
|
2909
|
+
} else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
|
2910
|
+
if (_.options.fade === false) {
|
2911
|
+
targetSlide = _.currentSlide;
|
2912
|
+
if (dontAnimate !== true) {
|
2913
|
+
_.animateSlide(slideLeft, function() {
|
2914
|
+
_.postSlide(targetSlide);
|
2915
|
+
});
|
2916
|
+
} else {
|
2917
|
+
_.postSlide(targetSlide);
|
2918
|
+
}
|
2919
|
+
}
|
2920
|
+
return;
|
2921
|
+
}
|
2922
|
+
|
2923
|
+
if ( _.options.autoplay ) {
|
2924
|
+
clearInterval(_.autoPlayTimer);
|
2925
|
+
}
|
2926
|
+
|
2927
|
+
if (targetSlide < 0) {
|
2928
|
+
if (_.slideCount % _.options.slidesToScroll !== 0) {
|
2929
|
+
animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
|
2930
|
+
} else {
|
2931
|
+
animSlide = _.slideCount + targetSlide;
|
2932
|
+
}
|
2933
|
+
} else if (targetSlide >= _.slideCount) {
|
2934
|
+
if (_.slideCount % _.options.slidesToScroll !== 0) {
|
2935
|
+
animSlide = 0;
|
2936
|
+
} else {
|
2937
|
+
animSlide = targetSlide - _.slideCount;
|
2938
|
+
}
|
2939
|
+
} else {
|
2940
|
+
animSlide = targetSlide;
|
2941
|
+
}
|
2942
|
+
|
2943
|
+
_.animating = true;
|
2944
|
+
|
2945
|
+
_.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
|
2946
|
+
|
2947
|
+
oldSlide = _.currentSlide;
|
2948
|
+
_.currentSlide = animSlide;
|
2949
|
+
|
2950
|
+
_.setSlideClasses(_.currentSlide);
|
2951
|
+
|
2952
|
+
if ( _.options.asNavFor ) {
|
2953
|
+
|
2954
|
+
navTarget = _.getNavTarget();
|
2955
|
+
navTarget = navTarget.slick('getSlick');
|
2956
|
+
|
2957
|
+
if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {
|
2958
|
+
navTarget.setSlideClasses(_.currentSlide);
|
2959
|
+
}
|
2960
|
+
|
2961
|
+
}
|
2962
|
+
|
2963
|
+
_.updateDots();
|
2964
|
+
_.updateArrows();
|
2965
|
+
|
2966
|
+
if (_.options.fade === true) {
|
2967
|
+
if (dontAnimate !== true) {
|
2968
|
+
|
2969
|
+
_.fadeSlideOut(oldSlide);
|
2970
|
+
|
2971
|
+
_.fadeSlide(animSlide, function() {
|
2972
|
+
_.postSlide(animSlide);
|
2973
|
+
});
|
2974
|
+
|
2975
|
+
} else {
|
2976
|
+
_.postSlide(animSlide);
|
2977
|
+
}
|
2978
|
+
_.animateHeight();
|
2979
|
+
return;
|
2980
|
+
}
|
2981
|
+
|
2982
|
+
if (dontAnimate !== true) {
|
2983
|
+
_.animateSlide(targetLeft, function() {
|
2984
|
+
_.postSlide(animSlide);
|
2985
|
+
});
|
2986
|
+
} else {
|
2987
|
+
_.postSlide(animSlide);
|
2988
|
+
}
|
2989
|
+
|
2990
|
+
};
|
2991
|
+
|
2992
|
+
Slick.prototype.startLoad = function() {
|
2993
|
+
|
2994
|
+
var _ = this;
|
2995
|
+
|
2996
|
+
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
|
2997
|
+
|
2998
|
+
_.$prevArrow.hide();
|
2999
|
+
_.$nextArrow.hide();
|
3000
|
+
|
3001
|
+
}
|
3002
|
+
|
3003
|
+
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
|
3004
|
+
|
3005
|
+
_.$dots.hide();
|
3006
|
+
|
3007
|
+
}
|
3008
|
+
|
3009
|
+
_.$slider.addClass('slick-loading');
|
3010
|
+
|
3011
|
+
};
|
3012
|
+
|
3013
|
+
Slick.prototype.swipeDirection = function() {
|
3014
|
+
|
3015
|
+
var xDist, yDist, r, swipeAngle, _ = this;
|
3016
|
+
|
3017
|
+
xDist = _.touchObject.startX - _.touchObject.curX;
|
3018
|
+
yDist = _.touchObject.startY - _.touchObject.curY;
|
3019
|
+
r = Math.atan2(yDist, xDist);
|
3020
|
+
|
3021
|
+
swipeAngle = Math.round(r * 180 / Math.PI);
|
3022
|
+
if (swipeAngle < 0) {
|
3023
|
+
swipeAngle = 360 - Math.abs(swipeAngle);
|
3024
|
+
}
|
3025
|
+
|
3026
|
+
if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
|
3027
|
+
return (_.options.rtl === false ? 'left' : 'right');
|
3028
|
+
}
|
3029
|
+
if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
|
3030
|
+
return (_.options.rtl === false ? 'left' : 'right');
|
3031
|
+
}
|
3032
|
+
if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
|
3033
|
+
return (_.options.rtl === false ? 'right' : 'left');
|
3034
|
+
}
|
3035
|
+
if (_.options.verticalSwiping === true) {
|
3036
|
+
if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
|
3037
|
+
return 'down';
|
3038
|
+
} else {
|
3039
|
+
return 'up';
|
3040
|
+
}
|
3041
|
+
}
|
3042
|
+
|
3043
|
+
return 'vertical';
|
3044
|
+
|
3045
|
+
};
|
3046
|
+
|
3047
|
+
Slick.prototype.swipeEnd = function(event) {
|
3048
|
+
|
3049
|
+
var _ = this,
|
3050
|
+
slideCount,
|
3051
|
+
direction;
|
3052
|
+
|
3053
|
+
_.dragging = false;
|
3054
|
+
_.interrupted = false;
|
3055
|
+
_.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;
|
3056
|
+
|
3057
|
+
if ( _.touchObject.curX === undefined ) {
|
3058
|
+
return false;
|
3059
|
+
}
|
3060
|
+
|
3061
|
+
if ( _.touchObject.edgeHit === true ) {
|
3062
|
+
_.$slider.trigger('edge', [_, _.swipeDirection() ]);
|
3063
|
+
}
|
3064
|
+
|
3065
|
+
if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {
|
3066
|
+
|
3067
|
+
direction = _.swipeDirection();
|
3068
|
+
|
3069
|
+
switch ( direction ) {
|
3070
|
+
|
3071
|
+
case 'left':
|
3072
|
+
case 'down':
|
3073
|
+
|
3074
|
+
slideCount =
|
3075
|
+
_.options.swipeToSlide ?
|
3076
|
+
_.checkNavigable( _.currentSlide + _.getSlideCount() ) :
|
3077
|
+
_.currentSlide + _.getSlideCount();
|
3078
|
+
|
3079
|
+
_.currentDirection = 0;
|
3080
|
+
|
3081
|
+
break;
|
3082
|
+
|
3083
|
+
case 'right':
|
3084
|
+
case 'up':
|
3085
|
+
|
3086
|
+
slideCount =
|
3087
|
+
_.options.swipeToSlide ?
|
3088
|
+
_.checkNavigable( _.currentSlide - _.getSlideCount() ) :
|
3089
|
+
_.currentSlide - _.getSlideCount();
|
3090
|
+
|
3091
|
+
_.currentDirection = 1;
|
3092
|
+
|
3093
|
+
break;
|
3094
|
+
|
3095
|
+
default:
|
3096
|
+
|
3097
|
+
|
3098
|
+
}
|
3099
|
+
|
3100
|
+
if( direction != 'vertical' ) {
|
3101
|
+
|
3102
|
+
_.slideHandler( slideCount );
|
3103
|
+
_.touchObject = {};
|
3104
|
+
_.$slider.trigger('swipe', [_, direction ]);
|
3105
|
+
|
3106
|
+
}
|
3107
|
+
|
3108
|
+
} else {
|
3109
|
+
|
3110
|
+
if ( _.touchObject.startX !== _.touchObject.curX ) {
|
3111
|
+
|
3112
|
+
_.slideHandler( _.currentSlide );
|
3113
|
+
_.touchObject = {};
|
3114
|
+
|
3115
|
+
}
|
3116
|
+
|
3117
|
+
}
|
3118
|
+
|
3119
|
+
};
|
3120
|
+
|
3121
|
+
Slick.prototype.swipeHandler = function(event) {
|
3122
|
+
|
3123
|
+
var _ = this;
|
3124
|
+
|
3125
|
+
if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
|
3126
|
+
return;
|
3127
|
+
} else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
|
3128
|
+
return;
|
3129
|
+
}
|
3130
|
+
|
3131
|
+
_.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
|
3132
|
+
event.originalEvent.touches.length : 1;
|
3133
|
+
|
3134
|
+
_.touchObject.minSwipe = _.listWidth / _.options
|
3135
|
+
.touchThreshold;
|
3136
|
+
|
3137
|
+
if (_.options.verticalSwiping === true) {
|
3138
|
+
_.touchObject.minSwipe = _.listHeight / _.options
|
3139
|
+
.touchThreshold;
|
3140
|
+
}
|
3141
|
+
|
3142
|
+
switch (event.data.action) {
|
3143
|
+
|
3144
|
+
case 'start':
|
3145
|
+
_.swipeStart(event);
|
3146
|
+
break;
|
3147
|
+
|
3148
|
+
case 'move':
|
3149
|
+
_.swipeMove(event);
|
3150
|
+
break;
|
3151
|
+
|
3152
|
+
case 'end':
|
3153
|
+
_.swipeEnd(event);
|
3154
|
+
break;
|
3155
|
+
|
3156
|
+
}
|
3157
|
+
|
3158
|
+
};
|
3159
|
+
|
3160
|
+
Slick.prototype.swipeMove = function(event) {
|
3161
|
+
|
3162
|
+
var _ = this,
|
3163
|
+
edgeWasHit = false,
|
3164
|
+
curLeft, swipeDirection, swipeLength, positionOffset, touches;
|
3165
|
+
|
3166
|
+
touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
|
3167
|
+
|
3168
|
+
if (!_.dragging || touches && touches.length !== 1) {
|
3169
|
+
return false;
|
3170
|
+
}
|
3171
|
+
|
3172
|
+
curLeft = _.getLeft(_.currentSlide);
|
3173
|
+
|
3174
|
+
_.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
|
3175
|
+
_.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
|
3176
|
+
|
3177
|
+
_.touchObject.swipeLength = Math.round(Math.sqrt(
|
3178
|
+
Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
|
3179
|
+
|
3180
|
+
if (_.options.verticalSwiping === true) {
|
3181
|
+
_.touchObject.swipeLength = Math.round(Math.sqrt(
|
3182
|
+
Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
|
3183
|
+
}
|
3184
|
+
|
3185
|
+
swipeDirection = _.swipeDirection();
|
3186
|
+
|
3187
|
+
if (swipeDirection === 'vertical') {
|
3188
|
+
return;
|
3189
|
+
}
|
3190
|
+
|
3191
|
+
if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
|
3192
|
+
event.preventDefault();
|
3193
|
+
}
|
3194
|
+
|
3195
|
+
positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
|
3196
|
+
if (_.options.verticalSwiping === true) {
|
3197
|
+
positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
|
3198
|
+
}
|
3199
|
+
|
3200
|
+
|
3201
|
+
swipeLength = _.touchObject.swipeLength;
|
3202
|
+
|
3203
|
+
_.touchObject.edgeHit = false;
|
3204
|
+
|
3205
|
+
if (_.options.infinite === false) {
|
3206
|
+
if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
|
3207
|
+
swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
|
3208
|
+
_.touchObject.edgeHit = true;
|
3209
|
+
}
|
3210
|
+
}
|
3211
|
+
|
3212
|
+
if (_.options.vertical === false) {
|
3213
|
+
_.swipeLeft = curLeft + swipeLength * positionOffset;
|
3214
|
+
} else {
|
3215
|
+
_.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
|
3216
|
+
}
|
3217
|
+
if (_.options.verticalSwiping === true) {
|
3218
|
+
_.swipeLeft = curLeft + swipeLength * positionOffset;
|
3219
|
+
}
|
3220
|
+
|
3221
|
+
if (_.options.fade === true || _.options.touchMove === false) {
|
3222
|
+
return false;
|
3223
|
+
}
|
3224
|
+
|
3225
|
+
if (_.animating === true) {
|
3226
|
+
_.swipeLeft = null;
|
3227
|
+
return false;
|
3228
|
+
}
|
3229
|
+
|
3230
|
+
_.setCSS(_.swipeLeft);
|
3231
|
+
|
3232
|
+
};
|
3233
|
+
|
3234
|
+
Slick.prototype.swipeStart = function(event) {
|
3235
|
+
|
3236
|
+
var _ = this,
|
3237
|
+
touches;
|
3238
|
+
|
3239
|
+
_.interrupted = true;
|
3240
|
+
|
3241
|
+
if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
|
3242
|
+
_.touchObject = {};
|
3243
|
+
return false;
|
3244
|
+
}
|
3245
|
+
|
3246
|
+
if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
|
3247
|
+
touches = event.originalEvent.touches[0];
|
3248
|
+
}
|
3249
|
+
|
3250
|
+
_.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
|
3251
|
+
_.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
|
3252
|
+
|
3253
|
+
_.dragging = true;
|
3254
|
+
|
3255
|
+
};
|
3256
|
+
|
3257
|
+
Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
|
3258
|
+
|
3259
|
+
var _ = this;
|
3260
|
+
|
3261
|
+
if (_.$slidesCache !== null) {
|
3262
|
+
|
3263
|
+
_.unload();
|
3264
|
+
|
3265
|
+
_.$slideTrack.children(this.options.slide).detach();
|
3266
|
+
|
3267
|
+
_.$slidesCache.appendTo(_.$slideTrack);
|
3268
|
+
|
3269
|
+
_.reinit();
|
3270
|
+
|
3271
|
+
}
|
3272
|
+
|
3273
|
+
};
|
3274
|
+
|
3275
|
+
Slick.prototype.unload = function() {
|
3276
|
+
|
3277
|
+
var _ = this;
|
3278
|
+
|
3279
|
+
$('.slick-cloned', _.$slider).remove();
|
3280
|
+
|
3281
|
+
if (_.$dots) {
|
3282
|
+
_.$dots.remove();
|
3283
|
+
}
|
3284
|
+
|
3285
|
+
if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
|
3286
|
+
_.$prevArrow.remove();
|
3287
|
+
}
|
3288
|
+
|
3289
|
+
if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
|
3290
|
+
_.$nextArrow.remove();
|
3291
|
+
}
|
3292
|
+
|
3293
|
+
_.$slides
|
3294
|
+
.removeClass('slick-slide slick-active slick-visible slick-current')
|
3295
|
+
.attr('aria-hidden', 'true')
|
3296
|
+
.css('width', '');
|
3297
|
+
|
3298
|
+
};
|
3299
|
+
|
3300
|
+
Slick.prototype.unslick = function(fromBreakpoint) {
|
3301
|
+
|
3302
|
+
var _ = this;
|
3303
|
+
_.$slider.trigger('unslick', [_, fromBreakpoint]);
|
3304
|
+
_.destroy();
|
3305
|
+
|
3306
|
+
};
|
3307
|
+
|
3308
|
+
Slick.prototype.updateArrows = function() {
|
3309
|
+
|
3310
|
+
var _ = this,
|
3311
|
+
centerOffset;
|
3312
|
+
|
3313
|
+
centerOffset = Math.floor(_.options.slidesToShow / 2);
|
3314
|
+
|
3315
|
+
if ( _.options.arrows === true &&
|
3316
|
+
_.slideCount > _.options.slidesToShow &&
|
3317
|
+
!_.options.infinite ) {
|
3318
|
+
|
3319
|
+
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
|
3320
|
+
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
|
3321
|
+
|
3322
|
+
if (_.currentSlide === 0) {
|
3323
|
+
|
3324
|
+
_.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
|
3325
|
+
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
|
3326
|
+
|
3327
|
+
} else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
|
3328
|
+
|
3329
|
+
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
|
3330
|
+
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
|
3331
|
+
|
3332
|
+
} else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
|
3333
|
+
|
3334
|
+
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
|
3335
|
+
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
|
3336
|
+
|
3337
|
+
}
|
3338
|
+
|
3339
|
+
}
|
3340
|
+
|
3341
|
+
};
|
3342
|
+
|
3343
|
+
Slick.prototype.updateDots = function() {
|
3344
|
+
|
3345
|
+
var _ = this;
|
3346
|
+
|
3347
|
+
if (_.$dots !== null) {
|
3348
|
+
|
3349
|
+
_.$dots
|
3350
|
+
.find('li')
|
3351
|
+
.removeClass('slick-active')
|
3352
|
+
.attr('aria-hidden', 'true');
|
3353
|
+
|
3354
|
+
_.$dots
|
3355
|
+
.find('li')
|
3356
|
+
.eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
|
3357
|
+
.addClass('slick-active')
|
3358
|
+
.attr('aria-hidden', 'false');
|
3359
|
+
|
3360
|
+
}
|
3361
|
+
|
3362
|
+
};
|
3363
|
+
|
3364
|
+
Slick.prototype.visibility = function() {
|
3365
|
+
|
3366
|
+
var _ = this;
|
3367
|
+
|
3368
|
+
if ( _.options.autoplay ) {
|
3369
|
+
|
3370
|
+
if ( document[_.hidden] ) {
|
3371
|
+
|
3372
|
+
_.interrupted = true;
|
3373
|
+
|
3374
|
+
} else {
|
3375
|
+
|
3376
|
+
_.interrupted = false;
|
3377
|
+
|
3378
|
+
}
|
3379
|
+
|
3380
|
+
}
|
3381
|
+
|
3382
|
+
};
|
3383
|
+
|
3384
|
+
$.fn.slick = function() {
|
3385
|
+
var _ = this,
|
3386
|
+
opt = arguments[0],
|
3387
|
+
args = Array.prototype.slice.call(arguments, 1),
|
3388
|
+
l = _.length,
|
3389
|
+
i,
|
3390
|
+
ret;
|
3391
|
+
for (i = 0; i < l; i++) {
|
3392
|
+
if (typeof opt == 'object' || typeof opt == 'undefined')
|
3393
|
+
_[i].slick = new Slick(_[i], opt);
|
3394
|
+
else
|
3395
|
+
ret = _[i].slick[opt].apply(_[i].slick, args);
|
3396
|
+
if (typeof ret != 'undefined') return ret;
|
3397
|
+
}
|
3398
|
+
return _;
|
3399
|
+
};
|
3400
|
+
|
3401
|
+
}));
|