Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../assets/js
File: instafeed.js
/**
[0] Fix | Delete
* @package EmbedPress
[1] Fix | Delete
* @author EmbedPress <help@embedpress.com>
[2] Fix | Delete
* @copyright Copyright (C) 2023 EmbedPress. All rights reserved.
[3] Fix | Delete
* @license GPLv2 or later
[4] Fix | Delete
* @since 1.7.0
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
[8] Fix | Delete
[9] Fix | Delete
let instaGlobals = {};
[10] Fix | Delete
[11] Fix | Delete
(function ($) {
[12] Fix | Delete
'use strict';
[13] Fix | Delete
[14] Fix | Delete
// Get the insta-gallery container element
[15] Fix | Delete
const getPopupTemplate = (instPost) => {
[16] Fix | Delete
[17] Fix | Delete
let instaPostData = JSON.parse(instPost);
[18] Fix | Delete
[19] Fix | Delete
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>';
[20] Fix | Delete
[21] Fix | Delete
if (instaPostData.like_count > 0) {
[22] Fix | Delete
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>';
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
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>';
[26] Fix | Delete
[27] Fix | Delete
const shareIcon = '<svg aria-label="Share Post" class="x1lliihq x1n2onr6" color="#000" fill="#737373" height="24" viewBox="0 0 24 24" width="24"><path fill="none" stroke="currentColor" stroke-linejoin="round" stroke-width="2" d="M22 3 9.218 10.083m2.48 10.251L22 3.001H2l7.218 7.083 2.48 10.25z"/></svg>';
[28] Fix | Delete
[29] Fix | Delete
const instaIcon = '<svg version="1.1" id="Icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" xml:space="preserve" width="20" height="20"><style>.st0{fill:none;stroke:#000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}</style><path class="st0" d="M14.375 19.375h-8.75c-2.75 0-5-2.25-5-5v-8.75c0-2.75 2.25-5 5-5h8.75c2.75 0 5 2.25 5 5v8.75c0 2.75-2.25 5-5 5z"/><path class="st0" d="M14.375 10A4.375 4.375 0 0 1 10 14.375 4.375 4.375 0 0 1 5.625 10a4.375 4.375 0 0 1 8.75 0zm1.25-5.625A.625.625 0 0 1 15 5a.625.625 0 0 1-.625-.625.625.625 0 0 1 1.25 0z"/></svg>';
[30] Fix | Delete
[31] Fix | Delete
const instaUserInfo = instPost.user_info;
[32] Fix | Delete
[33] Fix | Delete
let getDate = new Date(instaPostData.timestamp);
[34] Fix | Delete
getDate = getDate.toLocaleString('en-US', { day: 'numeric', month: 'short', year: 'numeric' });
[35] Fix | Delete
[36] Fix | Delete
let getTime = new Date(instaPostData.timestamp);
[37] Fix | Delete
getTime = getTime.toLocaleString('en-US', { hour12: false, hour: 'numeric', minute: 'numeric', second: 'numeric' });
[38] Fix | Delete
[39] Fix | Delete
let captionText = instaPostData.caption ? instaPostData.caption : '';
[40] Fix | Delete
const tagRegex = /(#\w+)/g;
[41] Fix | Delete
[42] Fix | Delete
let tagUrl = 'https://www.instagram.com/explore/tags/$1';
[43] Fix | Delete
[44] Fix | Delete
tagUrl = tagUrl.replace(/#/g, '');
[45] Fix | Delete
[46] Fix | Delete
const wrapTag = `<span class="tag-wrapper"><a target="_blank" href="${tagUrl}">$1</a></span>`;
[47] Fix | Delete
[48] Fix | Delete
captionText = captionText.replace(tagRegex, wrapTag);
[49] Fix | Delete
[50] Fix | Delete
let carouselTemplate = '';
[51] Fix | Delete
if (instaPostData.media_type === 'CAROUSEL_ALBUM') {
[52] Fix | Delete
carouselTemplate += `<div class="popup-carousel"><div class="cg-carousel__track js-carousel__track">`;
[53] Fix | Delete
[54] Fix | Delete
instaPostData.children.data?.map((item) => {
[55] Fix | Delete
console.log(item);
[56] Fix | Delete
if (item.media_type?.toLowerCase() === 'video') {
[57] Fix | Delete
carouselTemplate += `<video width="630" class="popup-media-image cg-carousel__slide js-carousel__slide" controls src="${item.media_url || ''}" alt="${item.caption || ''}" controlsList="nodownload"></video>`;
[58] Fix | Delete
}
[59] Fix | Delete
else {
[60] Fix | Delete
carouselTemplate += `<img width="630" class="popup-media-image cg-carousel__slide js-carousel__slide" src="${item.media_url || ''}" alt="${item.caption || ''}" />`;
[61] Fix | Delete
console.log(item);
[62] Fix | Delete
}
[63] Fix | Delete
});
[64] Fix | Delete
[65] Fix | Delete
carouselTemplate += `</div></div>`;
[66] Fix | Delete
[67] Fix | Delete
carouselTemplate += `<div class="cg-carousel__btns">
[68] Fix | Delete
<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>
[69] Fix | Delete
[70] Fix | Delete
<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>
[71] Fix | Delete
</div>`
[72] Fix | Delete
}
[73] Fix | Delete
else {
[74] Fix | Delete
if (instaPostData.media_type?.toLowerCase() === 'video') {
[75] Fix | Delete
carouselTemplate += `<video width="630" class="popup-media-image" controls src="${instaPostData.media_url || ''}" alt="${instaPostData.caption || ''}"></video>`;
[76] Fix | Delete
}
[77] Fix | Delete
else {
[78] Fix | Delete
carouselTemplate += `<img width="630" class="popup-media-image" src="${instaPostData.media_url || ''}" alt="${instaPostData.caption || ''}" />`;
[79] Fix | Delete
}
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
[83] Fix | Delete
let popupHtml = '';
[84] Fix | Delete
popupHtml += `
[85] Fix | Delete
<div class="popup-container">
[86] Fix | Delete
<div class="popup-md-9 white">
[87] Fix | Delete
<div class="embedpress-popup-block embedpress-popup-img" id="post-${instaPostData.id}">
[88] Fix | Delete
${carouselTemplate}
[89] Fix | Delete
</div>
[90] Fix | Delete
</div>
[91] Fix | Delete
<div class="popup-md-3 red">
[92] Fix | Delete
<div class="embedpress-popup-block embedpress-popup-info">
[93] Fix | Delete
<div class="embedpress-popup-header">
[94] Fix | Delete
<div class="embedpress-popup-header-img"> <a target="_blank" href="https://www.instagram.com/${instaPostData.username}/"
[95] Fix | Delete
target="_blank" class="embedpress-href"> <img decoding="async" loading="lazy"
[96] Fix | Delete
class="embedpress-popup-round"
[97] Fix | Delete
src="http://2.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?s=150&d=mm&r=g"
[98] Fix | Delete
width="30" height="30"> <span class="embedpress-popup-username">${instaPostData.username}</span>
[99] Fix | Delete
</a>
[100] Fix | Delete
</div>
[101] Fix | Delete
<div class="insta-followbtn">
[102] Fix | Delete
<a target="_new" href="https://www.instagram.com/${instaPostData.username}/" type="button" class="btn btn-primary">Follow</a>
[103] Fix | Delete
</div>
[104] Fix | Delete
</div>
[105] Fix | Delete
<div class="embedpress-popup-text">${captionText}</div>
[106] Fix | Delete
<div class="embedpress-popup-stats">
[107] Fix | Delete
<div class="embedpress-inline"><a target="_blank" href="${instaPostData.permalink}">${likeIcon} ${instaPostData.like_count || 0}</a></div> <div
[108] Fix | Delete
class="embedpress-inline"><a target="_blank" href="${instaPostData.permalink}">${commentsIcon} ${instaPostData.comments_count || 0}</a></div><div class="embedpress-inline">
[109] Fix | Delete
<p class="embedpress-popup-share-buttons hidden"> <a
[110] Fix | Delete
href="https://www.facebook.com/sharer/sharer.php?u=${instaPostData.permalink}"><span
[111] Fix | Delete
class="fa fa-facebook-square shr-btn shr-btn-fcbk"></span></a> <a
[112] Fix | Delete
href="https://twitter.com/home?status=${instaPostData.permalink}"
[113] Fix | Delete
target="_blank"><span class="fa fa-twitter-square shr-btn"></span></a> <a
[114] Fix | Delete
href="https://plus.google.com/share?url=${instaPostData.permalink}"
[115] Fix | Delete
target="_blank"><span class="fa fa-google-plus-square shr-btn"></span></a> <a
[116] Fix | Delete
href="https://www.linkedin.com/shareArticle?mini=true&amp;url=${instaPostData.permalink}"
[117] Fix | Delete
target="_blank"><span class="fa fa-linkedin-square shr-btn"></span></a> <a
[118] Fix | Delete
href="https://pinterest.com/pin/create/button/?url=${instaPostData.permalink}"
[119] Fix | Delete
target="_blank"><span class="fa fa-pinterest-square shr-btn"></span></a></p>
[120] Fix | Delete
<div class="embedpress-href embedpress-popup-share">${shareIcon}</div>
[121] Fix | Delete
</div><div class="embedpress-inline"><a
[122] Fix | Delete
href="${instaPostData.permalink}" target="_blank"
[123] Fix | Delete
class="embedpress-href">${instaIcon}</a></div>
[124] Fix | Delete
</div>
[125] Fix | Delete
[126] Fix | Delete
</div>
[127] Fix | Delete
</div>
[128] Fix | Delete
</div>
[129] Fix | Delete
`;
[130] Fix | Delete
[131] Fix | Delete
// INIT CAROUSEL
[132] Fix | Delete
[133] Fix | Delete
[134] Fix | Delete
return popupHtml;
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
// Add a click event listener to the insta-gallery container
[138] Fix | Delete
instaGlobals.instaPopup = (container) => {
[139] Fix | Delete
container?.addEventListener('click', function (event) {
[140] Fix | Delete
// Check if the clicked element has the class insta-gallery-item
[141] Fix | Delete
const instaItem = event.target.closest('.insta-gallery-item');
[142] Fix | Delete
[143] Fix | Delete
if (instaItem) {
[144] Fix | Delete
[145] Fix | Delete
const postData = instaItem.dataset.postdata;
[146] Fix | Delete
[147] Fix | Delete
const postid = instaItem.getAttribute('data-insta-postid');
[148] Fix | Delete
const postIndex = instaItem.getAttribute('data-postindex');
[149] Fix | Delete
const tkey = instaItem.parentElement.parentElement.getAttribute('data-tkey');
[150] Fix | Delete
[151] Fix | Delete
const closestPopup = event.target.closest('.ose-instagram-feed').querySelector('.insta-popup');
[152] Fix | Delete
closestPopup.style.display = 'block';
[153] Fix | Delete
[154] Fix | Delete
event.target.closest('.ose-instagram-feed').querySelector('.popup-is-initialized').innerHTML = getPopupTemplate(postData);
[155] Fix | Delete
[156] Fix | Delete
if (!document.querySelector(`#post-${postid}`).classList.contains('carousel-is-initialized')) {
[157] Fix | Delete
const carousel = new CgCarousel(`#post-${postid}`, { slidesPerView: 1, loop: true }, {});
[158] Fix | Delete
[159] Fix | Delete
// const plyer = new Plyr(`#post-${postid} video`);
[160] Fix | Delete
// console.log(plyer);
[161] Fix | Delete
[162] Fix | Delete
const next = document.querySelector(`#post-${postid} .js-carousel__next-1`);
[163] Fix | Delete
next?.addEventListener('click', () => carousel.next());
[164] Fix | Delete
[165] Fix | Delete
const prev = document.querySelector(`#post-${postid} .js-carousel__prev-1`);
[166] Fix | Delete
prev?.addEventListener('click', () => carousel.prev());
[167] Fix | Delete
[168] Fix | Delete
document.querySelector(`#post-${postid}`).classList.add('carousel-is-initialized');
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
}
[172] Fix | Delete
});
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
[176] Fix | Delete
const instaContainers = document.querySelectorAll('.embedpress-gutenberg-wrapper .insta-gallery');
[177] Fix | Delete
if (instaContainers.length > 0) {
[178] Fix | Delete
instaContainers.forEach((container) => {
[179] Fix | Delete
instaGlobals.instaPopup(container);
[180] Fix | Delete
});
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
$('.popup-close').click(function (e) {
[184] Fix | Delete
// Hide the popup by setting display to none
[185] Fix | Delete
$('.insta-popup').hide();
[186] Fix | Delete
$('.popup-container').remove();
[187] Fix | Delete
});
[188] Fix | Delete
[189] Fix | Delete
[190] Fix | Delete
const instafeeds = document.querySelectorAll('.ose-instagram-feed');
[191] Fix | Delete
[192] Fix | Delete
instaGlobals.initializeTabs = (containerEl) => {
[193] Fix | Delete
[194] Fix | Delete
// Initial tab selection
[195] Fix | Delete
showItems('ALL');
[196] Fix | Delete
[197] Fix | Delete
containerEl.addEventListener('click', function (event) {
[198] Fix | Delete
const clickedElement = event.target;
[199] Fix | Delete
if (!clickedElement) {
[200] Fix | Delete
return; // No element clicked, ignore the event
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
// Handle tab click
[204] Fix | Delete
if (clickedElement.matches('.tabs li')) {
[205] Fix | Delete
if (clickedElement.classList.contains('active')) {
[206] Fix | Delete
return;
[207] Fix | Delete
} else {
[208] Fix | Delete
const mediaType = clickedElement.getAttribute('data-media-type');
[209] Fix | Delete
showItems(mediaType);
[210] Fix | Delete
[211] Fix | Delete
const tabs = containerEl.querySelectorAll('.tabs li');
[212] Fix | Delete
tabs.forEach(t => t.classList.remove('active'));
[213] Fix | Delete
clickedElement.classList.add('active');
[214] Fix | Delete
}
[215] Fix | Delete
}
[216] Fix | Delete
[217] Fix | Delete
});
[218] Fix | Delete
[219] Fix | Delete
function showItems(mediaType) {
[220] Fix | Delete
const items = containerEl.getElementsByClassName('insta-gallery-item');
[221] Fix | Delete
for (let i = 0; i < items.length; i++) {
[222] Fix | Delete
const item = items[i];
[223] Fix | Delete
if (mediaType === 'ALL' || item.getAttribute('data-media-type') === mediaType) {
[224] Fix | Delete
console.log(item.getAttribute('data-media-type'));
[225] Fix | Delete
console.log(mediaType);
[226] Fix | Delete
item.style.display = 'block';
[227] Fix | Delete
} else {
[228] Fix | Delete
item.style.display = 'none';
[229] Fix | Delete
}
[230] Fix | Delete
}
[231] Fix | Delete
}
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
instaGlobals.instaLoadMore = () => {
[235] Fix | Delete
$('.insta-load-more-button').on('click', function (e) {
[236] Fix | Delete
const loadmoreBtn = $(this).closest('.load-more-button-container');
[237] Fix | Delete
const tkey = loadmoreBtn.data('loadmorekey');
[238] Fix | Delete
const connectedAccount = $(`[data-tkey="${tkey}"]`).data('connected-acc-type');
[239] Fix | Delete
const feedType = $(`[data-tkey="${tkey}"]`).data('feed-type');
[240] Fix | Delete
const hashtagId = $(`[data-tkey="${tkey}"]`).data('hashtag-id');
[241] Fix | Delete
const userId = $(`[data-tkey="${tkey}"]`).data('uid');
[242] Fix | Delete
let loadedPosts = loadmoreBtn.data('loaded-posts') || 0;
[243] Fix | Delete
let postsPerPage = loadmoreBtn.data('posts-per-page') || 0;
[244] Fix | Delete
[245] Fix | Delete
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>`;
[246] Fix | Delete
[247] Fix | Delete
$(this).append(spinicon);
[248] Fix | Delete
[249] Fix | Delete
var data = {
[250] Fix | Delete
'action': 'loadmore_data_handler',
[251] Fix | Delete
'insta_transient_key': tkey,
[252] Fix | Delete
'loaded_posts': loadedPosts,
[253] Fix | Delete
'user_id': userId,
[254] Fix | Delete
'posts_per_page': postsPerPage,
[255] Fix | Delete
'feed_type': feedType,
[256] Fix | Delete
'connected_account_type': connectedAccount
[257] Fix | Delete
};
[258] Fix | Delete
[259] Fix | Delete
if (feedType === 'hashtag_type') {
[260] Fix | Delete
data.hashtag_id = hashtagId;
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
jQuery.post(eplocalize.ajaxurl, data, function (response) {
[264] Fix | Delete
if (response.total_feed_posts >= response.next_post_index) {
[265] Fix | Delete
var $responseHtml = $(response.html);//
[266] Fix | Delete
$(`[data-tkey="${tkey}"] .insta-gallery`).append($responseHtml);
[267] Fix | Delete
$responseHtml.animate({ opacity: 1 }, 1000);
[268] Fix | Delete
$('.insta-loadmore-spinicon').remove();
[269] Fix | Delete
loadedPosts = response.next_post_index;
[270] Fix | Delete
loadmoreBtn.data('loaded-posts', loadedPosts);
[271] Fix | Delete
[272] Fix | Delete
// After loading more items, reinitialize the tabs for the specific container
[273] Fix | Delete
const containerEl = loadmoreBtn.closest('.ose-instagram-feed')[0];
[274] Fix | Delete
console.log(containerEl);
[275] Fix | Delete
instaGlobals.initializeTabs(containerEl);
[276] Fix | Delete
[277] Fix | Delete
if (response.total_feed_posts == response.next_post_index) {
[278] Fix | Delete
loadmoreBtn.hide();
[279] Fix | Delete
}
[280] Fix | Delete
} else {
[281] Fix | Delete
loadmoreBtn.hide();
[282] Fix | Delete
}
[283] Fix | Delete
});
[284] Fix | Delete
});
[285] Fix | Delete
[286] Fix | Delete
}
[287] Fix | Delete
[288] Fix | Delete
if (instafeeds.length > 0) {
[289] Fix | Delete
instafeeds.forEach(function (feed) {
[290] Fix | Delete
instaGlobals.initializeTabs(feed);
[291] Fix | Delete
});
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
instaGlobals.instaLoadMore();
[295] Fix | Delete
[296] Fix | Delete
[297] Fix | Delete
})(jQuery);
[298] Fix | Delete
[299] Fix | Delete
[300] Fix | Delete
document.addEventListener('DOMContentLoaded', function () {
[301] Fix | Delete
[302] Fix | Delete
instaGlobals.initCarousel = (carouselSelector, options, carouselId) => {
[303] Fix | Delete
[304] Fix | Delete
const carouselOptions = {
[305] Fix | Delete
slidesPerView: options.slideshow,
[306] Fix | Delete
spacing: options.spacing,
[307] Fix | Delete
loop: options.loop,
[308] Fix | Delete
autoplay: options.autoplay,
[309] Fix | Delete
transitionSpeed: options.transitionspeed,
[310] Fix | Delete
autoplaySpeed: options.autoplayspeed,
[311] Fix | Delete
arrows: options.arrows,
[312] Fix | Delete
breakpoints: {
[313] Fix | Delete
768: {
[314] Fix | Delete
slidesPerView: parseInt(options.slideshow) - 1
[315] Fix | Delete
},
[316] Fix | Delete
1024: {
[317] Fix | Delete
slidesPerView: parseInt(options.slideshow)
[318] Fix | Delete
}
[319] Fix | Delete
}
[320] Fix | Delete
};
[321] Fix | Delete
[322] Fix | Delete
// INIT CAROUSEL
[323] Fix | Delete
const carousel = new CgCarousel(carouselSelector, carouselOptions, {});
[324] Fix | Delete
[325] Fix | Delete
// Navigation
[326] Fix | Delete
const next = document.querySelector(`[data-carouselid="${carouselId}"] #js-carousel__next-1`);
[327] Fix | Delete
next.addEventListener('click', () => carousel.next());
[328] Fix | Delete
[329] Fix | Delete
const prev = document.querySelector(`[data-carouselid="${carouselId}"] #js-carousel__prev-1`);
[330] Fix | Delete
prev.addEventListener('click', () => carousel.prev());
[331] Fix | Delete
}
[332] Fix | Delete
[333] Fix | Delete
const instaWrappers = document.querySelectorAll('.ep-embed-content-wraper');
[334] Fix | Delete
[335] Fix | Delete
if (instaWrappers.length > 0) {
[336] Fix | Delete
instaWrappers.forEach((wrapper) => {
[337] Fix | Delete
const carouselId = wrapper.getAttribute('data-carouselid');
[338] Fix | Delete
[339] Fix | Delete
if (!carouselId) return;
[340] Fix | Delete
[341] Fix | Delete
let options = wrapper.getAttribute(`data-carousel-options`);
[342] Fix | Delete
[343] Fix | Delete
options = JSON.parse(options);
[344] Fix | Delete
const carouselSelector = `[data-carouselid="${carouselId}"] .embedpress-insta-container`;
[345] Fix | Delete
[346] Fix | Delete
if (options.arrows) {
[347] Fix | Delete
document.querySelector(`[data-carouselid="${carouselId}"] .cg-carousel__btns`).classList.remove('hidden');
[348] Fix | Delete
}
[349] Fix | Delete
[350] Fix | Delete
instaGlobals.initCarousel(carouselSelector, options, carouselId);
[351] Fix | Delete
[352] Fix | Delete
});
[353] Fix | Delete
}
[354] Fix | Delete
[355] Fix | Delete
[356] Fix | Delete
[357] Fix | Delete
});
[358] Fix | Delete
[359] Fix | Delete
[360] Fix | Delete
[361] Fix | Delete
jQuery(window).on("elementor/frontend/init", function () {
[362] Fix | Delete
[363] Fix | Delete
var filterableGalleryHandler = function ($scope, $) {
[364] Fix | Delete
[365] Fix | Delete
const instaWrappers = document.querySelectorAll('.ep-embed-content-wraper');
[366] Fix | Delete
[367] Fix | Delete
if (instaWrappers.length > 0) {
[368] Fix | Delete
instaWrappers.forEach((wrapper) => {
[369] Fix | Delete
const carouselId = wrapper.getAttribute('data-carouselid');
[370] Fix | Delete
[371] Fix | Delete
if (!carouselId) return;
[372] Fix | Delete
[373] Fix | Delete
let options = wrapper.getAttribute(`data-carousel-options`);
[374] Fix | Delete
[375] Fix | Delete
options = JSON.parse(options);
[376] Fix | Delete
const carouselSelector = `[data-carouselid="${carouselId}"] .embedpress-insta-container`;
[377] Fix | Delete
[378] Fix | Delete
if (options.arrows) {
[379] Fix | Delete
document.querySelector(`[data-carouselid="${carouselId}"] .cg-carousel__btns`).classList.remove('hidden');
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
instaGlobals.initCarousel(carouselSelector, options, carouselId);
[383] Fix | Delete
[384] Fix | Delete
});
[385] Fix | Delete
}
[386] Fix | Delete
[387] Fix | Delete
const instaFeed = document.querySelector(`${selectorEl} .ose-instagram-feed`);
[388] Fix | Delete
const instaGallery = document.querySelector(`${selectorEl} .insta-gallery`);
[389] Fix | Delete
if (instaFeed) {
[390] Fix | Delete
instaGlobals.initializeTabs(instaFeed);
[391] Fix | Delete
}
[392] Fix | Delete
if (instaFeed) {
[393] Fix | Delete
instaGlobals.instaPopup(instaFeed);
[394] Fix | Delete
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
};
[398] Fix | Delete
elementorFrontend.hooks.addAction("frontend/element_ready/embedpres_elementor.default", filterableGalleryHandler);
[399] Fix | Delete
});
[400] Fix | Delete
[401] Fix | Delete
[402] Fix | Delete
[403] Fix | Delete
[404] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function