1var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; 2if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } 3{ 4 let window = _____WB$wombat$assign$function_____("window"); 5 let self = _____WB$wombat$assign$function_____("self"); 6 let document = _____WB$wombat$assign$function_____("document"); 7 let location = _____WB$wombat$assign$function_____("location"); 8 let top = _____WB$wombat$assign$function_____("top"); 9 let parent = _____WB$wombat$assign$function_____("parent"); 10 let frames = _____WB$wombat$assign$function_____("frames"); 11 let opener = _____WB$wombat$assign$function_____("opener"); 12 13/** 14 * @package EmbedPress 15 * @author EmbedPress <[email protected]> 16 * @copyright Copyright (C) 2023 EmbedPress. All rights reserved. 17 * @license GPLv2 or later 18 * @since 1.7.0 19 */ 20 21 22 23let epGlobals = {}; 24 25(function ($) { 26 'use strict'; 27 // function equivalent to jquery ready() 28 function ready(fn) { 29 if (document.readyState !== 'loading') { 30 fn(); 31 } else { 32 document.addEventListener('DOMContentLoaded', fn); 33 } 34 } 35 36 ready(function () { 37 let option = { 38 forceObject: true, 39 }; 40 let selector = document.querySelectorAll('.embedpress-embed-document-pdf'); 41 if (selector.length) { 42 selector.forEach((function (value, index, thisArg) { 43 let id = value.dataset['emid']; 44 let src = value.dataset['emsrc']; 45 PDFObject?.embed(src, "." + id, option); 46 })); 47 } 48 if (typeof epGlobals.youtubeChannelGallery === 'function') { 49 epGlobals.youtubeChannelGallery(); 50 } 51 }); 52 53 /** 54 * 55 * Make embeds responsive so they don't overflow their container. 56 */ 57 58 /** 59 * Add max-width & max-height to <iframe> elements, depending on their width & height props. 60 * 61 * 62 * @return {void} 63 */ 64 function embedPressResponsiveEmbeds() { 65 var proportion, parentWidth; 66 67 // Loop iframe elements. 68 document.querySelectorAll('iframe').forEach(function (iframe) { 69 // Only continue if the iframe has a width & height defined. 70 if (iframe.width && iframe.height) { 71 // Calculate the proportion/ratio based on the width & height. 72 proportion = parseFloat(iframe.width) / parseFloat(iframe.height); 73 // Get the parent element's width. 74 parentWidth = parseFloat(window.getComputedStyle(iframe.parentElement, null).width.replace('px', '')); 75 // Set the max-width & height. 76 iframe.style.maxWidth = '100%'; 77 iframe.style.maxHeight = Math.round(parentWidth / proportion).toString() + 'px'; 78 } 79 }); 80 } 81 82 epGlobals.handlePosterImageLoad = function () { 83 var posterImages = document.querySelectorAll(".plyr__poster"); 84 posterImages.forEach(function (posterImage) { 85 if (posterImage) { 86 var videoWrappers = document.querySelectorAll("[data-playerid]"); 87 videoWrappers.forEach(function (videoWrapper) { 88 var observer = new MutationObserver(function (mutationsList, observer) { 89 var posterImageStyle = window.getComputedStyle(posterImage); 90 if (posterImageStyle.getPropertyValue('background-image') !== 'none') { 91 setTimeout(function () { 92 videoWrapper.style.opacity = "1"; 93 }, 200); 94 observer.disconnect(); 95 } 96 }); 97 98 observer.observe(posterImage, { attributes: true, attributeFilter: ['style'] }); 99 }); 100 } 101 }); 102 } 103 104 105 106 // Run on initial load. 107 embedPressResponsiveEmbeds(); 108 109 // Run on resize. 110 window.onresize = embedPressResponsiveEmbeds; 111 112 113 function hasClass(ele, cls) { 114 return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)")); 115 } 116 117 function addClass(ele, cls) { 118 if (!hasClass(ele, cls)) ele.className += " " + cls; 119 } 120 121 function removeClass(ele, cls) { 122 if (hasClass(ele, cls)) { 123 var reg = new RegExp("(\\s|^)" + cls + "(\\s|$)"); 124 ele.className = ele.className.replace(reg, " "); 125 } 126 } 127 if (!Element.prototype.matches) { 128 Element.prototype.matches = 129 Element.prototype.matchesSelector || 130 Element.prototype.webkitMatchesSelector || 131 Element.prototype.mozMatchesSelector || 132 Element.prototype.msMatchesSelector || 133 Element.prototype.oMatchesSelector || 134 function (s) { 135 var matches = (this.document || this.ownerDocument).querySelectorAll(s), 136 i = matches.length; 137 while (--i >= 0 && matches.item(i) !== this) { } 138 return i > -1; 139 }; 140 } 141 var delegate = function (el, evt, sel, handler) { 142 el.addEventListener(evt, function (event) { 143 var t = event.target; 144 while (t && t !== this) { 145 if (t.matches(sel)) { 146 handler.call(t, event); 147 } 148 t = t.parentNode; 149 } 150 }); 151 }; 152 153 function sendRequest(url, postData, callback) { 154 var req = createXMLHTTPObject(); 155 if (!req) return; 156 var method = postData ? "POST" : "GET"; 157 req.open(method, url, true); 158 if (postData) { 159 req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 160 } 161 req.onreadystatechange = function () { 162 if (req.readyState != 4) return; 163 if (req.status != 200 && req.status != 304) { 164 return; 165 } 166 callback(req); 167 }; 168 if (req.readyState == 4) return; 169 req.send(postData); 170 } 171 172 var XMLHttpFactories = [ 173 function () { 174 return new XMLHttpRequest(); 175 }, 176 function () { 177 return new ActiveXObject("Msxml3.XMLHTTP"); 178 }, 179 function () { 180 return new ActiveXObject("Msxml2.XMLHTTP.6.0"); 181 }, 182 function () { 183 return new ActiveXObject("Msxml2.XMLHTTP.3.0"); 184 }, 185 function () { 186 return new ActiveXObject("Msxml2.XMLHTTP"); 187 }, 188 function () { 189 return new ActiveXObject("Microsoft.XMLHTTP"); 190 }, 191 ]; 192 193 function createXMLHTTPObject() { 194 var xmlhttp = false;
195 for (var i = 0; i < XMLHttpFactories.length; i++) { 196 try { 197 xmlhttp = XMLHttpFactories[i](); 198 } catch (e) { 199 continue; 200 } 201 break; 202 } 203 return xmlhttp; 204 } 205 206 epGlobals.youtubeChannelGallery = function () { 207 var playerWraps = document.getElementsByClassName("ep-player-wrap"); 208 if (playerWraps && playerWraps.length) { 209 for (var i = 0, im = playerWraps.length; im > i; i++) { 210 youtubeChannelEvents(playerWraps[i]) 211 } 212 } 213 } 214 215 function youtubeChannelEvents(playerWrap) { 216 217 delegate(playerWrap, "click", ".item", function (event) { 218 var embed = "https://web.archive.org/web/20250110224033/https://www.youtube.com/embed/"; 219 var vid = this.getAttribute("data-vid"); 220 var iframe = playerWrap.getElementsByTagName("iframe"); 221 if (vid) { 222 if (iframe) { 223 var vidSrc = iframe[0].src.replace(/(.*\/embed\/)([^\?&"'>]+)(.+)?/, `\$1${vid}\$3`); 224 if (vidSrc.indexOf('autoplay') > 0) { 225 vidSrc = vidSrc.replace('autoplay=0', 'autoplay=1'); 226 } 227 else { 228 vidSrc += '&autoplay=1'; 229 } 230 iframe[0].src = vidSrc; 231 playerWrap.scrollIntoView(); 232 } 233 } 234 }); 235 236 var currentPage = 1; 237 238 let nearestEpContentId = playerWrap.querySelector('.ep-youtube__content__block').getAttribute('data-unique-id'); 239 240 let epContentBlock = playerWrap.querySelector('.ep-youtube__content__block'); 241 let parentElement = epContentBlock.parentElement; 242 243 // Get the value of data-channel-url attribute from a sibling 244 let channelUrl = parentElement.querySelector('[data-channel-url]').getAttribute('data-channel-url'); 245 246 247 delegate(playerWrap, "click", ".ep-next, .ep-prev", function (event) { 248 const totalPages = event.target.closest('.ose-youtube').getAttribute('data-total-pages'); 249 const closestClass = event.target.closest('.ose-youtube').classList; 250 251 const activePage = document.querySelector(`.${closestClass[1]} .embedpress-page-active`); 252 if (activePage) { 253 document.querySelector(`.${closestClass[1]} .embedpress-page-active`).classList.remove('embedpress-page-active'); 254 } 255 256 257 258 var isNext = this.classList.contains("ep-next"); 259 260 if (isNext) { 261 currentPage++; 262 } else { 263 currentPage--; 264 } 265 266 var data = { 267 action: "youtube_rest_api", 268 playlistid: this.getAttribute("data-playlistid"), 269 pagetoken: this.getAttribute("data-pagetoken"), 270 pagesize: this.getAttribute("data-pagesize"), 271 channelUrl: channelUrl, 272 currentpage: currentPage 273 }; 274 275 var formBody = []; 276 for (var property in data) { 277 var encodedKey = encodeURIComponent(property); 278 var encodedValue = encodeURIComponent(data[property]); 279 formBody.push(encodedKey + "=" + encodedValue); 280 } 281 formBody = formBody.join("&"); 282 283 var galleryWrapper = playerWrap.getElementsByClassName( 284 "ep-youtube__content__block" 285 ); 286 287 playerWrap.setAttribute('data-current-page', currentPage); 288 289 290 let x = 1; 291 292 sendRequest("/wp-admin/admin-ajax.php", formBody, function (request) { 293 if (galleryWrapper && galleryWrapper[0] && request.responseText) { 294 var response = JSON.parse(request.responseText); 295 galleryWrapper[0].outerHTML = response.html; 296 297 var currentPageNode = 298 galleryWrapper[0].getElementsByClassName("current-page"); 299 if (currentPageNode && currentPageNode[0]) { 300 currentPageNode[0].textContent = currentPage; 301 302 } 303 } 304 }); 305 306 const intervalID = setInterval(() => { 307 x++ 308 309 if (playerWrap.querySelector('.ep-youtube__content__block')) { 310 const newNearestEpContentId = playerWrap 311 .querySelector('.ep-youtube__content__block') 312 .getAttribute('data-unique-id'); 313 314 if (newNearestEpContentId !== nearestEpContentId && playerWrap.querySelector(`[data-
314page="${currentPage}"]`)) { 315 playerWrap.querySelector(`[data-page="${currentPage}"]`).classList.add('embedpress-page-active'); 316 nearestEpContentId = newNearestEpContentId; 317 clearInterval(intervalID); 318 } 319 } 320 321 if (x > 100) { 322 clearInterval(intervalID); 323 } 324 }, 100); 325 326 }); 327 } 328 329 //Load more for OpenaSea collection 330 const epLoadMore = () => { 331 332 $('.embedpress-gutenberg-wrapper .ep-nft-gallery-wrapper').each(function () { 333 let selctorEl = `[data-nftid='${$(this).data('nftid')}']`; 334 335 let loadmorelabel = $(selctorEl).data('loadmorelabel'); 336 let iconcolor = $(selctorEl + " .nft-loadmore").data('iconcolor'); 337 338 let spinicon = `<svg width="18" height="18" fill="${iconcolor || '#fff'}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_GuJz{transform-origin:center;animation:spinner_STY6 1.5s linear infinite}@keyframes spinner_STY6{100%{transform:rotate(360deg)}}</style><g class="spinner_GuJz"><circle cx="3" cy="12" r="2"/><circle cx="21" cy="12" r="2"/><circle cx="12" cy="21" r="2"/><circle cx="12" cy="3" r="2"/><circle cx="5.64" cy="5.64" r="2"/><circle cx="18.36" cy="18.36" r="2"/><circle cx="5.64" cy="18.36" r="2"/><circle cx="18.36" cy="5.64" r="2"/></g></svg>`; 339 340 $(selctorEl + ` .ep_nft_item`).slice(0, $(selctorEl).data('itemparpage')).show(); 341 $('.embedpress-gutenberg-wrapper .ep-nft-gallery-wrapper .ep-loadmore-wrapper button').css('display', 'flex'); 342 343 $(selctorEl + " .nft-loadmore").click(function (e) { 344 //change the text of the button 345 $(this).html(loadmorelabel + spinicon); 346 //disable the button 347 $(this).prop("disabled", true); 348 //wait for 1 seconds 349 setTimeout(function () { 350 //change the text back 351 $(selctorEl + " .nft-loadmore").text(loadmorelabel); 352 //enable the button 353 $(selctorEl + " .nft-loadmore").prop("disabled", false); 354 $(selctorEl + " .ep_nft_item:hidden").slice(0, $(selctorEl).data('itemparpage')).fadeIn("slow"); 355 if ($(selctorEl + " .ep_nft_item:hidden").length == 0) { 356 $(selctorEl + " .nft-loadmore").fadeOut("slow"); 357 } 358 }, 500); 359 }); 360 }); 361 }; 362 363 if ($('.embedpress-gutenberg-wrapper .ep-nft-gallery-wrapper').length > 0) { 364 epLoadMore(); 365 } 366 367 // Content protection system function 368 const unlockSubmitHander = (perentSel, that) => { 369 var ep_client_id = jQuery(that).closest('form').find('input[name="ep_client_id"]').val(); 370 var password = jQuery(`input[name="pass_${ep_client_id}"]`).val(); 371 var post_id = jQuery(`input[name="post_id"]`).val(); 372 const buttonText = jQuery(that).closest('.password-form-container').find('input[type="submit"]').val(); 373 const unlokingText = jQuery(that).data('unlocking-text'); 374 375 376 var data = { 377 'action': 'lock_content_form_handler', 378 'client_id': ep_client_id, 379 'password': password, 380 'post_id': post_id, 381 }; 382 383 jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="submit"]').val(unlokingText); 384 385 jQuery.post(eplocalize.ajaxurl, data, function (response) { 386 if (response.success) { 387 if (!response.embedHtml) { 388 389 jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="submit"]').val(buttonText); 390 jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="password"]').val(''); 391 jQuery(that).closest('.password-form-container').find('.error-message').removeClass('hidden'); 392 } 393 else { 394 jQuery('#' + perentSel + '-' + ep_client_id + ' .ep-embed-content-wraper').html(response.embedHtml); 395 396 if (jQuery('#' + perentSel + '-' + ep_client_id + ' .ose-youtube').length > 0) { 397 epGlobals.youtubeChannelGallery(); 398 } 399 400 if ($('.embedpress-gutenberg-wrapper .ep-nft-gallery-wrapper').length > 0) { 401 epLoadMore(); 402 } 403 404 // Custom player initialization when content protection enabled 405 document.querySelector('#' + perentSel + '-' + ep_client_id + ' .ep-embed-content-wraper').classList.remove('plyr-initialized'); 406 407 initPlayer(document.querySelector('#' + perentSel + '-' + ep_client_id + ' .ep-embed-content-wraper')); 408 409 if (eplocalize.is_pro_plugin_active) { 410 const adIdEl = document.querySelector('#' + perentSel + '-' + ep_client_id + ' [data-sponsored-id]'); 411 adInitialization(adIdEl, adIdEl?.getAttribute('data-ad-index')); 412 } 413 414 } 415 } else { 416 jQuery('#password-error_' + ep_client_id).html(response.form); 417 jQuery('#password-error_' + ep_client_id).show(); 418 } 419 }, 'json'); 420 } 421 422 // unlockSubmitHander called for gutentberg 423 jQuery('.ep-gutenberg-content .password-form').submit(function (e) { 424 e.preventDefault(); // Prevent the default form submission 425 unlockSubmitHander('ep-gutenberg-content', this); 426 }); 427 428 window.addEventListener('load', function (e) {
429 const urlParams = new URLSearchParams(window.location.search); 430 const hash = urlParams.get('hash'); 431 432 // find the element with the matching id 433 const element = document.getElementById(hash); 434 435 if (element) { 436 element.scrollIntoView({ behavior: 'smooth' }); 437 } 438 439 }); 440 441 // Get the insta-gallery container element 442 const getPopupTemplate = (instPost, hashtag = '', accountType) => { 443 444 let instaPostData = JSON.parse(instPost); 445 446 447 let likeIcon = '<svg aria-label="Like" class="x1lliihq x1n2onr6" color="#262626" fill="#262626" height="24" viewBox="0 0 24 24" width="24"><path d="M16.792 3.904A4.989 4.989 0 0 1 21.5 9.122c0 3.072-2.652 4.959-5.197 7.222-2.512 2.243-3.865 3.469-4.303 3.752-.477-.309-2.143-1.823-4.303-3.752C5.141 14.072 2.5 12.167 2.5 9.122a4.989 4.989 0 0 1 4.708-5.218 4.21 4.21 0 0 1 3.675 1.941c.84 1.175.98 1.763 1.12 1.763s.278-.588 1.11-1.766a4.17 4.17 0 0 1 3.679-1.938m0-2a6.04 6.04 0 0 0-4.797 2.127 6.052 6.052 0 0 0-4.787-2.127A6.985 6.985 0 0 0 .5 9.122c0 3.61 2.55 5.827 5.015 7.97.283.246.569.494.853.747l1.027.918a44.998 44.998 0 0 0 3.518 3.018 2 2 0 0 0 2.174 0 45.263 45.263 0 0 0 3.626-3.115l.922-.824c.293-.26.59-.519.885-.774 2.334-2.025 4.98-4.32 4.98-7.94a6.985 6.985 0 0 0-6.708-7.218Z"/></svg>'; 448 449 if (instaPostData.like_count > 0) { 450 likeIcon = '<svg aria-label="Unlike" class="x1lliihq x1n2onr6" color="#FF3040" fill="#FF3040" height="24" viewBox="0 0 48 48" width="24"><path d="M34.6 3.1c-4.5 0-7.9 1.8-10.6 5.6-2.7-3.7-6.1-5.5-10.6-5.5C6 3.1 0 9.6 0 17.6c0 7.3 5.4 12 10.6 16.5.6.5 1.3 1.1 1.9 1.7l2.3 2c4.4 3.9 6.6 5.9 7.6 6.5.5.3 1.1.5 1.6.5s1.1-.2 1.6-.5c1-.6 2.8-2.2 7.8-6.8l2-1.8c.7-.6 1.3-1.2 2-1.7C42.7 29.6 48 25 48 17.6c0-8-6-14.5-13.4-14.5z"/></svg>'; 451 } 452 453 const commentsIcon = '<svg aria-label="Comment" class="x1lliihq x1n2onr6" color="#000" height="24" viewBox="0 0 24 24" width="24"><path d="M20.656 17.008a9.993 9.993 0 1 0-3.59 3.615L22 22Z" fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="2"/></svg>'; 454 455 const shareIcon = '<svg width="20" height="20" viewBox="0 0 0.6 0.6" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg"><path stroke-width="1" d="m.543.282-.2-.2A.025.025 0 0 0 .3.1v.089a.275.275 0 0 0-.25.274V.5a.025.025 0 0 0 .045.015.3.3 0 0 1 .197-.101L.3.413V.5a.025.025 0 0 0 .043.018l.2-.2a.025.025 0 0 0 0-.035M.35.44V.388A.025.025 0 0 0 .325.363L.286.365a.35.35 0 0 0-.185.074.225.225 0 0 1 .224-.201A.025.025 0 0 0 .35.213V.16L.49.3Z"/></svg>'; 456 457 const instaIcon = '<svg width="18" height="18" viewBox="0 0 0.338 0.338" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M.248.079H.27M.102.012h.135a.09.09 0 0 1 .09.09v.135a.09.09 0 0 1-.09.09H.102a.09.09 0 0 1-.09-.09V.102a.09.09 0 0 1 .09-.09ZM.17.237a.068.068 0 1 1 0-.135.068.068 0 0 1 0 .135Z" stroke="#000" stroke-width=".032"/></svg>'; 458 459 460 461 const instaUserInfo = instPost.user_info; 462 463 let getDate = new Date(instaPostData.timestamp); 464 getDate = getDate.toLocaleString('en-US', { day: 'numeric', month: 'short', year: 'numeric' }); 465 466 let getTime = new Date(instaPostData.timestamp); 467 getTime = getTime.toLocaleString('en-US', { hour12: false, hour: 'numeric', minute: 'numeric', second: 'numeric' }); 468 469 let captionText = instaPostData.caption ? instaPostData.caption : ''; 470 const tagRegex = /(#\w+)/g; 471 472 const wrapTag = (match) => { 473 const tag = match.substring(1); // Remove the '#' character 474 const tagUrl = `https://web.archive.org/web/20250110224033/https://www.instagram.com/explore/tags/${tag}`; 475 return `<span class="tag-wrapper"><a target="_blank" href="${tagUrl}">${match}</a></span>`; 476 }; 477 478 captionText = captionText.replace(tagRegex, wrapTag); 479 480 let carouselTemplate = ''; 481 if (instaPostData.media_type === 'CAROUSEL_ALBUM') { 482 carouselTemplate += `<div class="popup-carousel"><div class="cg-carousel__track js-carousel__track">`; 483 484 instaPostData.children.data?.map((item) => { 485 if (item.media_type?.toLowerCase() === 'video') { 486 carouselTemplate += `<video width="630" class="popup-media-image cg-carou
486sel__slide js-carousel__slide" controls src="${item.media_url || ''}" alt="${item.caption || ''}" controlsList="nodownload"></video>`; 487 } 488 else { 489 carouselTemplate += `<img width="630" class="popup-media-image cg-carousel__slide js-carousel__slide" src="${item.media_url || ''}" alt="${item.caption || ''}" />`; 490 } 491 }); 492 493 carouselTemplate += `</div></div>`; 494 495 carouselTemplate += `<div class="cg-carousel__btns"> 496 <button class="cg-carousel__btn js-carousel__prev-1"><svg width="20" height="30" viewBox="-5 0 23 23" xmlns="http://www.w3.org/2000/svg"><path d="M11.24.29.361 10.742l-.06.054a.97.97 0 0 0-.301.642v.124a.97.97 0 0 0 .3.642l.054.044L11.239 22.71a1.061 1.061 0 0 0 1.459 0 .964.964 0 0 0 0-1.402l-10.15-9.746 10.15-9.87a.964.964 0 0 0 0-1.402 1.061 1.061 0 0 0-1.459 0Z" fill="#fff"/></svg></button> 497 498 <button class="cg-carousel__btn js-carousel__next-1"><svg width="20" height="30" viewBox="-5 0 23 23" xmlns="http://www.w3.org/2000/svg"><path d="m1.76.29 10.879 10.452.06.054a.97.97 0 0 1 .301.642v.124a.97.97 0 0 1-.3.642l-.054.044L1.761 22.71a1.061 1.061 0 0 1-1.459 0 .964.964 0 0 1 0-1.402l10.15-9.746-10.15-9.87a.964.964 0 0 1 0-1.402 1.061 1.061 0 0 1 1.459 0Z" fill="#fff"/></svg></button> 499 </div>` 500 } 501 else { 502 if (instaPostData.media_type?.toLowerCase() === 'video') { 503 carouselTemplate += `<video width="630" class="popup-media-image" controls src="${instaPostData.media_url || ''}" alt="${instaPostData.caption || ''}"></video>`; 504 } 505 else { 506 carouselTemplate += `<img width="630" class="popup-media-image" src="${instaPostData.media_url || ''}" alt="${instaPostData.caption || ''}" />`; 507 } 508 } 509 510 let srcUrl = `https://web.archive.org/web/20250110224033/https://www.instagram.com/${instaPostData.username}/`; 511 512 if (hashtag) { 513 instaPostData.username = '#' + hashtag; 514 srcUrl = `https://web.archive.org/web/20250110224033/https://www.instagram.com/explore/tags/${hashtag}/`; 515 } 516 517 518 let likeComments = ''; 519 520 if (eplocalize.is_pro_plugin_active && accountType === 'business') { 521 if (instaPostData.show_likes_count == 'true') { 522 likeComments += ` 523 <div class="embedpress-inline popup-like-button"><a target="_blank" href="${instaPostData.permalink}">${likeIcon} ${instaPostData.like_count || 0}</a></div> 524 `; 525 } 526 if (instaPostData.show_comments_count == 'true') { 527 likeComments += ` 528 <div class="embedpress-inline"><a target="_blank" href="${instaPostData.permalink}">${commentsIcon} ${instaPostData.comments_count || 0}</a></div> 529 `; 530 } 531 } 532 533 534 let followBtn = ''; 535 if (instaPostData.popup_follow_button_text == 'false') { 536 instaPostData.popup_follow_button_text = ''; 537 } 538 if (instaPostData.popup_follow_button == 'true' || instaPostData.popup_follow_button == 'yes') { 539 followBtn = `<div class="insta-followbtn"> 540 <a target="_new" href="${srcUrl}" type="button" class="btn btn-primary">${instaPostData.popup_follow_button_text}</a> 541 </div>`; 542 } 543 544 let popupHtml = ''; 545 popupHtml += ` 546 <div class="popup-container"> 547 <div class="popup-md-9 white"> 548 <div class="embedpress-popup-block embedpress-popup-img" id="post-${instaPostData.id}"> 549 ${carouselTemplate} 550 </div> 551 </div> 552 <div class="popup-md-3 red"> 553 <div class="embedpress-popup-block embedpress-popup-info"> 554 <div class="embedpress-popup-header"> 555 <div class="embedpress-popup-header-img"> <a target="_blank" href="${srcUrl}" 556 target="_blank" class="embedpress-href"> 557 <img decoding="async" loading="lazy" class="embedpress-popup-round" src="${instaPostData.profile_picture_url}" width="30" height="30"> <span class="embedpress-popup-username">${instaPostData.username}</span> 558 </a> 559 </div> 560 ${followBtn} 561 </div> 562 <div class="embedpress-popup-text">${captionText}</div> 563 <div class="embedpress-popup-stats"> 564 ${likeComments} 565 <div class="embedpress-inline"> 566 <div class="embedpress-popup-share-buttons"> <a 567 href="https://web.archive.org/web/20250110224033/https://www.facebook.com/sharer/sharer.php?u=${instaPostData.permalink}" target="_blank">
568 <span class="dashicons dashicons-facebook"></span></a> <a 569 href="https://web.archive.org/web/20250110224033/https://twitter.com/intent/tweet?url=${instaPostData.permalink}" 570 target="_blank"><span> 571 <svg viewBox="0 0 18 18" aria-hidden="true" class="r-4qtqp9 r-yyyyoo r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-lrsllp r-18jsvk2 r-16y2uox r-8kz0gk" width="18" height="18"><path d="M13.683 1.688h2.481l-5.42 6.195 6.377 8.43h-4.993L8.217 11.2l-4.474 5.113H1.26l5.798-6.626L.941 1.688H6.06l3.535 4.673zm-.871 13.14h1.375L5.313 3.095H3.838z"/></svg> 572 </span></a> 573 <a href="https://web.archive.org/web/20250110224033/https://www.linkedin.com/shareArticle?mini=true&url=${instaPostData.permalink}" 574 target="_blank"><span class="dashicons dashicons-linkedin"></span></a> <a 575 href="https://web.archive.org/web/20250110224033/https://pinterest.com/pin/create/button/?url=${instaPostData.permalink}" 576 target="_blank"><span class="dashicons dashicons-pinterest"></span></a></div> 577 <div class="embedpress-href embedpress-popup-share">${shareIcon}</div> 578 </div><div class="embedpress-inline embedpress-popup-instagram-buttons"><a 579 href="${instaPostData.permalink}" target="_blank" 580 class="embedpress-href">${instaIcon}</a></div> 581 </div> 582 583 </div> 584 </div> 585 </div> 586 `; 587 588 // INIT CAROUSEL 589 590 591 return popupHtml; 592 } 593 594 // Add a click event listener to the insta-gallery container 595 epGlobals.instaPopup = (container) => { 596 container?.addEventListener('click', function (event) { 597 // Check if the clicked element has the class insta-gallery-item 598 const instaItem = event.target.closest('.insta-gallery-item'); 599 600 if (instaItem) { 601 602 const postData = instaItem.dataset.postdata; 603 604 const postid = instaItem.getAttribute('data-insta-postid'); 605 const accountType = container?.closest('.instagram-container')?.getAttribute('data-connected-acc-type'); 606 607 let hashtag = ''; 608 609 if (instaItem.closest('.instagram-container').getAttribute('data-hashtag')) { 610 hashtag = instaItem?.closest('.instagram-container')?.getAttribute('data-hashtag'); 611 } 612 613 const closestPopup = event.target.closest('.ose-instagram-feed')?.querySelector('.insta-popup'); 614 615 if (closestPopup) { 616 closestPopup.style.display = 'block'; 617 } 618 619 620 var feedElement = event.target.closest('.ose-instagram-feed'); 621 if (feedElement) { 622 var popupElement = feedElement.querySelector('.popup-is-initialized'); 623 if (popupElement) { 624 popupElement.innerHTML = getPopupTemplate(postData, hashtag, accountType); 625 } 626 } 627 628 if (!document.querySelector(`#post-${postid}`)?.classList.contains('carousel-is-initialized')) { 629 const carousel = new CgCarousel(`#post-${postid}`, { slidesPerView: 1, loop: true }, {}); 630 631 const next = document.querySelector(`#post-${postid} .js-carousel__next-1`); 632 next?.addEventListener('click', () => carousel.next()); 633 634 const prev = document.querySelector(`#post-${postid} .js-carousel__prev-1`); 635 prev?.addEventListener('click', () => carousel.prev()); 636 637 document.querySelector(`#post-${postid}`)?.classList.add('carousel-is-initialized'); 638 } 639 640 } 641 }); 642 } 643 644 645 const instaContainers = document.querySelectorAll('.embedpress-gutenberg-wrapper .insta-gallery'); 646 if (instaContainers.length > 0) {
647 instaContainers.forEach((container) => { 648 epGlobals.instaPopup(container); 649 }); 650 } 651 652 $('.popup-close').click(function (e) { 653 // Hide the popup by setting display to none 654 $('.insta-popup').hide(); 655 $('.popup-container').remove(); 656 }); 657 658 $(document).on('click', function (e) { 659 if (e.target.classList.contains('popup-wrapper')) { 660 $('.insta-popup').hide(); 661 $('.popup-container').remove(); 662 } 663 }); 664 665 666 const instafeeds = document.querySelectorAll('.ose-instagram-feed'); 667 668 epGlobals.initializeTabs = (containerEl) => { 669 670 // Initial tab selection 671 showItems('ALL'); 672 673 containerEl.addEventListener('click', function (event) { 674 const clickedElement = event.target; 675 if (!clickedElement) { 676 return; // No element clicked, ignore the event 677 } 678 679 if (containerEl.querySelector('.load-more-button-container') && (clickedElement.getAttribute('data-media-type') === 'VIDEO' || clickedElement.getAttribute('data-media-type') === 'CAROUSEL_ALBUM')) { 680 containerEl.querySelector('.load-more-button-container').style.display = 'none'; 681 } 682 else if (containerEl.querySelector('.load-more-button-container') && (clickedElement.getAttribute('data-media-type') === 'ALL')) { 683 containerEl.querySelector('.load-more-button-container').style.display = 'flex'; 684 } 685 686 // Handle tab click 687 if (clickedElement.matches('.tabs li')) { 688 if (clickedElement.classList.contains('active')) { 689 return; 690 } else { 691 const mediaType = clickedElement.getAttribute('data-media-type'); 692 showItems(mediaType); 693 694 const tabs = containerEl.querySelectorAll('.tabs li');
695 tabs.forEach(t => t.classList.remove('active')); 696 clickedElement.classList.add('active'); 697 } 698 } 699 700 }); 701 702 function showItems(mediaType) { 703 const items = containerEl.getElementsByClassName('insta-gallery-item'); 704 for (let i = 0; i < items.length; i++) { 705 const item = items[i]; 706 if (mediaType === 'ALL' || item.getAttribute('data-media-type') === mediaType) { 707 item.style.display = 'block'; 708 } else { 709 item.style.display = 'none'; 710 } 711 } 712 } 713 } 714 715 epGlobals.instaLoadMore = () => { 716 // Unbind any previously bound click event to avoid multiple bindings 717 $('.insta-load-more-button').off('click').on('click', function (e) { 718 const that = $(this); 719 const loadmoreBtn = that.closest('.load-more-button-container'); 720 const loadmoreKey = loadmoreBtn.data('loadmorekey'); 721 const connectedAccount = that.closest('.instagram-container').data('connected-acc-type'); 722 const feedType = that.closest('.instagram-container').data('feed-type'); 723 const hashtagId = that.closest('.instagram-container').data('hashtag-id'); 724 const userId = that.closest('.instagram-container').data('uid'); 725 let loadedPosts = loadmoreBtn.data('loaded-posts') || 0; 726 let postsPerPage = loadmoreBtn.data('posts-per-page') || 0; 727 const params = JSON.stringify(that.closest('.instagram-container').data('params')); 728 729 730 const instaContainer = that.closest('.instagram-container'); 731 732 const spinicon = `<svg class="insta-loadmore-spinicon" width="18" height="18" fill="${'#fff'}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_GuJz{transform-origin:center;animation:spinner_STY6 1.5s linear infinite}@keyframes spinner_STY6{100%{transform:rotate(360deg)}}</style><g class="spinner_GuJz"><circle cx="3" cy="12" r="2"/><circle cx="21" cy="12" r="2"/><circle cx="12" cy="21" r="2"/><circle cx="12" cy="3" r="2"/><circle cx="5.64" cy="5.64" r="2"/><circle cx="18.36" cy="18.36" r="2"/><circle cx="5.64" cy="18.36" r="2"/><circle cx="18.36" cy="5.64" r="2"/></g></svg>`; 733 734 // Check if no spinicon exists 735 if (instaContainer.find('.insta-loadmore-spinicon').length === 0) { 736 that.append(spinicon); 737 } 738 739 that.attr('disabled', true); 740 741 var data = { 742 'action': 'loadmore_data_handler', 743 'user_id': userId, 744 'loaded_posts': loadedPosts, 745 'posts_per_page': postsPerPage, 746 'feed_type': feedType, 747 'connected_account_type': connectedAccount,
748 'loadmore_key': loadmoreKey, 749 'params': params, 750 '_nonce': eplocalize.nonce 751 }; 752 753 if (feedType === 'hashtag_type') { 754 data.hashtag_id = hashtagId; 755 } 756 757 jQuery.post(eplocalize.ajaxurl, data, function (response) { 758 if (response.total_feed_posts >= response.next_post_index) { 759 var $responseHtml = $(response.html); 760 761 instaContainer.find('.insta-gallery').append($responseHtml); 762 that.removeAttr('disabled'); 763 764 instaContainer.find('.insta-loadmore-spinicon').remove(); 765 766 loadedPosts = response.next_post_index; 767 768 loadmoreBtn.data('loaded-posts', loadedPosts); 769 770 // After loading more items, reinitialize the tabs for the specific container 771 const containerEl = loadmoreBtn.closest('.ose-instagram-feed')[0]; 772 epGlobals.initializeTabs(containerEl); 773 774 if (response.total_feed_posts === response.next_post_index) { 775 loadmoreBtn.remove(); 776 } 777 } else { 778 loadmoreBtn.remove(); 779 } 780 }); 781 }); 782 } 783 784 785 if (instafeeds.length > 0) { 786 instafeeds.forEach(function (feed) { 787 epGlobals.initializeTabs(feed); 788 }); 789 } 790 791 if ($('.embedpress-gutenberg-wrapper .ose-instagram-feed').length > 0) { 792 epGlobals.instaLoadMore(); 793 } 794 795 $(document).on({ 796 mouseenter: function () { 797 $('.embedpress-popup-share-buttons').addClass('show'); 798 }, 799 mouseleave: function () { 800 var buttons = $('.embedpress-popup-share-buttons'); 801 setTimeout(function () { 802 if (!buttons.is(':hover')) buttons.removeClass('show'); 803 }, 200); 804 } 805 }, '.embedpress-href.embedpress-popup-share, .embedpress-popup-share-buttons'); 806 807 $(document).on({ 808 mouseenter: function () { 809 $(this).addClass('show'); 810 }, 811 mouseleave: function () { 812 $(this).removeClass('show'); 813 } 814 }, '.embedpress-popup-share-buttons'); 815 816 817 818 819 820})(jQuery); 821 822 823 824document.addEventListener('DOMContentLoaded', function () { 825 826 epGlobals.initCarousel = (carouselSelector, options, carouselId) => { 827 828 const carouselOptions = { 829 slidesPerView: options.slideshow, 830 spacing: options.spacing, 831 loop: options.loop, 832 autoplay: options.autoplay, 833 transitionSpeed: options.transitionspeed, 834 autoplaySpeed: options.autoplayspeed, 835 arrows: options.arrows, 836 breakpoints: { 837 768: { 838 slidesPerView: parseInt(options.slideshow) - 1 839 }, 840 1024: { 841 slidesPerView: parseInt(options.slideshow) 842 } 843 } 844 }; 845 846 // INIT CAROUSEL 847 const carousel = new CgCarousel(carouselSelector, carouselOptions, {}); 848 849 // Navigation 850 const next = document.querySelector(`[data-carouselid="${carouselId}"] #js-carousel__next-1`); 851 next?.addEventListener('click', () => carousel.next()); 852 853 const prev = document.querySelector(`[data-carouselid="${carouselId}"] #js-carousel__prev-1`); 854 prev?.addEventListener('click', () => carousel.prev()); 855 } 856 857 const instaWrappers = document.querySelectorAll('.ep-embed-content-wraper'); 858 859 if (instaWrappers.length > 0) { 860 instaWrappers.forEach((wrapper) => { 861 const carouselId = wrapper.getAttribute('data-carouselid'); 862 863 if (!carouselId) return; 864 865 let options = wrapper.getAttribute(`data-carousel-options`); 866 867 options = JSON.parse(options); 868 const carouselSelector = `[data-carouselid="${carouselId}"] .embedpress-insta-container`; 869 870 if (options.arrows) { 871 document.querySelector(`[data-carouselid="${carouselId}
871"] .cg-carousel__btns`).classList.remove('hidden'); 872 } 873 874 epGlobals.initCarousel(carouselSelector, options, carouselId); 875 876 }); 877 } 878 879 // Youtube Channel Carousel 880 881 const youtubeCarouselWraper = document.querySelectorAll('[data-youtube-channel-carousel]'); 882 883 if (youtubeCarouselWraper.length > 0) { 884 youtubeCarouselWraper.forEach((wrapper) => { 885 const carouselId = wrapper.getAttribute('data-youtube-channel-carousel'); 886 if (!carouselId) return; 887 888 // let options = wrapper.getAttribute(`data-carousel-options`); 889 890 // options = JSON.parse(options); 891 892 const carouselSelector = `[data-youtube-channel-carousel="${carouselId}"] .youtube__content__body`; 893 894 // if (options.arrows) { 895 // document.querySelector(`[data-youtube-channel-carousel="${carouselId}"] .cg-carousel__btns`).classList.remove('hidden'); 896 // } 897 898 const options = { 899 slidesPerView: 2, 900 autoplay: true, 901 loop: true, 902 breakpoints: { 903 768: { 904 slidesPerView: 2 905 }, 906 1024: { 907 slidesPerView: 4 908 } 909 } 910 } 911 912 // epGlobals.initCarousel(carouselSelector, options, {}); 913 914 }); 915 } 916 917 918 919}); 920 921document.addEventListener('DOMContentLoaded', () => { 922 const carousel = document.querySelector('.youtube-carousel'); 923 924 if(!carousel) { 925 return; 926 } 927 928 const items = document.querySelectorAll('.item'); 929 const prevButton = document.querySelector('.preview'); 930 const nextButton = document.querySelector('.next'); 931 932 let itemsToShow = getItemsToShow(); // Determine items to show based on screen width 933 934 const totalItems = items.length; 935 let currentIndex = 0; 936 937 function updateCarousel() { 938 const offset = -currentIndex * (100 / itemsToShow); 939 carousel.style.transform = `translateX(${offset}%)`; 940 } 941 942 function nextSlide() { 943 const remainingItems = totalItems - (currentIndex + itemsToShow); 944 if (remainingItems >= itemsToShow) { 945 currentIndex += itemsToShow; 946 } else if (remainingItems > 0) { 947 currentIndex += remainingItems; 948 } else { 949 currentIndex = 0; 950 } 951 updateCarousel(); 952 } 953 954 function prevSlide() { 955 if (currentIndex > 0) { 956 currentIndex -= itemsToShow; 957 if (currentIndex < 0) { 958 currentIndex = 0; 959 } 960 } else { 961 currentIndex = totalItems - itemsToShow; 962 } 963 updateCarousel(); 964 } 965 966 nextButton?.addEventListener('click', nextSlide); 967 prevButton?.addEventListener('click', prevSlide); 968 969 // Optional: Autoplay 970 let autoplay = false; 971 const autoplayInterval = 3000; // Change the time as needed 972 let autoplayId; 973 974 function startAutoplay() { 975 autoplayId = setInterval(nextSlide, autoplayInterval); 976 } 977 978 function stopAutoplay() { 979 clearInterval(autoplayId); 980 } 981 982 if (autoplay) { 983 startAutoplay(); 984 985 // Stop autoplay on mouseover, resume on mouseout 986 carousel.addEventListener('mouseover', stopAutoplay); 987 carousel.addEventListener('mouseout', startAutoplay); 988 } 989 990 // Handle responsive behavior 991 window.addEventListener('resize', () => { 992 itemsToShow = getItemsToShow(); 993 updateCarousel(); 994 995 }); 996 997 function getItemsToShow() { 998 const width = window.innerWidth; 999 if (width >= 1024) { 1000 return 3; 1001 } else if (width >= 768) { 1002 return 2; 1003 } else { 1004 return 1; 1005 } 1006 } 1007}); 1008 1009 1010 1011 1012jQuery(window).on("elementor/frontend/init", function () { 1013 1014 var filterableGalleryHandler = function ($scope, $) { 1015 1016 // Get the Elementor unique selector for this widget 1017 let classes = $scope[0].className; 1018 let selectorEl = '.' + classes.split(' ').join('.'); 1019 1020 const epElLoadMore = () => { 1021 1022 const spinicon = '<svg width="18" height="18" fill="#fff" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_GuJz{transform-origin:center;animation:spinner_STY6 1.5s linear infinite}@keyframes spinner_STY6{100%{transform:rotate(360deg)}}</style><g class="spinner_GuJz"><circle cx="3" cy="12" r="2"/><circle cx="21" cy="12" r="2"/><circle cx="12" cy="21" r="2"/><circle cx="12" cy="3" r="2"/><circle cx="5.64" cy="5.64" r="2"/><circle cx="18.36" cy="18.36" r="2"/><circle cx="5.64" cy="18.36" r="2"/><circle cx="18.36" cy="5.64" r="2"/></g></svg>'; 1023 1024 $('.elementor-widget-container .ep-nft-gallery-wrapper').each(function () { 1025 let selctorEl = `.elementor-widget-container [data-nftid='${$(this).data('nftid')}
1025']`; 1026 let loadmorelabel = $(selctorEl).data('loadmorelabel'); 1027 $(selctorEl + ` .ep_nft_item`).slice(0, $(selctorEl).data('itemparpage')).show(); 1028 $('.elementor-widget-container .ep-nft-gallery-wrapper .ep-loadmore-wrapper button').css('display', 'flex'); 1029 1030 $(selctorEl + " .nft-loadmore").click(function (e) { 1031 //change the text of the button 1032 $(this).html(loadmorelabel + spinicon); 1033 1034 //disable the button 1035 $(this).prop("disabled", true); 1036 //wait for 1 seconds 1037 setTimeout(function () { 1038 //change the text back 1039 $(selctorEl + " .nft-loadmore").text(loadmorelabel); 1040 //enable the button 1041 $(selctorEl + " .nft-loadmore").prop("disabled", false); 1042 $(selctorEl + " .ep_nft_item:hidden").slice(0, $(selctorEl).data('itemparpage')).fadeIn("slow"); 1043 if ($(selctorEl + " .ep_nft_item:hidden").length == 0) { 1044 $(selctorEl + " .nft-loadmore").fadeOut("slow"); 1045 } 1046 }, 500); 1047 }); 1048 }); 1049 }; 1050 1051 if ($('.elementor-widget-container .ep-nft-gallery-wrapper').length > 0) { 1052 epElLoadMore(); 1053 } 1054 1055 // Content protection system function 1056 const unlockElSubmitHander = (perentSel, that) => { 1057 var ep_client_id = jQuery(that).closest('form').find('input[name="ep_client_id"]').val(); 1058 var password = jQuery(`input[name="pass_${ep_client_id}"]`).val(); 1059 var post_id = jQuery(`input[name="post_id"]`).val(); 1060 const buttonText = jQuery(that).closest('.password-form-container').find('input[type="submit"]').val(); 1061 const unlokingText = jQuery(that).data('unlocking-text'); 1062 1063 var data = { 1064 'action': 'lock_content_form_handler', 1065 'client_id': ep_client_id, 1066 'password': password, 1067 'post_id': post_id, 1068 }; 1069 1070 jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="submit"]').val(unlokingText); 1071 1072 jQuery.post(eplocalize.ajaxurl, data, function (response) { 1073 if (response.success) { 1074 if (!response.embedHtml) { 1075 jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="submit"]').val(buttonText); 1076 jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="password"]').val(''); 1077 jQuery(that).closest('.password-form-container').find('.error-message').removeClass('hidden'); 1078 } 1079 else { 1080 if ($('.ep-content-locked').has('#' + perentSel + '-' + ep_client_id).length) { 1081 $('.ep-content-locked').removeClass('ep-content-locked'); 1082 } 1083 1084 jQuery('#' + perentSel + '-' + ep_client_id + ' .ep-embed-content-wraper').html(response.embedHtml); 1085 1086 $('#' + perentSel + '-' + ep_client_id).removeClass('ep-content-protection-enabled'); 1087 1088 if (jQuery('#' + perentSel + '-' + ep_client_id + ' .ose-youtube').length > 0) { 1089 epGlobals.youtubeChannelGallery(); 1090 } 1091 1092 if ($('.elementor-widget-container .ep-nft-gallery-wrapper').length > 0) { 1093 epElLoadMore(); 1094 } 1095 } 1096 } else { 1097 jQuery('#password-error_' + ep_client_id).html(response.form); 1098 jQuery('#password-error_' + ep_client_id).show(); 1099 } 1100 }, 'json'); 1101 } 1102 1103 // unlockElSubmitHander called for Elementor 1104 jQuery('.ep-elementor-content .password-form').submit(function (e) { 1105 e.preventDefault(); // Prevent the default form submission 1106 unlockElSubmitHander('ep-elementor-content', this); 1107 }); 1108 1109 1110 const instaWrappers = document.querySelectorAll('.ep-embed-content-wraper'); 1111 1112 if (instaWrappers.length > 0) {
1113 instaWrappers.forEach((wrapper) => { 1114 const carouselId = wrapper.getAttribute('data-carouselid'); 1115 1116 if (!carouselId) return; 1117 1118 let options = wrapper.getAttribute(`data-carousel-options`); 1119 1120 options = JSON.parse(options); 1121 const carouselSelector = `[data-carouselid="${carouselId}"] .embedpress-insta-container`; 1122 1123 if (options.arrows) { 1124 document.querySelector(`[data-carouselid="${carouselId}"] .cg-carousel__btns`).classList.remove('hidden'); 1125 } 1126 1127 epGlobals.initCarousel(carouselSelector, options, carouselId); 1128 1129 }); 1130 } 1131 1132 const instaFeed = document.querySelector(`${selectorEl} .ose-instagram-feed`); 1133 const instaGallery = document.querySelector(`${selectorEl} .insta-gallery`); 1134 if (instaFeed) { 1135 epGlobals.initializeTabs(instaFeed); 1136 } 1137 if (instaGallery) { 1138 epGlobals.instaPopup(instaGallery); 1139 1140 $('.popup-close').click(function (e) { 1141 // Hide the popup by setting display to none 1142 $('.insta-popup').hide(); 1143 $('.popup-container').remove(); 1144 }); 1145 1146 } 1147 1148 if ($('.elementor-widget-container .ose-instagram-feed').length > 0) { 1149 epGlobals.instaLoadMore(); 1150 } 1151 1152 }; 1153 1154 const adsHandler = function ($scope, $) { 1155 window.epAdIndex = typeof (window.epAdIndex) === 'undefined' ? 0 : window.epAdIndex + 1; 1156 let classes = $scope[0].className; 1157 let classJoint = '.' + classes.split(' ').join('.'); 1158 const selectorEl = document.querySelector(classJoint + ' [data-sponsored-id]'); 1159 1160 if (jQuery('body').hasClass('elementor-editor-active') && eplocalize.is_pro_plugin_active) { 1161 adInitialization(selectorEl, window.epAdIndex); 1162 } 1163 1164 } 1165 1166 elementorFrontend.hooks.addAction("frontend/element_ready/embedpres_elementor.default", filterableGalleryHandler); 1167 elementorFrontend.hooks.addAction("frontend/element_ready/embedpress_pdf.default", filterableGalleryHandler); 1168 elementorFrontend.hooks.addAction("frontend/element_ready/embedpres_document.default", filterableGalleryHandler); 1169 elementorFrontend.hooks.addAction("frontend/element_ready/embedpres_elementor.default", adsHandler); 1170 elementorFrontend.hooks.addAction("frontend/element_ready/embedpres_elementor.default", epGlobals.handlePosterImageLoad); 1171}); 1172 1173 1174function presentationModeForIOS(iframes) { 1175 iframes?.forEach(function (iframe) { 1176 iframe.onload = function () { 1177 var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; 1178 var button = iframeDoc?.querySelector('#presentationMode.presentationMode'); 1179 button?.addEventListener('click', function () { 1180 iframe.classList.toggle('presentationModeEnabledIosDevice'); 1181 }); 1182 iframeDoc?.addEventListener('keydown', function (event) { 1183 if (event.keyCode === 27) { 1184 iframe.classList.remove('presentationModeEnabledIosDevice'); 1185 } 1186 }); 1187 }; 1188 }); 1189} 1190 1191function isIOSDevice() { 1192 return /iPhone|iPad|iPod/i.test(navigator.userAgent); 1193} 1194 1195if (isIOSDevice()) { 1196 var iframes = document.querySelectorAll('.embedpress-embed-document-pdf'); 1197 presentationModeForIOS(iframes) 1198} 1199 1200document.addEventListener("DOMContentLoaded", epGlobals.handlePosterImageLoad); 1201 1202 1203 1204// document.addEventListener('DOMContentLoaded', function () { 1205// const videoPopup = document.getElementById('videoPopup'); 1206// const videoIframe = document.getElementById('videoIframe'); 1207// const videoDescription = document.getElementById('videoDescription'); 1208// const closeBtn = document.querySelector('.close'); 1209// const nextBtn = document.getElementById('nextVideo'); 1210// const prevBtn = document.getElementById('prevVideo'); 1211 1212// let currentIndex = -1; 1213 1214// function openVideoPopup(index) { 1215// const items = document.querySelectorAll('.layout-grid .item, .layout-list .item, .layout-carousel .item'); 1216// if (index >= 0 && index < items.length) { 1217// currentIndex = index; 1218// const videoId = items[currentIndex].getAttribute('data-vid'); 1219// const description = items[currentIndex].querySelector('.video-description').innerHTML; 1220 1221// if (videoId) { 1222// videoIframe.src = `https://web.archive.org/web/20250110224033/https://www.youtube.com/embed/${videoId}?autoplay=1`; 1223// videoDescription.innerHTML = description; 1224// videoPopup.style.display = 'block'; 1225 1226// // Update navigation buttons visibility 1227// updateNavigationButtons(); 1228// } 1229// } 1230// } 1231 1232// function closeVideoPopup() { 1233// videoPopup.style.display = 'none'; 1234// videoIframe.src = ''; 1235// videoDescription.innerHTML = ''; 1236// } 1237 1238// function updateNavigationButtons() { 1239// const items = document.querySelectorAll('.layout-grid .item, .layout-list .item, .layout-carousel .item'); 1240// if (currentIndex <= 0) { 1241// prevBtn.style.display = 'none'; 1242// } else { 1243// prevBtn.style.display = 'block'; 1244// } 1245 1246// if (currentIndex >= items.length - 1) { 1247// nextBtn.style.display = 'none'; 1248// } else { 1249// nextBtn.style.display = 'block'; 1250// } 1251// } 1252 1253// document.addEventListener('click', function (event) { 1254// const items = document.querySelectorAll('.layout-grid .item, .layout-list .item, .layout-carousel .item'); 1255// const item = event.target.closest('.layout-grid .item, .layout-list .item, .layout-carousel .item'); 1256// if (item) { 1257// const index = Array.prototype.indexOf.call(items, item); 1258// openVideoPopup(index); 1259// } 1260// }); 1261 1262// closeBtn.addEventListener('click', closeVideoPopup); 1263 1264// window.addEventListener('click', function (event) { 1265// if (event.target === videoPopup) { 1266// closeVideoPopup(); 1267// } 1268// }); 1269 1270// nextBtn.addEventListener('click', function () { 1271// const items = document.querySelectorAll('.layout-grid .item, .layout-list .item, .layout-carousel .item'); 1272// if (currentIndex >= 0 && currentIndex < items.length - 1) { 1273// openVideoPopup(currentIndex + 1); 1274// } 1275// }); 1276 1277// prevBtn.addEventListener('click', function () { 1278// if (currentIndex > 0) { 1279// openVideoPopup(currentIndex - 1); 1280// } 1281// }); 1282// }); 1283 1284 1285jQuery(document).ready(function ($) { 1286
1287 let currentIndex = -1; 1288 1289 function createVideoPopup() { 1290 const videoPopupHtml = ` 1291 <div id="videoPopup" class="video-popup"> 1292 <div class="video-popup-content"> 1293 <span class="close">×</span> 1294 <div class="video-popup-inner-content"> 1295 <iframe id="videoIframe" frameborder="0" allowfullscreen allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"></iframe> 1296 <div id="videoDescription"></div> 1297 </div> 1298 <div class="popup-controls"> 1299 <span id="prevVideo" class="nav-icon prev-icon">❮</span> 1300 <span id="nextVideo" class="nav-icon next-icon">❯</span> 1301 </div> 1302 </div> 1303 </div>`; 1304 return $(videoPopupHtml).appendTo('body'); 1305 } 1306 1307 function openVideoPopup(index) { 1308 const items = $('.layout-grid .item, .layout-list .item, .layout-carousel .item'); 1309 if (index >= 0 && index < items.length) { 1310 // Remove any existing video popup before creating a new one 1311 $('#videoPopup').remove(); 1312 1313 currentIndex = index; 1314 const videoId = $(items[currentIndex]).data('vid'); 1315 const videoPopup = createVideoPopup(); 1316 const videoIframe = videoPopup.find('#videoIframe'); 1317 const videoDescriptionContainer = videoPopup.find('#videoDescription'); 1318 const closeBtn = videoPopup.find('.close'); 1319 const nextBtn = videoPopup.find('#nextVideo'); 1320 const prevBtn = videoPopup.find('#prevVideo'); 1321 1322 if (videoId) { 1323 fetchVideoData(videoId, videoIframe, videoDescriptionContainer); 1324 videoPopup.show(); 1325 updateNavigationButtons(nextBtn, prevBtn, items); 1326 1327 closeBtn.on('click', () => { 1328 closeVideoPopup(videoPopup); 1329 }); 1330 1331 $(window).on('click', function (event) { 1332 if ($(event.target).is(videoPopup)) { 1333 closeVideoPopup(videoPopup); 1334 } 1335 }); 1336 1337 nextBtn.on('click', function () { 1338 if (currentIndex >= 0 && currentIndex < items.length - 1) { 1339 openVideoPopup(currentIndex + 1); 1340 } 1341 }); 1342 1343 prevBtn.on('click', function () { 1344 if (currentIndex > 0) { 1345 openVideoPopup(currentIndex - 1); 1346 } 1347 }); 1348 } 1349 } 1350 } 1351 1352 1353 function closeVideoPopup(videoPopup) { 1354 videoPopup.remove(); 1355 currentIndex = -1; // Reset the index 1356 } 1357 1358 function updateNavigationButtons(nextBtn, prevBtn, items) { 1359 prevBtn.toggle(currentIndex > 0); 1360 nextBtn.toggle(currentIndex < items.length - 1); 1361 } 1362 1363 function fetchVideoData(videoId, videoIframe, videoDescriptionContainer) { 1364 const data = { 1365 action: 'fetch_video_description', 1366 vid: videoId 1367 }; 1368 1369 $.post(eplocalize.ajaxurl, data, function (response) { 1370 if (response.success) { 1371 videoIframe.attr('src', `https://web.archive.org/web/20250110224033/https://www.youtube.com/embed/${videoId}?autoplay=1`); 1372 videoDescriptionContainer.html(response.data.description); 1373 } else { 1374 console.error('Error fetching video data:', response?.data?.error); 1375 } 1376 }); 1377 } 1378 1379 $(document).on('click', '.layout-grid .item, .layout-list .item, .layout-carousel .item', function () { 1380 const items = $('.layout-grid .item, .layout-list .item, .layout-carousel .item'); 1381 const index = items.index(this); 1382 openVideoPopup(index); 1383 }); 1384}); 1385 1386 1387 1388// pause audio/video 1389 1390jQuery(document).ready(function () { 1391 const players = jQuery('.enabled-auto-pause audio, .enabled-auto-pause video'); 1392 1393 function pauseAllExcept(currentPlayer) { 1394 players.each(function () { 1395 if (this !== currentPlayer[0]) { 1396 this.pause(); 1397 } 1398 }); 1399 } 1400 1401 players.on('play', function () { 1402 pauseAllExcept(jQuery(this)); 1403 }); 1404}); 1405 1406 1407} 1408/* 1409 FILE ARCHIVED ON 22:40:33 Jan 10, 2025 AND RETRIEVED FROM THE 1410 INTERNET ARCHIVE ON 10:46:03 Oct 29, 2025. 1411 JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. 1412
1413 ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. 1414 SECTION 108(a)(3)). 1415*/ 1416/* 1417playback timings (ms): 1418 captures_list: 0.963 1419 exclusion.robots: 0.043 1420 exclusion.robots.policy: 0.027 1421 esindex: 0.013 1422 cdx.remote: 137.044 1423 LoadShardBlock: 1383.753 (3) 1424 PetaboxLoader3.resolve: 1061.217 (4) 1425 PetaboxLoader3.datanode: 495.43 (4) 1426 load_resource: 328.49 1427*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.