PageSourceSearch

http://gastrogirl.com/wp-content/themes/bracket-breadforthecity/js/scripts.js?ver=1.0.1

js gastrogirl.com collected 2026-10-02 15:03:22 UTC 10,260 bytes, 351 lines download raw bytes

1jQuery.noConflict();
2jQuery(document).ready(function ($) {
3
4    jQuery(".select-action").click(function() {
5      jQuery(this).toggleClass('active');
6      jQuery(".hero--inner__cta .inner-list").toggleClass('active');
7    });
8
9    setInterval(function() {
10      jQuery(".donate--button").toggleClass('donate--animated');
11    }, 5000);
12
13    jQuery('.scroll--to--menu a').on('click', function(event){
14      let thispageurl = window.location.href.split('#')[0];
15      let id = jQuery(this).attr("href").split('#')[0];
16        if (id === thispageurl) {
17          event.preventDefault();
18          jQuery('html,body').animate({scrollTop:jQuery(this.hash).offset().top - 120}, 500);
19        }
20    });
21
22    jQuery(".scroll--to").on('click', function(e){
23      e.preventDefault();
24      let id = jQuery(this).attr("data-target");
25      let offset = 120;
26      let target = jQuery(id).offset().top - offset;
27      jQuery('html, body').animate({scrollTop:target}, 500);
28  });
29
30    jQuery(".site--header__hamburger").on('click', function(event){
31        event.preventDefault();
32        jQuery(this).toggleClass('is-active');
33        jQuery('.site--header__content--menu').toggleClass('is-active');
34    });   
35    
36    jQuery(".nav-menu > .menu-item").on('click', function(event){
37        //event.preventDefault();
38        event.stopPropagation();
39        if(jQuery(this).hasClass('is-open')){
40          jQuery(this).removeClass('is-open');
41        }else{
42          jQuery(".sub-menu .menu-item").removeClass('is-open');
43          jQuery(".nav-menu > .menu-item").not(jQuery(this)).removeClass('is-open');
44          jQuery(this).addClass('is-open');
45        }
46    }); 
47
48    jQuery(".sub-menu > .menu-item").on('click', function(event){
49      //event.preventDefault();
50      event.stopPropagation();
51      jQuery(".sub-menu .menu-item").not(jQuery(this)).removeClass('is-open');
52      jQuery(this).addClass('is-open');
53    }); 
54
55    jQuery('.search-btn').on('click',function(e){
56      e.preventDefault();
57      jQuery('.site--header__main-actions').addClass('open');
58      setTimeout(function () {
59        jQuery('.site--header__main-actions input').focus();
60      },300);
61    });
62
63    jQuery('body').on('click', function (e) {
64      if ( $(e.target).closest('.site--header__main-actions').length == 0 ){
65        jQuery('.site--header__main-actions').removeClass('open');
66      }
67    })
68
69    let parentElement = jQuery('.category--cards__search-select-box');
70    jQuery('.category--cards__search-select').select2({
71      dropdownParent: parentElement,
72      minimumResultsForSearch: -1,
73    });
74
75    jQuery(".close--popup").on('click', function(event){
76        event.preventDefault();
77        jQuery('.carousel__button').click();
78    }); 
79    
80    jQuery(".paste--action").on('click', function(event){
81      copyToClipboard(event);
82
83      let message = jQuery(this).parent('div').find('span');
84      message.addClass('active');
85      setTimeout(function() { 
86        message.removeClass('active');
87      }, 2000);
88    }); 
89
90    jQuery(".share-button").on('click', function(event){
91      $(this).addClass('share-active');
92      var link = $(this).attr('data-link');
93      link = link.replaceAll("'", '');
94      var tempInput = document.createElement("input");
95      tempInput.style = "position: absolute; left: -1000px; top: -1000px";
96      tempInput.value = link;
97      $(this).append(tempInput);
98      tempInput.select()
99      document.execCommand('copy');
100      tempInput.remove();
101      
102      // show message indicating successful copy operation, for 5 seconds
103      $('.share-link-modal').show();
104      setTimeout(function(){
105          $('.share-link-modal').hide()
106      },5000);
107  }); 
108
109    jQuery('#placement_donation').on('change', function(){
110        let form_url = jQuery(this).val();
111        jQuery('#find_more').attr('href', form_url);
112    });
113
114    jQuery( ".back--top" ).on('click', function(e) {
115      e.preventDefault();
116      jQuery('html, body').animate({scrollTop:0}, '1000');
117    });
118
119    jQuery( ".modal--link a" ).each(function() {
120      if(jQuery(this).attr('href') === '#') { 
121          let id_add = jQuery(this).parents('.modal--link').find('.modal--content').attr('id');
122          jQuery(this).attr('data-fancybox', id_add);
123          jQuery(this).attr('data-src', '#'+id_add);
124      }
125    });
126
127    var
128    w       = 590,
129    h       = 405,
130    l       = (screen.availWidth - w) / 2,
131    t       = (screen.availHeight - h) / 2,
132    popPage = '.listen-modal';
133  
134    $(document).on('click',popPage,function(event){
135      window.open(this.href,"window","width= "+ w + ",height=" + h + ",left=" + l + ",top=" + t + ", scrollbars = yes, location = no, toolbar = no, menubar = no, status = no");
136       return false;
137    });
138
139    var maskedPhones = document.querySelectorAll('.gfield .ginput_container_phone input');
140
141    for (i = 0; i < maskedPhones.length; ++i) {
142      maskedPhones[i].addEventListener('mouseup', function(e) {
143        if ( e.currentTarget.value.replace(/\(|\)|_|-|\./g,'').trim() == '' ) { e.currentTarget.setSelectionRange(0,0); }
144      });
145    }
146
147    let input = document.querySelector('.slider--home__search-input');
148    let root  = document.documentElement.style;
149
150    if (jQuery('.slider--home__search-input').length > 0) {
151      /* on input event auto resize the field */
152      input.addEventListener('input', function() {
153        root.setProperty('--size', this.value.length )
154      });
155
156      /* resize the field if it is pre-populated */
157      document.addEventListener("DOMContentLoaded", function() {
158        root.setProperty('--size', input.value.length )
159      });
160
161      input.addEventListener('click', function(){
162        input.placeholder = '';
163      });
164
165      input.addEventListener('blur', function(){
166        input.placeholder = input.value === '' ? 'Search Gastro Girl':'';
167      });
168    }
169
170    jQuery('.related-posts').slick({
171      infinite: false,
172      slidesToShow: 3,
173      slidesToScroll: 1,
174      autoplay: false,
175      arrows: true,
176      prevArrow: "<button type='button' class='slider--prev'></button>",
177      nextArrow: "<button type='button' class='slider--next'></button>",
178      responsive: [
179          {
180            breakpoint: 1025,
181            settings: {
182              slidesToShow: 2,
183            }
184          },
185          {
186            breakpoint: 640,
187            settings: {
188              slidesToShow: 1,
189            }
190          }
191      ]
192  });
193
194    AOS.init({
195      once: true,
196    });
197
198    jQuery('.js-copyaddress').on('click', function (e) {
199      e.preventDefault();
200      isCopied = copyTextToClipboard( jQuery(this).data('address'), 'The address was copied to the clipboard' ) ;
201      
202    });
203    
204    var hash= window.location.hash
205
206    if ( hash == '' || hash == '#' || hash == undefined ) return false;
207    
208          
209    var target = jQuery(hash);
210  
211    headerHeight = 110;
212    
213    target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']');
214    
215    if (target.length) {
216      jQuery('html,body').scrollTop(0);
217      setTimeout(function() { 
218        jQuery('html,body').stop().animate({
219          scrollTop: target.offset().top - 110 //offsets for fixed header
220        }, 'linear');
221      }, 2500);      
222    }
223    
224});
225
226jQuery(window).on('load', function() {
227
228  jQuery('body').addClass('loaded');
229  arrowSlider();
230});
231
232jQuery(window).on('resize', function(){
233  arrowSlider();
234});
235
236jQuery(window).scroll(function() {
237  let scroll = jQuery(window).scrollTop();
238  if (scroll >= 60) {
239      jQuery('#masthead').addClass("shadow");
240  } else {
241      jQuery('#masthead').removeClass("shadow");
242  }
243});
244
245function arrowSlider () {
246  let top_arrow = jQuery('.slider--syncing__grid .box--slider__image').height() + 75;
247  jQuery('.slider--syncing .slick-arrow').css('top', top_arrow)
248}
249
250function animation() {
251	jQuery('[data-aos]').each(function(){
252		jQuery(this).addClass('aos-init');
253		if (isInViewport(jQuery(this))) {
254			jQuery(this).addClass('aos-animate');
255		}
256	});
257	window.addEventListener('scroll', function (event) {
258		jQuery('[data-aos]').each(function(){
259			if (isInViewport(jQuery(this))) {
260				jQuery(this).addClass('aos-animate');
261			}
262		});
263	}, false);
264}
265
266function isInViewport (el) {
267  let elementTop = (el.offset() !== undefined) && el.offset().top;
268	let viewportTop = jQuery(window).scrollTop();
269	let viewportBottom = viewportTop + jQuery(window).height();
270	
271	return elementTop < viewportBottom;
272}
273
274function copyToClipboard(e) {
275  let
276    t = e.target, 
277    c = t.dataset.copytarget,
278    inp = (c ? document.querySelector(c) : null);
279
280  if (inp && inp.select) {
281    inp.select();
282    try {
283      
284      document.execCommand( 'copy' );
285      inp.blur();
286    } catch (err) {
287      
288      alert('please press Ctrl/Cmd+C to copy');
289    }
290
291  }
292
293}
294
295function fallbackCopyTextToClipboard(text) {
296  var textArea = document.createElement("textarea");
297  textArea.value = text;
298  
299  // Avoid scrolling to bottom
300  textArea.style.top = "0";
301  textArea.style.left = "0";
302  textArea.style.position = "fixed";
303
304  document.body.appendChild(textArea);
305  textArea.focus();
306  textArea.select();
307
308  try {
309    var successful = document.execCommand('copy');
310    var msg = successful ? 'successful' : 'unsuccessful';
311    //console.log('Fallback: Copying text command was ' + msg);
312    return 1;
313  } catch (err) {
314    //console.error('Fallback: Oops, unable to copy', err);
315    return ;
316  }
317
318  document.body.removeChild(textArea);
319}
320
321function copyTextToClipboard(text, message) {
322  if (!navigator.clipboard) {
323    fallbackCopyTextToClipboard(text);
324    return;
325  }
326  window.iscopied = false;
327  navigator.clipboard.writeText(text).then(function() {
328    console.log('Async: Copying to clipboard was successful!');
329    alert(message);
330  }, function(err) {
331    console.error('Async: Could not copy text: ', err);
332    alert( 'There was an error copying the text' );
333  });
334}
335
336// target blank for external links
337window.onload = () => {
338  const links = document.querySelectorAll('a');
339  const currentDomain = window.location.hostname;
340
341  if(links){
342    links.forEach(link => {
343      if(link.href) {
344        const linkDomain = new URL(link.href).hostname;
345        if (linkDomain !== currentDomain) {
346          link.setAttribute('target', '_blank');
347        }
348      }
349    });
350  }
351};

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.