1(function () { 2 var b, d, c; 3 b = jQuery; 4 c = (function () { 5 function b() { 6 this.fadeDuration = 500; 7 this.fitImagesInViewport = true; 8 this.resizeDuration = 700; 9 this.showImageNumberLabel = true; 10 this.wrapAround = false 11 } 12 b.prototype.albumLabel = function (b, c) { 13 return "Image " + b + " of " + c 14 }; 15 return b 16 })(); 17 d = (function () { 18 function c(b) { 19 this.options = b; 20 this.album = []; 21 this.currentImageIndex = void 0; 22 this.init() 23 } 24 c.prototype.init = function () { 25 this.enable(); 26 return this.build() 27 }; 28 c.prototype.enable = function () { 29 var c = this; 30 return b('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function (d) { 31 c.start(b(d.currentTarget)); 32 return false 33 }) 34 }; 35 c.prototype.build = function () { 36 var c = this; 37 b("<div id='lightboxOverlay' class='lightboxOverlay'></div><div id='lightbox' class='lightbox'><div class='lb-outerContainer'><div class='lb-container'><img class='lb-image' src='' /><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(b('body')); 38 this.$lightbox = b('#lightbox'); 39 this.$overlay = b('#lightboxOverlay'); 40 this.$outerContainer = this.$lightbox.find('.lb-outerContainer'); 41 this.$container = this.$lightbox.find('.lb-container'); 42 this.containerTopPadding = parseInt(this.$container.css('padding-top'), 10); 43 this.containerRightPadding = parseInt(this.$container.css('padding-right'), 10); 44 this.containerBottomPadding = parseInt(this.$container.css('padding-bottom'), 10); 45 this.containerLeftPadding = parseInt(this.$container.css('padding-left'), 10); 46 this.$overlay.hide().on('click', function () { 47 c.end(); 48 return false 49 }); 50 this.$lightbox.hide().on('click', function (d) { 51 if (b(d.target).attr('id') === 'lightbox') { 52 c.end() 53 } 54 return false 55 }); 56 this.$outerContainer.on('click', function (d) { 57 if (b(d.target).attr('id') === 'lightbox') { 58 c.end() 59 } 60 return false 61 }); 62 this.$lightbox.find('.lb-prev').on('click', function () { 63 if (c.currentImageIndex === 0) { 64 c.changeImage(c.album.length - 1) 65 } else { 66 c.changeImage(c.currentImageIndex - 1) 67 } 68 return false 69 }); 70 this.$lightbox.find('.lb-next').on('click', function () { 71 if (c.currentImageIndex === c.album.length - 1) { 72 c.changeImage(0) 73 } else { 74 c.changeImage(c.currentImageIndex + 1) 75 } 76 return false 77 }); 78 return this.$lightbox.find('.lb-loader, .lb-close').on('click', function () { 79 c.end(); 80 return false 81 }) 82 }; 83 c.prototype.start = function (c) { 84 var f, e, j, d, g, n, o, k, l, m, p, h, i; 85 b(window).on("resize", this.sizeOverlay); 86 b('select, object, embed').css({ 87 visibility: "hidden" 88 }); 89 this.$overlay.width(b(document).width()).height(b(document).height()).fadeIn(this.options.fadeDuration); 90 this.album = []; 91 g = 0; 92 j = c.attr('data-lightbox'); 93 if (j) { 94 h = b(c.prop("tagName") + '[data-lightbox="' + j + '"]'); 95 for (d = k = 0, m = h.length; k < m; d = ++k) { 96 e = h[d]; 97 this.album.push({ 98 link: b(e).attr('href'), 99 title: b(e).attr('title') 100 }); 101 if (b(e).attr('href') === c.attr('href')) { 102 g = d 103 } 104 } 105 } else { 106 if (c.attr('rel') === 'lightbox') { 107 this.album.push({ 108 link: c.attr('href'), 109 title: c.attr('title') 110 }) 111 } else { 112 i = b(c.prop("tagName") + '[rel="' + c.attr('rel') + '"]'); 113 for (d = l = 0, p = i.length; l < p; d = ++l) { 114 e = i[d]; 115 this.album.push({ 116 link: b(e).attr('href'), 117 title: b(e).attr('title') 118 }); 119 if (b(e).attr('href') === c.attr('href')) { 120 g = d 121 } 122 } 123 } 124 } 125 f = b(window);
126 o = f.scrollTop() + f.height() / 10; 127 n = f.scrollLeft(); 128 this.$lightbox.css({ 129 top: o + 'px', 130 left: n + 'px' 131 }).fadeIn(this.options.fadeDuration); 132 this.changeImage(g) 133 }; 134 c.prototype.changeImage = function (f) { 135 var d, c, e = this; 136 this.disableKeyboardNav(); 137 d = this.$lightbox.find('.lb-image'); 138 this.sizeOverlay(); 139 this.$overlay.fadeIn(this.options.fadeDuration); 140 b('.lb-loader').fadeIn('slow'); 141 this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide(); 142 this.$outerContainer.addClass('animating'); 143 c = new Image(); 144 c.onload = function () { 145 var m, g, h, i, j, k, l; 146 d.attr('src', e.album[f].link); 147 m = b(c); 148 d.width(c.width); 149 d.height(c.height); 150 if (e.options.fitImagesInViewport) { 151 l = b(window).width(); 152 k = b(window).height(); 153 j = l - e.containerLeftPadding - e.containerRightPadding - 20; 154 i = k - e.containerTopPadding - e.containerBottomPadding - 110; 155 if ((c.width > j) || (c.height > i)) { 156 if ((c.width / j) > (c.height / i)) { 157 h = j; 158 g = parseInt(c.height / (c.width / h), 10); 159 d.width(h); 160 d.height(g) 161 } else { 162 g = i; 163 h = parseInt(c.width / (c.height / g), 10); 164 d.width(h); 165 d.height(g) 166 } 167 } 168 } 169 return e.sizeContainer(d.width(), d.height()) 170 }; 171 c.src = this.album[f].link; 172 this.currentImageIndex = f 173 }; 174 c.prototype.sizeOverlay = function () { 175 return b('#lightboxOverlay').width(b(document).width()).height(b(document).height()) 176 }; 177 c.prototype.sizeContainer = function (f, g) { 178 var b, d, e, h, c = this; 179 h = this.$outerContainer.outerWidth(); 180 e = this.$outerContainer.outerHeight(); 181 d = f + this.containerLeftPadding + this.containerRightPadding; 182 b = g + this.containerTopPadding + this.containerBottomPadding; 183 this.$outerContainer.animate({ 184 width: d, 185 height: b 186 }, this.options.resizeDuration, 'swing'); 187 setTimeout(function () { 188 c.$lightbox.find('.lb-dataContainer').width(d); 189 c.$lightbox.find('.lb-prevLink').height(b); 190 c.$lightbox.find('.lb-nextLink').height(b); 191 c.showImage() 192 }, this.options.resizeDuration) 193 }; 194 c.prototype.showImage = function () { 195 this.$lightbox.find('.lb-loader').hide(); 196 this.$lightbox.find('.lb-image').fadeIn('slow'); 197 this.updateNav(); 198 this.updateDetails(); 199 this.preloadNeighboringImages(); 200 this.enableKeyboardNav() 201 }; 202 c.prototype.updateNav = function () { 203 this.$lightbox.find('.lb-nav').show(); 204 if (this.album.length > 1) { 205 if (this.options.wrapAround) { 206 this.$lightbox.find('.lb-prev, .lb-next').show() 207 } else { 208 if (this.currentImageIndex > 0) { 209 this.$lightbox.find('.lb-prev').show() 210 } 211 if (this.currentImageIndex < this.album.length - 1) { 212 this.$lightbox.find('.lb-next').show() 213 } 214 } 215 } 216 }; 217 c.prototype.updateDetails = function () { 218 var b = this; 219 if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") { 220 this.$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast') 221 } 222 if (this.album.length > 1 && this.options.showImageNumberLabel) { 223 this.$lightbox.find('.lb-number').text(this.options.albumLabel(this.currentImageIndex + 1, this.album.length)).fadeIn('fast') 224 } else { 225 this.$lightbox.find('.lb-number').hide() 226 } 227 this.$outerContainer.removeClass('animating'); 228 this.$lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function () { 229 return b.sizeOverlay() 230 }) 231 }; 232 c.prototype.preloadNeighboringImages = function () { 233 var c, b; 234 if (this.album.length > this.currentImageIndex + 1) { 235 c = new Image(); 236 c.src = this.album[this.currentImageIndex + 1].link 237 } 238 if (this.currentImageIndex > 0) { 239 b = new Image(); 240 b.src = this.album[this.currentImageIndex - 1].link 241 } 242 }; 243 c.prototype.enableKeyboardNav = function () { 244 b(document).on('keyup.keyboard', b.proxy(this.keyboardAction, this)) 245 }; 246 c.prototype.disableKeyboardNav = function () { 247 b(document).off('.keyboard') 248 }; 249 c.prototype.keyboardAction = function (g) { 250 var d, e, f, c, b; 251 d = 27; 252 e = 37; 253 f = 39; 254 b = g.keyCode; 255 c = String.fromCharCode(b).toLowerCase(); 256 if (b === d || c.match(/x|o|c/)) { 257 this.end() 258 } else if (c === 'p' || b === e) { 259 if (this.currentImageIndex !== 0) { 260 this.changeImage(this.currentImageIndex - 1) 261 } 262 } else if (c === 'n' || b === f) { 263 if (this.currentImageIndex !== this.album.length - 1) { 264 this.changeImage(this.currentImageIndex + 1) 265 } 266 } 267 }; 268 c.prototype.end = function () { 269 this.disableKeyboardNav(); 270 b(window).off("resize", this.sizeOverlay); 271 this.$lightbox.fadeOut(this.options.fadeDuration); 272 this.$overlay.fadeOut(this.options.fadeDuration); 273 return b('select, object, embed').css({ 274 visibility: "visible" 275 }) 276 }; 277 return c 278 })(); 279 b(function () { 280 var e, b; 281 b = new c(); 282 return e = new d(b) 283 }) 284}).call(this);
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.