/* Simple JavaScript Inheritance * By John Resig http://ejohn.org/ * MIT Licensed. */(function() { var d = !1, g = /xyz/.test(function() { }) ? /\b_super\b/ : /.*/; this.SimpleClass = function() { }; SimpleClass.extend = function(b) { function c() { !d && this.init && this.init.apply(this, arguments) } var e = this.prototype; d = !0; var f = new this; d = !1; for (var a in b) f[a] = typeof b[a] == "function" && typeof e[a] == "function" && g.test(b[a]) ? function(a, b) { return function() { var c = this._super; this._super = e[a]; var d = b.apply(this, arguments); this._super = c; return d } }(a, b[a]) : b[a]; c.prototype = f; c.constructor = c; c.extend = arguments.callee; return c } })(); // PhotoSwipe - http://www.photoswipe.com/ // Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com) // Licensed under the MIT license // version: 1.0.11 (function() { if (!Function.prototype.bind) Function.prototype.bind = function(a) { var b = [].slice, c = b.call(arguments, 1), d = this, f = function() { }, e = function() { return d.apply(this instanceof f ? this : a || {}, c.concat(b.call(arguments))) }; f.prototype = d.prototype; e.prototype = new f; return e }; if (typeof Code === "undefined") Code = {}, Code.PhotoSwipe = {}; Code.PhotoSwipe.Util = {browser: {version: (navigator.userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], webkit: /webkit/i.test(navigator.userAgent), opera: /opera/i.test(navigator.userAgent), msie: /msie/i.test(navigator.userAgent) && !/opera/.test(navigator.userAgent), mozilla: /mozilla/i.test(navigator.userAgent) && !/(compatible|webkit)/.test(navigator.userAgent), mobileSafari: /mobile.*safari/i.test(navigator.userAgent), is3dSupported: !1, isAndroid: /android/i.test(navigator.userAgent), isBlackberry: /blackberry/i.test(navigator.userAgent), isiOS: /like Mac OS/i.test(navigator.userAgent), touchSupported: !1, gestureSupported: !1, _eventTagNames: {select: "input", change: "input", submit: "form", reset: "form", error: "img", load: "img", abort: "img"}, isEventSupported: function(a) { var b = document.createElement(this._eventTagNames[a] || "div"), a = "on" + a, c = a in b; c || (b.setAttribute(a, "return;"), c = typeof b[a] == "function"); return c }}, setElementData: function(a, b, c) { if (this.isNothing(a.UtilData)) a.UtilData = {}; a.UtilData[b] = c }, getElementData: function(a, b, c) { typeof c === "undefined" && (c = null); if (this.isNothing(a.UtilData)) return c; if (this.isNothing(a.UtilData[b])) return c; return a.UtilData[b] }, removeElementData: function(a, b) { delete a.UtilData[b] }, coalesce: function() { var a; for (a = 0; a < arguments.length; a++) if (!this.isNothing(arguments[a])) return arguments[a]; return null }, registerNamespace: function() { var a = arguments, b = null, c, d; for (c = 0; c < a.length; ++c) { var e = a[c].split("."); d = e[0]; eval("if (typeof " + d + ' == "undefined"){' + d + " = {};} obj = " + d + ";"); for (d = 1; d < e.length; ++d) b[e[d]] = b[e[d]] || {}, b = b[e[d]] } }, extend: function(a, b, c) { this.isNothing(c) && (c = !0); if (a && b && this.isObject(b)) for (var d in b) c ? a[d] = b[d] : typeof a[d] == "undefined" && (a[d] = b[d]) }, swapArrayElements: function(a, b, c) { var d = a[b]; a[b] = a[c]; a[c] = d }, isObject: function(a) { return typeof a == "object" }, isNothing: function(a) { if (typeof a === "undefined" || a === null) return!0; return!1 }, isFunction: function(a) { return typeof a == "function" }, isArray: function(a) { return a && Code.PhotoSwipe.Util.isFunction(a.pop) }, isNumber: function(a) { return typeof a == "number" }, isString: function(a) { return typeof a == "string" }, trim: function(a) { return a.replace(RegExp(/\s+?/), "") }}; if (Code.PhotoSwipe.Util.browser.webkit) { var e = document.createElement("div"); Code.PhotoSwipe.Util.browser.is3dSupported = !Code.PhotoSwipe.Util.isNothing(e.style.WebkitPerspective) } Code.PhotoSwipe.Util.browser.touchSupported = Code.PhotoSwipe.Util.browser.isEventSupported("touchstart"); Code.PhotoSwipe.Util.browser.gestureSupported = Code.PhotoSwipe.Util.browser.isEventSupported("gesturestart") })(window); (function(e, a) { a.extend(a, {DOM: {resetTranslate: function(b) { a.browser.webkit ? a.browser.is3dSupported ? a.DOM.setStyle(b, {webkitTransform: "translate3d(0px, 0px, 0px)"}) : a.DOM.setStyle(b, {webkitTransform: "translate(0px, 0px)"}) : a.DOM.setStyle(b, {webkitTransform: "translate(0px, 0px)", MozTransform: "translate(0px, 0px)", transform: "translate(0px, 0px)"}) }, createElement: function(a, c, d) { var a = document.createElement(a), e; for (e in c) c.hasOwnProperty(e) && a.setAttribute(e, c[e]); a.innerHTML = d || ""; return a }, appendChild: function(a, c) { c.appendChild(a) }, appendText: function(b, c) { var d = document.createTextNode(b); a.DOM.appendChild(d, c) }, appendToBody: function(a) { this.appendChild(a, document.body) }, removeChild: function(a, c) { c.removeChild(a) }, removeChildren: function(a) { if (a.hasChildNodes()) for (; a.childNodes.length >= 1; ) a.removeChild(a.childNodes[a.childNodes.length - 1]) }, hasAttribute: function(a, c) { return a.getAttribute(c) }, getAttribute: function(a, c) { if (!this.hasAttribute(a, c)) return""; return a.getAttribute(c) }, setAttribute: function(a, c, d) { a.setAttribute(c, d) }, removeAttribute: function(a, c) { this.hasAttribute(a, c) && a.removeAttribute(c) }, addClass: function(b, c) { var d = a.DOM.getAttribute(b, "class"); RegExp("(?:^|\\s+)" + c + "(?:\\s+|$)").test(d) || (d !== "" && (d += " "), d += c, a.DOM.setAttribute(b, "class", d)) }, removeClass: function(b, c) { var d = a.DOM.getAttribute(b, "class"), e = RegExp("(?:^|\\s+)" + c + "(?:\\s+|$)"); e.test(d) ? (d = d.replace(e, " "), a.DOM.setAttribute(b, "class", d), a.DOM.removeClass(b, c)) : (d = a.trim(d), d === "" ? a.DOM.removeAttribute(b, "class") : a.DOM.setAttribute(b, "class", d)) }, hasClass: function(b, c) { return RegExp("(?:^|\\s+)" + c + "(?:\\s+|$)").test(a.DOM.getAttribute(b, "class")) }, setStyle: function(b, c, d) { if (a.isObject(c)) for (var e in c) c.hasOwnProperty(e) && (b.style[e] = c[e]); else b.style[c] = d }, getStyle: function(a, c) { return e.getComputedStyle(a, "").getPropertyValue(c) }, hide: function(b) { a.setElementData(b, "oldDisplayValue", a.DOM.getStyle(b, "display")); a.DOM.setStyle(b, "display", "none") }, show: function(b) { if (a.DOM.getStyle(b, "display") == "none") { var c = a.getElementData(b, "oldDisplayValue", "block"); c === "none" && (c = "block"); a.DOM.setStyle(b, "display", c) } }, width: function(b, c) { if (!a.isNothing(c)) a.isNumber(c) && (c += "px"), b.style.width = c; return this._getDimension(b, "width") }, outerWidth: function(b) { var c = a.DOM.width(b); c += parseInt(a.DOM.getStyle(b, "padding-left"), 10) + parseInt(a.DOM.getStyle(b, "padding-right"), 10); c += parseInt(a.DOM.getStyle(b, "margin-left"), 10) + parseInt(a.DOM.getStyle(b, "margin-right"), 10); c += parseInt(a.DOM.getStyle(b, "border-left-width"), 10) + parseInt(a.DOM.getStyle(b, "border-right-width"), 10); return c }, height: function(b, c) { if (!a.isNothing(c)) a.isNumber(c) && (c += "px"), b.style.height = c; return this._getDimension(b, "height") }, _getDimension: function(a, c) { var d = e.parseInt(e.getComputedStyle(a, "").getPropertyValue(c)); if (isNaN(d)) { var f = {display: a.style.display, left: a.style.left}; a.style.display = "block"; a.style.left = "-1000000px"; d = e.parseInt(e.getComputedStyle(a, "").getPropertyValue(c)); a.style.display = f.display; a.style.left = f.left } return d }, outerHeight: function(b) { var c = a.DOM.height(b); c += parseInt(a.DOM.getStyle(b, "padding-top"), 10) + parseInt(a.DOM.getStyle(b, "padding-bottom"), 10); c += parseInt(a.DOM.getStyle(b, "margin-top"), 10) + parseInt(a.DOM.getStyle(b, "margin-bottom"), 10); c += parseInt(a.DOM.getStyle(b, "border-top-width"), 10) + parseInt(a.DOM.getStyle(b, "border-bottom-width"), 10); return c }, documentWidth: function() { return a.DOM.width(document.documentElement) }, documentHeight: function() { return Math.round(a.DOM.height(document.documentElement)) }, bodyWidth: function() { return a.DOM.width(document.body) }, bodyHeight: function() { return a.DOM.height(document.body) }, windowWidth: function() { return e.innerWidth }, windowHeight: function() { return e.innerHeight }, windowScrollLeft: function() { return e.pageXOffset }, windowScrollTop: function() { return e.pageYOffset }, addEventListener: function(a, c, d) { a.addEventListener(c, d, !1) }, removeEventListener: function(a, c, d) { a.removeEventListener(c, d, !1) }, getMousePosition: function(a) { var c = {x: 0, y: 0}; if (a.pageX) c.x = a.pageX; else if (a.clientX) c.x = a.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); if (a.pageY) c.y = a.pageY; else if (a.clientY) c.y = a.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); return c }, getTouchEvent: function(a) { return a }}}) })(window, Code.PhotoSwipe.Util); (function(e, a) { a.extend(a, {Animation: {_applyTransitionDelay: 50, _setTransition: function(b, c, d, f, g, h) { var i = a.Animation._getTransitionPrefix(), c = a.coalesce(c, ""), d = a.coalesce(d, ""), j; a.isFunction(f) ? (j = f, g = f = "") : (j = h, f = a.coalesce(f, ""), g = a.coalesce(g, "")); h = {}; h[i + "Property"] = c; h[i + "Duration"] = d; h[i + "TimingFunction"] = f; h[i + "Delay"] = g; a.DOM.setStyle(b, h); a.isFunction(j) && e.setTimeout(function() { j(b) }, a.Animation._applyTransitionDelay) }, _setTransitionEndEventListener: function(b) { a.setElementData(b, "transitionEndEvent", function(b) { var d = b.target; a.DOM.removeEventListener(d, a.Animation._getTransitionEndEventLabel(), a.getElementData(d, "transitionEndEvent")); a.removeElementData(d, "transitionEndEvent"); var f = a.getElementData(d, "transitionEndCallback"); a.removeElementData(d, "transitionEndCallback"); a.Animation._removeTransitions(d); a.isFunction(f) && e.setTimeout(function() { f(b) }, a.Animation._applyTransitionDelay) }); a.DOM.addEventListener(b, a.Animation._getTransitionEndEventLabel(), a.getElementData(b, "transitionEndEvent")) }, _removeTransitions: function(b) { var c = a.Animation._getTransitionPrefix(), d = {}; d[c + "Property"] = ""; d[c + "Duration"] = ""; d[c + "TimingFunction"] = ""; d[c + "Delay"] = ""; a.DOM.setStyle(b, d) }, _getTransitionEndEventLabel: function() { return document.documentElement.style.WebkitTransition !== void 0 ? "webkitTransitionEnd" : "transitionend" }, _getTransitionPrefix: function() { return document.documentElement.style.WebkitTransition !== void 0 ? "webkitTransition" : document.documentElement.style.MozTransition !== void 0 ? "MozTransition" : "transition" }, stopFade: function(b) { var c = a.getElementData(b, "transitionEndEvent"); a.isNothing(c) || (a.DOM.removeEventListener(b, a.Animation._getTransitionEndEventLabel(), a.getElementData(b, "transitionEndEvent")), c = e.getComputedStyle(b, "").getPropertyValue("opacity"), a.Animation._removeTransitions(b), a.DOM.setStyle(b, "opacity", c)) }, fadeIn: function(b, c, d, e) { c = a.coalesce(c, 1); d = a.coalesce(d, 500); a.setElementData(b, "transitionEndCallback", e); a.Animation._setTransition(b, "opacity", d + "ms", function(b) { a.Animation._setTransitionEndEventListener(b); a.DOM.setStyle(b, "opacity", c) }) }, fadeOut: function(b, c, d) { a.isNothing(c) && (c = 500); a.setElementData(b, "transitionEndCallback", d); a.Animation._setTransition(b, "opacity", c + "ms", function(b) { a.Animation._setTransitionEndEventListener(b); a.DOM.setStyle(b, "opacity", 0) }) }, slideBy: function(b, c, d, e, g) { a.isNothing(e) && (e = 500); a.setElementData(b, "transitionEndCallback", a.Animation._onSlideByEnd); a.setElementData(b, "slideByCallback", g); a.setElementData(b, "slideByXPos", c); a.setElementData(b, "slideByYPos", d); a.Animation._setTransition(b, "all", e + "ms", "ease-in", 0, function(b) { a.Animation._setTransitionEndEventListener(b); var c = a.getElementData(b, "slideByXPos"), d = a.getElementData(b, "slideByYPos"); a.removeElementData(b, "slideByXPos"); a.removeElementData(b, "slideByYPos"); a.browser.webkit ? a.browser.is3dSupported ? a.DOM.setStyle(b, {webkitTransform: "translate3d(" + c + "px, " + d + "px, 0)"}) : a.DOM.setStyle(b, {webkitTransform: "translate(" + c + "px, " + d + "px)"}) : a.DOM.setStyle(b, {webkitTransform: "translate(" + c + "px, " + d + "px)", MozTransform: "translate(" + c + "px, " + d + "px)", transform: "translate(" + c + "px, " + d + "px)"}) }) }, _onSlideByEnd: function(b) { var c = b.target, d = a.getElementData(c, "slideByCallback"), f = a.coalesce(c.style.webkitTransform, c.style.MozTransform, c.style.transform).match(/\((.*?)\)/)[1].split(", "), g = e.parseInt(f[0]), f = e.parseInt(f[1]), h = e.parseInt(a.DOM.getStyle(c, "left")), i = e.parseInt(a.DOM.getStyle(c, "top")); a.DOM.setStyle(c, {webkitTransform: "", MozTransform: "", transform: "", left: h + g + "px", top: i + f + "px"}); a.removeElementData(c, "slideByCallback"); a.removeElementData(c, "slideByXPos"); a.removeElementData(c, "slideByYPos"); a.isFunction(d) && e.setTimeout(function() { d(b) }, a.Animation._applyTransitionDelay) }}}) })(window, Code.PhotoSwipe.Util); (function() { Code.PhotoSwipe.EventClass = SimpleClass.extend({_listeners: null, init: function() { this._listeners = {} }, addEventListener: function(e, a) { typeof this._listeners[e] === "undefined" && (this._listeners[e] = []); this._listeners[e].push(a) }, dispatchEvent: function(e) { typeof e == "string" && (e = {type: e}); if (!e.target) e.target = this; if (!e.type) throw Error("Event object missing 'type' property."); if (this._listeners[e.type]instanceof Array) for (var a = this._listeners[e.type], b = 0, c = a.length; b < c; b++) a[b].call(this, e) }, removeEventListener: function(e, a) { if (this._listeners[e]instanceof Array) for (var b = this._listeners[e], c = 0, d = b.length; c < d; c++) if (b[c] === a) { b.splice(c, 1); break } }}) })(); (function(e, a) { Code.PhotoSwipe.ElementClass = Code.PhotoSwipe.EventClass.extend({el: null, settings: null, isHidden: null, fadeInHandler: null, fadeOutHandler: null, init: function(b) { this._super(); this.settings = {opacity: 1, fadeInSpeed: 250, fadeOutSpeed: 500}; a.extend(this.settings, b); this.fadeInHandler = this.postFadeIn.bind(this); this.fadeOutHandler = this.postFadeOut.bind(this); this.isHidden = !0 }, resetPosition: function() { }, show: function() { this.stopFade(); a.DOM.setStyle(this.el, "opacity", this.settings.opacity); a.DOM.show(this.el); this.postShow() }, postShow: function() { this.isHidden = !1; this.addEventListeners(); this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onShow) }, fadeIn: function() { a.DOM.setStyle(this.el, "opacity", 0); this.fadeInFromCurrentOpacity() }, fadeInFromCurrentOpacity: function() { this.stopFade(); this.isHidden = !1; a.DOM.show(this.el); a.Animation.fadeIn(this.el, this.settings.opacity, this.settings.fadeInSpeed, this.fadeInHandler) }, postFadeIn: function() { this.isHidden || (this.addEventListeners(), this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeIn)) }, hide: function() { this.stopFade(); a.DOM.hide(this.el); this.postHide() }, postHide: function() { this.isHidden = !0; this.removeEventListeners(); this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onHide) }, fadeOut: function() { this.stopFade(); this.isHidden = !0; a.Animation.fadeOut(this.el, this.settings.fadeOutSpeed, this.fadeOutHandler) }, postFadeOut: function() { this.isHidden && (a.DOM.hide(this.el), this.removeEventListeners(), this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeOut)) }, stopFade: function() { a.Animation.stopFade(this.el) }, addEventListeners: function() { }, removeEventListeners: function() { }}); Code.PhotoSwipe.ElementClass.EventTypes = {onShow: "onShow", onHide: "onHide", onClick: "onClick", onFadeIn: "onFadeIn", onFadeOut: "onFadeOut"} })(window, Code.PhotoSwipe.Util); (function(e, a) { Code.PhotoSwipe.FullSizeImageClass = Code.PhotoSwipe.EventClass.extend({el: null, index: null, naturalWidth: null, naturalHeight: null, src: null, caption: null, metaData: null, scaleMethod: null, isLandscape: null, isLoading: null, hasLoaded: null, loadEventHandler: null, init: function(b, c, d, e, g) { this._super(); this.index = b; this.naturalHeight = this.naturalWidth = 0; this.src = d; this.caption = e; this.metaData = a.coalesce(g, {}); this.hasLoaded = this.isLoading = this.isLandscape = !1; this.scaleMethod = c; this.loadEventHandler = this.onLoad.bind(this) }, load: function() { this.isLoading = !0; this.el = new Image; a.DOM.addClass(this.el, "ps-full-size-image"); this.el.onload = this.loadEventHandler; this.el.src = this.src }, onLoad: function() { this.naturalWidth = a.coalesce(this.el.naturalWidth, this.el.width); this.naturalHeight = a.coalesce(this.el.naturalHeight, this.el.height); this.isLandscape = this.naturalWidth > this.naturalHeight; this.isLoading = !1; this.hasLoaded = !0; this.dispatchEvent(Code.PhotoSwipe.FullSizeImageClass.EventTypes.onLoad) }}); Code.PhotoSwipe.FullSizeImageClass.EventTypes = {onLoad: "onLoad"} })(window, Code.PhotoSwipe.Util); (function(e, a) { Code.PhotoSwipe.DocumentOverlayClass = Code.PhotoSwipe.ElementClass.extend({init: function(b) { this.settings = {zIndex: 1E3}; a.extend(this.settings, b); this._super(b); this.el = a.DOM.createElement("div", {"class": Code.PhotoSwipe.DocumentOverlayClass.CssClasses.documentOverlay}, ""); a.DOM.setStyle(this.el, {left: 0, position: "absolute", zIndex: this.settings.zIndex, top: 0}); a.DOM.hide(this.el); a.DOM.appendToBody(this.el) }, resetPosition: function() { a.DOM.width(this.el, a.DOM.bodyWidth()); a.DOM.height(this.el, a.DOM.bodyHeight()) }}); Code.PhotoSwipe.DocumentOverlayClass.CssClasses = {documentOverlay: "ps-document-overlay"} })(window, Code.PhotoSwipe.Util); (function(e, a) { Code.PhotoSwipe.ViewportClass = Code.PhotoSwipe.ElementClass.extend({touchStartPoint: null, touchStartTime: null, touchStartHandler: null, touchMoveHandler: null, touchEndHandler: null, gestureStartHandler: null, gestureChangeHandler: null, gestureEndHandler: null, isGesture: null, mouseDownHandler: null, mouseUpHandler: null, init: function(b) { this.settings = {swipeThreshold: 500, swipeTimeThreshold: 250, zIndex: 1E3}; a.extend(this.settings, b); this._super(this.settings); this.touchStartPoint = {x: 0, y: 0}; if (a.browser.touchSupported) this.touchStartHandler = this.onTouchStart.bind(this), this.touchMoveHandler = this.onTouchMove.bind(this), this.touchEndHandler = this.onTouchEnd.bind(this); if (a.browser.gestureSupported) this.gestureStartHandler = this.onGestureStart.bind(this), this.gestureChangeHandler = this.onGestureChange.bind(this), this.gestureEndHandler = this.onGestureEnd.bind(this); this.mouseDownHandler = this.onMouseDown.bind(this); this.mouseUpHandler = this.onMouseUp.bind(this); this.el = a.DOM.createElement("div", {"class": Code.PhotoSwipe.ViewportClass.CssClasses.viewport, "data-role": "dialog"}, ""); a.DOM.setStyle(this.el, {position: "absolute", left: 0, zIndex: this.settings.zIndex, overflow: "hidden"}); a.DOM.hide(this.el); a.DOM.appendToBody(this.el) }, resetPosition: function() { a.DOM.setStyle(this.el, {top: a.DOM.windowScrollTop() + "px"}); a.DOM.width(this.el, a.DOM.bodyWidth()); a.DOM.height(this.el, a.DOM.windowHeight()) }, addEventListeners: function() { a.browser.touchSupported && (a.DOM.addEventListener(this.el, "touchstart", this.touchStartHandler), a.DOM.addEventListener(this.el, "touchmove", this.touchMoveHandler), a.DOM.addEventListener(this.el, "touchend", this.touchEndHandler)); a.browser.gestureSupported && (a.DOM.addEventListener(this.el, "gesturestart", this.gestureStartHandler), a.DOM.addEventListener(this.el, "gesturechange", this.gestureChangeHandler), a.DOM.addEventListener(this.el, "gestureend", this.gestureEndHandler)); a.DOM.addEventListener(this.el, "mousedown", this.mouseDownHandler); a.DOM.addEventListener(this.el, "mouseup", this.mouseUpHandler) }, removeEventListeners: function() { a.browser.touchSupported && (a.DOM.removeEventListener(this.el, "touchstart", this.touchStartHandler), a.DOM.removeEventListener(this.el, "touchmove", this.touchMoveHandler), a.DOM.removeEventListener(this.el, "touchend", this.touchEndHandler)); a.browser.gestureSupported && (a.DOM.removeEventListener(this.el, "gesturestart", this.gestureStartHandler), a.DOM.removeEventListener(this.el, "gesturechange", this.gestureChangeHandler), a.DOM.removeEventListener(this.el, "gestureend", this.gestureEndHandler)); a.DOM.removeEventListener(this.el, "mousedown", this.mouseDownHandler); a.DOM.removeEventListener(this.el, "mouseup", this.mouseUpHandler) }, getTouchPoint: function(a) { return{x: a[0].pageX, y: a[0].pageY} }, onGestureStart: function(b) { b.preventDefault(); b = a.DOM.getTouchEvent(b); this.dispatchEvent({type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target: this, action: Code.PhotoSwipe.ViewportClass.Actions.gestureStart, scale: b.scale, rotation: b.rotation}) }, onGestureChange: function(b) { b.preventDefault(); b = a.DOM.getTouchEvent(b); this.dispatchEvent({type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target: this, action: Code.PhotoSwipe.ViewportClass.Actions.gestureChange, scale: b.scale, rotation: b.rotation}) }, onGestureEnd: function(b) { b.preventDefault(); b = a.DOM.getTouchEvent(b); this.dispatchEvent({type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target: this, action: Code.PhotoSwipe.ViewportClass.Actions.gestureEnd, scale: b.scale, rotation: b.rotation}) }, onTouchStart: function(b) { b.preventDefault(); b = a.DOM.getTouchEvent(b).touches; b.length > 1 ? this.isGesture = !0 : (this.dispatchEvent({type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target: this, action: Code.PhotoSwipe.ViewportClass.Actions.touchStart, point: this.getTouchPoint(b)}), this.touchStartTime = new Date, this.isGesture = !1, this.touchStartPoint = this.getTouchPoint(b)) }, onTouchMove: function(b) { b.preventDefault(); if (!this.isGesture) b = a.DOM.getTouchEvent(b).touches, this.dispatchEvent({type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target: this, action: Code.PhotoSwipe.ViewportClass.Actions.touchMove, point: this.getTouchPoint(b)}) }, onTouchEnd: function(b) { b.preventDefault(); this.isGesture || (b = a.DOM.getTouchEvent(b), b = this.getTouchPoint(!a.isNothing(b.changedTouches) ? b.changedTouches : b.touches), this.dispatchEvent({type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target: this, action: Code.PhotoSwipe.ViewportClass.Actions.touchEnd, point: b}), this.fireTouchEvent(this.touchStartPoint, b)) }, onMouseDown: function(b) { b.preventDefault(); this.touchStartTime = new Date; this.isGesture = !1; this.touchStartPoint = a.DOM.getMousePosition(b) }, onMouseUp: function(b) { b.preventDefault(); this.fireTouchEvent(this.touchStartPoint, a.DOM.getMousePosition(b)) }, fireTouchEvent: function(b, c) { var d; new Date - this.touchStartTime > this.settings.swipeTimeThreshold || (d = c.x - b.x, d = Math.abs(d) >= this.settings.swipeThreshold ? d < 0 ? Code.PhotoSwipe.ViewportClass.Actions.swipeLeft : Code.PhotoSwipe.ViewportClass.Actions.swipeRight : Code.PhotoSwipe.ViewportClass.Actions.click, a.isNothing(d) || this.dispatchEvent({type: Code.PhotoSwipe.ViewportClass.EventTypes.onTouch, target: this, action: d})) }}); Code.PhotoSwipe.ViewportClass.CssClasses = {viewport: "ps-viewport"}; Code.PhotoSwipe.ViewportClass.Actions = {click: "click", swipeLeft: "swipeLeft", swipeRight: "swipeRight", touchStart: "touchStart", touchMove: "touchMove", touchEnd: "touchEnd", gestureStart: "gestureStart", gestureChange: "gestureChange", gestureEnd: "gestureEnd"}; Code.PhotoSwipe.ViewportClass.EventTypes = {onTouch: "onTouch"} })(window, Code.PhotoSwipe.Util); (function(e, a, b) { Code.PhotoSwipe.SliderItemClass = Code.PhotoSwipe.EventClass.extend({el: null, imageContainerEl: null, imageEl: null, parentEl: null, fullSizeImage: null, fullSizeImageLoadEventHandler: null, savedImageWidth: null, savedImageHeight: null, init: function(b) { this._super(); this.parentEl = b; this.fullSizeImageLoadEventHandler = this.onFullSizeImageLoad.bind(this); this.el = a.DOM.createElement("div", {"class": Code.PhotoSwipe.SliderItemClass.CssClasses.item + " " + Code.PhotoSwipe.SliderItemClass.CssClasses.loading}, ""); a.DOM.setStyle(this.el, {position: "absolute", overflow: "hidden", top: 0}); a.DOM.resetTranslate(this.el); a.DOM.appendChild(this.el, this.parentEl); this.imageContainerEl = a.DOM.createElement("div"); a.DOM.setStyle(this.imageContainerEl, {position: "absolute", overflow: "hidden", top: 0, left: 0}); a.DOM.appendChild(this.imageContainerEl, this.el); this.imageEl = new Image; a.DOM.setStyle(this.imageEl, {display: "block", position: "absolute", margin: 0, padding: 0}); a.DOM.hide(this.imageEl); a.DOM.appendChild(this.imageEl, this.imageContainerEl) }, resetPosition: function(b, d, e) { a.DOM.width(this.el, b); a.DOM.height(this.el, d); a.DOM.setStyle(this.el, "left", e + "px"); a.DOM.width(this.imageContainerEl, b); a.DOM.height(this.imageContainerEl, d); this.resetImagePosition() }, resetImagePosition: function() { if (!a.isNothing(this.fullSizeImage)) { a.DOM.getAttribute(this.imageEl, "src"); var b, d, e, g; g = a.DOM.width(this.el); var h = a.DOM.height(this.el); b = this.fullSizeImage.isLandscape ? g / this.fullSizeImage.naturalWidth : h / this.fullSizeImage.naturalHeight; d = Math.round(this.fullSizeImage.naturalWidth * b); e = Math.round(this.fullSizeImage.naturalHeight * b); this.fullSizeImage.scaleMethod === "zoom" ? (b = 1, e < h ? b = h / e : d < g && (b = g / d), b !== 1 && (d = Math.round(d * b), e = Math.round(e * b))) : this.fullSizeImage.scaleMethod === "fit" && (b = 1, d > g ? b = g / d : e > h && (b = h / e), b !== 1 && (d = Math.round(d * b), e = Math.round(e * b))); b = (h - e) / 2 + "px"; g = (g - d) / 2 + "px"; a.DOM.width(this.imageEl, d); a.DOM.height(this.imageEl, e); a.DOM.setStyle(this.imageEl, {top: b, left: g}); a.DOM.show(this.imageEl); this.savedImageWidth = d; this.savedImageHeight = e } }, setFullSizeImage: function(c) { this.fullSizeImage = c; a.DOM.removeClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.loading); a.DOM.removeClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.imageError); a.isNothing(this.fullSizeImage) ? (this.fullSizeImage = null, a.DOM.addClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.imageError), this.hideImage()) : this.fullSizeImage.hasLoaded ? (a.DOM.setAttribute(this.imageEl, "src", this.fullSizeImage.src), this.resetImagePosition(), this.dispatchEvent(Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageDisplay)) : (a.DOM.addClass(this.el, Code.PhotoSwipe.SliderItemClass.CssClasses.loading), this.hideImage(), this.fullSizeImage.isLoading || (this.fullSizeImage.addEventListener(b.EventTypes.onLoad, this.fullSizeImageLoadEventHandler), this.fullSizeImage.load())) }, onFullSizeImageLoad: function(c) { c.target.removeEventListener(b.EventTypes.onLoad, this.fullSizeImageLoadEventHandler); a.isNothing(this.fullSizeImage) || c.target.index !== this.fullSizeImage.index ? this.dispatchEvent({type: Code.PhotoSwipe.SliderItemClass.EventTypes.onFullSizeImageLoadAnomaly, target: this, fullSizeImage: c.target}) : this.setFullSizeImage(c.target) }, hideImage: function() { a.DOM.removeAttribute(this.imageEl, "src"); a.DOM.hide(this.imageEl) }}); Code.PhotoSwipe.SliderItemClass.CssClasses = {item: "ps-slider-item", loading: "ps-slider-item-loading", imageError: "ps-slider-item-image-error"}; Code.PhotoSwipe.SliderItemClass.EventTypes = {onFullSizeImageDisplay: "onFullSizeImageDisplay", onFullSizeImageLoadAnomaly: "onFullSizeImageLoadAnomaly"} })(window, Code.PhotoSwipe.Util, Code.PhotoSwipe.FullSizeImageClass); (function(e, a, b) { Code.PhotoSwipe.SliderClass = Code.PhotoSwipe.ElementClass.extend({parentEl: null, parentElWidth: null, parentElHeight: null, items: null, scaleEl: null, lastScaleValue: null, previousItem: null, currentItem: null, nextItem: null, hasBounced: null, lastShowAction: null, bounceSlideBy: null, showNextEndEventHandler: null, showPreviousEndEventHandler: null, bounceStepOneEventHandler: null, bounceStepTwoEventHandler: null, sliderFullSizeImageLoadAnomalyEventHandler: null, init: function(c, d) { this.settings = {slideSpeed: 250}; a.extend(this.settings, c); this._super(this.settings); this.parentEl = d; this.hasBounced = !1; this.showNextEndEventHandler = this.onShowNextEnd.bind(this); this.showPreviousEndEventHandler = this.onShowPreviousEnd.bind(this); this.bounceStepOneEventHandler = this.onBounceStepOne.bind(this); this.bounceStepTwoEventHandler = this.onBounceStepTwo.bind(this); this.sliderFullSizeImageLoadAnomalyEventHandler = this.onSliderFullSizeImageLoadAnomaly.bind(this); this.el = a.DOM.createElement("div", {"class": Code.PhotoSwipe.SliderClass.CssClasses.slider}, ""); a.DOM.setStyle(this.el, {position: "absolute", top: 0}); a.DOM.hide(this.el); a.DOM.appendChild(this.el, d); this.items = []; this.items.push(new b(this.el)); this.items.push(new b(this.el)); this.items.push(new b(this.el)); this.previousItem = this.items[0]; this.currentItem = this.items[1]; this.nextItem = this.items[2] }, addEventListeners: function() { for (var a = 0; a < this.items.length; a++) this.items[a].addEventListener(b.EventTypes.onFullSizeImageLoadAnomaly, this.sliderFullSizeImageLoadAnomalyEventHandler) }, removeEventListeners: function() { for (var a = 0; a < this.items.length; a++) this.items[a].removeEventListener(b.EventTypes.onFullSizeImageLoadAnomaly, this.sliderFullSizeImageLoadAnomalyEventHandler) }, resetPosition: function() { a.DOM.show(this.currentItem.imageContainerEl); this.parentElWidth = a.DOM.width(this.parentEl); this.parentElHeight = a.DOM.height(this.parentEl); a.DOM.width(this.el, this.parentElWidth * 3); a.DOM.height(this.el, this.parentElHeight); this.previousItem.resetPosition(this.parentElWidth, this.parentElHeight, 0); this.currentItem.resetPosition(this.parentElWidth, this.parentElHeight, this.parentElWidth); this.nextItem.resetPosition(this.parentElWidth, this.parentElHeight, this.parentElWidth * 2); this.center() }, center: function() { a.DOM.resetTranslate(this.el); a.DOM.setStyle(this.el, {left: this.parentElWidth * -1 + "px"}) }, setCurrentFullSizeImage: function(a) { this.currentItem.setFullSizeImage(a); this.dispatchDisplayCurrentFullSizeImage() }, setPreviousAndNextFullSizeImages: function(a, b) { this.nextItem.setFullSizeImage(b); this.previousItem.setFullSizeImage(a) }, showNext: function() { this.lastShowAction = Code.PhotoSwipe.SliderClass.ShowActionTypes.next; this.hasBounced = !1; a.isNothing(this.nextItem.fullSizeImage) ? this.bounce() : a.Animation.slideBy(this.el, this.parentElWidth * -1, 0, this.settings.slideSpeed, this.showNextEndEventHandler) }, showPrevious: function() { this.lastShowAction = Code.PhotoSwipe.SliderClass.ShowActionTypes.previous; this.hasBounced = !1; a.isNothing(this.previousItem.fullSizeImage) ? this.bounce() : a.Animation.slideBy(this.el, this.parentElWidth, 0, this.settings.slideSpeed, this.showPreviousEndEventHandler) }, bounce: function() { a.DOM.show(this.currentItem.imageContainerEl); this.hasBounced = !0; this.bounceSlideBy = this.parentElWidth / 2; a.Animation.slideBy(this.el, this.lastShowAction === Code.PhotoSwipe.SliderClass.ShowActionTypes.previous ? this.bounceSlideBy : this.bounceSlideBy * -1, 0, this.settings.slideSpeed, this.bounceStepOneEventHandler) }, onBounceStepOne: function() { a.Animation.slideBy(this.el, this.lastShowAction === Code.PhotoSwipe.SliderClass.ShowActionTypes.previous ? this.bounceSlideBy * -1 : this.bounceSlideBy, 0, this.settings.slideSpeed, this.bounceStepTwoEventHandler) }, onBounceStepTwo: function() { this.dispatchDisplayCurrentFullSizeImage() }, onShowNextEnd: function() { a.DOM.show(this.currentItem.imageContainerEl); a.swapArrayElements(this.items, 1, 2); this.currentItem = this.items[1]; this.nextItem = this.items[2]; var b = this.parentElWidth; a.DOM.setStyle(this.currentItem.el, "left", b + "px"); a.DOM.setStyle(this.nextItem.el, "left", b * 2 + "px"); this.center(); this.dispatchDisplayCurrentFullSizeImage() }, onShowPreviousEnd: function() { a.DOM.show(this.currentItem.imageContainerEl); a.swapArrayElements(this.items, 1, 0); this.currentItem = this.items[1]; this.previousItem = this.items[0]; a.DOM.setStyle(this.currentItem.el, "left", this.parentElWidth + "px"); a.DOM.setStyle(this.previousItem.el, "left", "0px"); this.center(); this.dispatchDisplayCurrentFullSizeImage() }, onSliderFullSizeImageLoadAnomaly: function(b) { b = b.fullSizeImage; !a.isNothing(this.currentItem.fullSizeImage) && this.currentItem.fullSizeImage.index === b.index ? (this.currentItem.setFullSizeImage(b), this.dispatchDisplayCurrentFullSizeImage()) : !a.isNothing(this.nextItem.fullSizeImage) && this.nextItem.fullSizeImage.index === b.index ? this.nextItem.setFullSizeImage(b) : a.isNothing(this.previousItem.fullSizeImage) || this.previousItem.fullSizeImage.index === b.index && this.previousItem.setFullSizeImage(b) }, dispatchDisplayCurrentFullSizeImage: function() { this.dispatchEvent({type: Code.PhotoSwipe.SliderClass.EventTypes.onDisplayCurrentFullSizeImage, target: this, fullSizeImage: this.currentItem.fullSizeImage}) }}); Code.PhotoSwipe.SliderClass.CssClasses = {slider: "ps-slider"}; Code.PhotoSwipe.SliderClass.ShowActionTypes = {next: "next", previous: "previous"}; Code.PhotoSwipe.SliderClass.EventTypes = {onDisplayCurrentFullSizeImage: "onDisplayCurrentFullSizeImage"} })(window, Code.PhotoSwipe.Util, Code.PhotoSwipe.SliderItemClass); (function(e, a) { Code.PhotoSwipe.CaptionClass = Code.PhotoSwipe.ElementClass.extend({contentEl: null, touchMoveHandler: null, captionValue: null, init: function(b) { this.settings = {position: "top", zIndex: 1E3}; a.extend(this.settings, b); this._super(this.settings); this.captionValue = ""; this.touchMoveHandler = this.onTouchMove.bind(this); b = Code.PhotoSwipe.CaptionClass.CssClasses.caption; this.settings.position === "bottom" && (b = b + " " + Code.PhotoSwipe.CaptionClass.CssClasses.bottom); this.el = a.DOM.createElement("div", {"class": b}, ""); a.DOM.setStyle(this.el, {left: 0, position: "absolute", overflow: "hidden", zIndex: this.settings.zIndex, opacity: 0}); a.DOM.hide(this.el); a.DOM.appendToBody(this.el); this.contentEl = a.DOM.createElement("div", {"class": Code.PhotoSwipe.CaptionClass.CssClasses.content}, ""); a.DOM.appendChild(this.contentEl, this.el) }, addEventListeners: function() { a.browser.touchSupported && a.DOM.addEventListener(this.el, "touchmove", this.touchMoveHandler) }, removeEventListeners: function() { a.browser.touchSupported && a.DOM.removeEventListener(this.el, "touchmove", this.touchMoveHandler) }, onTouchMove: function(a) { a.preventDefault() }, resetPosition: function() { var b; b = this.settings.position === "bottom" ? a.DOM.windowHeight() - a.DOM.outerHeight(this.el) + a.DOM.windowScrollTop() : a.DOM.windowScrollTop(); a.DOM.setStyle(this.el, "top", b + "px"); a.DOM.width(this.el, a.DOM.bodyWidth()) }, setCaptionValue: function(b) { a.DOM.removeChildren(this.contentEl); b = a.coalesce(b, "\u00a0"); a.isObject(b) ? a.DOM.appendChild(b, this.contentEl) : (b === "" && (b = "\u00a0"), a.DOM.appendText(b, this.contentEl)); this.captionValue = b === "\u00a0" ? "" : b }}); Code.PhotoSwipe.CaptionClass.CssClasses = {caption: "ps-caption", bottom: "ps-caption-bottom", content: "ps-caption-content"} })(window, Code.PhotoSwipe.Util); (function(e, a) { Code.PhotoSwipe.ToolbarClass = Code.PhotoSwipe.ElementClass.extend({closeEl: null, previousEl: null, nextEl: null, playEl: null, clickHandler: null, touchStartHandler: null, touchMoveHandler: null, touched: null, isNextActive: null, isPreviousActive: null, init: function(b) { this.settings = {position: "bottom", hideClose: !1, zIndex: 1E3}; a.extend(this.settings, b); this._super(this.settings); this.isPreviousActive = this.isNextActive = !0; this.touched = !1; this.clickHandler = this.onClick.bind(this); if (a.browser.touchSupported) this.touchMoveHandler = this.onTouchMove.bind(this), this.touchStartHandler = this.onTouchStart.bind(this); b = Code.PhotoSwipe.ToolbarClass.CssClasses.caption; this.settings.position === "top" && (b = b + " " + Code.PhotoSwipe.ToolbarClass.CssClasses.top); this.el = a.DOM.createElement("div", {"class": b}, ""); a.DOM.setStyle(this.el, {left: 0, position: "absolute", overflow: "hidden", zIndex: this.settings.zIndex, display: "table", opacity: 0}); a.DOM.hide(this.el); a.DOM.appendToBody(this.el); this.closeEl = a.DOM.createElement("div", {"class": Code.PhotoSwipe.ToolbarClass.CssClasses.close}, '
'); this.settings.hideClose && a.DOM.hide(this.closeEl); a.DOM.appendChild(this.closeEl, this.el); this.playEl = a.DOM.createElement("div", {"class": Code.PhotoSwipe.ToolbarClass.CssClasses.play}, '
'); a.DOM.appendChild(this.playEl, this.el); this.previousEl = a.DOM.createElement("div", {"class": Code.PhotoSwipe.ToolbarClass.CssClasses.previous}, '
'); a.DOM.appendChild(this.previousEl, this.el); this.nextEl = a.DOM.createElement("div", {"class": Code.PhotoSwipe.ToolbarClass.CssClasses.next}, '
'); a.DOM.appendChild(this.nextEl, this.el) }, postFadeIn: function() { this.isHidden || (a.DOM.setStyle(this.el, {display: "table"}), this._super(this.settings)) }, addEventListeners: function() { a.browser.touchSupported && (a.browser.isBlackberry || a.DOM.addEventListener(this.el, "touchstart", this.touchStartHandler), a.DOM.addEventListener(this.el, "touchmove", this.touchMoveHandler)); a.DOM.addEventListener(this.el, "click", this.clickHandler) }, removeEventListeners: function() { a.browser.touchSupported && (a.browser.isBlackberry || a.DOM.removeEventListener(this.el, "touchstart", this.touchStartHandler), a.DOM.removeEventListener(this.el, "touchmove", this.touchMoveHandler)); a.DOM.removeEventListener(this.el, "click", this.clickHandler) }, onTouchStart: function(a) { a.preventDefault(); this.touched = !0; this.handleClick(a) }, onTouchMove: function(a) { a.preventDefault() }, onClick: function(a) { this.touched || this.handleClick(a) }, handleClick: function(b) { var c; switch (b.target.parentNode) { case this.previousEl: if (this.isPreviousActive) c = Code.PhotoSwipe.ToolbarClass.Actions.previous; break; case this.nextEl: if (this.isNextActive) c = Code.PhotoSwipe.ToolbarClass.Actions.next; break; case this.playEl: c = Code.PhotoSwipe.ToolbarClass.Actions.play; break; case this.closeEl: c = Code.PhotoSwipe.ToolbarClass.Actions.close } a.isNothing(c) || this.dispatchEvent({type: Code.PhotoSwipe.ToolbarClass.EventTypes.onClick, target: this, action: c}) }, resetPosition: function() { var b; b = this.settings.position === "bottom" ? a.DOM.windowHeight() - a.DOM.outerHeight(this.el) + a.DOM.windowScrollTop() : a.DOM.windowScrollTop(); a.DOM.setStyle(this.el, "top", b + "px"); a.DOM.width(this.el, a.DOM.bodyWidth()) }, setNextState: function(b) { b ? (a.DOM.addClass(this.nextEl, Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled), this.isNextActive = !1) : (a.DOM.removeClass(this.nextEl, Code.PhotoSwipe.ToolbarClass.CssClasses.nextDisabled), this.isNextActive = !0) }, setPreviousState: function(b) { b ? (a.DOM.addClass(this.previousEl, Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled), this.isPreviousActive = !1) : (a.DOM.removeClass(this.previousEl, Code.PhotoSwipe.ToolbarClass.CssClasses.previousDisabled), this.isPreviousActive = !0) }}); Code.PhotoSwipe.ToolbarClass.CssClasses = {caption: "ps-toolbar", top: "ps-toolbar-top", close: "ps-toolbar-close", previous: "ps-toolbar-previous", previousDisabled: "ps-toolbar-previous-disabled", next: "ps-toolbar-next", nextDisabled: "ps-toolbar-next-disabled", play: "ps-toolbar-play", content: "ps-toolbar-content"}; Code.PhotoSwipe.ToolbarClass.Actions = {close: "close", previous: "previous", next: "next", play: "play"}; Code.PhotoSwipe.ToolbarClass.EventTypes = {onClick: "onClick"} })(window, Code.PhotoSwipe.Util); (function(e, a, b, c) { Code.PhotoSwipe.CaptionToolbarClass = Code.PhotoSwipe.EventClass.extend({toolbar: null, caption: null, isHidden: null, hasAddedEventListeners: null, toolbarClickEventHandler: null, init: function(d) { this._super(); this.settings = {opacity: 0.8, fadeInSpeed: 250, fadeOutSpeed: 500, autoHideDelay: 5E3, flipPosition: !1, showEmptyCaptions: !0, hideClose: !1, zIndex: 1E3}; a.extend(this.settings, d); this.isHidden = !0; this.hasAddedEventListeners = !1; this.toolbarClickEventHandler = this.onToolbarClick.bind(this); this.caption = new b({fadeInSpeed: this.settings.fadeInSpeed, fadeOutSpeed: this.settings.fadeOutSpeed, opacity: this.settings.opacity, position: this.settings.flipPosition ? "bottom" : "top", zIndex: this.settings.zIndex}); this.toolbar = new c({fadeInSpeed: this.settings.fadeInSpeed, fadeOutSpeed: this.settings.fadeOutSpeed, opacity: this.settings.opacity, position: this.settings.flipPosition ? "top" : "bottom", hideClose: this.settings.hideClose, zIndex: this.settings.zIndex + 1}) }, resetPosition: function() { this.caption.resetPosition(); this.toolbar.resetPosition() }, addEventListeners: function() { if (!this.hasAddedEventListeners) this.toolbar.addEventListener(c.EventTypes.onClick, this.toolbarClickEventHandler), this.hasAddedEventListeners = !0 }, removeEventListeners: function() { this.toolbar.removeEventListener(c.EventTypes.onClick, this.toolbarClickEventHandler); this.hasAddedEventListeners = !1 }, fadeIn: function() { this.stopAutoHideTimeout(); this.stopFade(); this.isHidden ? (this.isHidden = !1, this.fadeInCaption(), this.toolbar.fadeIn(), e.setTimeout(this.onFadeIn.bind(this), this.settings.fadeInSpeed)) : (this.caption.isHidden && this.fadeInCaption(), this.resetAutoHideTimeout()) }, showCaption: function() { this.caption.captionValue === "" ? this.settings.showEmptyCaptions && this.caption.show() : this.caption.show() }, fadeInCaption: function() { this.caption.captionValue === "" ? this.settings.showEmptyCaptions && this.caption.fadeIn() : this.caption.fadeIn() }, onFadeIn: function() { this.addEventListeners(); this.resetAutoHideTimeout() }, fadeOut: function() { this.stopAutoHideTimeout(); this.stopFade(); this.isHidden = !0; this.caption.fadeOut(); this.toolbar.fadeOut(); e.setTimeout(this.onFadeOut.bind(this), this.settings.fadeOutSpeed) }, onFadeOut: function() { }, stopFade: function() { this.caption.stopFade(); this.toolbar.stopFade() }, hide: function() { this.stopAutoHideTimeout(); this.stopFade(); this.isHidden = !0; this.removeEventListeners(); this.caption.hide(); this.toolbar.hide() }, setCaptionValue: function(a) { this.caption.setCaptionValue(a); this.caption.captionValue === "" && !this.settings.showEmptyCaptions && this.caption.fadeOut() }, resetAutoHideTimeout: function() { if (!this.isHidden && (this.stopAutoHideTimeout(), this.settings.autoHideDelay > 0)) this.autoHideTimeout = e.setTimeout(this.fadeOut.bind(this), this.settings.autoHideDelay) }, stopAutoHideTimeout: function() { a.isNothing(this.autoHideTimeout) || e.clearTimeout(this.autoHideTimeout) }, onToolbarClick: function(a) { this.dispatchEvent({type: Code.PhotoSwipe.ToolbarClass.EventTypes.onClick, target: this, action: a.action}) }, setNextState: function(a) { this.toolbar.setNextState(a) }, setPreviousState: function(a) { this.toolbar.setPreviousState(a) }}) })(window, Code.PhotoSwipe.Util, Code.PhotoSwipe.CaptionClass, Code.PhotoSwipe.ToolbarClass); (function(e, a) { Code.PhotoSwipe.ZoomPanRotateClass = Code.PhotoSwipe.ElementClass.extend({containerEl: null, imageEl: null, parentEl: null, transformSettings: null, panStartingPoint: null, init: function(b, c, d) { this.settings = {maxZoom: 5, minZoom: 0.5, adjustPanToZoom: !0}; a.extend(this.settings, b); this._super(b); this.parentEl = c; this.imageEl = d.cloneNode(!1); this.transformSettings = {startingScale: 1, scale: 1, startingRotation: 0, rotation: 0, startingTranslateX: 0, startingTranslateY: 0, translateX: 0, translateY: 0}; this.el = a.DOM.createElement("div", {"class": Code.PhotoSwipe.ZoomPanRotateClass.CssClasses.documentOverlay}, ""); a.DOM.setStyle(this.el, {left: 0, top: 0, position: "absolute"}); a.DOM.width(this.el, a.DOM.bodyWidth()); a.DOM.height(this.el, a.DOM.windowHeight()); this.containerEl = a.DOM.createElement("div"); a.DOM.setStyle(this.containerEl, {left: 0, top: 0, position: "absolute"}); a.DOM.width(this.containerEl, a.DOM.bodyWidth()); a.DOM.height(this.containerEl, a.DOM.windowHeight()); a.DOM.appendChild(this.imageEl, this.containerEl); a.DOM.appendChild(this.containerEl, this.el); a.DOM.appendChild(this.el, this.parentEl) }, setStartingTranslateFromCurrentTranform: function() { var b = this.containerEl.style.webkitTransform.match(/translate\((.*?)\)/); if (!a.isNothing(b)) b = b[1].split(", "), this.transformSettings.startingTranslateX = e.parseInt(b[0]), this.transformSettings.startingTranslateY = e.parseInt(b[1]) }, setStartingScaleAndRotation: function(a, c) { var d = this.transformSettings.startingScale * a; if (this.settings.minZoom !== 0 && d < this.settings.minZoom) d = this.settings.minZoom; else if (this.settings.maxZoom !== 0 && d > this.settings.maxZoom) d = this.settings.maxZoom; this.transformSettings.startingScale = d; this.transformSettings.startingRotation = (this.transformSettings.startingRotation + c) % 360 }, zoomRotate: function(a, c) { var d = this.transformSettings.startingScale * a; if (this.settings.minZoom !== 0 && d < this.settings.minZoom) d = this.settings.minZoom; else if (this.settings.maxZoom !== 0 && d > this.settings.maxZoom) d = this.settings.maxZoom; this.transformSettings.scale = d; this.transformSettings.rotation = this.transformSettings.startingRotation + c; this.applyTransform() }, panStart: function(a) { this.setStartingTranslateFromCurrentTranform(); this.panStartingPoint = {x: a.x, y: a.y} }, pan: function(a) { var c = a.x - this.panStartingPoint.x, a = a.y - this.panStartingPoint.y, a = a / this.transformSettings.scale ? a / this.transformSettings.scale : a; this.transformSettings.translateX = this.transformSettings.startingTranslateX + (this.settings.adjustPanToZoom ? c / this.transformSettings.scale : c); this.transformSettings.translateY = this.transformSettings.startingTranslateY + a; this.applyTransform() }, applyTransform: function() { this.containerEl.style.webkitTransform = "scale(" + this.transformSettings.scale + ") rotate(" + this.transformSettings.rotation % 360 + "deg) translate(" + this.transformSettings.translateX + "px, " + this.transformSettings.translateY + "px)" }, removeFromDOM: function() { a.DOM.removeChild(this.el, this.parentEl) }}); Code.PhotoSwipe.ZoomPanRotateClass.CssClasses = {documentOverlay: "ps-zoom-pan-rotate"} })(window, Code.PhotoSwipe.Util); (function(e, a, b, c, d, f, g, h, i, j, k) { h = Code.PhotoSwipe.EventClass.extend({fullSizeImages: null, documentOverlay: null, viewport: null, slider: null, captionAndToolbar: null, zoomPanRotate: null, settings: null, currentIndex: null, isBusy: null, isActive: null, currentHistoryHashValue: null, isBackEventSupported: null, slideshowTimeout: null, isSlideshowActive: null, lastShowPrevTrigger: null, backButtonClicked: null, viewportFadeInEventHandler: null, windowOrientationChangeEventHandler: null, windowScrollEventHandler: null, windowHashChangeHandler: null, keyDownEventHandler: null, viewportTouchEventHandler: null, viewportFadeOutEventHandler: null, sliderDisplayCurrentFullSizeImageEventHandler: null, toolbarClickEventHandler: null, orientationEventName: null, init: function() { this._super(); this.currentIndex = 0; this.backButtonClicked = this.isSlideshowActive = this.isActive = this.isBusy = !1; this.settings = {getImageSource: Code.PhotoSwipe.GetImageSource, getImageCaption: Code.PhotoSwipe.GetImageCaption, getImageMetaData: Code.PhotoSwipe.GetImageMetaData, fadeInSpeed: 250, fadeOutSpeed: 500, slideSpeed: 250, swipeThreshold: 50, swipeTimeThreshold: 250, loop: !0, slideshowDelay: 3E3, imageScaleMethod: "fit", preventHide: !1, zIndex: 1E3, backButtonHideEnabled: !0, jQueryMobile: !a.isNothing(e.jQuery) && !a.isNothing(e.jQuery.mobile), jQueryMobileDialogHash: "&ui-state=dialog", allowUserZoom: !0, allowRotationOnUserZoom: !0, maxUserZoom: 5, minUserZoom: 0.5, adjustUserPanToZoom: !0, captionAndToolbarHide: !1, captionAndToolbarHideOnSwipe: !0, captionAndToolbarFlipPosition: !1, captionAndToolbarAutoHideDelay: 5E3, captionAndToolbarOpacity: 0.8, captionAndToolbarShowEmptyCaptions: !0}; if (a.browser.isAndroid && navigator.userAgent.indexOf("2.1")) this.isBackEventSupported = !0; if (!this.isBackEventSupported) this.isBackEventSupported = "onhashchange"in e; if (this.settings.preventHide) this.settings.backButtonHideEnabled = !1; this.viewportFadeInEventHandler = this.onViewportFadeIn.bind(this); this.windowOrientationChangeEventHandler = this.onWindowOrientationChange.bind(this); this.windowScrollEventHandler = this.onWindowScroll.bind(this); this.windowHashChangeHandler = this.onWindowHashChange.bind(this); this.keyDownEventHandler = this.onKeyDown.bind(this); this.viewportTouchEventHandler = this.onViewportTouch.bind(this); this.viewportFadeOutEventHandler = this.onViewportFadeOut.bind(this); this.sliderDisplayCurrentFullSizeImageEventHandler = this.onSliderDisplayCurrentFullSizeImage.bind(this); this.toolbarClickEventHandler = this.onToolbarClick.bind(this) }, setOptions: function(b) { a.extend(this.settings, b); if (this.settings.preventHide) this.settings.backButtonHideEnabled = !1 }, setImages: function(b) { if (!a.isArray) throw"thumbEls is not an array"; this.currentIndex = 0; this.fullSizeImages = []; for (var c = 0; c < b.length; c++) { var e = b[c]; this.fullSizeImages.push(new d(c, this.settings.imageScaleMethod, this.settings.getImageSource(e), this.settings.getImageCaption(e), this.settings.getImageMetaData(e))) } }, show: function(c) { if (!this.isBusy && !this.isActive) { if (!a.isNumber(c)) throw"startingIndex must be a number"; if (a.isNothing(this.fullSizeImages)) throw"need to set images before showing the gallery"; this.backButtonClicked = !1; this.isBusy = this.isActive = !0; this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.show; a.DOM.addClass(document.body, Code.PhotoSwipe.CssClasses.activeBody); c = e.parseInt(c); if (c < 0 || c >= this.fullSizeImages.length) c = 0; this.currentIndex = c; a.isNothing(this.documentOverlay) ? this.build() : this.resetPosition(); this.viewport.addEventListener(b.EventTypes.onFadeIn, this.viewportFadeInEventHandler); this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeShow); this.viewport.fadeIn() } }, build: function() { this.documentOverlay = new c({fadeInSpeed: this.settings.fadeInSpeed, fadeOutSpeed: this.settings.fadeOutSpeed, zIndex: this.settings.zIndex}); this.viewport = new f({fadeInSpeed: this.settings.fadeInSpeed, fadeOutSpeed: this.settings.fadeOutSpeed, swipeThreshold: this.settings.swipeThreshold, swipeTimeThreshold: this.settings.swipeTimeThreshold, zIndex: this.settings.zIndex + 1}); this.slider = new g({fadeInSpeed: this.settings.fadeInSpeed, fadeOutSpeed: this.settings.fadeOutSpeed, slideSpeed: this.settings.slideSpeed}, this.viewport.el); this.captionAndToolbar = new j({opacity: this.settings.captionAndToolbarOpacity, fadeInSpeed: this.settings.fadeInSpeed, fadeOutSpeed: this.settings.fadeOutSpeed, autoHideDelay: this.settings.captionAndToolbarAutoHideDelay, flipPosition: this.settings.captionAndToolbarFlipPosition, showEmptyCaptions: this.settings.captionAndToolbarShowEmptyCaptions, hideClose: this.settings.preventHide, zIndex: this.settings.zIndex + 3}); this.resetPosition() }, addEventListeners: function() { this.orientationEventName = a.browser.isAndroid ? "resize" : "onorientationchange"in e ? "orientationchange" : "resize"; a.DOM.addEventListener(e, this.orientationEventName, this.windowOrientationChangeEventHandler); a.DOM.addEventListener(e, "scroll", this.windowScrollEventHandler); if (this.isBackEventSupported && this.settings.backButtonHideEnabled) this.settings.jQueryMobile ? e.location.hash = this.settings.jQueryMobileDialogHash : (this.currentHistoryHashValue = "PhotoSwipe" + (new Date).getTime().toString(), e.location.hash = this.currentHistoryHashValue), a.DOM.addEventListener(e, "hashchange", this.windowHashChangeHandler); a.DOM.addEventListener(document, "keydown", this.keyDownEventHandler); this.viewport.addEventListener(f.EventTypes.onTouch, this.viewportTouchEventHandler); this.slider.addEventListener(g.EventTypes.onDisplayCurrentFullSizeImage, this.sliderDisplayCurrentFullSizeImageEventHandler); this.captionAndToolbar.addEventListener(i.EventTypes.onClick, this.toolbarClickEventHandler) }, removeEventListeners: function() { a.DOM.removeEventListener(e, this.orientationEventName, this.windowOrientationChangeEventHandler); a.DOM.removeEventListener(e, "scroll", this.windowScrollEventHandler); this.isBackEventSupported && this.settings.backButtonHideEnabled && a.DOM.removeEventListener(e, "hashchange", this.windowHashChangeHandler); a.DOM.removeEventListener(document, "keydown", this.keyDownEventHandler); this.viewport.removeEventListener(f.EventTypes.onTouch, this.viewportTouchEventHandler); this.slider.removeEventListener(g.EventTypes.onDisplayCurrentFullSizeImage, this.sliderDisplayCurrentFullSizeImageEventHandler); this.captionAndToolbar.removeEventListener(i.EventTypes.onClick, this.toolbarClickEventHandler) }, onViewportFadeIn: function() { this.viewport.removeEventListener(b.EventTypes.onFadeIn, this.viewportFadeInEventHandler); this.documentOverlay.show(); this.slider.fadeIn(); this.addEventListeners(); this.slider.setCurrentFullSizeImage(this.fullSizeImages[this.currentIndex]); this.isBusy = !1; this.dispatchEvent(Code.PhotoSwipe.EventTypes.onShow) }, setSliderPreviousAndNextFullSizeImages: function() { var a, b = null, c = null; this.fullSizeImages.length > 1 && (a = this.fullSizeImages.length - 1, this.currentIndex === a ? (this.settings.loop && (c = this.fullSizeImages[0]), b = this.fullSizeImages[this.currentIndex - 1]) : this.currentIndex === 0 ? (c = this.fullSizeImages[this.currentIndex + 1], this.settings.loop && (b = this.fullSizeImages[a])) : (c = this.fullSizeImages[this.currentIndex + 1], b = this.fullSizeImages[this.currentIndex - 1])); this.slider.setPreviousAndNextFullSizeImages(b, c) }, onKeyDown: function(a) { this.stopSlideshow(); a.keyCode === 37 ? (a.preventDefault(), this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.keyboard, this.showPrevious()) : a.keyCode === 39 ? (a.preventDefault(), this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.keyboard, this.showNext()) : a.keyCode === 38 || a.keyCode === 40 ? a.preventDefault() : a.keyCode === 27 ? (a.preventDefault(), this.hide()) : a.keyCode === 32 && (this.settings.hideToolbar ? this.hide() : this.toggleCaptionAndToolbar(), a.preventDefault()) }, onWindowOrientationChange: function() { this.resetPosition() }, onWindowScroll: function() { this.resetPosition() }, onWindowHashChange: function() { if (e.location.hash !== "#" + (this.settings.jQueryMobile ? this.settings.jQueryMobileDialogHash : this.currentHistoryHashValue)) this.backButtonClicked = !0, this.hide() }, resetPosition: function() { this.removeZoomPanRotate(); this.viewport.resetPosition(); this.slider.resetPosition(); this.documentOverlay.resetPosition(); this.captionAndToolbar.resetPosition(); this.dispatchEvent(Code.PhotoSwipe.EventTypes.onResetPosition) }, canUserZoom: function() { if (!this.settings.allowUserZoom) return!1; if (this.isBusy) return!1; if (a.isNothing(this.slider.currentItem.fullSizeImage)) return!1; if (!this.slider.currentItem.fullSizeImage.hasLoaded) return!1; return!0 }, isZoomActive: function() { return!a.isNothing(this.zoomPanRotate) }, onViewportTouch: function(b) { switch (b.action) { case f.Actions.gestureStart: if (this.canUserZoom()) { this.stopSlideshow(); if (!this.isZoomActive()) this.zoomPanRotate = new k({maxZoom: this.settings.maxUserZoom, minZoom: this.settings.minUserZoom, adjustPanToZoom: this.settings.adjustUserPanToZoom}, this.viewport.el, this.slider.currentItem.imageEl), a.DOM.resetTranslate(this.zoomPanRotate.containerEl), a.DOM.resetTranslate(this.zoomPanRotate.imageEl); this.fadeOutCaptionAndToolbar() } break; case f.Actions.gestureChange: this.isZoomActive() && this.zoomPanRotate.zoomRotate(b.scale, this.settings.allowRotationOnUserZoom ? b.rotation : 0); break; case f.Actions.gestureEnd: this.isZoomActive() && this.zoomPanRotate.setStartingScaleAndRotation(b.scale, this.settings.allowRotationOnUserZoom ? b.rotation : 0); break; case f.Actions.touchStart: this.stopSlideshow(); this.isZoomActive() && this.zoomPanRotate.panStart(b.point); break; case f.Actions.touchMove: this.isZoomActive() && this.zoomPanRotate.pan(b.point); break; case f.Actions.click: this.stopSlideshow(); this.settings.hideToolbar ? this.hide() : this.toggleCaptionAndToolbar(); this.dispatchEvent(Code.PhotoSwipe.EventTypes.onViewportClick); break; case f.Actions.swipeLeft: this.stopSlideshow(); this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.swipe; this.showNext(); break; case f.Actions.swipeRight: this.stopSlideshow(), this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.swipe, this.showPrevious() } }, onViewportFadeOut: function() { this.viewport.removeEventListener(b.EventTypes.onFadeOut, this.viewportFadeOutEventHandler); this.isActive = this.isBusy = !1; this.dispatchEvent(Code.PhotoSwipe.EventTypes.onHide); this.goBackInHistory() }, hide: function() { if (!this.isBusy && !this.settings.preventHide && this.isActive) this.isBusy = !0, this.removeZoomPanRotate(), this.removeEventListeners(), this.documentOverlay.hide(), this.captionAndToolbar.hide(), this.slider.hide(), a.DOM.removeClass(document.body, Code.PhotoSwipe.CssClasses.activeBody), this.viewport.addEventListener(b.EventTypes.onFadeOut, this.viewportFadeOutEventHandler), this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeHide), this.viewport.fadeOut() }, hideImmediately: function() { if (this.isActive) this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeHide), this.removeZoomPanRotate(), this.removeEventListeners(), this.documentOverlay.hide(), this.captionAndToolbar.hide(), this.slider.hide(), this.viewport.hide(), a.DOM.removeClass(document.body, Code.PhotoSwipe.CssClasses.activeBody), this.isActive = this.isBusy = !1, this.dispatchEvent(Code.PhotoSwipe.EventTypes.onHide), this.goBackInHistory() }, goBackInHistory: function() { this.isBackEventSupported && this.settings.backButtonHideEnabled && (this.backButtonClicked || e.history.back()) }, showNext: function() { if (!this.isBusy) this.isBusy = !0, this.cleanUpZoomPanRotateForNextPrevious(), this.setCaptionAndToolbarOnShowPreviousNext(), this.slider.showNext(), this.dispatchEvent(Code.PhotoSwipe.EventTypes.onShowNext) }, showPrevious: function() { if (!this.isBusy) this.isBusy = !0, this.cleanUpZoomPanRotateForNextPrevious(), this.setCaptionAndToolbarOnShowPreviousNext(), this.wasUserZoomActive && a.DOM.hide(this.slider.currentItem.imageEl), this.slider.showPrevious(), this.dispatchEvent(Code.PhotoSwipe.EventTypes.onShowPrevious) }, cleanUpZoomPanRotateForNextPrevious: function() { a.isNothing(this.zoomPanRotate) || (this.settings.loop ? a.DOM.hide(this.slider.currentItem.imageEl) : this.currentIndex > 0 && this.currentIndex < this.fullSizeImages.length - 2 && a.DOM.hide(this.slider.currentItem.imageEl)); this.removeZoomPanRotate() }, setCaptionAndToolbarOnShowPreviousNext: function() { if (!this.settings.captionAndToolbarHide) { var a = !1; switch (this.lastShowPrevTrigger) { case Code.PhotoSwipe.ShowPrevTriggers.toolbar: a = !0; break; case Code.PhotoSwipe.ShowPrevTriggers.slideshow: a = !1; break; default: a = !this.settings.captionAndToolbarHideOnSwipe } a ? this.captionAndToolbar.resetAutoHideTimeout() : this.fadeOutCaptionAndToolbar() } }, onSliderDisplayCurrentFullSizeImage: function(a) { this.currentIndex = a.fullSizeImage.index; if (!this.settings.captionAndToolbarHide) { this.settings.loop ? (this.captionAndToolbar.setNextState(!1), this.captionAndToolbar.setPreviousState(!1)) : (this.currentIndex >= this.fullSizeImages.length - 1 ? this.captionAndToolbar.setNextState(!0) : this.captionAndToolbar.setNextState(!1), this.currentIndex < 1 ? this.captionAndToolbar.setPreviousState(!0) : this.captionAndToolbar.setPreviousState(!1)); this.captionAndToolbar.setCaptionValue(this.fullSizeImages[this.currentIndex].caption); a = !1; switch (this.lastShowPrevTrigger) { case Code.PhotoSwipe.ShowPrevTriggers.toolbar: a = !0; break; case Code.PhotoSwipe.ShowPrevTriggers.show: a = !0; break; case Code.PhotoSwipe.ShowPrevTriggers.slideshow: a = !1; break; default: a = !this.settings.captionAndToolbarHideOnSwipe } a && (this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarShow), this.captionAndToolbar.fadeIn()); this.dispatchEvent(Code.PhotoSwipe.EventTypes.onDisplayImage) } this.lastShowPrevTrigger = ""; this.setSliderPreviousAndNextFullSizeImages(); this.isSlideshowActive && this.fireSlideshowTimeout(); this.isBusy = !1 }, toggleCaptionAndToolbar: function() { this.settings.captionAndToolbarHide ? this.captionAndToolbar.hide() : this.captionAndToolbar.isHidden ? (this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarShow), this.captionAndToolbar.fadeIn()) : (this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarHide), this.captionAndToolbar.fadeOut()) }, fadeOutCaptionAndToolbar: function() { !this.settings.captionAndToolbarHide && !this.captionAndToolbar.isHidden && (this.dispatchEvent(Code.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarHide), this.captionAndToolbar.fadeOut()) }, onToolbarClick: function(a) { this.stopSlideshow(); switch (a.action) { case i.Actions.previous: this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.toolbar; this.showPrevious(); break; case i.Actions.next: this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.toolbar; this.showNext(); break; case i.Actions.play: this.startSlideshow(); break; default: this.hide() } }, startSlideshow: function() { if (!this.isBusy) a.isNothing(this.slideshowTimeout) || e.clearTimeout(this.slideshowTimeout), this.removeZoomPanRotate(), this.isSlideshowActive = !0, this.fadeOutCaptionAndToolbar(), this.fireSlideshowTimeout(), this.dispatchEvent(Code.PhotoSwipe.EventTypes.onSlideshowStart) }, stopSlideshow: function() { a.isNothing(this.slideshowTimeout) || e.clearTimeout(this.slideshowTimeout); this.isSlideshowActive = !1; this.dispatchEvent(Code.PhotoSwipe.EventTypes.onSlideshowStop) }, fireSlideshowTimeout: function() { var a = !1; this.settings.loop ? this.fullSizeImages.length > 1 && (a = !0) : this.currentIndex < this.fullSizeImages.length - 1 && (a = !0); if (a) this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.slideshow, this.slideshowTimeout = e.setTimeout(this.showNext.bind(this), this.settings.slideshowDelay) }, removeZoomPanRotate: function() { if (!a.isNothing(this.zoomPanRotate)) this.zoomPanRotate.removeFromDOM(), this.zoomPanRotate = null }}); Code.PhotoSwipe.CssClasses = {activeBody: "ps-active"}; Code.PhotoSwipe.ShowPrevTriggers = {show: "show", toolbar: "toobar", swipe: "swipe", keyboard: "keyboard", slideshow: "slideshow"}; Code.PhotoSwipe.EventTypes = {onBeforeShow: "onBeforeShow", onShow: "onShow", onBeforeHide: "onBeforeHide", onHide: "onHide", onShowNext: "onShowNext", onShowPrevious: "onShowPrevious", onDisplayImage: "onDisplayImage", onResetPosition: "onResetPosition", onSlideshowStart: "onSlideshowStart", onSlideshowStop: "onSlideshowStop", onBeforeCaptionAndToolbarShow: "onBeforeCaptionAndToolbarShow", onBeforeCaptionAndToolbarHide: "onBeforeCaptionAndToolbarHide", onViewportClick: "onViewportClick"}; Code.PhotoSwipe.GetImageSource = function(a) { return a.href }; Code.PhotoSwipe.GetImageCaption = function(b) { if (b.nodeName === "IMG") return a.DOM.getAttribute(b, "alt"); var c, d; for (c = 0; c < b.childNodes.length; c++) if (d = b.childNodes[c], b.childNodes[c].nodeName === "IMG") return a.DOM.getAttribute(d, "alt") }; Code.PhotoSwipe.GetImageMetaData = function() { return{} }; Code.PhotoSwipe.Current = new h; Code.photoSwipe = function(b, c, d) { var e = !0; if (!a.isNothing(b)) { if (a.isNothing(c)) c = document.documentElement, e = !1; a.isString(c) && (c = document.documentElement.querySelector(c)); if (a.isNothing(c)) throw"Unable to find container element"; a.isString(b) && (b = c.querySelectorAll(b)); if (!a.isNothing(b)) { var f = function(a) { a.preventDefault(); g(a.currentTarget) }, g = function(a) { var c; for (c = 0; c < b.length; c++) if (b[c] === a) break; Code.PhotoSwipe.Current.show(c) }; Code.PhotoSwipe.Current.setOptions(d); Code.PhotoSwipe.Current.setImages(b); if (e) c.addEventListener("click", function(c) { if (c.target !== c.currentTarget) { c.preventDefault(); var d = function(b, c, e) { if (a.isNothing(b) || a.isNothing(c) || a.isNothing(e)) return null; if (b.nodeName === c) return b; if (b === e) return null; return d(b.parentNode, c, e) }, c = d(c.target, b[0].nodeName, c.currentTarget); a.isNothing(c) || g(c) } }, !1); else for (c = 0; c < b.length; c++) b[c].addEventListener("click", f, !1); return b } } }; if (!a.isNothing(e.jQuery)) e.jQuery.fn.photoSwipe = function(a) { var b = this; Code.PhotoSwipe.Current.setOptions(a); Code.PhotoSwipe.Current.setImages(b); $(b).live("click", function(a) { a.preventDefault(); a = $(b).index($(a.currentTarget)); Code.PhotoSwipe.Current.show(a) }) } })(window, Code.PhotoSwipe.Util, Code.PhotoSwipe.ElementClass, Code.PhotoSwipe.DocumentOverlayClass, Code.PhotoSwipe.FullSizeImageClass, Code.PhotoSwipe.ViewportClass, Code.PhotoSwipe.SliderClass, Code.PhotoSwipe.CaptionClass, Code.PhotoSwipe.ToolbarClass, Code.PhotoSwipe.CaptionToolbarClass, Code.PhotoSwipe.ZoomPanRotateClass);