1/*! 2 * Lightbox v2.10.0 3 * by Lokesh Dhakar 4 * 5 * More info: 6 * http://lokeshdhakar.com/projects/lightbox2/ 7 * 8 * Copyright 2007, 2018 Lokesh Dhakar 9 * Released under the MIT license 10 * https://github.com/lokesh/lightbox2/blob/master/LICENSE 11 * 12 * @preserve 13 */ 14// Uses Node, AMD or browser globals to create a module. 15!function(t,i){"function"==typeof define&&define.amd? 16// AMD. Register as an anonymous module. 17define(["jquery"],i):"object"==typeof exports? 18// Node. Does not work with strict CommonJS, but 19// only CommonJS-like environments that support module.exports, 20// like Node. 21module.exports=i(require("jquery")): 22// Browser globals (root is window) 23t.lightbox=i(t.jQuery)}(this,function(g){function t(t){this.album=[],this.currentImageIndex=void 0,this.init(), 24// options 25this.options=g.extend({},this.constructor.defaults),this.option(t)} 26// Descriptions of all options available on the demo site: 27// http://lokeshdhakar.com/projects/lightbox2/index.html#options 28return t.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:600,fitImagesInViewport:!0,imageFadeDuration:600, 29// maxWidth: 800, 30// maxHeight: 600, 31positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1, 32/* 33 Sanitize Title 34 If the caption data is trusted, for example you are hardcoding it in, then leave this to false. 35 This will free you to add html tags, such as links, in the caption. 36 37 If the caption data is user submitted or from some other untrusted source, then set this to true 38 to prevent xss and other injection attacks. 39 */ 40sanitizeTitle:!1},t.prototype.option=function(t){g.extend(this.options,t)},t.prototype.imageCountLabel=function(t,i){return this.options.albumLabel.replace(/%1/g,t).replace(/%2/g,i)},t.prototype.init=function(){var t=this; 41// Both enable and build methods require the body tag to be in the DOM. 42g(document).ready(function(){t.enable(),t.build()})}, 43// Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes 44// that contain 'lightbox'. When these are clicked, start lightbox. 45t.prototype.enable=function(){var i=this;g("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(t){return i.start(g(t.currentTarget)),!1})}, 46// Build html for the lightbox and the overlay. 47// Attach event handlers to the new DOM elements. click click click 48t.prototype.build=function(){if(!(0<g("#lightbox").length)){var i=this;g('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(g("body")), 49// Cache jQuery objects 50this.$lightbox=g("#lightbox"),this.$overlay=g("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.$image=this.$lightbox.find(".lb-image"),this.$nav=this.$lightbox.find(".lb-nav"), 51// Store css values for future lookup 52this.containerPadding={top:parseInt(this.$container.css("padding-top"),10),right:parseInt(this.$container.css("padding-right"),10),bottom:parseInt(this.$container.css("padding-bottom"),10),left:parseInt(this.$container.css("padding-left"),10)},this.imageBorderWidth={top:parseInt(this.$image.css("border-top-width"),10),right:parseInt(this.$image.css("border-right-width"),10),bottom:parseInt(this.$image.css("border-bottom-width"),10),left:parseInt(this.$image.css("border-left-width"),10)}, 53// Attach event handlers to the newly minted DOM elements 54this.$overlay.hide().on("click",function(){return i.end(),!1}),this.$lightbox.hide().on("click",function(t){return"lightbox"===g(t.target).attr("id")&&i.end(),!1}),this.$outerContainer.on("click",function(t){return"lightbox"===g(t.target).attr("id")&&i.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===i.currentImageIndex?i.changeImage(i.album.length-1):i.changeImage(i.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return i.currentImageIndex===i.album.length-1?i.changeImage(0):i.changeImage(i.currentImageIndex+1),!1}), 55/* 56 Show context menu for image on right-click 57 58 There is a div containing the navigation that spans the entire image and lives above of it. If 59 you right-click, you are right clicking this div and not the image. This prevents users from 60 saving the image or using other context menu actions with the image. 61 62 To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we 63 set pointer-events to none on the nav div. This is so that the upcoming right-click event on 64 the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs 65 we set the pointer events back to auto for the nav div so it can capture hover and left-click 66 events as usual. 67 */ 68this.$nav.on("mousedown",function(t){3===t.which&&(i.$nav.css("pointer-events","none"),i.$lightbox.one("contextmenu",function(){setTimeout(function(){this.$nav.css("pointer-events","auto")}.bind(i),0)}))}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return i.end(),!1})}}, 69// Show overlay and lightbox. If the image is part of a set, add siblings to album array. 70t.prototype.start=function(t){function i(t){e.album.push({alt:t.attr("data-alt"),link:t.attr("href"),title:t.attr("data-title")||t.attr("title")})} 71// Support both data-lightbox attribute and rel attribute implementations 72var e=this,n=g(window);n.on("resize",g.proxy(this.sizeOverlay,this)),g("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var a=0,o=t.attr("data-lightbox"),s;if(o){s=g(t.prop("tagName")+'[data-lightbox="'+o+'"]');for(var r=0;r<s.length;r=++r)i(g(s[r])),s[r]===t[0]&&(a=r)}else if("lightbox"===t.attr("rel")) 73// If image is not part of a set 74i(t);else{ 75// If image is part of a set 76s=g(t.prop("tagName")+'[rel="'+t.attr("rel")+'"]');for(var h=0;h<s.length;h=++h)i(g(s[h])),s[h]===t[0]&&(a=h)} 77// Position Lightbox 78var l=n.scrollTop()+this.options.positionFromTop,d=n.scrollLeft();this.$lightbox.css({top:l+"px",left:d+"px"}).fadeIn(this.options.fadeDuration), 79// Disable scrolling of the page while open 80this.options.disableScrolling&&g("html").addClass("lb-disable-scrolling"),this.changeImage(a)}, 81// Hide most UI elements in preparation for the animated resizing of the lightbox. 82t.prototype.changeImage=function(r){var h=this;this.disableKeyboardNav();var l=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),g(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating"); 83// When image to show is preloaded, we send the width and height to sizeContainer() 84var d=new Image;d.onload=function(){var t,i,e,n,a,o,s;l.attr({alt:h.album[r].alt,src:h.album[r].link}),t=g(d),l.width(d.width),l.height(d.height),h.options.fitImagesInViewport&&( 85// Fit image inside the viewport. 86// Take into account the border around the image and an additional 10px gutter on each side. 87s=g(window).width(),o=g(window).height(),a=s-h.containerPadding.left-h.containerPadding.right-h.imageBorderWidth.left-h.imageBorderWidth.right-20,n=o-h.containerPadding.top-h.containerPadding.bottom-h.imageBorderWidth.top-h.imageBorderWidth.bottom-120, 88// Check if image size is larger then maxWidth|maxHeight in settings 89h.options.maxWidth&&h.options.maxWidth<a&&(a=h.options.maxWidth),h.options.maxHeight&&h.options.maxHeight<a&&(n=h.options.maxHeight),
90// Is the current image's width or height is greater than the maxImageWidth or maxImageHeight 91// option than we need to size down while maintaining the aspect ratio. 92(d.width>a||d.height>n)&&(d.width/a>d.height/n?(e=a,i=parseInt(d.height/(d.width/e),10)):(i=n,e=parseInt(d.width/(d.height/i),10)),l.width(e),l.height(i))),h.sizeContainer(l.width(),l.height())},d.src=this.album[r].link,this.currentImageIndex=r}, 93// Stretch overlay to fit the viewport 94t.prototype.sizeOverlay=function(){this.$overlay.width(g(document).width()).height(g(document).height())}, 95// Animate the size of the lightbox to fit the image we are showing 96t.prototype.sizeContainer=function(t,i){function e(){n.$lightbox.find(".lb-dataContainer").width(s),n.$lightbox.find(".lb-prevLink").height(r),n.$lightbox.find(".lb-nextLink").height(r),n.showImage()}var n=this,a=this.$outerContainer.outerWidth(),o=this.$outerContainer.outerHeight(),s=t+this.containerPadding.left+this.containerPadding.right+this.imageBorderWidth.left+this.imageBorderWidth.right,r=i+this.containerPadding.top+this.containerPadding.bottom+this.imageBorderWidth.top+this.imageBorderWidth.bottom;a!==s||o!==r?this.$outerContainer.animate({width:s,height:r},this.options.resizeDuration,"swing",function(){e()}):e()}, 97// Display the image and its details and begin preload neighboring images. 98t.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn(this.options.imageFadeDuration),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()}, 99// Display previous and next navigation if appropriate. 100t.prototype.updateNav=function(){ 101// Check to see if the browser supports touch events. If so, we take the conservative approach 102// and assume that mouse hover events are not supported and always show prev/next navigation 103// arrows in image sets. 104var t=!1;try{document.createEvent("TouchEvent"),t=!!this.options.alwaysShowNavOnTouchDevices}catch(t){}this.$lightbox.find(".lb-nav").show(),1<this.album.length&&(this.options.wrapAround?(t&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(0<this.currentImageIndex&&(this.$lightbox.find(".lb-prev").show(),t&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),t&&this.$lightbox.find(".lb-next").css("opacity","1"))))}, 105// Display caption, image number, and closing button. 106t.prototype.updateDetails=function(){var t=this; 107// Enable anchor clicks in the injected caption html. 108// Thanks Nate Wright for the fix. @https://github.com/NateWr 109if(void 0!==this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title){var i=this.$lightbox.find(".lb-caption");this.options.sanitizeTitle?i.text(this.album[this.currentImageIndex].title):i.html(this.album[this.currentImageIndex].title),i.fadeIn("fast").find("a").on("click",function(t){void 0!==g(this).attr("target")?window.open(g(this).attr("href"),g(this).attr("target")):location.href=g(this).attr("href")})}if(1<this.album.length&&this.options.showImageNumberLabel){var e=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(e).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return t.sizeOverlay()})}, 110// Preload previous and next images in set. 111t.prototype.preloadNeighboringImages=function(){var t,i;this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);0<this.currentImageIndex&&((new Image).src=this.album[this.currentImageIndex-1].link)},t.prototype.enableKeyboardNav=function(){g(document).on("keyup.keyboard",g.proxy(this.keyboardAction,this))},t.prototype.disableKeyboardNav=function(){g(document).off(".keyboard")},t.prototype.keyboardAction=function(t){var i=27,e=37,n=39,a=t.keyCode,o=String.fromCharCode(a).toLowerCase();27===a||o.match(/x|o|c/)?this.end():"p"===o||37===a?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&1<this.album.length&&this.changeImage(this.album.length-1):"n"!==o&&39!==a||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&1<this.album.length&&this.changeImage(0))}, 112// Closing time. :-( 113t.prototype.end=function(){this.disableKeyboardNav(),g(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),g("select, object, embed").css({visibility:"visible"}),this.options.disableScrolling&&g("html").removeClass("lb-disable-scrolling")},new t});
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.