PageSourceSearch

https://greencollar.com.au/wp-content/themes/greencollar-child-032026/assets/js/main.js?ver=1789628849

js greencollar.com.au collected 2026-09-25 20:30:29 UTC 10,123 bytes, 314 lines download raw bytes

1jQuery(document).ready(function($) {
2  
3  // Displays the slider for recent posts
4  $('.post-slider').owlCarousel({
5      loop:true,
6      margin: 30,
7      nav:true,
8      dots: false,
9      responsive:{
10          0:{
11              items:1
12          },
13          600:{
14              items:3
15          },
16          1000:{
17              items:4
18          }
19      }
20  })
21  
22  // Runs the slide up and down toggle on hover for image tiles
23  $(".large-img-tile").on({
24      mouseenter: function () {
25          $(this).find('.wpb_text_column').slideDown(200);
26          $(this).find('.nectar-button').slideDown(200);
27      },
28      mouseleave: function () {
29          $(this).find('.wpb_text_column').slideUp(200);
30          $(this).find('.nectar-button').slideUp(200);
31      }
32  });
33
34  // Runs the click and drag for horizontal scroll
35  var clicked = false, clickX;
36
37  $('.scroll-wrapper').on({
38      'mousemove': function(e) {
39          clicked && updateScrollPos(e, $(this));
40      },
41      'mousedown': function(e) {
42          e.preventDefault();        
43          clicked = true;
44          clickX = e.pageX;
45      },
46      'mouseup': function() {
47          clicked = false;
48          $('html').css('cursor', 'auto');
49      }
50  });
51
52  var updateScrollPos = function(e, curElement) {
53      $('html').css('cursor', 'grabbing');
54      $(curElement).scrollLeft($(curElement).scrollLeft() + (clickX - e.pageX), 8000);
55  }
56  
57  $('.share-btn').on('click', function(e) {
58    e.preventDefault();
59    $('#social-sharing-container').toggle("slide", { direction: "left" }, 500);
60  });
61  
62  // Function to redirect filter page to category page
63  $('#filter_by').on('change', function() {
64    window.location.href = $(this).val();
65  });
66  
67  // Function to redirect to sort page
68  $('#sort_by').on('change', function() {
69    var websiteUrl = 'https://' + window.location.hostname + window.location.pathname + '?sort_by='+$(this).val();
70    window.location.href = websiteUrl;
71  });
72  
73  // Function to redirect to taxonomy page
74  $('#location_filter').on('change', function() {
75    var websiteUrl = 'https://' + window.location.hostname + '/location/'+$(this).val();
76    window.location.href = websiteUrl;
77  });
78  
79  // Function to redirect to taxonomy page
80  $('#method_filter').on('change', function() {
81    var websiteUrl = 'https://' + window.location.hostname + '/method/'+$(this).val();
82    window.location.href = websiteUrl;
83  });
84
85  // Function to redirect to taxonomy page
86  $('#project_location_filter').on('change', function() {
87    var websiteUrl = 'https://' + window.location.hostname + $(this).val();
88    window.location.href = websiteUrl;
89  });
90  
91  // Function to redirect to taxonomy page
92  $('#event_date_filter').on('change', function() {
93    var websiteUrl = 'https://' + window.location.hostname + $(this).val();
94    window.location.href = websiteUrl;
95  });
96  
97  // Function to redirect to taxonomy page
98  $('#event_location_filter').on('change', function() {
99    var websiteUrl = 'https://' + window.location.hostname + $(this).val();
100    window.location.href = websiteUrl;
101  });
102  
103  // Function to redirect to taxonomy page
104  $('#project_method_filter').on('change', function() {
105    var websiteUrl = 'https://' + window.location.hostname + $(this).val();
106    window.location.href = websiteUrl;
107  });
108  // Function get get URL parameters
109  var getUrlParameter = function getUrlParameter(sParam) {
110      var sPageURL = window.location.search.substring(1),
111          sURLVariables = sPageURL.split('&'),
112          sParameterName,
113          i;
114
115      for (i = 0; i < sURLVariables.length; i++) {
116          sParameterName = sURLVariables[i].split('=');
117
118          if (sParameterName[0] === sParam) {
119              return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
120          }
121      }
122      return false;
123  };
124  
125  // Function to set the chosen sort on post page
126  var sort_by = getUrlParameter('sort_by');
127  if (sort_by != '') {
128    var selectedID = '#sort_by option[value='+sort_by+']';
129    $(selectedID).attr('selected','selected');
130  }
131  
132  // Function to close the team profile block
133  $('.mobile-close').on('click', function(e) {
134    e.preventDefault();
135    var bioID = $(this).attr('data-ref');
136    $(bioID).slideToggle(500);
137  });
138  
139  // AJAX function to display team bio
140  $(".team-member").on("click", function (e) {
141      e.preventDefault();
142      // Class Toggles
143      $(".team-member").removeClass("active");
144      $(this).addClass("active");
145      $(".single-bio").hide();
146                           
147      var postID = $(this).attr("data-id");
148      var singlebioID = "#"+$(this).attr("data-bio");
149      $(singlebioID).slideToggle(500);
150      
151      $.ajax({
152          type: "POST",
153          url: "https://greencollar.com.au/wp-admin/admin-ajax.php",
154          data: {
155              "post_id": postID,
156              "action": "get_member_data" 
157          }, success: function (result) {
158
159             $(singlebioID).find(".image-profile .profile-img").css("background-image", "url("+result.featured_image+")");
160             
161             // Member info
162             $(singlebioID).find(".member-name").html(result.member_name);
163             $(singlebioID).find(".position").html(result.position_title);
164             $(singlebioID).find(".member-description").html(result.member_description);
165            
166            // Icon Logic to show/hide
167             if (result.linkedin_url != "") {
168               $(singlebioID).find(".linkedin-icon").show();
169               $(singlebioID).find(".linkedin-icon").attr("href", result.linkedin_url);
170             } else {
171               $(singlebioID).find(".linkedin-icon").hide();
172             }
173             if (result.email_address != "") {
174               $(singlebioID).find(".email-icon").show();
175               $(singlebioID).find(".email-icon").attr("href", "mailto:"+result.email_address);
176             } else {
177               $(singlebioID).find(".email-icon").hide();
178             }
179             
180          },
181          error: function () {
182              alert("error");
183          }
184      });
185
186  });
187  
188  // Function to toggle between the timelines accordions
189  $('.milestone-title').on('click', function(e) {
190    e.preventDefault();
191    
192    // Removes all active status
193    $('.milestone-title').each(function() {
194      $(this).removeClass('active');
195    });
196    
197    // Add active status
198    $(this).addClass('active');
199    
200    var contentID = $(this).attr('data-ref');
201    $('.show-block').removeClass('show-block');
202    $(contentID).addClass('show-block');
203    
204    
205  });
206  
207  // Function to toggle the active year
208  $('.timeline-sidebar li').on('click', function(e) {
209    e.preventDefault();
210    $('.timeline-sidebar li').each(function() {
211      $(this).removeClass('active');
212    });
213    
214    $(this).addClass('active');
215    
216  });
217  
218  // Function to toggle the active year
219  $('.timeline-sidebar li span').on('click', function(e) {
220    e.preventDefault();
221    
222    var elementID = $(this).attr('data-ref');
223    
224    $([document.documentElement, document.body]).animate({
225        scrollTop: $(elementID).offset().top - 150
226    }, 1000);
227    
228    console.log(elementID);
229    
230  });
231  
232  // Function to stick the sidebar for milestone to top of page after scrolling past
233  $(window).scroll(function(e){ 
234    
235    if ($(document).hasClass('.timeline-row')) {
236    
237      var topofTimeline = $(".timeline-row").offset().top;
238      var topofContent = $(".scrolling-tab-content").offset().top;
239      var height = $(".scrolling-tab-content").outerHeight() - 350;
240      
241      // Only activate on desktop
242      if ($(window).width() > 1100) {
243        
244        if ($(window).scrollTop() > topofTimeline && $(window).scrollTop() < (topofContent + height) ) {
245          $(".timeline-row").addClass('fixed');
246        } else {
247          $(".timeline-row").removeClass('fixed');
248        }
249      
250      }
251      
252    }
253  });
254  
255  
256  // AJAX function to display event pop up information
257  $(".event-tile").on("click", function (e) {
258      e.preventDefault();
259
260      var postID = $(this).attr("data-id");
261      
262      $.ajax({
263          type: "POST",
264          url: ajaxurl,
265          data: {
266              "post_id": postID,
267              "action": "get_single_event" 
268          }, 
269          success: function (result) {
270            
271            var data = $.parseJSON(result);
272            var mainContent = '<h5>'+data["post_title"]+'</h5>'+data["event_description"];
273            var btns = "";
274            
275            if (data["ticket_url"] != "") {
276              btns += '<a href="'+ data["ticket_url"] +'" target="_blank" class="ticket-btn">'+ data["ticket_label"] +'</a>';
277            }
278            
279            if (data["permalink"] != "") {
280              btns += '<a href="'+ data["permalink"] +'" class="readmore-btn">Read More</a>';
281            }
282            
283            console.log(result);
284            
285            $('.event-image-block').css('background-image', 'url("'+data["feature_image"]+'")');
286            $('.event-type').html(data["event_type"]);
287            $('.location-block').html(data["location"]);
288            $('.date-block').html(data["event_date"]);
289            $('.content-block').html(mainContent);
290            $('.event-cta-area').html(btns);
291            
292            if (data["speakers"] == "") {
293              $('.speaker-label').hide();
294            } else {
295              $('.speaker-label').show();
296            }
297            
298            $('#speakers').html(data["speakers"]);
299            
300            $('#event-popup').fadeIn(200);
301          },
302          error: function () {
303              alert("error");
304          }
305      });
306      
307  });
308  
309  $('#close-popup').on("click", function(e) {
310    e.preventDefault();
311    $('#event-popup').fadeOut(300);
312  });
313  
314});

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.