1(function() { 2 'use strict'; 3 4 var defaults = { 5 6 mode: 'lg-slide', 7 8 // Ex : 'ease' 9 cssEasing: 'ease', 10 11 //'for jquery animation' 12 easing: 'linear', 13 speed: 600, 14 height: '100%', 15 width: '100%', 16 addClass: '', 17 startClass: 'lg-start-zoom', 18 backdropDuration: 150, 19 hideBarsDelay: 6000, 20 21 useLeft: false, 22 23 closable: true, 24 loop: true, 25 escKey: true, 26 keyPress: true, 27 controls: true, 28 slideEndAnimatoin: true, 29 hideControlOnEnd: false, 30 mousewheel: true, 31 32 getCaptionFromTitleOrAlt: true, 33 34 // .lg-item || '.lg-sub-html' 35 appendSubHtmlTo: '.lg-sub-html', 36 37 subHtmlSelectorRelative: false, 38 39 /** 40 * @desc number of preload slides 41 * will exicute only after the current slide is fully loaded. 42 * 43 * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th 44 * slide will be loaded in the background after the 4th slide is fully loaded.. 45 * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... 46 * 47 */ 48 preload: 1, 49 showAfterLoad: true, 50 selector: '', 51 selectWithin: '', 52 nextHtml: '', 53 prevHtml: '', 54 55 // 0, 1 56 index: false, 57 58 iframeMaxWidth: '100%', 59 60 download: true, 61 counter: true, 62 appendCounterTo: '.lg-toolbar', 63 64 swipeThreshold: 50, 65 enableSwipe: true, 66 enableDrag: true, 67 68 dynamic: false, 69 dynamicEl: [], 70 galleryId: 1 71 }; 72 73 function Plugin(element, options) { 74 75 // Current lightGallery element 76 this.el = element; 77 78 // Current jquery element 79 this.$el = $(element); 80 81 // lightGallery settings 82 this.s = $.extend({}, defaults, options); 83 84 // When using dynamic mode, ensure dynamicEl is an array 85 if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) { 86 throw ('When using dynamic mode, you must also define dynamicEl as an Array.'); 87 } 88 89 // lightGallery modules 90 this.modules = {}; 91 92 // false when lightgallery complete first slide; 93 this.lGalleryOn = false; 94 95 this.lgBusy = false; 96 97 // Timeout function for hiding controls; 98 this.hideBartimeout = false; 99 100 // To determine browser supports for touch events; 101 this.isTouch = ('ontouchstart' in document.documentElement); 102 103 // Disable hideControlOnEnd if sildeEndAnimation is true 104 if (this.s.slideEndAnimatoin) { 105 this.s.hideControlOnEnd = false; 106 } 107 108 // Gallery items 109 if (this.s.dynamic) { 110 this.$items = this.s.dynamicEl; 111 } else { 112 if (this.s.selector === 'this') { 113 this.$items = this.$el; 114 } else if (this.s.selector !== '') { 115 if (this.s.selectWithin) { 116 this.$items = $(this.s.selectWithin).find(this.s.selector); 117 } else { 118 this.$items = this.$el.find($(this.s.selector)); 119 } 120 } else { 121 this.$items = this.$el.children(); 122 } 123 } 124 125 // .lg-item 126 this.$slide = ''; 127 128 // .lg-outer 129 this.$outer = ''; 130 131 this.init(); 132 133 return this; 134 } 135 136 Plugin.prototype.init = function() { 137 138 var _this = this; 139 140 // s.preload should not be more than $item.length 141 if (_this.s.preload > _this.$items.length) { 142 _this.s.preload = _this.$items.length; 143 } 144 145 // if dynamic option is enabled execute immediately 146 var _hash = window.location.hash; 147 if (_hash.indexOf('lg=' + this.s.galleryId) > 0) { 148 149 _this.index = parseInt(_hash.split('&slide=')[1], 10); 150 151 $('body').addClass('lg-from-hash'); 152 if (!$('body').hasClass('lg-on')) { 153 setTimeout(function() { 154 _this.build(_this.index); 155 }); 156 157 $('body').addClass('lg-on'); 158 } 159 } 160 161 if (_this.s.dynamic) { 162 163 _this.$el.trigger('onBeforeOpen.lg'); 164 165 _this.index = _this.s.index || 0; 166 167 // prevent accidental double execution 168 if (!$('body').hasClass('lg-on')) { 169 setTimeout(function() { 170 _this.build(_this.index); 171 $('body').addClass('lg-on'); 172 }); 173 } 174 } else { 175 176 // Using different namespace for click because click event should not unbind if selector is same object('this') 177 _this.$items.on('click.lgcustom', function(event) { 178 179 // For IE8 180 try { 181 event.preventDefault(); 182 event.preventDefault(); 183 } catch (er) { 184 event.returnValue = false;
185 } 186 187 _this.$el.trigger('onBeforeOpen.lg'); 188 189 _this.index = _this.s.index || _this.$items.index(this); 190 191 // prevent accidental double execution 192 if (!$('body').hasClass('lg-on')) { 193 _this.build(_this.index); 194 $('body').addClass('lg-on'); 195 } 196 }); 197 } 198 199 }; 200 201 Plugin.prototype.build = function(index) { 202 203 var _this = this; 204 205 _this.structure(); 206 207 // module constructor 208 $.each($.fn.lightGallery.modules, function(key) { 209 _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el); 210 }); 211 212 // initiate slide function 213 _this.slide(index, false, false, false); 214 215 if (_this.s.keyPress) { 216 _this.keyPress(); 217 } 218 219 if (_this.$items.length > 1) { 220 221 _this.arrow(); 222 223 setTimeout(function() { 224 _this.enableDrag(); 225 _this.enableSwipe(); 226 }, 50); 227 228 if (_this.s.mousewheel) { 229 _this.mousewheel(); 230 } 231 } else { 232 _this.$slide.on('click.lg', function() { 233 _this.$el.trigger('onSlideClick.lg'); 234 }); 235 } 236 237 _this.counter(); 238 239 _this.closeGallery(); 240 241 _this.$el.trigger('onAfterOpen.lg'); 242 243 // Hide controllers if mouse doesn't move for some period 244 _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() { 245 246 _this.$outer.removeClass('lg-hide-items'); 247 248 clearTimeout(_this.hideBartimeout); 249 250 // Timeout will be cleared on each slide movement also 251 _this.hideBartimeout = setTimeout(function() { 252 _this.$outer.addClass('lg-hide-items'); 253 }, _this.s.hideBarsDelay); 254 255 }); 256 257 _this.$outer.trigger('mousemove.lg'); 258 259 }; 260 261 Plugin.prototype.structure = function() { 262 var list = ''; 263 var controls = ''; 264 var i = 0; 265 var subHtmlCont = ''; 266 var template; 267 var _this = this; 268 269 $('body').append('<div class="lg-backdrop"></div>'); 270 $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms'); 271 272 // Create gallery items 273 for (i = 0; i < this.$items.length; i++) { 274 list += '<div class="lg-item"></div>'; 275 } 276 277 // Create controlls 278 if (this.s.controls && this.$items.length > 1) { 279 controls = '<div class="lg-actions">' + 280 '<button class="lg-prev lg-icon">' + this.s.prevHtml + '</button>' + 281 '<button class="lg-next lg-icon">' + this.s.nextHtml + '</button>' + 282 '</div>'; 283 } 284 285 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 286 subHtmlCont = '<div class="lg-sub-html"></div>'; 287 } 288 289 template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' + 290 '<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' + 291 '<div class="lg-inner">' + list + '</div>' + 292 '<div class="lg-toolbar lg-group">' + 293 '<span class="lg-close lg-icon"></span>' + 294 '</div>' + 295 controls + 296 subHtmlCont + 297 '</div>' + 298 '</div>'; 299 300 $('body').append(template); 301 this.$outer = $('.lg-outer'); 302 this.$slide = this.$outer.find('.lg-item'); 303 304 if (this.s.useLeft) { 305 this.$outer.addClass('lg-use-left'); 306 307 // Set mode lg-slide if use left is true; 308 this.s.mode = 'lg-slide'; 309 } else { 310 this.$outer.addClass('lg-use-css3'); 311 } 312 313 // For fixed height gallery 314 _this.setTop(); 315 $(window).on('resize.lg orientationchange.lg', function() { 316 setTimeout(function() { 317 _this.setTop(); 318 }, 100); 319 }); 320 321 // add class lg-current to remove initial transition 322 this.$slide.eq(this.index).addClass('lg-current'); 323
324 // add Class for css support and transition mode 325 if (this.doCss()) { 326 this.$outer.addClass('lg-css3'); 327 } else { 328 this.$outer.addClass('lg-css'); 329 330 // Set speed 0 because no animation will happen if browser doesn't support css3 331 this.s.speed = 0; 332 } 333 334 this.$outer.addClass(this.s.mode); 335 336 if (this.s.enableDrag && this.$items.length > 1) { 337 this.$outer.addClass('lg-grab'); 338 } 339 340 if (this.s.showAfterLoad) { 341 this.$outer.addClass('lg-show-after-load'); 342 } 343 344 if (this.doCss()) { 345 var $inner = this.$outer.find('.lg-inner'); 346 $inner.css('transition-timing-function', this.s.cssEasing); 347 $inner.css('transition-duration', this.s.speed + 'ms'); 348 } 349 350 setTimeout(function() { 351 $('.lg-backdrop').addClass('in'); 352 }); 353 354 setTimeout(function() { 355 _this.$outer.addClass('lg-visible'); 356 }, this.s.backdropDuration); 357 358 if (this.s.download) { 359 this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>'); 360 } 361 362 // Store the current scroll top value to scroll back after closing the gallery.. 363 this.prevScrollTop = $(window).scrollTop(); 364 365 }; 366 367 // For fixed height gallery 368 Plugin.prototype.setTop = function() { 369 if (this.s.height !== '100%') { 370 var wH = $(window).height(); 371 var top = (wH - parseInt(this.s.height, 10)) / 2; 372 var $lGallery = this.$outer.find('.lg'); 373 if (wH >= parseInt(this.s.height, 10)) { 374 $lGallery.css('top', top + 'px'); 375 } else { 376 $lGallery.css('top', '0px'); 377 } 378 } 379 }; 380 381 // Find css3 support 382 Plugin.prototype.doCss = function() { 383 // check for css animation support 384 var support = function() { 385 var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; 386 var root = document.documentElement; 387 var i = 0; 388 for (i = 0; i < transition.length; i++) { 389 if (transition[i] in root.style) { 390 return true; 391 } 392 } 393 }; 394 395 if (support()) { 396 return true; 397 } 398 399 return false; 400 }; 401 402 /** 403 * @desc Check the given src is video 404 * @param {String} src 405 * @return {Object} video type 406 * Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } 407 */ 408 Plugin.prototype.isVideo = function(src, index) { 409 410 var html; 411 if (this.s.dynamic) { 412 html = this.s.dynamicEl[index].html; 413 } else { 414 html = this.$items.eq(index).attr('data-html'); 415 } 416 417 if (!src) { 418 if(html) { 419 return { 420 html5: true 421 }; 422 } else { 423 console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html'); 424 return false; 425 } 426 } 427 428 var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); 429 var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); 430 var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i); 431 var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i); 432 433 if (youtube) { 434 return { 435 youtube: youtube 436 }; 437 } else if (vimeo) { 438 return { 439 vimeo: vimeo 440 }; 441 } else if (dailymotion) { 442 return { 443 dailymotion: dailymotion 444 }; 445 } else if (vk) { 446 return { 447 vk: vk 448 }; 449 } 450 }; 451 452 /** 453 * @desc Create image counter 454 * Ex: 1/10 455 */ 456 Plugin.prototype.counter = function() { 457 if (this.s.counter) { 458 $(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>'); 459 } 460 }; 461 462 /** 463 * @desc add sub-html into the slide 464 * @param {Number} index - index of the slide 465 */ 466 Plugin.prototype.addHtml = function(index) { 467 var subHtml = null; 468 var subHtmlUrl; 469 var $currentEle; 470 if (this.s.dynamic) { 471 if (this.s.dynamicEl[index].subHtmlUrl) { 472 subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl; 473 } else { 474 subHtml = this.s.dynamicEl[index].subHtml; 475 } 476 } else { 477 $currentEle = this.$items.eq(index); 478 if ($currentEle.attr('data-sub-html-url')) { 479 subHtmlUrl = $currentEle.attr('data-sub-html-url'); 480 } else { 481 subHtml = $currentEle.attr('data-sub-html'); 482 if (this.s.getCaptionFromTitleOrAlt && !subHtml) { 483 subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt'); 484 } 485 } 486 } 487 488 if (!subHtmlUrl) { 489 if (typeof subHtml !== 'undefined' && subHtml !== null) { 490 491 // get first letter of subhtml 492 // if first letter starts with . or # get the html form the jQuery object 493 var fL = subHtml.substring(0, 1); 494 if (fL === '.' || fL === '#') { 495 if (this.s.subHtmlSelectorRelative && !this.s.dynamic) { 496 subHtml = $currentEle.find(subHtml).html(); 497 } else { 498 subHtml = $(subHtml).html(); 499 } 500 } 501 } else { 502 subHtml = ''; 503 } 504 } 505 506 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 507 508 if (subHtmlUrl) { 509 this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl); 510 } else { 511 this.$outer.find(this.s.appendSubHtmlTo).html(subHtml); 512 } 513 514 } else { 515 516 if (subHtmlUrl) { 517 this.$slide.eq(index).load(subHtmlUrl); 518 } else { 519 this.$slide.eq(index).append(subHtml); 520 } 521 } 522 523 // Add lg-empty-html class if title doesn't exist 524 if (typeof subHtml !== 'undefined' && subHtml !== null) { 525 if (subHtml === '') { 526 this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html'); 527 } else { 528 this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html'); 529 } 530 } 531 532 this.$el.trigger('onAfterAppendSubHtml.lg', [index]); 533 }; 534 535 /** 536 * @desc Preload slides 537 * @param {Number} index - index of the slide 538 */ 539 Plugin.prototype.preload = function(index) { 540 var i = 1; 541 var j = 1; 542 for (i = 1; i <= this.s.preload; i++) { 543 if (i >= this.$items.length - index) { 544 break; 545 } 546 547 this.loadContent(index + i, false, 0); 548 } 549 550 for (j = 1; j <= this.s.preload; j++) { 551 if (index - j < 0) { 552 break; 553 } 554 555 this.loadContent(index - j, false, 0); 556 } 557 }; 558 559 /**
560 * @desc Load slide content into slide. 561 * @param {Number} index - index of the slide. 562 * @param {Boolean} rec - if true call loadcontent() function again. 563 * @param {Boolean} delay - delay for adding complete class. it is 0 except first time. 564 */ 565 Plugin.prototype.loadContent = function(index, rec, delay) { 566 567 var _this = this; 568 var _hasPoster = false; 569 var _$img; 570 var _src; 571 var _poster; 572 var _srcset; 573 var _sizes; 574 var _html; 575 var getResponsiveSrc = function(srcItms) { 576 var rsWidth = []; 577 var rsSrc = []; 578 for (var i = 0; i < srcItms.length; i++) { 579 var __src = srcItms[i].split(' '); 580 581 // Manage empty space 582 if (__src[0] === '') { 583 __src.splice(0, 1); 584 } 585 586 rsSrc.push(__src[0]); 587 rsWidth.push(__src[1]); 588 } 589 590 var wWidth = $(window).width(); 591 for (var j = 0; j < rsWidth.length; j++) { 592 if (parseInt(rsWidth[j], 10) > wWidth) { 593 _src = rsSrc[j]; 594 break; 595 } 596 } 597 }; 598 599 if (_this.s.dynamic) { 600 601 if (_this.s.dynamicEl[index].poster) { 602 _hasPoster = true; 603 _poster = _this.s.dynamicEl[index].poster; 604 } 605 606 _html = _this.s.dynamicEl[index].html; 607 _src = _this.s.dynamicEl[index].src; 608 609 if (_this.s.dynamicEl[index].responsive) { 610 var srcDyItms = _this.s.dynamicEl[index].responsive.split(','); 611 getResponsiveSrc(srcDyItms); 612 } 613 614 _srcset = _this.s.dynamicEl[index].srcset; 615 _sizes = _this.s.dynamicEl[index].sizes; 616 617 } else { 618 619 if (_this.$items.eq(index).attr('data-poster')) { 620 _hasPoster = true; 621 _poster = _this.$items.eq(index).attr('data-poster'); 622 } 623 624 _html = _this.$items.eq(index).attr('data-html'); 625 _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); 626 627 if (_this.$items.eq(index).attr('data-responsive')) { 628 var srcItms = _this.$items.eq(index).attr('data-responsive').split(','); 629 getResponsiveSrc(srcItms); 630 } 631 632 _srcset = _this.$items.eq(index).attr('data-srcset'); 633 _sizes = _this.$items.eq(index).attr('data-sizes'); 634 635 } 636 637 //if (_src || _srcset || _sizes || _poster) { 638 639 var iframe = false; 640 if (_this.s.dynamic) { 641 if (_this.s.dynamicEl[index].iframe) { 642 iframe = true; 643 } 644 } else { 645 if (_this.$items.eq(index).attr('data-iframe') === 'true') { 646 iframe = true; 647 } 648 } 649 650 var _isVideo = _this.isVideo(_src, index); 651 if (!_this.$slide.eq(index).hasClass('lg-loaded')) { 652 if (iframe) { 653 _this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-iframe" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allowfullscreen="true"></iframe></div></div>'); 654 } else if (_hasPoster) { 655 var videoClass = ''; 656 if (_isVideo && _isVideo.youtube) { 657 videoClass = 'lg-has-youtube'; 658 } else if (_isVideo && _isVideo.vimeo) { 659 videoClass = 'lg-has-vimeo'; 660 } else { 661 videoClass = 'lg-has-html5'; 662 } 663 664 _this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>'); 665 666 } else if (_isVideo) { 667 _this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'); 668 _this.$el.trigger('hasVideo.lg', [index, _src, _html]); 669 } else { 670 _this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>'); 671 } 672 673 _this.$el.trigger('onAferAppendSlide.lg', [index]); 674 675 _$img = _this.$slide.eq(index).find('.lg-object'); 676 if (_sizes) { 677 _$img.attr('sizes', _sizes); 678 } 679 680 if (_srcset) { 681 _$img.attr('srcset', _srcset); 682 try { 683 picturefill({ 684 elements: [_$img[0]] 685 }); 686 } catch (e) { 687 console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.'); 688 } 689 } 690 691 if (this.s.appendSubHtmlTo !== '.lg-sub-html') { 692 _this.addHtml(index); 693 } 694 695 _this.$slide.eq(index).addClass('lg-loaded'); 696 } 697 698 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 699 700 // For first time add some delay for displaying the start animation. 701 var _speed = 0; 702
703 // Do not change the delay value because it is required for zoom plugin. 704 // If gallery opened from direct url (hash) speed value should be 0 705 if (delay && !$('body').hasClass('lg-from-hash')) { 706 _speed = delay; 707 } 708 709 setTimeout(function() { 710 _this.$slide.eq(index).addClass('lg-complete'); 711 _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]); 712 }, _speed); 713 714 }); 715 716 // @todo check load state for html5 videos 717 if (_isVideo && _isVideo.html5 && !_hasPoster) { 718 _this.$slide.eq(index).addClass('lg-complete'); 719 } 720 721 if (rec === true) { 722 if (!_this.$slide.eq(index).hasClass('lg-complete')) { 723 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 724 _this.preload(index); 725 }); 726 } else { 727 _this.preload(index); 728 } 729 } 730 731 //} 732 }; 733 734 /** 735 * @desc slide function for lightgallery 736 ** Slide() gets call on start 737 ** ** Set lg.on true once slide() function gets called. 738 ** Call loadContent() on slide() function inside setTimeout 739 ** ** On first slide we do not want any animation like slide of fade 740 ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately 741 ** ** Else loadContent() should wait for the transition to complete. 742 ** ** So set timeout s.speed + 50 743 <=> ** loadContent() will load slide content in to the particular slide 744 ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function. 745 ** ** preload will execute only when the previous slide is fully loaded (images iframe) 746 ** ** avoid simultaneous image load 747 <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value 748 ** loadContent() <====> Preload(); 749 750 * @param {Number} index - index of the slide 751 * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag 752 * @param {Boolean} fromThumb - true if slide function called via thumbnail click 753 * @param {String} direction - Direction of the slide(next/prev) 754 */ 755 Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) { 756 757 var _prevIndex = this.$outer.find('.lg-current').index(); 758 var _this = this; 759 760 // Prevent if multiple call 761 // Required for hsh plugin 762 if (_this.lGalleryOn && (_prevIndex === index)) { 763 return; 764 } 765 766 var _length = this.$slide.length; 767 var _time = _this.lGalleryOn ? this.s.speed : 0; 768 769 if (!_this.lgBusy) { 770 771 if (this.s.download) { 772 var _src; 773 if (_this.s.dynamic) { 774 _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src); 775 } else { 776 _src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src')); 777 778 } 779 780 if (_src) { 781 $('#lg-download').attr('href', _src); 782 _this.$outer.removeClass('lg-hide-download'); 783 } else { 784 _this.$outer.addClass('lg-hide-download'); 785 } 786 } 787 788 this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 789 790 _this.lgBusy = true; 791 792 clearTimeout(_this.hideBartimeout); 793 794 // Add title if this.s.appendSubHtmlTo === lg-sub-html 795 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 796 797 // wait for slide animation to complete 798 setTimeout(function() { 799 _this.addHtml(index); 800 }, _time); 801 } 802 803 this.arrowDisable(index); 804 805 if (!direction) { 806 if (index < _prevIndex) { 807 direction = 'prev'; 808 } else if (index > _prevIndex) {
809 direction = 'next'; 810 } 811 } 812 813 if (!fromTouch) { 814 815 // remove all transitions 816 _this.$outer.addClass('lg-no-trans'); 817 818 this.$slide.removeClass('lg-prev-slide lg-next-slide'); 819 820 if (direction === 'prev') { 821 822 //prevslide 823 this.$slide.eq(index).addClass('lg-prev-slide'); 824 this.$slide.eq(_prevIndex).addClass('lg-next-slide'); 825 } else { 826 827 // next slide 828 this.$slide.eq(index).addClass('lg-next-slide'); 829 this.$slide.eq(_prevIndex).addClass('lg-prev-slide'); 830 } 831 832 // give 50 ms for browser to add/remove class 833 setTimeout(function() { 834 _this.$slide.removeClass('lg-current'); 835 836 //_this.$slide.eq(_prevIndex).removeClass('lg-current'); 837 _this.$slide.eq(index).addClass('lg-current'); 838 839 // reset all transitions 840 _this.$outer.removeClass('lg-no-trans'); 841 }, 50); 842 } else { 843 844 this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); 845 var touchPrev; 846 var touchNext; 847 if (_length > 2) { 848 touchPrev = index - 1; 849 touchNext = index + 1; 850 851 if ((index === 0) && (_prevIndex === _length - 1)) { 852 853 // next slide 854 touchNext = 0; 855 touchPrev = _length - 1; 856 } else if ((index === _length - 1) && (_prevIndex === 0)) { 857 858 // prev slide 859 touchNext = 0; 860 touchPrev = _length - 1; 861 } 862 863 } else { 864 touchPrev = 0; 865 touchNext = 1; 866 } 867 868 if (direction === 'prev') { 869 _this.$slide.eq(touchNext).addClass('lg-next-slide'); 870 } else { 871 _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); 872 } 873 874 _this.$slide.eq(index).addClass('lg-current'); 875 } 876 877 if (_this.lGalleryOn) { 878 setTimeout(function() { 879 _this.loadContent(index, true, 0); 880 }, this.s.speed + 50); 881 882 setTimeout(function() { 883 _this.lgBusy = false; 884 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 885 }, this.s.speed); 886 887 } else { 888 _this.loadContent(index, true, _this.s.backdropDuration); 889 890 _this.lgBusy = false; 891 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 892 } 893 894 _this.lGalleryOn = true; 895 896 if (this.s.counter) { 897 $('#lg-counter-current').text(index + 1); 898 } 899 900 } 901 _this.index = index; 902 903 }; 904 905 /** 906 * @desc Go to next slide 907 * @param {Boolean} fromTouch - true if slide function called via touch event 908 */ 909 Plugin.prototype.goToNextSlide = function(fromTouch) { 910 var _this = this; 911 var _loop = _this.s.loop; 912 if (fromTouch && _this.$slide.length < 3) { 913 _loop = false; 914 } 915 916 if (!_this.lgBusy) { 917 if ((_this.index + 1) < _this.$slide.length) { 918 _this.index++; 919 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 920 _this.slide(_this.index, fromTouch, false, 'next'); 921 } else { 922 if (_loop) { 923 _this.index = 0; 924 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 925 _this.slide(_this.index, fromTouch, false, 'next'); 926 } else if (_this.s.slideEndAnimatoin && !fromTouch) { 927 _this.$outer.addClass('lg-right-end'); 928 setTimeout(function() { 929 _this.$outer.removeClass('lg-right-end'); 930 }, 400); 931 } 932 } 933 } 934 }; 935 936 /** 937 * @desc Go to previous slide 938 * @param {Boolean} fromTouch - true if slide function called via touch event 939 */ 940 Plugin.prototype.goToPrevSlide = function(fromTouch) { 941 var _this = this; 942 var _loop = _this.s.loop; 943 if (fromTouch && _this.$slide.length < 3) { 944 _loop = false;
945 } 946 947 if (!_this.lgBusy) { 948 if (_this.index > 0) { 949 _this.index--; 950 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 951 _this.slide(_this.index, fromTouch, false, 'prev'); 952 } else { 953 if (_loop) { 954 _this.index = _this.$items.length - 1; 955 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 956 _this.slide(_this.index, fromTouch, false, 'prev'); 957 } else if (_this.s.slideEndAnimatoin && !fromTouch) { 958 _this.$outer.addClass('lg-left-end'); 959 setTimeout(function() { 960 _this.$outer.removeClass('lg-left-end'); 961 }, 400); 962 } 963 } 964 } 965 }; 966 967 Plugin.prototype.keyPress = function() { 968 var _this = this; 969 if (this.$items.length > 1) { 970 $(window).on('keyup.lg', function(e) { 971 if (_this.$items.length > 1) { 972 if (e.keyCode === 37) { 973 e.preventDefault(); 974 _this.goToPrevSlide(); 975 } 976 977 if (e.keyCode === 39) { 978 e.preventDefault(); 979 _this.goToNextSlide(); 980 } 981 } 982 }); 983 } 984 985 $(window).on('keydown.lg', function(e) { 986 if (_this.s.escKey === true && e.keyCode === 27) { 987 e.preventDefault(); 988 if (!_this.$outer.hasClass('lg-thumb-open')) { 989 _this.destroy(); 990 } else { 991 _this.$outer.removeClass('lg-thumb-open'); 992 } 993 } 994 }); 995 }; 996 997 Plugin.prototype.arrow = function() { 998 var _this = this; 999 this.$outer.find('.lg-prev').on('click.lg', function() { 1000 _this.goToPrevSlide(); 1001 }); 1002 1003 this.$outer.find('.lg-next').on('click.lg', function() { 1004 _this.goToNextSlide(); 1005 }); 1006 }; 1007 1008 Plugin.prototype.arrowDisable = function(index) { 1009 1010 // Disable arrows if s.hideControlOnEnd is true 1011 if (!this.s.loop && this.s.hideControlOnEnd) { 1012 if ((index + 1) < this.$slide.length) { 1013 this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled'); 1014 } else { 1015 this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled'); 1016 } 1017 1018 if (index > 0) { 1019 this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled'); 1020 } else { 1021 this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled'); 1022 } 1023 } 1024 }; 1025 1026 Plugin.prototype.setTranslate = function($el, xValue, yValue) { 1027 // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 1028 if (this.s.useLeft) { 1029 $el.css('left', xValue); 1030 } else { 1031 $el.css({ 1032 transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' 1033 }); 1034 } 1035 }; 1036 1037 Plugin.prototype.touchMove = function(startCoords, endCoords) { 1038 1039 var distance = endCoords - startCoords; 1040 1041 if (Math.abs(distance) > 15) { 1042 // reset opacity and transition duration 1043 this.$outer.addClass('lg-dragging'); 1044 1045 // move current slide 1046 this.setTranslate(this.$slide.eq(this.index), distance, 0); 1047 1048 // move next and prev slide with current slide 1049 this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0); 1050 this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0); 1051 } 1052 }; 1053 1054 Plugin.prototype.touchEnd = function(distance) { 1055 var _this = this; 1056 1057 // keep slide animation for any mode while dragg/swipe 1058 if (_this.s.mode !== 'lg-slide') { 1059 _this.$outer.addClass('lg-slide'); 1060 } 1061 1062 this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0'); 1063 1064 // set transition duration 1065 setTimeout(function() { 1066 _this.$outer.removeClass('lg-dragging'); 1067 if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 1068 _this.goToNextSlide(true); 1069 } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 1070 _this.goToPrevSlide(true); 1071 } else if (Math.abs(distance) < 5) { 1072 1073 // Trigger click if distance is less than 5 pix 1074 _this.$el.trigger('onSlideClick.lg'); 1075 } 1076 1077 _this.$slide.removeAttr('style'); 1078 }); 1079 1080 // remove slide class once drag/swipe is completed if mode is not slide 1081 setTimeout(function() { 1082 if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') { 1083 _this.$outer.removeClass('lg-slide'); 1084 } 1085 }, _this.s.speed + 100); 1086 1087 }; 1088 1089 Plugin.prototype.enableSwipe = function() { 1090 var _this = this; 1091 var startCoords = 0; 1092 var endCoords = 0; 1093 var isMoved = false;
1094 1095 if (_this.s.enableSwipe && _this.doCss()) { 1096 1097 _this.$slide.on('touchstart.lg', function(e) { 1098 if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { 1099 e.preventDefault(); 1100 _this.manageSwipeClass(); 1101 startCoords = e.originalEvent.targetTouches[0].pageX; 1102 } 1103 }); 1104 1105 _this.$slide.on('touchmove.lg', function(e) { 1106 if (!_this.$outer.hasClass('lg-zoomed')) { 1107 e.preventDefault(); 1108 endCoords = e.originalEvent.targetTouches[0].pageX; 1109 _this.touchMove(startCoords, endCoords); 1110 isMoved = true; 1111 } 1112 }); 1113 1114 _this.$slide.on('touchend.lg', function() { 1115 if (!_this.$outer.hasClass('lg-zoomed')) { 1116 if (isMoved) { 1117 isMoved = false; 1118 _this.touchEnd(endCoords - startCoords); 1119 } else { 1120 _this.$el.trigger('onSlideClick.lg'); 1121 } 1122 } 1123 }); 1124 } 1125 1126 }; 1127 1128 Plugin.prototype.enableDrag = function() { 1129 var _this = this; 1130 var startCoords = 0; 1131 var endCoords = 0; 1132 var isDraging = false; 1133 var isMoved = false; 1134 if (_this.s.enableDrag && _this.doCss()) { 1135 _this.$slide.on('mousedown.lg', function(e) { 1136 if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy && !$(e.target).text().trim()) { 1137 e.preventDefault(); 1138 _this.manageSwipeClass(); 1139 startCoords = e.pageX; 1140 isDraging = true; 1141 1142 // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 1143 _this.$outer.scrollLeft += 1; 1144 _this.$outer.scrollLeft -= 1; 1145 1146 // * 1147 1148 _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); 1149 1150 _this.$el.trigger('onDragstart.lg'); 1151 } 1152 }); 1153 1154 $(window).on('mousemove.lg', function(e) { 1155 if (isDraging) { 1156 isMoved = true; 1157 endCoords = e.pageX; 1158 _this.touchMove(startCoords, endCoords); 1159 _this.$el.trigger('onDragmove.lg'); 1160 } 1161 }); 1162 1163 $(window).on('mouseup.lg', function(e) { 1164 if (isMoved) { 1165 isMoved = false; 1166 _this.touchEnd(endCoords - startCoords); 1167 _this.$el.trigger('onDragend.lg'); 1168 } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { 1169 _this.$el.trigger('onSlideClick.lg'); 1170 } 1171 1172 // Prevent execution on click 1173 if (isDraging) { 1174 isDraging = false; 1175 _this.$outer.removeClass('lg-grabbing').addClass('lg-grab'); 1176 } 1177 }); 1178 1179 } 1180 }; 1181 1182 Plugin.prototype.manageSwipeClass = function() { 1183 var _touchNext = this.index + 1; 1184 var _touchPrev = this.index - 1; 1185 if (this.s.loop && this.$slide.length > 2) { 1186 if (this.index === 0) { 1187 _touchPrev = this.$slide.length - 1; 1188 } else if (this.index === this.$slide.length - 1) { 1189 _touchNext = 0; 1190 } 1191 } 1192 1193 this.$slide.removeClass('lg-next-slide lg-prev-slide'); 1194 if (_touchPrev > -1) { 1195 this.$slide.eq(_touchPrev).addClass('lg-prev-slide'); 1196 } 1197 1198 this.$slide.eq(_touchNext).addClass('lg-next-slide'); 1199 }; 1200 1201 Plugin.prototype.mousewheel = function() { 1202 var _this = this; 1203 _this.$outer.on('mousewheel.lg', function(e) { 1204 1205 if (!e.deltaY) { 1206 return; 1207 } 1208 1209 if (e.deltaY > 0) { 1210 _this.goToPrevSlide(); 1211 } else { 1212 _this.goToNextSlide(); 1213 } 1214 1215 e.preventDefault(); 1216 }); 1217 1218 }; 1219 1220 Plugin.prototype.closeGallery = function() { 1221 1222 var _this = this; 1223 var mousedown = false;
1224 this.$outer.find('.lg-close').on('click.lg', function() { 1225 _this.destroy(); 1226 }); 1227 1228 if (_this.s.closable) { 1229 1230 // If you drag the slide and release outside gallery gets close on chrome 1231 // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer 1232 _this.$outer.on('mousedown.lg', function(e) { 1233 1234 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) { 1235 mousedown = true; 1236 } else { 1237 mousedown = false; 1238 } 1239 1240 }); 1241 1242 _this.$outer.on('mousemove.lg', function() { 1243 mousedown = false; 1244 }); 1245 1246 _this.$outer.on('mouseup.lg', function(e) { 1247 1248 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) { 1249 if (!_this.$outer.hasClass('lg-dragging')) { 1250 _this.destroy(); 1251 } 1252 } 1253 1254 }); 1255 1256 } 1257 1258 }; 1259 1260 Plugin.prototype.destroy = function(d) { 1261 1262 var _this = this; 1263 1264 if (!d) { 1265 _this.$el.trigger('onBeforeClose.lg'); 1266 $(window).scrollTop(_this.prevScrollTop); 1267 } 1268 1269 1270 /** 1271 * if d is false or undefined destroy will only close the gallery 1272 * plugins instance remains with the element 1273 * 1274 * if d is true destroy will completely remove the plugin 1275 */ 1276 1277 if (d) { 1278 if (!_this.s.dynamic) { 1279 // only when not using dynamic mode is $items a jquery collection 1280 this.$items.off('click.lg click.lgcustom'); 1281 } 1282 1283 $.removeData(_this.el, 'lightGallery'); 1284 } 1285 1286 // Unbind all events added by lightGallery 1287 this.$el.off('.lg.tm'); 1288 1289 // Distroy all lightGallery modules 1290 $.each($.fn.lightGallery.modules, function(key) { 1291 if (_this.modules[key]) { 1292 _this.modules[key].destroy(); 1293 } 1294 }); 1295 1296 this.lGalleryOn = false; 1297 1298 clearTimeout(_this.hideBartimeout); 1299 this.hideBartimeout = false; 1300 $(window).off('.lg'); 1301 $('body').removeClass('lg-on lg-from-hash'); 1302 1303 if (_this.$outer) { 1304 _this.$outer.removeClass('lg-visible'); 1305 } 1306 1307 $('.lg-backdrop').removeClass('in'); 1308 1309 setTimeout(function() { 1310 if (_this.$outer) { 1311 _this.$outer.remove(); 1312 } 1313 1314 $('.lg-backdrop').remove(); 1315 1316 if (!d) { 1317 _this.$el.trigger('onCloseAfter.lg'); 1318 } 1319 1320 }, _this.s.backdropDuration + 50); 1321 }; 1322 1323 $.fn.lightGallery = function(options) { 1324 return this.each(function() { 1325 if (!$.data(this, 'lightGallery')) { 1326 $.data(this, 'lightGallery', new Plugin(this, options)); 1327 } else { 1328 try { 1329 $(this).data('lightGallery').init(); 1330 } catch (err) { 1331 console.error('lightGallery has not initiated properly'); 1332 } 1333 } 1334 }); 1335 }; 1336 1337 $.fn.lightGallery.modules = {}; 1338 1339})(); 1340 1341 1342 1343/*! lg-video - v1.0.1 - 2016-09-30 1344* http://sachinchoolur.github.io/lightGallery 1345* Copyright (c) 2016 Sachin N; Licensed GPLv3 */ 1346!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={videoMaxWidth:"855px",youtubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,vkPlayerParams:!1,videojs:!1,videojsOptions:{}},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),this.core.s=a.extend({},b,this.core.s),this.videoLoaded=!1,this.init(),this};c.prototype.init=function(){var b=this;b.core.$el.on("hasVideo.lg.tm",function(a,c,d,e){if(b.core.$slide.eq(c).find(".lg-video").append(b.loadVideo(d,"lg-object",!0,c,e)),e)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(c).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){b.videoLoaded||this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(c).find(".lg-html5").get(0).play()}),b.core.$el.on("onAferAppendSlide.lg.tm",function(a,c){b.core.$slide.eq(c).find(".lg-video-cont").css("max-width",b.core.s.videoMaxWidth),b.videoLoaded=!0});
1346var c=function(a){if(a.find(".lg-object").hasClass("lg-has-poster")&&a.find(".lg-object").is(":visible"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-dailymotion").get(0),f=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(e)e.contentWindow.postMessage("play","*");else if(f)if(b.core.s.videojs)try{videojs(f).play()}catch(a){console.error("Make sure you have included videojs")}else f.play();a.addClass("lg-video-playing")}else{a.addClass("lg-video-playing lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("href")||b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}};b.core.doCss()&&b.core.$items.length>1&&(b.core.s.enableSwipe&&b.core.isTouch||b.core.s.enableDrag&&!b.core.isTouch)?b.core.$el.on("onSlideClick.lg.tm",function(){var a=b.core.$slide.eq(b.core.index);c(a)}):b.core.$slide.on("click.lg",function(){c(a(this))}),b.core.$el.on("onBeforeSlide.lg.tm",function(c,d,e){var f=b.core.$slide.eq(d),g=f.find(".lg-youtube").get(0),h=f.find(".lg-vimeo").get(0),i=f.find(".lg-dailymotion").get(0),j=f.find(".lg-vk").get(0),k=f.find(".lg-html5").get(0);if(g)g.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(h)try{$f(h).api("pause")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(i)i.contentWindow.postMessage("pause","*");else if(k)if(b.core.s.videojs)try{videojs(k).pause()}catch(a){console.error("Make sure you have included videojs")}else k.pause();j&&a(j).attr("src",a(j).attr("src").replace("&autoplay","&noplay"));var l;l=b.core.s.dynamic?b.core.s.dynamicEl[e].src:b.core.$items.eq(e).attr("href")||b.core.$items.eq(e).attr("data-src");var m=b.core.isVideo(l,e)||{};(m.youtube||m.vimeo||m.dailymotion||m.vk)&&b.core.$outer.addClass("lg-hide-download")}),b.core.$el.on("onAfterSlide.lg.tm",function(a,c){b.core.$slide.eq(c).removeClass("lg-video-playing")})},c.prototype.loadVideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:1),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='<iframe class="lg-video-object lg-youtube '+c+'" width="560" height="315" src="//www.youtube.com/embed/'+j.youtube[1]+i+'" frameborder="0" allowfullscreen></iframe>';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='<iframe class="lg-video-object lg-vimeo '+c+'" width="560" height="315" src="//player.vimeo.com/video/'+j.vimeo[1]+i+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';else if(j.dailymotion)i="?wmode=opaque&autoplay="+h+"&api=postMessage",this.core.s.dailymotionPlayerParams&&(i=i+"&"+a.param(this.core.s.dailymotionPlayerParams)),g='<iframe class="lg-video-object lg-dailymotion '+c+'" width="560" height="315" src="//www.dailymotion.com/embed/video/'+j.dailymotion[1]+i+'" frameborder="0" allowfullscreen></iframe>';else if(j.html5){var k=f.substring(0,1);"."!==k&&"#"!==k||(f=a(f).html()),g=f}else j.vk&&(i="&autoplay="+h,this.core.s.vkPlayerParams&&(i=i+"&"+a.param(this.core.s.vkPlayerParams)),g='<iframe class="lg-video-object lg-vk '+c+'" width="560" height="315" src="http://vk.com/video_ext.php?'+j.vk[1]+i+'" frameborder="0" allowfullscreen></iframe>');return g},c.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=c}()}); 1347 1348/*! lg-autoplay - v1.0.1 - 2016-09-30 1349* http://sachinchoolur.github.io/lightGallery 1350* Copyright (c) 2016 Sachin N; Licensed GPLv3 */ 1351!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";
1351var b={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),!(this.core.$items.length<2)&&(this.core.s=a.extend({},b,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};c.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),a.progress(),a.core.s.autoplay&&a.startlAuto(),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},c.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},c.prototype.controls=function(){var b=this,c='<span class="lg-autoplay-button lg-icon"></span>';a(this.core.s.appendAutoplayControlsTo).append(c),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},c.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+1<a.core.$items.length?a.core.index++:a.core.index=0,a.fromAuto=!0,a.core.slide(a.core.index,!1,!1)},a.core.s.speed+a.core.s.pause)},c.prototype.cancelAuto=function(){clearInterval(this.interval),this.interval=!1,this.core.$outer.find(".lg-progress").removeAttr("style"),this.core.$outer.removeClass("lg-show-autoplay"),this.core.$outer.find(".lg-progress-bar").removeClass("lg-start")},c.prototype.destroy=function(){this.cancelAuto(),this.core.$outer.find(".lg-progress-bar").remove()},a.fn.lightGallery.modules.autoplay=c}()}); 1352 1353/*! lg-zoom - v1.0.1 - 2016-09-30 1354* http://sachinchoolur.github.io/lightGallery 1355* Copyright (c) 2016 Sachin N; Licensed GPLv3 */ 1356!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={scale:1,zoom:!0,actualSize:!0,enableZoomAfter:300},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1,this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()),this};c.prototype.init=function(){var b=this,c='<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-icon"></span>';b.core.s.actualSize&&(c+='<span id="lg-actual-size" class="lg-icon"></span>'),this.core.$outer.find(".lg-toolbar").append(c),b.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(c,d,e){var f=b.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),b.zoomabletimeout=setTimeout(function(){b.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var d=1,e=function(c){var d,e,f=b.core.$outer.find(".lg-current .lg-image"),g=(a(window).width()-f.width())/2,h=(a(window).height()-f.height())/2+a(window).scrollTop();d=b.pageX-g,e=b.pageY-h;var i=(c-1)*d,j=(c-1)*e;f.css("transform","scale3d("+c+", "+c+", 1)").attr("data-scale",c),f.parent().css({left:-i+"px",top:-j+"px"}).attr("data-x",i).attr("data-y",j)},f=function(){d>1?b.core.$outer.addClass("lg-zoomed"):b.resetZoom(),d<1&&(d=1),e(d)},g=function(c,e,g,h){var i,j=e.width();
1356i=b.core.s.dynamic?b.core.s.dynamicEl[g].width||e[0].naturalWidth||j:b.core.$items.eq(g).attr("data-width")||e[0].naturalWidth||j;var k;b.core.$outer.hasClass("lg-zoomed")?d=1:i>j&&(k=i/j,d=k||2),h?(b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop()):(b.pageX=c.pageX||c.originalEvent.targetTouches[0].pageX,b.pageY=c.pageY||c.originalEvent.targetTouches[0].pageY),f(),setTimeout(function(){b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)},h=!1;b.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,c){var d=b.core.$slide.eq(c).find(".lg-image");d.on("dblclick",function(a){g(a,d,c)}),d.on("touchstart",function(a){h?(clearTimeout(h),h=null,g(a,d,c)):h=setTimeout(function(){h=null},300),a.preventDefault()})}),a(window).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom",function(){b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop(),e(d)}),a("#lg-zoom-out").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d-=b.core.s.scale,f())}),a("#lg-zoom-in").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d+=b.core.s.scale,f())}),a("#lg-actual-size").on("click.lg",function(a){g(a,b.core.$slide.eq(b.core.index).find(".lg-image"),b.core.index,!0)}),b.core.$el.on("onBeforeSlide.lg.tm",function(){d=1,b.resetZoom()}),b.core.isTouch||b.zoomDrag(),b.core.isTouch&&b.zoomSwipe()},c.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale"),this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()},c.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.outerHeight()*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.outerWidth()*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),(Math.abs(c.x-b.x)>15||Math.abs(c.y-b.y)>15)&&j.css({left:h+"px",top:i+"px"})}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},c.prototype.zoomDrag=function(){var b=this,c={},d={},e=!1,f=!1,g=!1,h=!1;b.core.$slide.on("mousedown.lg.zoom",function(d){var f=b.core.$slide.eq(b.core.index).find(".lg-object");h=f.outerHeight()*f.attr("data-scale")>b.core.$outer.find(".lg").height(),g=f.outerWidth()*f.attr("data-scale")>b.core.$outer.find(".lg").width(),b.core.$outer.hasClass("lg-zoomed")&&a(d.target).hasClass("lg-object")&&(g||h)&&(d.preventDefault(),c={x:d.pageX,y:d.pageY},e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.zoom",function(a){if(e){var i,j,k=b.core.$slide.eq(b.core.index).find(".lg-img-wrap");f=!0,d={x:a.pageX,y:a.pageY},b.core.$outer.addClass("lg-zoom-dragging"),j=h?-Math.abs(k.attr("data-y"))+(d.y-c.y):-Math.abs(k.attr("data-y")),i=g?-Math.abs(k.attr("data-x"))+(d.x-c.x):-Math.abs(k.attr("data-x")),k.css({left:i+"px",top:j+"px"})}}),a(window).on("mouseup.lg.zoom",function(a){e&&(e=!1,b.core.$outer.removeClass("lg-zoom-dragging"),!f||c.x===d.x&&c.y===d.y||(d={x:a.pageX,y:a.pageY},b.touchendZoom(c,d,g,h)),f=!1),b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},c.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.outerHeight())/2,k=Math.abs(g.outerHeight()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.outerWidth())/2,m=Math.abs(g.outerWidth()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);(Math.abs(b.x-a.x)>15||Math.abs(b.y-a.y)>15)&&(d&&(i<=-k?i=-k:i>=-j&&(i=-j)),c&&(h<=-m?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),f.css({left:h+"px",top:i+"px"}))},c.prototype.destroy=function(){var b=this;b.core.$el.off(".lg.zoom"),a(window).off(".lg.zoom"),b.core.$slide.off(".lg.zoom"),b.core.$el.off(".lg.tm.zoom"),b.resetZoom(),clearTimeout(b.zoomabletimeout),b.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=c}()}); 1357 1358/*! lg-thumbnail - v1.0.1 - 2016-09-30 1359* http://sachinchoolur.github.io/lightGallery 1360* Copyright (c) 2016 Sachin N; Licensed GPLv3 */ 1361!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,pullCaptionUp:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbn
vendor: 8,849 bytes, lines 1361-1366
1361ail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small",loadDailymotionThumbnail:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.$el=a(c),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.left=0,this.init(),this};c.prototype.init=function(){var a=this;this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&setTimeout(function(){a.core.$outer.addClass("lg-thumb-open")},700),this.core.s.pullCaptionUp&&this.core.$outer.addClass("lg-pull-caption-up"),this.build(),this.core.s.animateThumb?(this.core.s.enableThumbDrag&&!this.core.isTouch&&this.core.doCss()&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.core.isTouch&&this.core.doCss()&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},c.prototype.build=function(){function b(a,b,c){var g,h=d.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo||h.dailymotion?h.youtube?g=d.core.s.loadYoutubeThumbnail?"//img.youtube.com/vi/"+h.youtube[1]+"/"+d.core.s.youtubeThumbSize+".jpg":b:h.vimeo?d.core.s.loadVimeoThumbnail?(g="//i.vimeocdn.com/video/error_"+f+".jpg",i=h.vimeo[1]):g=b:h.dailymotion&&(g=d.core.s.loadDailymotionThumbnail?"//www.dailymotion.com/thumbnail/video/"+h.dailymotion[1]:b):g=b,e+='<div data-vimeo-id="'+i+'" class="lg-thumb-item" style="width:'+d.core.s.thumbWidth+"px; margin-right: "+d.core.s.thumbMargin+'px"><img src="'+g+'" /></div>',i=""}var c,d=this,e="",f="",g='<div class="lg-thumb-outer"><div class="lg-thumb group"></div></div>';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":f="640";break;case"thumbnail_medium":f="200x150";break;case"thumbnail_small":f="100x75"}if(d.core.$outer.addClass("lg-has-thumb"),d.core.$outer.find(".lg").append(g),d.$thumbOuter=d.core.$outer.find(".lg-thumb-outer"),d.thumbOuterWidth=d.$thumbOuter.width(),d.core.s.animateThumb&&d.core.$outer.find(".lg-thumb").css({width:d.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&d.$thumbOuter.css("height",d.core.s.thumbContHeight+"px"),d.core.s.dynamic)for(var h=0;h<d.core.s.dynamicEl.length;h++)b(d.core.s.dynamicEl[h].src,d.core.s.dynamicEl[h].thumb,h);else d.core.$items.each(function(c){d.core.s.exThumbImage?b(a(this).attr("href")||a(this).attr("data-src"),a(this).attr(d.core.s.exThumbImage),c):b(a(this).attr("href")||a(this).attr("data-src"),a(this).find("img").attr("src"),c)});d.core.$outer.find(".lg-thumb").html(e),c=d.core.$outer.find(".lg-thumb-item"),c.each(function(){var b=a(this),c=b.attr("data-vimeo-id");c&&a.getJSON("//www.vimeo.com/api/v2/video/"+c+".json?callback=?",{format:"json"},function(a){b.find("img").attr("src",a[0][d.core.s.vimeoThumbSize])})}),c.eq(d.core.index).addClass("active"),d.core.$el.on("onBeforeSlide.lg.tm",function(){c.removeClass("active"),c.eq(d.core.index).addClass("active")}),c.on("click.lg touchend.lg",function(){var b=a(this);setTimeout(function(){(d.thumbClickable&&!d.core.lgBusy||!d.core.doCss())&&(d.core.index=b.index(),d.core.slide(d.core.index,!1,!0))},50)}),d.core.$el.on("onBeforeSlide.lg.tm",function(){d.animateThumb(d.core.index)}),a(window).on("resize.lg.thumb orientationchange.lg.thumb",function(){setTimeout(function(){d.animateThumb(d.core.index),d.thumbOuterWidth=d.$thumbOuter.width()},200)})},c.prototype.setTranslate=function(a){this.core.$outer.find(".lg-thumb").css({transform:"translate3d(-"+a+"px, 0px, 0px)"})},c.prototype.animateThumb=function(a){var b=this.core.$outer.find(".lg-thumb");if(this.core.s.animateThumb){var c;switch(this.core.s.currentPagerPosition){case"left":c=0;break;case"middle":c=this.thumbOuterWidth/2-this.core.s.thumbWidth/2;break;case"right":c=this.thumbOuterWidth-this.core.s.thumbWidth}this.left=(this.core.s.thumbWidth+this.core.s.thumbMargin)*a-1-c,this.left>this.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},c.prototype.enableThumbDrag=function(){var b=this,c=0,d=0,e=!1,f=!1,g=0;b.$thumbOuter.addClass("lg-grab"),b.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){b.thumbTotalWidth>b.thumbOuterWidth&&(a.preventDefault(),c=a.pageX,e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.thumbClickable=!1,b.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.thumb",function(a){e&&(g=b.left,f=!0,d=a.pageX,b.$thumbOuter.addClass("lg-dragging"),g-=d-c,g>b.thumbTotalWidth-b.thumbOuterWidth&&(g=b.thumbTotalWidth-b.thumbOuterWidth),g<0&&(g=0),b.setTranslate(g))}),a(window).on("mouseup.lg.thumb",function(){f?(f=!1,b.$thumbOuter.removeClass("lg-dragging"),b.left=g,Math.abs(d-c)<b.core.s.swipeThreshold&&(b.thumbClickable=!0)):b.thumbClickable=!0,e&&(e=!1,b.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab"))})},c.prototype.enableThumbSwipe=function(){var a=this,b=0,c=0,d=!1,e=0;a.core.$outer.find(".lg-thumb").on("touchstart.lg",function(c){a.thumbTotalWidth>a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),e<0&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)<a.core.s.swipeThreshold&&(a.thumbClickable=!0),a.left=e):a.thumbClickable=!0})},c.prototype.toogle=function(){var a=this;a.core.s.toogleThumb&&(a.core.$outer.addClass("lg-can-toggle"),a.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},c.prototype.thumbkeyPress=function(){var b=this;a(window).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),b.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),b.core.$outer.removeClass("lg-thumb-open"))})},c.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(window).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"),this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=c}()}); 1362 1363/*! lg-fullscreen - v1.0.1 - 2016-09-30 1364* http://sachinchoolur.github.io/lightGallery 1365* Copyright (c) 2016 Sachin N; Licensed GPLv3 */ 1366!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={fullScreen:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),this.core.s=a.extend({},b,this.core.s),this.init(),this};c.prototype.init=function(){var a="";if(this.core.s.fullScreen){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))return;a='<span class="lg-fullscreen lg-icon"></span>',this.core.$outer.find(".lg-toolbar").append(a),this.fullScreen()}},c.prototype.requestFullscreen=function(){var a=document.documentElement;a.requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen&&a.webkitRequestFullscreen()},c.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},c.prototype.fullScreen=function(){var b=this;a(document).on("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg",function(){b.core.$outer.toggleClass("lg-fullscreen-on")}),this.core.$outer.find(".lg-fullscreen").on("click.lg",function(){document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?b.exitFullscreen():b.requestFullscreen()})},c.prototype.destroy=function(){this.exitFullscreen(),a(document).off("fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg")},a.fn.lightGallery.modules.fullscreen=c}()});
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.