vendor: 2,955 bytes, lines 1-85
1/*! lightgallery - v1.2.14 - 2016-01-18 2* http://sachinchoolur.github.io/lightGallery/ 3* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ 4(function($, window, document, undefined) { 5 6 'use strict'; 7 8 var defaults = { 9 pager: false 10 }; 11 12 var Pager = function(element) { 13 14 this.core = $(element).data('lightGallery'); 15 16 this.$el = $(element); 17 this.core.s = $.extend({}, defaults, this.core.s); 18 if (this.core.s.pager && this.core.$items.length > 1) { 19 this.init(); 20 } 21 22 return this; 23 }; 24 25 Pager.prototype.init = function() { 26 var _this = this; 27 var pagerList = ''; 28 var $pagerCont; 29 var $pagerOuter; 30 var timeout; 31 32 _this.core.$outer.find('.lg').append('<div class="lg-pager-outer"></div>'); 33 34 if (_this.core.s.dynamic) { 35 for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { 36 pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + _this.core.s.dynamicEl[i].thumb + '" /></div></span>'; 37 } 38 } else { 39 _this.core.$items.each(function() { 40 41 if (!_this.core.s.exThumbImage) { 42 pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).find('img').attr('src') + '" /></div></span>'; 43 } else { 44 pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).attr(_this.core.s.exThumbImage) + '" /></div></span>'; 45 } 46 47 }); 48 } 49 50 $pagerOuter = _this.core.$outer.find('.lg-pager-outer'); 51 52 $pagerOuter.html(pagerList); 53 54 $pagerCont = _this.core.$outer.find('.lg-pager-cont'); 55 $pagerCont.on('click.lg touchend.lg', function() { 56 var _$this = $(this); 57 _this.core.index = _$this.index(); 58 _this.core.slide(_this.core.index, false, false); 59 }); 60 61 $pagerOuter.on('mouseover.lg', function() { 62 clearTimeout(timeout); 63 $pagerOuter.addClass('lg-pager-hover'); 64 }); 65 66 $pagerOuter.on('mouseout.lg', function() { 67 timeout = setTimeout(function() { 68 $pagerOuter.removeClass('lg-pager-hover'); 69 }); 70 }); 71 72 _this.core.$el.on('onBeforeSlide.lg.tm', function(e, prevIndex, index) { 73 $pagerCont.removeClass('lg-pager-active'); 74 $pagerCont.eq(index).addClass('lg-pager-active'); 75 }); 76 77 }; 78 79 Pager.prototype.destroy = function() { 80 81 }; 82 83 $.fn.lightGallery.modules.pager = Pager; 84 85})(jQuery, window, document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.