├── photoswipe
├── default-skin
│ ├── preloader.gif
│ ├── default-skin.png
│ ├── default-skin.svg
│ └── default-skin.css
├── COMMIT_ID
├── photoswipe.css
├── photoswipe-ui-default.min.js
├── photoswipe-ui-default.js
├── photoswipe.min.js
└── photoswipe.js
├── README.md
├── demo.html
└── photoswipe-flickr.js
/photoswipe/default-skin/preloader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyoshenka/photoswipe-flickr/HEAD/photoswipe/default-skin/preloader.gif
--------------------------------------------------------------------------------
/photoswipe/default-skin/default-skin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lyoshenka/photoswipe-flickr/HEAD/photoswipe/default-skin/default-skin.png
--------------------------------------------------------------------------------
/photoswipe/COMMIT_ID:
--------------------------------------------------------------------------------
1 | the commit that I copied this from https://github.com/dimsemenov/PhotoSwipe
2 | 41ff96cb8e88ef6f884c388db9f2a6d5e9d3b77a
3 | v4.1.1
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # photoswipe-flickr
2 |
3 | Show a Flickr album as a slideshow using [Photoswipe](http://photoswipe.com/).
4 |
5 | ## Usage
6 |
7 | ### Get a Flickr API key (if you don't already have one)
8 |
9 | [Create a new api key](https://www.flickr.com/services/apps/create/apply/?). You only need the `key` part, not the `secret`.
10 |
11 | ### Get the album ID
12 |
13 | Open the photoset in Flickr, then look at the URL. It should look something like `https://www.flickr.com/photos/your_name/sets/7225764364613184/`. That
14 | string of numbers at the end is the album ID.
15 |
16 | ### Check the demo
17 |
18 | [Live demo here](http://lyoshenka.github.io/photoswipe-flickr/demo.html#key=4ca3b9ef09d104c57ecd6f017d7d6c42&aid=72157648364623184)
19 |
20 | Look at the [source for the demo](https://github.com/lyoshenka/photoswipe-flickr/blob/master/demo.html) for a very simple example of how to set everything up. The
21 | important parts are to include `photoswipe-flickr.js` after you include the photoswipe JS, and then to call `photoswipeFlickr()` with your API key and
22 | album ID (and options for the photoswipe gallery, if you want). There's also a bit of extra code to reopen the gallery after it has been closed, but
23 | that's optional.
24 |
25 | Here's [another demo](http://i.grin.io/iceland/slideshow.html) of the slideslow in action.
26 |
27 | ## Bugs/Feedback
28 |
29 | Email me: alex@grin.io
30 |
--------------------------------------------------------------------------------
/photoswipe/default-skin/default-skin.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/photoswipe/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-backface-visibility: hidden;
70 | will-change: opacity; }
71 |
72 | .pswp__scroll-wrap {
73 | position: absolute;
74 | left: 0;
75 | top: 0;
76 | width: 100%;
77 | height: 100%;
78 | overflow: hidden; }
79 |
80 | .pswp__container,
81 | .pswp__zoom-wrap {
82 | -ms-touch-action: none;
83 | touch-action: none;
84 | position: absolute;
85 | left: 0;
86 | right: 0;
87 | top: 0;
88 | bottom: 0; }
89 |
90 | /* Prevent selection and tap highlights */
91 | .pswp__container,
92 | .pswp__img {
93 | -webkit-user-select: none;
94 | -moz-user-select: none;
95 | -ms-user-select: none;
96 | user-select: none;
97 | -webkit-tap-highlight-color: transparent;
98 | -webkit-touch-callout: none; }
99 |
100 | .pswp__zoom-wrap {
101 | position: absolute;
102 | width: 100%;
103 | -webkit-transform-origin: left top;
104 | -ms-transform-origin: left top;
105 | transform-origin: left top;
106 | /* for open/close transition */
107 | -webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
108 | transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
109 |
110 | .pswp__bg {
111 | will-change: opacity;
112 | /* for open/close transition */
113 | -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
114 | transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
115 |
116 | .pswp--animated-in .pswp__bg,
117 | .pswp--animated-in .pswp__zoom-wrap {
118 | -webkit-transition: none;
119 | transition: none; }
120 |
121 | .pswp__container,
122 | .pswp__zoom-wrap {
123 | -webkit-backface-visibility: hidden; }
124 |
125 | .pswp__item {
126 | position: absolute;
127 | left: 0;
128 | right: 0;
129 | top: 0;
130 | bottom: 0;
131 | overflow: hidden; }
132 |
133 | .pswp__img {
134 | position: absolute;
135 | width: auto;
136 | height: auto;
137 | top: 0;
138 | left: 0; }
139 |
140 | /*
141 | stretched thumbnail or div placeholder element (see below)
142 | style is added to avoid flickering in webkit/blink when layers overlap
143 | */
144 | .pswp__img--placeholder {
145 | -webkit-backface-visibility: hidden; }
146 |
147 | /*
148 | div element that matches size of large image
149 | large image loads on top of it
150 | */
151 | .pswp__img--placeholder--blank {
152 | background: #222; }
153 |
154 | .pswp--ie .pswp__img {
155 | width: 100% !important;
156 | height: auto !important;
157 | left: 0;
158 | top: 0; }
159 |
160 | /*
161 | Error message appears when image is not loaded
162 | (JS option errorMsg controls markup)
163 | */
164 | .pswp__error-msg {
165 | position: absolute;
166 | left: 0;
167 | top: 50%;
168 | width: 100%;
169 | text-align: center;
170 | font-size: 14px;
171 | line-height: 16px;
172 | margin-top: -8px;
173 | color: #CCC; }
174 |
175 | .pswp__error-msg a {
176 | color: #CCC;
177 | text-decoration: underline; }
178 |
--------------------------------------------------------------------------------
/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
15 |
16 |
17 |
18 | Reopen Gallery
19 |
20 |
21 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/photoswipe-flickr.js:
--------------------------------------------------------------------------------
1 | if (typeof photoswipeFlickr === 'undefined')
2 | {
3 | photoswipeFlickr = function(apiKey, photosetId, galleryOptions, callback) {
4 | return photoswipeFlickr._init(apiKey, photosetId, galleryOptions, callback);
5 | };
6 |
7 | photoswipeFlickr._galleryOptions = undefined;
8 | photoswipeFlickr._flickrData = undefined;
9 | photoswipeFlickr._gallery = undefined;
10 |
11 | photoswipeFlickr._flickrPhotoSizes = {
12 | 240: 'm',
13 | 320: 'n',
14 | 640: 'z',
15 | 800: 'c',
16 | 1024: 'b',
17 | 1600: 'h',
18 | 2048: 'k',
19 | 2400: 'o' // do not comment this out.
20 | // TODO: allow commenting out, but if image doesn't have some of the larger sizes, always default to "original" size
21 | };
22 | photoswipeFlickr._currentSize = parseInt(Object.keys(photoswipeFlickr._flickrPhotoSizes)[0], 10); //start with smallest size
23 | photoswipeFlickr._firstResize = true;
24 |
25 |
26 | photoswipeFlickr.xhr = function (url, callbackFn) {
27 | var fnName = 'callback'+Math.floor(Math.random()*1000001),
28 | script = document.createElement('script');
29 | callbackFn = callbackFn || function(){};
30 | window[fnName] = function(result) { callbackFn(result); };
31 | script.src = url+'&jsoncallback='+fnName;
32 | document.getElementsByTagName('head')[0].appendChild(script);
33 | };
34 |
35 |
36 | photoswipeFlickr.initGallery = function(callback) {
37 | callback = callback || function(){};
38 | if(!photoswipeFlickr._flickrData || !photoswipeFlickr._galleryOptions)
39 | {
40 | return 'You have to initialize everything.';
41 | }
42 |
43 | if (!photoswipeFlickr._gallery)
44 | {
45 | photoswipeFlickr._initGallery(photoswipeFlickr._flickrData, photoswipeFlickr._galleryOptions);
46 | }
47 |
48 | callback(photoswipeFlickr._gallery);
49 | }
50 |
51 |
52 | photoswipeFlickr._initGallery = function (data, galleryOptions) {
53 | // Initializes and opens PhotoSwipe
54 | var pswpElement = document.querySelectorAll('.pswp')[0],
55 | gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, data, galleryOptions);
56 |
57 | // beforeResize event fires each time size of gallery viewport updates
58 | gallery.listen('beforeResize', function() {
59 | // gallery.viewportSize.x - width of PhotoSwipe viewport
60 | // gallery.viewportSize.y - height of PhotoSwipe viewport
61 | // window.devicePixelRatio - ratio between physical pixels and device independent pixels (Number)
62 | // 1 (regular display), 2 (@2x, retina) ...
63 |
64 | var newSize = 0,
65 | imageSrcWillChange = false
66 | realViewportWidth = gallery.viewportSize.x * window.devicePixelRatio; // calculate real pixels when size changes
67 |
68 |
69 | for (var size in photoswipeFlickr._flickrPhotoSizes)
70 | {
71 | if (realViewportWidth > size)
72 | {
73 | newSize = parseInt(size, 10);
74 | }
75 | }
76 |
77 | if (photoswipeFlickr._currentSize < newSize)
78 | {
79 | imageSrcWillChange = true;
80 | photoswipeFlickr._currentSize = newSize;
81 | }
82 |
83 | // Invalidate items only when source is changed and when it's not the first update
84 | if(imageSrcWillChange && !photoswipeFlickr._firstResize)
85 | {
86 | // invalidateCurrItems sets a flag on slides that are in DOM, which will force update of content (image) on window.resize.
87 | gallery.invalidateCurrItems();
88 | }
89 |
90 | photoswipeFlickr._firstResize = false;
91 | });
92 |
93 |
94 | // gettingData event fires each time PhotoSwipe retrieves image source & size
95 | gallery.listen('gettingData', function(index, item) {
96 |
97 | // Set image source & size based on real viewport width
98 | var ext = photoswipeFlickr._flickrPhotoSizes[photoswipeFlickr._currentSize];
99 |
100 | if (typeof item.sizeData[ext].src == 'undefined') {
101 | // The desired size is not available
102 | // Set to original as a fallback
103 | ext = 'o';
104 | // Is the next size up available?
105 | for (size in photoswipeFlickr._flickrPhotoSizes) {
106 | if (size > photoswipeFlickr._currentSize) {
107 | var newExt = photoswipeFlickr._flickrPhotoSizes[size];
108 | if (typeof item.sizeData[newExt].src != 'undefined') {
109 | // Found one
110 | ext = newExt;
111 | break;
112 | }
113 | }
114 | }
115 | }
116 |
117 | item.src = item.sizeData[ext].src || item.sizeData['o'].src;
118 | item.w = item.sizeData[ext].w || item.sizeData['o'].w;
119 | item.h = item.sizeData[ext].h || item.sizeData['o'].h;
120 |
121 | // It doesn't really matter what will you do here, as long as item.src, item.w and item.h have valid values.
122 | //
123 | // Just avoid http requests in this listener, as it fires quite often
124 | });
125 |
126 | gallery.listen('destroy', function() {
127 | photoswipeFlickr._gallery = undefined;
128 | });
129 |
130 | photoswipeFlickr._gallery = gallery;
131 | };
132 |
133 |
134 |
135 |
136 | photoswipeFlickr._init = function(apiKey, photosetId, galleryOptions, callback) {
137 | var sizes = photoswipeFlickr._flickrPhotoSizes;
138 |
139 | photoswipeFlickr._galleryOptions = galleryOptions || {};
140 |
141 | if (!('getImageURLForShare' in photoswipeFlickr._galleryOptions))
142 | {
143 | photoswipeFlickr._galleryOptions.getImageURLForShare = function(shareButtonData) {
144 | return photoswipeFlickr._gallery.currItem.original_src || photoswipeFlickr._gallery.currItem.src || '';
145 | };
146 | }
147 |
148 | // photoswipeFlickr._flickrData = undefined;
149 | // photoswipeFlickr._gallery = undefined;
150 |
151 | callback = callback || function(){};
152 |
153 | if (photoswipeFlickr._flickrData)
154 | {
155 | photoswipeFlickr._initGallery(photoswipeFlickr._flickrData, photoswipeFlickr._galleryOptions);
156 | callback(photoswipeFlickr._gallery);
157 | }
158 | else
159 | {
160 | var sizeParams = Object.keys(sizes).map(function(size) { return 'url_'+sizes[size]; }).join(','),
161 | url = 'https://api.flickr.com/services/rest?method=flickr.photosets.getPhotos&api_key=' + apiKey + '&photoset_id=' +
162 | photosetId + '&extras=' + sizeParams + '&format=json';
163 |
164 | photoswipeFlickr.xhr(url, function(data) {
165 | var i, items = [];
166 |
167 | for (i in data.photoset.photo) {
168 | var photo = data.photoset.photo[i],
169 | item = { sizeData: {} },
170 | size, ext;
171 | for (size in sizes)
172 | {
173 | ext = sizes[size];
174 | item.sizeData[ext] = {
175 | src: photo['url_'+ext],
176 | w: photo['width_'+ext],
177 | h: photo['height_'+ext],
178 | }
179 | item.original_src = photo.url_o;
180 | //item.title = photo.title;
181 | }
182 | items.push(item);
183 | };
184 |
185 | photoswipeFlickr._flickrData = items;
186 |
187 | photoswipeFlickr._initGallery(photoswipeFlickr._flickrData, photoswipeFlickr._galleryOptions);
188 | callback(photoswipeFlickr._gallery);
189 | });
190 | }
191 | };
192 | };
193 |
--------------------------------------------------------------------------------
/photoswipe/photoswipe-ui-default.min.js:
--------------------------------------------------------------------------------
1 | /*! PhotoSwipe Default UI - 4.1.1 - 2015-12-24
2 | * http://photoswipe.com
3 | * Copyright (c) 2015 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")?!0:(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):!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;ca?v.hideControls():!x&&a>=.95&&v.showControls()});var a;l("onPinchClose",function(b){x&&.9>b?(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;f>g;g++){a=d[g],c=a.className;for(var h=0;h-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});
--------------------------------------------------------------------------------
/photoswipe/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 | /*