Merge pull request #415 from saimn/update-photoswipe
Update photoswipe to 4.4.0
This commit is contained in:
@@ -72,6 +72,9 @@
|
||||
.pswp__button--share {
|
||||
background-position: -44px -44px; }
|
||||
|
||||
.pswp__button--download {
|
||||
background-position: -176px 0; }
|
||||
|
||||
.pswp__button--fs {
|
||||
display: none; }
|
||||
|
||||
@@ -92,8 +95,8 @@
|
||||
background-position: -132px 0; }
|
||||
|
||||
/* no arrows on touch screens */
|
||||
.pswp--touch .pswp__button--arrow--left,
|
||||
.pswp--touch .pswp__button--arrow--right {
|
||||
.pswp--touch:not(.pswp--preventswipe) .pswp__button--arrow--left,
|
||||
.pswp--touch:not(.pswp--preventswipe) .pswp__button--arrow--right {
|
||||
visibility: hidden; }
|
||||
|
||||
/*
|
||||
@@ -140,7 +143,6 @@
|
||||
.pswp__counter,
|
||||
.pswp__share-modal {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
|
||||
@@ -153,7 +155,7 @@
|
||||
left: 0;
|
||||
padding: 10px;
|
||||
position: absolute;
|
||||
z-index: 1600;
|
||||
z-index: 16777371;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.25s ease-out;
|
||||
transition: opacity 0.25s ease-out;
|
||||
@@ -164,9 +166,9 @@
|
||||
display: none; }
|
||||
|
||||
.pswp__share-tooltip {
|
||||
z-index: 1620;
|
||||
z-index: 16777391;
|
||||
position: absolute;
|
||||
background: #FFF;
|
||||
background: #fff;
|
||||
top: 56px;
|
||||
border-radius: 2px;
|
||||
display: block;
|
||||
@@ -216,28 +218,28 @@ a.pswp__share--facebook:before {
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 15px;
|
||||
border: 6px solid transparent;
|
||||
border-bottom-color: #FFF;
|
||||
border: 6px solid rgba(0, 0, 0, 0);
|
||||
border-bottom-color: #fff;
|
||||
-webkit-pointer-events: none;
|
||||
-moz-pointer-events: none;
|
||||
pointer-events: none; }
|
||||
|
||||
a.pswp__share--facebook:hover {
|
||||
background: #3E5C9A;
|
||||
color: #FFF; }
|
||||
background: #3e5c9a;
|
||||
color: #fff; }
|
||||
a.pswp__share--facebook:hover:before {
|
||||
border-bottom-color: #3E5C9A; }
|
||||
border-bottom-color: #3e5c9a; }
|
||||
|
||||
a.pswp__share--twitter:hover {
|
||||
background: #55ACEE;
|
||||
color: #FFF; }
|
||||
background: #55acee;
|
||||
color: #fff; }
|
||||
|
||||
a.pswp__share--pinterest:hover {
|
||||
background: #CCC;
|
||||
color: #CE272D; }
|
||||
background: #ccc;
|
||||
color: #ce272d; }
|
||||
|
||||
a.pswp__share--download:hover {
|
||||
background: #DDD; }
|
||||
background: #ddd; }
|
||||
|
||||
/*
|
||||
|
||||
@@ -251,7 +253,7 @@ a.pswp__share--download:hover {
|
||||
height: 44px;
|
||||
font-size: 13px;
|
||||
line-height: 44px;
|
||||
color: #FFF;
|
||||
color: #fff;
|
||||
opacity: 0.75;
|
||||
padding: 0 10px; }
|
||||
|
||||
@@ -268,16 +270,16 @@ a.pswp__share--download:hover {
|
||||
min-height: 44px; }
|
||||
.pswp__caption small {
|
||||
font-size: 11px;
|
||||
color: #BBB; }
|
||||
color: #bbb; }
|
||||
|
||||
.pswp__caption__center {
|
||||
text-align: left;
|
||||
text-align: center;
|
||||
max-width: 420px;
|
||||
margin: 0 auto;
|
||||
font-size: 13px;
|
||||
padding: 10px;
|
||||
line-height: 20px;
|
||||
color: #CCC; }
|
||||
color: #ccc; }
|
||||
|
||||
.pswp__caption--empty {
|
||||
display: none; }
|
||||
@@ -351,7 +353,7 @@ a.pswp__share--download:hover {
|
||||
box-sizing: border-box;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 2px solid #FFF;
|
||||
border: 2px solid #fff;
|
||||
border-radius: 50%;
|
||||
border-left-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
@@ -417,7 +419,7 @@ a.pswp__share--download:hover {
|
||||
-webkit-font-smoothing: auto;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
z-index: 1550; }
|
||||
z-index: 16777321; }
|
||||
|
||||
/* top black bar with buttons and "1 of X" indicator */
|
||||
.pswp__top-bar {
|
||||
@@ -467,7 +469,8 @@ a.pswp__share--download:hover {
|
||||
.pswp__ui--hidden .pswp__button--arrow--left,
|
||||
.pswp__ui--hidden .pswp__button--arrow--right {
|
||||
/* Force paint & create composition layer for controls. */
|
||||
opacity: 0.001; }
|
||||
opacity: 0.001;
|
||||
visibility: hidden; }
|
||||
|
||||
/* pswp__ui--one-slide class is added when there is just one item in gallery */
|
||||
.pswp__ui--one-slide .pswp__button--arrow--left,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 794 B |
@@ -1 +1,36 @@
|
||||
<svg width="264" height="88" viewBox="0 0 264 88" xmlns="http://www.w3.org/2000/svg"><title>default-skin 2</title><g fill="none" fill-rule="evenodd"><g><path d="M67.002 59.5v3.768c-6.307.84-9.184 5.75-10.002 9.732 2.22-2.83 5.564-5.098 10.002-5.098V71.5L73 65.585 67.002 59.5z" id="Shape" fill="#fff"/><g fill="#fff"><path d="M13 29v-5h2v3h3v2h-5zM13 15h5v2h-3v3h-2v-5zM31 15v5h-2v-3h-3v-2h5zM31 29h-5v-2h3v-3h2v5z" id="Shape"/></g><g fill="#fff"><path d="M62 24v5h-2v-3h-3v-2h5zM62 20h-5v-2h3v-3h2v5zM70 20v-5h2v3h3v2h-5zM70 24h5v2h-3v3h-2v-5z"/></g><path d="M20.586 66l-5.656-5.656 1.414-1.414L22 64.586l5.656-5.656 1.414 1.414L23.414 66l5.656 5.656-1.414 1.414L22 67.414l-5.656 5.656-1.414-1.414L20.586 66z" fill="#fff"/><path d="M111.785 65.03L110 63.5l3-3.5h-10v-2h10l-3-3.5 1.785-1.468L117 59l-5.215 6.03z" fill="#fff"/><path d="M152.215 65.03L154 63.5l-3-3.5h10v-2h-10l3-3.5-1.785-1.468L147 59l5.215 6.03z" fill="#fff"/><g><path id="Rectangle-11" fill="#fff" d="M160.957 28.543l-3.25-3.25-1.413 1.414 3.25 3.25z"/><path d="M152.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" id="Oval-1" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M150 21h5v1h-5z"/></g><g><path d="M116.957 28.543l-1.414 1.414-3.25-3.25 1.414-1.414 3.25 3.25z" fill="#fff"/><path d="M108.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M106 21h5v1h-5z"/><path fill="#fff" d="M109.043 19.008l-.085 5-1-.017.085-5z"/></g></g></g></svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg version="1.1" viewBox="0 0 264 88" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title>default-skin 2</dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<title>default-skin 2</title>
|
||||
<path d="m67.002 59.5v3.768c-6.307 0.84-9.184 5.75-10.002 9.732 2.22-2.83 5.564-5.098 10.002-5.098v3.598l5.998-5.915-5.998-6.085z" fill="#fff" fill-rule="evenodd"/>
|
||||
<g fill="#fff" fill-rule="evenodd">
|
||||
<path d="m13 29v-5h2v3h3v2h-5zm0-14h5v2h-3v3h-2v-5zm18 0v5h-2v-3h-3v-2h5zm0 14h-5v-2h3v-3h2v5z"/>
|
||||
</g>
|
||||
<g fill="#fff" fill-rule="evenodd">
|
||||
<path d="m62 24v5h-2v-3h-3v-2h5zm0-4h-5v-2h3v-3h2v5zm8 0v-5h2v3h3v2h-5zm0 4h5v2h-3v3h-2v-5z"/>
|
||||
</g>
|
||||
<path d="m20.586 66-5.656-5.656 1.414-1.414 5.656 5.656 5.656-5.656 1.414 1.414-5.656 5.656 5.656 5.656-1.414 1.414-5.656-5.656-5.656 5.656-1.414-1.414 5.656-5.656z" fill="#fff" fill-rule="evenodd"/>
|
||||
<path d="m111.78 65.03-1.785-1.53l3-3.5h-10v-2h10l-3-3.5 1.785-1.468 5.215 5.968-5.215 6.03z" fill="#fff" fill-rule="evenodd"/>
|
||||
<path d="m152.22 65.03 1.785-1.53-3-3.5h10v-2h-10l3-3.5-1.785-1.468-5.215 5.968 5.215 6.03z" fill="#fff" fill-rule="evenodd"/>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path d="m160.96 28.543-3.25-3.25-1.413 1.414 3.25 3.25z" fill="#fff"/>
|
||||
<path d="m152.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" stroke="#fff" stroke-width="1.5"/>
|
||||
<path d="m150 21h5v1h-5z" fill="#fff"/>
|
||||
</g>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path d="m116.96 28.543-1.414 1.414-3.25-3.25 1.414-1.414 3.25 3.25z" fill="#fff"/>
|
||||
<path d="m108.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" stroke="#fff" stroke-width="1.5"/>
|
||||
<path d="m106 21h5v1h-5z" fill="#fff"/>
|
||||
<path d="m109.04 19.008-0.085 5-1-0.017 0.085-5z" fill="#fff"/>
|
||||
</g>
|
||||
<rect x="190" y="27" width="16" height="2" fill="#fff"/>
|
||||
<path d="m198 26-6-6h4v-5h4v5h4z" fill="#fff" fill-rule="evenodd"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -1,6 +1,9 @@
|
||||
/*! PhotoSwipe Default UI - 4.1.3 - 2019-01-08
|
||||
/*!
|
||||
* PhotoSwipe Default UI - 4.4.0 - 2020-12-06
|
||||
* http://photoswipe.com
|
||||
* Copyright (c) 2019 Dmitry Semenov; */
|
||||
* Copyright (c) 2020 Dmitry Semenov;
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* UI on top of main sliding area (caption, arrows, close button, etc.).
|
||||
@@ -16,35 +19,31 @@
|
||||
root.PhotoSwipeUI_Default = factory();
|
||||
}
|
||||
})(this, function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
var PhotoSwipeUI_Default =
|
||||
function(pswp, framework) {
|
||||
|
||||
var PhotoSwipeUI_Default = function (pswp, framework) {
|
||||
var ui = this;
|
||||
var _overlayUIUpdated = false,
|
||||
_controlsVisible = true,
|
||||
_fullscrenAPI,
|
||||
_stopAllAnimations,
|
||||
_controls,
|
||||
_captionContainer,
|
||||
_fakeCaptionContainer,
|
||||
_indexIndicator,
|
||||
_prevButton,
|
||||
_nextButton,
|
||||
_shareButton,
|
||||
_shareModal,
|
||||
_shareModalHidden = true,
|
||||
_downloadButton,
|
||||
_initalCloseOnScrollValue,
|
||||
_isIdle,
|
||||
_listen,
|
||||
|
||||
_loadingIndicator,
|
||||
_loadingIndicatorHidden,
|
||||
_loadingIndicatorTimeout,
|
||||
|
||||
_galleryHasOneSlide,
|
||||
|
||||
_options,
|
||||
_defaultUIOptions = {
|
||||
barsSize: {top: 44, bottom: 'auto'},
|
||||
@@ -55,7 +54,7 @@ var PhotoSwipeUI_Default =
|
||||
|
||||
addCaptionHTMLFn: function (item, captionEl /*, isFake */) {
|
||||
if (!item.title) {
|
||||
captionEl.children[0].innerHTML = '';
|
||||
framework.resetEl(captionEl.firstChild);
|
||||
return false;
|
||||
}
|
||||
captionEl.children[0].innerHTML = item.title;
|
||||
@@ -67,20 +66,26 @@ var PhotoSwipeUI_Default =
|
||||
fullscreenEl: true,
|
||||
zoomEl: true,
|
||||
shareEl: true,
|
||||
downloadEl: true,
|
||||
counterEl: true,
|
||||
arrowEl: true,
|
||||
preloaderEl: true,
|
||||
closeOnOutsideClick: true,
|
||||
|
||||
tapToClose: false,
|
||||
tapToToggleControls: true,
|
||||
|
||||
clickToCloseNonZoomable: true,
|
||||
clickToShowNextNonZoomable: false,
|
||||
|
||||
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: '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: true}
|
||||
],
|
||||
getImageURLForShare: function (/* shareButtonData */) {
|
||||
@@ -95,19 +100,15 @@ var PhotoSwipeUI_Default =
|
||||
|
||||
indexIndicatorSep: ' / ',
|
||||
fitControlsWidth: 1200
|
||||
|
||||
},
|
||||
_blockControlsTap,
|
||||
_blockControlsTapTimeout;
|
||||
|
||||
|
||||
|
||||
var _onControlsTap = function (e) {
|
||||
if (_blockControlsTap) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
e = e || window.event;
|
||||
|
||||
if (_options.timeToIdle && _options.mouseUsed && !_isIdle) {
|
||||
@@ -115,7 +116,6 @@ var PhotoSwipeUI_Default =
|
||||
_onIdleMouseMove();
|
||||
}
|
||||
|
||||
|
||||
var target = e.target || e.srcElement,
|
||||
uiElement,
|
||||
clickedClass = target.getAttribute('class') || '',
|
||||
@@ -126,7 +126,6 @@ var PhotoSwipeUI_Default =
|
||||
if (uiElement.onTap && clickedClass.indexOf('pswp__' + uiElement.name) > -1) {
|
||||
uiElement.onTap();
|
||||
found = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +146,6 @@ var PhotoSwipeUI_Default =
|
||||
_blockControlsTap = false;
|
||||
}, tapDelay);
|
||||
}
|
||||
|
||||
},
|
||||
_fitControlsInViewport = function () {
|
||||
return !pswp.likelyTouchDevice || _options.mouseUsed || screen.width > _options.fitControlsWidth;
|
||||
@@ -155,25 +153,32 @@ var PhotoSwipeUI_Default =
|
||||
_togglePswpClass = function (el, cName, add) {
|
||||
framework[(add ? 'add' : 'remove') + 'Class'](el, 'pswp__' + cName);
|
||||
},
|
||||
|
||||
// add class when there is just one item in the gallery
|
||||
// (by default it hides left/right arrows and 1ofX counter)
|
||||
_countNumItems = function () {
|
||||
var hasOneSlide = (_options.getNumItemsFn() === 1);
|
||||
var hasOneSlide = _options.getNumItemsFn() === 1;
|
||||
|
||||
if (hasOneSlide !== _galleryHasOneSlide) {
|
||||
_togglePswpClass(_controls, 'ui--one-slide', hasOneSlide);
|
||||
_galleryHasOneSlide = hasOneSlide;
|
||||
}
|
||||
},
|
||||
_downloadFile = function () {
|
||||
var link = document.createElement('A');
|
||||
link.setAttribute('href', pswp.currItem.downloadURL || pswp.currItem.src || '');
|
||||
link.setAttribute('target', '_blank');
|
||||
link.setAttribute('download', '');
|
||||
|
||||
_downloadButton.appendChild(link);
|
||||
link.click();
|
||||
_downloadButton.removeChild(link);
|
||||
},
|
||||
_toggleShareModalClass = function () {
|
||||
_togglePswpClass(_shareModal, 'share-modal--hidden', _shareModalHidden);
|
||||
},
|
||||
_toggleShareModal = function () {
|
||||
|
||||
_shareModalHidden = !_shareModalHidden;
|
||||
|
||||
|
||||
if (!_shareModalHidden) {
|
||||
_toggleShareModalClass();
|
||||
setTimeout(function () {
|
||||
@@ -195,7 +200,6 @@ var PhotoSwipeUI_Default =
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
_openWindowPopup = function (e) {
|
||||
e = e || window.event;
|
||||
var target = e.target || e.srcElement;
|
||||
@@ -210,9 +214,13 @@ var PhotoSwipeUI_Default =
|
||||
return true;
|
||||
}
|
||||
|
||||
window.open(target.href, 'pswp_share', 'scrollbars=yes,resizable=yes,toolbar=no,'+
|
||||
window.open(
|
||||
target.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) );
|
||||
(window.screen ? Math.round(screen.width / 2 - 275) : 100)
|
||||
);
|
||||
|
||||
if (!_shareModalHidden) {
|
||||
_toggleShareModal();
|
||||
@@ -235,15 +243,23 @@ var PhotoSwipeUI_Default =
|
||||
page_url = _options.getPageURLForShare(shareButtonData);
|
||||
share_text = _options.getTextForShare(shareButtonData);
|
||||
|
||||
shareURL = shareButtonData.url.replace('{{url}}', encodeURIComponent(page_url) )
|
||||
shareURL = shareButtonData.url
|
||||
.replace('{{url}}', encodeURIComponent(page_url))
|
||||
.replace('{{image_url}}', encodeURIComponent(image_url))
|
||||
.replace('{{raw_image_url}}', image_url)
|
||||
.replace('{{text}}', encodeURIComponent(share_text));
|
||||
|
||||
shareButtonOut += '<a href="' + shareURL + '" target="_blank" '+
|
||||
'class="pswp__share--' + shareButtonData.id + '"' +
|
||||
(shareButtonData.download ? 'download' : '') + '>' +
|
||||
shareButtonData.label + '</a>';
|
||||
shareButtonOut +=
|
||||
'<a href="' +
|
||||
shareURL +
|
||||
'" target="_blank" ' +
|
||||
'class="pswp__share--' +
|
||||
shareButtonData.id +
|
||||
'"' +
|
||||
(shareButtonData.download ? 'download' : '') +
|
||||
'>' +
|
||||
shareButtonData.label +
|
||||
'</a>';
|
||||
|
||||
if (_options.parseShareButtonOut) {
|
||||
shareButtonOut = _options.parseShareButtonOut(shareButtonData, shareButtonOut);
|
||||
@@ -251,7 +267,6 @@ var PhotoSwipeUI_Default =
|
||||
}
|
||||
_shareModal.children[0].innerHTML = shareButtonOut;
|
||||
_shareModal.children[0].onclick = _openWindowPopup;
|
||||
|
||||
},
|
||||
_hasCloseClass = function (target) {
|
||||
for (var i = 0; i < _options.closeElClasses.length; i++) {
|
||||
@@ -297,38 +312,30 @@ var PhotoSwipeUI_Default =
|
||||
_setupLoadingIndicator = function () {
|
||||
// Setup loading indicator
|
||||
if (_options.preloaderEl) {
|
||||
|
||||
_toggleLoadingIndicator(true);
|
||||
|
||||
_listen('beforeChange', function () {
|
||||
|
||||
clearTimeout(_loadingIndicatorTimeout);
|
||||
|
||||
// display loading indicator with delay
|
||||
_loadingIndicatorTimeout = setTimeout(function () {
|
||||
|
||||
if (pswp.currItem && pswp.currItem.loading) {
|
||||
|
||||
if (!pswp.allowProgressiveImg() || (pswp.currItem.img && !pswp.currItem.img.naturalWidth)) {
|
||||
// show preloader if progressive loading is not enabled,
|
||||
// or image width is not defined yet (because of slow connection)
|
||||
_toggleLoadingIndicator(false);
|
||||
// items-controller.js function allowProgressiveImg
|
||||
}
|
||||
|
||||
} else {
|
||||
_toggleLoadingIndicator(true); // hide preloader
|
||||
}
|
||||
|
||||
}, _options.loadingIndicatorDelay);
|
||||
|
||||
});
|
||||
_listen('imageLoadComplete', function (index, item) {
|
||||
if (pswp.currItem === item) {
|
||||
_toggleLoadingIndicator(true);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
_toggleLoadingIndicator = function (hide) {
|
||||
@@ -339,10 +346,9 @@ var PhotoSwipeUI_Default =
|
||||
},
|
||||
_applyNavBarGaps = function (item) {
|
||||
var gap = item.vGap;
|
||||
var bars = _options.barsSize;
|
||||
|
||||
if (_fitControlsInViewport()) {
|
||||
|
||||
var bars = _options.barsSize;
|
||||
if (_options.captionEl && bars.bottom === 'auto') {
|
||||
if (!_fakeCaptionContainer) {
|
||||
_fakeCaptionContainer = framework.createEl('pswp__caption pswp__caption--fake');
|
||||
@@ -351,7 +357,6 @@ var PhotoSwipeUI_Default =
|
||||
framework.addClass(_controls, 'pswp__ui--fit');
|
||||
}
|
||||
if (_options.addCaptionHTMLFn(item, _fakeCaptionContainer, true)) {
|
||||
|
||||
var captionSize = _fakeCaptionContainer.clientHeight;
|
||||
gap.bottom = parseInt(captionSize, 10) || 44;
|
||||
} else {
|
||||
@@ -371,7 +376,6 @@ var PhotoSwipeUI_Default =
|
||||
// Hide controls when mouse is used
|
||||
if (_options.timeToIdle) {
|
||||
_listen('mouseUsed', function () {
|
||||
|
||||
framework.bind(document, 'mousemove', _onIdleMouseMove);
|
||||
framework.bind(document, 'mouseout', _onMouseLeaveWindow);
|
||||
|
||||
@@ -385,7 +389,6 @@ var PhotoSwipeUI_Default =
|
||||
}
|
||||
},
|
||||
_setupHidingControlsDuringGestures = function () {
|
||||
|
||||
// Hide controls on vertical drag
|
||||
_listen('onVerticalDrag', function (now) {
|
||||
if (_controlsVisible && now < 0.95) {
|
||||
@@ -412,11 +415,8 @@ var PhotoSwipeUI_Default =
|
||||
ui.showControls();
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
var _uiElements = [
|
||||
{
|
||||
name: 'caption',
|
||||
@@ -445,6 +445,14 @@ var PhotoSwipeUI_Default =
|
||||
_toggleShareModal();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'button--download',
|
||||
option: 'downloadEl',
|
||||
onInit: function (el) {
|
||||
_downloadButton = el;
|
||||
},
|
||||
onTap: _downloadFile
|
||||
},
|
||||
{
|
||||
name: 'button--zoom',
|
||||
option: 'zoomEl',
|
||||
@@ -460,16 +468,24 @@ var PhotoSwipeUI_Default =
|
||||
{
|
||||
name: 'button--close',
|
||||
option: 'closeEl',
|
||||
onTap: pswp.close
|
||||
onTap: function () {
|
||||
setTimeout(pswp.close);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'button--arrow--left',
|
||||
option: 'arrowEl',
|
||||
onInit: function (el) {
|
||||
_prevButton = el;
|
||||
},
|
||||
onTap: pswp.prev
|
||||
},
|
||||
{
|
||||
name: 'button--arrow--right',
|
||||
option: 'arrowEl',
|
||||
onInit: function (el) {
|
||||
_nextButton = el;
|
||||
},
|
||||
onTap: pswp.next
|
||||
},
|
||||
{
|
||||
@@ -490,13 +506,10 @@ var PhotoSwipeUI_Default =
|
||||
_loadingIndicator = el;
|
||||
}
|
||||
}
|
||||
|
||||
];
|
||||
|
||||
var _setupUIElements = function () {
|
||||
var item,
|
||||
classAttr,
|
||||
uiElement;
|
||||
var item, classAttr, uiElement;
|
||||
|
||||
var loopThroughChildElements = function (sChildren) {
|
||||
if (!sChildren) {
|
||||
@@ -512,8 +525,8 @@ var PhotoSwipeUI_Default =
|
||||
uiElement = _uiElements[a];
|
||||
|
||||
if (classAttr.indexOf('pswp__' + uiElement.name) > -1) {
|
||||
|
||||
if( _options[uiElement.option] ) { // if element is not disabled from options
|
||||
if (_options[uiElement.option]) {
|
||||
// if element is not disabled from options
|
||||
|
||||
framework.removeClass(item, 'pswp__element--disabled');
|
||||
if (uiElement.onInit) {
|
||||
@@ -537,11 +550,7 @@ var PhotoSwipeUI_Default =
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
ui.init = function () {
|
||||
|
||||
// extend options
|
||||
framework.extend(pswp.options, _defaultUIOptions, true);
|
||||
|
||||
@@ -554,7 +563,6 @@ var PhotoSwipeUI_Default =
|
||||
// create local link
|
||||
_listen = pswp.listen;
|
||||
|
||||
|
||||
_setupHidingControlsDuringGestures();
|
||||
|
||||
// update controls when slides change
|
||||
@@ -575,10 +583,13 @@ var PhotoSwipeUI_Default =
|
||||
var t = e.target || e.srcElement;
|
||||
if (
|
||||
t &&
|
||||
t.getAttribute('class') && e.type.indexOf('mouse') > -1 &&
|
||||
( t.getAttribute('class').indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) )
|
||||
t.nodeType === 1 &&
|
||||
t.getAttribute('class') &&
|
||||
e.type.indexOf('mouse') > -1 &&
|
||||
(t.getAttribute('class').indexOf('__caption') > 0 || /(SMALL|STRONG|EM)/i.test(t.tagName))
|
||||
) {
|
||||
preventObj.prevent = false;
|
||||
_stopAllAnimations();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -597,7 +608,6 @@ var PhotoSwipeUI_Default =
|
||||
if (!_shareModalHidden) {
|
||||
_toggleShareModal();
|
||||
}
|
||||
|
||||
if (_idleInterval) {
|
||||
clearInterval(_idleInterval);
|
||||
}
|
||||
@@ -617,7 +627,6 @@ var PhotoSwipeUI_Default =
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// clean up things when gallery is destroyed
|
||||
_listen('destroy', function () {
|
||||
if (_options.captionEl) {
|
||||
@@ -635,7 +644,6 @@ var PhotoSwipeUI_Default =
|
||||
ui.setIdle(false);
|
||||
});
|
||||
|
||||
|
||||
if (!_options.showAnimationDuration) {
|
||||
framework.removeClass(_controls, 'pswp__ui--hidden');
|
||||
}
|
||||
@@ -673,17 +681,15 @@ var PhotoSwipeUI_Default =
|
||||
ui.update = function () {
|
||||
// Don't update UI if it's hidden
|
||||
if (_controlsVisible && pswp.currItem) {
|
||||
|
||||
ui.updateIndexIndicator();
|
||||
|
||||
if (_options.captionEl) {
|
||||
_options.addCaptionHTMLFn(pswp.currItem, _captionContainer);
|
||||
var captionExists = _options.addCaptionHTMLFn(pswp.currItem, _captionContainer);
|
||||
|
||||
_togglePswpClass(_captionContainer, 'caption--empty', !pswp.currItem.title);
|
||||
_togglePswpClass(_captionContainer, 'caption--empty', !captionExists);
|
||||
}
|
||||
|
||||
_overlayUIUpdated = true;
|
||||
|
||||
} else {
|
||||
_overlayUIUpdated = false;
|
||||
}
|
||||
@@ -696,7 +702,6 @@ var PhotoSwipeUI_Default =
|
||||
};
|
||||
|
||||
ui.updateFullscreen = function (e) {
|
||||
|
||||
if (e) {
|
||||
// some browsers change window scroll position during the fullscreen
|
||||
// so PhotoSwipe updates it just in case
|
||||
@@ -711,9 +716,19 @@ var PhotoSwipeUI_Default =
|
||||
|
||||
ui.updateIndexIndicator = function () {
|
||||
if (_options.counterEl) {
|
||||
_indexIndicator.innerHTML = (pswp.getCurrentIndex()+1) +
|
||||
_options.indexIndicatorSep +
|
||||
_options.getNumItemsFn();
|
||||
_indexIndicator.innerHTML = pswp.getCurrentIndex() + 1 + _options.indexIndicatorSep + _options.getNumItemsFn();
|
||||
}
|
||||
if (!_options.loop) {
|
||||
if (pswp.getCurrentIndex() === 0) {
|
||||
framework.addClass(_prevButton, 'pswp__element--disabled');
|
||||
} else {
|
||||
framework.removeClass(_prevButton, 'pswp__element--disabled');
|
||||
}
|
||||
if (pswp.getCurrentIndex() === _options.getNumItemsFn() - 1) {
|
||||
framework.addClass(_nextButton, 'pswp__element--disabled');
|
||||
} else {
|
||||
framework.removeClass(_nextButton, 'pswp__element--disabled');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -726,9 +741,10 @@ var PhotoSwipeUI_Default =
|
||||
}
|
||||
|
||||
if (e.detail && e.detail.pointerType === 'mouse') {
|
||||
|
||||
// Silently ignore right-click events.
|
||||
if (!e.detail.rightClick) {
|
||||
// close gallery if clicked outside of the image
|
||||
if(_hasCloseClass(target)) {
|
||||
if (_options.closeOnOutsideClick && _hasCloseClass(target)) {
|
||||
pswp.close();
|
||||
return;
|
||||
}
|
||||
@@ -737,14 +753,15 @@ var PhotoSwipeUI_Default =
|
||||
if (pswp.getZoomLevel() === 1 && pswp.getZoomLevel() <= pswp.currItem.fitRatio) {
|
||||
if (_options.clickToCloseNonZoomable) {
|
||||
pswp.close();
|
||||
} else if (_options.clickToShowNextNonZoomable) {
|
||||
pswp.next();
|
||||
}
|
||||
} else {
|
||||
pswp.toggleDesktopZoom(e.detail.releasePoint);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
// tap anywhere (except buttons) to toggle visibility of controls
|
||||
if (_options.tapToToggleControls) {
|
||||
if (_controlsVisible) {
|
||||
@@ -755,11 +772,13 @@ var PhotoSwipeUI_Default =
|
||||
}
|
||||
|
||||
// tap to close gallery
|
||||
if(_options.tapToClose && (framework.hasClass(target, 'pswp__img') || _hasCloseClass(target)) ) {
|
||||
if (
|
||||
_options.tapToClose &&
|
||||
(framework.hasClass(target, 'pswp__img') || (_options.closeOnOutsideClick && _hasCloseClass(target)))
|
||||
) {
|
||||
pswp.close();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
ui.onMouseOver = function (e) {
|
||||
@@ -800,7 +819,6 @@ var PhotoSwipeUI_Default =
|
||||
elementK: 'fullscreenElement',
|
||||
eventK: tF
|
||||
};
|
||||
|
||||
} else if (dE.mozRequestFullScreen) {
|
||||
api = {
|
||||
enterK: 'mozRequestFullScreen',
|
||||
@@ -808,9 +826,6 @@ var PhotoSwipeUI_Default =
|
||||
elementK: 'mozFullScreenElement',
|
||||
eventK: 'moz' + tF
|
||||
};
|
||||
|
||||
|
||||
|
||||
} else if (dE.webkitRequestFullscreen) {
|
||||
api = {
|
||||
enterK: 'webkitRequestFullscreen',
|
||||
@@ -818,7 +833,6 @@ var PhotoSwipeUI_Default =
|
||||
elementK: 'webkitFullscreenElement',
|
||||
eventK: 'webkit' + tF
|
||||
};
|
||||
|
||||
} else if (dE.msRequestFullscreen) {
|
||||
api = {
|
||||
enterK: 'msRequestFullscreen',
|
||||
@@ -844,18 +858,14 @@ var PhotoSwipeUI_Default =
|
||||
_options.closeOnScroll = _initalCloseOnScrollValue;
|
||||
|
||||
return document[this.exitK]();
|
||||
|
||||
};
|
||||
api.isFullscreen = function() { return document[this.elementK]; };
|
||||
api.isFullscreen = function () {
|
||||
return document[this.elementK];
|
||||
};
|
||||
}
|
||||
|
||||
return api;
|
||||
};
|
||||
|
||||
|
||||
|
||||
};
|
||||
return PhotoSwipeUI_Default;
|
||||
|
||||
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@
|
||||
overflow: hidden;
|
||||
-ms-touch-action: none;
|
||||
touch-action: none;
|
||||
z-index: 1500;
|
||||
z-index: 16777271;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
/* create separate layer, to avoid paint on window.onscroll in webkit/blink */
|
||||
-webkit-backface-visibility: hidden;
|
||||
@@ -69,7 +69,10 @@
|
||||
-webkit-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
-webkit-backface-visibility: hidden;
|
||||
will-change: opacity; }
|
||||
will-change: opacity;
|
||||
/* for open/close transition */
|
||||
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
|
||||
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
||||
|
||||
.pswp__scroll-wrap {
|
||||
position: absolute;
|
||||
@@ -93,10 +96,9 @@
|
||||
.pswp__container,
|
||||
.pswp__img {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
-webkit-touch-callout: none; }
|
||||
|
||||
.pswp__zoom-wrap {
|
||||
@@ -109,12 +111,6 @@
|
||||
-webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
|
||||
transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
||||
|
||||
.pswp__bg {
|
||||
will-change: opacity;
|
||||
/* for open/close transition */
|
||||
-webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
|
||||
transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
|
||||
|
||||
.pswp--animated-in .pswp__bg,
|
||||
.pswp--animated-in .pswp__zoom-wrap {
|
||||
-webkit-transition: none;
|
||||
@@ -172,8 +168,8 @@
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
margin-top: -8px;
|
||||
color: #CCC; }
|
||||
color: #ccc; }
|
||||
|
||||
.pswp__error-msg a {
|
||||
color: #CCC;
|
||||
color: #ccc;
|
||||
text-decoration: underline; }
|
||||
10
sigal/themes/photoswipe/static/photoswipe.css.map
Normal file
10
sigal/themes/photoswipe/static/photoswipe.css.map
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "photoswipe.css",
|
||||
"sources": [
|
||||
"../src/css/main.scss",
|
||||
"../src/css/_main-settings.scss"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AAAA,2EAA2E;AAE3E;;EAEE;AAMF,uBAAuB;AACvB,AAAA,KAAK,CAAC;EACL,OAAO,EAAE,IAAI;EACb,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,IAAI,EAAE,CAAC;EACP,GAAG,EAAE,CAAC;EACN,QAAQ,EAAE,MAAM;EAChB,gBAAgB,EAAE,IAAI;EACtB,YAAY,EAAE,IAAI;EAClB,OAAO,EChBa,QAAQ;EDiB5B,wBAAwB,EAAE,IAAI;EAC9B,8EAA8E;EAC9E,2BAA2B,EAAE,MAAM;EACnC,OAAO,EAAE,IAAI,GAWb;EAzBD,AAiBE,KAjBG,CAiBH,CAAC,CAAC;IACD,UAAU,EAAE,UAAU,GACtB;EAnBH,AAsBC,KAtBI,CAsBJ,GAAG,CAAC;IACH,SAAS,EAAE,IAAI,GACf;;AAGF,kEAAkE;AAClE,AAAA,sBAAsB,CAAC;EACtB,oGAAoG;EACpG,OAAO,EAAE,KAAK;EACd,WAAW,EAAE,OAAO;EACpB,+BAA+B;EAC/B,UAAU,EAAE,OAAO,CC5CkB,KAAK,CD4Ce,6BAA6B,GACtF;;AAED,AAAA,WAAW,CAAC;EACX,OAAO,EAAE,KAAK,GACd;;AAED,AAAA,mBAAmB,CAAC,UAAU,CAAC;EAC9B,uBAAuB;EACvB,MAAM,EAAE,eAAe;EACvB,MAAM,EAAE,YA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;EAClB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;EACjB,UAAU,EAAE,IAAI;EAChB,KAAK,EC/LmB,IAAI,GDgM5B;;AAED,AAAA,gBAAgB,CAAC,CAAC,CAAC;EAClB,KAAK,ECnMmB,IAAI;EDoM5B,eAAe,EAAE,SAAS,GAC1B"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user