1(function (e, t, n, r) { 2 "use strict"; 3 var i = n("html"), s = n(e), o = n(t), u = n.fancybox = function () { 4 u.open.apply(this, arguments) 5 }, a = navigator.userAgent.match(/msie/i), f = null, l = t.createTouch !== r, c = function (e) { 6 return e && e.hasOwnProperty && e instanceof n 7 }, h = function (e) { 8 return e && n.type(e) === "string" 9 }, p = function (e) { 10 return h(e) && e.indexOf("%") > 0 11 }, d = function (e) { 12 return e && !(e.style.overflow && e.style.overflow === "hidden") && (e.clientWidth && e.scrollWidth > e.clientWidth || e.clientHeight && e.scrollHeight > e.clientHeight) 13 }, v = function (e, t) { 14 var n = parseInt(e, 10) || 0; 15 if (t && p(e)) { 16 n = u.getViewport()[t] / 100 * n 17 } 18 return Math.ceil(n) 19 }, m = function (e, t) { 20 return v(e, t) + "px" 21 }; 22 n.extend(u, {version: "2.1.5", defaults: {padding: 15, margin: 20, width: 800, height: 600, minWidth: 100, minHeight: 100, maxWidth: 9999, maxHeight: 9999, pixelRatio: 1, autoSize: true, autoHeight: false, autoWidth: false, autoResize: true, autoCenter: !l, fitToView: true, aspectRatio: false, topRatio: .5, leftRatio: .5, scrolling: "auto", wrapCSS: "", arrows: true, closeBtn: true, closeClick: false, nextClick: false, mouseWheel: true, autoPlay: false, playSpeed: 3e3, preload: 3, modal: false, loop: true, ajax: {dataType: "html", headers: {"X-fancyBox": true}}, iframe: {scrolling: "auto", preload: true}, swf: {wmode: "transparent", allowfullscreen: "true", allowscriptaccess: "always"}, keys: {next: {13: "left", 34: "up", 39: "left", 40: "up"}, prev: {8: "right", 33: "down", 37: "right", 38: "down"}, close: [27], play: [32], toggle: [70]}, direction: {next: "left", prev: "right"}, scrollOutside: true, index: 0, type: null, href: null, content: null, title: null, tpl: {wrap: '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>', image: '<img class="fancybox-image" src="{href}" alt="" />', iframe: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (a ? ' allowtransparency="true"' : "") + "></iframe>", error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', closeBtn: '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>', next: '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', prev: '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'}, openEffect: "fade", openSpeed: 250, openEasing: "swing", openOpacity: true, openMethod: "zoomIn", closeEffect: "fade", closeSpeed: 250, closeEasing: "swing", closeOpacity: true, closeMethod: "zoomOut", nextEffect: "elastic", nextSpeed: 250, nextEasing: "swing", nextMethod: "changeIn", prevEffect: "elastic", prevSpeed: 250, prevEasing: "swing", prevMethod: "changeOut", helpers: {overlay: true, title: true}, onCancel: n.noop, beforeLoad: n.noop, afterLoad: n.noop, beforeShow: n.noop, afterShow: n.noop, beforeChange: n.noop, beforeClose: n.noop, afterClose: n.noop}, group: {}, opts: {}, previous: null, coming: null, current: null, isActive: false, isOpen: false, isOpened: false, wrap: null, skin: null, outer: null, inner: null, player: {timer: null, isActive: false}, ajaxLoad: null, imgPreload: null, transitions: {}, helpers: {}, open: function (e, t) { 23 if (!e) { 24 return 25 } 26 if (!n.isPlainObject(t)) { 27 t = {} 28 } 29 if (false === u.close(true)) { 30 return 31 } 32 if (!n.isArray(e)) { 33 e = c(e) ? n(e).get() : [e] 34 } 35 n.each(e, function (i, s) { 36 var o = {}, a, f, l, p, d, v, m; 37 if (n.type(s) === "object") { 38 if (s.nodeType) { 39 s = n(s) 40 } 41 if (c(s)) { 42 o = {href: s.data("fancybox-href") || s.attr("href"), title: s.data("fancybox-title") || s.attr("title"), isDom: true, element: s}; 43 if (n.metadata) { 44 n.extend(true, o, s.metadata()) 45 } 46 } else { 47 o = s 48 } 49 } 50 a = t.href || o.href || (h(s) ? s : null); 51 f = t.title !== r ? t.title : o.title || ""; 52 l = t.content || o.content; 53 p = l ? "html" : t.type || o.type; 54 if (!p && o.isDom) { 55 p = s.data("fancybox-type"); 56 if (!p) { 57 d = s.prop("class").match(/fancybox\.(\w+)/); 58 p = d ? d[1] : null 59 } 60 } 61 if (h(a)) { 62 if (!p) { 63 if (u.isImage(a)) { 64 p = "image" 65 } else if (u.isSWF(a)) { 66 p = "swf" 67 } else if (a.charAt(0) === "#") { 68 p = "inline" 69 } else if (h(s)) { 70 p = "html"; 71 l = s 72 } 73 } 74 if (p === "ajax") { 75 v = a.split(/\s+/, 2); 76 a = v.shift(); 77 m = v.shift() 78 } 79 } 80 if (!l) { 81 if (p === "inline") { 82 if (a) { 83 l = n(h(a) ? a.replace(/.*(?=#[^\s]+$)/, "") : a) 84 } else if (o.isDom) { 85 l = s 86 } 87 } else if (p === "html") { 88 l = a 89 } else if (!p && !a && o.isDom) { 90 p = "inline"; 91 l = s 92 } 93 } 94 n.extend(o, {href: a, type: p, content: l, title: f, selector: m}); 95 e[i] = o 96 }); 97 u.opts = n.extend(true, {}, u.defaults, t); 98 if (t.keys !== r) { 99 u.opts.keys = t.keys ? n.extend({}, u.defaults.keys, t.keys) : false 100 } 101 u.group = e; 102 return u._start(u.opts.index) 103 }, cancel: function () { 104 var e = u.coming; 105 if (!e || false === u.trigger("onCancel")) { 106 return 107 } 108 u.hideLoading(); 109 if (u.ajaxLoad) { 110 u.ajaxLoad.abort() 111 } 112 u.ajaxLoad = null; 113 if (u.imgPreload) { 114 u.imgPreload.onload = u.imgPreload.onerror = null 115 } 116 if (e.wrap) {
117 e.wrap.stop(true, true).trigger("onReset").remove() 118 } 119 u.coming = null; 120 if (!u.current) { 121 u._afterZoomOut(e) 122 } 123 }, close: function (e) { 124 u.cancel(); 125 if (false === u.trigger("beforeClose")) { 126 return 127 } 128 u.unbindEvents(); 129 if (!u.isActive) { 130 return 131 } 132 if (!u.isOpen || e === true) { 133 n(".fancybox-wrap").stop(true).trigger("onReset").remove(); 134 u._afterZoomOut() 135 } else { 136 u.isOpen = u.isOpened = false; 137 u.isClosing = true; 138 n(".fancybox-item, .fancybox-nav").remove(); 139 u.wrap.stop(true, true).removeClass("fancybox-opened"); 140 u.transitions[u.current.closeMethod]() 141 } 142 }, play: function (e) { 143 var t = function () { 144 clearTimeout(u.player.timer) 145 }, n = function () { 146 t(); 147 if (u.current && u.player.isActive) { 148 u.player.timer = setTimeout(u.next, u.current.playSpeed) 149 } 150 }, r = function () { 151 t(); 152 o.unbind(".player"); 153 u.player.isActive = false; 154 u.trigger("onPlayEnd") 155 }, i = function () { 156 if (u.current && (u.current.loop || u.current.index < u.group.length - 1)) { 157 u.player.isActive = true; 158 o.bind({"onCancel.player beforeClose.player": r, "onUpdate.player": n, "beforeLoad.player": t}); 159 n(); 160 u.trigger("onPlayStart") 161 } 162 }; 163 if (e === true || !u.player.isActive && e !== false) { 164 i() 165 } else { 166 r() 167 } 168 }, next: function (e) { 169 var t = u.current; 170 if (t) { 171 if (!h(e)) { 172 e = t.direction.next 173 } 174 u.jumpto(t.index + 1, e, "next") 175 } 176 }, prev: function (e) { 177 var t = u.current; 178 if (t) { 179 if (!h(e)) { 180 e = t.direction.prev 181 } 182 u.jumpto(t.index - 1, e, "prev") 183 } 184 }, jumpto: function (e, t, n) { 185 var i = u.current; 186 if (!i) { 187 return 188 } 189 e = v(e); 190 u.direction = t || i.direction[e >= i.index ? "next" : "prev"]; 191 u.router = n || "jumpto"; 192 if (i.loop) { 193 if (e < 0) { 194 e = i.group.length + e % i.group.length 195 } 196 e = e % i.group.length 197 } 198 if (i.group[e] !== r) { 199 u.cancel(); 200 u._start(e) 201 } 202 }, reposition: function (e, t) { 203 var r = u.current, i = r ? r.wrap : null, s; 204 if (i) { 205 s = u._getPosition(t); 206 if (e && e.type === "scroll") { 207 delete s.position; 208 i.stop(true, true).animate(s, 200) 209 } else { 210 i.css(s); 211 r.pos = n.extend({}, r.dim, s) 212 } 213 } 214 }, update: function (e) { 215 var t = e && e.type, n = !t || t === "orientationchange"; 216 if (n) { 217 clearTimeout(f); 218 f = null 219 } 220 if (!u.isOpen || f) { 221 return 222 } 223 f = setTimeout(function () { 224 var r = u.current; 225 if (!r || u.isClosing) { 226 return 227 } 228 u.wrap.removeClass("fancybox-tmp"); 229 if (n || t === "load" || t === "resize" && r.autoResize) { 230 u._setDimension() 231 } 232 if (!(t === "scroll" && r.canShrink)) { 233 u.reposition(e) 234 } 235 u.trigger("onUpdate"); 236 f = null 237 }, n && !l ? 0 : 300) 238 }, toggle: function (e) { 239 if (u.isOpen) { 240 u.current.fitToView = n.type(e) === "boolean" ? e : !u.current.fitToView; 241 if (l) { 242 u.wrap.removeAttr("style").addClass("fancybox-tmp"); 243 u.trigger("onUpdate") 244 }
245 u.update() 246 } 247 }, hideLoading: function () { 248 o.unbind(".loading"); 249 n("#fancybox-loading").remove() 250 }, showLoading: function () { 251 var e, t; 252 u.hideLoading(); 253 e = n('<div id="fancybox-loading"><div></div></div>').click(u.cancel).appendTo("body"); 254 o.bind("keydown.loading", function (e) { 255 if ((e.which || e.keyCode) === 27) { 256 e.preventDefault(); 257 u.cancel() 258 } 259 }); 260 if (!u.defaults.fixed) { 261 t = u.getViewport(); 262 e.css({position: "absolute", top: t.h * .5 + t.y, left: t.w * .5 + t.x}) 263 } 264 }, getViewport: function () { 265 var t = u.current && u.current.locked || false, n = {x: s.scrollLeft(), y: s.scrollTop()}; 266 if (t) { 267 n.w = t[0].clientWidth; 268 n.h = t[0].clientHeight 269 } else { 270 n.w = l && e.innerWidth ? e.innerWidth : s.width(); 271 n.h = l && e.innerHeight ? e.innerHe
271ight : s.height() 272 } 273 return n 274 }, unbindEvents: function () { 275 if (u.wrap && c(u.wrap)) { 276 u.wrap.unbind(".fb") 277 } 278 o.unbind(".fb"); 279 s.unbind(".fb") 280 }, bindEvents: function () { 281 var e = u.current, t; 282 if (!e) { 283 return 284 } 285 s.bind("orientationchange.fb" + (l ? "" : " resize.fb") + (e.autoCenter && !e.locked ? " scroll.fb" : ""), u.update); 286 t = e.keys; 287 if (t) { 288 o.bind("keydown.fb", function (i) { 289 var s = i.which || i.keyCode, o = i.target || i.srcElement; 290 if (s === 27 && u.coming) { 291 return false 292 } 293 if (!i.ctrlKey && !i.altKey && !i.shiftKey && !i.metaKey && !(o && (o.type || n(o).is("[contenteditable]")))) { 294 n.each(t, function (t, o) { 295 if (e.group.length > 1 && o[s] !== r) { 296 u[t](o[s]); 297 i.preventDefault(); 298 return false 299 } 300 if (n.inArray(s, o) > -1) { 301 u[t](); 302 i.preventDefault(); 303 return false 304 } 305 }) 306 } 307 }) 308 } 309 if (n.fn.mousewheel && e.mouseWheel) { 310 u.wrap.bind("mousewheel.fb", function (t, r, i, s) { 311 var o = t.target || null, a = n(o), f = false; 312 while (a.length) { 313 if (f || a.is(".fancybox-skin") || a.is(".fancybox-wrap")) { 314 break 315 } 316 f = d(a[0]); 317 a = n(a).parent() 318 } 319 if (r !== 0 && !f) { 320 if (u.group.length > 1 && !e.canShrink) { 321 if (s > 0 || i > 0) { 322 u.prev(s > 0 ? "down" : "left") 323 } else if (s < 0 || i < 0) { 324 u.next(s < 0 ? "up" : "right") 325 } 326 t.preventDefault() 327 } 328 } 329 }) 330 } 331 }, trigger: function (e, t) { 332 var r, i = t || u.coming || u.current; 333 if (!i) { 334 return 335 } 336 if (n.isFunction(i[e])) { 337 r = i[e].apply(i, Array.prototype.slice.call(arguments, 1)) 338 } 339 if (r === false) { 340 return false 341 } 342 if (i.helpers) { 343 n.each(i.helpers, function (t, r) { 344 if (r && u.helpers[t] && n.isFunction(u.helpers[t][e])) { 345 u.helpers[t][e](n.extend(true, {}, u.helpers[t].defaults, r), i) 346 } 347 }) 348 } 349 o.trigger(e) 350 }, isImage: function (e) { 351 return h(e) && e.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i) 352 }, isSWF: function (e) { 353 return h(e) && e.match(/\.(swf)((\?|#).*)?$/i) 354 }, _start: function (e) { 355 var t = {}, r, i, s, o, a; 356 e = v(e); 357 r = u.group[e] || null; 358 if (!r) { 359 return false 360 } 361 t = n.extend(true, {}, u.opts, r); 362 o = t.margin; 363 a = t.padding; 364 if (n.type(o) === "number") { 365 t.margin = [o, o, o, o] 366 } 367 if (n.type(a) === "number") { 368 t.padding = [a, a, a, a] 369 } 370 if (t.modal) { 371 n.extend(true, t, {closeBtn: false, closeClick: false, nextClick: false, arrows: false, mouseWheel: false, keys: null, helpers: {overlay: {closeClick: false}}}) 372 } 373 if (t.autoSize) { 374 t.autoWidth = t.autoHeight = true 375 } 376 if (t.width === "auto") { 377 t.autoWidth = true 378 } 379 if (t.height === "auto") { 380 t.autoHeight = true 381 } 382 t.group = u.group; 383 t.index = e; 384 u.coming = t; 385 if (false === u.trigger("beforeLoad")) { 386 u.coming = null; 387 return 388 } 389 s = t.type; 390 i = t.href; 391 if (!s) { 392 u.coming = null; 393 if (u.current && u.router && u.router !== "jumpto") { 394 u.current.index = e; 395 return u[u.router](u.direction) 396 } 397 return false 398 } 399 u.isActive = true; 400 if (s === "image" || s === "swf") { 401 t.autoHeight = t.autoWidth = false; 402 t.scrolling = "visible" 403 } 404 if (s === "image") { 405 t.aspectRatio = true 406 } 407 if (s === "iframe" && l) { 408 t.scrolling = "scroll" 409 } 410 t.wrap = n(t.tpl.wrap).addClass("fancybox-" + (l ? "mobile" : "desktop") + " fancybox-type-" + s + " fancybox-tmp " + t.wrapCSS).appendTo(t.parent || "body"); 411 n.extend(t, {skin: n(".fancybox-skin", t.wrap), outer: n(".fancybox-outer", t.wrap), inner: n(".fancybox-inner", t.wrap)}); 412 n.each(["Top", "Right", "Bottom", "Left"], function (e, n) { 413 t.skin.css("padding" + n, m(t.padding[e])) 414 }); 415 u.trigger("onReady"); 416 if (s === "inline" || s === "html") { 417 if (!t.content || !t.content.length) { 418 return u._error("content") 419 } 420 } else if (!i) { 421 return u._error("href") 422 } 423 if (s === "image") { 424 u._loadImage() 425 } else if (s === "ajax") { 426 u._loadAjax() 427 } else if (s === "iframe") { 428 u._loadIframe() 429 } else { 430 u._afterLoad() 431 } 432 }, _error: function (e) { 433 n.extend(u.coming, {type: "html", autoWidth: true, autoHeight: true, minWidth: 0, minHeight: 0, scrolling: "no", hasError: e, content: u.coming.tpl.error}); 434 u._afterLoad() 435 }, _loadImage: function () { 436 var e = u.imgPreload = new Image; 437 e.onload = function () { 438 this.onload = this.onerror = null; 439 u.coming.width = this.width / u.opts.pixelRatio; 440 u.coming.height = this.height / u.opts.pixelRatio; 441 u._afterLoad() 442 }; 443 e.onerror = function () { 444 this.onload = this.onerror = null; 445 u._error("image") 446 }; 447 e.src = u.coming.href; 448 if (e.complete !== true) { 449 u.showLoading() 450 } 451 }, _loadAjax: function () { 452 var e = u.coming; 453 u.showLoading(); 454 u.ajaxLoad = n.ajax(n.extend({}, e.ajax, {url: e.href, error: function (e, t) { 455 if (u.coming && t !== "abort") { 456 u._error("ajax", e) 457 } else { 458 u.hideLoading() 459 } 460 }, success: function (t, n) { 461 if (n === "success") { 462 e.content = t; 463 u._afterLoad() 464 } 465 }})) 466 }, _loadIframe: function () { 467 var e = u.coming, t = n(e.tpl.iframe.replace(/\{rnd\}/g, (new Date).getTime())).attr("scrolling", l ? "auto" : e.iframe.
467scrolling).attr("src", e.href); 468 n(e.wrap).bind("onReset", function () { 469 try { 470 n(this).find("iframe").hide().attr("src", "//about:blank").end().empty() 471 } catch (e) { 472 } 473 }); 474 if (e.iframe.preload) { 475 u.showLoading(); 476 t.one("load", function () { 477 n(this).data("ready", 1); 478 if (!l) { 479 n(this).bind("load.fb", u.update) 480 } 481 n(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(); 482 u._afterLoad() 483 }) 484 } 485 e.content = t.appendTo(e.inner); 486 if (!e.iframe.preload) { 487 u._afterLoad() 488 } 489 }, _preloadImages: function () { 490 var e = u.group, t = u.current, n = e.length, r = t.preload ? Math.min(t.preload, n - 1) : 0, i, s; 491 for (s = 1; s <= r; s += 1) { 492 i = e[(t.index + s) % n]; 493 if (i.type === "image" && i.href) { 494 (new Image).src = i.href 495 } 496 } 497 }, _afterLoad: function () { 498 var e = u.coming, t = u.current, r = "fancybox-placeholder", i, s, o, a, f, l; 499 u.hideLoading(); 500 if (!e || u.isActive === false) { 501 return 502 } 503 if (false === u.trigger("afterLoad", e, t)) { 504 e.wrap.stop(true).trigger("onReset").remove(); 505 u.coming = null; 506 return 507 } 508 if (t) { 509 u.trigger("beforeChange", t); 510 t.wrap.stop(true).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove() 511 } 512 u.unbindEvents(); 513 i = e; 514 s = e.content; 515 o = e.type; 516 a = e.scrolling; 517 n.extend(u, {wrap: i.wrap, skin: i.skin, outer: i.outer, inner: i.inner, current: i, previous: t}); 518 f = i.href; 519 switch (o) { 520 case"inline": 521 case"ajax": 522 case"html": 523 if (i.selector) { 524 s = n("<div>").html(s).find(i.selector) 525 } else if (c(s)) { 526 if (!s.data(r)) { 527 s.data(r, n('<div class="' + r + '"></div>').insertAfter(s).hide()) 528 } 529 s = s.show().detach(); 530 i.wrap.bind("onReset", function () { 531 if (n(this).find(s).length) { 532 s.hide().replaceAll(s.data(r)).data(r, false) 533 } 534 }) 535 } 536 break; 537 case"image": 538 s = i.tpl.image.replace("{href}", f); 539 break; 540 case"swf": 541 s = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + f + '"></param>'; 542 l = ""; 543 n.each(i.swf, function (e, t) { 544 s += '<param name="' + e + '" value="' + t + '"></param>'; 545 l += " " + e + '="' + t + '"' 546 }); 547 s += '<embed src="' + f + '" type="application/x-shockwave-flash" width="100%" height="100%"' + l + "></embed></object>"; 548 break 549 } 550 if (!(c(s) && s.parent().is(i.inner))) { 551 i.inner.append(s) 552 } 553 u.trigger("beforeShow"); 554 i.inner.css("overflow", a === "yes" ? "scroll" : a === "no" ? "hidden" : a); 555 u._setDimension(); 556 u.reposition(); 557 u.isOpen = false; 558 u.coming = null; 559 u.bindEvents(); 560 if (!u.isOpened) { 561 n(".fancybox-wrap").not(i.wrap).stop(true).trigger("onReset").remove() 562 } else if (t.prevMethod) { 563 u.transitions[t.prevMethod]() 564 } 565 u.transitions[u.isOpened ? i.nextMethod : i.openMethod](); 566 u._preloadImages() 567 }, _setDimension: function () { 568 var e = u.getViewport(), t = 0, r = false, i = false, s = u.wrap, o = u.skin, a = u.inner, f = u.current, l = f.width, c = f.height, h = f.minWidth, d = f.minHeight, g = f.maxWidth, y = f.maxHeight, b = f.scrolling, w = f.scrollOutside ? f.scrollbarWidth : 0, E = f.margin, S = v(E[1] + E[3]), x = v(E[0] + E[2]), T, N, C,
568k, L, A, O, M, _, D, P, H, B, j, I; 569 s.add(o).add(a).width("auto").height("auto").removeClass("fancybox-tmp"); 570 T = v(o.outerWidth(true) - o.width()); 571 N = v(o.outerHeight(true) - o.height()); 572 C = S + T; 573 k = x + N; 574 L = p(l) ? (e.w - C) * v(l) / 100 : l; 575 A = p(c) ? (e.h - k) * v(c) / 100 : c; 576 if (f.type === "iframe") { 577 j = f.content; 578 if (f.autoHeight && j.data("ready") === 1) { 579 try { 580 if (j[0].contentWindow.document.location) { 581 a.width(L).height(9999); 582 I = j.contents().find("body"); 583 if (w) { 584 I.css("overflow-x", "hidden") 585 } 586 A = I.outerHeight(true) 587 } 588 } catch (q) { 589 } 590 } 591 } else if (f.autoWidth || f.autoHeight) { 592 a.addClass("fancybox-tmp"); 593 if (!f.autoWidth) { 594 a.width(L) 595 } 596 if (!f.autoHeight) { 597 a.height(A) 598 } 599 if (f.autoWidth) { 600 L = a.width() 601 } 602 if (f.autoHeight) { 603 A = a.height() 604 } 605 a.removeClass("fancybox-tmp") 606 } 607 l = v(L); 608 c = v(A); 609 _ = L / A; 610 h = v(p(h) ? v(h, "w") - C : h); 611 g = v(p(g) ? v(g, "w") - C : g); 612 d = v(p(d) ? v(d, "h") - k : d); 613 y = v(p(y) ? v(y, "h") - k : y); 614 O = g; 615 M = y; 616 if (f.fitToView) { 617 g = Math.min(e.w - C, g); 618 y = Math.min(e.h - k, y) 619 } 620 H = e.w - S; 621 B = e.h - x; 622 if (f.aspectRatio) { 623 if (l > g) { 624 l = g; 625 c = v(l / _) 626 } 627 if (c > y) { 628 c = y; 629 l = v(c * _) 630 } 631 if (l < h) { 632 l = h; 633 c = v(l / _) 634 } 635 if (c < d) { 636 c = d; 637 l = v(c * _) 638 } 639 } else { 640 l = Math.max(h, Math.min(l, g)); 641 if (f.autoHeight && f.type !== "iframe") { 642 a.width(l); 643 c = a.height() 644 } 645 c = Math.max(d, Math.min(c, y)) 646 } 647 if (f.fitToView) { 648 a.width(l).height(c); 649 s.width(l + T); 650 D = s.width(); 651 P = s.height(); 652 if (f.aspectRatio) { 653 while ((D > H || P > B) && l > h && c > d) { 654 if (t++ > 19) { 655 break 656 } 657 c = Math.max(d, Math.min(y, c - 10)); 658 l = v(c * _); 659 if (l < h) { 660 l = h; 661 c = v(l / _) 662 } 663 if (l > g) { 664 l = g; 665 c = v(l / _) 666 } 667 a.width(l).height(c); 668 s.width(l + T); 669 D = s.width(); 670 P = s.height() 671 } 672 } else { 673 l = Math.max(h, Math.min(l, l - (D - H))); 674 c = Math.max(d, Math.min(c, c - (P - B))) 675 } 676 } 677 if (w && b === "auto" && c < A && l + T + w < H) { 678 l += w 679 } 680 a.width(l).height(c); 681 s.width(l + T); 682 D = s.width(); 683 P = s.height(); 684 r = (D > H || P > B) && l > h && c > d; 685 i = f.aspectRatio ? l < O && c < M && l < L && c < A : (l < O || c < M) && (l < L || c < A); 686 n.extend(f, {dim: {width: m(D), height: m(P)}, origWidth: L, origHeight: A, canShrink: r, canExpand: i, wPadding: T, hPadding: N, wrapSpace: P - o.outerHeight(true), skinSpace: o.height() - c}); 687 if (!j && f.autoHeight && c > d && c < y && !i) { 688 a.height("auto") 689 } 690 }, _getPosition: function (e) { 691 var t = u.current, n = u.getViewport(), r = t.margin, i = u.wrap.width() + r[1] + r[3], s = u.wrap.height() + r[0] + r[2], o = {position: "absolute", top: r[0], left: r[3]}; 692 if (t.autoCenter && t.fixed && !e && s <= n.h && i <= n.w) { 693 o.position = "fixed" 694 } else if (!t.locked) { 695 o.top += n.y; 696 o.left += n.x 697 } 698 o.top = m(Math.max(o.top, o.top + (n.h - s) * t.topRatio));
699 o.left = m(Math.max(o.left, o.left + (n.w - i) * t.leftRatio)); 700 return o 701 }, _afterZoomIn: function () { 702 var e = u.current; 703 if (!e) { 704 return 705 } 706 u.isOpen = u.isOpened = true; 707 u.wrap.css("overflow", "visible").addClass("fancybox-opened"); 708 u.update(); 709 if (e.closeClick || e.nextClick && u.group.length > 1) { 710 u.inner.css("cursor", "pointer").bind("click.fb", function (t) { 711 if (!n(t.target).is("a") && !n(t.target).parent().is("a")) { 712 t.preventDefault(); 713 u[e.closeClick ? "close" : "next"]() 714 } 715 }) 716 } 717 if (e.closeBtn) { 718 n(e.tpl.closeBtn).appendTo(u.skin).bind("click.fb", function (e) { 719 e.preventDefault(); 720 u.close() 721 }) 722 } 723 if (e.arrows && u.group.length > 1) { 724 if (e.loop || e.index > 0) { 725 n(e.tpl.prev).appendTo(u.outer).bind("click.fb", u.prev) 726 } 727 if (e.loop || e.index < u.group.length - 1) { 728 n(e.tpl.next).appendTo(u.outer).bind("click.fb", u.next) 729 } 730 } 731 u.trigger("afterShow"); 732 if (!e.loop && e.index === e.group.length - 1) { 733 u.play(false) 734 } else if (u.opts.autoPlay && !u.player.isActive) { 735 u.opts.autoPlay = false; 736 u.play() 737 } 738 }, _afterZoomOut: function (e) { 739 e = e || u.current; 740 n(".fancybox-wrap").trigger("onReset").remove(); 741 n.extend(u, {group: {}, opts: {}, router: false, current: null, isActive: false, isOpened: false, isOpen: false, isClosing: false, wrap: null, skin: null, outer: null, inner: null}); 742 u.trigger("afterClose", e) 743 }}); 744 u.transitions = {getOrigPosition: function () { 745 var e = u.current, t = e.element, n = e.orig, r = {}, i = 50, s = 50, o = e.hPadding, a = e.wPadding, f = u.getViewport(); 746 if (!n && e.isDom && t.is(":visible")) { 747 n = t.find("img:first"); 748 if (!n.length) { 749 n = t 750 } 751 } 752 if (c(n)) { 753 r = n.offset(); 754 if (n.is("img")) { 755 i = n.outerWidth(); 756 s = n.outerHeight() 757 } 758 } else { 759 r.top = f.y + (f.h - s) * e.topRatio; 760 r.left = f.x + (f.w - i) * e.leftRatio 761 } 762 if (u.wrap.css("position") === "fixed" || e.locked) { 763 r.top -= f.y; 764 r.left -= f.x 765 }
766 r = {top: m(r.top - o * e.topRatio), left: m(r.left - a * e.leftRatio), width: m(i + a), height: m(s + o)}; 767 return r 768 }, step: function (e, t) { 769 var n, r, i, s = t.prop, o = u.current, a = o.wrapSpace, f = o.skinSpace; 770 if (s === "width" || s === "height") { 771 n = t.end === t.start ? 1 : (e - t.start) / (t.end - t.start); 772 if (u.isClosing) { 773 n = 1 - n 774 } 775 r = s === "width" ? o.wPadding : o.hPadding; 776 i = e - r; 777 u.skin[s](v(s === "width" ? i : i - a * n)); 778 u.inner[s](v(s === "width" ? i : i - a * n - f * n)) 779 } 780 }, zoomIn: function () { 781 var e = u.current, t = e.pos, r = e.openEffect, i = r === "elastic", s = n.extend({opacity: 1}, t); 782 delete s.position; 783 if (i) { 784 t = this.getOrigPosition(); 785 if (e.openOpacity) { 786 t.opacity = .1 787 } 788 } else if (r === "fade") { 789 t.opacity = .1 790 } 791 u.wrap.css(t).animate(s, {duration: r === "none" ? 0 : e.openSpeed, easing: e.openEasing, step: i ? this.step : null, complete: u._afterZoomIn}) 792 }, zoomOut: function () { 793 var e = u.current, t = e.closeEffect, n = t === "elastic", r = {opacity: .1}; 794 if (n) { 795 r = this.getOrigPosition(); 796 if (e.closeOpacity) { 797 r.opacity = .1 798 } 799 } 800 u.wrap.animate(r, {duration: t === "none" ? 0 : e.closeSpeed, easing: e.closeEasing, step:
800n ? this.step : null, complete: u._afterZoomOut}) 801 }, changeIn: function () { 802 var e = u.current, t = e.nextEffect, n = e.pos, r = {opacity: 1}, i = u.direction, s = 200, o; 803 n.opacity = .1; 804 if (t === "elastic") { 805 o = i === "down" || i === "up" ? "top" : "left"; 806 if (i === "down" || i === "right") { 807 n[o] = m(v(n[o]) - s); 808 r[o] = "+=" + s + "px" 809 } else { 810 n[o] = m(v(n[o]) + s); 811 r[o] = "-=" + s + "px" 812 } 813 } 814 if (t === "none") { 815 u._afterZoomIn() 816 } else { 817 u.wrap.css(n).animate(r, {duration: e.nextSpeed, easing: e.nextEasing, complete: u._afterZoomIn}) 818 } 819 }, changeOut: function () { 820 var e = u.previous, t = e.prevEffect, r = {opacity: .1}, i = u.direction, s = 200; 821 if (t === "elastic") { 822 r[i === "down" || i === "up" ? "top" : "left"] = (i === "up" || i === "left" ? "-" : "+") + "=" + s + "px" 823 } 824 e.wrap.animate(r, {duration: t === "none" ? 0 : e.prevSpeed, easing: e.prevEasing, complete: function () { 825 n(this).trigger("onReset").remove() 826 }}) 827 }}; 828 u.helpers.overlay = {defaults: {closeClick: true, speedOut: 200, showEarly: true, css: {}, locked: !l, fixed: true}, overlay: null, fixed: false, el: n("html"), create: function (e) { 829 e = n.extend({}, this.defaults, e); 830 if (this.overlay) { 831 this.close() 832 } 833 this.overlay = n('<div class="fancybox-overlay"></div>').appendTo(u.coming ? u.coming.parent : e.parent); 834 this.fixed = false; 835 if (e.fixed && u.defaults.fixed) { 836 this.overlay.addClass("fancybox-overlay-fixed"); 837 this.fixed = true 838 } 839 }, open: function (e) { 840 var t = this; 841 e = n.extend({}, this.defaults, e); 842 if (this.overlay) { 843 this.overlay.unbind(".overlay").width("auto").height("auto") 844 } else { 845 this.create(e) 846 } 847 if (!this.fixed) { 848 s.bind("resize.overlay", n.proxy(this.update, this)); 849 this.update() 850 } 851 if (e.closeClick) { 852 this.overlay.bind("click.overlay", function (e) { 853 if (n(e.target).hasClass("fancybox-overlay")) { 854 if (u.isActive) { 855 u.close() 856 } else { 857 t.close() 858 } 859 return false 860 } 861 }) 862 } 863 this.overlay.css(e.css).show() 864 }, close: function () { 865 var e, t; 866 s.unbind("resize.overlay"); 867 if (this.el.hasClass("fancybox-lock")) { 868 n(".fancybox-margin").removeClass("fancybox-margin"); 869 e = s.scrollTop(); 870 t = s.scrollLeft(); 871 this.el.removeClass("fancybox-lock"); 872 s.scrollTop(e).scrollLeft(t) 873 } 874 n(".fancybox-overlay").remove().hide(); 875 n.extend(this, {overlay: null, fixed: false}) 876 }, update: function () { 877 var e = "100%", n; 878 this.overlay.width(e).height("100%"); 879 if (a) { 880 n = Math.max(t.documentElement.offsetWidth, t.body.offsetWidth); 881 if (o.width() > n) { 882 e = o.width() 883 } 884 } else if (o.width() > s.width()) { 885 e = o.width() 886 } 887 this.overlay.width(e).height(o.height()) 888 }, onReady: function (e, t) { 889 var r = this.overlay; 890 n(".fancybox-overlay").stop(true, true); 891 if (!r) { 892 this.create(e) 893 } 894 if (e.locked && this.fixed && t.fixed) { 895 if (!r) { 896 this.margin = o.height() > s.height() ? n("html").css("margin-right").replace("px", "") : false 897 } 898 t.locked = this.overlay.append(t.wrap); 899 t.fixed = false 900 } 901 if (e.showEarly === true) { 902 this.beforeShow.apply(this, arguments) 903 } 904 }, beforeShow: function (e, t) { 905 var r, i; 906 if (t.locked) { 907 if (this.margin !== false) { 908 n("*").filter(function () { 909 return n(this).css("position") === "fixed" && !n(this).hasClass("fancybox-overlay") && !n(this).hasClass("fancybox-wrap") 910 }).addClass("fancybox-margin"); 911 this.el.addClass("fancybox-margin") 912 } 913 r = s.scrollTop(); 914 i = s.scrollLeft(); 915 this.el.addClass("fancybox-lock"); 916 s.scrollTop(r).scrollLeft(i) 917 } 918 this.open(e) 919 }
919, onUpdate: function () { 920 if (!this.fixed) { 921 this.update() 922 } 923 }, afterClose: function (e) { 924 if (this.overlay && !u.coming) { 925 this.overlay.fadeOut(e.speedOut, n.proxy(this.close, this)) 926 } 927 }}; 928 u.helpers.title = {defaults: {type: "float", position: "bottom"}, beforeShow: function (e) { 929 var t = u.current, r = t.title, i = e.type, s, o; 930 if (n.isFunction(r)) { 931 r = r.call(t.element, t) 932 } 933 if (!h(r) || n.trim(r) === "") { 934 return 935 } 936 s = n('<div class="fancybox-title fancybox-title-' + i + '-wrap">' + r + "</div>"); 937 switch (i) { 938 case"inside": 939 o = u.skin; 940 break; 941 case"outside": 942 o = u.wrap; 943 break; 944 case"over": 945 o = u.inner; 946 break; 947 default: 948 o = u.skin; 949 s.appendTo("body"); 950 if (a) { 951 s.width(s.width()) 952 } 953 s.wrapInner('<span class="child"></span>'); 954 u.current.margin[2] += Math.abs(v(s.css("margin-bottom"))); 955 break 956 } 957 s[e.position === "top" ? "prependTo" : "appendTo"](o) 958 }}; 959 n.fn.fancybox = function (e) { 960 var t, r = n(this), i = this.selector || "", s = function (s) { 961 var o = n(this).blur(), a = t, f, l; 962 if (!(s.ctrlKey || s.altKey || s.shiftKey || s.metaKey) && !o.is(".fancybox-wrap")) { 963 f = e.groupAttr || "data-fancybox-group"; 964 l = o.attr(f); 965 if (!l) { 966 f = "rel"; 967 l = o.get(0)[f] 968 } 969 if (l && l !== "" && l !== "nofollow") { 970 o = i.length ? n(i) : r; 971 o = o.filter("[" + f + '="' + l + '"]'); 972 a = o.index(this) 973 } 974 e.index = a; 975 if (u.open(o, e) !== false) { 976 s.preventDefault() 977 } 978 } 979 }; 980 e = e || {}; 981 t = e.index || 0; 982 if (!i || e.live === false) { 983 r.unbind("click.fb-start").bind("click.fb-start", s) 984 } else { 985 o.undelegate(i, "click.fb-start").delegate(i + ":not('.fancybox-item, .fancybox-nav')", "click.fb-start", s) 986 } 987 this.filter("[data-fancybox-start=1]").trigger("click"); 988 return this 989 }; 990 o.ready(function () { 991 var t, s; 992 if (n.scrollbarWidth === r) { 993 n.scrollbarWidth = function () { 994 var e = n('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"), t = e.children(), r = t.innerWidth() - t.height(99).innerWidth(); 995 e.remove(); 996 return r 997 } 998 } 999 if (n.support.fixedPosition === r) { 1000 n.support.fixedPosition = function () { 1001 var e = n('<div style="position:fixed;top:20px;"></div>').appendTo("body"), t = e[0].offsetTop === 20 || e[0].offsetTop === 15; 1002 e.remove(); 1003 return t 1004 }() 1005 } 1006 n.extend(u.defaults, {scrollbarWidth: n.scrollbarWidth(), fixed: n.support.fixedPosition, parent: n("body")}); 1007 t = n(e).width(); 1008 i.addClass("fancybox-lock-test"); 1009 s = n(e).width(); 1010 i.removeClass("fancybox-lock-test"); 1011 n("<style type='text/css'>.fancybox-margin{margin-right:" + (s - t) + "px;}</style>").appendTo("head") 1012 }) 1013})(window, document, jQuery)
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.