Permalink
Browse files

build & cleanup

  • Loading branch information...
1 parent f54a5c2 commit ab26befd4110812eb085d525c2f7fa6d296deff9 @dimsemenov committed Dec 5, 2014
View
@@ -1,3 +1,4 @@
+node_modules/
release/*
/release
/node_modules
@@ -30,3 +31,7 @@ website/dist/
.sass-cache/
+
+
+
+
View
@@ -20,6 +20,13 @@ module.exports = function(grunt) {
"kramdown: \r\n"+
" input: GFM \r\n";
+ var awsDefaults = {};
+ if( grunt.file.exists('./aws-keys.json') ) {
+ awsDefaults = grunt.file.readJSON('./aws-keys.json')
+ }
+
+
+
// Project configuration.
grunt.initConfig({
// Metadata.
@@ -154,13 +161,13 @@ module.exports = function(grunt) {
}
},
-
- aws: grunt.file.readJSON('aws-keys.json'), // Read the file
+ //,
+ // aws: grunt.file.readJSON('aws-keys.json'), // Read the file
aws_s3: {
options: {
- accessKeyId: '<%= aws.AWSAccessKeyId %>', // Use the variables
- secretAccessKey: '<%= aws.AWSSecretKey %>', // You can also use env variables
+ accessKeyId: awsDefaults ? awsDefaults.AWSAccessKeyId : '', // Use the variables
+ secretAccessKey: awsDefaults ? awsDefaults.AWSSecretKey : '', // You can also use env variables
region: 'eu-west-1',
uploadConcurrency: 5, // 5 simultaneous uploads
downloadConcurrency: 5 // 5 simultaneous downloads
@@ -1,4 +1,4 @@
-/*! PhotoSwipe Default UI - 4.0.0 - 2014-12-04
+/*! PhotoSwipe Default UI - 4.0.0 - 2014-12-05
* http://photoswipe.com
* Copyright (c) 2014 Dmitry Semenov; */
/**
@@ -1,4 +1,4 @@
-/*! PhotoSwipe Default UI - 4.0.0 - 2014-12-04
+/*! PhotoSwipe Default UI - 4.0.0 - 2014-12-05
* http://photoswipe.com
* Copyright (c) 2014 Dmitry Semenov; */
(function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t:e.PhotoSwipeUI_Default=t()})(this,function(){"use strict";var e=function(e,t){var n,o,i,a,r,l,s,u,c,d,p,m,f,h,v,y,x=this,w=!1,g=!0,b=!0,I={barsSize:{top:44,bottom:"auto"},closeElClasses:["item","caption","zoom-wrap","ui","top-bar"],timeToIdle:4e3,timeToIdleOutside:1e3,loadingIndicatorDelay:1e3,addCaptionHTMLFn:function(e,t){return e.title?(t.children[0].innerHTML=e.title,!0):(t.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}],indexIndicatorSep:" / "},C=function(e){if(f)return!0;e=e||window.event;for(var t,n,o=e.target||e.srcElement,i=o.className,a=0;Z.length>a;a++)t=Z[a],t.onTap&&i.indexOf("pswp__"+t.name)>-1&&(t.onTap(),n=!0);n&&(e.stopPropagation&&e.stopPropagation(),f=!0,h=setTimeout(function(){f=!1},30))},T=function(){return!e.likelyTouchDevice||e.options.mouseUsed||screen.width>1200},E=function(){return b=!b,b?(t.removeClass(s,"pswp__share-modal--fade-in"),setTimeout(function(){b&&t[(b?"add":"remove")+"Class"](s,"pswp__share-modal--hidden")},300)):(t[(b?"add":"remove")+"Class"](s,"pswp__share-modal--hidden"),setTimeout(function(){b||t.addClass(s,"pswp__share-modal--fade-in")},30)),b||D(),!1},_=function(e){e=e||window.event;var t=e.target||e.srcElement;return t.href?t.hasAttribute("download")?!0:(window.open(t.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)),b||E(),!1):!1},D=function(){for(var t,n,o="",i=0;e.options.shareButtons.length>i;i++)t=e.options.shareButtons[i],n=t.url.replace("{{url}}",encodeURIComponent(window.location.href)).replace("{{image_url}}",encodeURIComponent(e.currItem.src||"")).replace("{{raw_image_url}}",e.currItem.src||"").replace("{{text}}",encodeURIComponent(e.currItem.title||"")),o+='<a href="'+n+'" target="_blank" class="pswp__share--'+t.id+'"'+(t.download?"download":"")+">"+t.label+"</a>";s.children[0].innerHTML=o,s.children[0].onclick=_},k=function(n){for(var o=0;e.options.closeElClasses.length>o;o++)if(t.hasClass(n,"pswp__"+e.options.closeElClasses[o]))return!0},M=0,F=function(){clearTimeout(y),M=0,c&&x.setIdle(!1)},S=function(t){t=t?t:window.event;var n=t.relatedTarget||t.toElement;n&&"HTML"!=n.nodeName||(clearTimeout(y),y=setTimeout(function(){x.setIdle(!0)},e.options.timeToIdleOutside))},O=function(e){p!==e&&(t[(e?"remove":"add")+"Class"](d,"pswp__preloader--active"),p=e)},Z=[{name:"caption",option:"captionEl",onInit:function(e){i=e}},{name:"share-modal",option:"shareEl",onInit:function(e){s=e},onTap:function(){E()}},{name:"button--share",option:"shareEl",onInit:function(e){l=e},onTap:function(){E()}},{name:"button--zoom",option:"zoomEl",onTap:e.toggleDesktopZoom},{name:"counter",option:"counterEl",onInit:function(e){r=e}},{name:"button--close",option:"closeEl",onTap:e.close},{name:"button--arrow--left",option:"arrowEl",onTap:e.prev},{name:"button--arrow--right",option:"arrowEl",onTap:e.next},{name:"button--fs",option:"fullscreenEl",onTap:function(){n.isFullscreen()?n.exit():n.enter()}},{name:"preloader",option:"preloaderEl",onInit:function(e){d=e}}];x.init=function(){t.extend(e.options,I,!0),o=e.scrollWrap.children[1];var r=e.listen;r("onVerticalDrag",function(e){g&&.95>e?x.hideControls():!g&&e>=.95&&x.showControls()});var u;r("onPinchClose",function(e){g&&.9>e?(x.hideControls(),u=!0):u&&!g&&e>.9&&x.showControls()}),r("zoomGestureEnded",function(){u=!1,u&&!g&&x.showControls()}),r("beforeChange",x.update),r("doubleTap",function(t){var n=e.currItem.initialZoomLevel;e.getZoomLevel()!==n?e.zoomTo(n,t,333):e.zoomTo(e.currItem.doubleTapZoom,t,333)}),r("bindEvents",function(){t.bind(o,"pswpTap click",C),t.bind(e.scrollWrap,"pswpTap",x.onGlobalTap),e.likelyTouchDevice||t.bind(e.scrollWrap,"mouseover",x.onMouseOver)}),e.options.timeToIdle&&r("mouseUsed",function(){t.bind(document,"mousemove",F),t.bind(document,"mouseout",S),v=setInterval(function(){M++,2===M&&x.setIdle(!0)},e.options.timeToIdle/2)}),r("preventDragEvent",function(e,t,n){var o=e.target||e.srcElement;o&&o.className&&e.type.indexOf("mouse")>-1&&(o.className.indexOf("__caption")>0||/(SMALL|STRONG|EM)/i.test(o.tagName))&&(n.prevent=!1)}),r("unbindEvents",function(){b||E(),v&&clearInterval(v),t.unbind(document,"mouseout",S),t.unbind(document,"mousemove",F),t.unbind(o,"pswpTap click",C),t.unbind(e.scrollWrap,"pswpTap",x.onGlobalTap),t.unbind(e.scrollWrap,"mouseover",x.onMouseOver),n&&(t.unbind(document,n.eventK,x.updateFullscreen),n.isFullscreen()&&(I.hideAnimationDuration=0,n.exit()),n=null)}),r("destroy",function(){e.options.captionEl&&(a&&o.removeChild(a),t.removeClass(i,"pswp__caption--empty")),s&&(s.children[0].onclick=null),t.removeClass(o,"pswp__ui--over-close"),t.addClass(o,"pswp__ui--hidden"),x.setIdle(!1)}),e.options.showAnimationDuration||t.removeClass(o,"pswp__ui--hidden"),r("initialZoomIn",function(){e.options.showAnimationDuration&&t.removeClass(o,"pswp__ui--hidden")}),r("initialZoomOut",function(){t.addClass(o,"pswp__ui--hidden")}),r("parseVerticalMargin",function(n){var r=n.vGap;if(T()){var l=e.options.barsSize;if(e.options.captionEl&&"auto"===l.bottom)if(a||(a=t.createEl("pswp__caption pswp__caption--fake"),a.appendChild(t.createEl("pswp__caption__center")),o.insertBefore(a,i),t.addClass(o,"pswp__ui--fit")),e.options.addCaptionHTMLFn(n,a,!0)){var s=a.clientHeight;r.bottom=parseInt(s,10)||44}else r.bottom=l.top;else r.bottom=l.bottom;r.top=l.top}else r.top=r.bottom=0});var c,d,p,f=function(n){for(var o=n.length,i=0;o>i;i++){c=n[i],d=c.className;for(var a=0;Z.length>a;a++)p=Z[a],d.indexOf("pswp__"+p.name)>-1&&(e.options[p.option]?(t.removeClass(c,"pswp__element--disabled"),p.onInit&&p.onInit(c)):t.addClass(c,"pswp__element--disabled"))}};f(o.children),f(o.children[0].children),e.options.shareEl&&l&&s&&(b=!0),e.options.fullscreenEl&&(n||(n=x.getFullscreenAPI()),n?(t.bind(document,n.eventK,x.updateFullscreen),x.updateFullscreen(),t.addClass(e.template,"pswp--supports-fs")):t.removeClass(e.template,"pswp--supports-fs")),e.options.preloaderEl&&(O(!0),r("beforeChange",function(){clearTimeout(m),m=setTimeout(function(){e.currItem&&e.currItem.loading?(!e.allowProgressiveImg()||e.currItem.img&&!e.currItem.img.naturalWidth)&&O(!1):O(!0)},e.options.loadingIndicatorDelay)}),r("imageLoadComplete",function(t,n){e.currItem===n&&O(!0)}))},x.setIdle=function(e){c=e,t[(e?"add":"remove")+"Class"](o,"pswp__ui--idle")},x.update=function(){g&&e.currItem?(x.updateIndexIndicator(),e.options.captionEl&&(e.options.addCaptionHTMLFn(e.currItem,i),e.currItem.title?t.removeClass(i,"pswp__caption--empty"):t.addClass(i,"pswp__caption--empty")),w=!0):w=!1},x.updateFullscreen=function(){t[(n.isFullscreen()?"add":"remove")+"Class"](e.template,"pswp--fs")},x.updateIndexIndicator=function(){e.options.counterEl&&(r.innerHTML=e.getCurrentIndex()+1+e.options.indexIndicatorSep+e.options.getNumItemsFn())},x.onGlobalTap=function(n){n=n||window.event;var o=n.target||n.srcElement;if(!f)if(n.detail&&"mouse"===n.detail.pointerType)k(o)&&e.close(),t.hasClass(o,"pswp__img")&&(1===e.getZoomLevel()&&e.getZoomLevel()<=e.currItem.fitRatio?e.close():e.toggleDesktopZoom(n.detail.releasePoint));else if(e.options.tapToToggleControls&&(g?x.hideControls():x.showControls()),e.options.tapToClose&&(t.hasClass(o,"pswp__img")||k(o)))return e.close(),void 0},x.onMouseOver=function(e){e=e||window.event;var n=e.target||e.srcElement;k(n)?t.addClass(o,"pswp__ui--over-close"):t.removeClass(o,"pswp__ui--over-close")},x.hideControls=function(){t.addClass(o,"pswp__ui--hidden"),g=!1},x.showControls=function(){g=!0,w||x.update(),t.removeClass(o,"pswp__ui--hidden")},x.supportsFullscreen=function(){var e=document;return!!(e.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.msExitFullscreen)},x.getFullscreenAPI=function(){var t,n=document.documentElement,o="fullscreenchange";return n.requestFullscreen?t={enterK:"requestFullscreen",exitK:"exitFullscreen",elementK:"fullscreenElement",eventK:o}:n.mozRequestFullScreen?t={enterK:"mozRequestFullScreen",exitK:"mozCancelFullScreen",elementK:"mozFullScreenElement",eventK:"moz"+o}:n.webkitRequestFullscreen?t={enterK:"webkitRequestFullscreen",exitK:"webkitExitFullscreen",elementK:"webkitFullscreenElement",eventK:"webkit"+o}:n.msRequestFullscreen&&(t={enterK:"msRequestFullscreen",exitK:"msExitFullscreen",elementK:"msFullscreenElement",eventK:"MSFullscreenChange"}),t&&(t.enter=function(){return u=e.options.closeOnScroll,e.options.closeOnScroll=!1,e.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT)},t.exit=function(){return e.options.closeOnScroll=u,document[this.exitK]()},t.isFullscreen=function(){return document[this.elementK]}),t}};return e});
View
@@ -1,4 +1,4 @@
-/*! PhotoSwipe - v4.0.0 - 2014-12-04
+/*! PhotoSwipe - v4.0.0 - 2014-12-05
* http://photoswipe.com
* Copyright (c) 2014 Dmitry Semenov; */
(function (root, factory) {
@@ -442,7 +442,6 @@ var _isOpen,
return _listeners[name].push(fn);
},
_shout = function(name) {
- console.log(name);
var listeners = _listeners[name];
if(listeners) {
@@ -2797,6 +2796,7 @@ var _getItemAt,
}
},
_appendImagesPool = function() {
+
if(_imagesToAppendPool.length) {
var poolItem;
@@ -3048,18 +3048,21 @@ _registerModule('Controller', {
}
+
+
+ if(!item.loading) {
+ _preloadImage(item);
+ }
+
+
if( self.allowProgressiveImg() ) {
// just append image
- if(!_initialContentSet /*&& index === _currentItemIndex*/) {
- _imagesToAppendPool.push({item:item, baseDiv:baseDiv, img:img, index:index, holder:holder});
+ if(!_initialContentSet) {
+ _imagesToAppendPool.push({item:item, baseDiv:baseDiv, img:(img || item.img), index:index, holder:holder});
} else {
- _appendImage(index, item, baseDiv, img, true, true);
+ _appendImage(index, item, baseDiv, (img || item.img), true, true);
}
}
-
- if(!item.loading) {
- _preloadImage(item);
- }
Oops, something went wrong.
@@ -19,16 +19,15 @@
<meta property="og:url" content="{{page.canonical_url}}">
<meta property="og:title" content="{{page.title}}">
<meta property="og:description" content="{{page.description}}">
- <!-- <meta property="og:image" content="http://dimsemenov.com/magnific-og-400x400.jpg"> -->
+ <meta property="og:image" content="http://photoswipe.com/test/horizontal-swipe.jpg">
<link href="https://plus.google.com/102586375605352607718" rel="publisher" />
<link href="site-assets/site.css?v={{site.pswpversion}}" rel="stylesheet" />
<link href="dist/photoswipe.css?v={{site.pswpversion}}" rel="stylesheet" />
<link href="dist/default-skin/default-skin.css?v={{site.pswpversion}}" rel="stylesheet" />
- <script type="text/javascript" src="http://use.typekit.net/snf1yod.js"></script>
- <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
+
{% if site.url == 'local' %}
<script>
@@ -40,6 +39,9 @@
<script src="dist/photoswipe-ui-default.min.js?v={{site.pswpversion}}"></script>
{% endif %}
+ <script src="//use.typekit.net/snf1yod.js"></script>
+ <script>try{Typekit.load();}catch(e){}</script>
+
<!--[if lt IE 9]>
<script>
document.createElement('figure');
@@ -81,6 +83,7 @@
{% endif %}
{% if site.url != 'local' %}
+ <!-- analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -91,6 +94,31 @@
ga('send', 'pageview');
</script>
+ <!-- Yandex.Metrika counter -->
+ <script type="text/javascript">
+ (function (d, w, c) {
+ (w[c] = w[c] || []).push(function() {
+ try {
+ w.yaCounter24301471 = new Ya.Metrika({id:24301471,
+ webvisor:true,
+ clickmap:true});
+ } catch(e) { }
+ });
+
+ var n = d.getElementsByTagName("script")[0],
+ s = d.createElement("script"),
+ f = function () { n.parentNode.insertBefore(s, n); };
+ s.type = "text/javascript";
+ s.async = true;
+ s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
+
+ if (w.opera == "[object Opera]") {
+ d.addEventListener("DOMContentLoaded", f, false);
+ } else { f(); }
+ })(document, window, "yandex_metrika_callbacks");
+ </script>
+ <noscript><div><img src="//mc.yandex.ru/watch/24301471" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
+ <!-- /Yandex.Metrika counter -->
{% endif %}
View
@@ -1,7 +1,7 @@
---
layout: default
-title: PhotoSwipe
-description:
+title: PhotoSwipe - JavaScript Image Gallery
+description: Touch-friendly JavaScript image gallery for mobile and desktop, without dependencies.
canonical_url: http://dimsemenov.com/plugins/photoswipe/
include_credit: false
buildtool: false
@@ -466,12 +466,22 @@ <h3 style="border-left: 5px solid #fcf5a3;padding-left:5px;margin-left:-10px;">U
<div class="row row--large">
<h2>About</h2>
<p>The script was created by <a href="http://www.codecomputerlove.com/" style="white-space:nowrap;">Code Computerlove</a>, a digital agency in Manchester. In March 2014, it <a href="https://twitter.com/PhotoSwipe/status/444134042787930113">passed</a> on development to <a href="http://dimsemenov.com/">Dmitry Semenov</a>.<br>The new version of PhotoSwipe (4.0) was entirely rewritten, supports a much longer list of devices, and contains a lot of performance and UX improvements. Built-in support for jQuery Mobile has been dropped.</p>
+ </div>
- <iframe src="http://ghbtns.com/github-btn.html?user=dimsemenov&amp;repo=photoswipe&amp;type=watch&amp;count=true&amp;size=large" allowtransparency="true" frameborder="0" scrolling="0" width="155" height="30" style=""></iframe>
-
+ <div class="row row--large">
+ <div class="share-buttons" style="text-align:center">
+ <h2>Please spread the word if you find the script useful</h2>
+ <div id="buttons-row">
+ <a id="tweet" rel="nofollow" target="_blank" href="https://twitter.com/intent/tweet?text=New%20PhotoSwipe&amp;url=http://photoswipe.com">Tweet!</a>
+ <a id="like" rel="nofollow" target="_blank" href="http://www.facebook.com/sharer.php?u=http://photoswipe.com">Like!</a>
+ <a id="gplus" rel="nofollow" target="_blank" href="https://plus.google.com/share?url=http://photoswipe.com">+1</a>
+ <iframe src="http://ghbtns.com/github-btn.html?user=dimsemenov&amp;repo=photoswipe&amp;type=watch&amp;count=true&amp;size=large" allowtransparency="true" frameborder="0" scrolling="0" width="155" height="30" style="transform: translateY(8px);-moz-transform: translateY(8px);-webkit-transform: translateY(8px); margin-left: 9px;"></iframe>
+ </div>
+ </div>
</div>
+
<div class="row row--footer">
<p><span title="Coded">&lt;/&gt;</span> with <span title="love">&lt;3</span> in <a class="ukraine-flag" href="http://en.wikipedia.org/wiki/Ukraine" title="Ukraine"></a> by <a href="http://twitter.com/dimsemenov">@dimsemenov</a></p>

0 comments on commit ab26bef

Please sign in to comment.