PageSourceSearch

https://shopping-raststaette.ch/wp-content/themes/zillion/js/custom.js?ver=1.0.0466833882

js shopping-raststaette.ch collected 2026-10-09 22:28:35 UTC 38,071 bytes, 1,108 lines download raw bytes

1// const { FALSE } = require("node-sass");
2
3jQuery(document).ready(function ($) {
4
5  //Remove title attr
6  $('img.wp-post-image, img').removeAttr('title');
7
8  /* humbergur */
9  $('.humbergur__menu').click(function (e) {
10
11    $(this).toggleClass('active');
12    $('html').toggleClass('overlay_bg');
13  });
14
15
16  $('a[href="#unser_angebot"]').click(function (e) {
17    $('#w_bus_textid').addClass('w_bus_text_active');
18    $('#unser_angebot').addClass('active_unser_angebot');
19    $('.click_box').addClass('active_box');
20
21  });
22
23  
24  $(window).on("resize", function (e) {
25    checkScreenSize();
26  });
27  checkScreenSize(); 
28  function checkScreenSize(){
29      var newWindowWidth = $(window).width();
30      // 767 > 580
31      if (newWindowWidth > 580) {
32        $('.dev_mobile_service').removeClass('mobile_Service');
33      }else{
34        $('.dev_mobile_service').addClass('mobile_Service');
35      }
36  }
37
38  $('body').on('click','.dev_mobile_service a', function(e){
39    $('nav#site-navigation button.menu-toggle').trigger('click');
40    //$('a.head_service_icon').trigger('click');
41  });
42
43
44  // 	mobile brands
45
46  // Initially hide all brand content wraps except the expanded one
47  $('.combo_bdata .brand_content_wrap').hide();
48  $('.combo_bdata .brand_content_wrap.active').show();
49  var clickCount = 0;
50  var $items = $('.brands_grid_item');
51  $items.each(function () {
52    var $item = $(this);
53    var $details = $($item.find('.brand_logo_wrap a').attr('href'));
54    $item.click(function () {
55      var isActive = $item.hasClass('expanded');
56      $items.removeClass('expanded');
57      $items.not(this).toggleClass('inactive', !isActive);
58      $details.filter('.open').removeClass('open').slideUp(500).promise().done(function () {
59        $details.hide();
60        if (!isActive) {
61          $('.brands_grid_item').removeClass('open');
62          $('.brand_content_wrap ').hide();
63          window.location.hash = $details;
64          var offset = $('#masthead').height() + 130;
65          $("html, body").animate({ scrollTop: $item.offset().top - offset }, 300);
66          $item.removeClass('inactive').addClass('expanded');
67          $details.slideDown(500)
68            .promise()
69            .done(function () {
70              $(this).addClass('open');
71            });
72        }
73      });
74    });
75  });
76
77
78  // Close if clicked outside the .brands_grid_wrap
79  $(document).on('click', function (e) {
80    if (!$(e.target).closest('.brands_grid_wrap').length) {
81      $('.combo_bdata .brand_content_wrap').removeClass('active').slideUp();
82      $('.brands_grid_item').removeClass('expanded');
83    }
84  });
85
86 
87  // preoader 
88  preloaderFadeOutTime = 2000;
89  function fadePreloader() {
90    var preloader = $('#preloader');
91    preloader.fadeOut(preloaderFadeOutTime);
92  }
93  fadePreloader();
94
95  //for sticky bar
96  function header_sticky() {
97    var scroll = $(window).scrollTop();
98    if (scroll >= 50) {
99      $(".site-header").addClass("sticky");
100      
101    } else {
102      $(".site-header").removeClass("sticky");
103      
104    }
105  }
106  header_sticky();
107  $(window).scroll(header_sticky);
108
109  function header_bar() {
110    var scroll = $(window).scrollTop();
111    var screenWidth = $(window).width();
112
113    if (screenWidth >= 992) { // Desktop (992px and above)
114      if (scroll >= 750) {
115        $(".navigations").addClass("sticky_bar");
116        $("body.home").addClass("body_sticky_bar_cls");
117      } else {
118        $(".navigations").removeClass("sticky_bar");
119        $("body.home").removeClass("body_sticky_bar_cls");
120      }
121    } else if (screenWidth >= 768 && screenWidth <= 991) { // Tablet (768px to 991px)
122      if (scroll >= 400) {
123        $(".navigations").addClass("sticky_bar");
124        $("body.home").addClass("body_sticky_bar_cls");
125      } else {
126        $(".navigations").removeClass("sticky_bar");
127        $("body.home").removeClass("body_sticky_bar_cls");
128      }
129    } else if (screenWidth >= 576 && screenWidth <= 767) { // Large Mobile (576px to 767px)
130      if (scroll >= 400) {
131        $(".navigations").addClass("sticky_bar");
132        $("body.home").addClass("body_sticky_bar_cls");
133      } else {
134        $(".navigations").removeClass("sticky_bar");
135        $("body.home").removeClass("body_sticky_bar_cls");
136      }
137    } else if (screenWidth <= 575) { // Small Mobile (575px and below)
138      if (scroll >= 400) {
139        $(".navigations").addClass("sticky_bar");
140        $("body.home").addClass("body_sticky_bar_cls");
141      } else {
142        $(".navigations").removeClass("sticky_bar");
143        $("body.home").removeClass("body_sticky_bar_cls");
144      }
145    }
146  }
147
148  header_bar(); // Call the function on page load
149  $(window).scroll(header_bar); // Call the function on scroll
150  $(window).resize(header_bar); // Call the function on window resize
151 
152  //Dynamic Padding
153  function my_dynPad() {
154    const $container = $(".container");
155    const marLeft = parseInt($container.css("margin-left"), 10);
156    const padLeft = parseInt($container.css("padding-left"), 10);
157
158    if (!isNaN(marLeft) && !isNaN(padLeft)) {
159      const dynSpace = (marLeft + padLeft) + "px";
160      $(".dynamic_left").css("padding-left", dynSpace);
161      $(".dynamic_right").css("padding-right", dynSpace);
162    }
163  }
164  my_dynPad();
165  $(window).resize(my_dynPad);
166
167
168  function get_container_width() {
169    const container = $(".home_banner .container").width();
170    jQuery('.home_banner .slider_popup').css('width', container+'px');
171  }
172  get_container_width();
173  jQuery(window).resize(get_container_width);
174    
175
176  //http://www.zillionera.com
177
178  //Animation WOW
179  var wow = new WOW({
180    boxClass: 'wow',      // animated element css class (default is wow)
181    animateClass: 'animated', // animation css class (default is animated)
182    offset: 0,          // distance to the element when triggering the animation (default is 0)
183    mobile: true,       // trigger animations on mobile devices (default is true)
184    live: true,       // act on asynchronously loaded content (default is true)
185    callback: function (box) {
186      // the callback is fired every time an animation is started
187      // the argument that is passed in is the DOM node being animated
188    },
189    scrollContainer: null,    // optional scroll container selector, otherwise use window,
190    resetAnimation: true,     // reset animation on end (default is true)
191  }
192  );
193  wow.init();
194
195  /* Animation Attribute */
196  $('.data_delay_1').attr('data-wow-delay', '.1s');
197  $('.data_delay_3').attr('data-wow-delay', '.5s');
198  $('.data_delay_6').attr('data-wow-delay', '1s');
199  $('.data_delay_9').attr('data-wow-delay', '1.5s');
200  $('.data_delay_12').attr('data-wow-delay', '2s');
201  $('.data_delay_15').attr('data-wow-delay', '2.5s');
202
203  $('.data_duration_6').attr('data-wow-duration', '.6s');
204
205  // banner slider
206  $('.banner_slider').slick({
207    autoplay: true,
208    autoplaySpeed: 2500,
209    fade: true,
210    speed: 1000,
211    cssEase: 'linear',
212    arrows: false,
213    slidesToShow: 1,
214    slidesToScroll: 1,
215    dots: true,
216    useTransform: true,
217    responsive: [
218      {
219        breakpoint: 991,
220        settings: {
221          arrows: false,
222        },
223      }
224    ],
225  });
226
227  //Search Header
228  $('.searchtoggle_btn ').click(function () {
229    $('.full_width_search ').addClass('active');
230  });
231  $('.close_search_blk ').click(function () {
232    $('.full_width_search ').removeClass('active');
233  });
234 
235	// Add class 'tab-box_par' to the parent element of '.custom-tab-box'
236  $('.custom-tab-box').parent('.panel-grid').addClass('tab-box_par');
237
238  // Get the active tab
239  let activeTab = $('.tab-menu li a.active').attr('data-rel');
240  $("#" + activeTab).parent('.tab-box_par').addClass('make_act');
241
242  // Handle tab click event
243  $('.tab-menu li a, a.head_service_icon, .dev_mobile_service a').on('click', function (event) {
244    var targetElement = $(this).attr('href');
245
246    if( targetElement == '#service_section' ){
247      $('.clsoffcanvs').trigger('click');
248    }
249    
250    //console.log('targetElement = ' , targetElement);
251    var get_this_id = $(this).attr('id');
252
253    // Check if the clicked tab is already active
254    if ($('.tab-menu li a[href="'+targetElement+'"]').hasClass('active')) {
255      // Toggle content visibility for the active tab
256      setTimeout(function(){
257        $('.tab-menu li a[href="'+targetElement+'"]').removeClass('active');
258      }, 200);
259      
260      $('.tab-menu li a[href="'+targetElement+'"]').removeClass('inactive');
261      $(targetElement).parent('.tab-box_par').removeClass('make_act').hide();
262      //history.replaceState("", document.title, window.location.pathname + window.location.search);
263    } else {
264      // Deactivate all tabs
265      $('.tab-menu li a').removeClass('active').addClass('inactive');
266      // Activate the clicked tab
267      $('.tab-menu li a[href="'+targetElement+'"]').removeClass('inactive').addClass('active');
268      // Hide all tab content except the current active one without animation
269      $('.tab-box_par').not($(targetElement).parent('.tab-box_par')).removeClass('make_act').hide();
270      // Show the content related to the clicked tab with animation
271      $(targetElement).parent('.tab-box_par').addClass('make_act').show()
272        .promise()
273        .done(function () {
274          // Scroll to the tab content after it is fully visible
275          if( targetElement == '#service_section'){
276
277            var header_height = $('#masthead').height();
278            var navigations_height = $('.navigations').height();
279            var service_section_pdtop = parseInt($('#service_section').css('padding-top'));
280            var total_height = header_height + navigations_height + service_section_pdtop;
281            if ($('.navigations').hasClass('sticky_bar')) {
282              var total_height = total_height - 60;
283            } 
284
285            //console.log('Desktop total_height = ' , total_height);
286
287            var screenWidth = $(window).width();
288            if (screenWidth <= 767){
289              var total_height = header_height + navigations_height + service_section_pdtop + 50;
290              setTimeout(function(){
291                $('html, body').animate({ scrollTop: $('#service_section').offset().top - total_height }, 500); // Animation duration
292              }, 500);
293
294            }else{
295              $('html, body').animate({ scrollTop: $('#service_section').offset().top - total_height }, 500);
296            }
297          }else{
298            var header_height = $('#masthead').height();
299            var navigations_height = $('.navigations').height();
300            var total_height = header_height + navigations_height + 130;
301            if ($('.navigations').hasClass('sticky_bar')) {
302              var total_height = total_height - 60;
303            } 
304
305            if( get_this_id == 'open_w670623ec39310' ){
306              var total_height = total_height + 100;
307            }
308
309            var screenWidth = $(window).width();
310            if (screenWidth <= 767){
311              setTimeout(function(){
312                $('html, body').animate({ scrollTop: $('.tab-menu li a[href="'+targetElement+'"]').offset().top - 200 }, 500); // Animation duration
313              }, 500);
314            }else{
315              $('html, body').animate({ scrollTop: $('.tab-menu li a[href="'+targetElement+'"]').offset().top - total_height }, 300);
316            }
317          }
318        });
319    }
320  });
321
322  // Parking click: open Services first, then scroll to #parking-spaces
323  $('.menu_title_parking').on('click', function(e) {
324    e.preventDefault();
325
326    // Open Services tab
327    $('.tab-menu li a[href="#service_section"]').trigger('click');
328
329    // Delay to allow Services tab to render
330    setTimeout(function() {
331      var header_height = $('#masthead').height() || 0;
332      var nav_height = $('.navigations').height() || 0;
333      var total_height = header_height + nav_height + 30;
334
335      if ($('#parking-spaces').length) {
336        $('html, body').animate({
337          scrollTop: $('#parking-spaces').offset().top - total_height
338        }, 600);
339      }
340    }, 800);
341  });
342
343  
344
345  $('a.parking_target').on('click', function(e) {
346    e.preventDefault();
347
348    $('nav#site-navigation button.menu-toggle').trigger('click');
349
350    var screenWidth = $(window).width();
351    if (screenWidth <= 767){
352      $('li#menu-item-1490.target_a a').trigger('click');
353    }else{
354      $('li#menu-item-1380.target_a a').trigger('click');
355    }
356    
357  });
358
359  $('.target_a a, a.head_ladestationen_icon, .target_a_a').click(function () {
360
361
362    //var targetElement = '#e-ladestationen';
363    var targetElement = $(this).attr('href');
364
365    var get_this_id = $(this).attr('id');
366    $('.tab-menu li a').removeClass('active').addClass('inactive');
367    $('.tab-menu li a[href="'+targetElement+'"]').removeClass('inactive').addClass('active');
368    $('.tab-box_par').not($(targetElement).parent('.tab-box_par')).removeClass('make_act').hide();
369    $(targetElement).parent('.tab-box_par').addClass('make_act').show()
370      .promise()
371      .done(function () {
372        var header_height = $('#masthead').height() + parseInt($('#masthead').css('padding-top')) + parseInt($('#masthead').css('padding-bottom'));
373        var navigations_height = $('.navigations').height() + parseInt($('.navigations').css('padding-top')) + parseInt($('.navigations').css('padding-bottom'));
374        //var total_height = header_height + navigations_height + 130;
375        var targetElement_height = parseInt($('.tab-menu li a[href="'+targetElement+'"]').height());
376        var total_height = header_height + navigations_height + 17;
377        // if ($('.navigations').hasClass('sticky_bar')) {
378        //   var total_height = total_height + 60;
379        // } 
380
381        // console.log('header_height ------' , header_height);
382        // console.log('navigations_height ------' , navigations_height);
383        // console.log('targetElement_height ------' , targetElement_height);
384        // console.log('total_height ------' , total_height);
385
386        // if( get_this_id == 'open_w670623ec39310' ){
387        //   var total_height = total_height + 100;
388        // }
389        var screenWidth = $(window).width();
390        if (screenWidth <= 767){
391          setTimeout(function(){
392            $('html, body').animate({ scrollTop: $('.tab-menu li a[href="'+targetElement+'"]').offset().top - 200 }, 500); // Animation duration
393          }, 500);
394        }else{
395          setTimeout(function(){
396            $('html, body').animate({ scrollTop: $('.tab-menu li a[href="'+targetElement+'"]').offset().top - total_height }, 500);
397          }, 500);
398        }
399      });
400  });
401
402	
403  $('.target_a_a').click(function () {
404    $('#site-navigation').removeClass('toggled')
405    $('.humbergur__menu').removeClass('active');
406    $('.hamRotate').removeClass('active');
407  });
408
409  $(window).on('load', function() {
410    if (window.location.hash) {
411      var target = window.location.hash; 
412      var header_height = $('#masthead').height() || 0;
413      var navigations_height = $('.navigations:visible').height() || 0;
414
415      // Special case: Parking
416      if (target === '#parking-spaces') {
417        var total_height = header_height + navigations_height + 30;
418
419        // Open Services tab first
420        $('.tab-menu li a[href="#service_section"]').trigger('click');
421
422        // Delay to allow Services content to appear
423        setTimeout(function(){
424          if ($('#parking-spaces').length) {
425            $('html, body').animate({
426              scrollTop: $('#parking-spaces').offset().top - total_height
427            }, 600);
428          }
429        }, 800);
430      }
431      // Normal Service Section
432      else if (target === '#service_section') {
433        var service_section_pdtop = parseInt($('#service_section').css('padding-top'));
434        var total_height = header_height + navigations_height + service_section_pdtop - 20;
435        $('html, body').animate({ 
436          scrollTop: $('#service_section').offset().top - total_height 
437        }, 500);
438      }
439      // Fallback: any other hash target
440      else if ($(target).length) {
441        var total_height = header_height + navigations_height + 30;
442        setTimeout(function(){
443          $('html, body').animate({
444            scrollTop: $(target).offset().top - total_height
445          }, 500);
446        }, 500);
447      }
448    }
449  });
450 
451  $('.w_bus_btn a.sowb-button').click(function () {
452    var screenWidth = $(window).width();
453    if (screenWidth <= 767){
454      $('html, body').animate({ scrollTop: $('#unser_angebot').offset().top - 810 }, 500); // Animation duration
455    }
456  });
457
458
459  // Handle clicks outside the tab menu
460  $(document).on('click', function (event) {
461      if (!$(event.target).closest('.tab-menu, .tab-box_par').length) {
462          //$('.tab-menu li a').removeClass('active').removeClass('inactive');
463          //$('.tab-box_par').removeClass('make_act').slideUp(400, 'swing');
464      }
465  });
466
467  // Initialize a counter to ensure unique IDs for each section
468  let sectionCounter = 0;
469
470  $('.faq_sec').each(function () {
471    sectionCounter++;
472    let $btnWrapper = $(this).find('.toggle_btnwrapper');
473    let $imgWrapper = $(this).find('.toggle_img_wrapper');
474
475    // Assign unique IDs to each image in the image wrapper
476    $imgWrapper.find('.toggle_img').each(function (index) {
477      $(this).attr('id', 'toggle_img_' + sectionCounter + '_' + index);
478    });
479
480    // Assign data-rel attributes to each button in the button wrapper
481    $btnWrapper.find('.acc_item').each(function (index) {
482      $(this).addClass('ssasasas');
483      $(this).attr('data-rel', 'toggle_img_' + sectionCounter + '_' + index);
484    });
485  });
486
487  // Event handler for the accordion functionality
488  $('.faq_sec .acc_item').on('click', function () {
489    var target = $(this).attr('data-rel');
490
491    // Remove active class from all buttons and add to the clicked button
492    $(this).closest('.toggle_btnwrapper').find('.acc_item').removeClass('active_menu');
493    $(this).addClass('active_menu');
494
495    // Remove active class and hide all images, then show the targeted image
496    $(this).closest('.faq_sec').find('.toggle_img_wrapper .toggle_img').removeClass('make_act').hide();
497    $("#" + target).addClass('make_act').fadeIn('slow');
498    return false;
499  });
500
501  // Accordion functionality for the accordion items
502  $('.acc_item').on('click', function (e) {
503    e.stopPropagation();
504
505    // Slide up all items except the clicked one
506    $('.acc_item').not(this).removeClass('active').find('.toggle_item').slideUp(300);
507
508    // Toggle the clicked item
509    const toggle_item = $(this).find('.toggle_item');
510    toggle_item.slideToggle(300);
511    $(this).toggleClass('active');
512
513    // Update toggle button icon
514    $('.toggle-btn i').not($(this).find('.toggle-btn i')).removeClass('fa-minus').addClass('fa-plus');
515    $(this).find('.toggle-btn i').toggleClass('fa-plus fa-minus');
516  });
517
518  // Click outside to close all accordion items
519  $(document).on('click', function (e) {
520    if (!$(e.target).closest('.acc_item').length) {
521      $('.acc_item').removeClass('active').find('.toggle_item').slideUp(300);
522      $('.toggle-btn i').removeClass('fa-minus').addClass('fa-plus');
523    }
524  });
525
526  // brands tab 
527  // Make the first tab active by default
528  $('.brands_tab_menu li:first-child a').addClass('active_menu');
529  $('.brands_main_wrap .brands_tab_box:first-child').addClass('make_act').show();
530
531  // Handle tab click event
532  $('.brands_tab_menu li a').on('click', function () {
533      var target = $(this).attr('data-rel');
534
535      // Update the active_menu state for tab buttons
536      $(this).closest('.brands_tab_menu').find('li a').removeClass('active_menu');
537      $(this).addClass('active_menu');
538
539      // Update the make_act state for tab content
540      $('.brands_main_wrap').find('.brands_tab_box').removeClass('make_act').hide();
541      $("#" + target).addClass('make_act').fadeIn('slow');
542      return false;
543  });
544
545  // Optional: Handle the brand tab active state on click
546  $('#brands .tab_menu_item a').click(function () {
547      $('#brands').addClass('tab_active');
548  });
549  // brands tab 
550
551  $('.clsoffcanvs').click(function () {
552    $('#site-navigation').removeClass('toggled')
553    $('.humbergur__menu').removeClass('active');
554    $('.hamRotate').removeClass('active');
555  });
556
557
558  $(document).on('click', function (event) {
559    if (!$(event.target).closest('.offcanvs , .humbergur__menu').length) {
560      $('.humbergur__menu').removeClass('active');
561      $('.hamRotate').removeClass('active');
562    }
563  });
564
565
566  $('.contact_three_col').parent().addClass('prnt_contact_three_col')
567  $('.park_frm ').parent().addClass('prnt_park_frm ')
568
569  $('.payment_submitbtn').attr('disabled', true);
570  $('.prkfrmstp2').hide(); // Initially hide the second step
571
572  $('.openparkstp2_btn').click(function (event) {
573    event.preventDefault();
574    let allFilled = true;
575    $('.prkfrmstp1 .user_inputs').each(function () {
576      if ($(this).val() === '') {
577        allFilled = false;
578        return false; // Break out of the loop
579      }
580    });
581    if (allFilled) {
582      $('.prkfrmstp1').hide();
583      $('.prkfrmstp2').show();
584      $('.payment_submitbtn').removeAttr('disabled'); // Enable submit button
585    } else {
586      $('.err').text('Please fill out all fields');
587    }
588  });
589
590  $('.parkprevstep1').click(function (e) {
591    e.preventDefault();
592    $('.prkfrmstp1').show();
593    $('.prkfrmstp2').hide();
594  });
595
596  $('.payment_method option:nth-child(1)').attr('disabled', true);
597
598});
599
600
601//************* IMPORT *******************/
602
603jQuery(document).ready(function ($) {
604
605  var now = new Date();
606
607  var day = ("0" + now.getDate()).slice(-2);
608  var month = ("0" + (now.getMonth() + 1)).slice(-2);
609
610  var today = (day) + "." + (month) + "." + now.getFullYear();
611
612  $('.Ticketabdem input').val(today);
613
614  var output = now.getFullYear() + "-" + (month) + "-" + (day);
615
616  $('.end-date-dropdown select').on('change', function () {
617    if ($('.Ticketabdem input').val() == "") {
618      $('.end-date-dropdown select').prop('disabled', true);
619    } else if ($('#myFirstDatepicker').val() && $('#mySecondDatepicker').val() == "") {
620      $('.TotalKosten .wpcf7-text').val("");
621    } else {
622      $('.end-date-dropdown select').removeAttr('disabled');
623      Date.prototype.addDays = function (days) {
624        this.setDate(this.getDate() + parseInt(days));
625        return this;
626      };
627
628      let entrydate = $('#myFirstDatepicker').val();
629
630      let num_of_days = $('.end-date-dropdown select').val();
631
632      convertsd = moment(entrydate, "DD.MM.YYYY").format();
633
634      sd = new Date(convertsd);
635
636      var c = sd.addDays(num_of_days);
637
638      var edc = $('.enddate-display').val($.datepicker.formatDate('dd.mm.yy', new Date(c)));
639
640      var abc = $('.enddate-display').val();
641
642      converted = moment(c, "DD.MM.YYYY").format();
643
644      ed = new Date(converted);
645
646      diffTime = Math.abs(ed - sd);
647
648      diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
649
650      let price = parseInt("8");
651
652      e = price * num_of_days;
653
654      totalPrice = parseInt(e);
655
656      $('.TotalKosten .wpcf7-text').val("");
657
658      $('.TotalKosten .wpcf7-text').val("CHF " + totalPrice + ".00");
659
660      var starttime = jQuery('.timeentry input').val();
661
662      jQuery('.EndTime input').val(starttime);
663    }
664  });
665
666
667  $('.timeentry input').on('change', function () {
668    var starttime = jQuery('.timeentry input').val();
669    jQuery('.EndTime input').val(starttime);
670  });
671
672  $('.end-date-dropdown select').on('change', function () {
673    if ($('#myFirstDatepicker').val() && $('#mySecondDatepicker').val() == "") {
674      $('.EndDate input').val("");
675    }
676  });
677
678  $('.end-date-dropdown select').on('change', function () {
679    var tage = $('.end-date-dropdown select').val();
680    if (tage == 'Tage auswählen') {
681      var end_d = $('.EndDate input').val();
682      var tot_cost = $('.TotalKosten input').val();
683      if (isNaN(end_d)) {
684        $('.EndDate input').val('');
685      }
686      if (isNaN(tot_cost)) {
687        $('.TotalKosten input').val('');
688      }
689    }
690  });
691
692
693  //Clock Time picker
694
695  $('.clockpicker').clockpicker({
696    placement: 'bottom',
697    align: 'left',
698    autoclose: true,
699    minuteStepping: 15,
700    donetext: 'Zeit auswählen',
701    'default': 'now',
702  });
703
704  //Form Validations
705
706  $('.uacf7-next').html('Weiter');
707
708  var inv_amt = $('.totalkosten .wpcf7-text').val();
709  if (inv_amt !== '') {
710    $('.totalkosten .wpcf7-text').val("CHF " + inv_amt + ".00");
711  }
712
713  $("select.wpcf7-select option[value='Zahlung auswählen']").attr('disabled', 'disabled');
714
715  $('input.vehiclenum').on('blur', function (e) {
716    $('.vehicle_num .wpcf7-form-control-wrap span').html('');
717    var plate = jQuery('.vehicle_num .wpcf7-form-control-wrap input').val();
718
719    //var plate = jQuery('input.vehiclenum').val();
720    if (plate.length == 0) {
721      $('.invoicedate input').val('');
722      $('.invoice input').val('');
723      $('.totalkosten .wpcf7-text').val("CHF " + 0 + ".00");
724    } else if (plate.length > 2) {
725      $.ajax({
726        type: 'POST',
727        url: "https://pms-api.shopping-raststaette.ch/vehicles/filter?page=1&limit=10",
728        dataType: "json",
729        data: {
730          "compressed_plate": plate
731        },
732        success: function (response) {
733          var len = response.result.list.length;
734          let plateuppercase = plate.toUpperCase();
735          if (response.result.list.length === 0 || typeof response.result.list[0] == 'undefined') {
736            $('.vehicle_num .wpcf7-form-control-wrap').append('<span class="error">Es wurden keine relevanten Daten gefunden.</span>');
737            $('input.invoicedate').val('');
738            $('input.invoice').val('');
739            $('input.totalkosten.wpcf7-text').val("CHF " + 0 + ".00");
740            $(".uacf7-next").prop('disabled', 'disabled');
741            
742          } else if (response.result.list[0].compressed_plate == plateuppercase) {
743            for (var i = 0; i < len; i++) {
744              var vehicle_no = response.result.list[i]['plates'];
745              var invoice_no = response.result.list[i]['invoice_code'];
746              var invoicedate = response.result.list[i]['invoice_date'];
747              var amount = response.result.list[i]['invoice_amount'];
748            }
749
750            $('.vehicle_num .wpcf7-form-control-wrap input').val(vehicle_no);
751            $('input.invoicedate').val(invoicedate);
752            $('input.invoice').val(invoice_no);
753            $('input.totalkosten.wpcf7-text').val("CHF " + amount + ".00");
754            $(".uacf7-next").prop('disabled', false);
755
756          } else {
757            $('.vehicle_num .wpcf7-form-control-wrap').append('<span class="error">Es wurden keine relevanten Daten gefunden.</span>');
758            $('input.invoicedate').val('');
759            $('input.invoice').val('');
760            $('input.totalkosten.wpcf7-text').val("CHF " + 0 + ".00");
761            $(".uacf7-next").prop('disabled', 'disabled');
762          }
763        }
764      });
765
766    }
767  });
768
769  document.addEventListener('wpcf7submit', function (event) {
770    var testInput = jQuery('select[name="payment"]').val();
771
772    var id = event.detail.contactFormId;
773    var payment = jQuery("input[name=payment]").val();
774    if (id == "142" && testInput == "Twint") {
775      var today = new Date();
776      var dd = String(today.getDate()).padStart(2, '0');
777      var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
778      var yyyy = today.getFullYear();
779
780      today = dd + '.' + mm + '.' + yyyy;
781      var random = Math.floor(1000 + Math.random() * 9000);
782      var numran = "PR-" + random;
783
784      if (jQuery("input[name=invoicedate]").val() == "") {
785        var invoicedate = today;
786      } else {
787        var invoicedate = jQuery("input[name=invoicedate]").val();
788      }
789      if (jQuery("input[name=invoice]").val() == "") {
790        var invoicenumber = numran;
791      } else {
792        var invoicenumber = jQuery("input[name=invoice]").val();
793      }
794      var numberplate = jQuery("input[name=kontrollschild]").val();
795      var totalcosts = jQuery("input[name=totalkosten]").val();
796
797      var payment = jQuery("input[name=payment]").val();
798      var email = jQuery("input[name=email-647]").val();
799      var emailid = jQuery(".customemail").val(email);
800      var inumber = jQuery(".sdate").val(invoicenumber);
801      var numberplates = jQuery(".edate").text(numberplate);
802      var formid = jQuery(".formid").val("142");
803      var idate = jQuery(".vehicle").val(invoicedate);
804      var statenews = jQuery(".statenew").val("Würenlos");
805      var countrynews = jQuery(".countrynew").val("CH");
806      var pricedisplays = jQuery(".time").val(totalcosts);
807      var amt = jQuery(".amt").val(totalcosts);
808
809      var string = totalcosts.split(" ");
810      var pasr = parseInt(string[1]);
811
812      var costt = pasr / 10;
813
814      var delcartnew = {
815        'wpsc_ajax_action': "empty_cart",
816        'action': "empty_cart"
817      };
818      jQuery.ajax({
819        type: "post",
820        dataType: "json",
821        url: '../wp-admin/admin-ajax.php',
822        data: delcartnew,
823        success: function (msg) {
824
825        }
826      });
827      var poynew = {
828        'wpsc_quantity_update': costt,
829        'key': "-1",
830        'wpsc_update_quantity': true,
831        'wpsc_ajax_action': "wpsc_update_quantity",
832        'wpsc_ajax_action': "add_to_cart",
833        'product_id': 17,
834        'action': "wpsc_update_quantity"
835      };
836      jQuery.ajax({
837        type: "post",
838        dataType: "json",
839        url: '../wp-admin/admin-ajax.php',
840        data: poynew,
841        success: function (msg) {
842
843          var cart_total = msg.cart_total;
844          var plainText = cart_total.replace(/<[^>]+>/g, '');
845
846          if (plainText == "CHF0.00") {
847            alert("Zahlungsabruch. Die Seite wird neu geladen. Wir entschuldigen uns für die Unannehmlichkeiten.");
848            window.location.href = "https://www.shopping-raststaette.ch/park-ride/nachzahlung/";
849          } else {
850            jQuery(".afterbind").click();
851          }
852
853        }
854      });
855
856    } else if (id == "19" && testInput == "Twint") {
857      var startdate = jQuery("input[name=Ticketabdem]").val();
858      var enddate = jQuery("input[name=EndDate]").val();
859      var time = jQuery("input[name=timeentry]").val();
860      var vehicle = jQuery("input[name=Kontrollschild]").val();
861      var amount = jQuery("input[name=TotalKosten]").val();
862      var payment = jQuery("input[name=payment]").val();
863      var email = jQuery("input[name=email-646]").val();
864      var no_of_days = jQuery(".end-date-dropdown select").val();
865      var formid = jQuery(".formid").val("19");
866      var email = jQuery(".customemail").val(email);
867      var sdate = jQuery(".sdate").val(startdate);
868      var edate = jQuery(".edate").text(enddate);
869      var time = jQuery(".time").val(time);
870      var vehicle = jQuery(".vehicle").val(vehicle);
871      var statenew = jQuery(".statenew").val("Würenlos");
872      var countrynew = jQuery(".countrynew").val("CH");
873      var pricedisplay = jQuery(".pricedisplay").text(amount);
874      var amt = jQuery(".amt").val(amount);
875      var days = jQuery(".days").val(no_of_days);
876      let dateentry = jQuery('#myFirstDatepicker').val();
877      e = parseInt(no_of_days);
878
879
880      if (e != "" || e === null || typeof e !== 'undefined') {
881        var delcart = {
882          'wpsc_ajax_action': "empty_cart",
883          'action': "empty_cart"
884        };
885        var poy = {
886          'wpsc_quantity_update': e,
887          'key': "-1",
888          'wpsc_update_quantity': true,
889          'wpsc_ajax_action': "wpsc_update_quantity",
890          'wpsc_ajax_action': "add_to_cart",
891          'product_id': 15,
892          'action': "wpsc_update_quantity"
893        };
894        jQuery.ajax({
895          type: "post",
896          dataType: "json",
897          url: 'https://www.shopping-raststaette.ch/park-ride/wp-admin/admin-ajax.php',
898          data: delcart,
899          success: function (msg) {
900
901          }
902        });
903
904        jQuery.ajax({
905          type: "post",
906          dataType: "json",
907          url: 'https://www.shopping-raststaette.ch/park-ride/wp-admin/admin-ajax.php',
908          data: poy,
909          success: function (msg) {
910
911            var cart_total = msg.cart_total;
912            var plainText = cart_total.replace(/<[^>]+>/g, '');
913
914            if (plainText == "CHF0.00") {
915              alert("Zahlungsabruch. Die Seite wird neu geladen. Wir entschuldigen uns für die Unannehmlichkeiten.");
916              window.location.href = "https://www.shopping-raststaette.ch/park-ride/";
917            } else {
918              jQuery(".afterbind").click();
919            }
920
921          }
922        });
923      } else if (e === 0) {
924        alert("Zahlungsabruch. Die Seite wird neu geladen. Wir entschuldigen uns für die Unannehmlichkeiten.");
925        window.location.href = "https://www.shopping-raststaette.ch/park-ride/";
926      } else {
927        alert("Zahlungsabruch. Die Seite wird neu geladen. Wir entschuldigen uns für die Unannehmlichkeiten.");
928        window.location.href = "https://www.shopping-raststaette.ch/park-ride/";
929      }
930    }
931
932  }, false);
933
934  setTimeout(() => {
935    $('#myFirstDatepicker').val(today);
936
937  }, 1500);
938
939  jQuery('.timeentry input').bind('keypress', function (e) {
940
941    if (e.keyCode) {
942      e.preventDefault();
943      return false;
944    }
945  });
946
947  /*$('.payselect select').on('change', function() {
948      var select_text = jQuery('.payselect .wpcf7-select option:selected').text();
949      
950          if(select_text == 'Twint') {
951             jQuery('.modal.fade').addClass('show twintinfo');
952          }
953      
954          jQuery('.modalClose').on('click', function() {
955             jQuery('.modal').removeClass('show twintinfo');
956          });
957    })*/
958
959
960
961
962
963
964  $('.event-title').on('click', function () {
965    $('.event-title').removeClass('active');
966    $('.event-item').removeClass('active');
967    $(this).addClass('active');
968    $(this).closest('.event-item').addClass('active');
969    $('.event-details').slideUp();
970    $(this).next('.event-details').slideToggle();
971  });
972
973
974  $('.click_box').click(function () {
975    $('.click_box').parent().removeClass('active_prnt');
976    $(this).parent().addClass('active_prnt');
977    $('.click_box').removeClass('active_box');
978    $('.click_box').find('.open_content').removeClass('active');
979    $(this).toggleClass('active_box');
980    $(this).find('.open_content').toggleClass('active');
981  });
982  $('.primary_tab_menu li > a').on('click', function () {
983    $('.primary_tab_menu li').removeClass('active_list');
984    $(this).parent('li').addClass('active_list');
985    var target = $(this).attr('data-rel');
986    $(this).closest('.primary_tab_menu').find('li a').removeClass('active_menu');
987    $(this).addClass('active_menu');
988    $('.tabs_content_wrap').find('.primary_tab_box').removeClass('make_act').hide();
989    $("#" + target).addClass('make_act').fadeIn('slow');
990    return false;
991  });
992
993  $('.show_hiddnlist p').click(function () {
994    $('.Hidden_timelist').slideToggle();
995    $('.show_hiddnlist p').hide();
996  });
997
998  $(document).on('click', function (event) {
999    if (!$(event.target).closest('.Hidden_timelist , .show_hiddnlist').length) {
1000      $('.Hidden_timelist').slideUp();
1001      $('.show_hiddnlist p').show();
1002
1003    }
1004  });
1005  // 	$('.events_list_wrap .event:nth-child(even) .padding_container').addClass('dynamic_right');
1006  // 	$('.events_list_wrap .event:nth-child(odd) .padding_container').addClass('dynamic_left');
1007
1008  // 	$('.page-id-759').find('.container').removeClass();
1009
1010
1011  $('.logo_cnt_wrap').parent('.panel-grid').addClass('tab-box_par');
1012  // $('.tab-box_par').hide();
1013  $('.logo_tabmenu li a').on('click', function () {
1014    $('.gastro_sec').addClass('active')
1015    $('.gestro_head_wrap').addClass('dynamic_right')
1016    let act_tab2 = $(this).attr('data-rel');
1017    //     $("#" + act_tab2).parent('.tab-box_par').show();
1018    var target = $(this).attr('data-rel');
1019    $(this).parent('li').siblings('li').find('a').removeClass('active');
1020    $(this).addClass('active');
1021    let tar = "#" + target;
1022    $(tar).parents('.tab-box_par').addClass('make_act').slideDown('slow').siblings(".tab-box_par").hide();
1023    return false;
1024  });
1025  $('.logo_tabmenu li a').click(function (e) {
1026    $('.pizza_slider').slick('setPosition');
1027  })
1028
1029  $('.pizza_slider ').slick({
1030    autoplay: true,
1031    autoplaySpeed: 2500,
1032    speed: 1000,
1033    cssEase: 'linear',
1034    arrows: true,
1035    slidesToShow: 1,
1036    slidesToScroll: 1,
1037    dots: true,
1038    arrows: false,
1039    useTransform: true,
1040    responsive: [
1041      {
1042        breakpoint: 991,
1043        settings: {
1044          arrows: false,
1045        },
1046      }
1047    ],
1048  });
1049
1050
1051  function checkWindowWidth() {
1052    if ($(window).width() <= 991) {
1053      $('.logo_tabmenu a').click(function () {
1054        $('.gastro_sec').addClass('dynamic_right');
1055      });
1056      $('.logo_accodion ').addClass('dynamic_right');
1057
1058    } else {
1059      $('.gastro_sec, .logo_accodion  ').removeClass('dynamic_right');
1060    }
1061  }
1062  checkWindowWidth();
1063  $(window).resize(checkWindowWidth);
1064
1065  $('.user_email input').on('input', function () {
1066    if ($(this).val().trim() !== "") {
1067      $('.req_lbl').hide();
1068    } else {
1069      $('.req_lbl').show(); // Show the label if input is empty
1070    }
1071  });
1072  $('#impressum_content').hide();
1073
1074  $('#impressum').on('click', function (e) {
1075    $(this).parent().next('.so-panel').find('#impressum_content').slideToggle();
1076
1077  });
1078
1079  if (window.location.href.includes('#Impressum')) {
1080    $("#impressum_content").slideToggle();
1081    $('html, body').animate({
1082      scrollTop: $('#impressum_content').offset().top - 200 // Adjust scroll position
1083    }, 1000); // Animation duration
1084  }
1085
1086
1087  $('footer .menu-item a').on('click', function (e) {
1088    if ($(this).text() == 'Impressum') {
1089      $("#impressum_content").slideToggle();
1090    }
1091  });
1092  $('div.navigations ul #menu-item-212 a').on('click', function (e) {
1093    if ($(this).text() == 'Impressum') {
1094      $("#impressum_content").slideToggle();
1095    }
1096  });
1097  function checkWindowWidth2() {
1098    if ($(window).width() <= 991) {
1099      $('.events_section.dynamic_left').addClass('dynamic_right');
1100    } else {
1101      $('.events_section').removeClass('dynamic_right');
1102    }
1103  }
1104  $('ul.logo_tabmenu li:first-child a').click();
1105
1106  checkWindowWidth2();
1107  $(window).resize(checkWindowWidth2);
1108});

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.