PageSourceSearch

https://www.caritas-stpoelten.at/_assets/f2ad908d8053f4cfd6ac64639…/newsletterPopUp.js?1782979428

js caritas-stpoelten.at collected 2026-10-02 17:34:18 UTC 3,414 bytes, 114 lines download raw bytes

1/*!
2 * I-Kiu Newsletter Pop Up
3 * with love and passion by i-kiu.at (https://i-kiu.at)
4 */
5
6
7jQuery(document).ready(function ($) {
8
9  var frm = $('.newsletter-form');
10  frm.each(function () {
11    $(this).parsley();
12    $(this).submit(function (e) {
13      e.preventDefault();
14      $.ajax({
15        type: 'post',
16        url: frm.attr('action'),
17        data: frm.serialize() + '&tx_ikcaritas_newslettersubscription[submitType]=ajax'
18      })
19        .done(function(data) {
20          if (data['status'] == 'success') {
21            frm.html(data['message']);
22            if (typeof (gtag) !== 'undefined') {
23              gtag("event", "join_group", {
24                group_id: "NL_PopUp"
25              });
26            }
27          }
28        })
29        .fail(function(response) {
30          console.log('An error occurred: ' + response.status + ' ' + response.statusText);
31        });
32    });
33
34    const inputElement =this;
35    const formElement = inputElement.closest('form')
36    const captchaTarget = document.querySelector('#newsletter-captcha-widget')
37    const submitButton = formElement.querySelector('[type="submit"]')
38
39    // async function setupCaptchaField(inputElement, formElement, captchaTarget, submitButton, captchaeuSolutionElement, captchaErrorElement) {
40
41    setupCaptchaField(inputElement, formElement, captchaTarget, submitButton, document.querySelector('#captcha_eu_solution'), document.querySelector('#error-message-captcha'))
42    /*
43    $('#newsletter-form input').focus(function () {
44      // $(this).unbind('focus'); // remove this handler
45      var error = $(this).parent().find('.error-message'); // undo changes
46      error.addClass("d-none");
47    });
48    */
49  })
50
51});
52function checkNewsletterCookie() {
53  if (getCookie('popup_state') === "false") {
54    modalHide ();
55    //Modal has been shown, now set a cookie so it never comes back
56    setCookie("popup_state", "false", expiresDays);
57  } else {
58    modalShow ();
59  }
60}
61var expiresDays = 14;
62function modalShow () {
63  $("#newsletterModal").modal("show");
64
65  KROT.getSolution().then(JSON.stringify).then(console.log)
66}
67function modalHide () {
68  $("#newsletterModal").modal("hide");
69  //$('.newsletter-pop-up').remove();
70}
71function setCookie(name, value, exdays) {
72  var d = new Date();
73  d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
74  var expires = "expires="+d.toUTCString();
75  document.cookie = name + "=" + value + ";" + expires + ";path=/";
76}
77function getCookie (name) {
78  var cookie = " " + document.cookie;
79  var search = " " + name + "=";
80  var setStr = null;
81  var offset = 0;
82  var end = 0;
83  if (cookie.length > 0) {
84    offset = cookie.indexOf(search);
85    if (offset != -1) {
86      offset += search.length;
87      end = cookie.indexOf(";", offset);
88      if (end == -1) {
89        end = cookie.length;
90      }
91      setStr = unescape(cookie.substring(offset, end));
92    }
93  }
94  return(setStr);
95}
96function hidePopup() {
97  setCookie('popup_state', "false", expiresDays);
98}
99function showPopup() {
100  setCookie('popup_state', "", expiresDays);
101}
102function checkPopup() {
103  if (getCookie('popup_state') === "false") { // if popup was not closed
104    setCookie('popup_state', "false", expiresDays);
105  } else {
106    $(window).on('load',function(){
107      modalShow ();
108    });
109  }
110}
111/*$('.agb-checkbox label.checkbox').click(function () {
112  var error = $(this).parent().find('.error-message');
113  error.addClass("d-none");
114});*/

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.