From 8acdf7f90d91abbc796b5e790273a64d97393fc9 Mon Sep 17 00:00:00 2001 From: Dmitry Semenov Date: Thu, 15 Jan 2015 14:30:16 +0200 Subject: [PATCH] 4.0.5 version bump & build --- bower.json | 2 +- dist/photoswipe-ui-default.js | 18 ++++++++++++++++-- dist/photoswipe-ui-default.min.js | 4 ++-- dist/photoswipe.js | 2 +- dist/photoswipe.min.js | 2 +- package.json | 2 +- photoswipe.json | 2 +- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/bower.json b/bower.json index 6efc3b9ff..5034d011b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "photoswipe", - "version": "4.0.3", + "version": "4.0.5", "homepage": "http://photoswipe.com", "authors": [ "Dmitry Semenov " diff --git a/dist/photoswipe-ui-default.js b/dist/photoswipe-ui-default.js index fc8532638..a23114254 100644 --- a/dist/photoswipe-ui-default.js +++ b/dist/photoswipe-ui-default.js @@ -1,4 +1,4 @@ -/*! PhotoSwipe Default UI - 4.0.3 - 2015-01-03 +/*! PhotoSwipe Default UI - 4.0.5 - 2015-01-15 * http://photoswipe.com * Copyright (c) 2015 Dmitry Semenov; */ /** @@ -74,6 +74,8 @@ var PhotoSwipeUI_Default = tapToClose: false, tapToToggleControls: true, + clickToCloseNonZoomable: true, + 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}}'}, @@ -107,6 +109,11 @@ var PhotoSwipeUI_Default = e = e || window.event; + if(_options.timeToIdle && _options.mouseUsed && !_isIdle) { + // reset idle timer + _onIdleMouseMove(); + } + var target = e.target || e.srcElement, uiElement, @@ -680,6 +687,10 @@ var PhotoSwipeUI_Default = _overlayUIUpdated = false; } + if(!_shareModalHidden) { + _toggleShareModal(); + } + _countNumItems(); }; @@ -708,11 +719,14 @@ var PhotoSwipeUI_Default = // close gallery if clicked outside of the image if(_hasCloseClass(target)) { pswp.close(); + return; } if(framework.hasClass(target, 'pswp__img')) { if(pswp.getZoomLevel() === 1 && pswp.getZoomLevel() <= pswp.currItem.fitRatio) { - pswp.close(); + if(_options.clickToCloseNonZoomable) { + pswp.close(); + } } else { pswp.toggleDesktopZoom(e.detail.releasePoint); } diff --git a/dist/photoswipe-ui-default.min.js b/dist/photoswipe-ui-default.min.js index 53160c91d..54b53e27c 100644 --- a/dist/photoswipe-ui-default.min.js +++ b/dist/photoswipe-ui-default.min.js @@ -1,4 +1,4 @@ -/*! PhotoSwipe Default UI - 4.0.3 - 2015-01-03 +/*! PhotoSwipe Default UI - 4.0.5 - 2015-01-15 * http://photoswipe.com * Copyright (c) 2015 Dmitry Semenov; */ -!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,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:" / "},A=function(a){if(r)return!0;a=a||window.event;for(var c,d,e=a.target||a.srcElement,f=e.className,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>1200},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