Current File : /var/www/html/blog/wp-content/plugins/blogsqode-posts/public/assets/js/blogsqode-public.js |
jQuery(document).ready(function () {
"use strict";
/* load more when category tab bar off2 */
jQuery(function ($) {
var page = 2;
var maxPage = jQuery(".load_more_posts_with_sidebar3").data("pages");
$("body").on("click", ".load_more_posts_with_sidebar3", function () {
var layout = $(this).data("layout");
var data = {
action: "blogsqode_loadmore_with_sidebar_tab_off",
page: page,
layout: layout,
};
jQuery.post(
blogsqode_loadmore_params_with_sidebar.ajaxurl,
data,
function (response) {
if ($.trim(response) != "") {
jQuery(
".blogsqode-blog-wrap.blog-listing-with-sidebar .selected-layout"
).append(response);
page++;
} else {
jQuery(".load_more_posts_with_sidebar3").hide();
}
}
);
if (page === maxPage) {
jQuery(".load_more_posts_with_sidebar3").hide();
}
});
});
jQuery(document).on("click", ".label.entypo-export", function () {
if (jQuery(this).parent().find(".checkbox").attr("checked")) {
jQuery(this).parent().find(".social").removeClass("checked_social");
jQuery(this).parent().find(".checkbox").removeAttr("checked");
} else {
jQuery(this).parent().find(".checkbox").attr("checked", "checked");
jQuery(this).parent().find(".social").addClass("checked_social");
}
});
jQuery(".single_blog_share_box_lyt_3 h3").click(function () {
jQuery(".social").toggleClass("checked_social");
});
jQuery(".paginate4").append(
'<svg width="36" height="30" viewBox="0 0 36 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 0L35.3205 30H0.679491L18 0Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate5").append(
'<svg width="36" height="40" viewBox="0 0 36 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.17949 10.2887L18 0.57735L34.8205 10.2887V29.7113L18 39.4226L1.17949 29.7113V10.2887Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate6").append(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.24055 6.24055L20 0.541196L33.7594 6.24055L39.4588 20L33.7595 33.7595L20 39.4588L6.24055 33.7594L0.541196 20L6.24055 6.24055Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate7").append(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.8322 4.57325L25.8787 1.90727L26.7763 5.85476L26.9093 6.43972L27.4607 6.2035L31.1819 4.60941L30.8158 8.64107L30.7615 9.2385L31.3589 9.18424L35.3906 8.81808L33.7965 12.5393L33.5603 13.0907L34.1452 13.2237L38.0927 14.1213L35.4267 17.1678L35.0317 17.6192L35.5469 17.9265L39.0238 20L35.5469 22.0735L35.0317 22.3808L35.4267 22.8322L38.0927 25.8787L34.1452 26.7763L33.5603 26.9093L33.7965 27.4607L35.3906 31.1819L31.3589 30.8158L30.7615 30.7615L30.8158 31.3589L31.1819 35.3906L27.4607 33.7965L26.9093 33.5603L26.7763 34.1452L25.8787 38.0927L22.8322 35.4267L22.3808 35.0317L22.0735 35.5469L20 39.0238L17.9265 35.5469L17.6192 35.0317L17.1678 35.4267L14.1213 38.0927L13.2237 34.1452L13.0907 33.5603L12.5393 33.7965L8.81808 35.3906L9.18424 31.3589L9.2385 30.7615L8.64107 30.8158L4.60941 31.1819L6.2035 27.4607L6.43972 26.9093L5.85476 26.7763L1.90727 25.8787L4.57325 22.8322L4.96832 22.3808L4.45309 22.0735L0.976182 20L4.45309 17.9265L4.96832 17.6192L4.57325 17.1678L1.90727 14.1213L5.85476 13.2237L6.43972 13.0907L6.2035 12.5393L4.60941 8.81808L8.64107 9.18424L9.2385 9.2385L9.18424 8.64107L8.81808 4.60941L12.5393 6.2035L13.0907 6.43972L13.2237 5.85476L14.1213 1.90727L17.1678 4.57325L17.6192 4.96832L17.9265 4.45309L20 0.976182L22.0735 4.45309L22.3808 4.96832L22.8322 4.57325Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate9").append(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0L31.7557 3.81966L39.0211 13.8197V26.1803L31.7557 36.1803L20 40L8.2443 36.1803L0.97887 26.1803V13.8197L8.2443 3.81966L20 0Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate10").append(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0L30 2.67949L37.3205 10L40 20L37.3205 30L30 37.3205L20 40L10 37.3205L2.67949 30L0 20L2.67949 10L10 2.67949L20 0Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate11").append(
'<svg width="40" height="37" viewBox="0 0 40 37" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0L39.0211 13.8197L31.7557 36.1803H8.2443L0.97887 13.8197L20 0Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate12").append(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0H40V30L30 40H0V10Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate13").append(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0H30L40 10V30L30 40H10L0 30V10Z" stroke="#E9E9E9"/></svg>'
);
jQuery(".paginate19").append(
'<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 40C18.8675 40 18.0782 38.8144 17.3138 37.6677C16.8041 36.8997 16.2237 36.0326 15.7388 35.8981C15.2539 35.7636 14.2488 36.252 13.3994 36.6519C12.189 37.2465 10.922 37.8623 9.99823 37.3173C9.0745 36.7723 8.93647 35.3601 8.86214 34.0011C8.80198 33.0667 8.73474 32.005 8.36313 31.6334C7.99151 31.2617 6.94745 31.1945 5.9954 31.1343C4.63635 31.0458 3.23483 30.9574 2.67918 29.9982C2.12352 29.0391 2.74994 27.8075 3.34452 26.5971C3.76215 25.7477 4.23994 24.785 4.09838 24.2612C3.95681 23.7374 3.10032 23.1994 2.32878 22.6827C1.18208 21.9183 0 21.129 0 20C0 18.871 1.18208 18.0782 2.32878 17.3138C3.09678 16.8041 3.96389 16.2237 4.09838 15.7353C4.23287 15.2469 3.74445 14.2488 3.34452 13.3994C2.74994 12.189 2.13414 10.922 2.67918 9.99823C3.22421 9.0745 4.63635 8.93648 5.9954 8.86215C6.92975 8.80199 7.99151 8.7312 8.36313 8.35959C8.73474 7.98797 8.80198 6.94391 8.86214 5.9954C8.95062 4.63635 9.04265 3.23129 9.99823 2.67918C10.9538 2.12706 12.189 2.74996 13.3994 3.34455C14.2488 3.76217 15.215 4.23996 15.7388 4.09839C16.2626 3.95682 16.8006 3.10034 17.3138 2.32879C18.0782 1.18209 18.8675 0 20 0C21.1326 0 21.9182 1.18209 22.6827 2.32879C23.1959 3.0968 23.7728 3.9639 24.2612 4.09839C24.7496 4.23288 25.7477 3.74448 26.6006 3.34455C27.8075 2.74996 29.0568 2.13414 30.0018 2.67918C30.9467 3.22421 31.0635 4.63635 31.1343 5.9954C31.198 6.92975 31.2653 7.99151 31.6369 8.35959C32.0085 8.72767 33.0526 8.80199 34.0046 8.86215C35.3601 8.95063 36.7652 9.03911 37.3173 9.99823C37.8694 10.9574 37.2465 12.189 36.6519 13.3994C36.2343 14.2488 35.7601 15.215 35.8981 15.7353C36.0361 16.2555 36.8997 16.797 37.6677 17.3138C38.8144 18.0782 40 18.8675 40 20C40 21.1326 38.8144 21.9183 37.6677 22.6827C36.9032 23.1924 36.0326 23.7728 35.8981 24.2612C35.7636 24.7496 36.2343 25.7477 36.6519 26.5971C37.2465 27.8075 37.8623 29.0568 37.3173 29.9982C36.7723 30.9397 35.3601 31.06 34.0046 31.1343C33.0667 31.1945 32.0085 31.2653 31.6369 31.6369C31.2653 32.0085 31.1945 33.0526 31.1343 34.0011C31.0494 35.3601 30.9574 36.7652 29.9982 37.3173C29.0391 37.8694 27.8075 37.2465 26.6006 36.6519C25.7477 36.2343 24.7815 35.7601 24.2612 35.8981C23.7409 36.0361 23.1994 36.8961 22.6827 37.6677C21.9182 38.8144 21.129 40 20 40ZM15.5335 34.8151C15.6947 34.815 15.8552 34.8353 16.0113 34.8753C16.8855 35.1088 17.5226 36.068 18.1986 37.0802C18.779 37.9508 19.4373 38.9383 20 38.9383C20.5627 38.9383 21.221 37.9508 21.8015 37.0802C22.4739 36.068 23.1145 35.1088 23.9851 34.8753C24.8558 34.6417 25.9989 35.1761 27.0678 35.7034C27.9809 36.1529 29.0179 36.6626 29.4674 36.4113C29.9168 36.16 30.0089 34.9779 30.0761 33.9338C30.154 32.7022 30.2318 31.5378 30.8866 30.883C31.5413 30.2283 32.7022 30.154 33.9338 30.0761C34.9637 30.0089 36.1281 29.9345 36.4113 29.4674C36.6944 29.0002 36.16 27.9809 35.7034 27.0678C35.1796 26.006 34.6417 24.8947 34.8752 23.9852C35.1088 23.0756 36.068 22.4739 37.0802 21.7979C37.9508 21.2175 38.9382 20.5627 38.9382 20C38.9382 19.4373 37.9508 18.779 37.0802 18.1986C36.068 17.5226 35.1088 16.8855 34.8752 16.0113C34.6417 15.1372 35.1796 13.9975 35.7034 12.9287C36.1529 12.0156 36.6626 10.9786 36.4113 10.5291C36.16 10.0796 34.9744 9.98762 33.9338 9.92037C32.7022 9.84251 31.5378 9.76465 30.8866 9.11343C30.2354 8.46222 30.1575 7.29429 30.0761 6.06265C30.0089 5.03274 29.9345 3.86835 29.4674 3.58521C29.0002 3.30207 27.9809 3.83295 27.0678 4.29305C26.006 4.82039 24.8982 5.35481 23.9851 5.12122C23.072 4.88763 22.4739 3.92851 21.8015 2.9163C21.221 2.04566 20.5627 1.06176 20 1.06176C19.4373 1.06176 18.779 2.04566 18.1986 2.9163C17.5226 3.92851 16.8855 4.88763 16.0113 5.12122C15.1371 5.35481 13.9975 4.82039 12.9287 4.29305C12.0156 3.84357 10.9821 3.33393 10.5291 3.58521C10.0761 3.83649 9.98761 5.00089 9.92036 6.06265C9.8425 7.29429 9.76819 8.45868 9.11343 9.11343C8.45868 9.76819 7.29429 9.84251 6.06265 9.92037C5.03274 9.98762 3.86835 10.0619 3.58521 10.5291C3.30207 10.9963 3.83295 12.0156 4.29305 12.9287C4.82039 13.9904 5.3548 15.1018 5.12121 16.0113C4.88762 16.9209 3.93205 17.5226 2.91984 18.1986C2.0492 18.779 1.06176 19.4337 1.06176 20C1.06176 20.5663 2.0492 21.2175 2.91984 21.7979C3.93205 22.4739 4.88762 23.111 5.12121 23.9852C5.3548 24.8593 4.82039 25.999 4.29305 27.0678C3.84357 27.9809 3.33393 29.0179 3.58521 29.4674C3.83649 29.9168 5.00089 30.0089 6.06265 30.0761C7.29429 30.154 8.45868 30.2318 9.11343 30.883C9.76819 31.5343 9.8425 32.7022 9.92036 33.9338C9.98761 34.9637 10.0619 36.1281 10.5291 36.4113C10.9963 36.6944 12.0156 36.1635 12.9287 35.7034C13.8418 35.2433 14.7301 34.8151 15.5335 34.8151Z" stroke="#E9E9E9"/></svg>'
);
});
/* Both category and date are disabled */
(function () {
function checkDisabled() {
var category = document.querySelector(".blogsqode_post_cat");
var date = document.querySelector(".blogsqode-post-date");
if (!category && !date) {
hideStructure();
}
}
function hideStructure() {
var elements = document.querySelectorAll(".layout-10-top");
elements.forEach(function (element) {
element.style.display = "none";
});
}
checkDisabled();
})();
/* category tab slick slider in all layout */
jQuery(document).ready(function ($) {
if ($(".category-filter-all.slick-slider").length > 0) {
$(".category-filter-all.slick-slider").each(function () {
var totalSlides = $(this).find(".category-name").length;
$(this).slick({
autoplay: false,
variableWidth: true,
dots: false,
slidesToScroll: 1,
infinite: false,
speed: 500,
arrows: true,
prevArrow:
'<svg class="slick-pre" width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="29" height="29" rx="4.5" stroke="#E9E9E9"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4233 18.6733C16.2586 18.8381 15.9914 18.8381 15.8267 18.6733L12.4517 15.2983C12.2869 15.1336 12.2869 14.8664 12.4517 14.7017L15.8267 11.3267C15.9914 11.1619 16.2586 11.1619 16.4233 11.3267C16.5881 11.4914 16.5881 11.7586 16.4233 11.9233L13.3466 15L16.4233 18.0767C16.5881 18.2414 16.5881 18.5086 16.4233 18.6733Z" fill="#14141F"/></svg>',
nextArrow:
'<svg class="slick-next" width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="29" height="29" rx="4.5" stroke="#E9E9E9"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5767 11.3267C13.7414 11.1619 14.0086 11.1619 14.1733 11.3267L17.5483 14.7017C17.7131 14.8664 17.7131 15.1336 17.5483 15.2983L14.1733 18.6733C14.0086 18.8381 13.7414 18.8381 13.5767 18.6733C13.4119 18.5086 13.4119 18.2414 13.5767 18.0767L16.6534 15L13.5767 11.9233C13.4119 11.7586 13.4119 11.4914 13.5767 11.3267Z" fill="#14141F"/></svg>',
});
});
}
});
/* 3rd layout js slider with filter */
jQuery(document).ready(function ($) {
if ($(".blogsqode-slick-slider.slick-slider").length > 0) {
var slider = $(".blogsqode-slick-slider.slick-slider").each(function () {
var totalSlides = $(this).find(".blogsqode-post-item").length;
var slidesToShow = Math.min(totalSlides, 3);
$(this).slick({
autoplay: false,
autoplaySpeed: 2000,
dots: false,
arrows: true,
prevArrow:
'<button type="button" class="slick-prev slick-arrow" aria-label="Previous"><svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="29" height="29" rx="4.5" stroke="#E9E9E9"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4233 18.6733C16.2586 18.8381 15.9914 18.8381 15.8267 18.6733L12.4517 15.2983C12.2869 15.1336 12.2869 14.8664 12.4517 14.7017L15.8267 11.3267C15.9914 11.1619 16.2586 11.1619 16.4233 11.3267C16.5881 11.4914 16.5881 11.7586 16.4233 11.9233L13.3466 15L16.4233 18.0767C16.5881 18.2414 16.5881 18.5086 16.4233 18.6733Z" fill="#14141F"/></svg></button>',
nextArrow:
'<button type="button" class="slick-next slick-arrow" aria-label="Next"><svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="29" height="29" rx="4.5" stroke="#E9E9E9"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5767 11.3267C13.7414 11.1619 14.0086 11.1619 14.1733 11.3267L17.5483 14.7017C17.7131 14.8664 17.7131 15.1336 17.5483 15.2983L14.1733 18.6733C14.0086 18.8381 13.7414 18.8381 13.5767 18.6733C13.4119 18.5086 13.4119 18.2414 13.5767 18.0767L16.6534 15L13.5767 11.9233C13.4119 11.7586 13.4119 11.4914 13.5767 11.3267Z" fill="#14141F"/></svg></button>',
infinite: false,
speed: 500,
slidesToShow: slidesToShow,
slidesToScroll: 1,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: Math.min(slidesToShow, 2),
slidesToScroll: 1,
},
},
{
breakpoint: 576,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
},
},
],
});
});
}
$(".category-multiple-slide .category-name").on("click", function () {
var filterClass = $(this).data("filter");
$(".blogsqode-slick-slider.slick-slider").slick("slickUnfilter");
$(".blogsqode-slick-slider.slick-slider").slick("slickFilter", filterClass);
$(this)
.addClass("cat-name-active")
.siblings()
.removeClass("cat-name-active");
});
$(".category-general-filter-all .category-name").on("click", function () {
var filterClass = $(this).data("filter");
$(".blogsqode-slick-slider.slick-slider").slick("slickUnfilter");
$(".blogsqode-slick-slider.slick-slider").slick("slickFilter", filterClass);
$(this)
.addClass("cat-name-active")
.siblings()
.removeClass("cat-name-active");
});
$(".category-filter-tab .category-name").on("click", function () {
$(this)
.addClass("cat-name-active")
.siblings()
.removeClass("cat-name-active");
});
$(".category-general-filter .category-name").on("click", function () {
$(this)
.addClass("cat-name-active")
.siblings()
.removeClass("cat-name-active");
});
});
/* 4th layout slider with filter */
jQuery(document).ready(function ($) {
if ($(".blog-slick-slider-with-sidebar.slick-slider").length > 0) {
var slider2 = $(".blog-slick-slider-with-sidebar.slick-slider").each(
function () {
var totalSlides = $(this).find(".blogsqode-post-item").length;
var slidesToShow = Math.min(totalSlides, 2);
$(this).slick({
autoplay: false,
autoplaySpeed: 2000,
dots: false,
arrows: true,
prevArrow:
'<button type="button" class="slick-prev slick-arrow" aria-label="Previous"><svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="29" height="29" rx="4.5" stroke="#E9E9E9"/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.4233 18.6733C16.2586 18.8381 15.9914 18.8381 15.8267 18.6733L12.4517 15.2983C12.2869 15.1336 12.2869 14.8664 12.4517 14.7017L15.8267 11.3267C15.9914 11.1619 16.2586 11.1619 16.4233 11.3267C16.5881 11.4914 16.5881 11.7586 16.4233 11.9233L13.3466 15L16.4233 18.0767C16.5881 18.2414 16.5881 18.5086 16.4233 18.6733Z" fill="#14141F"/></svg></button>',
nextArrow:
'<button type="button" class="slick-next slick-arrow" aria-label="Next"><svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="0.5" y="0.5" width="29" height="29" rx="4.5" stroke="#E9E9E9"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5767 11.3267C13.7414 11.1619 14.0086 11.1619 14.1733 11.3267L17.5483 14.7017C17.7131 14.8664 17.7131 15.1336 17.5483 15.2983L14.1733 18.6733C14.0086 18.8381 13.7414 18.8381 13.5767 18.6733C13.4119 18.5086 13.4119 18.2414 13.5767 18.0767L16.6534 15L13.5767 11.9233C13.4119 11.7586 13.4119 11.4914 13.5767 11.3267Z" fill="#14141F"/></svg></button>',
infinite: false,
speed: 500,
slidesToShow: slidesToShow,
slidesToScroll: 1,
responsive: [
{
breakpoint: 576,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
},
},
],
});
}
);
}
$(".cat-with-slide .filter-btn").on("click", function () {
var filterClass = $(this).data("filter");
$(".blog-slick-slider-with-sidebar.slick-slider").slick("slickUnfilter");
$(".blog-slick-slider-with-sidebar.slick-slider").slick(
"slickFilter",
filterClass
);
$(this)
.addClass("cat-name-active")
.siblings()
.removeClass("cat-name-active");
});
$(".cat-with-slide .category-name").on("click", function () {
var filterClass = $(this).data("filter");
$(".blog-slick-slider-with-sidebar.slick-slider").slick("slickUnfilter");
$(".blog-slick-slider-with-sidebar.slick-slider").slick(
"slickFilter",
filterClass
);
$(this)
.addClass("cat-name-active")
.siblings()
.removeClass("cat-name-active");
});
});
/* load more work when category tab bar off first shortcode */
jQuery(function ($) {
var page = 2;
var maxPage = jQuery(".load_more_posts_tab_off").data("pages");
$("body").on("click", ".load_more_posts_tab_off", function () {
var layout = $(this).data("layout");
var data = {
action: "blogsqode_loadmore",
page: page,
layout: layout,
};
jQuery.post(blogsqode_loadmore_params.ajaxurl, data, function (response) {
if ($.trim(response) != "") {
jQuery(".blogsqode-blog-wrap .selected-layout").append(response);
page++;
} else {
jQuery(".load_more_posts_tab_off").hide();
}
});
if (page === maxPage) {
jQuery(".load_more_posts_tab_off").hide();
}
});
});
/* matchheight box js */
jQuery(document).ready(function ($) {
$(".blogsqode-post-item").matchHeight();
});
/* btn-related js */
document.addEventListener("DOMContentLoaded", function () {
addBorder(".blog-listing-slider .read_more_btn_lyt_15", "btn-with-border");
addBorder(".blog-listing .read_more_btn_lyt_15", "btn-with-border-1");
addBorder(".blog-listing-inners .read_more_btn_lyt_15", "btn-with-border-2");
addBorder(
".blog-slider-layout-bg-with-sidebar .read_more_btn_lyt_15",
"btn-with-border-3"
);
});
function addBorder(selector, className) {
var parentDivs = document.querySelectorAll(selector);
parentDivs.forEach(function (parentDiv) {
var link = parentDiv.querySelector(".fillDisable");
if (link) {
parentDiv.classList.add(className);
}
});
}