jquery-slick-rails 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ddde7fd91d3d24bff24ad33987771d60b0f74593
4
+ data.tar.gz: 5747b56eb8f7ad2178f3ee10ebca3f5e976d5d08
5
+ SHA512:
6
+ metadata.gz: b1099bb646c9c039fe927e9d13c6534be25621d36a46d295a71f897309d21a90a78bf1eaa726e7e148a3979a491a603637263b7cd13453d87e2192981d92431b
7
+ data.tar.gz: 6436c0c0cb29c748fbc4c62c315e635b608ccd21573430e7885a9d43ef314a89e2ebea97a16d9556b7c95c894d5aa7bdb5c7e41c6116f23dd0566a1173001bb7
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 Mike MacDonald
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,34 @@
1
+ # JquerySlickRails
2
+
3
+ A ruby gem that uses the Rails asset pipeline to include the jQuery Slick plugin by Ken Wheeler
4
+ (https://kenwheeler.github.io/slick/).
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem "jquery-slick-rails"
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install jquery-slick-rails
19
+
20
+ NOTE: this is a jQuery plugin so you will also need the `jquery-rails` gem:
21
+
22
+ * https://github.com/rails/jquery-rails
23
+
24
+ ## Usage
25
+
26
+ In your `application.js` you will need to add this line:
27
+
28
+ //= require jquery.slick
29
+
30
+ and this line
31
+
32
+ @import 'slick';
33
+
34
+ into your `application.css.scss`.
@@ -0,0 +1,6 @@
1
+ module JquerySlickRails
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module JquerySlickRails
2
+ VERSION = "1.3.6"
3
+ end
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by Fontastic.me</metadata>
5
+ <defs>
6
+ <font id="slick" horiz-adv-x="512">
7
+ <font-face font-family="slick" units-per-em="512" ascent="480" descent="-32"/>
8
+ <missing-glyph horiz-adv-x="512" />
9
+
10
+ <glyph unicode="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
11
+ <glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
12
+ <glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
13
+ <glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
14
+ </font></defs></svg>
@@ -0,0 +1,1703 @@
1
+ /*
2
+ _ _ _ _
3
+ ___| (_) ___| | __ (_)___
4
+ / __| | |/ __| |/ / | / __|
5
+ \__ \ | | (__| < _ | \__ \
6
+ |___/_|_|\___|_|\_(_)/ |___/
7
+ |__/
8
+
9
+ Version: 1.3.6
10
+ Author: Ken Wheeler
11
+ Website: http://kenwheeler.github.io
12
+ Docs: http://kenwheeler.github.io/slick
13
+ Repo: http://github.com/kenwheeler/slick
14
+ Issues: http://github.com/kenwheeler/slick/issues
15
+
16
+ */
17
+
18
+ /* global window, document, define, jQuery, setInterval, clearInterval */
19
+
20
+ (function(factory) {
21
+ 'use strict';
22
+ if (typeof define === 'function' && define.amd) {
23
+ define(['jquery'], factory);
24
+ } else {
25
+ factory(jQuery);
26
+ }
27
+
28
+ }(function($) {
29
+ 'use strict';
30
+ var Slick = window.Slick || {};
31
+
32
+ Slick = (function() {
33
+
34
+ var instanceUid = 0;
35
+
36
+ function Slick(element, settings) {
37
+
38
+ var _ = this,
39
+ responsiveSettings, breakpoint;
40
+
41
+ _.defaults = {
42
+ accessibility: true,
43
+ arrows: true,
44
+ autoplay: false,
45
+ autoplaySpeed: 3000,
46
+ centerMode: false,
47
+ centerPadding: '50px',
48
+ cssEase: 'ease',
49
+ customPaging: function(slider, i) {
50
+ return '<button type="button">' + (i + 1) + '</button>';
51
+ },
52
+ dots: false,
53
+ draggable: true,
54
+ easing: 'linear',
55
+ fade: false,
56
+ infinite: true,
57
+ lazyLoad: 'ondemand',
58
+ onBeforeChange: null,
59
+ onAfterChange: null,
60
+ onInit: null,
61
+ onReInit: null,
62
+ pauseOnHover: true,
63
+ responsive: null,
64
+ slide: 'div',
65
+ slidesToShow: 1,
66
+ slidesToScroll: 1,
67
+ speed: 300,
68
+ swipe: true,
69
+ touchMove: true,
70
+ touchThreshold: 5,
71
+ useCSS: true,
72
+ vertical: false
73
+ };
74
+
75
+ _.initials = {
76
+ animating: false,
77
+ autoPlayTimer: null,
78
+ currentSlide: 0,
79
+ currentLeft: null,
80
+ direction: 1,
81
+ $dots: null,
82
+ listWidth: null,
83
+ listHeight: null,
84
+ loadIndex: 0,
85
+ $nextArrow: null,
86
+ $prevArrow: null,
87
+ slideCount: null,
88
+ slideWidth: null,
89
+ $slideTrack: null,
90
+ $slides: null,
91
+ sliding: false,
92
+ slideOffset: 0,
93
+ swipeLeft: null,
94
+ $list: null,
95
+ touchObject: {},
96
+ transformsEnabled: false
97
+ };
98
+
99
+ $.extend(_, _.initials);
100
+
101
+ _.activeBreakpoint = null;
102
+ _.animType = null;
103
+ _.animProp = null;
104
+ _.breakpoints = [];
105
+ _.breakpointSettings = [];
106
+ _.cssTransitions = false;
107
+ _.paused = false;
108
+ _.positionProp = null;
109
+ _.$slider = $(element);
110
+ _.$slidesCache = null;
111
+ _.transformType = null;
112
+ _.transitionType = null;
113
+ _.windowWidth = 0;
114
+ _.windowTimer = null;
115
+
116
+ _.options = $.extend({}, _.defaults, settings);
117
+
118
+ _.originalSettings = _.options;
119
+ responsiveSettings = _.options.responsive || null;
120
+
121
+ if (responsiveSettings && responsiveSettings.length > -1) {
122
+ for (breakpoint in responsiveSettings) {
123
+ if (responsiveSettings.hasOwnProperty(breakpoint)) {
124
+ _.breakpoints.push(responsiveSettings[
125
+ breakpoint].breakpoint);
126
+ _.breakpointSettings[responsiveSettings[
127
+ breakpoint].breakpoint] =
128
+ responsiveSettings[breakpoint].settings;
129
+ }
130
+ }
131
+ _.breakpoints.sort(function(a, b) {
132
+ return b - a;
133
+ });
134
+ }
135
+
136
+ _.autoPlay = $.proxy(_.autoPlay, _);
137
+ _.autoPlayClear = $.proxy(_.autoPlayClear, _);
138
+ _.changeSlide = $.proxy(_.changeSlide, _);
139
+ _.setPosition = $.proxy(_.setPosition, _);
140
+ _.swipeHandler = $.proxy(_.swipeHandler, _);
141
+ _.dragHandler = $.proxy(_.dragHandler, _);
142
+ _.keyHandler = $.proxy(_.keyHandler, _);
143
+ _.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
144
+
145
+ _.instanceUid = instanceUid++;
146
+
147
+ _.init();
148
+
149
+ }
150
+
151
+ return Slick;
152
+
153
+ }());
154
+
155
+ Slick.prototype.addSlide = function(markup, index, addBefore) {
156
+
157
+ var _ = this;
158
+
159
+ if (typeof(index) === 'boolean') {
160
+ addBefore = index;
161
+ index = null;
162
+ } else if (index < 0 || (index >= _.slideCount)) {
163
+ return false;
164
+ }
165
+
166
+ _.unload();
167
+
168
+ if (typeof(index) === 'number') {
169
+ if (index === 0 && _.$slides.length === 0) {
170
+ $(markup).appendTo(_.$slideTrack);
171
+ } else if (addBefore) {
172
+ $(markup).insertBefore(_.$slides.eq(index));
173
+ } else {
174
+ $(markup).insertAfter(_.$slides.eq(index));
175
+ }
176
+ } else {
177
+ if (addBefore === true) {
178
+ $(markup).prependTo(_.$slideTrack);
179
+ } else {
180
+ $(markup).appendTo(_.$slideTrack);
181
+ }
182
+ }
183
+
184
+ _.$slides = _.$slideTrack.children(this.options.slide);
185
+
186
+ _.$slideTrack.children(this.options.slide).remove();
187
+
188
+ _.$slideTrack.append(_.$slides);
189
+
190
+ _.$slidesCache = _.$slides;
191
+
192
+ _.reinit();
193
+
194
+ };
195
+
196
+ Slick.prototype.animateSlide = function(targetLeft,
197
+ callback) {
198
+
199
+ var animProps = {}, _ = this;
200
+
201
+ if (_.transformsEnabled === false) {
202
+ if (_.options.vertical === false) {
203
+ _.$slideTrack.animate({
204
+ left: targetLeft
205
+ }, _.options.speed, _.options.easing, callback);
206
+ } else {
207
+ _.$slideTrack.animate({
208
+ top: targetLeft
209
+ }, _.options.speed, _.options.easing, callback);
210
+ }
211
+
212
+ } else {
213
+
214
+ if (_.cssTransitions === false) {
215
+
216
+ $({
217
+ animStart: _.currentLeft
218
+ }).animate({
219
+ animStart: targetLeft
220
+ }, {
221
+ duration: _.options.speed,
222
+ easing: _.options.easing,
223
+ step: function(now) {
224
+ if (_.options.vertical === false) {
225
+ animProps[_.animType] = 'translate(' +
226
+ now + 'px, 0px)';
227
+ _.$slideTrack.css(animProps);
228
+ } else {
229
+ animProps[_.animType] = 'translate(0px,' +
230
+ now + 'px)';
231
+ _.$slideTrack.css(animProps);
232
+ }
233
+ },
234
+ complete: function() {
235
+ if (callback) {
236
+ callback.call();
237
+ }
238
+ }
239
+ });
240
+
241
+ } else {
242
+
243
+ _.applyTransition();
244
+
245
+ if (_.options.vertical === false) {
246
+ animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
247
+ } else {
248
+ animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
249
+ }
250
+ _.$slideTrack.css(animProps);
251
+
252
+ if (callback) {
253
+ setTimeout(function() {
254
+
255
+ _.disableTransition();
256
+
257
+ callback.call();
258
+ }, _.options.speed);
259
+ }
260
+
261
+ }
262
+
263
+ }
264
+
265
+ };
266
+
267
+ Slick.prototype.applyTransition = function(slide) {
268
+
269
+ var _ = this,
270
+ transition = {};
271
+
272
+ if (_.options.fade === false) {
273
+ transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
274
+ } else {
275
+ transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
276
+ }
277
+
278
+ if (_.options.fade === false) {
279
+ _.$slideTrack.css(transition);
280
+ } else {
281
+ _.$slides.eq(slide).css(transition);
282
+ }
283
+
284
+ };
285
+
286
+ Slick.prototype.autoPlay = function() {
287
+
288
+ var _ = this;
289
+
290
+ if (_.autoPlayTimer) {
291
+ clearInterval(_.autoPlayTimer);
292
+ }
293
+
294
+ if (_.slideCount > _.options.slidesToShow && _.paused !== true) {
295
+ _.autoPlayTimer = setInterval(_.autoPlayIterator,
296
+ _.options.autoplaySpeed);
297
+ }
298
+
299
+ };
300
+
301
+ Slick.prototype.autoPlayClear = function() {
302
+
303
+ var _ = this;
304
+
305
+ if (_.autoPlayTimer) {
306
+ clearInterval(_.autoPlayTimer);
307
+ }
308
+
309
+ };
310
+
311
+ Slick.prototype.autoPlayIterator = function() {
312
+
313
+ var _ = this;
314
+
315
+ if (_.options.infinite === false) {
316
+
317
+ if (_.direction === 1) {
318
+
319
+ if ((_.currentSlide + 1) === _.slideCount -
320
+ 1) {
321
+ _.direction = 0;
322
+ }
323
+
324
+ _.slideHandler(_.currentSlide + _.options
325
+ .slidesToScroll);
326
+
327
+ } else {
328
+
329
+ if ((_.currentSlide - 1 === 0)) {
330
+
331
+ _.direction = 1;
332
+
333
+ }
334
+
335
+ _.slideHandler(_.currentSlide - _.options
336
+ .slidesToScroll);
337
+
338
+ }
339
+
340
+ } else {
341
+
342
+ _.slideHandler(_.currentSlide + _.options.slidesToScroll);
343
+
344
+ }
345
+
346
+ };
347
+
348
+ Slick.prototype.buildArrows = function() {
349
+
350
+ var _ = this;
351
+
352
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
353
+
354
+ _.$prevArrow = $(
355
+ '<button type="button" class="slick-prev">Previous</button>').appendTo(
356
+ _.$slider);
357
+ _.$nextArrow = $(
358
+ '<button type="button" class="slick-next">Next</button>').appendTo(
359
+ _.$slider);
360
+
361
+ if (_.options.infinite !== true) {
362
+ _.$prevArrow.addClass('slick-disabled');
363
+ }
364
+
365
+ }
366
+
367
+ };
368
+
369
+ Slick.prototype.buildDots = function() {
370
+
371
+ var _ = this,
372
+ i, dotString;
373
+
374
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
375
+
376
+ dotString = '<ul class="slick-dots">';
377
+
378
+ for (i = 0; i <= _.getDotCount(); i += 1) {
379
+ dotString += '<li>' + _.options.customPaging.call(this, _, i) + '</li>';
380
+ }
381
+
382
+ dotString += '</ul>';
383
+
384
+ _.$dots = $(dotString).appendTo(
385
+ _.$slider);
386
+
387
+ _.$dots.find('li').first().addClass(
388
+ 'slick-active');
389
+
390
+ }
391
+
392
+ };
393
+
394
+ Slick.prototype.buildOut = function() {
395
+
396
+ var _ = this;
397
+
398
+ _.$slides = _.$slider.children(_.options.slide +
399
+ ':not(.slick-cloned)').addClass(
400
+ 'slick-slide');
401
+ _.slideCount = _.$slides.length;
402
+ _.$slidesCache = _.$slides;
403
+
404
+ _.$slider.addClass('slick-slider');
405
+
406
+ _.$slideTrack = (_.slideCount === 0) ?
407
+ $('<div class="slick-track"/>').appendTo(_.$slider) :
408
+ _.$slides.wrapAll('<div class="slick-track"/>').parent();
409
+
410
+ _.$list = _.$slideTrack.wrap(
411
+ '<div class="slick-list"/>').parent();
412
+ _.$slideTrack.css('opacity', 0);
413
+
414
+ if (_.options.centerMode === true) {
415
+ _.options.infinite = true;
416
+ _.options.slidesToScroll = 1;
417
+ if (_.options.slidesToShow % 2 === 0) {
418
+ _.options.slidesToShow = 3;
419
+ }
420
+ }
421
+
422
+ $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
423
+
424
+ _.setupInfinite();
425
+
426
+ _.buildArrows();
427
+
428
+ _.buildDots();
429
+
430
+ if (_.options.accessibility === true) {
431
+ _.$list.prop('tabIndex', 0);
432
+ }
433
+
434
+ _.setSlideClasses(typeof this.currentSlide === 'number' ? this.currentSlide : 0);
435
+
436
+ if (_.options.draggable === true) {
437
+ _.$list.addClass('draggable');
438
+ }
439
+
440
+ };
441
+
442
+ Slick.prototype.checkResponsive = function() {
443
+
444
+ var _ = this,
445
+ breakpoint, targetBreakpoint;
446
+
447
+ if (_.originalSettings.responsive && _.originalSettings
448
+ .responsive.length > -1 && _.originalSettings.responsive !== null) {
449
+
450
+ targetBreakpoint = null;
451
+
452
+ for (breakpoint in _.breakpoints) {
453
+ if (_.breakpoints.hasOwnProperty(breakpoint)) {
454
+ if ($(window).width() < _.breakpoints[
455
+ breakpoint]) {
456
+ targetBreakpoint = _.breakpoints[
457
+ breakpoint];
458
+ }
459
+ }
460
+ }
461
+
462
+ if (targetBreakpoint !== null) {
463
+ if (_.activeBreakpoint !== null) {
464
+ if (targetBreakpoint !== _.activeBreakpoint) {
465
+ _.activeBreakpoint =
466
+ targetBreakpoint;
467
+ _.options = $.extend({}, _.defaults,
468
+ _.breakpointSettings[
469
+ targetBreakpoint]);
470
+ _.refresh();
471
+ }
472
+ } else {
473
+ _.activeBreakpoint = targetBreakpoint;
474
+ _.options = $.extend({}, _.defaults,
475
+ _.breakpointSettings[
476
+ targetBreakpoint]);
477
+ _.refresh();
478
+ }
479
+ } else {
480
+ if (_.activeBreakpoint !== null) {
481
+ _.activeBreakpoint = null;
482
+ _.options = $.extend({}, _.defaults,
483
+ _.originalSettings);
484
+ _.refresh();
485
+ }
486
+ }
487
+
488
+ }
489
+
490
+ };
491
+
492
+ Slick.prototype.changeSlide = function(event) {
493
+
494
+ var _ = this;
495
+
496
+ switch (event.data.message) {
497
+
498
+ case 'previous':
499
+ _.slideHandler(_.currentSlide - _.options
500
+ .slidesToScroll);
501
+ break;
502
+
503
+ case 'next':
504
+ _.slideHandler(_.currentSlide + _.options
505
+ .slidesToScroll);
506
+ break;
507
+
508
+ case 'index':
509
+ _.slideHandler($(event.target).parent().index() * _.options.slidesToScroll);
510
+ break;
511
+
512
+ default:
513
+ return false;
514
+ }
515
+
516
+ };
517
+
518
+ Slick.prototype.destroy = function() {
519
+
520
+ var _ = this;
521
+
522
+ _.autoPlayClear();
523
+
524
+ _.touchObject = {};
525
+
526
+ $('.slick-cloned', _.$slider).remove();
527
+ if (_.$dots) {
528
+ _.$dots.remove();
529
+ }
530
+ if (_.$prevArrow) {
531
+ _.$prevArrow.remove();
532
+ _.$nextArrow.remove();
533
+ }
534
+ _.$slides.unwrap().unwrap();
535
+ _.$slides.removeClass(
536
+ 'slick-slide slick-active slick-visible').removeAttr('style');
537
+ _.$slider.removeClass('slick-slider');
538
+ _.$slider.removeClass('slick-initialized');
539
+
540
+ _.$list.off('.slick');
541
+ $(window).off('.slick-' + _.instanceUid);
542
+ };
543
+
544
+ Slick.prototype.disableTransition = function(slide) {
545
+
546
+ var _ = this,
547
+ transition = {};
548
+
549
+ transition[_.transitionType] = "";
550
+
551
+ if (_.options.fade === false) {
552
+ _.$slideTrack.css(transition);
553
+ } else {
554
+ _.$slides.eq(slide).css(transition);
555
+ }
556
+
557
+ };
558
+
559
+ Slick.prototype.fadeSlide = function(slideIndex, callback) {
560
+
561
+ var _ = this;
562
+
563
+ if (_.cssTransitions === false) {
564
+
565
+ _.$slides.eq(slideIndex).css({
566
+ zIndex: 1000
567
+ });
568
+
569
+ _.$slides.eq(slideIndex).animate({
570
+ opacity: 1
571
+ }, _.options.speed, _.options.easing, callback);
572
+
573
+ } else {
574
+
575
+ _.applyTransition(slideIndex);
576
+
577
+ _.$slides.eq(slideIndex).css({
578
+ opacity: 1,
579
+ zIndex: 1000
580
+ });
581
+
582
+ if (callback) {
583
+ setTimeout(function() {
584
+
585
+ _.disableTransition(slideIndex);
586
+
587
+ callback.call();
588
+ }, _.options.speed);
589
+ }
590
+
591
+ }
592
+
593
+ };
594
+
595
+ Slick.prototype.filterSlides = function(filter) {
596
+
597
+ var _ = this;
598
+
599
+ if (filter !== null) {
600
+
601
+ _.unload();
602
+
603
+ _.$slideTrack.children(this.options.slide).remove();
604
+
605
+ _.$slidesCache.filter(filter).appendTo(_.$slideTrack);
606
+
607
+ _.reinit();
608
+
609
+ }
610
+
611
+ };
612
+
613
+ Slick.prototype.getCurrent = function() {
614
+
615
+ var _ = this;
616
+
617
+ return _.currentSlide;
618
+
619
+ };
620
+
621
+ Slick.prototype.getDotCount = function() {
622
+
623
+ var _ = this,
624
+ breaker = 0,
625
+ dotCounter = 0,
626
+ dotCount = 0,
627
+ dotLimit;
628
+
629
+ dotLimit = _.options.infinite === true ? _.slideCount + _.options.slidesToShow - _.options.slidesToScroll : _.slideCount;
630
+
631
+ while (breaker < dotLimit) {
632
+ dotCount++;
633
+ dotCounter += _.options.slidesToScroll;
634
+ breaker = dotCounter + _.options.slidesToShow;
635
+ }
636
+
637
+ return dotCount;
638
+
639
+ };
640
+
641
+ Slick.prototype.getLeft = function(slideIndex) {
642
+
643
+ var _ = this,
644
+ targetLeft,
645
+ verticalHeight,
646
+ verticalOffset = 0;
647
+
648
+ _.slideOffset = 0;
649
+ verticalHeight = _.$slides.first().outerHeight();
650
+
651
+ if (_.options.infinite === true) {
652
+ if (_.slideCount > _.options.slidesToShow) {
653
+ _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
654
+ verticalOffset = (verticalHeight * _.options.slidesToShow) * -1;
655
+ }
656
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
657
+ if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
658
+ _.slideOffset = ((_.slideCount % _.options.slidesToShow) * _.slideWidth) * -1;
659
+ verticalOffset = ((_.slideCount % _.options.slidesToShow) * verticalHeight) * -1;
660
+ }
661
+ }
662
+ } else {
663
+ if (_.slideCount % _.options.slidesToShow !== 0) {
664
+ if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
665
+ _.slideOffset = (_.options.slidesToShow * _.slideWidth) - ((_.slideCount % _.options.slidesToShow) * _.slideWidth);
666
+ verticalOffset = ((_.slideCount % _.options.slidesToShow) * verticalHeight);
667
+ }
668
+ }
669
+ }
670
+
671
+ if (_.options.centerMode === true) {
672
+ _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
673
+ }
674
+
675
+ if (_.options.vertical === false) {
676
+ targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
677
+ } else {
678
+ targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
679
+ }
680
+
681
+ return targetLeft;
682
+
683
+ };
684
+
685
+ Slick.prototype.init = function() {
686
+
687
+ var _ = this;
688
+
689
+ if (!$(_.$slider).hasClass('slick-initialized')) {
690
+
691
+ $(_.$slider).addClass('slick-initialized');
692
+ _.buildOut();
693
+ _.setProps();
694
+ _.startLoad();
695
+ _.loadSlider();
696
+ _.initializeEvents();
697
+ _.checkResponsive();
698
+ }
699
+
700
+ if (_.options.onInit !== null) {
701
+ _.options.onInit.call(this, _);
702
+ }
703
+
704
+ };
705
+
706
+ Slick.prototype.initArrowEvents = function() {
707
+
708
+ var _ = this;
709
+
710
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
711
+ _.$prevArrow.on('click.slick', {
712
+ message: 'previous'
713
+ }, _.changeSlide);
714
+ _.$nextArrow.on('click.slick', {
715
+ message: 'next'
716
+ }, _.changeSlide);
717
+ }
718
+
719
+ };
720
+
721
+ Slick.prototype.initDotEvents = function() {
722
+
723
+ var _ = this;
724
+
725
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
726
+ $('li', _.$dots).on('click.slick', {
727
+ message: 'index'
728
+ }, _.changeSlide);
729
+ }
730
+
731
+ };
732
+
733
+ Slick.prototype.initializeEvents = function() {
734
+
735
+ var _ = this;
736
+
737
+ _.initArrowEvents();
738
+
739
+ _.initDotEvents();
740
+
741
+ _.$list.on('touchstart.slick mousedown.slick', {
742
+ action: 'start'
743
+ }, _.swipeHandler);
744
+ _.$list.on('touchmove.slick mousemove.slick', {
745
+ action: 'move'
746
+ }, _.swipeHandler);
747
+ _.$list.on('touchend.slick mouseup.slick', {
748
+ action: 'end'
749
+ }, _.swipeHandler);
750
+ _.$list.on('touchcancel.slick mouseleave.slick', {
751
+ action: 'end'
752
+ }, _.swipeHandler);
753
+
754
+ if (_.options.pauseOnHover === true && _.options.autoplay === true) {
755
+ _.$list.on('mouseenter.slick', _.autoPlayClear);
756
+ _.$list.on('mouseleave.slick', _.autoPlay);
757
+ }
758
+
759
+ if(_.options.accessibility === true) {
760
+ _.$list.on('keydown.slick', _.keyHandler);
761
+ }
762
+
763
+ $(window).on('orientationchange.slick.slick-' + _.instanceUid, function() {
764
+ _.checkResponsive();
765
+ _.setPosition();
766
+ });
767
+
768
+ $(window).on('resize.slick.slick-' + _.instanceUid, function() {
769
+ if ($(window).width !== _.windowWidth) {
770
+ clearTimeout(_.windowDelay);
771
+ _.windowDelay = window.setTimeout(function() {
772
+ _.windowWidth = $(window).width();
773
+ _.checkResponsive();
774
+ _.setPosition();
775
+ }, 50);
776
+ }
777
+ });
778
+
779
+ $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
780
+ $(document).on('ready.slick.slick-' + _.instanceUid, _.setPosition);
781
+
782
+ };
783
+
784
+ Slick.prototype.initUI = function() {
785
+
786
+ var _ = this;
787
+
788
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
789
+
790
+ _.$prevArrow.show();
791
+ _.$nextArrow.show();
792
+
793
+ }
794
+
795
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
796
+
797
+ _.$dots.show();
798
+
799
+ }
800
+
801
+ if (_.options.autoplay === true) {
802
+
803
+ _.autoPlay();
804
+
805
+ }
806
+
807
+ };
808
+
809
+ Slick.prototype.keyHandler = function(event) {
810
+
811
+ var _ = this;
812
+
813
+ if (event.keyCode === 37) {
814
+ _.changeSlide({
815
+ data: {
816
+ message: 'previous'
817
+ }
818
+ });
819
+ } else if (event.keyCode === 39) {
820
+ _.changeSlide({
821
+ data: {
822
+ message: 'next'
823
+ }
824
+ });
825
+ }
826
+
827
+ };
828
+
829
+ Slick.prototype.lazyLoad = function() {
830
+
831
+ var _ = this,
832
+ loadRange, cloneRange, rangeStart, rangeEnd;
833
+
834
+ if (_.options.centerMode === true || _.options.fade === true ) {
835
+ rangeStart = _.options.slidesToShow + _.currentSlide - 1;
836
+ rangeEnd = rangeStart + _.options.slidesToShow + 2;
837
+ } else {
838
+ rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
839
+ rangeEnd = rangeStart + _.options.slidesToShow;
840
+ }
841
+
842
+ loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
843
+
844
+ $('img[data-lazy]', loadRange).not('[src]').each(function() {
845
+ $(this).css({opacity: 0}).attr('src', $(this).attr('data-lazy')).removeClass('slick-loading').load(function(){
846
+ $(this).animate({ opacity: 1 }, 200);
847
+ });
848
+ });
849
+
850
+ if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
851
+ cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
852
+ $('img[data-lazy]', cloneRange).not('[src]').each(function() {
853
+ $(this).css({opacity: 0}).attr('src', $(this).attr('data-lazy')).removeClass('slick-loading').load(function(){
854
+ $(this).animate({ opacity: 1 }, 200);
855
+ });
856
+ });
857
+ } else if (_.currentSlide === 0) {
858
+ cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
859
+ $('img[data-lazy]', cloneRange).not('[src]').each(function() {
860
+ $(this).css({opacity: 0}).attr('src', $(this).attr('data-lazy')).removeClass('slick-loading').load(function(){
861
+ $(this).animate({ opacity: 1 }, 200);
862
+ });
863
+ });
864
+ }
865
+
866
+ };
867
+
868
+ Slick.prototype.loadSlider = function() {
869
+
870
+ var _ = this;
871
+
872
+ _.setPosition();
873
+
874
+ _.$slideTrack.css({
875
+ opacity: 1
876
+ });
877
+
878
+ _.$slider.removeClass('slick-loading');
879
+
880
+ _.initUI();
881
+
882
+ if (_.options.lazyLoad === 'progressive') {
883
+ _.progressiveLazyLoad();
884
+ }
885
+
886
+ };
887
+
888
+ Slick.prototype.postSlide = function(index) {
889
+
890
+ var _ = this;
891
+
892
+ if (_.options.onAfterChange !== null) {
893
+ _.options.onAfterChange.call(this, _, index);
894
+ }
895
+
896
+ _.animating = false;
897
+
898
+ _.setPosition();
899
+
900
+ _.swipeLeft = null;
901
+
902
+ if (_.options.autoplay === true && _.paused === false) {
903
+ _.autoPlay();
904
+ }
905
+
906
+ };
907
+
908
+ Slick.prototype.progressiveLazyLoad = function() {
909
+
910
+ var _ = this,
911
+ imgCount, targetImage;
912
+
913
+ imgCount = $('img[data-lazy]').not('[src]').length;
914
+
915
+ if (imgCount > 0) {
916
+ targetImage = $($('img[data-lazy]', _.$slider).not('[src]').get(0));
917
+ targetImage.attr('src', targetImage.attr('data-lazy')).removeClass('slick-loading').load(function() {
918
+ _.progressiveLazyLoad();
919
+ });
920
+ }
921
+
922
+ };
923
+
924
+ Slick.prototype.refresh = function() {
925
+
926
+ var _ = this,
927
+ currentSlide = _.currentSlide;
928
+
929
+ _.destroy();
930
+
931
+ $.extend(_, _.initials);
932
+
933
+ _.currentSlide = currentSlide;
934
+ _.init();
935
+
936
+ };
937
+
938
+ Slick.prototype.reinit = function() {
939
+
940
+ var _ = this;
941
+
942
+ _.$slides = _.$slideTrack.children(_.options.slide).addClass(
943
+ 'slick-slide');
944
+
945
+ _.slideCount = _.$slides.length;
946
+
947
+ if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
948
+ _.currentSlide = _.currentSlide - _.options.slidesToScroll;
949
+ }
950
+
951
+ _.setProps();
952
+
953
+ _.setupInfinite();
954
+
955
+ _.buildArrows();
956
+
957
+ _.updateArrows();
958
+
959
+ _.initArrowEvents();
960
+
961
+ _.buildDots();
962
+
963
+ _.updateDots();
964
+
965
+ _.initDotEvents();
966
+
967
+ _.setSlideClasses(0);
968
+
969
+ _.setPosition();
970
+
971
+ if (_.options.onReInit !== null) {
972
+ _.options.onReInit.call(this, _);
973
+ }
974
+
975
+ };
976
+
977
+ Slick.prototype.removeSlide = function(index, removeBefore) {
978
+
979
+ var _ = this;
980
+
981
+ if (typeof(index) === 'boolean') {
982
+ removeBefore = index;
983
+ index = removeBefore === true ? 0 : _.slideCount - 1;
984
+ } else {
985
+ index = removeBefore === true ? --index : index;
986
+ }
987
+
988
+ if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
989
+ return false;
990
+ }
991
+
992
+ _.unload();
993
+
994
+ _.$slideTrack.children(this.options.slide).eq(index).remove();
995
+
996
+ _.$slides = _.$slideTrack.children(this.options.slide);
997
+
998
+ _.$slideTrack.children(this.options.slide).remove();
999
+
1000
+ _.$slideTrack.append(_.$slides);
1001
+
1002
+ _.$slidesCache = _.$slides;
1003
+
1004
+ _.reinit();
1005
+
1006
+ };
1007
+
1008
+ Slick.prototype.setCSS = function(position) {
1009
+
1010
+ var _ = this,
1011
+ positionProps = {}, x, y;
1012
+
1013
+ x = _.positionProp == 'left' ? position + 'px' : '0px';
1014
+ y = _.positionProp == 'top' ? position + 'px' : '0px';
1015
+
1016
+ positionProps[_.positionProp] = position;
1017
+
1018
+ if (_.transformsEnabled === false) {
1019
+ _.$slideTrack.css(positionProps);
1020
+ } else {
1021
+ positionProps = {};
1022
+ if (_.cssTransitions === false) {
1023
+ positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
1024
+ _.$slideTrack.css(positionProps);
1025
+ } else {
1026
+ positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
1027
+ _.$slideTrack.css(positionProps);
1028
+ }
1029
+ }
1030
+
1031
+ };
1032
+
1033
+ Slick.prototype.setDimensions = function() {
1034
+
1035
+ var _ = this;
1036
+
1037
+ if (_.options.centerMode === true) {
1038
+ _.$slideTrack.children('.slick-slide').width(_.slideWidth);
1039
+ } else {
1040
+ _.$slideTrack.children('.slick-slide').width(_.slideWidth);
1041
+ }
1042
+
1043
+
1044
+ if (_.options.vertical === false) {
1045
+ _.$slideTrack.width(Math.ceil((_.slideWidth * _
1046
+ .$slideTrack.children('.slick-slide').length)));
1047
+ if (_.options.centerMode === true) {
1048
+ _.$list.css({
1049
+ padding: ('0px ' + _.options.centerPadding)
1050
+ });
1051
+ }
1052
+ } else {
1053
+ _.$list.height(_.$slides.first().outerHeight() * _.options.slidesToShow);
1054
+ _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight() * _
1055
+ .$slideTrack.children('.slick-slide').length)));
1056
+ if (_.options.centerMode === true) {
1057
+ _.$list.css({
1058
+ padding: (_.options.centerPadding + ' 0px')
1059
+ });
1060
+ }
1061
+ }
1062
+
1063
+ };
1064
+
1065
+ Slick.prototype.setFade = function() {
1066
+
1067
+ var _ = this,
1068
+ targetLeft;
1069
+
1070
+ _.$slides.each(function(index, element) {
1071
+ targetLeft = (_.slideWidth * index) * -1;
1072
+ $(element).css({
1073
+ position: 'relative',
1074
+ left: targetLeft,
1075
+ top: 0,
1076
+ zIndex: 800,
1077
+ opacity: 0
1078
+ });
1079
+ });
1080
+
1081
+ _.$slides.eq(_.currentSlide).css({
1082
+ zIndex: 900,
1083
+ opacity: 1
1084
+ });
1085
+
1086
+ };
1087
+
1088
+ Slick.prototype.setPosition = function() {
1089
+
1090
+ var _ = this;
1091
+
1092
+ _.setValues();
1093
+ _.setDimensions();
1094
+
1095
+ if (_.options.fade === false) {
1096
+ _.setCSS(_.getLeft(_.currentSlide));
1097
+ } else {
1098
+ _.setFade();
1099
+ }
1100
+
1101
+ };
1102
+
1103
+ Slick.prototype.setProps = function() {
1104
+
1105
+ var _ = this;
1106
+
1107
+ _.positionProp = _.options.vertical === true ? 'top' : 'left';
1108
+
1109
+ if (_.positionProp === 'top') {
1110
+ _.$slider.addClass('slick-vertical');
1111
+ } else {
1112
+ _.$slider.removeClass('slick-vertical');
1113
+ }
1114
+
1115
+ if (document.body.style.WebkitTransition !== undefined ||
1116
+ document.body.style.MozTransition !== undefined ||
1117
+ document.body.style.msTransition !== undefined) {
1118
+ if(_.options.useCSS === true) {
1119
+ _.cssTransitions = true;
1120
+ }
1121
+ }
1122
+
1123
+ if (document.body.style.MozTransform !== undefined) {
1124
+ _.animType = 'MozTransform';
1125
+ _.transformType = "-moz-transform";
1126
+ _.transitionType = 'MozTransition';
1127
+ }
1128
+ if (document.body.style.webkitTransform !== undefined) {
1129
+ _.animType = 'webkitTransform';
1130
+ _.transformType = "-webkit-transform";
1131
+ _.transitionType = 'webkitTransition';
1132
+ }
1133
+ if (document.body.style.msTransform !== undefined) {
1134
+ _.animType = 'transform';
1135
+ _.transformType = "transform";
1136
+ _.transitionType = 'transition';
1137
+ }
1138
+
1139
+ _.transformsEnabled = (_.animType !== null);
1140
+
1141
+ };
1142
+
1143
+ Slick.prototype.setValues = function() {
1144
+
1145
+ var _ = this;
1146
+
1147
+ _.listWidth = _.$list.width();
1148
+ _.listHeight = _.$list.height();
1149
+ if(_.options.vertical === false) {
1150
+ _.slideWidth = Math.ceil(_.listWidth / _.options
1151
+ .slidesToShow);
1152
+ } else {
1153
+ _.slideWidth = Math.ceil(_.listWidth);
1154
+ }
1155
+
1156
+ };
1157
+
1158
+ Slick.prototype.setSlideClasses = function(index) {
1159
+
1160
+ var _ = this,
1161
+ centerOffset, allSlides, indexOffset;
1162
+
1163
+ _.$slider.find('.slick-slide').removeClass('slick-active').removeClass('slick-center');
1164
+ allSlides = _.$slider.find('.slick-slide');
1165
+
1166
+ if (_.options.centerMode === true) {
1167
+
1168
+ centerOffset = Math.floor(_.options.slidesToShow / 2);
1169
+
1170
+ if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
1171
+ _.$slides.slice(index - centerOffset, index + centerOffset + 1).addClass('slick-active');
1172
+ } else {
1173
+ indexOffset = _.options.slidesToShow + index;
1174
+ allSlides.slice(indexOffset - centerOffset + 1, indexOffset + centerOffset + 2).addClass('slick-active');
1175
+ }
1176
+
1177
+ if (index === 0) {
1178
+ allSlides.eq(allSlides.length - 1 - _.options.slidesToShow).addClass('slick-center');
1179
+ } else if (index === _.slideCount - 1) {
1180
+ allSlides.eq(_.options.slidesToShow).addClass('slick-center');
1181
+ }
1182
+
1183
+ _.$slides.eq(index).addClass('slick-center');
1184
+
1185
+ } else {
1186
+
1187
+ if (index > 0 && index < (_.slideCount - _.options.slidesToShow)) {
1188
+ _.$slides.slice(index, index + _.options.slidesToShow).addClass('slick-active');
1189
+ } else if ( allSlides.length <= _.options.slidesToShow ) {
1190
+ allSlides.addClass('slick-active');
1191
+ } else {
1192
+ indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
1193
+ allSlides.slice(indexOffset, indexOffset + _.options.slidesToShow).addClass('slick-active');
1194
+ }
1195
+
1196
+ }
1197
+
1198
+ if (_.options.lazyLoad === 'ondemand') {
1199
+ _.lazyLoad();
1200
+ }
1201
+
1202
+ };
1203
+
1204
+ Slick.prototype.setupInfinite = function() {
1205
+
1206
+ var _ = this,
1207
+ i, slideIndex, infiniteCount;
1208
+
1209
+ if (_.options.fade === true || _.options.vertical === true) {
1210
+ _.options.centerMode = false;
1211
+ }
1212
+
1213
+ if (_.options.infinite === true && _.options.fade === false) {
1214
+
1215
+ slideIndex = null;
1216
+
1217
+ if (_.slideCount > _.options.slidesToShow) {
1218
+
1219
+ if (_.options.centerMode === true) {
1220
+ infiniteCount = _.options.slidesToShow + 1;
1221
+ } else {
1222
+ infiniteCount = _.options.slidesToShow;
1223
+ }
1224
+
1225
+ for (i = _.slideCount; i > (_.slideCount -
1226
+ infiniteCount); i -= 1) {
1227
+ slideIndex = i - 1;
1228
+ $(_.$slides[slideIndex]).clone().attr('id', '').prependTo(
1229
+ _.$slideTrack).addClass('slick-cloned');
1230
+ }
1231
+ for (i = 0; i < infiniteCount; i += 1) {
1232
+ slideIndex = i;
1233
+ $(_.$slides[slideIndex]).clone().attr('id', '').appendTo(
1234
+ _.$slideTrack).addClass('slick-cloned');
1235
+ }
1236
+ _.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
1237
+ $(this).attr('id', '');
1238
+ });
1239
+
1240
+ }
1241
+
1242
+ }
1243
+
1244
+ };
1245
+
1246
+ Slick.prototype.slideHandler = function(index) {
1247
+
1248
+ var targetSlide, animSlide, slideLeft, unevenOffset, targetLeft = null,
1249
+ _ = this;
1250
+
1251
+ if (_.animating === true) {
1252
+ return false;
1253
+ }
1254
+
1255
+ targetSlide = index;
1256
+ targetLeft = _.getLeft(targetSlide);
1257
+ slideLeft = _.getLeft(_.currentSlide);
1258
+
1259
+ unevenOffset = _.slideCount % _.options.slidesToScroll !== 0 ? _.options.slidesToScroll : 0;
1260
+
1261
+ _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
1262
+
1263
+ if (_.options.infinite === false && (index < 0 || index > (_.slideCount - _.options.slidesToShow + unevenOffset))) {
1264
+ if(_.options.fade === false) {
1265
+ targetSlide = _.currentSlide;
1266
+ _.animateSlide(slideLeft, function() {
1267
+ _.postSlide(targetSlide);
1268
+ });
1269
+ }
1270
+ return false;
1271
+ }
1272
+
1273
+ if (_.options.autoplay === true) {
1274
+ clearInterval(_.autoPlayTimer);
1275
+ }
1276
+
1277
+ if (targetSlide < 0) {
1278
+ if (_.slideCount % _.options.slidesToScroll !== 0) {
1279
+ animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
1280
+ } else {
1281
+ animSlide = _.slideCount - _.options.slidesToScroll;
1282
+ }
1283
+ } else if (targetSlide > (_.slideCount - 1)) {
1284
+ animSlide = 0;
1285
+ } else {
1286
+ animSlide = targetSlide;
1287
+ }
1288
+
1289
+ _.animating = true;
1290
+
1291
+ if (_.options.onBeforeChange !== null && index !== _.currentSlide) {
1292
+ _.options.onBeforeChange.call(this, _, _.currentSlide, animSlide);
1293
+ }
1294
+
1295
+ _.currentSlide = animSlide;
1296
+
1297
+ _.setSlideClasses(_.currentSlide);
1298
+
1299
+ _.updateDots();
1300
+ _.updateArrows();
1301
+
1302
+ if (_.options.fade === true) {
1303
+ _.fadeSlide(animSlide, function() {
1304
+ _.postSlide(animSlide);
1305
+ });
1306
+ return false;
1307
+ }
1308
+
1309
+ _.animateSlide(targetLeft, function() {
1310
+ _.postSlide(animSlide);
1311
+ });
1312
+
1313
+ };
1314
+
1315
+ Slick.prototype.startLoad = function() {
1316
+
1317
+ var _ = this;
1318
+
1319
+ if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
1320
+
1321
+ _.$prevArrow.hide();
1322
+ _.$nextArrow.hide();
1323
+
1324
+ }
1325
+
1326
+ if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
1327
+
1328
+ _.$dots.hide();
1329
+
1330
+ }
1331
+
1332
+ _.$slider.addClass('slick-loading');
1333
+
1334
+ };
1335
+
1336
+ Slick.prototype.swipeDirection = function() {
1337
+
1338
+ var xDist, yDist, r, swipeAngle, _ = this;
1339
+
1340
+ xDist = _.touchObject.startX - _.touchObject.curX;
1341
+ yDist = _.touchObject.startY - _.touchObject.curY;
1342
+ r = Math.atan2(yDist, xDist);
1343
+
1344
+ swipeAngle = Math.round(r * 180 / Math.PI);
1345
+ if (swipeAngle < 0) {
1346
+ swipeAngle = 360 - Math.abs(swipeAngle);
1347
+ }
1348
+
1349
+ if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
1350
+ return 'left';
1351
+ }
1352
+ if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
1353
+ return 'left';
1354
+ }
1355
+ if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
1356
+ return 'right';
1357
+ }
1358
+
1359
+ return 'vertical';
1360
+
1361
+ };
1362
+
1363
+ Slick.prototype.swipeEnd = function(event) {
1364
+
1365
+ var _ = this;
1366
+
1367
+ _.$list.removeClass('dragging');
1368
+
1369
+ if (_.touchObject.curX === undefined) {
1370
+ return false;
1371
+ }
1372
+
1373
+ if (_.touchObject.swipeLength >= _.touchObject.minSwipe) {
1374
+ $(event.target).on('click.slick', function(event) {
1375
+ event.stopImmediatePropagation();
1376
+ event.stopPropagation();
1377
+ event.preventDefault();
1378
+ $(event.target).off('click.slick');
1379
+ });
1380
+
1381
+ switch (_.swipeDirection()) {
1382
+ case 'left':
1383
+ _.slideHandler(_.currentSlide + _.options.slidesToScroll);
1384
+ _.touchObject = {};
1385
+ break;
1386
+
1387
+ case 'right':
1388
+ _.slideHandler(_.currentSlide - _.options.slidesToScroll);
1389
+ _.touchObject = {};
1390
+ break;
1391
+ }
1392
+ } else {
1393
+ if(_.touchObject.startX !== _.touchObject.curX) {
1394
+ _.slideHandler(_.currentSlide);
1395
+ _.touchObject = {};
1396
+ }
1397
+ }
1398
+
1399
+ };
1400
+
1401
+ Slick.prototype.swipeHandler = function(event) {
1402
+
1403
+ var _ = this;
1404
+
1405
+ if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
1406
+ return undefined;
1407
+ } else if ((_.options.draggable === false) || (_.options.draggable === false && !event.originalEvent.touches)) {
1408
+ return undefined;
1409
+ }
1410
+
1411
+ _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
1412
+ event.originalEvent.touches.length : 1;
1413
+
1414
+ _.touchObject.minSwipe = _.listWidth / _.options
1415
+ .touchThreshold;
1416
+
1417
+ switch (event.data.action) {
1418
+
1419
+ case 'start':
1420
+ _.swipeStart(event);
1421
+ break;
1422
+
1423
+ case 'move':
1424
+ _.swipeMove(event);
1425
+ break;
1426
+
1427
+ case 'end':
1428
+ _.swipeEnd(event);
1429
+ break;
1430
+
1431
+ }
1432
+
1433
+ };
1434
+
1435
+ Slick.prototype.swipeMove = function(event) {
1436
+
1437
+ var _ = this,
1438
+ curLeft, swipeDirection, positionOffset, touches;
1439
+
1440
+ touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
1441
+
1442
+ curLeft = _.getLeft(_.currentSlide);
1443
+
1444
+ if (!_.$list.hasClass('dragging') || touches && touches.length !== 1) {
1445
+ return false;
1446
+ }
1447
+
1448
+ _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
1449
+ _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
1450
+
1451
+ _.touchObject.swipeLength = Math.round(Math.sqrt(
1452
+ Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
1453
+
1454
+ swipeDirection = _.swipeDirection();
1455
+
1456
+ if (swipeDirection === 'vertical') {
1457
+ return;
1458
+ }
1459
+
1460
+ if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
1461
+ event.preventDefault();
1462
+ }
1463
+
1464
+ positionOffset = _.touchObject.curX > _.touchObject.startX ? 1 : -1;
1465
+
1466
+ if (_.options.vertical === false) {
1467
+ _.swipeLeft = curLeft + _.touchObject.swipeLength * positionOffset;
1468
+ } else {
1469
+ _.swipeLeft = curLeft + (_.touchObject
1470
+ .swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
1471
+ }
1472
+
1473
+ if (_.options.fade === true || _.options.touchMove === false) {
1474
+ return false;
1475
+ }
1476
+
1477
+ if (_.animating === true) {
1478
+ _.swipeLeft = null;
1479
+ return false;
1480
+ }
1481
+
1482
+ _.setCSS(_.swipeLeft);
1483
+
1484
+ };
1485
+
1486
+ Slick.prototype.swipeStart = function(event) {
1487
+
1488
+ var _ = this,
1489
+ touches;
1490
+
1491
+ if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
1492
+ _.touchObject = {};
1493
+ return false;
1494
+ }
1495
+
1496
+ if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
1497
+ touches = event.originalEvent.touches[0];
1498
+ }
1499
+
1500
+ _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
1501
+ _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
1502
+
1503
+ _.$list.addClass('dragging');
1504
+
1505
+ };
1506
+
1507
+ Slick.prototype.unfilterSlides = function() {
1508
+
1509
+ var _ = this;
1510
+
1511
+ if (_.$slidesCache !== null) {
1512
+
1513
+ _.unload();
1514
+
1515
+ _.$slideTrack.children(this.options.slide).remove();
1516
+
1517
+ _.$slidesCache.appendTo(_.$slideTrack);
1518
+
1519
+ _.reinit();
1520
+
1521
+ }
1522
+
1523
+ };
1524
+
1525
+ Slick.prototype.unload = function() {
1526
+
1527
+ var _ = this;
1528
+
1529
+ $('.slick-cloned', _.$slider).remove();
1530
+ if (_.$dots) {
1531
+ _.$dots.remove();
1532
+ }
1533
+ if (_.$prevArrow) {
1534
+ _.$prevArrow.remove();
1535
+ _.$nextArrow.remove();
1536
+ }
1537
+ _.$slides.removeClass(
1538
+ 'slick-slide slick-active slick-visible').removeAttr('style');
1539
+
1540
+ };
1541
+
1542
+ Slick.prototype.updateArrows = function() {
1543
+
1544
+ var _ = this;
1545
+
1546
+ if (_.options.arrows === true && _.options.infinite !==
1547
+ true && _.slideCount > _.options.slidesToShow) {
1548
+ _.$prevArrow.removeClass('slick-disabled');
1549
+ _.$nextArrow.removeClass('slick-disabled');
1550
+ if (_.currentSlide === 0) {
1551
+ _.$prevArrow.addClass('slick-disabled');
1552
+ _.$nextArrow.removeClass('slick-disabled');
1553
+ } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
1554
+ _.$nextArrow.addClass('slick-disabled');
1555
+ _.$prevArrow.removeClass('slick-disabled');
1556
+ }
1557
+ }
1558
+
1559
+ };
1560
+
1561
+ Slick.prototype.updateDots = function() {
1562
+
1563
+ var _ = this;
1564
+
1565
+ if (_.$dots !== null) {
1566
+
1567
+ _.$dots.find('li').removeClass('slick-active');
1568
+ _.$dots.find('li').eq(_.currentSlide / _.options.slidesToScroll).addClass(
1569
+ 'slick-active');
1570
+
1571
+ }
1572
+
1573
+ };
1574
+
1575
+ $.fn.slick = function(options) {
1576
+ var _ = this;
1577
+ return _.each(function(index, element) {
1578
+
1579
+ element.slick = new Slick(element, options);
1580
+
1581
+ });
1582
+ };
1583
+
1584
+ $.fn.slickAdd = function(slide, slideIndex, addBefore) {
1585
+ var _ = this;
1586
+ return _.each(function(index, element) {
1587
+
1588
+ element.slick.addSlide(slide, slideIndex, addBefore);
1589
+
1590
+ });
1591
+ };
1592
+
1593
+ $.fn.slickCurrentSlide = function() {
1594
+ var _ = this;
1595
+ return _.get(0).slick.getCurrent();
1596
+ };
1597
+
1598
+ $.fn.slickFilter = function(filter) {
1599
+ var _ = this;
1600
+ return _.each(function(index, element) {
1601
+
1602
+ element.slick.filterSlides(filter);
1603
+
1604
+ });
1605
+ };
1606
+
1607
+ $.fn.slickGoTo = function(slide) {
1608
+ var _ = this;
1609
+ return _.each(function(index, element) {
1610
+
1611
+ element.slick.slideHandler(slide);
1612
+
1613
+ });
1614
+ };
1615
+
1616
+ $.fn.slickNext = function() {
1617
+ var _ = this;
1618
+ return _.each(function(index, element) {
1619
+
1620
+ element.slick.changeSlide({
1621
+ data: {
1622
+ message: 'next'
1623
+ }
1624
+ });
1625
+
1626
+ });
1627
+ };
1628
+
1629
+ $.fn.slickPause = function() {
1630
+ var _ = this;
1631
+ return _.each(function(index, element) {
1632
+
1633
+ element.slick.autoPlayClear();
1634
+ element.slick.paused = true;
1635
+
1636
+ });
1637
+ };
1638
+
1639
+ $.fn.slickPlay = function() {
1640
+ var _ = this;
1641
+ return _.each(function(index, element) {
1642
+
1643
+ element.slick.paused = false;
1644
+ element.slick.autoPlay();
1645
+
1646
+ });
1647
+ };
1648
+
1649
+ $.fn.slickPrev = function() {
1650
+ var _ = this;
1651
+ return _.each(function(index, element) {
1652
+
1653
+ element.slick.changeSlide({
1654
+ data: {
1655
+ message: 'previous'
1656
+ }
1657
+ });
1658
+
1659
+ });
1660
+ };
1661
+
1662
+ $.fn.slickRemove = function(slideIndex, removeBefore) {
1663
+ var _ = this;
1664
+ return _.each(function(index, element) {
1665
+
1666
+ element.slick.removeSlide(slideIndex, removeBefore);
1667
+
1668
+ });
1669
+ };
1670
+
1671
+ $.fn.slickSetOption = function(option, value, refresh) {
1672
+ var _ = this;
1673
+ return _.each(function(index, element) {
1674
+
1675
+ element.slick.options[option] = value;
1676
+
1677
+ if (refresh === true) {
1678
+ element.slick.unload();
1679
+ element.slick.reinit();
1680
+ }
1681
+
1682
+ });
1683
+ };
1684
+
1685
+ $.fn.slickUnfilter = function() {
1686
+ var _ = this;
1687
+ return _.each(function(index, element) {
1688
+
1689
+ element.slick.unfilterSlides();
1690
+
1691
+ });
1692
+ };
1693
+
1694
+ $.fn.unslick = function() {
1695
+ var _ = this;
1696
+ return _.each(function(index, element) {
1697
+
1698
+ element.slick.destroy();
1699
+
1700
+ });
1701
+ };
1702
+
1703
+ }));