summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js')
-rw-r--r--plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js b/plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js
new file mode 100644
index 00000000..6d0b1867
--- /dev/null
+++ b/plugins/jetpack/_inc/build/carousel/jetpack-carousel.min.js
@@ -0,0 +1,4 @@
+/* Do not modify this file directly. It is compiled from other files. */
+/* jshint sub: true, onevar: false, multistr: true, devel: true, smarttabs: true */
+/* global jetpackCarouselStrings, DocumentTouch */
+jQuery(document).ready(function(e){var t,a,i,o,s,r,n,l,c,d,p,u,m,h,f,g,j,v,w,_=110,x=e("body").css("overflow"),b=e("html").css("overflow"),y="";window.innerWidth<=760&&(_=Math.round(window.innerWidth/760*110))<40&&("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(_=0),void 0===Date.now&&(Date.now=function(){return(new Date).getTime()});var S=function(e){switch(e.which){case 38:e.preventDefault(),o.scrollTop(o.scrollTop()-100);break;case 40:e.preventDefault(),o.scrollTop(o.scrollTop()+100);break;case 39:e.preventDefault(),i.jp_carousel("next");break;case 37:case 8:e.preventDefault(),i.jp_carousel("previous");break;case 27:e.preventDefault(),o.jp_carousel("close")}},C=function(){clearTimeout(d),d=setTimeout(function(){i.jp_carousel("slides").jp_carousel("fitSlide",!0),i.jp_carousel("updateSlidePositions",!0),i.jp_carousel("fitMeta",!0)},200)},k=function(){if(!t){t=e("<div></div>").addClass("jp-carousel-overlay").css({position:"absolute",top:0,right:0,bottom:0,left:0});var d='<a class="jp-carousel-commentlink" href="#">'+jetpackCarouselStrings.comment+"</a>";Number(jetpackCarouselStrings.is_logged_in),d=e('<div class="jp-carousel-buttons">'+d+"</div>"),c=e('<h2 itemprop="caption description"></h2>'),p=e('<div class="jp-carousel-photo-info"></div>').append(c),f=e("<div></div>").addClass("jp-carousel-image-meta").css({float:"right","margin-top":"20px",width:"250px"}),f.append(d).append("<ul class='jp-carousel-image-exif' style='display:none;'></ul>").append("<a class='jp-carousel-image-download' style='display:none;'></a>").append("<div class='jp-carousel-image-map' style='display:none;'></div>"),g=e("<div></div>").addClass("jp-carousel-titleanddesc").css({width:"100%","margin-top":f.css("margin-top")});var m='<div id="jp-carousel-comment-form-container">';jetpackCarouselStrings.local_comments_commenting_as&&jetpackCarouselStrings.local_comments_commenting_as.length&&(1!==Number(jetpackCarouselStrings.is_logged_in)&&1===Number(jetpackCarouselStrings.comment_registration)?m+='<div id="jp-carousel-comment-form-commenting-as">'+jetpackCarouselStrings.local_comments_commenting_as+"</div>":(m+='<form id="jp-carousel-comment-form">',m+='<textarea name="comment" class="jp-carousel-comment-form-field jp-carousel-comment-form-textarea" id="jp-carousel-comment-form-comment-field" placeholder="'+jetpackCarouselStrings.write_comment+'"></textarea>',m+='<div id="jp-carousel-comment-form-submit-and-info-wrapper">',m+='<div id="jp-carousel-comment-form-commenting-as">'+jetpackCarouselStrings.local_comments_commenting_as+"</div>",m+='<input type="submit" name="submit" class="jp-carousel-comment-form-button" id="jp-carousel-comment-form-button-submit" value="'+jetpackCarouselStrings.post_comment+'" />',m+='<span id="jp-carousel-comment-form-spinner">&nbsp;</span>',m+='<div id="jp-carousel-comment-post-results"></div>',m+="</div>",m+="</form>")),m+="</div>",j=e(m).css({width:"100%","margin-top":"20px",color:"#999"}),a=e("<div></div>").addClass("jp-carousel-comments").css({width:"100%",bottom:"10px","margin-top":"20px"});var h=e('<div id="jp-carousel-comments-loading"><span>'+jetpackCarouselStrings.loading_comments+"</span></div>").css({width:"100%",bottom:"10px","margin-top":"20px"}),w=e(window).width()-2*_-(f.width()+40);w+="px",v=e("<div></div>").addClass("jp-carousel-left-column-wrapper").css({width:Math.floor(w)}).append(g).append(j).append(a).append(h);var x=e("<div></div>").addClass("jp-carousel-fadeaway");n=e("<div></div>").addClass("jp-carousel-info").css({top:Math.floor(e(window).height()/100*85),left:_,right:_}).append(p).append(f),window.innerWidth<=760?(p.remove().insertAfter(g),n.prepend(v)):n.append(v);var b=e(window).height()-parseInt(n.css("top"),10)+"px";s=e("<div><span></span></div>").addClass("jp-carousel-next-button").css({right:"15px"}).hide(),r=e("<div><span></span></div>").addClass("jp-carousel-previous-button").css({left:0}).hide(),s.add(r).css({position:"fixed",top:"40px",bottom:b,width:_}),i=e("<div></div>").addClass("jp-carousel").css({position:"absolute",top:0,bottom:b,left:0,right:0}),u=e('<div class="jp-carousel-close-hint"><span>&times;</span></div>').css({position:"fixed"}),o=e("<div></div>").addClass("jp-carousel-wrap").addClass("jp-carousel-transitions"),"white"===jetpackCarouselStrings.background_color&&o.addClass("jp-carousel-light"),o.attr("itemscope",""),o.attr("itemtype","https://schema.org/ImageGallery"),o.css({position:"fixed",top:0,right:0,bottom:0,left:0,"z-index":2147483647,"overflow-x":"hidden","overflow-y":"auto",direction:"ltr"}).hide().append(t).append(i).append(x).append(n).append(s).append(r).append(u).appendTo(e("body")).click(function(t){var a=e(t.target),s=a.parents("div.jp-carousel-wrap"),r=s.data("carousel-extra"),l=s.find("div.selected"),c=l.data("attachment-id");if(r=r||[],a.is(i)||a.parents().add(a).is(u))o.jp_carousel("close");else if(a.hasClass("jp-carousel-commentlink"))t.preventDefault(),t.stopPropagation(),e(window).unbind("keydown",S),o.animate({scrollTop:parseInt(n.position().top,10)},"fast"),e("#jp-carousel-comment-form-submit-and-info-wrapper").slideDown("fast"),e("#jp-carousel-comment-form-comment-field").focus();else if(a.hasClass("jp-carousel-comment-login")){var d=jetpackCarouselStrings.login_url+"%23jp-carousel-"+c;window.location.href=d}else if(a.parents("#jp-carousel-comment-form-container").length){var p=e("#jp-carousel-comment-form-comment-field").blur(function(){e(window).bind("keydown",S)}).focus(function(){e(window).unbind("keydown",S)}),m=e("#jp-carousel-comment-form-email-field").blur(function(){e(window).bind("keydown",S)}).focus(function(){e(window).unbind("keydown",S)}),h=e("#jp-carousel-comment-form-author-field").blur(function(){e(window).bind("keydown",S)}).focus(function(){e(window).unbind("keydown",S)}),f=e("#jp-carousel-comment-form-url-field").blur(function(){e(window).bind("keydown",S)}).focus(function(){e(window).unbind("keydown",S)});if(p&&p.attr("id")===a.attr("id"))e(window).unbind("keydown",S),e("#jp-carousel-comment-form-submit-and-info-wrapper").slideDown("fast");else if(a.is('input[type="submit"]')){t.preventDefault(),t.stopPropagation(),e("#jp-carousel-comment-form-spinner").spin("small","white");var g={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:r.blog_id,id:c,comment:p.val()};if(!g.comment.length)return void i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-comment-field",error:jetpackCarouselStrings.no_comment_text});if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(g.email=m.val(),g.author=h.val(),g.url=f.val(),1===Number(jetpackCarouselStrings.require_name_email))){if(!g.email.length||!g.email.match("@"))return void i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-email-field",error:jetpackCarouselStrings.no_comment_email});if(!g.author.length)return void i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-author-field",error:jetpackCarouselStrings.no_comment_author})}e.ajax({type:"POST",url:jetpackCarouselStrings.ajaxurl,data:g,dataType:"json",success:function(t){"approved"===t.comment_status?e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-success">'+jetpackCarouselStrings.comment_approved+"</span>").slideDown("fast"):"unapproved"===t.comment_status?e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-success">'+jetpackCarouselStrings.comment_unapproved+"</span>").slideDown("fast"):e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-error">'+jetpackCarouselStrings.comment_post_error+"</span>").slideDown("fast"),i.jp_carousel("clearCommentTextAreaValue"),i.jp_carousel("getComments",{attachment_id:c,offset:0,clear:!0}),e("#jp-carousel-comment-form-button-submit").val(jetpackCarouselStrings.post_comment),e("#jp-carousel-comment-form-spinner").spin(!1)},error:function(){i.jp_carousel("postCommentError",{field:"jp-carousel-comment-form-comment-field",error:jetpackCarouselStrings.comment_post_error})}})}}else a.parents(".jp-carousel-info").length||o.jp_carousel("next")}).bind("jp_carousel.afterOpen",function(){e(window).bind("keydown",S),e(window).bind("resize",C),i.opened=!0,C()}).bind("jp_carousel.beforeClose",function(){var t=e(window).scrollTop();e(window).unbind("keydown",S),e(window).unbind("resize",C),e(window).scrollTop(t),e(".jp-carousel-previous-button").hide(),e(".jp-carousel-next-button").hide()}).bind("jp_carousel.afterClose",function(){window.location.hash&&history.back&&history.back(),y="",i.opened=!1}).on("transitionend.jp-carousel ",".jp-carousel-slide",function(t){if("transform"===t.originalEvent.propertyName){var a=(Date.now()-l)/1e3/t.originalEvent.elapsedTime;o.off("transitionend.jp-carousel"),a>=2&&e(".jp-carousel-transitions").removeClass("jp-carousel-transitions")}}),e(".jp-carousel-wrap").touchwipe({wipeLeft:function(e){e.preventDefault(),i.jp_carousel("next")},wipeRight:function(e){e.preventDefault(),i.jp_carousel("previous")},preventDefaultEvents:!1}),s.add(r).click(function(e){e.preventDefault(),e.stopPropagation(),s.is(this)?i.jp_carousel("next"):i.jp_carousel("previous")})}},I=function(){e("a img[data-attachment-id]").each(function(){var t=e(this).parent();if(!t.parent(".gallery-icon").length&&void 0!==e(t).attr("href")){var a=!1;e(t).attr("href").split("?")[0]===e(this).attr("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),e(t).attr("href")===e(this).attr("data-permalink")&&(a=!0),a&&(e(t).addClass("single-image-gallery"),e(t).data("carousel-extra",{blog_id:Number(jetpackCarouselStrings.blog_id)}))}})},D={testForData:function(t){return t=e(t),!(!t.length||!t.data("carousel-extra"))},testIfOpened:function(){return!(void 0===i||void 0===i.opened||!i.opened)},openOrSelectSlide:function(t){e(this).jp_carousel("testIfOpened")?i.jp_carousel("selectSlideAtIndex",t):e(this).jp_carousel("open",{start_index:t})},open:function(t){var a={items_selector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id]",start_index:0},s=e(this).data("carousel-extra");if(s&&(k(),!i.jp_carousel("testIfOpened")))return x=e("body").css("overflow"),e("body").css("overflow","hidden"),b=e("html").css("overflow"),e("html").css("overflow","hidden"),w=e(window).scrollTop(),o.data("carousel-extra",s),this.each(function(){var s=e(this);t&&e.extend(a,t),-1===a.start_index&&(a.start_index=0),o.trigger("jp_carousel.beforeOpen").fadeIn("fast",function(){o.trigger("jp_carousel.afterOpen"),i.jp_carousel("initSlides",s.find(a.items_selector),a.start_index).jp_carousel("selectSlideAtIndex",a.start_index)}),i.html("")})},selectSlideAtIndex:function(e){var t=this.jp_carousel("slides"),a=t.eq(e);return 0===a.length&&(a=t.eq(0)),i.jp_carousel("selectSlide",a,!1),this},close:function(){return e("body").css("overflow",x),e("html").css("overflow",b),this.jp_carousel("clearCommentTextAreaValue"),o.trigger("jp_carousel.beforeClose").fadeOut("fast",function(){o.trigger("jp_carousel.afterClose"),e(window).scrollTop(w)})},next:function(){this.jp_carousel("previousOrNext","nextSlide")},previous:function(){this.jp_carousel("previousOrNext","prevSlide")},previousOrNext:function(e){if(!this.jp_carousel("hasMultipleImages"))return!1;var t=i.jp_carousel(e);t&&(o.animate({scrollTop:0},"fast"),this.jp_carousel("clearCommentTextAreaValue"),this.jp_carousel("selectSlide",t))},selectedSlide:function(){return this.find(".selected")},setSlidePosition:function(e){return l=Date.now(),this.css({"-webkit-transform":"translate3d("+e+"px,0,0)","-moz-transform":"translate3d("+e+"px,0,0)","-ms-transform":"translate("+e+"px,0)","-o-transform":"translate("+e+"px,0)",transform:"translate3d("+e+"px,0,0)"})},updateSlidePositions:function(e){var t=this.jp_carousel("selectedSlide"),a=i.width(),o=t.width(),s=i.jp_carousel("prevSlide"),r=i.jp_carousel("nextSlide"),n=s.prev(),l=r.next(),c=Math.floor(.5*(a-o));t.jp_carousel("setSlidePosition",c).show(),i.jp_carousel("fitInfo",e),1==(h.is(t.prevAll())?1:-1)?(l.is(s)||l.jp_carousel("setSlidePosition",a+r.width()).show(),n.is(r)||n.jp_carousel("setSlidePosition",-n.width()-o).show()):l.is(s)||l.jp_carousel("setSlidePosition",a+o).show(),s.jp_carousel("setSlidePosition",Math.floor(-s.width()+.75*_)).show(),r.jp_carousel("setSlidePosition",Math.ceil(a-.75*_)).show()},selectSlide:function(t,a){h=this.find(".selected").removeClass("selected");var s,r,n=i.jp_carousel("slides").css({position:"fixed"}),l=e(t).addClass("selected").css({position:"relative"}),d=l.data("attachment-id"),p=i.jp_carousel("prevSlide"),u=i.jp_carousel("nextSlide"),m=p.prev(),f=u.next();i.jp_carousel("loadFullImage",l),c.hide(),0===u.length&&n.length<=2?e(".jp-carousel-next-button").hide():e(".jp-carousel-next-button").show(),0===p.length&&n.length<=2?e(".jp-carousel-previous-button").hide():e(".jp-carousel-previous-button").show(),s=l.add(p).add(m).add(u).add(f).jp_carousel("loadSlide"),n.not(s).hide(),i.jp_carousel("updateSlidePositions",a),o.trigger("jp_carousel.selectSlide",[l]),i.jp_carousel("getTitleDesc",{title:l.data("title"),desc:l.data("desc")});var g=l.data("image-meta");i.jp_carousel("updateExif",g),i.jp_carousel("updateFullSizeLink",l),i.jp_carousel("updateMap",g),i.jp_carousel("testCommentsOpened",l.data("comments-opened")),i.jp_carousel("getComments",{attachment_id:d,offset:0,clear:!0}),e("#jp-carousel-comment-post-results").slideUp(),l.data("caption")?(r=e("<div />").text(l.data("caption")).html(),r===e("<div />").text(l.data("title")).html()&&e(".jp-carousel-titleanddesc-title").fadeOut("fast").empty(),r===e("<div />").text(l.data("desc")).html()&&e(".jp-carousel-titleanddesc-desc").fadeOut("fast").empty(),c.html(l.data("caption")).fadeIn("slow")):c.fadeOut("fast").empty(),jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(d)+"&rand="+Math.random()),e(u).add(p).each(function(){i.jp_carousel("loadFullImage",e(this))}),window.location.hash=y="#jp-carousel-"+d},slides:function(){return this.find(".jp-carousel-slide")},slideDimensions:function(){return{width:e(window).width()-2*_,height:Math.floor(e(window).height()/100*85-60)}},loadSlide:function(){return this.each(function(){var t=e(this);t.find("img").one("load",function(){t.jp_carousel("fitSlide",!1)})})},bestFit:function(){var e,t,a=i.jp_carousel("slideDimensions"),o=this.jp_carousel("originalDimensions"),s=o.width/o.height,r=1,n=1;return o.width>a.width&&(r=a.width/o.width),o.height>a.height&&(n=a.height/o.height),r<n?(e=a.width,t=Math.floor(e/s)):n<r?(t=a.height,e=Math.floor(t*s)):(e=o.width,t=o.height),{width:e,height:t}},fitInfo:function(){var e=this.jp_carousel("selectedSlide"),t=e.jp_carousel("bestFit");return p.css({left:Math.floor(.5*(n.width()-t.width)),width:Math.floor(t.width)}),this},fitMeta:function(t){var a={top:Math.floor(e(window).height()/100*85+5)+"px"},i={width:n.width()-(f.width()+80)+"px"};t?(n.animate(a),v.animate(i)):(n.animate(a),v.css(i))},fitSlide:function(){return this.each(function(){var t=e(this),a=t.jp_carousel("bestFit"),o=i.jp_carousel("slideDimensions");a.left=0,a.top=Math.floor(.5*(o.height-a.height))+40,t.css(a)})},texturize:function(t){return t=""+t,t=t.replace(/'/g,"&#8217;").replace(/&#039;/g,"&#8217;").replace(/[\u2019]/g,"&#8217;"),t=t.replace(/"/g,"&#8221;").replace(/&#034;/g,"&#8221;").replace(/&quot;/g,"&#8221;").replace(/[\u201D]/g,"&#8221;"),t=t.replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"'),e.trim(t)},initSlides:function(t,a){t.length<2?e(".jp-carousel-next-button, .jp-carousel-previous-button").hide():e(".jp-carousel-next-button, .jp-carousel-previous-button").show(),t.each(function(){var t,a=e(this),o=a.data("orig-size")||"",s=i.jp_carousel("slideDimensions"),r=o.split(","),n=a.data("medium-file")||"",l=a.data("large-file")||"";o={width:parseInt(r[0],10),height:parseInt(r[1],10)},t=a.data("orig-file"),t=i.jp_carousel("selectBestImageSize",{orig_file:t,orig_width:o.width,orig_height:o.height,max_width:s.width,max_height:s.height,medium_file:n,large_file:l}),e(this).data("gallery-src",t)}),0!==a&&(e("<img/>")[0].src=e(t[a]).data("gallery-src"));var o=t.first().closest(".tiled-gallery.type-rectangular").length>0;return t.each(function(t){var s=e(this),r=s.data("attachment-id")||0,n=s.data("comments-opened")||0,l=s.data("image-meta")||{},c=s.data("orig-size")||"",d={width:s[0].naturalWidth,height:s[0].naturalHeight},p=s.data("image-title")||"",u=s.data("image-description")||"",m=s.parents(".gallery-item").find(".gallery-caption").html()||"",h=s.data("gallery-src")||"",f=s.data("medium-file")||"",g=s.data("large-file")||"",j=s.data("orig-file")||"",v=s.parents("div.tiled-gallery-item").find("div.tiled-gallery-caption").html();if(v&&(m=v),r&&c.length){p=i.jp_carousel("texturize",p),u=i.jp_carousel("texturize",u),m=i.jp_carousel("texturize",m);var w=e("<img/>").attr("src","data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7").css("width","100%").css("height","100%"),_=e('<div class="jp-carousel-slide" itemprop="associatedMedia" itemscope itemtype="https://schema.org/ImageObject"></div>').hide().css({left:t<a?-1e3:i.width()}).append(w).appendTo(i).data("src",h).data("title",p).data("desc",u).data("caption",m).data("attachment-id",r).data("permalink",s.parents("a").attr("href")).data("orig-size",c).data("comments-opened",n).data("image-meta",l).data("medium-file",f).data("large-file",g).data("orig-file",j).data("thumb-size",d);o&&_.data("preview-image",s.attr("src")).css({"background-image":'url("'+s.attr("src")+'")',"background-size":"100% 100%","background-position":"center center"}),_.jp_carousel("fitSlide",!1)}}),this},selectBestImageSize:function(e){if("object"!=typeof e&&(e={}),void 0===e.orig_file)return"";if(void 0===e.orig_width||void 0===e.max_width)return e.orig_file;if(void 0===e.medium_file||void 0===e.large_file)return e.orig_file;var t=document.createElement("a");t.href=e.large_file;var a=null!=t.hostname.match(/^i[\d]{1}.wp.com$/i),o=i.jp_carousel("getImageSizeParts",e.medium_file,e.orig_width,a),s=i.jp_carousel("getImageSizeParts",e.large_file,e.orig_width,a),r=parseInt(s[0],10),n=parseInt(s[1],10),l=parseInt(o[0],10),c=parseInt(o[1],10);if(e.orig_max_width=e.max_width,e.orig_max_height=e.max_height,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.max_width=e.max_width*window.devicePixelRatio,e.max_height=e.max_height*window.devicePixelRatio),r>=e.max_width||n>=e.max_height)return e.large_file;if(l>=e.max_width||c>=e.max_height)return e.medium_file;if(a){var d=e.large_file.lastIndexOf("?"),p=e.large_file;return-1!==d&&(p=e.large_file.substring(0,d),(e.orig_width>e.max_width||e.orig_height>e.max_height)&&(p+="?fit="+e.orig_max_width+"%2C"+e.orig_max_height)),p}return e.orig_file},getImageSizeParts:function(e,t,a){var i=a?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1"),o=i!==e?a?i.split("%2C"):i.split("x"):[t,0];return"9999"===o[0]&&(o[0]="0"),"9999"===o[1]&&(o[1]="0"),o},originalDimensions:function(){var t=e(this).data("orig-size").split(",");return{width:parseInt(t[0],10),height:parseInt(t[1],10)}},format:function(e){if("object"!=typeof e&&(e={}),e.text&&void 0!==e.text)return e.replacements&&void 0!==e.replacements?e.text.replace(/{(\d+)}/g,function(t,a){return void 0!==e.replacements[a]?e.replacements[a]:t}):e.text},shutterSpeed:function(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"},parseTitleDesc:function(t){return!t.match(" ")&&t.match("_")?"":(e(["CIMG","DSC_","DSCF","DSCN","DUW","GEDC","IMG","JD","MGP","PICT","Imagen","Foto","DSC","Scan","SANY","SAM","Screen Shot [0-9]+"]).each(function(e,a){if(new RegExp("^"+a).test(t))return void(t="")}),t)},getTitleDesc:function(t){var a,o="",s="",r="";a=e("div.jp-carousel-titleanddesc","div.jp-carousel-wrap"),a.hide(),o=i.jp_carousel("parseTitleDesc",t.title)||"",s=i.jp_carousel("parseTitleDesc",t.desc)||"",(o.length||s.length)&&(e("<div />").html(o).text()===e("<div />").html(s).text()&&(o=""),r=o.length?'<div class="jp-carousel-titleanddesc-title">'+o+"</div>":"",r+=s.length?'<div class="jp-carousel-titleanddesc-desc">'+s+"</div>":"",a.html(r).fadeIn("slow")),e("div#jp-carousel-comment-form-container").css("margin-top","20px"),e("div#jp-carousel-comments-loading").css("margin-top","20px")},updateExif:function(t){if(!t||1!==Number(jetpackCarouselStrings.display_exif))return!1;var a=e("<ul class='jp-carousel-image-exif'></ul>");e.each(t,function(t,o){if(0!==parseFloat(o)&&o.length&&-1!==e.inArray(t,e.makeArray(jetpackCarouselStrings.meta_data))){switch(t){case"focal_length":o+="mm";break;case"shutter_speed":o=i.jp_carousel("shutterSpeed",o);break;case"aperture":o="f/"+o}a.append("<li><h5>"+jetpackCarouselStrings[t]+"</h5>"+o+"</li>")}}),e("div.jp-carousel-image-meta ul.jp-carousel-image-exif").replaceWith(a)},updateFullSizeLink:function(t){if(!t||!t.data)return!1;var a,o=t.data("orig-size").split(","),s=document.createElement("a");s.href=t.data("src").replace(/\?.+$/,""),a=null!==s.hostname.match(/^i[\d]{1}.wp.com$/i)?s.href:t.data("orig-file").replace(/\?.+$/,"");var r=e("<a>"+i.jp_carousel("format",{text:jetpackCarouselStrings.download_original,replacements:o})+"</a>").addClass("jp-carousel-image-download").attr("href",a).attr("target","_blank");e("div.jp-carousel-image-meta a.jp-carousel-image-download").replaceWith(r)},updateMap:function(t){if(t.latitude&&t.longitude&&1===Number(jetpackCarouselStrings.display_geo)){var a=t.latitude,i=t.longitude,o=e("div.jp-carousel-image-meta","div.jp-carousel-wrap"),s=e("<div></div>"),r="&scale=2&style=feature:all|element:all|invert_lightness:true|hue:0x0077FF|saturation:-50|lightness:-5|gamma:0.91";s.addClass("jp-carousel-image-map").html('<img width="154" height="154" src="https://maps.googleapis.com/maps/api/staticmap?\t\t\t\t\t\t\tcenter='+a+","+i+"&\t\t\t\t\t\t\tzoom=8&\t\t\t\t\t\t\tsize=154x154&\t\t\t\t\t\t\tsensor=false&\t\t\t\t\t\t\tmarkers=size:medium%7Ccolor:blue%7C"+a+","+i+r+'" class="gmap-main" />\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="gmap-topright"><div class="imgclip"><img width="175" height="154" src="https://maps.googleapis.com/maps/api/staticmap?\t\t\t\t\t\t\tcenter='+a+","+i+"&\t\t\t\t\t\t\tzoom=3&\t\t\t\t\t\t\tsize=175x154&\t\t\t\t\t\t\tsensor=false&\t\t\t\t\t\t\tmarkers=size:small%7Ccolor:blue%7C"+a+","+i+r+'"c /></div></div>\t\t\t\t\t\t\t\t\t\t\t\t\t').prependTo(o)}},testCommentsOpened:function(t){1===parseInt(t,10)?(e(".jp-carousel-buttons").fadeIn("fast"),j.fadeIn("fast")):(e(".jp-carousel-buttons").fadeOut("fast"),j.fadeOut("fast"))},getComments:function(t){if(clearInterval(m),"object"==typeof t&&void 0!==t.attachment_id&&t.attachment_id){(!t.offset||void 0===t.offset||t.offset<1)&&(t.offset=0);var a=e(".jp-carousel-comments"),o=e("#jp-carousel-comments-loading").show();t.clear&&a.hide().empty(),e.ajax({type:"GET",url:jetpackCarouselStrings.ajaxurl,dataType:"json",data:{action:"get_attachment_comments",nonce:jetpackCarouselStrings.nonce,id:t.attachment_id,offset:t.offset},success:function(s){t.clear&&a.fadeOut("fast").empty(),e(s).each(function(){var o=e("<div></div>").addClass("jp-carousel-comment").attr("id","jp-carousel-comment-"+this.id).html('<div class="comment-gravatar">'+this.gravatar_markup+'</div><div class="comment-author">'+this.author_markup+'</div><div class="comment-date">'+this.date_gmt+'</div><div class="comment-content">'+this.content+"</div>");a.append(o),clearInterval(m),m=setInterval(function(){e(".jp-carousel-overlay").height()-150<e(".jp-carousel-wrap").scrollTop()+e(window).height()&&(i.jp_carousel("getComments",{attachment_id:t.attachment_id,offset:t.offset+10,clear:!1}),clearInterval(m))},300)});var r=e(".jp-carousel div.selected");if(r&&r.data&&r.data("attachment-id")!=t.attachment_id)return a.fadeOut("fast"),void a.empty();e(".jp-carousel-overlay").height(e(window).height()+g.height()+j.height()+(a.height()>0?a.height():f.height())+200),a.show(),o.hide()},error:function(e,t,i){console.log("Comment get fail...",e,t,i),a.fadeIn("fast"),o.fadeOut("fast")}})}},postCommentError:function(t){"object"!=typeof t&&(t={}),t.field&&void 0!==t.field&&t.error&&void 0!==t.error&&(e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-error">'+t.error+"</span>").slideDown("fast"),e("#jp-carousel-comment-form-spinner").spin(!1))},setCommentIframeSrc:function(t){var a=e("#jp-carousel-comment-iframe");a&&a.length&&(a.attr("src",a.attr("src").replace(/(postid=)\d+/,"$1"+t)),a.attr("src",a.attr("src").replace(/(%23.+)?$/,"%23jp-carousel-"+t)))},clearCommentTextAreaValue:function(){var t=e("#jp-carousel-comment-form-comment-field");t&&t.val("")},nextSlide:function(){var e=this.jp_carousel("slides"),t=this.jp_carousel("selectedSlide");return 0===t.length||e.length>2&&t.is(e.last())?e.first():t.next()},prevSlide:function(){var e=this.jp_carousel("slides"),t=this.jp_carousel("selectedSlide");return 0===t.length||e.length>2&&t.is(e.first())?e.last():t.prev()},loadFullImage:function(t){var a=t.find("img:first");a.data("loaded")||(a.on("load.jetpack",function(){a.off("load.jetpack"),e(this).closest(".jp-carousel-slide").css("background-image","")}),!t.data("preview-image")||t.data("thumb-size")&&t.width()>t.data("thumb-size").width?a.attr("src",a.closest(".jp-carousel-slide").data("src")).attr("itemprop","image"):a.attr("src",t.data("preview-image")).attr("itemprop","image"),a.data("loaded",1))},hasMultipleImages:function(){return i.jp_carousel("slides").length>1}};e.fn.jp_carousel=function(t){return D[t]?D[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on jQuery.jp_carousel"):D.open.apply(this,arguments)},e(document.body).on("click.jp-carousel","div.gallery,div.tiled-gallery, a.single-image-gallery",function(t){e(this).jp_carousel("testForData",t.currentTarget)&&(e(t.target).parent().hasClass("gallery-caption")||(t.preventDefault(),t.stopPropagation(),e(this).jp_carousel("open",{start_index:e(this).find(".gallery-item, .tiled-gallery-item").index(e(t.target).parents(".gallery-item, .tiled-gallery-item"))})))}),1===Number(jetpackCarouselStrings.single_image_gallery)&&(I(),e(document.body).on("post-load",function(){I()})),e(window).on("hashchange.jp-carousel",function(){var t,a,s,r,n=/jp-carousel-(\d+)/;if(!window.location.hash||!n.test(window.location.hash))return void(i&&i.opened&&o.jp_carousel("close"));if(window.location.hash!==y||!i.opened){if(window.location.hash&&i&&!i.opened&&history.back)return void history.back();y=window.location.hash,t=window.location.hash.match(n),a=parseInt(t[1],10),s=e("div.gallery, div.tiled-gallery, a.single-image-gallery"),s.each(function(t,i){if(e(i).find("img").each(function(t,o){if(e(o).data("attachment-id")===parseInt(a,10))return r={index:t,gallery:i},!1}),r)return e(r.gallery).jp_carousel("openOrSelectSlide",r.index),!1})}}),window.location.hash&&e(window).trigger("hashchange")}),function(e){e.fn.touchwipe=function(t){var a={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:!0};return t&&e.extend(a,t),this.each(function(){function e(){this.removeEventListener("touchmove",t),o=null,r=!1}function t(t){if(a.preventDefaultEvents&&t.preventDefault(),r){var i=t.touches[0].pageX,n=t.touches[0].pageY,l=o-i,c=s-n;Math.abs(l)>=a.min_move_x?(e(),l>0?a.wipeLeft(t):a.wipeRight(t)):Math.abs(c)>=a.min_move_y&&(e(),c>0?a.wipeDown(t):a.wipeUp(t))}}function i(e){1===e.touches.length&&(o=e.touches[0].pageX,s=e.touches[0].pageY,r=!0,this.addEventListener("touchmove",t,!1))}var o,s,r=!1;"ontouchstart"in document.documentElement&&this.addEventListener("touchstart",i,!1)}),this}}(jQuery); \ No newline at end of file