PageSourceSearch

https://secours-islamique.org/templates/shaper_hope/js/main.js

js secours-islamique.org collected 2026-09-24 18:28:49 UTC 12,172 bytes, 413 lines download raw bytes

1/**
2 * @package Helix3 Framework
3 * @author JoomShaper http://www.joomshaper.com
4 * @copyright Copyright (c) 2010 - 2016 JoomShaper
5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
6 */
7
8jQuery(function ($) {
9  // ************    START Helix 1.4 JS    ************** //
10  // **************************************************** //
11
12  //Default
13  if (typeof sp_offanimation === "undefined" || sp_offanimation === "") {
14    sp_offanimation = "default";
15  }
16
17  if (sp_offanimation == "default") {
18    $("#offcanvas-toggler").on("click", function (event) {
19      event.preventDefault();
20      $(".off-canvas-menu-init").addClass("offcanvas");
21    });
22
23    $('<div class="offcanvas-overlay"></div>').insertBefore(".offcanvas-menu");
24    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
25      event.preventDefault();
26      $(".off-canvas-menu-init").removeClass("offcanvas");
27    });
28  }
29
30  // Slide Top Menu
31  if (sp_offanimation == "slidetop") {
32    $("#offcanvas-toggler").on("click", function (event) {
33      event.preventDefault();
34      $(".off-canvas-menu-init").addClass("slide-top-menu");
35    });
36
37    $('<div class="offcanvas-overlay"></div>').insertBefore(".offcanvas-menu");
38    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
39      event.preventDefault();
40      $(".off-canvas-menu-init").removeClass("slide-top-menu");
41    });
42  }
43
44  //Full Screen
45  if (sp_offanimation == "fullscreen") {
46    $("#offcanvas-toggler").on("click", function (event) {
47      event.preventDefault();
48      $(".off-canvas-menu-init").addClass("full-screen-off-canvas");
49    });
50    $(document).ready(function () {
51      $(".off-canvas-menu-init").addClass("full-screen");
52    });
53    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
54      event.preventDefault();
55      $(".off-canvas-menu-init").removeClass("full-screen-off-canvas");
56    });
57  }
58
59  //Full screen from top
60  if (sp_offanimation == "fullScreen-top") {
61    $("#offcanvas-toggler").on("click", function (event) {
62      event.preventDefault();
63      $(".off-canvas-menu-init").addClass("full-screen-off-canvas-ftop");
64    });
65    $(document).ready(function () {
66      $(".off-canvas-menu-init").addClass("full-screen-ftop");
67    });
68    $(".close-offcanvas, .offcanvas-overlay").on("click", function (event) {
69      event.preventDefault();
70      $(".off-canvas-menu-init").removeClass("full-screen-off-canvas-ftop");
71    });
72  }
73
74  //Dark with plus
75  if (sp_offanimation == "drarkplus") {
76    $("#offcanvas-toggler").on("click", function (event) {
77      event.preventDefault();
78      $(".off-canvas-menu-init").addClass("new-look-off-canvas");
79    });
80    $('<div class="offcanvas-overlay"></div>').insertBefore(".offcanvas-menu");
81    $(document).ready(function () {
82      $(".off-canvas-menu-init").addClass("new-look");
83    });
84    $(".close-offcanvas,.offcanvas-overlay").on("click", function (event) {
85      event.preventDefault();
86      $(".off-canvas-menu-init").removeClass("new-look-off-canvas");
87    });
88  }
89
90  // if sticky header
91  if ($("body.sticky-header").length > 0 && $("#sp-header").length > 0) {
92    var fixedSection = $("#sp-header");
93    // sticky nav
94    var headerHeight = fixedSection.outerHeight();
95    var stickyNavTop = fixedSection.offset().top;
96    fixedSection.addClass("animated");
97    fixedSection.before('<div class="nav-placeholder"></div>');
98    $(".nav-placeholder").height("inherit");
99    //add class
100    fixedSection.addClass("menu-fixed-out");
101    var stickyNav = function () {
102      var scrollTop = $(window).scrollTop();
103      if (scrollTop > stickyNavTop) {
104        fixedSection
105          .removeClass("menu-fixed-out")
106          .addClass("menu-fixed fadeInDown");
107        $(".nav-placeholder").height(headerHeight);
108      } else {
109        if (fixedSection.hasClass("menu-fixed")) {
110          fixedSection
111            .removeClass("menu-fixed fadeInDown")
112            .addClass("menu-fixed-out");
113          $(".nav-placeholder").height("inherit");
114        }
115      }
116    };
117    stickyNav();
118    $(window).scroll(function () {
119      stickyNav();
120    });
121  }
122  // go to top
123  if (typeof sp_gotop === "undefined") {
124    sp_gotop = "";
125  }
126
127  if (sp_gotop) {
128    // go to top
129    $(window).scroll(function () {
130      if ($(this).scrollTop() > 100) {
131        $(".scrollup").fadeIn();
132      } else {
133        $(".scrollup").fadeOut(400);
134      }
135    });
136
137    $(".scrollup").click(function () {
138      $("html, body").animate(
139        {
140          scrollTop: 0,
141        },
142        600
143      );
144      return false;
145    });
146  } // has go to top
147
148  // Preloader
149  if (typeof sp_preloader === "undefined") {
150    sp_preloader = "";
151  }
152
153  if (sp_preloader) {
154    $(window).on("load", function () {
155      if ($(".sp-loader-with-logo").length > 0) {
156        move();
157      }
158      setTimeout(function () {
159        $(".sp-pre-loader").fadeOut();
160      }, 1000);
161    });
162  } // has preloader
163  //preloader Function
164  function move() {
165    var elem = document.getElementById("line-load");
166    var width = 1;
167    var id = setInterval(frame, 10);
168    function frame() {
169      if (width >= 100) {
170        clearInterval(id);
171      } else {
172        width++;
173        elem.style.width = width + "%";
174      }
175    }
176  }
177  // ************    END:: Helix 1.4 JS    ************** //
178  // **************************************************** //
179
180  // **************   START Mega SCRIPT   *************** //
181  // **************************************************** //
182
183  //mega menu
184  $(".sp-megamenu-wrapper")
185    .parent()
186    .parent()
187    .css("position", "static")
188    .parent()
189    .css("position", "relative");
190  $(".sp-menu-full").each(function () {
191    $(this).parent().addClass("menu-justify");
192  });
193
194  // boxlayout
195  if ($("body.layout-boxed").length > 0) {
196    var windowWidth = $("#sp-header").parent().outerWidth();
197    $("#sp-header").css({ "max-width": windowWidth, left: "auto" });
198  }
199
200  // **************   END:: Mega SCRIPT   *************** //
201  // **************************************************** //
202
203  // **************  START Others SCRIPT  *************** //
204  // **************************************************** //
205
206  //donation js
207  var donation_input = $(".sppb-addon-donation .donation-ammount-wrap > input");
208  donation_input.on("click", function () {
209    console.log("test");
210    // remove previous active class and add class
211    donation_input.removeClass("active");
212    $(this).addClass("active");
213
214    var currency = $(".sppb-addon-donation .donation-ammount-wrap").data(
215        "currency"
216      ),
217      crncy_code = currency.split(":"),
218      pid = $(".sppb-addon-donation .donation-ammount-wrap").data("pid"),
219      this_val = $(this).val(),
220      cur_code = this_val.slice(0, 1),
221      amt = this_val.split(cur_code);
222
223    if (amt[1]) {
224      var amt = amt[1];
225    } else {
226      var amt = this_val;
227    }
228    if (amt != "" && amt > 0) {
229      $(".sppb-addon-donation .donation-button .donation-button-link").attr(
230        "href",
231        "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=" +
232          pid +
233          "&item_name=donation&amount=" +
234          amt +
235          "&currency_code=" +
236          crncy_code[0] +
237          ""
238      );
239    }
240  });
241
242  //donation custom onkeyup change value
243  $(".sppb-addon-donation .donation-ammount-wrap > input.input-text").on(
244    "keyup",
245    function (event) {
246      var this_val = $(this).val(),
247        pid = $(".sppb-addon-donation .donation-ammount-wrap").data("pid"),
248        currency = $(".sppb-addon-donation .donation-ammount-wrap").data(
249          "currency"
250        ),
251        crncy_code = currency.split(":");
252
253      if (this_val != "" && this_val > 0) {
254        $(".sppb-addon-donation .donation-button .donation-button-link").attr(
255          "href",
256          "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=" +
257            pid +
258            "&item_name=donation&amount=" +
259            this_val +
260            "&currency_code=" +
261            crncy_code[0] +
262            ""
263        );
264      }
265    }
266  );
267
268  //Tooltip
269  var tooltipTriggerList = [].slice.call(
270    document.querySelectorAll('[data-toggle="tooltip"]')
271  );
272  var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
273    return new bootstrap.Tooltip(tooltipTriggerEl);
274  });
275
276  // Article Ajax voting
277  $(document).on("click", ".sp-rating .star", function (event) {
278    event.preventDefault();
279
280    var data = {
281      action: "voting",
282      user_rating: $(this).data("number"),
283      id: $(this).closest(".post_rating").attr("id"),
284    };
285
286    var request = {
287      option: "com_ajax",
288      plugin: "helix3",
289      data: data,
290      format: "json",
291    };
292
293    $.ajax({
294      type: "POST",
295      data: request,
296      beforeSend: function () {
297        $(".post_rating .ajax-loader").show();
298      },
299      success: function (response) {
300        var data = $.parseJSON(response.data);
301
302        $(".post_rating .ajax-loader").hide();
303
304        if (data.status == "invalid") {
305          $(".post_rating .voting-result")
306            .text("You have already rated this entry!")
307            .fadeIn("fast");
308        } else if (data.status == "false") {
309          $(".post_rating .voting-result")
310            .text("Somethings wrong here, try again!")
311            .fadeIn("fast");
312        } else if (data.status == "true") {
313          var rate = data.action;
314          $(".voting-symbol")
315            .find(".star")
316            .each(function (i) {
317              if (i < rate) {
318                $(".star")
319                  .eq(-(i + 1))
320                  .addClass("active");
321              }
322            });
323
324          $(".post_rating .voting-result").text("Thank You!").fadeIn("fast");
325        }
326      },
327      error: function () {
328        $(".post_rating .ajax-loader").hide();
329        $(".post_rating .voting-result")
330          .text("Failed to rate, try again!")
331          .fadeIn("fast");
332      },
333    });
334  });
335
336  // **************  END:: Others SCRIPT  *************** //
337  // **************************************************** //
338});
339
340//For react template
341jQuery(function ($) {
342  var observer = new MutationObserver(function (mutations) {
343    mutations.forEach(function (mutation) {
344      var newNodes = mutation.addedNodes;
345      if (newNodes !== null) {
346        var $nodes = $(newNodes);
347
348        $nodes.each(function () {
349          var $node = $(this);
350          $node.find("#slide-fullwidth").each(function () {
351            var $slideFullwidth = $(this);
352
353            // Autoplay
354            var $autoplay = $slideFullwidth.attr("data-sppb-slide-ride");
355            if ($autoplay == "true") {
356              var $autoplay = true;
357            } else {
358              var $autoplay = false;
359            }
360
361            // controllers
362            var $controllers = $slideFullwidth.attr(
363              "data-sppb-slidefull-controllers"
364            );
365            if ($controllers == "true") {
366              var $controllers = true;
367            } else {
368              var $controllers = false;
369            }
370
371            $slideFullwidth.owlCarousel({
372              margin: 0,
373              loop: true,
374              video: true,
375              autoplay: $autoplay,
376              animateIn: "fadeIn",
377              animateOut: "fadeOut",
378              autoplayHoverPause: true,
379              autoplaySpeed: 1500,
380              responsive: {
381                0: {
382                  items: 1,
383                },
384                600: {
385                  items: 1,
386                },
387                1000: {
388                  items: 1,
389                },
390              },
391              dots: $controllers,
392            });
393
394            $(".sppbSlidePrev").click(function () {
395              $slideFullwidth.trigger("prev.owl.carousel", [400]);
396            });
397
398            $(".sppbSlideNext").click(function () {
399              $slideFullwidth.trigger("next.owl.carousel", [400]);
400            });
401          });
402        });
403      }
404    });
405  });
406
407  var config = {
408    childList: true,
409    subtree: true,
410  };
411  // Pass in the target node, as well as the observer options
412  observer.observe(document.body, config);
413});

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.