PageSourceSearch

https://agendapro.com/blog/wp-content/themes/AgendaProBlog/assets/js/scripts.js?ver=1.1.57

js agendapro.com collected 2026-09-24 10:08:18 UTC 7,219 bytes, 181 lines download raw bytes

1jQuery(document).ready(function($) {
2
3    // progressbar 
4      $(window).scroll(function() {
5        var scroll = $(this).scrollTop();
6
7        var height = $(document).height() - $(window).height();
8        var percentage = (scroll / height) * 100;
9        $('#progressBar').width(percentage + '%');
10      });
11
12
13      // logica scrollspy
14      if ($('#scrollspy').length) {
15
16        var headers = $('.entry-content').find('h2');
17        var scrollspyMenu = $('#scrollspy');
18        headers.each(function(index) {
19            var headerId = 'scrollspy-header-' + index;
20            var headerText = $(this).text();
21            var listItem = $('<a class="list-group-item list-group-item-action" href="#' + headerId + '">' + headerText + '</a>');
22            scrollspyMenu.append(listItem);
23            $(this).attr('id', headerId); 
24        });
25
26        $('#scrollspy').append(scrollspyMenu);
27
28        $('body').scrollspy({ target: '#scrollspy' });
29
30        $(window).on('activate.bs.scrollspy', function() {
31            var activeSection = $('#scrollspy .active').attr('href');
32            headers.removeClass('active-header');
33            if (activeSection) {
34                $(activeSection).addClass('active-header');
35            }
36        });
37    }
38      // fin scrollspy
39      
40      // backtoTop
41      $(window).scroll(function() {
42
43        if ($(this).scrollTop() > 0) {
44            $('#back-top').removeClass('btn-hide');
45        } else {
46            $('#back-top').addClass('btn-hide');
47        }
48    });
49
50    $('#back-top').on('click', function() {
51        $('html, body').animate({ scrollTop: 0 }, 'slow');
52    });
53
54
55    const navOffCanvasBtn = document.querySelectorAll(".offcanvas-nav-btn");
56    const navOffCanvas = document.querySelector('.navbar:not(.navbar-clone) .offcanvas-nav');
57    const bsOffCanvas = new bootstrap.Offcanvas(navOffCanvas, {scroll: true});
58    const scrollLink = document.querySelectorAll('.onepage .navbar li a.scroll');
59    const searchOffcanvas = document.getElementById('offcanvas-search');
60    navOffCanvasBtn.forEach(e => {
61        e.addEventListener('click', event => {
62        bsOffCanvas.show();
63        })
64    });
65
66    // modal popup
67  if(document.getElementById("ModalPopUp")) {
68    var ModalPopup = new bootstrap.Modal(document.getElementById("ModalPopUp"), {});
69
70    setTimeout(() => {
71      ModalPopup.show();
72    }, 3000);
73  } 
74
75  // sticky bottom nav 
76
77if($('.sticky-bottom-nav').length > 0) {
78  $('#close-sticky-nav').on('click', function(){
79    $('.sticky-bottom-nav').addClass('hidden');
80  })
81}
82
83});
84
85(function($){
86  if (typeof acf !== 'undefined' && acf !== null) {
87    acf.add_filter('color_picker_args', function(args, field) {
88      args.palettes = ['#812df2', '#0989E9', '#FB23C3', '#FF7A59', '#CA9956', '#fff', '#000'];
89      return args;
90    });
91  }
92})(jQuery);
93
94// mix panel
95
96(function (f, b) { if (!b.__SV) { var e, g, i, h; window.mixpanel = b; b._i = []; b.init = function (e, f, c) { function g(a, d) { var b = d.split("."); 2 == b.length && ((a = a[b[0]]), (d = b[1])); a[d] = function () { a.push([d].concat(Array.prototype.slice.call(arguments, 0))); }; } var a = b; "undefined" !== typeof c ? (a = b[c] = []) : (c = "mixpanel"); a.people = a.people || []; a.toString = function (a) { var d = "mixpanel"; "mixpanel" !== c && (d += "." + c); a || (d += " (stub)"); return d; }; a.people.toString = function () { return a.toString(1) + ".people (stub)"; }; i = "disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove".split( " "); for (h = 0; h < i.length; h++) g(a, i[h]); var j = "set set_once union unset remove delete".split(" "); a.get_group = function () { function b(c) { d[c] = function () { call2_args = arguments; call2 = [c].concat(Array.prototype.slice.call(call2_args, 0)); a.push([e, call2]); }; } for ( var d = {}, e = ["get_group"].concat( Array.prototype.slice.call(arguments, 0)), c = 0; c < j.length; c++) b(j[c]); return d; }; b._i.push([e, f, c]); }; b.__SV = 1.2; e = f.createElement("script"); e.type = "text/javascript"; e.async = !0; e.src = "undefined" !== typeof MIXPANEL_CUSTOM_LIB_URL ? MIXPANEL_CUSTOM_LIB_URL : "file:" === f.location.protocol && "//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//) ? "https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js" : "//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js"; g = f.getElementsByTagName("script")[0]; g.parentNode.insertBefore(e, g); } })(document, window.mixpanel || []);
97
98mixpanel.init("c8cedd25b946ef07c5f7efed97d03480", {
99  persistence: "localStorage",
100  track_pageview: false,
101  loaded: function(mixpanel) {
102      distinct_id = mixpanel.get_distinct_id();
103      cookie_distinct_id = getCookie('ap_mp_distinct_id');
104      if (cookie_distinct_id) {
105          if (cookie_distinct_id.includes('$device:')) {
106              mixpanel.register({
107                  "distinct_id": cookie_distinct_id,
108                  "$device_id": cookie_distinct_id.replace('$device:', '')
109              });
110          }else{
111              mixpanel.register({
112                  "distinct_id": cookie_distinct_id
113              });
114          }
115      }else{
116          setCookie('ap_mp_distinct_id', distinct_id, 365, '.' + getCleanDomain());
117      }
118      mixpanel.track_pageview();
119  },
120});
121
122
123function getCleanDomain() {
124  // Get the current hostname
125  const host = window.location.hostname;
126
127  // Split the hostname by dots
128  const parts = host.split('.');
129
130  // If there are more than two parts (e.g., sub.domain.com), assume the last two are the main domain
131  if (parts.length > 2) {
132      return parts.slice(-2).join('.');
133  }
134  
135  // If there are only two parts (e.g., domain.com), return them as they are
136  return host;
137}
138
139function setCookie(name, value, days, domain) {
140  const date = new Date();
141  date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
142  const expires = 'expires=' + date.toUTCString();
143  const domainString = domain ? 'domain=' + domain + ';' : '';
144  document.cookie = name + '=' + value + ';' + expires + ';path=/;' + domainString;
145}
146
147function getCookie(name) {
148  // Split cookie string and get all individual name=value pairs in an array
149  var cookieArr = document.cookie.split(";");
150  
151  // Loop through the array elements
152  for(var i = 0; i < cookieArr.length; i++) {
153      var cookiePair = cookieArr[i].split("=");
154      
155      /* Removing whitespace at the beginning of the cookie name
156      and compare it with the given string */
157      if(name == cookiePair[0].trim()) {
158          // Decode the cookie value and return
159          return decodeURIComponent(cookiePair[1]);
160      }
161  }
162  
163  // Return null if not found
164  return null;
165}
166
167const btnSignup = document.querySelectorAll('.btn-signup');
168
169btnSignup.forEach(e => {
170    e.addEventListener('click', event => {
171    mixpanel.track('click_blog_pre_signup');
172  })
173});
174
175
176
177
178
179
180
181

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.