PageSourceSearch

https://ogarnij-japonski.pl/wp-content/plugins/shadepro-helper/assets/js/addon.js?ver=7.1.2

js ogarnij-japonski.pl collected 2026-10-02 15:48:26 UTC 20,339 bytes, 715 lines download raw bytes

1(function ($) {
2
3  "use strict";
4  /* ---------------------------------------------
5    CountDown
6    --------------------------------------------- */
7
8
9  function addZero(your_number, length) {
10    var num = '' + your_number;
11    while (num.length < length) {
12      num = '0' + num;
13    }
14    return num;
15  }
16
17  /* ---------------------------------------------
18
19  Navigation menu
20
21  --------------------------------------------- */
22
23  // dropdown for mobile
24
25  $(document).ready(function () {
26
27
28  });
29
30  // accordion script starts
31  var Shadepro_Accordion = function ($scope, $) {
32    var accordionTitle = $scope.find('.shadepro-accordion-title');
33
34    var accmin = $scope.find('.shadepro-accordion-single-item');
35
36    accmin.each(function () {
37      if ($(this).hasClass('yes')) {
38        $(this).addClass('wraper-active');
39      }
40    });
41
42    accordionTitle.each(function () {
43      if ($(this).hasClass('active-default')) {
44        $(this).addClass('active');
45        $(this).next('.shadepro-accordion-content').slideDown();
46      }
47    });
48
49    // Remove multiple click event for nested accordion
50    accordionTitle.unbind('click');
51
52    //$accordionWrapper.children('.shadepro-accordion-content').first().show();
53    accordionTitle.click(function (e) {
54      e.preventDefault();
55
56      if ($(this).hasClass('active')) {
57        $(this).removeClass('active');
58        $(this).next().slideUp(400);
59        $(this).parent().removeClass('wraper-active');
60
61      } else {
62        $(this).parent().parent().find('.shadepro-accordion-title').removeClass('active');
63
64        accmin.removeClass('wraper-active');
65
66        $(this).parent('.yes').removeClass('wraper-active');
67
68        $(this).parent().parent().find('.shadepro-accordion-content').slideUp(400);
69
70        $(this).parent().addClass('wraper-active');
71
72        $(this).toggleClass('active');
73        $(this).next().slideToggle(400);
74
75      }
76    });
77  }
78  //portfolio js start
79  var Shadepro_Portfolio_Gallery_Js = function () {
80
81    if ($.fn.isotope) {
82      var $gridMas = $('.shadepro-pf-gallery-wrap.layout-mode-masonry');
83
84      $gridMas.isotope({
85        itemSelector: '.shadepro-pf-gallery-wrap .shadepro-portfolio-item-wrap',
86        percentPosition: true,
87        layoutMode: 'packery',
88      }).resize();
89
90      $gridMas.imagesLoaded().progress(function () {
91        $gridMas.isotope({
92          itemSelector: '.shadepro-pf-gallery-wrap .shadepro-portfolio-item-wrap',
93          percentPosition: true,
94          layoutMode: 'packery',
95
96        }).resize()
97      });
98
99    }
100
101  }
102  //portfolio js start
103  var Shadepro_Portfolio_Js = function () {
104
105    if ($.fn.isotope) {
106      var $gridMas = $('.shadepro-portfolio-wrap.layout-mode-masonry');
107      var $grid = $('.shadepro-portfolio-wrap.layout-mode-normal');
108
109      $grid.isotope({
110        itemSelector: '.shadepro-portfolio-item-wrap',
111        percentPosition: true,
112        layoutMode: 'fitRows',
113      })
114
115      $grid.imagesLoaded().progress(function () {
116        $grid.isotope({
117          itemSelector: '.shadepro-portfolio-item-wrap',
118          percentPosition: true,
119          layoutMode: 'fitRows',
120
121        })
122      });
123
124      $gridMas.isotope({
125        itemSelector: '.shadepro-portfolio-item-wrap',
126        percentPosition: true,
127        layoutMode: 'packery',
128      })
129
130      $gridMas.imagesLoaded().progress(function () {
131        $gridMas.isotope({
132          itemSelector: '.shadepro-portfolio-item-wrap',
133          percentPosition: true,
134          layoutMode: 'packery',
135
136        }).resize()
137      });
138
139
140      $(".pf-isotope-nav li").on('click', function () {
141        $(".pf-isotope-nav li").removeClass("active");
142        $(this).addClass("active");
143
144        var selector = $(this).attr("data-filter");
145        $gridMas.isotope({
146          filter: selector,
147          animationOptions: {
148            duration: 750,
149            easing: "linear",
150            queue: false,
151          }
152        }).resize();
153
154      });
155
156
157      $(".pf-isotope-nav li").on('click', function () {
158        $(".pf-isotope-nav li").removeClass("active");
159        $(this).addClass("active");
160
161        var selector = $(this).attr("data-filter");
162        $grid.isotope({
163          filter: selector,
164          animationOptions: {
165            duration: 750,
166            easing: "linear",
167            queue: false,
168          }
169        }).resize();
170
171      });
172    }
173
174    // comment load more button click event
175    $('.shadepro-pf-loadmore-btn').on('click', function () {
176      var button = $(this);
177
178      // decrease the current comment page value
179      var dpaged = button.data('paged'),
180        total_pages = button.data('total-page'),
181        nonce = button.data('referrar'),
182        ajaxurl = button.data('url');
183
184      dpaged++;
185      // console.log(foio_portfolio_js_datas);
186      $.ajax({
187        url: ajaxurl, // AJAX handler, declared before
188        dataType: 'html',
189        data: {
190          'action': 'shadepro_loadmore_callback', // wp_ajax_cloadmore
191          // 'post_id': foio_portfolio_js_datas.parent_post_id, // the current post
192          'paged': dpaged, // current comment page
193          'folio_nonce': nonce,
194          'portfolio_settings': button.data('portfolio-settings'),
195        },
196        type: 'POST',
197        beforeSend: function (xhr) {
198          button.text('Loading...'); // preloader here
199        },
200        success: function (data) {
201          if (data) {
202            $('.shadepro-portfolio-wrap').append(data);
203            $('.shadepro-portfolio-wrap').isotope('reloadItems').isotope()
204            button.text('More Portfolios');
205            button.data('paged', dpaged);
206            // if the last page, remove the button
207            if (total_pages == dpaged)
208              button.remove();
209          } else {
210            button.remove();
211          }
212        }
213      });
214      return false;
215    });
216
217  }
218  //end portfolio js
219
220
221
222
223  $(window).load(function () {
224
225    var cPriceHeadHeight = $('.pricing-style-classic .shadepro-price-wrap').height();
226    var mPriceHeadHeight = $('.pricing-style-minimal .shadepro-price-wrap').height();
227
228    $('.pricing-style-classic .shadepro-pricing-head-filler').css("height", cPriceHeadHeight + "px");
229    $('.pricing-style-minimal .shadepro-pricing-head-filler').css("height", mPriceHeadHeight + "px");
230
231  })
232
233  /*   function countDown() {
234      var second = 1000,
235        minute = second * 60,
236        hour = minute * 60,
237        day = hour * 24;
238
239      var shadeproDate = $(".shadepro-countdown#date").data("date");
240      var countDown = new Date(shadeproDate).getTime(),
241        x =  setInterval(function () {
242
243          var now = new Date().getTime(),
244            distance = countDown - now;
245          var cDays = document.getElementById("days");
246          if (cDays) {
247            (document.getElementById("days").innerHTML = addZero(Math.floor(distance / day)),
248              (document.getElementById("hours").innerHTML = addZero(Math.floor(
249                (distance % day) / hour
250              ), 2))),
251
252            (document.getElementById("minutes").innerHTML = addZero(Math.floor(
253              (distance % hour) / minute
254            ), 2)),
255            (document.getElementById("seconds").innerHTML = addZero(Math.floor(
256              (distance % minute) / second
257            ), 2));
258          }
259        }, second);
260
261        
262    } */
263
264  function makeTimer() {
265
266    var shadeproDate = $(".shadepro-countdown#date").data("date");
267    var endTime = new Date(shadeproDate);
268    endTime = (Date.parse(endTime) / 1000);
269
270    var now = new Date();
271    now = (Date.parse(now) / 1000);
272
273    var timeLeft = endTime - now;
274
275    var days = Math.floor(timeLeft / 86400);
276    var hours = Math.floor((timeLeft - (days * 86400)) / 3600);
277    var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600)) / 60);
278    var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60)));
279
280    if (hours < "10") {
281      hours = "0" + hours;
282    }
283    if (minutes < "10") {
284      minutes = "0" + minutes;
285    }
286    if (seconds < "10") {
287      seconds = "0" + seconds;
288    }
289
290    $("#days").html(days);
291    $("#hours").html(hours);
292    $("#minutes").html(minutes);
293    $("#seconds").html(seconds);
294
295  }
296
297
298
299  var ShadeProCountDown = function () {
300    setInterval(function () {
301      makeTimer();
302    }, 1000);
303  }
304
305  var ShadePricingTable = function () {
306
307    $("[data-pricing-trigger]").on("click", function (e) {
308      $(e.target).toggleClass("active");
309      var target = $(e.target).attr("data-target");
310      if ($(target).attr("data-value-active") == "monthly") {
311        $(target).attr("data-value-active", "yearly");
312      } else {
313        $(target).attr("data-value-active", "monthly");
314      }
315    })
316
317    // Classic tab switcher
318    $("[data-pricing-tab-trigger]").on("click", function (e) {
319      $('[data-pricing-tab-trigger]').removeClass("active");
320      $(this).addClass("active");
321      var target = $(e.target).attr("data-target");
322      if ($(target).attr("data-value-active") == "monthly") {
323        $(target).attr("data-value-active", "yearly");
324      } else {
325        $(target).attr("data-value-active", "monthly");
326      }
327    })
328
329  }
330
331  var ShadeProductCategories = function () {
332
333    if ($.fn.isotope) {
334      var $gridMas = $('.product-categories-wrap.masonry');
335
336      $gridMas.isotope({
337        itemSelector: '.shade-product-cat-wrap',
338        percentPosition: true,
339        layoutMode: 'packery',
340      })
341
342      $gridMas.imagesLoaded().progress(function () {
343        $gridMas.isotope({
344          itemSelector: '.shade-product-cat-wrap',
345          percentPosition: true,
346          layoutMode: 'packery',
347
348        })
349      });
350    }
351  }
352
353  var ShadePostLoop = function () {
354    if ($.fn.isotope) {
355
356      $('.shade-post-widget-area.masonry').isotope({
357        itemSelector: '.shade-post-widget-area.masonry>div',
358        percentPosition: true,
359        layoutMode: 'packery',
360      })
361
362    }
363  }
364
365  var ShadeJobLoop = function () {
366    if ($.fn.owlCarousel) {
367      $('.shade-job-carousel').owlCarousel({
368        margin: 30,
369        responsiveClass: true,
370        navText: ['<i class="fas fa-arrow-left"></i>', '<i class="fas fa-arrow-right"></i>'],
371        responsive: {
372          0: {
373            items: 1,
374            nav: true
375          },
376          768: {
377            items: 2,
378            nav: false
379          },
380          1000: {
381            items: 4,
382            nav: true,
383            loop: false
384          }
385        }
386      })
387    }
388  }
389
390  //sakib testimonial
391  var ShadeTestimonialCarousel = function ($scope, $) {
392    var twraper = $scope.find(".shadepro--tcarousel");
393    var settings = twraper.data('settings'),
394      rtl = $('body').hasClass('rtl') ? true : false;
395    if ($.fn.owlCarousel) {
396      $('.shadepro--tcarousel').owlCarousel({
397        rtl: rtl,
398        margin: settings['margin'],
399        responsiveClass: true,
400        loop: settings['loop'],
401        dots: settings['dots'],
402        nav: settings['nav'],
403        autoplay: settings['autoplay'],
404        items: settings['tes_per_coulmn'],
405        autoplaytimeout: settings['autoplaytimeout'],
406        navText: ['<i class="fas fa-long-arrow-alt-left"></i>', '<i class="fas fa-long-arrow-alt-right"></i>'],
407        responsive: {
408          0: {
409            items: settings['tes_per_coulmn_mobile'],
410          },
411          600: {
412            items: settings['tes_per_coulmn_tablet'],
413          },
414
415          768: {
416            items: settings['tes_per_coulmn_tablet'],
417          },
418          1000: {
419            items: settings['tes_per_coulmn'],
420          }
421        }
422      })
423    }
424  }
425
426  //sakib testimonial
427  var ShadeImageCarousel = function ($scope, $) {
428    var twraper = $scope.find(".shadepro-image-carousel");
429    var settings = twraper.data('settings'),
430      rtl = $('body').hasClass('rtl') ? true : false;
431
432    $('.shadepro-image-carousel').slick({
433      infinite: settings['loop'],
434      rtl: rtl,
435      slidesToShow: 3,
436      autoplay: settings['autoplay'],
437      autoplaySpeed: settings['autoplaytimeout'],
438      slidesToScroll: 1,
439      dots: settings['dots'],
440      arrows: settings['nav'],
441      centerMode: true,
442      centerPadding: '350px',
443      prevArrow: '<button type="button" class="slick-prev"><i class="fas fa-angle-left"></i></i></button>',
444      nextArrow: '<button type="button" class="slick-next"><i class="fas fa-angle-right"></i></i></button>',
445      responsive: [{
446          breakpoint: 1800,
447          settings: {
448            slidesToShow: 3,
449            centerPadding: '200px',
450
451          }
452        },
453        {
454          breakpoint: 1670,
455          settings: {
456            slidesToShow: 3,
457            centerPadding: '250px',
458
459          }
460        },
461        {
462          breakpoint: 1640,
463          settings: {
464            slidesToShow: 3,
465            centerPadding: '200px',
466
467          }
468        },
469        {
470          breakpoint: 1550,
471          settings: {
472            slidesToShow: 3,
473            centerPadding: '170px',
474
475          }
476        },
477        {
478          breakpoint: 1450,
479          settings: {
480            slidesToShow: 3,
481            centerPadding: '180px',
482
483          }
484        },
485        {
486          breakpoint: 1350,
487          settings: {
488            slidesToShow: 3,
489            centerPadding: '100px',
490
491          }
492        },
493        {
494          breakpoint: 1250,
495          settings: {
496            slidesToShow: 3,
497            centerPadding: '50px',
498
499          }
500        },
501        {
502          breakpoint: 1150,
503          settings: {
504            slidesToShow: 3,
505            centerPadding: '0px',
506
507          }
508        },
509        {
510          breakpoint: 1050,
511          settings: {
512            slidesToShow: 1,
513            centerPadding: '300px',
514
515          }
516        },
517        {
518          breakpoint: 950,
519          settings: {
520            slidesToShow: 1,
521            centerPadding: '250px',
522
523          }
524        },
525        {
526          breakpoint: 850,
527          settings: {
528            slidesToShow: 1,
529            centerPadding: '200px',
530          }
531        },
532        {
533          breakpoint: 750,
534          settings: {
535            slidesToShow: 1,
536            centerPadding: '150px',
537          }
538        },
539        {
540          breakpoint: 650,
541          settings: {
542            slidesToShow: 1,
543            centerPadding: '100px',
544          }
545        },
546        {
547          breakpoint: 515,
548          settings: {
549            slidesToShow: 1,
550            autoplay: true,
551            centerPadding: '0px',
552          }
553        },
554        {
555          breakpoint: 480,
556          settings: {
557            slidesToShow: 1,
558            autoplay: true,
559            centerPadding: '0px',
560            arrows: false,
561          }
562        }
563
564      ]
565    });
566  }
567
568
569  //sakib tab 
570  var shadeproTab = function ($scope, $) {
571    $('ul.tabs li').on('click', function () {
572      var tab_id = $(this).attr('data-tab');
573
574      $('ul.tabs li').removeClass('current');
575      $('.tab-content').removeClass('current');
576
577      $(this).addClass('current');
578      $("#" + tab_id).addClass('current');
579    })
580  };
581
582  //Main menu
583  var ShadeProMainMenu = function ($scope, $) {
584
585    $('.shadepro-mega-menu').closest('.elementor-container').addClass('megamenu-full-container');
586    var count = 0;
587    $(".main-navigation ul.navbar-nav>li.shadepro-mega-menu>.sub-menu>li").each(function (index) {
588      count++;
589      if ($(this).is('li:last-child')) {
590        $(this).parent().addClass('mg-column-' + count);
591        count = 0;
592      }
593    });
594
595  };
596
597  var ShadeCowWOrkingSearch = function ($scope, $) {
598    if ($.fn.datepicker) {
599      $('#coworking-date').datepicker();
600    }
601
602    if ($.fn.niceSelect) {
603      $('select').niceSelect();
604    }
605
606  }
607
608
609  var ShadeproGlobal = function ($scope, $) {
610
611    if ($scope.hasClass('shadepro-sticky-yes')) {
612      var current_widget = $scope;
613      current_widget.wrap('<div class="sticky-wrapper"></div>');
614      var headerHeight = $(current_widget).parent('.sticky-wrapper').height(),
615        stickyWrapper = $(current_widget).parent('.sticky-wrapper');
616      stickyWrapper.css('height', headerHeight + "px")
617      window.onscroll = function () {
618        scrollFunction()
619      };
620
621      function scrollFunction() {
622
623        if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
624          if ($scope.hasClass('shadepro-sticky-yes')) {
625            stickyWrapper.addClass("is-sticky");
626            console.log(stickyWrapper);
627          }
628        } else {
629          if ($scope.hasClass('shadepro-sticky-yes')) {
630            stickyWrapper.removeClass("is-sticky");
631          }
632        }
633        if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 300) {
634          if ($scope.hasClass('shadepro-sticky-yes')) {
635            $scope.addClass("reveal-sticky");
636          }
637        } else {
638          if ($scope.hasClass('shadepro-sticky-yes')) {
639            $scope.removeClass("reveal-sticky");
640          }
641        }
642
643      }
644
645    }
646
647    // Watch the changes of spacing control
648    var current_gr = $scope.attr('class');
649    current_gr = "." + current_gr.split(' ').join('.');
650    current_gr += " .shadepro-gradient-canvas";
651
652    if ($scope.hasClass('shadepro-adv-gradient-yes')) {
653
654      $scope.prepend('<canvas class="shadepro-gradient-canvas" data-js-darken-top data-transition-in><canvas>');
655
656      var gradient = new Gradient();
657      gradient.initGradient(current_gr);
658
659    }
660
661    if (typeof (elementor) !== 'undefined') {
662
663      elementor.channels.editor.on('change', function (view) {
664        let changed = view.elementSettingsModel.changed;
665
666        if ($scope.hasClass('shadepro-adv-gradient-yes')) {
667
668          if ($scope.find(".shadepro-gradient-canvas").length == 0) {
669            $scope.prepend('<canvas class="shadepro-gradient-canvas" data-js-darken-top data-transition-in><canvas>');
670          }
671
672          if ($scope.find(".shadepro-gradient-canvas").length > 0) {
673            var gradient = new Gradient();
674            gradient.initGradient(current_gr);
675          }
676        } else {
677          if ($scope.find(".shadepro-gradient-canvas").length > 0) {
678            $scope.find(".shadepro-gradient-canvas").remove();
679          }
680        }
681
682
683        // for accordion 
684        $('.shadepro-disable-default-yes .elementor-accordion-item').find('.elementor-active').removeClass('elementor-active');
685        $('.shadepro-disable-default-yes .elementor-accordion-item').find('.elementor-tab-content').removeAttr('style');
686
687      });
688    }
689
690
691    $('.shadepro-disable-default-yes .elementor-accordion-item').find('.elementor-active').removeClass('elementor-active');
692    $('.shadepro-disable-default-yes .elementor-accordion-item').find('.elementor-tab-content').removeAttr('style');
693
694  }
695
696  $(window).on("elementor/frontend/init", function () {
697
698    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-accordion.default", Shadepro_Accordion);
699    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-product-categories.default", ShadeProductCategories);
700    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-price-table.default", ShadePricingTable);
701    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-job-loop.default", ShadeJobLoop);
702    elementorFrontend.hooks.addAction("frontend/element_ready/blog-loop.default", ShadePostLoop);
703    elementorFrontend.hooks.addAction("frontend/element_ready/testimonial-sahde-pro.default", ShadeTestimonialCarousel);
704    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-image-carousel.default", ShadeImageCarousel);
705    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-tab.default", shadeproTab);
706    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-countdown.default", ShadeProCountDown);
707    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-portfolio.default", Shadepro_Portfolio_Js);
708    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-portfolio-gallery.default", Shadepro_Portfolio_Gallery_Js);
709    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-main-menu.default", ShadeProMainMenu);
710    elementorFrontend.hooks.addAction("frontend/element_ready/shadepro-main-menu.default", ShadeCowWOrkingSearch);
711    elementorFrontend.hooks.addAction("frontend/element_ready/global", ShadeproGlobal);
712
713  });
714
715})(jQuery);

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.