PageSourceSearch

https://www.redigerit.com/wp-content/plugins/digihub-addon/assets/js/digihub-addon.js?ver=1750317924

js redigerit.com collected 2026-10-05 09:54:39 UTC 23,552 bytes, 764 lines download raw bytes

1(function ($) {
2  "use strict";
3
4  var WidgetDefaultHandler = function ($scope) {
5    if ($scope.find(".wow").length) {
6      var wow = new WOW({
7        boxClass: "wow", // animated element css class (default is wow)
8        animateClass: "animated", // animation css class (default is animated)
9        mobile: true, // trigger animations on mobile devices (default is true)
10        live: true // act on asynchronously loaded content (default is true)
11      });
12      //wow.init();
13    }
14
15    let digihubImgHvr = $scope.find(".digihub-image-hover");
16    if (digihubImgHvr.length) {
17
18      //Image Hover Effect
19      Array.from(document.querySelectorAll(".digihub-image-hover")).forEach(
20        (e) => {
21          const imgs = Array.from(e.querySelectorAll("img"));
22          const displacementImage = e.dataset.hoverImage;
23          if (0 !== imgs.length) {
24            var button = new hoverEffect({
25              parent: e,
26              intensity: 0.2,
27              image1: imgs[0].getAttribute("src"),
28              image2: imgs[1].getAttribute("src"),
29              displacementImage: displacementImage
30            });
31          }
32        }
33      );
34    };
35
36    if ($scope.find(".hover-item").length) {
37      // Hover Image
38      const link = document.querySelectorAll(".hover-item");
39      const linkHoverReveal = document.querySelectorAll(".hover-item__box");
40      const linkImages = document.querySelectorAll(".hover-item__box-img");
41      for (let i = 0; i < link.length; i++) {
42        link[i].addEventListener("mousemove", (e) => {
43          linkHoverReveal[i].style.opacity = 1;
44          linkHoverReveal[
45            i
46          ].style.transform = `translate(-100%, -50% ) rotate(14deg)`;
47          linkImages[i].style.transform = "scale(1, 1)";
48          linkHoverReveal[i].style.left = e.clientX + "px";
49        });
50        link[i].addEventListener("mouseleave", (e) => {
51          linkHoverReveal[i].style.opacity = 0;
52          linkHoverReveal[
53            i
54          ].style.transform = `translate(-50%, -50%) rotate(-14deg)`;
55          linkImages[i].style.transform = "scale(0.8, 0.8)";
56        });
57      }
58    }
59
60
61    // owl slider
62    let digihubowlCarousel = $scope.find(".digihub-owl__carousel");
63    if (digihubowlCarousel.length) {
64      digihubowlCarousel.each(function () {
65        let elm = $(this);
66        let options = elm.data("owl-options");
67        let thmOwlCarousel = elm.owlCarousel(
68          "object" === typeof options ? options : JSON.parse(options)
69        );
70        elm.find("button").each(function () {
71          $(this).attr("aria-label", "carousel button");
72        });
73      });
74    }
75
76    let digihubowlCarouselNav = $(".digihub-owl__carousel--custom-nav");
77    if (digihubowlCarouselNav.length) {
78      digihubowlCarouselNav.each(function () {
79        let elm = $(this);
80        let owlNavPrev = elm.data("owl-nav-prev");
81        let owlNavNext = elm.data("owl-nav-next");
82        $(owlNavPrev).on("click", function (e) {
83          elm.trigger("prev.owl.carousel");
84          e.preventDefault();
85        });
86
87        $(owlNavNext).on("click", function (e) {
88          elm.trigger("next.owl.carousel");
89          e.preventDefault();
90        });
91      });
92    }
93
94    if ($scope.find(".odometer").length) {
95      var odo = $(".odometer");
96      odo.each(function () {
97        $(this).appear(function () {
98          var countNumber = $(this).attr("data-count");
99          $(this).html(countNumber);
100        });
101      });
102    }
103
104    if ($scope.find(".masonry-layout").length) {
105      $scope.find(".masonry-layout").imagesLoaded(function () {
106        $scope.find(".masonry-layout").isotope({
107          itemSelector: ".masonry-layout__item",
108          percentPosition: true,
109          masonry: {
110            columnWidth: 1
111          }
112        });
113      });
114    }
115    if ($scope.find(".img-popup").length) {
116      var groups = {};
117      $(".img-popup").each(function () {
118        var id = parseInt($(this).attr("data-group"), 10);
119
120        if (!groups[id]) {
121          groups[id] = [];
122        }
123
124        groups[id].push(this);
125      });
126
127      $.each(groups, function () {
128        $(this).magnificPopup({
129          type: "image",
130          closeOnContentClick: true,
131          closeBtnInside: false,
132          gallery: {
133            enabled: true
134          }
135        });
136      });
137    }
138
139    if ($scope.find(".digihub-masonary").length) {
140      $scope.find(".digihub-masonary").imagesLoaded(function () {
141        $scope.find(".digihub-masonary").isotope({
142          layoutMode: "masonry"
143        });
144      });
145    }
146
147    if ($(".post-filter").length) {
148      $(".post-filter li")
149        .children(".filter-text")
150        .on("click", function () {
151          var Self = $(this);
152          var selector = Self.parent().attr("data-filter");
153          $(".post-filter li").removeClass("active");
154          Self.parent().addClass("active");
155          $(".digihub-filter").isotope({
156            filter: selector,
157            animationOptions: {
158              duration: 500,
159              easing: "linear",
160              queue: false
161            }
162          });
163          return false;
164        });
165    }
166
167    if ($scope.find(".post-filter.has-dynamic-filters-counter").length) {
168      // var allItem = $('.single-filter-item').length;
169      var activeFilterItem = $(".post-filter.has-dynamic-filters-counter").find(
170        "li"
171      );
172      activeFilterItem.each(function () {
173        var filterElement = $(this).data("filter");
174        var count = $(".digihub-filter").find(filterElement).length;
175        $(this)
176          .children(".filter-text")
177          .append('<span class="count">(' + count + ")</span>");
178      });
179    }
180
181    if ($scope.find(".masonary-layout").length) {
182      $scope.find(".masonary-layout").isotope({
183        layoutMode: "masonry"
184      });
185    }
186    if ($scope.find(".post-filter").length) {
187      $scope
188        .find(".post-filter li")
189        .children(".filter-text")
190        .on("click", function () {
191          var Self = $(this);
192          var selector = Self.parent().attr("data-filter");
193          $(".post-filter li").removeClass("active");
194          Self.parent().addClass("active");
195          $(".filter-layout").isotope({
196            filter: selector,
197            animationOptions: {
198              duration: 500,
199              easing: "linear",
200              queue: false
201            }
202          });
203          return false;
204        });
205    }
206
207    if ($scope.find(".tabs-box").length) {
208      $scope.find(".tabs-box .tab-buttons .tab-btn").on("click", function (e) {
209        e.preventDefault();
210        var target = $($(this).attr("data-tab"));
211
212        if ($(target).is(":visible")) {
213          return false;
214        } else {
215          target
216            .parents(".tabs-box")
217            .find(".tab-buttons")
218            .find(".tab-btn")
219            .removeClass("active-btn");
220          $(this).addClass("active-btn");
221          target
222            .parents(".tabs-box")
223            .find(".tabs-content")
224            .find(".tab")
225            .fadeOut(0);
226          target
227            .parents(".tabs-box")
228            .find(".tabs-content")
229            .find(".tab")
230            .removeClass("active-tab");
231          $(target).fadeIn(300);
232          $(target).addClass("active-tab");
233        }
234      });
235    }
236
237    if ($scope.find(".neighborhoods__faq").length) {
238      $scope
239        .find(".neighborhoods__faq")
240        .find(".accrodion")
241        .each(function () {
242          $(this).on("click", function () {
243            let tabName = $(this).data("name");
244            $(".neighborhoods__img-box")
245              .find(".neighborhoods__location-1")
246              .removeClass("active");
247            $(".neighborhoods__img-box")
248              .find(".neighborhoods__location-1." + tabName)
249              .addClass("active");
250          });
251        });
252    }
253
254    // Accrodion
255    if ($scope.find(".digihub-accrodion").length) {
256      var accrodionGrp = $(".digihub-accrodion");
257      accrodionGrp.each(function () {
258        var accrodionName = $(this).data("grp-name");
259        var Self = $(this);
260        var accordion = Self.find(".accrodion");
261        Self.addClass(accrodionName);
262        Self.find(".accrodion .accrodion-content").hide();
263        Self.find(".accrodion.active").find(".accrodion-content").show();
264        accordion.each(function () {
265          $(this)
266            .find(".accrodion-title")
267            .on("click", function () {
268              if ($(this).parent().hasClass("active") === false) {
269                $(".digihub-accrodion." + accrodionName)
270                  .find(".accrodion")
271                  .removeClass("active");
272                $(".digihub-accrodion." + accrodionName)
273                  .find(".accrodion")
274                  .find(".accrodion-content")
275                  .slideUp();
276                $(this).parent().addClass("active");
277                $(this).parent().find(".accrodion-content").slideDown();
278              }
279            });
280        });
281      });
282    }
283
284    // Popular Causes Progress Bar
285    if ($scope.find(".count-bar").length) {
286      $(".count-bar").appear(
287        function () {
288          var el = $(this);
289          var percent = el.data("percent");
290          $(el).css("width", percent).addClass("counted");
291        },
292        {
293          accY: -50
294        }
295      );
296    }
297
298    // Popular Causes Progress Bar
299    if ($scope.find(".circle-progress").length) {
300      $(".circle-progress").appear(function () {
301        let circleProgress = $(".circle-progress");
302        circleProgress.each(function () {
303          let progress = $(this);
304          let progressOptions = progress.data("options");
305          progress.circleProgress(progressOptions);
306        });
307      });
308    }
309
310    //Progress Bar / Levels
311    function radial_animate() {
312      $("svg.radial-progress").each(function (index, value) {
313        $(this).find($("circle.bar-animated")).removeAttr("style");
314        // Get element in Veiw port
315        var elementTop = $(this).offset().top;
316        var elementBottom = elementTop + $(this).outerHeight();
317        var viewportTop = $(window).scrollTop();
318        var viewportBottom = viewportTop + $(window).height();
319
320        if (elementBottom > viewportTop && elementTop < viewportBottom) {
321          var percent = $(value).data("countervalue");
322          var radius = $(this).find($("circle.bar-animated")).attr("r");
323          var circumference = 2 * Math.PI * radius;
324          var strokeDashOffset = circumference - (percent * circumference) / 100;
325          $(this).find($("circle.bar-animated")).animate(
326            {
327              "stroke-dashoffset": strokeDashOffset
328            },
329            2800
330          );
331        }
332      });
333    }
334    // To check If it is in Viewport
335    var $window = $(window);
336
337    function check_if_in_view() {
338      $(".countervalue").each(function () {
339        if ($(this).hasClass("start")) {
340          var elementTop = $(this).offset().top;
341          var elementBottom = elementTop + $(this).outerHeight();
342
343          var viewportTop = $(window).scrollTop();
344          var viewportBottom = viewportTop + $(window).height();
345
346          if (elementBottom > viewportTop && elementTop < viewportBottom) {
347            $(this).removeClass("start");
348            $(".countervalue").text();
349            var myNumbers = $(this).text();
350            if (myNumbers == Math.floor(myNumbers)) {
351              $(this).animate(
352                {
353                  Counter: $(this).text()
354                },
355                {
356                  duration: 2800,
357                  easing: "swing",
358                  step: function (now) {
359                    $(this).text(Math.ceil(now) + "%");
360                  }
361                }
362              );
363            } else {
364              $(this).animate(
365                {
366                  Counter: $(this).text()
367                },
368                {
369                  duration: 2800,
370                  easing: "swing",
371                  step: function (now) {
372                    $(this).text(now.toFixed(2) + "$");
373                  }
374                }
375              );
376            }
377
378            radial_animate();
379          }
380        }
381      });
382    }
383
384    $window.on("scroll", check_if_in_view);
385    $window.on("load", check_if_in_view);
386
387    //Fact Counter + Text Count
388    if ($(".count-box").length) {
389      $(".count-box").appear(
390        function () {
391          var $t = $(this),
392            n = $t.find(".count-text").attr("data-stop"),
393            r = parseInt($t.find(".count-text").attr("data-speed"), 10);
394
395          if (!$t.hasClass("counted")) {
396            $t.addClass("counted");
397            $({
398              countNum: $t.find(".count-text").text()
399            }).animate(
400              {
401                countNum: n
402              },
403              {
404                duration: r,
405                easing: "linear",
406                step: function () {
407                  $t.find(".count-text").text(Math.floor(this.countNum));
408                },
409                complete: function () {
410                  $t.find(".count-text").text(this.countNum);
411                }
412              }
413            );
414          }
415        },
416        {
417          accY: 0
418        }
419      );
420    }
421
422
423    let thmSwiperSliders = $scope.find(".thm-swiper__slider");
424    if (thmSwiperSliders.length) {
425      thmSwiperSliders.each(function () {
426        let elm = $(this);
427        let options = elm.data("swiper-options");
428        let thmSwiperSlider = new Swiper(
429          elm,
430          "object" === typeof options ? options : JSON.parse(options)
431        );
432      });
433    }
434
435    let thmOwlCarousels = $scope.find(".digihub-owl__carousel");
436    if (thmOwlCarousels.length) {
437      thmOwlCarousels.each(function () {
438        let elm = $(this);
439        let options = elm.data("owl-options");
440        let thmOwlCarousel = elm.owlCarousel(
441          "object" === typeof options ? options : JSON.parse(options)
442        );
443      });
444    }
445
446    let thmOwlNavCarousels = $scope.find(".thm-owl__carousel--custom-nav");
447    if (thmOwlNavCarousels.length) {
448      thmOwlNavCarousels.each(function () {
449        let elm = $(this);
450        let owlNavPrev = elm.data("owl-nav-prev");
451        let owlNavNext = elm.data("owl-nav-next");
452        $(owlNavPrev).on("click", function (e) {
453          elm.trigger("prev.owl.carousel");
454          e.preventDefault();
455        });
456
457        $(owlNavNext).on("click", function (e) {
458          elm.trigger("next.owl.carousel");
459          e.preventDefault();
460        });
461      });
462    }
463
464    if ($scope.find("#testimonials-two__thumb").length) {
465      let testimonialsThumb = new Swiper("#testimonials-two__thumb", {
466        slidesPerView: 3,
467        spaceBetween: 0,
468        speed: 1400,
469        watchSlidesVisibility: true,
470        watchSlidesProgress: true,
471        loop: true,
472        autoplay: {
473          delay: 5000
474        }
475      });
476
477      let testimonialsCarousel = new Swiper("#testimonials-two__carousel", {
478        observer: true,
479        observeParents: true,
480        speed: 1400,
481        mousewheel: false,
482        slidesPerView: 1,
483        autoplay: {
484          delay: 5000
485        },
486        thumbs: {
487          swiper: testimonialsThumb
488        },
489        pagination: {
490          el: "#testimonials-one__carousel-pagination",
491          type: "bullets",
492          clickable: true
493        }
494      });
495    }
496    if ($scope.find(".post-filter").length) {
497      var postFilterList = $(".post-filter li");
498      // for first init
499      $(".filter-layout").isotope({
500        filter: ".filter-item",
501        animationOptions: {
502          duration: 500,
503          easing: "linear",
504          queue: false
505        }
506      });
507      // on click filter links
508      postFilterList.on("click", function () {
509        var Self = $(this);
510        var selector = Self.attr("data-filter");
511        postFilterList.removeClass("active");
512        Self.addClass("active");
513
514        $(".filter-layout").isotope({
515          filter: selector,
516          animationOptions: {
517            duration: 500,
518            easing: "linear",
519            queue: false
520          }
521        });
522        return false;
523      });
524    }
525    if ($scope.find(".curved-circle--item").length) {
526      $(".curved-circle--item").circleType();
527    }
528
529    // Date Picker
530    if ($(".digihub-datepicker").length) {
531      $(".digihub-datepicker").each(function () {
532        $(this).datepicker();
533      });
534    }
535
536    if ($("#datepicker").length) {
537      $("#datepicker").datepicker();
538    }
539
540    if ($("#datepicker2").length) {
541      $("#datepicker2").datepicker();
542    }
543
544    digihub_stretch();
545
546    function digihub_stretch() {
547      var i = $(window).width();
548      $(".row .digihub-stretch-element-inside-column").each(function () {
549        var $this = $(this),
550          row = $this.closest(".row"),
551          cols = $this.closest('[class^="col-"]'),
552          colsheight = $this.closest('[class^="col-"]').height(),
553          rect = this.getBoundingClientRect(),
554          l = row[0].getBoundingClientRect(),
555          s = cols[0].getBoundingClientRect(),
556          r = rect.left,
557          d = i - rect.right,
558          c = l.left + (parseFloat(row.css("padding-left")) || 0),
559          u = i - l.right + (parseFloat(row.css("padding-right")) || 0),
560          p = s.left,
561          f = i - s.right,
562          styles = {
563            "margin-left": 0,
564            "margin-right": 0
565          };
566        if (Math.round(c) === Math.round(p)) {
567          var h = parseFloat($this.css("margin-left") || 0);
568          styles["margin-left"] = h - r;
569        }
570        if (Math.round(u) === Math.round(f)) {
571          var w = parseFloat($this.css("margin-right") || 0);
572          styles["margin-right"] = w - d;
573        }
574        $this.css(styles);
575      });
576    }
577  };
578
579  var WidgetFaqHandler = function ($scope) {
580    if ($scope.find(".accrodion-grp").length) {
581      var accrodionGrp = $(".accrodion-grp");
582      accrodionGrp.each(function () {
583        var accrodionName = $(this).data("grp-name");
584        var Self = $(this);
585        var accordion = Self.find(".accrodion");
586        Self.addClass(accrodionName);
587        Self.find(".accrodion .accrodion-content").hide();
588        Self.find(".accrodion.active").find(".accrodion-content").show();
589        accordion.each(function () {
590          $(this)
591            .find(".accrodion-title")
592            .on("click", function () {
593              if ($(this).parent().hasClass("active") === false) {
594                $(".accrodion-grp." + accrodionName)
595                  .find(".accrodion")
596                  .removeClass("active");
597                $(".accrodion-grp." + accrodionName)
598                  .find(".accrodion")
599                  .find(".accrodion-content")
600                  .slideUp();
601                $(this).parent().addClass("active");
602                $(this).parent().find(".accrodion-content").slideDown();
603              }
604            });
605        });
606      });
607    }
608  };
609
610  if ($("#history-one__thumb").length) {
611    let testimonialsThumb = new Swiper("#history-one__thumb", {
612      slidesPerView: 5,
613      spaceBetween: 0,
614      speed: 1400,
615      watchSlidesVisibility: true,
616      watchSlidesProgress: true,
617      loop: true,
618      autoplay: {
619        delay: 5000
620      }
621    });
622
623    let testimonialsCarousel = new Swiper("#history-one__carousel", {
624      observer: true,
625      observeParents: true,
626      loop: true,
627      speed: 1400,
628      mousewheel: false,
629      slidesPerView: 1,
630      spaceBetween: 72,
631      autoplay: {
632        delay: 5000
633      },
634      thumbs: {
635        swiper: testimonialsThumb
636      },
637      pagination: {
638        el: "#testimonials-one__carousel-pagination",
639        type: "bullets",
640        clickable: true
641      },
642
643      navigation: {
644        nextEl: "#history-one__swiper-button-next",
645        prevEl: "#history-one__swiper-button-prev"
646      }
647    });
648  }
649
650  var WidgetFooterSubscribeHandler = function ($scope) {
651    // mailchimp form
652    if ($scope.find(".mc-form").length) {
653      $(".mc-form").each(function () {
654        var Self = $(this);
655        var mcURL = Self.data("url");
656        var mcResp = Self.parent().find(".mc-form__response");
657
658        Self.ajaxChimp({
659          url: mcURL,
660          callback: function (resp) {
661            // appending response
662            mcResp.append(function () {
663              return '<p class="mc-message">' + resp.msg + "</p>";
664            });
665            // making things based on response
666            if (resp.result === "success") {
667              // Do stuff
668              Self.removeClass("errored").addClass("successed");
669              mcResp.removeClass("errored").addClass("successed");
670              Self.find("input").val("");
671
672              mcResp.find("p").fadeOut(10000);
673            }
674            if (resp.result === "error") {
675              Self.removeClass("successed").addClass("errored");
676              mcResp.removeClass("successed").addClass("errored");
677              Self.find("input").val("");
678
679              mcResp.find("p").fadeOut(10000);
680            }
681          }
682        });
683      });
684    }
685  };
686  //elementor front start
687  $(window).on("elementor/frontend/init", function () {
688    elementorFrontend.hooks.addAction(
689      "frontend/element_ready/widget",
690      WidgetDefaultHandler
691    );
692
693    elementorFrontend.hooks.addAction(
694      "frontend/element_ready/digihub-faq.default",
695      WidgetFaqHandler
696    );
697
698    elementorFrontend.hooks.addAction(
699      "frontend/element_ready/footer-subscribe.default",
700      WidgetFooterSubscribeHandler
701    );
702  });
703
704  // login
705  $("#digihub-login").submit(function (event) {
706    event.preventDefault();
707
708    var login = "action=signup_paragon&param=login&" + $(this).serialize();
709    $.ajax({
710      type: "POST",
711      url: digihub_login_object.ajaxurl,
712      data: login,
713      beforeSend: function () {
714        // setting a timeout
715        $(".login-result").addClass("loading");
716      },
717      success: function (data) {
718        $(".login-result").removeClass("loading");
719        if (data.status == 2) {
720          $(".login-result").removeClass("alert alert-warning");
721          $(".login-result").html(data.message).addClass("alert alert-success");
722          window.location.href = digihub_login_object.login_redirect_url;
723        } else if (data.status == 1) {
724          $(".login-result").html(data.message).addClass("alert alert-warning");
725        } else {
726          $(".login-result")
727            .html(digihub_login_object.message)
728            .addClass("alert alert-warning");
729        }
730      }
731    });
732  }); //end login
733
734  // register
735  $("#digihub-registration").submit(function (event) {
736    event.preventDefault();
737
738    var signupForm =
739      "action=signup_paragon&param=register&" + $(this).serialize();
740    $.ajax({
741      type: "POST",
742      url: digihub_login_object.ajaxurl,
743      data: signupForm,
744      beforeSend: function () {
745        // setting a timeout
746        $(".registration-result").addClass("loading");
747      },
748      success: function (data) {
749        $(".registration-result").removeClass("loading");
750        if (data.status == 2) {
751          $(".registration-result").removeClass("alert alert-warning");
752          $(".registration-result")
753            .html(data.message)
754            .addClass("alert alert-success");
755          window.location.href = digihub_login_object.registration_redirect_url;
756        } else {
757          $(".registration-result")
758            .html(data.message)
759            .addClass("alert alert-warning");
760        }
761      }
762    });
763  }); //end register
764})(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.