Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/js/modules/themify.gallery.min.js
Назад
(($,d,f,y)=>{"use strict";const b={origHash:null,config:{},init(e){this.config=e,this.initLightbox(),this.openAnchor()},lightboxSelector(e){if(e.preventDefault(),e.stopImmediatePropagation(),!$(".mfp-wrap.mfp-gallery").length){const o=$(this);let a=o.find("> a");a=(0===a.length?o:a).attr("href");const s=b,l=s.getFileType(a),c=s.isVideo(a),p=d.parseVideo(a),h={},g=o.parents(".tf_swiper-container");let e;e=0<g.length?"inline"===l||"iframe"===l?[]:o.data("rel")?$('a[data-rel="'+o.data("rel")+'"]'):g.find(".tf_swiper-slide:not(.tf_swiper-slide-duplicate) .themify_lightbox img").parents(".themify_lightbox"):"inline"===l||"iframe"===l?[]:o.data("rel")?$('a[data-rel="'+o.data("rel")+'"]'):o.closest(".themify_builder_content>.module_row, .loops-wrapper, .gallery-wrapper").find(".themify_lightbox img").parents(".themify_lightbox"),$.uniqueSort(e);let i,n=0<g.length&&g[0].swiper?g[0].swiper.realIndex:1<e.length?e.index(this):0,t=c?"100%":s.getParam("width",a)?s.getParam("width",a):"94%",r=!c&&s.getParam("height",a)?s.getParam("height",a):"100%";if(t.includes("%")||(t+="px"),r.includes("%")||(r+="px"),!0===c&&("youtube"===p.type||"vimeo"===p.type)){const u=s.getCustomParams(a);u&&(a="youtube"===p.type?(h.youtube={id:"v=",index:"youtube.com/",src:"//www.youtube.com/embed/%id%"+u},s.getYoutubePath(a)):(h.vimeo={id:"/",index:"vimeo.com/",src:"//player.vimeo.com/video/%id%"+u},a.split("?")[0]))}const m={items:i=1<e.length&&-1!==n?(i=[],e.each(function(e,t){i.push({src:s.getiFrameLink($(t).prop("href")),title:s.getTitle(t),type:s.getFileType($(t).prop("href"))})}),i.reduce(function(e,t){const i=e.filter(function(e){return t.src===e.src});return 0===i.length&&(t.src===a&&(n=e.length),e.push(t)),e},[])):(n=0,{src:s.getiFrameLink(a),title:s.getTitle(this)}),type:l,image:{markup:s.getImageMarkup(this)},iframe:{markup:'<div class="mfp-iframe-scaler" style="max-width: '+t+" !important; height: "+r+';"><div role="button" tabindex="0" class="tf_close mfp-close"></div><div class="mfp-iframe-wrapper"><iframe class="mfp-iframe" noresize="noresize" frameborder="0" allowfullscreen></iframe></div>'+s.getSocialMarkup()+"</div>",patterns:h},callbacks:{beforeOpen(){f.body.classList.add("themify_mp_opened")},open(){s.updateHash("open",this),s.openSharing(this);let e=o.data("zoom-config"),t={};e&&((e=e.split("|"))[0]&&(t.width=e[0]),void 0!==e[1]&&(t.height=e[1]),$(this.content).parent().css(t))},change(){s.updateHash("open",this)},close(){s.updateHash("close")},afterClose(){f.body.classList.remove("themify_mp_opened")}}};1<e.length&&$.extend(m,{gallery:{enabled:!0,tCounter:s.config.i18n?s.config.i18n.tCounter:""}}),0<o.find("img").length&&$.extend(m,{mainClass:"mfp-with-zoom",zoom:{enabled:!d.isTouch,duration:300,easing:"ease-in-out",opener(){return o.find("img")}}}),m.mainClass=m.mainClass||"",m.mainClass+=c?" video-frame":" standard-frame",m.fixedContentPos=!0,s.isInIframe()?y.parent.jQuery.magnificPopup.open(m):$.magnificPopup.open(m,n)}},gallerySelector(e){const t=b;if("image"===t.getFileType($(this).prop("href"))){const i=$(t.config.gallerySelector,$(this).closest(".module, .gallery, .gallery-wrapper").not(".module-gallery"));if(i.length){e.preventDefault(),e.stopImmediatePropagation();const a=[],n=(i.each(function(){let e=$(this).prop("title");e=""!==e?e:void 0!==$(this).children("img").prop("alt")?$(this).children("img").prop("alt"):"",0<$(this).parent().next(".gallery-caption").length?e=$(this).parent().next(".wp-caption-text").html():0<$(this).find(".gallery-caption").find(".entry-content").length&&(e=$(this).find(".gallery-caption").find(".entry-content").text()),a.push({src:$(this).prop("href"),title:e,type:"image"})}),{gallery:{enabled:!0},image:{markup:t.getImageMarkup(this)},items:a,mainClass:"mfp-with-zoom",zoom:{enabled:!d.isTouch,duration:300,easing:"ease-in-out",opener(e){e=$(i[e.index]);return e.is("img")?e:e.find("img")}},callbacks:{open(){t.updateHash("open",this),t.openSharing(this)},change(){t.updateHash("open",this)},close(){t.updateHash("close")}}});(t.isInIframe()?y.parent.jQuery:$).magnificPopup.open(n,i.index(this))}}},contentImagesAreas(e){const t=b;if("image"===t.getFileType(this.getAttribute("href"))&&$(this).closest(t.config.contentImagesAreas)){e.preventDefault(),e.stopImmediatePropagation();const i=$(this),a={items:{src:i.prop("href"),title:0<i.next(".wp-caption-text").length?i.next(".wp-caption-text").html():i.children("img").prop("alt")},image:{markup:t.getImageMarkup(this)},type:"image",callbacks:{open(){t.updateHash("open",this),t.openSharing(this)},change(){t.updateHash("open",this)},close(){t.updateHash("close")}}};0<i.find("img").length&&$.extend(a,{mainClass:"mfp-with-zoom",zoom:{enabled:!d.isTouch,duration:300,easing:"ease-in-out",opener(){return i.find("img")}}}),(t.isInIframe()?y.parent.jQuery:$).magnificPopup.open(a)}},initLightbox(){d.body.off("click",this.config.lightboxSelector,this.lightboxSelector).on("click",this.config.lightboxSelector,this.lightboxSelector),this.config.gallerySelector&&d.body.off("click",this.config.gallerySelector,this.gallerySelector).on("click",this.config.gallerySelector,this.gallerySelector),this.config.contentImagesAreas&&d.body.off("click",".post-content a,.page-content a",this.contentImagesAreas).on("click",".post-content a,.page-content a",this.contentImagesAreas)},isInIframe(){return this.config.extraLightboxArgs&&this.config.extraLightboxArgs.displayIframeContentsInParent},getFileType(t){let i;try{i=new URL(t)}catch(e){i=t}const e=i&&"object"==typeof i?t.replace(i.search,""):t;return e.match(/\.(gif|jpg|jpeg|tiff|png|webp|apng)$/i)?"image":t.match(/\bajax=true\b/i)?"ajax":"#"===t.substr(0,1)?"inline":"iframe"},isVideo(e){return this.isYoutube(e)||this.isVimeo(e)||e.match(/\b.mov\b/i)||e.match(/\b.swf\b/i)},isYoutube(e){return"youtube"===d.parseVideo(e).type},isVimeo(e){return"vimeo"===d.parseVideo(e).type},getYoutubePath(e){let t="//youtube.com/watch?v=";return t+=e.match(/youtu\.be/i)?e.match(/youtu\.be\/([^\?]*)/i)[1]:this.getParam("v",e)},getiFrameLink(e){return"iframe"===this.getFileType(e)&&null===this.isVideo(e)&&(d.parseVideo(e),e=d.updateQueryString("iframe","true",e)),e},getParam(e,t){const i="[\\?&]"+(e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"))+"=([^&#]*)",a=new RegExp(i),n=a.exec(t);return null==n?"":n[1]},getCustomParams(e){let t=e.split("?")[1];return"?autoplay=1"+(t=t?"&"+t.replace(/[\\?&]?(v|autoplay)=[^&#]*/g,"").replace(/^&/g,""):"")},openSharing(t){if(!this.config.disableSharing){const e=t.content[0].tfClass("tf_social_sharing")[0];e&&e.tfOn("click",function(e){e.preventDefault(),d.sharer(e.target.dataset.type,t.currItem.data.src.replace("?iframe=true",""),t.currItem.data.title)})}},updateHash(e,i){if("open"===e){null===this.origHash&&(this.origHash=y.location.hash);let e=i.currItem.data.title,t=f.createElement("div");t.innerHTML=e,""!==(e=t.textContent.trim())&&this._updateHash(e)}else this._updateHash(this.origHash),this.origHash=null},_updateHash(e){"#"!==(""+e).charAt(0)&&(e="#"+e),history.replaceState("","",e)},openAnchor(){if(""!==y.location.hash){let e=decodeURI(y.location.hash.substring(1)),t=f.querySelector('[alt="'+e+'"]');null!==(t=null===t?f.querySelector('[title="'+e+'"]'):t)&&t.click()}},getIcon(e){e="tf-"+e.trim().replace(" ","-");const t="http://www.w3.org/2000/svg",i=f.createElementNS(t,"use"),a=f.createElementNS(t,"svg");return a.setAttribute("class","tf_fa "+e),i.setAttributeNS(null,"href","#"+e),a.appendChild(i),a},getSocialMarkup(){return this.config.disableSharing?"":(d.fonts(["ti-facebook","ti-twitter-alt","ti-pinterest","ti-email"]),'<div class="tf_social_sharing"><a href="#" data-type="facebook">'+this.getIcon("ti-facebook").outerHTML+'</a><a href="#" data-type="twitter">'+this.getIcon("ti-twitter-alt").outerHTML+'</a><a href="#" data-type="pinterest">'+this.getIcon("ti-pinterest").outerHTML+'</a><a href="#" data-type="email">'+this.getIcon("ti-email").outerHTML+"</a></div>")},getTitle(e){const t=e.querySelector("img");let i=e.dataset.t;return i=(i=!i&&t?t.title||t.alt:i)||e.title},getImageMarkup(e){const t="no"!==e.dataset.title?'<div class="mfp-title"></div>':"";return'<div class="mfp-figure"><div role="button" tabindex="0" class="tf_close mfp-close"></div><div class="mfp-counter"></div><div class="mfp-img"></div><div class="mfp-bottom-bar">'+t+this.getSocialMarkup()+"</div></div>"}};d.on("tf_gallery_init",e=>{b.init(e)})})(jQuery,Themify,document,window);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка