1/************************************************ 2 Nxt Museum 3************************************************/ 4$(function () { 5 function resetTime (date) { 6 var newDate = new Date(date); 7 8 newDate.setHours(0, 0, 0, 0) 9 10 return newDate; 11 } 12 13 /************************************************ 14 timeslot data 15 ************************************************/ 16 $('#timeslot-section').on('change', function () { 17 var selectedWeekday = $('.calendar').datepicker('getDate').getDay(); 18 var selectedDate = $('.calendar').val(); 19 var customTimeslotSelected = false; 20 var lastTimeSlotSelected = false; 21 var selectedTimeslot = $('.timeslots-container li').find('input:checked').val(); 22 var lastTimeSlot = $('.timeslots-container li').last().find('label') 23 .clone().children().remove().end().text(); //removes extra html added to the timeslot and just return the last time in text 24 25 /*** .custom-timeslot-selected-text ***/ 26 $('.custom-timeslot-selected-text').each(function () { 27 if ($(this).data('from') !== undefined && $(this).data('from') <= selectedDate && $(this).data('until') >= selectedDate) { 28 lastTimeSlotSelected = selectedTimeslot === lastTimeSlot; 29 $(this).toggle(lastTimeSlotSelected); 30 customTimeslotSelected = true; 31 } 32 else if (customTimeslotSelected === false) { 33 var weekdays = $(this).data('weekdays') !== undefined ? $(this).data('weekdays').indexOf(selectedWeekday) > -1 : false; 34 lastTimeSlotSelected = selectedTimeslot === lastTimeSlot; 35 $(this).toggle(weekdays && lastTimeSlotSelected); 36 } 37 else { 38 $(this).toggle(false); 39 } 40 }); 41 }); 42 43 /************************************************ 44 dynamic pricing 45 ************************************************/ 46 if (parseFloat(ticketsTotalPrice) <= 0 || typeof (dynamicPriceDates) == 'undefined' || dynamicPriceDates.length === 0) { 47 $('#calendar-section').removeClass('has-titles'); 48 } else { 49 $('#timeslot-section').on('change', function () { 50 var selectedDate = $('#calendar-date').val(); 51 52 var dynamicPricing = dynamicPriceDates[selectedDate] ?? false; 53 54 if (dynamicPricing === false) { 55 return; 56 } 57 58 var timeslots = dynamicPricing.timeslots; 59 var style = dynamicPricing.style; 60 61 $('.timeslots-container .timeslot').each(function () { 62 var timeslotEl = $(this); 63 var time = timeslotEl.data('timeslot'); 64 var totalPriceA = 0; 65 var totalPriceB = 0; 66 67 $.each(ticketNumbers, function (id, number) { 68 $.each(ticketDetails, function (tickettypeId, tickettype) { 69 if (id === tickettypeId) { 70 totalPriceA += (tickettype.price.changed * number); 71 } 72 }); 73 74 $.each(timeslots, function (timeslot, tickettypes) { 75 if (timeslot === time) { 76 $.each(tickettypes, function (tickettypeId, tickettype) { 77 if (id === tickettypeId) { 78 totalPriceB += (tickettype.price * number); 79 } 80 }); 81 } 82 }); 83 }); 84 85 totalPrice = totalPriceB !== 0 ? totalPriceB : totalPriceA; 86 87 timeslotEl.find('.timeslot-price').remove(); 88 timeslotEl.find('label').append($('<span class="timeslot-price">' + convertPrice(totalPrice + productsTotalPrice + merchandiseTotalPrice) + '</span>')); 89 90 $.each(style.timeslots, function (timeslot, val) { 91 if (timeslot === time) { 92 timeslotEl.addClass(val); 93 } 94 }); 95 }); 96 }); 97 } 98 99});
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.