├── pswp
├── .placeholder
├── default-skin
│ ├── preloader.gif
│ ├── default-skin.png
│ ├── plugin.css
│ ├── default-skin.svg
│ └── default-skin.css
├── pswp.html
├── photoswipe.css
├── pswp.min.js
├── photoswipe-ui-default.min.js
└── photoswipe.min.js
├── src
├── .placeholder
└── pswp.js
├── custom
├── .placeholder
└── default-skin
│ └── .placeholder
├── .gitignore
├── plugin.json
├── README.md
└── plugin.php
/pswp/.placeholder:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/.placeholder:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/custom/.placeholder:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/custom/default-skin/.placeholder:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | custom/*.js
2 | custom/*.css
3 | custom/*.png
4 | custom/*.svg
5 | custom/*.gif
6 |
--------------------------------------------------------------------------------
/pswp/default-skin/preloader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanielMuller/koken-plugin-photoswipe/HEAD/pswp/default-skin/preloader.gif
--------------------------------------------------------------------------------
/pswp/default-skin/default-skin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DanielMuller/koken-plugin-photoswipe/HEAD/pswp/default-skin/default-skin.png
--------------------------------------------------------------------------------
/pswp/default-skin/plugin.css:
--------------------------------------------------------------------------------
1 | .pswp {
2 | text-align:left;
3 | }
4 | a.pswp__share--gplus:hover {
5 | background: #D73D32;
6 | color: #FFF;
7 | }
8 | a.pswp__share--tumblr:hover {
9 | background: #2c4762;
10 | color: #FFF;
11 | }
12 | .kicon-heart:before {
13 | content: '\e805';
14 | font-family: 'kicons';
15 | font-style: normal;
16 | font-weight: 400;
17 | }
18 | .icon-large:before {
19 | vertical-align:-10%;
20 | font-size:1.5em;
21 | }
22 | .pswp__button--rating, .pswp__button--rating:hover {
23 | background:none;
24 | color:#fff;
25 | }
26 | .koken-rating::after {
27 | content: attr(data-count);
28 | }
29 |
--------------------------------------------------------------------------------
/pswp/default-skin/default-skin.svg:
--------------------------------------------------------------------------------
1 | default-skin 2
--------------------------------------------------------------------------------
/pswp/pswp.html:
--------------------------------------------------------------------------------
1 |
38 |
--------------------------------------------------------------------------------
/plugin.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PhotoSwipe",
3 | "version": "1.7.10",
4 | "description": "Replaces default Lightbox with Photoswipe (http://photoswipe.com)",
5 | "author": {
6 | "name": "Daniel Muller",
7 | "link": "http://daniel.ctrlaltdel.ch"
8 | },
9 | "data": {
10 | "share": {
11 | "label": "Sharing",
12 | "info": "Choose allowed sharing possibilites",
13 | "type": "placeholder"
14 | },
15 | "share_facebook": {
16 | "label": "Facebook",
17 | "type": "boolean",
18 | "value": true
19 | },
20 | "share_twitter": {
21 | "label": "Twitter",
22 | "type": "boolean",
23 | "value": true
24 | },
25 | "share_pinterest": {
26 | "label": "Pinterest",
27 | "type": "boolean",
28 | "value": true
29 | },
30 | "share_gplus": {
31 | "label": "Google+",
32 | "type": "boolean",
33 | "value": true
34 | },
35 | "share_tumblr": {
36 | "label": "Tumblr",
37 | "type": "boolean",
38 | "value": false
39 | },
40 | "share_download": {
41 | "label": "Download",
42 | "type": "boolean",
43 | "value": false
44 | },
45 | "localization": {
46 | "label": "Localization settings",
47 | "info": "some localization strings",
48 | "type": "placeholder"
49 | },
50 | "view_in_lightbox": {
51 | "label": "View in lightbox string",
52 | "info": "View in lightbox string",
53 | "type": "string"
54 | },
55 | "behaviors": {
56 | "label": "Behaviors",
57 | "info": "Choose some behaviors",
58 | "type": "placeholder"
59 | },
60 | "show_title": {
61 | "label": "Display caption",
62 | "type": "boolean",
63 | "value": false
64 | },
65 | "download_full": {
66 | "label": "Download biggest size",
67 | "info": "Download current size or biggest size",
68 | "type": "boolean",
69 | "value": false
70 | },
71 | "using_pjax_without_pillar": {
72 | "label": "Using pjax without pillar",
73 | "info": "Using pjax without pillar needs to disable the automatic pillar hacks (for example, list layout on Madison2 requires this flag enabled)",
74 | "type": "boolean",
75 | "value": false
76 | },
77 | "trigger_el": {
78 | "label": "Trigger Element",
79 | "info": "jQuery Element that triggers Photoswipe. Needs to be the parent of the img tag. Leave empty to use the default based on current theme. Example for Axis: a.k-link-lightbox",
80 | "type": "string"
81 | },
82 | "scroll_el": {
83 | "label": "Scroll Trigger Element",
84 | "info": "jQuery Element that triggers Koken's keyboard scroll. Leave empty to use the default based on current theme.",
85 | "type": "string"
86 | },
87 | "max_size": {
88 | "label": "Max Image Size",
89 | "type": "slider",
90 | "min": 750,
91 | "max": 2050,
92 | "step": 50,
93 | "value": 2048,
94 | "suffix": "px"
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Koken Photoswipe Plugin
2 | =======================
3 | Disclaimer
4 | -----------------
5 | This repo is now archieved.
6 |
7 | I am no longer a user of [Koken](http://koken.me/) and have migrated my Gallery to [Yapawa](https://yapawa.net/), a gallery site that I developped.
8 |
9 | Thank you Koken Team for your awesome tool that allowed me to host my pictures during many years.
10 |
11 | ---
12 |
13 | Usage limitations
14 | -----------------
15 | - This plugin is originally developped for the Axis Theme (version 1). On other Themes, the result can be totally unpredictable.
16 | It makes only sense on pages with a thumnail-grid layout and with the ability to link the images to Lightbox (lens templates using ` `).
17 | - ` ` lens tags must not have a fixed preset. The plugin is expecting the *data-presets* attribute to get all avalaible sizes.
18 | - Support for Themes other than Axis was added in V1.2.
19 | - Since V1.3, the plugin now works on any page, as long as the DOM is structured as expected.
20 | - Major improvements since V1.5 to support Pillar based themes (V2 Themes).
21 |
22 | Demo
23 | ----
24 | Check out http://daniel.mesphotos.ch to see it in action
25 |
26 | Installation
27 | ------------
28 | [Photoswipe](https://github.com/dimsemenov/photoswipe) files are included as static inside the *vendor* folder.
29 | To install, execute on the server (or locally and copy to the server):
30 | ```bash
31 | git clone https://github.com/DanielMuller/koken-plugin-photoswipe.git path/to/koken/storage/plugins/photoswipe
32 | ```
33 |
34 | Enable plugin in Settings/Plugins.
35 |
36 | Configuration
37 | -------------
38 | You can choose which sharing services are available.
39 |
40 | You can define which DOM Elements will trigger Photoswipe. by leaving the option empty, the default element for the current Theme is used.
41 |
42 | It advised to clear *System Caches* after inabling it.
43 |
44 | Layout
45 | ------
46 | By default, the default layout from Photoswipe is used:
47 | - pswp/photoswipe.css
48 | - pswp/default-skin/default-skin.css
49 | - pswp/photoswipe.min.js
50 | - pswp/photoswipe-ui-default.min.js
51 | - pswp.min.js
52 |
53 | You can replace any of this files, by creating a file with same name inside the `custom` folder:
54 | - custom/photoswipe.css
55 | - custom/default-skin/default-skin.css
56 | - custom/photoswipe.min.js
57 | - custom/photoswipe-ui-default.min.js
58 | - custom/pswp.min.js
59 |
60 | Uglifier
61 | --------
62 | Javascript compression can be done using uglify-js, a node.js library.
63 | An easy way to install it under Debian/Ubuntu:
64 | `apt-get install node-uglify`
65 |
66 | And uglify the file by running:
67 | `uglifyjs src/pswp.js > pswp/pswp.min.js`
68 |
69 | Title/Caption
70 | -------------
71 |
72 | You can enable/disable the usage of the image title/caption in the lightbox in
73 | the plugin setup.
74 |
75 | The image title will be used from the `alt` image attribute.
76 |
77 | If you want to add the caption or additional information to the image title
78 | you've to add a html element to the template.
79 |
80 | Simple caption:
81 |
82 |
83 |
84 | {{ content.caption }}
85 |
86 |
87 | Complex caption using the timestamp and exif data:
88 |
89 |
90 |
91 |
92 |
93 | |
94 |
95 |
96 | {{ exif.make }},
97 |
98 |
99 | {{ exif.model }},
100 |
101 |
102 | {{ exif.exposure }},
103 |
104 |
105 | {{ exif.aperture }},
106 |
107 |
108 | {{ exif.focal_length }},
109 |
110 |
111 | {{ exif.iso_speed_ratings }}
112 |
113 |
114 |
115 |
116 |
117 |
118 | Todo
119 | ----
120 | - Ajax/PHP calls for image details
121 |
122 | Credits
123 | -------
124 | All the heavy lifting is done using [Photoswipe](http://photoswipe.com) by [Code computerlove](http://www.codecomputerlove.com/) and [Dmitry Semenov](http://dimsemenov.com/).
125 | This plugin just integrates the relevant code into [Koken](http://koken.me/).
126 | The version used in this plugin is [2572d...](https://github.com/dimsemenov/PhotoSwipe/tree/2572dbd4987938e9e71c64eaffd634aaf658082f)
127 |
--------------------------------------------------------------------------------
/pswp/photoswipe.css:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */
2 | /*
3 | Styles for basic PhotoSwipe functionality (sliding area, open/close transitions)
4 | */
5 | /* pswp = photoswipe */
6 | .pswp {
7 | display: none;
8 | position: absolute;
9 | width: 100%;
10 | height: 100%;
11 | left: 0;
12 | top: 0;
13 | overflow: hidden;
14 | -ms-touch-action: none;
15 | touch-action: none;
16 | z-index: 1500;
17 | -webkit-text-size-adjust: 100%;
18 | /* create separate layer, to avoid paint on window.onscroll in webkit/blink */
19 | -webkit-backface-visibility: hidden;
20 | outline: none; }
21 | .pswp * {
22 | -webkit-box-sizing: border-box;
23 | box-sizing: border-box; }
24 | .pswp img {
25 | max-width: none; }
26 |
27 | /* style is added when JS option showHideOpacity is set to true */
28 | .pswp--animate_opacity {
29 | /* 0.001, because opacity:0 doesn't trigger Paint action, which causes lag at start of transition */
30 | opacity: 0.001;
31 | will-change: opacity;
32 | /* for open/close transition */
33 | -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
34 | transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
35 |
36 | .pswp--open {
37 | display: block; }
38 |
39 | .pswp--zoom-allowed .pswp__img {
40 | /* autoprefixer: off */
41 | cursor: -webkit-zoom-in;
42 | cursor: -moz-zoom-in;
43 | cursor: zoom-in; }
44 |
45 | .pswp--zoomed-in .pswp__img {
46 | /* autoprefixer: off */
47 | cursor: -webkit-grab;
48 | cursor: -moz-grab;
49 | cursor: grab; }
50 |
51 | .pswp--dragging .pswp__img {
52 | /* autoprefixer: off */
53 | cursor: -webkit-grabbing;
54 | cursor: -moz-grabbing;
55 | cursor: grabbing; }
56 |
57 | /*
58 | Background is added as a separate element.
59 | As animating opacity is much faster than animating rgba() background-color.
60 | */
61 | .pswp__bg {
62 | position: absolute;
63 | left: 0;
64 | top: 0;
65 | width: 100%;
66 | height: 100%;
67 | background: #000;
68 | opacity: 0;
69 | -webkit-transform: translateZ(0);
70 | transform: translateZ(0);
71 | -webkit-backface-visibility: hidden;
72 | will-change: opacity; }
73 |
74 | .pswp__scroll-wrap {
75 | position: absolute;
76 | left: 0;
77 | top: 0;
78 | width: 100%;
79 | height: 100%;
80 | overflow: hidden; }
81 |
82 | .pswp__container,
83 | .pswp__zoom-wrap {
84 | -ms-touch-action: none;
85 | touch-action: none;
86 | position: absolute;
87 | left: 0;
88 | right: 0;
89 | top: 0;
90 | bottom: 0; }
91 |
92 | /* Prevent selection and tap highlights */
93 | .pswp__container,
94 | .pswp__img {
95 | -webkit-user-select: none;
96 | -moz-user-select: none;
97 | -ms-user-select: none;
98 | user-select: none;
99 | -webkit-tap-highlight-color: transparent;
100 | -webkit-touch-callout: none; }
101 |
102 | .pswp__zoom-wrap {
103 | position: absolute;
104 | width: 100%;
105 | -webkit-transform-origin: left top;
106 | -ms-transform-origin: left top;
107 | transform-origin: left top;
108 | /* for open/close transition */
109 | -webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
110 | transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
111 |
112 | .pswp__bg {
113 | will-change: opacity;
114 | /* for open/close transition */
115 | -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
116 | transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
117 |
118 | .pswp--animated-in .pswp__bg,
119 | .pswp--animated-in .pswp__zoom-wrap {
120 | -webkit-transition: none;
121 | transition: none; }
122 |
123 | .pswp__container,
124 | .pswp__zoom-wrap {
125 | -webkit-backface-visibility: hidden; }
126 |
127 | .pswp__item {
128 | position: absolute;
129 | left: 0;
130 | right: 0;
131 | top: 0;
132 | bottom: 0;
133 | overflow: hidden; }
134 |
135 | .pswp__img {
136 | position: absolute;
137 | width: auto;
138 | height: auto;
139 | top: 0;
140 | left: 0; }
141 |
142 | /*
143 | stretched thumbnail or div placeholder element (see below)
144 | style is added to avoid flickering in webkit/blink when layers overlap
145 | */
146 | .pswp__img--placeholder {
147 | -webkit-backface-visibility: hidden; }
148 |
149 | /*
150 | div element that matches size of large image
151 | large image loads on top of it
152 | */
153 | .pswp__img--placeholder--blank {
154 | background: #222; }
155 |
156 | .pswp--ie .pswp__img {
157 | width: 100% !important;
158 | height: auto !important;
159 | left: 0;
160 | top: 0; }
161 |
162 | /*
163 | Error message appears when image is not loaded
164 | (JS option errorMsg controls markup)
165 | */
166 | .pswp__error-msg {
167 | position: absolute;
168 | left: 0;
169 | top: 50%;
170 | width: 100%;
171 | text-align: center;
172 | font-size: 14px;
173 | line-height: 16px;
174 | margin-top: -8px;
175 | color: #CCC; }
176 |
177 | .pswp__error-msg a {
178 | color: #CCC;
179 | text-decoration: underline; }
180 |
--------------------------------------------------------------------------------
/plugin.php:
--------------------------------------------------------------------------------
1 | pswp_folder = "pswp";
8 | $this->custom_folder = "custom";
9 | $this->dev_folder = "src";
10 |
11 | $this->register_hook('before_closing_body', 'foot');
12 |
13 | $this->env = "production";
14 | # Define ENVIRONMENT in app/site/site.php
15 | if (defined('ENVIRONMENT')) {
16 | if (ENVIRONMENT!="production") {
17 | $this->env = "development";
18 | }
19 | }
20 | }
21 |
22 | function foot($data)
23 | {
24 |
25 | $sharing = Array();
26 | foreach ($this->data as $key => $val) {
27 | $matches = null;
28 | preg_match("/^share_(.+)$/",$key,$matches);
29 | if ($matches[1] && $val == 1) {
30 | $sharing[] = $matches[1];
31 | }
32 | }
33 |
34 | $scrollEl = $this->get_scrollEl();
35 | $css = "photoswipe.css";
36 | $skin_css = "default-skin/default-skin.css";
37 | $js = "photoswipe.min.js";
38 | $ui_js = "photoswipe-ui-default.min.js";
39 | $pswp_js = "pswp.min.js";
40 | $plugin_css = "default-skin/plugin.css";
41 |
42 | $pswp = Array();
43 | $pswp[] = ' ';
44 | $pswp[] = ' ';
45 | $pswp[] = ' ';
46 | $pswp[] = '';
47 | $pswp[] = '';
48 | $pswp[] = '';
49 | $koken_options = Array(
50 | 'showTitle' => $this->data->show_title ? true : false,
51 | 'sharing' => $sharing,
52 | 'triggerEl' => $this->get_triggerEl(),
53 | 'view_in_lightbox' => $this->get_view_in_lightbox(),
54 | 'usingPillar' => $this->usingPillar(),
55 | 'usingPjaxWithoutPillar' => $this->data->using_pjax_without_pillar ? true : false,
56 | 'hidpi' => Koken::$site['hidpi'],
57 | 'max_size' => intval($this->data->max_size),
58 | 'download_full' => $this->data->download_full ? true : false
59 | );
60 | $pswp[] = '';
61 |
62 | if ($scrollEl) {
63 | $pswp[] = '';
64 | }
65 |
66 | if (is_file($this->get_file_path().DIRECTORY_SEPARATOR.$this->custom_folder.DIRECTORY_SEPARATOR."pswp.html")) {
67 | include $this->get_file_path().DIRECTORY_SEPARATOR.$this->custom_folder.DIRECTORY_SEPARATOR."pswp.html";
68 | } else {
69 | include $this->get_file_path().DIRECTORY_SEPARATOR.$this->pswp_folder.DIRECTORY_SEPARATOR."pswp.html";
70 | }
71 | print join("\n",$pswp);
72 | }
73 |
74 | function get_url($file) {
75 | if ($this->env=="development") {
76 | $real_file = str_replace("min.","",$file);
77 | if (is_file($this->get_file_path().DIRECTORY_SEPARATOR.$this->dev_folder.DIRECTORY_SEPARATOR.$real_file)) {
78 | return Koken::$location['real_root_folder']."/storage/plugins/".$this->get_key()."/".$this->dev_folder."/".$real_file;
79 | }
80 | if (is_file($this->get_file_path().DIRECTORY_SEPARATOR.$this->dev_folder.DIRECTORY_SEPARATOR.$file)) {
81 | return Koken::$location['real_root_folder']."/storage/plugins/".$this->get_key()."/".$this->dev_folder."/".$file;
82 | }
83 | }
84 | if (is_file($this->get_file_path().DIRECTORY_SEPARATOR.$this->custom_folder.DIRECTORY_SEPARATOR.$file)) {
85 | return Koken::$location['real_root_folder']."/storage/plugins/".$this->get_key()."/".$this->custom_folder."/".$file;
86 | }
87 | else {
88 | return Koken::$location['real_root_folder']."/storage/plugins/".$this->get_key()."/".$this->pswp_folder."/".$file;
89 | }
90 | }
91 |
92 | function get_triggerEl() {
93 | if (trim($this->data->trigger_el)!="") {
94 | return trim($this->data->trigger_el);
95 | }
96 |
97 | $triggerEls = Array(
98 | 'axis' => 'a.k-link-lightbox',
99 | 'axis 2' => 'a.k-link-lightbox',
100 | 'boulevard' => 'div.content',
101 | 'chastain' => 'span.img-wrap a',
102 | 'elementary' => 'a.thumb',
103 | 'ensemble' => 'div.list-image a',
104 | 'madison' => 'a.k-link-lightbox',
105 | 'madison 2' => 'a.k-link-lightbox',
106 | 'regale' => 'div#grid:not(.albums) a.img-hover',
107 | 'regale 2' => 'a.k-link-lightbox',
108 | 'repertoire' => 'div.img-wrap a',
109 | 'oxygen' => 'a.k-link-lightbox'
110 | );
111 | $myTheme = strtolower(Koken::$site['theme']['name']);
112 | return $triggerEls[$myTheme];
113 | }
114 |
115 | function get_scrollEl() {
116 | if (trim($this->data->scroll_el)!="") {
117 | $element = trim($this->data->scroll_el);
118 | $info = pathinfo($element);
119 | return Array($element, $info['extension']);
120 | }
121 |
122 | $scrollEls = Array(
123 | 'ensemble' => 'div.list-image',
124 | 'repertoire' => '.scroll-me',
125 | 'chastain' => '.content-list',
126 | 'madison' => '.item'
127 | );
128 | $myTheme = strtolower(Koken::$site['theme']['name']);
129 |
130 | $scrollEl = null;
131 | if (array_key_exists($myTheme,$scrollEls)) {
132 | $element = $scrollEls[$myTheme];
133 | $info = pathinfo($element);
134 | $scrollEl = Array($element, $info['extension']);
135 | }
136 | return $scrollEl;
137 | }
138 |
139 | function usingPillar() {
140 | $myTheme = strtolower(Koken::$site['theme']['name']);
141 | $pillarThemes = Array('madison 2', 'regale 2', 'axis 2');
142 | return (in_array($myTheme,$pillarThemes)) ? true : false;
143 | }
144 |
145 | function get_view_in_lightbox() {
146 | if (trim($this->data->view_in_lightbox)!="") {
147 | return trim($this->data->view_in_lightbox);
148 | }
149 | else return "View in lightbox";
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/pswp/pswp.min.js:
--------------------------------------------------------------------------------
1 | var initPhotoSwipeFromDOM=function(options){var parseThumbnailElements=function(el){var items=[];el.children("img").each(function(){if(typeof $(this).attr("data-base")!="undefined"&&typeof $(this).attr("data-extension")!="undefined"&&typeof $(this).attr("data-presets")!="undefined"){var item={};var base=$(this).attr("data-base");var ext=$(this).attr("data-extension");item["_common"]={msrc:$(this).attr("data-src")||$(this).attr("src")};item["title"]=$(this).attr("data-alt")||$(this).attr("alt");item["caption"]=$(this).nextAll(".item-caption:first").html();item.pid=base.split("/").slice(-3).join("-").slice(0,-1).toLowerCase();var rating_el=$(this).parent().parent().children("figcaption").find("span.koken-rating");var rating=null;if(rating_el.length>0){rating={cid:rating_el.attr("data-cid"),average:rating_el.attr("data-average"),count:rating_el.attr("data-count")}}item["rating"]=rating;jQuery.each($(this).attr("data-presets").split(" "),function(i,val){var preset_info=val.split(",");var name=preset_info[0];var size_factor=isHighDensity()?2:1;var retina=isHighDensity()?".2x.":".";var w=parseInt(preset_info[1]);var h=parseInt(preset_info[2]);var src=base+name+retina+ext;item[name]={src:src,w:size_factor*w,h:size_factor*h};if(name=="huge"){item["huge.2x"]={src:base+name+".2x."+ext,w:2*w,h:2*h}}});itemExists=false;$.each(items,function(index,value){if(value.pid==item.pid){itemExists=true;return false}});if(!itemExists){items.push(item)}}});return items};var photoswipeParseHash=function(){var hash=window.location.hash.substring(1),params={};if(hash.length<5){return params}var vars=hash.split("&");for(var i=0;i0,getDoubleTapZoom:function(){if(window.devicePixelRatio>1){return.5}else{return 1}},galleryPIDs:true,addCaptionHTMLFn:function(item,captionEl,isFake){if(item["rating"]&&!isFake){$("button.pswp__button--rating span").attr("data-cid",item["rating"].cid).attr("data-average",item["rating"].average).attr("data-count",item["rating"].count)}if(!koken_options.showTitle||!item.title){captionEl.children[0].innerHTML="";return false}captionEl.children[0].innerHTML=item.title+(item.caption?""+item.caption+" ":"");return true}};if(fromURL){if(options.galleryPIDs){for(var j=0;j=1600&&max_size>=1600&&"huge"in items[0]){neededSize="huge";if(realViewportWidth>=2048&&max_size>=2048&&koken_options.hidpi===true&&size_factor==1){neededSize="huge.2x"}}else if(realViewportWidth>=1024&&max_size>=1024&&"xlarge"in items[0]){neededSize="xlarge"}else if(realViewportWidth>=800&&max_size>=800&&"large"in items[0]){neededSize="large"}else{neededSize="medium_large"}if(useImageSize!=neededSize){useImageSize=neededSize;if(!firstResize){gallery.invalidateCurrItems()}}firstResize=false});gallery.listen("gettingData",function(index,item){item.src=item[useImageSize].src;item.msrc=item["_common"].msrc.replace(".crop.",".");item.w=item[useImageSize].w;item.h=item[useImageSize].h});var scroll_move=null;var bind_move=false;if(typeof $K=="object"){if(typeof $K.keyboard=="object"){if(typeof $K.keyboard.scroll=="object"){if(typeof $K.keyboard.scroll.move=="function"){scroll_move=$K.keyboard.scroll.move;$K.keyboard.scroll.move=function(){return true}}}$("[data-bind-to-key]").each(function(){bind_move=true;var t=$(this),e=t.attr("data-bind-to-key");key.unbind(e)})}}gallery.listen("destroy",function(){if(bind_move===true){$K.keyboard.bind()}if(scroll_move){$K.keyboard.scroll.move=scroll_move;scroll_move=null}pswp_open=false;$(".pswp")[0].className="pswp";if(pswp_open_orientation!=window.orientation){initPS()}if(pswp_open_width!=$(window).width()||pswp_open_height!=$(window).height()){initPS()}});gallery.init();pswp_open=true;pswp_open_orientation=window.orientation;pswp_open_width=$(window).width();pswp_open_height=$(window).height()};var isHighDensity=function(){if(koken_options.hidpi===false){return false}return window.matchMedia&&(window.matchMedia("only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)").matches||window.matchMedia("only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)").matches)||window.devicePixelRatio&&window.devicePixelRatio>1.3};var initPS=function(){if(koken_options.usingPillar||koken_options.usingPjaxWithoutPillar){setTimeout(runInitPS,500)}else{runInitPS()}};var runInitPS=function(){if(!pswp_open){$(".pswp")[0].className="pswp";$("a[data-pswp-uid]").removeAttr("data-pswp-upid")}var i=0;if(koken_options.usingPillar&&!koken_options.usingPjaxWithoutPillar){if(size_group=="size_0"&&typeof start_size_group=="undefined"){old_size_group=size_group;class_attr=$("div.pillar").attr("class");if(class_attr){start_size_group=$.grep(class_attr.split(" "),function(v){return v!="pillar"})[0]}}if(orientation_changed){if(size_group=="size_0"){size_group=start_size_group}old_size_group=size_group;class_attr=$("div.pillar:not(."+old_size_group+")").attr("class");if(class_attr){size_group=$.grep(class_attr.split(" "),function(v){return v!="pillar"})[0]}orientation_changed=false}galleryElements=$("div.pillar:not(."+old_size_group+") "+koken_options.triggerEl)}else{galleryElements=$(koken_options.triggerEl)}if(!pswp_open){galleryElements.each(function(){if($(this).children("img").length>0){set_link($(this),i);i++}});galleryElements.each(function(){if($(this).attr("title")==koken_options.view_in_lightbox){lb_url=$(this).attr("href");if(typeof lb_url!="undefined"&&lb_url.length>0){lb_element=$(this);$('a[href="'+lb_url+'"]').each(function(){if($(this).attr("data-pswp-uid")&&$(this).children("img").length>0){set_link(lb_element,$(this).attr("data-pswp-uid"))}})}}})}};var set_link=function(el,i){if(!el.parent().hasClass("type_video")){el.click(function(e){openPhotoSwipe(el.first().attr("data-pswp-uid"));return false})}el.attr("data-pswp-uid",i)};var koken_options=options;var pswp_open=false;var pswp_open_orientation;var orientation_changed=false;var orientation=window.orientation;var size_group="size_0",old_size_group,start_size_group;var galleryElements=$(koken_options.triggerEl);var last_resize=0;$(window).on("k-resize",function(){if(Date.now()-last_resize>1e3){last_resize=Date.now();initPS()}});if(koken_options.usingPillar||koken_options.usingPjaxWithoutPillar){$(document).on("pjax:end",function(){initPS()});$(window).on("orientationchange",function(){if(window.orientation!=orientation){orientation_changed=true;orientation=window.orientation;initPS()}else{orientation_changed=false}});$(window).on("k-infinite-loaded",function(){initPS()});initPS()}else{initPS()}var hashData=photoswipeParseHash();if(hashData.pid&&hashData.gid){openPhotoSwipe(hashData.pid,true,true)}};
2 |
--------------------------------------------------------------------------------
/pswp/photoswipe-ui-default.min.js:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe Default UI - 4.1.2 - 2017-04-05
2 | * http://photoswipe.com
3 | * Copyright (c) 2017 Dmitry Semenov; */
4 | !function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipeUI_Default=b()}(this,function(){"use strict";var a=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=this,w=!1,x=!0,y=!0,z={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(a,b){return a.title?(b.children[0].innerHTML=a.title,!0):(b.children[0].innerHTML="",!1)},closeEl:!0,captionEl:!0,fullscreenEl:!0,zoomEl:!0,shareEl:!0,counterEl:!0,arrowEl:!0,preloaderEl:!0,tapToClose:!1,tapToToggleControls:!0,clickToCloseNonZoomable:!0,shareButtons:[{id:"facebook",label:"Share on Facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"},{id:"twitter",label:"Tweet",url:"https://twitter.com/intent/tweet?text={{text}}&url={{url}}"},{id:"pinterest",label:"Pin it",url:"http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}"},{id:"download",label:"Download image",url:"{{raw_image_url}}",download:!0}],getImageURLForShare:function(){return a.currItem.src||""},getPageURLForShare:function(){return window.location.href},getTextForShare:function(){return a.currItem.title||""},indexIndicatorSep:" / ",fitControlsWidth:1200},A=function(a){if(r)return!0;a=a||window.event,q.timeToIdle&&q.mouseUsed&&!k&&K();for(var c,d,e=a.target||a.srcElement,f=e.getAttribute("class")||"",g=0;g-1&&(c.onTap(),d=!0);if(d){a.stopPropagation&&a.stopPropagation(),r=!0;var h=b.features.isOldAndroid?600:30;s=setTimeout(function(){r=!1},h)}},B=function(){return!a.likelyTouchDevice||q.mouseUsed||screen.width>q.fitControlsWidth},C=function(a,c,d){b[(d?"add":"remove")+"Class"](a,"pswp__"+c)},D=function(){var a=1===q.getNumItemsFn();a!==p&&(C(d,"ui--one-slide",a),p=a)},E=function(){C(i,"share-modal--hidden",y)},F=function(){return y=!y,y?(b.removeClass(i,"pswp__share-modal--fade-in"),setTimeout(function(){y&&E()},300)):(E(),setTimeout(function(){y||b.addClass(i,"pswp__share-modal--fade-in")},30)),y||H(),!1},G=function(b){b=b||window.event;var c=b.target||b.srcElement;return a.shout("shareLinkClick",b,c),!!c.href&&(!!c.hasAttribute("download")||(window.open(c.href,"pswp_share","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left="+(window.screen?Math.round(screen.width/2-275):100)),y||F(),!1))},H=function(){for(var a,b,c,d,e,f="",g=0;g"+a.label+"",q.parseShareButtonOut&&(f=q.parseShareButtonOut(a,f));i.children[0].innerHTML=f,i.children[0].onclick=G},I=function(a){for(var c=0;c=.95&&v.showControls()});var a;l("onPinchClose",function(b){x&&b<.9?(v.hideControls(),a=!0):a&&!x&&b>.9&&v.showControls()}),l("zoomGestureEnded",function(){a=!1,a&&!x&&v.showControls()})},S=[{name:"caption",option:"captionEl",onInit:function(a){e=a}},{name:"share-modal",option:"shareEl",onInit:function(a){i=a},onTap:function(){F()}},{name:"button--share",option:"shareEl",onInit:function(a){h=a},onTap:function(){F()}},{name:"button--zoom",option:"zoomEl",onTap:a.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(a){g=a}},{name:"button--close",option:"closeEl",onTap:a.close},{name:"button--arrow--left",option:"arrowEl",onTap:a.prev},{name:"button--arrow--right",option:"arrowEl",onTap:a.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){c.isFullscreen()?c.exit():c.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(a){m=a}}],T=function(){var a,c,e,f=function(d){if(d)for(var f=d.length,g=0;g-1&&(q[e.option]?(b.removeClass(a,"pswp__element--disabled"),e.onInit&&e.onInit(a)):b.addClass(a,"pswp__element--disabled"))}};f(d.children);var g=b.getChildByClass(d,"pswp__top-bar");g&&f(g.children)};v.init=function(){b.extend(a.options,z,!0),q=a.options,d=b.getChildByClass(a.scrollWrap,"pswp__ui"),l=a.listen,R(),l("beforeChange",v.update),l("doubleTap",function(b){var c=a.currItem.initialZoomLevel;a.getZoomLevel()!==c?a.zoomTo(c,b,333):a.zoomTo(q.getDoubleTapZoom(!1,a.currItem),b,333)}),l("preventDragEvent",function(a,b,c){var d=a.target||a.srcElement;d&&d.getAttribute("class")&&a.type.indexOf("mouse")>-1&&(d.getAttribute("class").indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(d.tagName))&&(c.prevent=!1)}),l("bindEvents",function(){b.bind(d,"pswpTap click",A),b.bind(a.scrollWrap,"pswpTap",v.onGlobalTap),a.likelyTouchDevice||b.bind(a.scrollWrap,"mouseover",v.onMouseOver)}),l("unbindEvents",function(){y||F(),t&&clearInterval(t),b.unbind(document,"mouseout",L),b.unbind(document,"mousemove",K),b.unbind(d,"pswpTap click",A),b.unbind(a.scrollWrap,"pswpTap",v.onGlobalTap),b.unbind(a.scrollWrap,"mouseover",v.onMouseOver),c&&(b.unbind(document,c.eventK,v.updateFullscreen),c.isFullscreen()&&(q.hideAnimationDuration=0,c.exit()),c=null)}),l("destroy",function(){q.captionEl&&(f&&d.removeChild(f),b.removeClass(e,"pswp__caption--empty")),i&&(i.children[0].onclick=null),b.removeClass(d,"pswp__ui--over-close"),b.addClass(d,"pswp__ui--hidden"),v.setIdle(!1)}),q.showAnimationDuration||b.removeClass(d,"pswp__ui--hidden"),l("initialZoomIn",function(){q.showAnimationDuration&&b.removeClass(d,"pswp__ui--hidden")}),l("initialZoomOut",function(){b.addClass(d,"pswp__ui--hidden")}),l("parseVerticalMargin",P),T(),q.shareEl&&h&&i&&(y=!0),D(),Q(),M(),N()},v.setIdle=function(a){k=a,C(d,"ui--idle",a)},v.update=function(){x&&a.currItem?(v.updateIndexIndicator(),q.captionEl&&(q.addCaptionHTMLFn(a.currItem,e),C(e,"caption--empty",!a.currItem.title)),w=!0):w=!1,y||F(),D()},v.updateFullscreen=function(d){d&&setTimeout(function(){a.setScrollOffset(0,b.getScrollY())},50),b[(c.isFullscreen()?"add":"remove")+"Class"](a.template,"pswp--fs")},v.updateIndexIndicator=function(){q.counterEl&&(g.innerHTML=a.getCurrentIndex()+1+q.indexIndicatorSep+q.getNumItemsFn())},v.onGlobalTap=function(c){c=c||window.event;var d=c.target||c.srcElement;if(!r)if(c.detail&&"mouse"===c.detail.pointerType){if(I(d))return void a.close();b.hasClass(d,"pswp__img")&&(1===a.getZoomLevel()&&a.getZoomLevel()<=a.currItem.fitRatio?q.clickToCloseNonZoomable&&a.close():a.toggleDesktopZoom(c.detail.releasePoint))}else if(q.tapToToggleControls&&(x?v.hideControls():v.showControls()),q.tapToClose&&(b.hasClass(d,"pswp__img")||I(d)))return void a.close()},v.onMouseOver=function(a){a=a||window.event;var b=a.target||a.srcElement;C(d,"ui--over-close",I(b))},v.hideControls=function(){b.addClass(d,"pswp__ui--hidden"),x=!1},v.showControls=function(){x=!0,w||v.update(),b.removeClass(d,"pswp__ui--hidden")},v.supportsFullscreen=function(){var a=document;return!!(a.exitFullscreen||a.mozCancelFullScreen||a.webkitExitFullscreen||a.msExitFullscreen)},v.getFullscreenAPI=function(){var b,c=document.documentElement,d="fullscreenchange";return c.requestFullscreen?b={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:d}:c.mozRequestFullScreen?b={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+d}:c.webkitRequestFullscreen?b={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+d}:c.msRequestFullscreen&&(b={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),b&&(b.enter=function(){return j=q.closeOnScroll,q.closeOnScroll=!1,"webkitRequestFullscreen"!==this.enterK?a.template[this.enterK]():void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},b.exit=function(){return q.closeOnScroll=j,document[this.exitK]()},b.isFullscreen=function(){return document[this.elementK]}),b}};return a});
--------------------------------------------------------------------------------
/pswp/default-skin/default-skin.css:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
2 | /*
3 |
4 | Contents:
5 |
6 | 1. Buttons
7 | 2. Share modal and links
8 | 3. Index indicator ("1 of X" counter)
9 | 4. Caption
10 | 5. Loading indicator
11 | 6. Additional styles (root element, top bar, idle state, hidden state, etc.)
12 |
13 | */
14 | /*
15 |
16 | 1. Buttons
17 |
18 | */
19 | /* css reset */
20 | .pswp__button {
21 | width: 44px;
22 | height: 44px;
23 | position: relative;
24 | background: none;
25 | cursor: pointer;
26 | overflow: visible;
27 | -webkit-appearance: none;
28 | display: block;
29 | border: 0;
30 | padding: 0;
31 | margin: 0;
32 | float: right;
33 | opacity: 0.75;
34 | -webkit-transition: opacity 0.2s;
35 | transition: opacity 0.2s;
36 | -webkit-box-shadow: none;
37 | box-shadow: none; }
38 | .pswp__button:focus,
39 | .pswp__button:hover {
40 | background-color: transparent;
41 | opacity: 1; }
42 | .pswp__button:active {
43 | outline: none;
44 | opacity: 0.9; }
45 | .pswp__button::-moz-focus-inner {
46 | padding: 0;
47 | border: 0; }
48 |
49 | /* pswp__ui--over-close class it added when mouse is over element that should close gallery */
50 | .pswp__ui--over-close .pswp__button--close {
51 | opacity: 1; }
52 |
53 | .pswp__button,
54 | .pswp__button--arrow--left:before,
55 | .pswp__button--arrow--right:before {
56 | background: url(default-skin.png) 0 0 no-repeat;
57 | background-size: 264px 88px;
58 | width: 44px;
59 | height: 44px; }
60 |
61 | @media (-webkit-min-device-pixel-ratio: 1.1), (-webkit-min-device-pixel-ratio: 1.09375), (min-resolution: 105dpi), (min-resolution: 1.1dppx) {
62 | /* Serve SVG sprite if browser supports SVG and resolution is more than 105dpi */
63 | .pswp--svg .pswp__button,
64 | .pswp--svg .pswp__button--arrow--left:before,
65 | .pswp--svg .pswp__button--arrow--right:before {
66 | background-image: url(default-skin.svg); }
67 | .pswp--svg .pswp__button--arrow--left,
68 | .pswp--svg .pswp__button--arrow--right {
69 | background: none; } }
70 | .pswp--svg .pswp__button--rating{
71 | background: none;}
72 |
73 |
74 | .pswp__button--close {
75 | background-position: 0 -44px; }
76 |
77 | .pswp__button--share {
78 | background-position: -44px -44px; }
79 |
80 | .pswp__button--fs {
81 | display: none; }
82 |
83 | .pswp--supports-fs .pswp__button--fs {
84 | display: block; }
85 |
86 | .pswp--fs .pswp__button--fs {
87 | background-position: -44px 0; }
88 |
89 | .pswp__button--zoom {
90 | display: none;
91 | background-position: -88px 0; }
92 |
93 | .pswp--zoom-allowed .pswp__button--zoom {
94 | display: block; }
95 |
96 | .pswp--zoomed-in .pswp__button--zoom {
97 | background-position: -132px 0; }
98 |
99 | /* no arrows on touch screens */
100 | .pswp--touch .pswp__button--arrow--left,
101 | .pswp--touch .pswp__button--arrow--right {
102 | visibility: hidden; }
103 |
104 | /*
105 | Arrow buttons hit area
106 | (icon is added to :before pseudo-element)
107 | */
108 | .pswp__button--arrow--left,
109 | .pswp__button--arrow--right {
110 | background: none;
111 | top: 50%;
112 | margin-top: -50px;
113 | width: 70px;
114 | height: 100px;
115 | position: absolute; }
116 |
117 | .pswp__button--arrow--left {
118 | left: 0; }
119 |
120 | .pswp__button--arrow--right {
121 | right: 0; }
122 |
123 | .pswp__button--arrow--left:before,
124 | .pswp__button--arrow--right:before {
125 | content: '';
126 | top: 35px;
127 | background-color: rgba(0, 0, 0, 0.3);
128 | height: 30px;
129 | width: 32px;
130 | position: absolute; }
131 |
132 | .pswp__button--arrow--left:before {
133 | left: 6px;
134 | background-position: -138px -44px; }
135 |
136 | .pswp__button--arrow--right:before {
137 | right: 6px;
138 | background-position: -94px -44px; }
139 |
140 | /*
141 |
142 | 2. Share modal/popup and links
143 |
144 | */
145 | .pswp__counter,
146 | .pswp__share-modal {
147 | -webkit-user-select: none;
148 | -moz-user-select: none;
149 | -ms-user-select: none;
150 | user-select: none; }
151 |
152 | .pswp__share-modal {
153 | display: block;
154 | background: rgba(0, 0, 0, 0.5);
155 | width: 100%;
156 | height: 100%;
157 | top: 0;
158 | left: 0;
159 | padding: 10px;
160 | position: absolute;
161 | z-index: 1600;
162 | opacity: 0;
163 | -webkit-transition: opacity 0.25s ease-out;
164 | transition: opacity 0.25s ease-out;
165 | -webkit-backface-visibility: hidden;
166 | will-change: opacity; }
167 |
168 | .pswp__share-modal--hidden {
169 | display: none; }
170 |
171 | .pswp__share-tooltip {
172 | z-index: 1620;
173 | position: absolute;
174 | background: #FFF;
175 | top: 56px;
176 | border-radius: 2px;
177 | display: block;
178 | width: auto;
179 | right: 44px;
180 | -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
181 | box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
182 | -webkit-transform: translateY(6px);
183 | -ms-transform: translateY(6px);
184 | transform: translateY(6px);
185 | -webkit-transition: -webkit-transform 0.25s;
186 | transition: transform 0.25s;
187 | -webkit-backface-visibility: hidden;
188 | will-change: transform; }
189 | .pswp__share-tooltip a {
190 | display: block;
191 | padding: 8px 12px;
192 | color: #000;
193 | text-decoration: none;
194 | font-size: 14px;
195 | line-height: 18px; }
196 | .pswp__share-tooltip a:hover {
197 | text-decoration: none;
198 | color: #000; }
199 | .pswp__share-tooltip a:first-child {
200 | /* round corners on the first/last list item */
201 | border-radius: 2px 2px 0 0; }
202 | .pswp__share-tooltip a:last-child {
203 | border-radius: 0 0 2px 2px; }
204 |
205 | .pswp__share-modal--fade-in {
206 | opacity: 1; }
207 | .pswp__share-modal--fade-in .pswp__share-tooltip {
208 | -webkit-transform: translateY(0);
209 | -ms-transform: translateY(0);
210 | transform: translateY(0); }
211 |
212 | /* increase size of share links on touch devices */
213 | .pswp--touch .pswp__share-tooltip a {
214 | padding: 16px 12px; }
215 |
216 | a.pswp__share--facebook:before {
217 | content: '';
218 | display: block;
219 | width: 0;
220 | height: 0;
221 | position: absolute;
222 | top: -12px;
223 | right: 15px;
224 | border: 6px solid transparent;
225 | border-bottom-color: #FFF;
226 | -webkit-pointer-events: none;
227 | -moz-pointer-events: none;
228 | pointer-events: none; }
229 |
230 | a.pswp__share--facebook:hover {
231 | background: #3E5C9A;
232 | color: #FFF; }
233 | a.pswp__share--facebook:hover:before {
234 | border-bottom-color: #3E5C9A; }
235 |
236 | a.pswp__share--twitter:hover {
237 | background: #55ACEE;
238 | color: #FFF; }
239 |
240 | a.pswp__share--pinterest:hover {
241 | background: #CCC;
242 | color: #CE272D; }
243 |
244 | a.pswp__share--download:hover {
245 | background: #DDD; }
246 |
247 | /*
248 |
249 | 3. Index indicator ("1 of X" counter)
250 |
251 | */
252 | .pswp__counter {
253 | position: absolute;
254 | left: 0;
255 | top: 0;
256 | height: 44px;
257 | font-size: 13px;
258 | line-height: 44px;
259 | color: #FFF;
260 | opacity: 0.75;
261 | padding: 0 10px; }
262 |
263 | /*
264 |
265 | 4. Caption
266 |
267 | */
268 | .pswp__caption {
269 | position: absolute;
270 | left: 0;
271 | bottom: 0;
272 | width: 100%;
273 | min-height: 44px; }
274 | .pswp__caption small {
275 | font-size: 11px;
276 | color: #BBB; }
277 |
278 | .pswp__caption__center {
279 | text-align: left;
280 | max-width: 420px;
281 | margin: 0 auto;
282 | font-size: 13px;
283 | padding: 10px;
284 | line-height: 20px;
285 | color: #CCC; }
286 |
287 | .pswp__caption--empty {
288 | display: none; }
289 |
290 | /* Fake caption element, used to calculate height of next/prev image */
291 | .pswp__caption--fake {
292 | visibility: hidden; }
293 |
294 | /*
295 |
296 | 5. Loading indicator (preloader)
297 |
298 | You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
299 |
300 | */
301 | .pswp__preloader {
302 | width: 44px;
303 | height: 44px;
304 | position: absolute;
305 | top: 0;
306 | left: 50%;
307 | margin-left: -22px;
308 | opacity: 0;
309 | -webkit-transition: opacity 0.25s ease-out;
310 | transition: opacity 0.25s ease-out;
311 | will-change: opacity;
312 | direction: ltr; }
313 |
314 | .pswp__preloader__icn {
315 | width: 20px;
316 | height: 20px;
317 | margin: 12px; }
318 |
319 | .pswp__preloader--active {
320 | opacity: 1; }
321 | .pswp__preloader--active .pswp__preloader__icn {
322 | /* We use .gif in browsers that don't support CSS animation */
323 | background: url(preloader.gif) 0 0 no-repeat; }
324 |
325 | .pswp--css_animation .pswp__preloader--active {
326 | opacity: 1; }
327 | .pswp--css_animation .pswp__preloader--active .pswp__preloader__icn {
328 | -webkit-animation: clockwise 500ms linear infinite;
329 | animation: clockwise 500ms linear infinite; }
330 | .pswp--css_animation .pswp__preloader--active .pswp__preloader__donut {
331 | -webkit-animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite;
332 | animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; }
333 |
334 | .pswp--css_animation .pswp__preloader__icn {
335 | background: none;
336 | opacity: 0.75;
337 | width: 14px;
338 | height: 14px;
339 | position: absolute;
340 | left: 15px;
341 | top: 15px;
342 | margin: 0; }
343 |
344 | .pswp--css_animation .pswp__preloader__cut {
345 | /*
346 | The idea of animating inner circle is based on Polymer ("material") loading indicator
347 | by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html
348 | */
349 | position: relative;
350 | width: 7px;
351 | height: 14px;
352 | overflow: hidden; }
353 |
354 | .pswp--css_animation .pswp__preloader__donut {
355 | -webkit-box-sizing: border-box;
356 | box-sizing: border-box;
357 | width: 14px;
358 | height: 14px;
359 | border: 2px solid #FFF;
360 | border-radius: 50%;
361 | border-left-color: transparent;
362 | border-bottom-color: transparent;
363 | position: absolute;
364 | top: 0;
365 | left: 0;
366 | background: none;
367 | margin: 0; }
368 |
369 | @media screen and (max-width: 1024px) {
370 | .pswp__preloader {
371 | position: relative;
372 | left: auto;
373 | top: auto;
374 | margin: 0;
375 | float: right; } }
376 |
377 | @-webkit-keyframes clockwise {
378 | 0% {
379 | -webkit-transform: rotate(0deg);
380 | transform: rotate(0deg); }
381 | 100% {
382 | -webkit-transform: rotate(360deg);
383 | transform: rotate(360deg); } }
384 |
385 | @keyframes clockwise {
386 | 0% {
387 | -webkit-transform: rotate(0deg);
388 | transform: rotate(0deg); }
389 | 100% {
390 | -webkit-transform: rotate(360deg);
391 | transform: rotate(360deg); } }
392 |
393 | @-webkit-keyframes donut-rotate {
394 | 0% {
395 | -webkit-transform: rotate(0);
396 | transform: rotate(0); }
397 | 50% {
398 | -webkit-transform: rotate(-140deg);
399 | transform: rotate(-140deg); }
400 | 100% {
401 | -webkit-transform: rotate(0);
402 | transform: rotate(0); } }
403 |
404 | @keyframes donut-rotate {
405 | 0% {
406 | -webkit-transform: rotate(0);
407 | transform: rotate(0); }
408 | 50% {
409 | -webkit-transform: rotate(-140deg);
410 | transform: rotate(-140deg); }
411 | 100% {
412 | -webkit-transform: rotate(0);
413 | transform: rotate(0); } }
414 |
415 | /*
416 |
417 | 6. Additional styles
418 |
419 | */
420 | /* root element of UI */
421 | .pswp__ui {
422 | -webkit-font-smoothing: auto;
423 | visibility: visible;
424 | opacity: 1;
425 | z-index: 1550; }
426 |
427 | /* top black bar with buttons and "1 of X" indicator */
428 | .pswp__top-bar {
429 | position: absolute;
430 | left: 0;
431 | top: 0;
432 | height: 44px;
433 | width: 100%; }
434 |
435 | .pswp__caption,
436 | .pswp__top-bar,
437 | .pswp--has_mouse .pswp__button--arrow--left,
438 | .pswp--has_mouse .pswp__button--arrow--right {
439 | -webkit-backface-visibility: hidden;
440 | will-change: opacity;
441 | -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
442 | transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
443 |
444 | /* pswp--has_mouse class is added only when two subsequent mousemove events occur */
445 | .pswp--has_mouse .pswp__button--arrow--left,
446 | .pswp--has_mouse .pswp__button--arrow--right {
447 | visibility: visible; }
448 |
449 | .pswp__top-bar,
450 | .pswp__caption {
451 | background-color: rgba(0, 0, 0, 0.5); }
452 |
453 | /* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */
454 | .pswp__ui--fit .pswp__top-bar,
455 | .pswp__ui--fit .pswp__caption {
456 | background-color: rgba(0, 0, 0, 0.3); }
457 |
458 | /* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
459 | .pswp__ui--idle .pswp__top-bar {
460 | opacity: 0; }
461 |
462 | .pswp__ui--idle .pswp__button--arrow--left,
463 | .pswp__ui--idle .pswp__button--arrow--right {
464 | opacity: 0; }
465 |
466 | /*
467 | pswp__ui--hidden class is added when controls are hidden
468 | e.g. when user taps to toggle visibility of controls
469 | */
470 | .pswp__ui--hidden .pswp__top-bar,
471 | .pswp__ui--hidden .pswp__caption,
472 | .pswp__ui--hidden .pswp__button--arrow--left,
473 | .pswp__ui--hidden .pswp__button--arrow--right {
474 | /* Force paint & create composition layer for controls. */
475 | opacity: 0.001; }
476 |
477 | /* pswp__ui--one-slide class is added when there is just one item in gallery */
478 | .pswp__ui--one-slide .pswp__button--arrow--left,
479 | .pswp__ui--one-slide .pswp__button--arrow--right,
480 | .pswp__ui--one-slide .pswp__counter {
481 | display: none; }
482 |
483 | .pswp__element--disabled {
484 | display: none !important; }
485 |
486 | .pswp--minimal--dark .pswp__top-bar {
487 | background: none; }
488 |
--------------------------------------------------------------------------------
/src/pswp.js:
--------------------------------------------------------------------------------
1 | var initPhotoSwipeFromDOM = function(options) {
2 |
3 | var parseThumbnailElements = function(el) {
4 |
5 | var items = []
6 | el.children("img").each(function(){
7 | if (typeof($(this).attr('data-base')) != "undefined" && typeof($(this).attr('data-extension')) != "undefined" && typeof($(this).attr('data-presets')) != "undefined") {
8 | var item = {};
9 | var base = $(this).attr('data-base');
10 | var ext = $(this).attr('data-extension');
11 | item['_common'] = {
12 | "msrc": $(this).attr('data-src') || $(this).attr('src')
13 | };
14 | item['title'] = $(this).attr('data-alt') || $(this).attr('alt');
15 |
16 | item['caption'] = $(this).nextAll('.item-caption:first').html();
17 | item.pid = base.split('/').slice(-3).join("-").slice(0,-1).toLowerCase();
18 | var rating_el = $(this).parent().parent().children('figcaption').find('span.koken-rating');
19 | var rating = null;
20 | if (rating_el.length > 0) {
21 | rating = {
22 | cid: rating_el.attr('data-cid'),
23 | average: rating_el.attr('data-average'),
24 | count: rating_el.attr('data-count')
25 | }
26 | }
27 | item['rating'] = rating;
28 |
29 | jQuery.each($(this).attr('data-presets').split(" "), function(i,val) {
30 | var preset_info = val.split(",");
31 | var name = preset_info[0];
32 | var size_factor = isHighDensity() ? 2 : 1;
33 | var retina = isHighDensity() ? '.2x.' : '.';
34 | var w = parseInt(preset_info[1]);
35 | var h = parseInt(preset_info[2]);
36 | var src = base+name+retina+ext;
37 |
38 | item[name] = {
39 | "src": src,
40 | "w": size_factor*w,
41 | "h": size_factor*h
42 | };
43 | if (name=='huge') {
44 | item['huge.2x'] = {
45 | "src": base+name+'.2x.'+ext,
46 | "w": 2*w,
47 | "h": 2*h
48 | };
49 | }
50 | });
51 | itemExists = false;
52 | $.each(items,function(index, value){
53 | if (value.pid == item.pid) {
54 | itemExists = true;
55 | return false;
56 | }
57 | });
58 | if (!itemExists) {
59 | items.push(item);
60 | }
61 | }
62 | });
63 | return items;
64 | };
65 |
66 | // parse picture index and gallery index from URL (#&pid=1&gid=2)
67 | var photoswipeParseHash = function() {
68 | var hash = window.location.hash.substring(1),
69 | params = {};
70 |
71 | if(hash.length < 5) {
72 | return params;
73 | }
74 |
75 | var vars = hash.split('&');
76 | for (var i = 0; i < vars.length; i++) {
77 | if(!vars[i]) {
78 | continue;
79 | }
80 | var pair = vars[i].split('=');
81 | if(pair.length < 2) {
82 | continue;
83 | }
84 | params[pair[0]] = pair[1];
85 | }
86 |
87 | if(params.gid) {
88 | params.gid = parseInt(params.gid, 10);
89 | }
90 |
91 | return params;
92 | };
93 |
94 | var openPhotoSwipe = function(index, disableAnimation, fromURL) {
95 | var pswpElement = $('.pswp')[0],
96 | gallery,
97 | options,
98 | items;
99 |
100 | if (pswp_open) {
101 | return true;
102 | }
103 | items = parseThumbnailElements(galleryElements);
104 |
105 | availableShareButtons = {
106 | facebook:{ id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'},
107 | twitter:{id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text={{text}}&url={{url}}'},
108 | pinterest:{id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}'},
109 | gplus:{id:'gplus', label:'Google+', url:'https://plus.google.com/share?url={{url}}'},
110 | tumblr:{id:'tumblr', label:'Tumblr', url:'http://www.tumblr.com/share/photo?caption={{text}}&click_thru={{url}}&source={{image_url}}'},
111 | download:{id:'download', label:'Download Image', url:'{{raw_image_url}}',download:true}
112 | };
113 | var shareButtons = Array();
114 | $.each(koken_options.sharing, function(index,value) {
115 | shareButtons.push(eval('availableShareButtons.'+value));
116 | });
117 |
118 | // define options (if needed)
119 | options = {
120 | preload: [5,10],
121 |
122 | getThumbBoundsFn: function(index) {
123 | el=$("[data-pswp-uid='"+index+"']").children("img[data-presets]");
124 | if (typeof(el.offset())=="undefined") {
125 | return {x:0,y:0,w:200};
126 | }
127 | return {x:el.offset().left, y:el.offset().top, w:el.width()};
128 | },
129 |
130 | shareButtons: shareButtons,
131 | getImageURLForShare: function( shareButtonData ) {
132 | if (shareButtonData.download && koken_options.download_full) {
133 | download_version = 'huge';
134 | if (koken_options.hidpi===true) {download_version = 'huge.2x'}
135 | return gallery.currItem[download_version].src;
136 | }
137 | return gallery.currItem.src || '';
138 | },
139 | shareEl: (shareButtons.length>0),
140 | // prevent zooming to 200x on retina devices (eg retina macbook pro, ipads)
141 | getDoubleTapZoom: function(){
142 | if (window.devicePixelRatio > 1) {
143 | return 0.5;
144 | } else {
145 | return 1;
146 | }
147 | },
148 | galleryPIDs: true,
149 | addCaptionHTMLFn: function(item, captionEl, isFake) {
150 | if (item['rating'] && !isFake) {
151 | $('button.pswp__button--rating span').attr('data-cid', item['rating'].cid).attr('data-average', item['rating'].average).attr('data-count', item['rating'].count);
152 | }
153 |
154 | if(!koken_options.showTitle || !item.title) {
155 | captionEl.children[0].innerHTML = '';
156 | return false;
157 | }
158 | captionEl.children[0].innerHTML = item.title + (item.caption ? '' + item.caption + ' ' : '');
159 | return true;
160 | }
161 | };
162 |
163 | if (fromURL) {
164 | if (options.galleryPIDs) {
165 | for (var j = 0;j < items.length; j++) {
166 | if(items[j].pid == index) {
167 | options.index = j;
168 | break;
169 | }
170 | }
171 | } else {
172 | options.index = parseInt(index,10) -1;
173 | }
174 | } else {
175 | options.index = parseInt(index,10);
176 | }
177 |
178 | if (isNaN(options.index)) {
179 | return;
180 | }
181 |
182 | if(disableAnimation) {
183 | options.showAnimationDuration = 0;
184 | }
185 |
186 | // If Items[0] has rating data, we enable the rating display in UI
187 | if (items[0].rating) {
188 | $('button.pswp__button--rating').removeClass('pswp__element--disabled');
189 | }
190 |
191 | // Pass data to PhotoSwipe and initialize it
192 | gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
193 |
194 | // create variable that will store real size of viewport
195 | var realViewportWidth,
196 | useImageSize = 'medium_large',
197 | firstResize = true,
198 | imageSrcWillChange;
199 |
200 | // beforeResize event fires each time size of gallery viewport updates
201 | gallery.listen('beforeResize', function() {
202 | // calculate real pixels when size changes
203 | max_size = koken_options.max_size;
204 | size_factor = isHighDensity() ? 2 : 1;
205 | realViewportWidth = gallery.viewportSize.x * size_factor;
206 |
207 | // Code below is needed if you want image to switch dynamically on window.resize
208 |
209 | // Find out if current images need to be changed
210 | if(realViewportWidth >=1600 && max_size >= 1600 && 'huge' in items[0]) {
211 | neededSize = 'huge';
212 | if(realViewportWidth >=2048 && max_size >= 2048 && koken_options.hidpi===true && size_factor==1) {
213 | neededSize = 'huge.2x';
214 | }
215 | } else if(realViewportWidth >= 1024 && max_size >= 1024 && 'xlarge' in items[0]) {
216 | neededSize = 'xlarge';
217 | } else if(realViewportWidth >= 800 && max_size >= 800 && 'large' in items[0]) {
218 | neededSize = 'large';
219 | } else {
220 | neededSize = 'medium_large';
221 | }
222 |
223 | // Invalidate items only when source is changed and when it's not the first update
224 | if (useImageSize != neededSize) {
225 | useImageSize = neededSize;
226 | if (!firstResize) {
227 | // invalidateCurrItems sets a flag on slides that are in DOM,
228 | // which will force update of content (image) on window.resize.
229 | gallery.invalidateCurrItems();
230 | }
231 | }
232 |
233 | firstResize = false;
234 | });
235 |
236 | // gettingData event fires each time PhotoSwipe retrieves image source & size
237 |
238 | gallery.listen('gettingData', function(index, item) {
239 |
240 | // Set image source & size based on real viewport width
241 | item.src = item[useImageSize].src;
242 | item.msrc = item['_common'].msrc.replace(".crop.",".");
243 | item.w = item[useImageSize].w;
244 | item.h = item[useImageSize].h;
245 |
246 | // It doesn't really matter what will you do here,
247 | // as long as item.src, item.w and item.h have valid values.
248 | //
249 | // Just avoid http requests in this listener, as it fires quite often
250 |
251 | });
252 |
253 | /*
254 | gallery.listen('imageLoadComplete', function(index, item) {
255 | console.log(index);
256 | console.dir(item);
257 | });
258 | */
259 |
260 | var scroll_move = null;
261 | var bind_move = false;
262 | if (typeof $K == 'object') {
263 | if (typeof $K.keyboard == 'object') {
264 | if (typeof $K.keyboard.scroll == 'object') {
265 | if (typeof $K.keyboard.scroll.move == "function") {
266 | scroll_move = $K.keyboard.scroll.move;
267 | $K.keyboard.scroll.move = function(){return true;};
268 | }
269 | }
270 | $("[data-bind-to-key]").each(function() {
271 | bind_move = true;
272 | var t = $(this), e = t.attr("data-bind-to-key");
273 | key.unbind(e);
274 | });
275 | }
276 | }
277 | gallery.listen('destroy',function(){
278 | if (bind_move === true){
279 | $K.keyboard.bind();
280 | }
281 | if (scroll_move) {
282 | $K.keyboard.scroll.move = scroll_move;
283 | scroll_move = null;
284 | }
285 | pswp_open = false;
286 | $('.pswp')[0].className = "pswp";
287 | if (pswp_open_orientation!=window.orientation) {
288 | initPS();
289 | }
290 | if (pswp_open_width!=$(window).width() || pswp_open_height!=$(window).height()) {
291 | initPS();
292 | }
293 | });
294 | gallery.init();
295 | pswp_open = true;
296 | pswp_open_orientation = window.orientation;
297 | pswp_open_width = $(window).width();
298 | pswp_open_height = $(window).height();
299 | };
300 |
301 | var isHighDensity = function(){
302 | if (koken_options.hidpi===false) {
303 | return false;
304 | }
305 | return ((window.matchMedia && (window.matchMedia('only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)').matches)) || (window.devicePixelRatio && window.devicePixelRatio > 1.3));
306 | };
307 |
308 | var initPS = function() {
309 | if (koken_options.usingPillar || koken_options.usingPjaxWithoutPillar) {
310 | setTimeout(runInitPS,500);
311 | } else {
312 | runInitPS();
313 | }
314 | };
315 | var runInitPS = function(){
316 |
317 | if (!pswp_open) {
318 | $('.pswp')[0].className = "pswp";
319 | $("a[data-pswp-uid]").removeAttr("data-pswp-upid");
320 | }
321 |
322 | var i = 0;
323 | if (koken_options.usingPillar && !koken_options.usingPjaxWithoutPillar) {
324 | if (size_group == "size_0" && typeof(start_size_group)=="undefined") {
325 | old_size_group = size_group;
326 | class_attr = $('div.pillar').attr('class');
327 | if (class_attr) {
328 | start_size_group = $.grep(class_attr.split(' '),function(v){return v!='pillar';})[0];
329 | }
330 | }
331 | if (orientation_changed) {
332 | if (size_group == "size_0") {
333 | size_group = start_size_group;
334 | }
335 | old_size_group = size_group;
336 | class_attr = $('div.pillar:not(.'+old_size_group+')').attr('class');
337 | if (class_attr) {
338 | size_group = $.grep(class_attr.split(' '),function(v){return v!='pillar';})[0];
339 | }
340 | orientation_changed = false;
341 | }
342 | galleryElements = $('div.pillar:not(.'+old_size_group+') '+koken_options.triggerEl);
343 | }
344 | else {
345 | galleryElements = $(koken_options.triggerEl);
346 | }
347 | if (!pswp_open) {
348 | galleryElements.each(function(){
349 | if ($(this).children("img").length > 0) {
350 | set_link($(this),i);
351 | i++;
352 | }
353 | });
354 | galleryElements.each(function(){
355 | if ($(this).attr("title")==koken_options.view_in_lightbox) {
356 | lb_url = $(this).attr("href");
357 | if (typeof lb_url != "undefined" && lb_url.length > 0 ) {
358 | lb_element = $(this);
359 | $('a[href="'+lb_url+'"]').each(function(){
360 | if ($(this).attr('data-pswp-uid') && $(this).children("img").length > 0 ) {
361 | set_link(lb_element,$(this).attr('data-pswp-uid'));
362 | }
363 | });
364 | }
365 | }
366 | });
367 | }
368 | };
369 | var set_link = function(el,i) {
370 | if (!el.parent().hasClass('type_video')) {
371 | el.click(function(e) {
372 | openPhotoSwipe(el.first().attr('data-pswp-uid'));
373 | return false;
374 | });
375 | }
376 | el.attr('data-pswp-uid', i);
377 | };
378 | var koken_options = options;
379 | var pswp_open = false;
380 | var pswp_open_orientation;
381 | var orientation_changed = false;
382 | var orientation = window.orientation;
383 | var size_group = "size_0", old_size_group, start_size_group;
384 |
385 | var galleryElements = $(koken_options.triggerEl);
386 |
387 | var last_resize = 0;
388 | $(window).on('k-resize',function(){
389 | if ((Date.now()-last_resize>1000)) {
390 | last_resize = Date.now();
391 | initPS();
392 | }
393 | });
394 |
395 | if (koken_options.usingPillar || koken_options.usingPjaxWithoutPillar) {
396 | $(document).on('pjax:end', function(){
397 | initPS();
398 | });
399 | $(window).on('orientationchange', function(){
400 | if (window.orientation != orientation) {
401 | orientation_changed = true;
402 | orientation = window.orientation;
403 | initPS();
404 | }
405 | else {
406 | orientation_changed = false;
407 | }
408 | });
409 | $(window).on('k-infinite-loaded',function(){
410 | initPS();
411 | });
412 | initPS();
413 | }
414 | else {
415 | initPS();
416 | }
417 |
418 | // Parse URL and open gallery if it contains #&pid=3&gid=1
419 | var hashData = photoswipeParseHash();
420 | if(hashData.pid && hashData.gid) {
421 | openPhotoSwipe( hashData.pid, true, true );
422 | }
423 |
424 | };
425 |
--------------------------------------------------------------------------------
/pswp/photoswipe.min.js:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe - v4.1.2 - 2017-04-05
2 | * http://photoswipe.com
3 | * Copyright (c) 2017 Dmitry Semenov; */
4 | !function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipe=b()}(this,function(){"use strict";var a=function(a,b,c,d){var e={features:null,bind:function(a,b,c,d){var e=(d?"remove":"add")+"EventListener";b=b.split(" ");for(var f=0;f0&&(g=parseInt(g[1],10),g>=1&&g<8&&(d.isOldIOSPhone=!0))}var h=f.match(/Android\s([0-9\.]*)/),i=h?h[1]:0;i=parseFloat(i),i>=1&&(i<4.4&&(d.isOldAndroid=!0),d.androidVersion=i),d.isMobileOpera=/opera mini|opera mobi/i.test(f)}for(var j,k,l=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],n=0;n<4;n++){c=m[n];for(var o=0;o<3;o++)j=l[o],k=c+(c?j.charAt(0).toUpperCase()+j.slice(1):j),!d[j]&&k in b&&(d[j]=k);c&&!d.raf&&(c=c.toLowerCase(),d.raf=window[c+"RequestAnimationFrame"],d.raf&&(d.caf=window[c+"CancelAnimationFrame"]||window[c+"CancelRequestAnimationFrame"]))}if(!d.raf){var p=0;d.raf=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-p)),d=window.setTimeout(function(){a(b+c)},c);return p=b+c,d},d.caf=function(a){clearTimeout(a)}}return d.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,e.features=d,d}};e.detectFeatures(),e.features.oldIE&&(e.bind=function(a,b,c,d){b=b.split(" ");for(var e,f=(d?"detach":"attach")+"Event",g=function(){c.handleEvent.call(c)},h=0;hb-1?a-b:a<0?b+a:a},Ba={},Ca=function(a,b){return Ba[a]||(Ba[a]=[]),Ba[a].push(b)},Da=function(a){var b=Ba[a];if(b){var c=Array.prototype.slice.call(arguments);c.shift();for(var d=0;df.currItem.fitRatio?ya||(mc(f.currItem,!1,!0),ya=!0):ya&&(mc(f.currItem),ya=!1)),Ga(ea,pa.x,pa.y,s))},Ia=function(a){a.container&&Ga(a.container.style,a.initialPosition.x,a.initialPosition.y,a.initialZoomLevel,a)},Ja=function(a,b){b[E]=u+a+"px, 0px"+v},Ka=function(a,b){if(!i.loop&&b){var c=m+(ta.x*ra-a)/ta.x,d=Math.round(a-tb.x);(c<0&&d>0||c>=ac()-1&&d<0)&&(a=tb.x+d*i.mainScrollEndFriction)}tb.x=a,Ja(a,n)},La=function(a,b){var c=ub[a]-sa[a];return oa[a]+na[a]+c-c*(b/t)},Ma=function(a,b){a.x=b.x,a.y=b.y,b.id&&(a.id=b.id)},Na=function(a){a.x=Math.round(a.x),a.y=Math.round(a.y)},Oa=null,Pa=function(){Oa&&(e.unbind(document,"mousemove",Pa),e.addClass(a,"pswp--has_mouse"),i.mouseUsed=!0,Da("mouseUsed")),Oa=setTimeout(function(){Oa=null},100)},Qa=function(){e.bind(document,"keydown",f),N.transform&&e.bind(f.scrollWrap,"click",f),i.mouseUsed||e.bind(document,"mousemove",Pa),e.bind(window,"resize scroll orientationchange",f),Da("bindEvents")},Ra=function(){e.unbind(window,"resize scroll orientationchange",f),e.unbind(window,"scroll",r.scroll),e.unbind(document,"keydown",f),e.unbind(document,"mousemove",Pa),N.transform&&e.unbind(f.scrollWrap,"click",f),V&&e.unbind(window,p,f),clearTimeout(O),Da("unbindEvents")},Sa=function(a,b){var c=ic(f.currItem,qa,a);return b&&(da=c),c},Ta=function(a){return a||(a=f.currItem),a.initialZoomLevel},Ua=function(a){return a||(a=f.currItem),a.w>0?i.maxSpreadZoom:1},Va=function(a,b,c,d){return d===f.currItem.initialZoomLevel?(c[a]=f.currItem.initialPosition[a],!0):(c[a]=La(a,d),c[a]>b.min[a]?(c[a]=b.min[a],!0):c[a]1?1:a.fitRatio,c=a.container.style,d=b*a.w,e=b*a.h;c.width=d+"px",c.height=e+"px",c.left=a.initialPosition.x+"px",c.top=a.initialPosition.y+"px"},Ha=function(){if(ea){var a=ea,b=f.currItem,c=b.fitRatio>1?1:b.fitRatio,d=c*b.w,e=c*b.h;a.width=d+"px",a.height=e+"px",a.left=pa.x+"px",a.top=pa.y+"px"}}},Xa=function(a){var b="";i.escKey&&27===a.keyCode?b="close":i.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next")),b&&(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||(a.preventDefault?a.preventDefault():a.returnValue=!1,f[b]()))},Ya=function(a){a&&(Y||X||fa||T)&&(a.preventDefault(),a.stopPropagation())},Za=function(){f.setScrollOffset(0,e.getScrollY())},$a={},_a=0,ab=function(a){$a[a]&&($a[a].raf&&I($a[a].raf),_a--,delete $a[a])},bb=function(a){$a[a]&&ab(a),$a[a]||(_a++,$a[a]={})},cb=function(){for(var a in $a)$a.hasOwnProperty(a)&&ab(a)},db=function(a,b,c,d,e,f,g){var h,i=Ea();bb(a);var j=function(){if($a[a]){if(h=Ea()-i,h>=d)return ab(a),f(c),void(g&&g());f((c-b)*e(h/d)+b),$a[a].raf=H(j)}};j()},eb={shout:Da,listen:Ca,viewportSize:qa,options:i,isMainScrollAnimating:function(){return fa},getZoomLevel:function(){return s},getCurrentIndex:function(){return m},isDragging:function(){return V},isZooming:function(){return aa},setScrollOffset:function(a,b){sa.x=a,M=sa.y=b,Da("updateScrollOffset",sa)},applyZoomPan:function(a,b,c,d){pa.x=b,pa.y=c,s=a,Ha(d)},init:function(){if(!j&&!k){var c;f.framework=e,f.template=a,f.bg=e.getChildByClass(a,"pswp__bg"),J=a.className,j=!0,N=e.detectFeatures(),H=N.raf,I=N.caf,E=N.transform,L=N.oldIE,f.scrollWrap=e.getChildByClass(a,"pswp__scroll-wrap"),f.container=e.getChildByClass(f.scrollWrap,"pswp__container"),n=f.container.style,f.itemHolders=y=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],y[0].el.style.display=y[2].el.style.display="none",Wa(),r={resize:f.updateSize,orientationchange:function(){clearTimeout(O),O=setTimeout(function(){qa.x!==f.scrollWrap.clientWidth&&f.updateSize()},500)},scroll:Za,keydown:Xa,click:Ya};var d=N.isOldIOSPhone||N.isOldAndroid||N.isMobileOpera;for(N.animationName&&N.transform&&!d||(i.showAnimationDuration=i.hideAnimationDuration=0),c=0;c=ac())&&(m=0),f.currItem=_b(m),(N.isOldIOSPhone||N.isOldAndroid)&&(va=!1),a.setAttribute("aria-hidden","false"),i.modal&&(va?a.style.position="fixed":(a.style.position="absolute",a.style.top=e.getScrollY()+"px")),void 0===M&&(Da("initialLayout"),M=K=e.getScrollY());var l="pswp--open ";for(i.mainClass&&(l+=i.mainClass+" "),i.showHideOpacity&&(l+="pswp--animate_opacity "),l+=G?"pswp--touch":"pswp--notouch",l+=N.animationName?" pswp--css_animation":"",l+=N.svg?" pswp--svg":"",e.addClass(a,l),f.updateSize(),o=-1,ua=null,c=0;cda.min.x?a=da.min.x:ada.min.y?b=da.min.y:b=h&&(o+=ua+(ua>0?-h:h),c=h);for(var d=0;d0?(b=y.shift(),y[h-1]=b,o++,Ja((o+2)*ta.x,b.el.style),f.setContent(b,m-c+d+1+1)):(b=y.pop(),y.unshift(b),o--,Ja(o*ta.x,b.el.style),f.setContent(b,m+c-d-1-1));if(ea&&1===Math.abs(ua)){var e=_b(z);e.initialZoomLevel!==s&&(ic(e,qa),mc(e),Ia(e))}ua=0,f.updateCurrZoomItem(),z=m,Da("afterChange")}}},updateSize:function(b){if(!va&&i.modal){var c=e.getScrollY();if(M!==c&&(a.style.top=c+"px",M=c),!b&&xa.x===window.innerWidth&&xa.y===window.innerHeight)return;xa.x=window.innerWidth,xa.y=window.innerHeight,a.style.height=xa.y+"px"}if(qa.x=f.scrollWrap.clientWidth,qa.y=f.scrollWrap.clientHeight,Za(),ta.x=qa.x+Math.round(qa.x*i.spacing),ta.y=qa.y,Ka(ta.x*ra),Da("beforeResize"),void 0!==o){for(var d,g,j,k=0;k2&&(j=Aa(j)),g=_b(j),g&&(x||g.needsUpdate||!g.bounds)?(f.cleanSlide(g),f.setContent(d,j),1===k&&(f.currItem=g,f.updateCurrZoomItem(!0)),g.needsUpdate=!1):d.index===-1&&j>=0&&f.setContent(d,j),g&&g.container&&(ic(g,qa),mc(g),Ia(g));x=!1}t=s=f.currItem.initialZoomLevel,da=f.currItem.bounds,da&&(pa.x=da.center.x,pa.y=da.center.y,Ha(!0)),Da("resize")},zoomTo:function(a,b,c,d,f){b&&(t=s,ub.x=Math.abs(b.x)-pa.x,ub.y=Math.abs(b.y)-pa.y,Ma(oa,pa));var g=Sa(a,!1),h={};Va("x",g,h,a),Va("y",g,h,a);var i=s,j={x:pa.x,y:pa.y};Na(h);var k=function(b){1===b?(s=a,pa.x=h.x,pa.y=h.y):(s=(a-i)*b+i,pa.x=(h.x-j.x)*b+j.x,pa.y=(h.y-j.y)*b+j.y),f&&f(b),Ha(1===b)};c?db("customZoomTo",0,1,c,d||e.easing.sine.inOut,k):k(1)}},fb=30,gb=10,hb={},ib={},jb={},kb={},lb={},mb=[],nb={},ob=[],pb={},qb=0,rb=ma(),sb=0,tb=ma(),ub=ma(),vb=ma(),wb=function(a,b){return a.x===b.x&&a.y===b.y},xb=function(a,b){return Math.abs(a.x-b.x)-1)&&(b(a)?a:Cb(a.parentNode,b)))},Db={},Eb=function(a,b){return Db.prevent=!Cb(a.target,i.isClickableElement),Da("preventDragEvent",a,b,Db),Db.prevent},Fb=function(a,b){return b.x=a.pageX,b.y=a.pageY,b.id=a.identifier,b},Gb=function(a,b,c){c.x=.5*(a.x+b.x),c.y=.5*(a.y+b.y)},Hb=function(a,b,c){if(a-Q>50){var d=ob.length>2?ob.shift():{};d.x=b,d.y=c,ob.push(d),Q=a}},Ib=function(){var a=pa.y-f.currItem.initialPosition.y;return 1-Math.abs(a/(qa.y/2))},Jb={},Kb={},Lb=[],Mb=function(a){for(;Lb.length>0;)Lb.pop();return F?(la=0,mb.forEach(function(a){0===la?Lb[0]=a:1===la&&(Lb[1]=a),la++})):a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(Lb[0]=Fb(a.touches[0],Jb),a.touches.length>1&&(Lb[1]=Fb(a.touches[1],Kb))):(Jb.x=a.pageX,Jb.y=a.pageY,Jb.id="",Lb[0]=Jb),Lb},Nb=function(a,b){var c,d,e,g,h=0,j=pa[a]+b[a],k=b[a]>0,l=tb.x+b.x,m=tb.x-nb.x;return c=j>da.min[a]||jda.min[a]&&(c=i.panEndFriction,h=da.min[a]-j,d=da.min[a]-oa[a]),(d<=0||m<0)&&ac()>1?(g=l,m<0&&l>nb.x&&(g=nb.x)):da.min.x!==da.max.x&&(e=j)):(j0)&&ac()>1?(g=l,m>0&&lf.currItem.fitRatio&&(pa[a]+=b[a]*c)):(void 0!==g&&(Ka(g,!0),$=g!==nb.x),da.min.x!==da.max.x&&(void 0!==e?pa.x=e:$||(pa.x+=b.x*c)),void 0!==g)},Ob=function(a){if(!("mousedown"===a.type&&a.button>0)){if($b)return void a.preventDefault();if(!U||"mousedown"!==a.type){if(Eb(a,!0)&&a.preventDefault(),Da("pointerDown"),F){var b=e.arraySearch(mb,a.pointerId,"id");b<0&&(b=mb.length),mb[b]={x:a.pageX,y:a.pageY,id:a.pointerId}}var c=Mb(a),d=c.length;_=null,cb(),V&&1!==d||(V=ha=!0,e.bind(window,p,f),S=ka=ia=T=$=Y=W=X=!1,ga=null,Da("firstTouchStart",c),Ma(oa,pa),na.x=na.y=0,Ma(kb,c[0]),Ma(lb,kb),nb.x=ta.x*ra,ob=[{x:kb.x,y:kb.y}],Q=P=Ea(),Sa(s,!0),zb(),Ab()),!aa&&d>1&&!fa&&!$&&(t=s,X=!1,aa=W=!0,na.y=na.x=0,Ma(oa,pa),Ma(hb,c[0]),Ma(ib,c[1]),Gb(hb,ib,vb),ub.x=Math.abs(vb.x)-pa.x,ub.y=Math.abs(vb.y)-pa.y,ba=ca=yb(hb,ib))}}},Pb=function(a){if(a.preventDefault(),F){var b=e.arraySearch(mb,a.pointerId,"id");if(b>-1){var c=mb[b];c.x=a.pageX,c.y=a.pageY}}if(V){var d=Mb(a);if(ga||Y||aa)_=d;else if(tb.x!==ta.x*ra)ga="h";else{var f=Math.abs(d[0].x-kb.x)-Math.abs(d[0].y-kb.y);Math.abs(f)>=gb&&(ga=f>0?"h":"v",_=d)}}},Qb=function(){if(_){var a=_.length;if(0!==a)if(Ma(hb,_[0]),jb.x=hb.x-kb.x,jb.y=hb.y-kb.y,aa&&a>1){if(kb.x=hb.x,kb.y=hb.y,!jb.x&&!jb.y&&wb(_[1],ib))return;Ma(ib,_[1]),X||(X=!0,Da("zoomGestureStarted"));var b=yb(hb,ib),c=Vb(b);c>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(ka=!0);var d=1,e=Ta(),g=Ua();if(c1&&(d=1),c=e-d*(e/3);else c>g&&(d=(c-g)/(6*e),d>1&&(d=1),c=g+d*e);d<0&&(d=0),ba=b,Gb(hb,ib,rb),na.x+=rb.x-vb.x,na.y+=rb.y-vb.y,Ma(vb,rb),pa.x=La("x",c),pa.y=La("y",c),S=c>s,s=c,Ha()}else{if(!ga)return;if(ha&&(ha=!1,Math.abs(jb.x)>=gb&&(jb.x-=_[0].x-lb.x),Math.abs(jb.y)>=gb&&(jb.y-=_[0].y-lb.y)),kb.x=hb.x,kb.y=hb.y,0===jb.x&&0===jb.y)return;if("v"===ga&&i.closeOnVerticalDrag&&!Bb()){na.y+=jb.y,pa.y+=jb.y;var k=Ib();return T=!0,Da("onVerticalDrag",k),Fa(k),void Ha()}Hb(Ea(),hb.x,hb.y),Y=!0,da=f.currItem.bounds;var l=Nb("x",jb);l||(Nb("y",jb),Na(pa),Ha())}}},Rb=function(a){if(N.isOldAndroid){if(U&&"mouseup"===a.type)return;a.type.indexOf("touch")>-1&&(clearTimeout(U),U=setTimeout(function(){U=0},600))}Da("pointerUp"),Eb(a,!1)&&a.preventDefault();var b;if(F){var c=e.arraySearch(mb,a.pointerId,"id");if(c>-1)if(b=mb.splice(c,1)[0],navigator.pointerEnabled)b.type=a.pointerType||"mouse";else{var d={4:"mouse",2:"touch",3:"pen"};b.type=d[a.pointerType],b.type||(b.type=a.pointerType||"mouse")}}var g,h=Mb(a),j=h.length;if("mouseup"===a.type&&(j=0),2===j)return _=null,!0;1===j&&Ma(lb,h[0]),0!==j||ga||fa||(b||("mouseup"===a.type?b={x:a.pageX,y:a.pageY,type:"mouse"}:a.changedTouches&&a.changedTouches[0]&&(b={x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY,type:"touch"})),Da("touchRelease",a,b));var k=-1;if(0===j&&(V=!1,e.unbind(window,p,f),zb(),aa?k=0:sb!==-1&&(k=Ea()-sb)),sb=1===j?Ea():-1,g=k!==-1&&k<150?"zoom":"swipe",aa&&j<2&&(aa=!1,1===j&&(g="zoomPointerUp"),Da("zoomGestureEnded")),_=null,Y||X||fa||T)if(cb(),R||(R=Sb()),R.calculateSwipeSpeed("x"),T){var l=Ib();if(lf.currItem.fitRatio&&Tb(R))}},Sb=function(){var a,b,c={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(d){ob.length>1?(a=Ea()-Q+50,b=ob[ob.length-2][d]):(a=Ea()-P,b=lb[d]),c.lastFlickOffset[d]=kb[d]-b,c.lastFlickDist[d]=Math.abs(c.lastFlickOffset[d]),c.lastFlickDist[d]>20?c.lastFlickSpeed[d]=c.lastFlickOffset[d]/a:c.lastFlickSpeed[d]=0,Math.abs(c.lastFlickSpeed[d])<.1&&(c.lastFlickSpeed[d]=0),c.slowDownRatio[d]=.95,c.slowDownRatioReverse[d]=1-c.slowDownRatio[d],c.speedDecelerationRatio[d]=1},calculateOverBoundsAnimOffset:function(a,b){c.backAnimStarted[a]||(pa[a]>da.min[a]?c.backAnimDestination[a]=da.min[a]:pa[a]fb&&(h||b.lastFlickOffset.x>20)?d=-1:g<-fb&&(h||b.lastFlickOffset.x<-20)&&(d=1)}var j;d&&(m+=d,m<0?(m=i.loop?ac()-1:0,j=!0):m>=ac()&&(m=i.loop?0:ac()-1,j=!0),j&&!i.loop||(ua+=d,ra-=d,c=!0));var k,l=ta.x*ra,n=Math.abs(l-tb.x);return c||l>tb.x==b.lastFlickSpeed.x>0?(k=Math.abs(b.lastFlickSpeed.x)>0?n/Math.abs(b.lastFlickSpeed.x):333,k=Math.min(k,400),k=Math.max(k,250)):k=333,qb===m&&(c=!1),fa=!0,Da("mainScrollAnimStart"),db("mainScroll",tb.x,l,k,e.easing.cubic.out,Ka,function(){cb(),fa=!1,qb=-1,(c||qb!==m)&&f.updateCurrItem(),Da("mainScrollAnimComplete")}),c&&f.updateCurrItem(!0),c},Vb=function(a){return 1/ca*a*t},Wb=function(){var a=s,b=Ta(),c=Ua();sc&&(a=c);var d,g=1,h=ja;return ia&&!S&&!ka&&s1||navigator.msMaxTouchPoints>1),f.likelyTouchDevice=G,r[A]=Ob,r[B]=Pb,r[C]=Rb,D&&(r[D]=r[C]),N.touch&&(q+=" mousedown",p+=" mousemove mouseup",r.mousedown=r[A],r.mousemove=r[B],r.mouseup=r[C]),G||(i.allowPanToNext=!1)}}});var Xb,Yb,Zb,$b,_b,ac,bc,cc=function(b,c,d,g){Xb&&clearTimeout(Xb),$b=!0,Zb=!0;var h;b.initialLayout?(h=b.initialLayout,b.initialLayout=null):h=i.getThumbBoundsFn&&i.getThumbBoundsFn(m);var j=d?i.hideAnimationDuration:i.showAnimationDuration,k=function(){ab("initialZoom"),d?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Fa(1),c&&(c.style.display="block"),e.addClass(a,"pswp--animated-in"),Da("initialZoom"+(d?"OutEnd":"InEnd"))),g&&g(),$b=!1};if(!j||!h||void 0===h.x)return Da("initialZoom"+(d?"Out":"In")),s=b.initialZoomLevel,Ma(pa,b.initialPosition),Ha(),a.style.opacity=d?0:1,Fa(1),void(j?setTimeout(function(){k()},j):k());var n=function(){var c=l,g=!f.currItem.src||f.currItem.loadError||i.showHideOpacity;b.miniImg&&(b.miniImg.style.webkitBackfaceVisibility="hidden"),d||(s=h.w/b.w,pa.x=h.x,pa.y=h.y-K,f[g?"template":"bg"].style.opacity=.001,Ha()),bb("initialZoom"),d&&!c&&e.removeClass(a,"pswp--animated-in"),g&&(d?e[(c?"remove":"add")+"Class"](a,"pswp--animate_opacity"):setTimeout(function(){e.addClass(a,"pswp--animate_opacity")},30)),Xb=setTimeout(function(){if(Da("initialZoom"+(d?"Out":"In")),d){var f=h.w/b.w,i={x:pa.x,y:pa.y},l=s,m=ja,n=function(b){1===b?(s=f,pa.x=h.x,pa.y=h.y-M):(s=(f-l)*b+l,pa.x=(h.x-i.x)*b+i.x,pa.y=(h.y-M-i.y)*b+i.y),Ha(),g?a.style.opacity=1-b:Fa(m-b*m)};c?db("initialZoom",0,1,j,e.easing.cubic.out,n,k):(n(1),Xb=setTimeout(k,j+20))}else s=b.initialZoomLevel,Ma(pa,b.initialPosition),Ha(),Fa(1),g?a.style.opacity=1:Fa(1),Xb=setTimeout(k,j+20)},d?25:90)};n()},dc={},ec=[],fc={index:0,errorMsg:'',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Yb.length}},gc=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},hc=function(a,b,c){var d=a.bounds;d.center.x=Math.round((dc.x-b)/2),d.center.y=Math.round((dc.y-c)/2)+a.vGap.top,d.max.x=b>dc.x?Math.round(dc.x-b):d.center.x,d.max.y=c>dc.y?Math.round(dc.y-c)+a.vGap.top:d.center.y,d.min.x=b>dc.x?0:d.center.x,d.min.y=c>dc.y?a.vGap.top:d.center.y},ic=function(a,b,c){if(a.src&&!a.loadError){var d=!c;if(d&&(a.vGap||(a.vGap={top:0,bottom:0}),Da("parseVerticalMargin",a)),dc.x=b.x,dc.y=b.y-a.vGap.top-a.vGap.bottom,d){var e=dc.x/a.w,f=dc.y/a.h;a.fitRatio=e1&&(c=1),a.initialZoomLevel=c,a.bounds||(a.bounds=gc())}if(!c)return;return hc(a,a.w*c,a.h*c),d&&c===a.initialZoomLevel&&(a.initialPosition=a.bounds.center),a.bounds}return a.w=a.h=0,a.initialZoomLevel=a.fitRatio=1,a.bounds=gc(),a.initialPosition=a.bounds.center,a.bounds},jc=function(a,b,c,d,e,g){b.loadError||d&&(b.imageAppended=!0,mc(b,d,b===f.currItem&&ya),c.appendChild(d),g&&setTimeout(function(){b&&b.loaded&&b.placeholder&&(b.placeholder.style.display="none",b.placeholder=null)},500))},kc=function(a){a.loading=!0,a.loaded=!1;var b=a.img=e.createEl("pswp__img","img"),c=function(){a.loading=!1,a.loaded=!0,a.loadComplete?a.loadComplete(a):a.img=null,b.onload=b.onerror=null,b=null};return b.onload=c,b.onerror=function(){a.loadError=!0,c()},b.src=a.src,b},lc=function(a,b){if(a.src&&a.loadError&&a.container)return b&&(a.container.innerHTML=""),a.container.innerHTML=i.errorMsg.replace("%url%",a.src),!0},mc=function(a,b,c){if(a.src){b||(b=a.container.lastChild);var d=c?a.w:Math.round(a.w*a.fitRatio),e=c?a.h:Math.round(a.h*a.fitRatio);a.placeholder&&!a.loaded&&(a.placeholder.style.width=d+"px",a.placeholder.style.height=e+"px"),b.style.width=d+"px",b.style.height=e+"px"}},nc=function(){if(ec.length){for(var a,b=0;b=0,e=Math.min(c[0],ac()),g=Math.min(c[1],ac());for(b=1;b<=(d?g:e);b++)f.lazyLoadItem(m+b);for(b=1;b<=(d?e:g);b++)f.lazyLoadItem(m-b)}),Ca("initialLayout",function(){f.currItem.initialLayout=i.getThumbBoundsFn&&i.getThumbBoundsFn(m)}),Ca("mainScrollAnimComplete",nc),Ca("initialZoomInEnd",nc),Ca("destroy",function(){for(var a,b=0;b=0&&(void 0!==Yb[a]&&Yb[a])},allowProgressiveImg:function(){return i.forceProgressiveLoading||!G||i.mouseUsed||screen.width>1200},setContent:function(a,b){i.loop&&(b=Aa(b));var c=f.getItemAt(a.index);c&&(c.container=null);var d,g=f.getItemAt(b);if(!g)return void(a.el.innerHTML="");Da("gettingData",b,g),a.index=b,a.item=g;var h=g.container=e.createEl("pswp__zoom-wrap");if(!g.src&&g.html&&(g.html.tagName?h.appendChild(g.html):h.innerHTML=g.html),lc(g),ic(g,qa),!g.src||g.loadError||g.loaded)g.src&&!g.loadError&&(d=e.createEl("pswp__img","img"),d.style.opacity=1,d.src=g.src,mc(g,d),jc(b,g,h,d,!0));else{if(g.loadComplete=function(c){if(j){if(a&&a.index===b){if(lc(c,!0))return c.loadComplete=c.img=null,ic(c,qa),Ia(c),void(a.index===m&&f.updateCurrZoomItem());c.imageAppended?!$b&&c.placeholder&&(c.placeholder.style.display="none",c.placeholder=null):N.transform&&(fa||$b)?ec.push({item:c,baseDiv:h,img:c.img,index:b,holder:a,clearPlaceholder:!0}):jc(b,c,h,c.img,fa||$b,!0)}c.loadComplete=null,c.img=null,Da("imageLoadComplete",b,c)}},e.features.transform){var k="pswp__img pswp__img--placeholder";k+=g.msrc?"":" pswp__img--placeholder--blank";var l=e.createEl(k,g.msrc?"img":"");g.msrc&&(l.src=g.msrc),mc(g,l),h.appendChild(l),g.placeholder=l}g.loading||kc(g),f.allowProgressiveImg()&&(!Zb&&N.transform?ec.push({item:g,baseDiv:h,img:g.img,index:b,holder:a}):jc(b,g,h,g.img,!0,!0))}Zb||b!==m?Ia(g):(ea=h.style,cc(g,d||g.img)),a.el.innerHTML="",a.el.appendChild(h)},cleanSlide:function(a){a.img&&(a.img.onload=a.img.onerror=null),a.loaded=a.loading=a.img=a.imageAppended=!1}}});var oc,pc={},qc=function(a,b,c){var d=document.createEvent("CustomEvent"),e={origEvent:a,target:a.target,releasePoint:b,pointerType:c||"touch"};d.initCustomEvent("pswpTap",!0,!0,e),a.target.dispatchEvent(d)};za("Tap",{publicMethods:{initTap:function(){Ca("firstTouchStart",f.onTapStart),Ca("touchRelease",f.onTapRelease),Ca("destroy",function(){pc={},oc=null})},onTapStart:function(a){a.length>1&&(clearTimeout(oc),oc=null)},onTapRelease:function(a,b){if(b&&!Y&&!W&&!_a){var c=b;if(oc&&(clearTimeout(oc),oc=null,xb(c,pc)))return void Da("doubleTap",c);if("mouse"===b.type)return void qc(a,b,"mouse");var d=a.target.tagName.toUpperCase();if("BUTTON"===d||e.hasClass(a.target,"pswp__single-tap"))return void qc(a,b);Ma(pc,c),oc=setTimeout(function(){qc(a,b),oc=null},300)}}}});var rc;za("DesktopZoom",{publicMethods:{initDesktopZoom:function(){L||(G?Ca("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(b){rc={};var c="wheel mousewheel DOMMouseScroll";Ca("bindEvents",function(){e.bind(a,c,f.handleMouseWheel)}),Ca("unbindEvents",function(){rc&&e.unbind(a,c,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var d,g=function(){f.mouseZoomedIn&&(e.removeClass(a,"pswp--zoomed-in"),f.mouseZoomedIn=!1),s<1?e.addClass(a,"pswp--zoom-allowed"):e.removeClass(a,"pswp--zoom-allowed"),h()},h=function(){d&&(e.removeClass(a,"pswp--dragging"),d=!1)};Ca("resize",g),Ca("afterChange",g),Ca("pointerDown",function(){f.mouseZoomedIn&&(d=!0,e.addClass(a,"pswp--dragging"))}),Ca("pointerUp",h),b||g()},handleMouseWheel:function(a){if(s<=f.currItem.fitRatio)return i.modal&&(!i.closeOnScroll||_a||V?a.preventDefault():E&&Math.abs(a.deltaY)>2&&(l=!0,f.close())),!0;if(a.stopPropagation(),rc.x=0,"deltaX"in a)1===a.deltaMode?(rc.x=18*a.deltaX,rc.y=18*a.deltaY):(rc.x=a.deltaX,rc.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(rc.x=-.16*a.wheelDeltaX),a.wheelDeltaY?rc.y=-.16*a.wheelDeltaY:rc.y=-.16*a.wheelDelta;else{if(!("detail"in a))return;rc.y=a.detail}Sa(s,!0);var b=pa.x-rc.x,c=pa.y-rc.y;(i.modal||b<=da.min.x&&b>=da.max.x&&c<=da.min.y&&c>=da.max.y)&&a.preventDefault(),f.panTo(b,c)},toggleDesktopZoom:function(b){b=b||{x:qa.x/2+sa.x,y:qa.y/2+sa.y};var c=i.getDoubleTapZoom(!0,f.currItem),d=s===c;f.mouseZoomedIn=!d,f.zoomTo(d?f.currItem.initialZoomLevel:c,b,333),e[(d?"remove":"add")+"Class"](a,"pswp--zoomed-in")}}});var sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc,Ec={history:!0,galleryUID:1},Fc=function(){return Cc.hash.substring(1)},Gc=function(){sc&&clearTimeout(sc),uc&&clearTimeout(uc)},Hc=function(){var a=Fc(),b={};if(a.length<5)return b;var c,d=a.split("&");for(c=0;c-1&&(yc=yc.split("&gid=")[0],yc=yc.split("?gid=")[0]),Ca("afterChange",f.updateURL),Ca("unbindEvents",function(){e.unbind(window,"hashchange",f.onHashChange)});var a=function(){xc=!0,Ac||(Bc?history.back():yc?Cc.hash=yc:Dc?history.pushState("",document.title,Cc.pathname+Cc.search):Cc.hash=""),Gc()};Ca("unbindEvents",function(){l&&a()}),Ca("destroy",function(){xc||a()}),Ca("firstUpdate",function(){m=Hc().pid});var b=yc.indexOf("pid=");b>-1&&(yc=yc.substring(0,b),"&"===yc.slice(-1)&&(yc=yc.slice(0,-1))),setTimeout(function(){j&&e.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){return Fc()===yc?(Ac=!0,void f.close()):void(vc||(wc=!0,f.goTo(Hc().pid),wc=!1))},updateURL:function(){Gc(),wc||(zc?sc=setTimeout(Ic,800):Ic())}}}),e.extend(f,eb)};return a});
--------------------------------------------------------------------------------