PageSourceSearch

https://www.coalicionporelevangelio.org/wp-content/themes/luther/js/modules/call-to-action.js?ver=1790717561

js coalicionporelevangelio.org collected 2026-10-02 03:11:57 UTC 8,098 bytes, 216 lines download raw bytes

1(function ($) {
2
3  $(document).ready(function () {
4    ArticleDrawerCTA();
5    // NewsletterDrawer();
6    //$(".container").NewsletterDrawerFun();
7    $(".site_wrapper").NewsletterDrawerFun();
8
9  });
10  $(window).on("load", function () {
11    HeaderCallToAction();
12  });
13
14  function HeaderCallToAction() {
15    if ($('body').hasClass('header_callout')) {
16      setTimeout(function () {
17        $('#header_callout_pushdown_spacer, .header_callout_pushdown').addClass('cta_show');
18        if ($(window).width() > 767) {
19          if ($('body').hasClass('home')) {
20            var $stick = $('.rightnow_section');
21            if (!$stick.hasClass('natural')) {
22              $('.rightnow_section').addClass('cta_show');
23            } else {
24              $stick.css('top', 0);
25            }
26          } else {
27            $('.rightnow_section').addClass('cta_show');
28          }
29        }
30        $('.header_wrapper, .natevents-header, .main_sidenav,.natevents_2019-header,.sticky_menu').addClass('cta_show');
31      }, 2000);
32      $('.header_callout_close').on('click', function (e) {
33        $('#header_callout_pushdown_spacer, .header_callout_pushdown').removeClass('cta_show');
34
35        if ($(window).width() > 767) {
36          $('.header_wrapper,.rightnow_section,.natevents-header,.main_sidenav,.natevents_2019-header,.sticky_menu').removeClass('cta_show');
37        } else {
38          $('.header_callout_pushdown').css('bottom', '-' + $('.header_callout_pushdown').height() + 'px')
39        }
40      });
41    }
42  };
43
44  function ArticleDrawerCTA() {
45
46    if ($('#article_drawer_cta').length > 0) {
47      var drawerCookieName = $('#article_drawer_cta').data('cookie-name');
48      var drawerCookieValue = $('#article_drawer_cta').data('cookie-value');
49      var drawerCookieDuration = parseInt($('#article_drawer_cta').data('cookie-duration'));
50      var drawerCookieAddEvent = $('#article_drawer_cta').data('cookie-add');
51      if (drawerCookieName == undefined) {
52        drawerCookieName = '';
53      }
54      var firstArticle = $('article.article:first');
55      var drawer = $('#article_drawer_cta');
56      var drawerTimer;
57      var drawerCookie;
58      if (Cookies != undefined) {
59        drawerCookie = Cookies.get(drawerCookieName);
60      }
61      $(window).on('scroll', function () {
62        if (drawer.length > 0) {
63          if (drawerCookieName.length <= 0 || drawerCookie == undefined) {
64            if ($(window).scrollTop() >= ($(firstArticle).height() / 2.5)) { // if scrolled within and half way down the first article
65
66              $(drawer).addClass('come_in'); //show the article drawer
67
68              drawerTimer = setTimeout(function () { //set the timer for the drawer to disapear
69                if (!$(drawer).hasClass('hovering')) {
70                  $(drawer).removeClass('come_in');
71                  drawer.length = 0;
72                }
73              }, 15000);
74            }
75          }
76        }
77      });
78
79      $(drawer).mouseover(function () { // if the drawer is hovered clear out the timer
80        clearTimeout(drawerTimer);
81        $(drawer).addClass('hovering');
82      });
83      $(drawer).mouseout(function () {
84        $(drawer).removeClass('hovering');
85        drawerTimer = setTimeout(function () {
86          if (!$(drawer).hasClass('hovering')) {
87            $(drawer).removeClass('come_in');
88            drawer.length = 0;
89          }
90        }, 8000);
91      });
92
93      $('.article_callout_drawer_close').on('click', function (e) {// remove drawer click
94        $(drawer).removeClass('come_in');
95        drawer.length = 0;
96      });
97      if (drawerCookieAddEvent == 'buttonClick' && drawerCookie == undefined) {
98        $('.article_callout_drawer .flat_btn').click(function () {
99          Cookies.set(drawerCookieName, drawerCookieValue, { expires: drawerCookieDuration, path: '/', domain: '.thegospelcoalition.org' });
100        });
101      }
102
103    }
104  }
105
106  $.fn.NewsletterDrawerFun = function () {
107    // var thisPage = $(this).find('article:first');//if has article ..mainly for infinite scroll
108    // if (thisPage.length == 0) {
109    //   thisPage = $(this).find('main > div');
110    // }
111    var NewsletterDrawer = $(this).find('.stay_up_to_date.newsletter_signup_form.is_drawer');
112
113    //if ($(NewsletterDrawer).length > 0 && $(thisPage).length > 0) {
114    if ($(NewsletterDrawer).length > 0) {
115
116      $(NewsletterDrawer).each(function (index, el) {
117        var drawerCookieName = $(this).data('cookie-name');
118        var drawerCookieValue = $(this).data('cookie-value');
119        var drawerCookieDuration = parseInt($(this).data('cookie-duration'));
120        var drawerCookieAddEvent = $(this).data('cookie-add');
121        var newsletterID = $(this).data('newsletter-id');
122
123
124        if (drawerCookieName == undefined) {
125          drawerCookieName = '';
126        }
127        var drawerCookie;
128        if (Cookies != undefined) {
129          drawerCookie = Cookies.get(drawerCookieName);
130        }
131        //var thisArticle = $(this).closest('article.article');
132        //var thisArticle = $(this).closest('article');
133
134        var drawer = $(NewsletterDrawer);
135        var drawerTimer;
136        $(drawer).hide();
137        if (drawer.length > 0) {
138          setTimeout(function () {
139            if (!$(drawer).hasClass('come_in')) {
140              $(drawer).appendTo(document.body).show(1100).addClass('come_in');
141            }
142          }, 2000);
143        }
144        // $(window).on('scroll', function () {
145        //   if (drawer.length > 0) {
146        //     var winTop = $(window).scrollTop();
147        //     var artH = $(thisPage).height();
148        //     var hT = $(thisPage).offset().top;
149
150        //     if (drawerCookieName.length <= 0 || drawerCookie == undefined) {
151        //       if (winTop >= (artH / 2.5) + hT) { // if scrolled within and half way down the article
152        //         //show the article drawer
153        //         if (!$(drawer).hasClass('come_in')) {
154        //           $(drawer).appendTo(document.body).show(1100).addClass('come_in');
155        //         }
156        //         //drawerTimer = setTimeout(function () { //set the timer for the drawer to disapear
157        //         //  if (!$(drawer).hasClass('hovering')) {
158        //         //    $(drawer).removeClass('come_in');
159        //         //    drawer.length = 0;
160        //         //  }
161        //         //}, 16000);
162        //       }
163        //     }
164        //   }
165        // });
166
167
168        //$(drawer).on('hover mouseover focus', function () { // if the drawer is hovered clear out the timer
169        //  clearTimeout(drawerTimer);
170        //  $('input.email', this).focus();
171        //  $(drawer).addClass('hovering');
172        //});
173        //$(drawer).mouseout(function () {
174        //  $(drawer).removeClass('hovering');
175        //  drawerTimer = setTimeout(function () {
176        //    if (!$(drawer).hasClass('hovering')) {
177        //      $(drawer).removeClass('come_in');
178        //      drawer.length = 0;
179        //    }
180        //  }, 8000);
181        //});
182
183        $('.newsletter_drawer_close', this).on('click', function (e) {// remove drawer click
184          $(drawer).removeClass('come_in');
185          setTimeout(function () {
186            $('.newsletter_signup_form.is_drawer[data-newsletter-id="' + newsletterID + '"]').css('display', 'none');
187          }, 1500);
188          drawer.length = 0;
189        });
190        if (drawerCookieAddEvent == 'buttonClick' && drawerCookie == undefined) {
191          $('input.button', this).on('click', function (e) {
192            Cookies.set(drawerCookieName, drawerCookieValue, { expires: drawerCookieDuration, path: '/', domain: '.thegospelcoalition.org' });
193          });
194        }
195
196      });
197
198    }
199  }
200
201  function debounce(func, wait, immediate) {
202    var timeout;
203    return function () {
204      var context = this, args = arguments;
205      var later = function () {
206        timeout = null;
207        if (!immediate) func.apply(context, args);
208      };
209      var callNow = immediate && !timeout;
210      clearTimeout(timeout);
211      timeout = setTimeout(later, wait);
212      if (callNow) func.apply(context, args);
213    };
214  };
215
216})(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.