1Booking = { 2 openTo : true, 3 from: {}, 4 to: {}, 5 baseUrl :"//securebooking.eviivo.com/", 6 targetUrl: 'http://securebooking.eviivo.com/mywebsite/Bulles74110.home?viewname=onlinebooking', 7 shortname : "Bulles74110", 8 referrer: "MyWebsite", 9 // securebooking: { 10 // 'startdate': '', // 13/07/2018 11 // 'enddate': '', // 13/07/2018 12 // 'nights': '', // 7 13 // 'industrytype': '1', //1 14 // 'adults1': '', // 3 15 // 'children1': '', // 0 16 // 'shortname': '', //"Bulles74110"; 17 // 'errorcode': 'NotFound', //NotFound 18 // ?startdate=2018-07-13&adults1=1&children1=0&enddate=2018-07-20 19 // }, 20 securebooking: { 21 'startdate': '', // 2018-07-13 22 'enddate': '', // 2018-07-20 23 // 'nights': '', // 7 24 // 'industrytype': '1', //1 25 'adults1': '', // 3 26 'children1': '', // 0 27 'shortname': '', //"Bulles74110"; 28 // 'errorcode': 'NotFound', //NotFound 29 }, 30 constructor: function () { 31 Booking.securebooking['shortname'] = Booking.shortname; 32 Booking.from = jQuery('.period-from input').pickadate({ 33 firstDay: 1, 34 container: "#datepicker_wrapper .period-from", 35 format: 'dd-mm-yyyy', 36 min: new Date(), 37 disable: 0, 38 onSet: function (context) { 39 Booking.to.prop('disabled', false); 40 if (context.select) { 41 if (jQuery('.period-to input') != ''){ 42 var min = new Date(context.select), 43 max = new Date(min), 44 to = Booking.to.pickadate('picker'); 45 46 max.setDate(min.getDate() + 28); 47 48 to.clear().set({ 49 min: min, 50 max: max 51 }); 52 53 if (Booking.openTo) { 54 to.open(); 55 } 56 Booking.openTo = true; 57 } 58 } 59 } 60 }); 61 62 Booking.to = jQuery('.period-to input').pickadate({ 63 firstDay: 1, 64 format: 'dd-mm-yyyy', 65 container: "#datepicker_wrapper .period-to", 66 min: new Date(), 67 disable: 0, 68 onSet: function (context) { 69 if (context.select) { 70 var date_to = new Date(context.select); 71 // jQuery('.chambres').slideDown(); 72 } else { 73 // jQuery('.chambres').slideUp(); 74 } 75 if (jQuery('.period-from input').val() == ''){ 76 jQuery('.period-from input').click(); 77 jQuery('.chambres').slideUp(); 78 } 79 80 } 81 }); 82 }, 83 submit: function () { 84 jQuery('.home-form-period').submit(function (e) { 85 e.preventDefault(); 86 e.stopPropagation(); 87 88 var dateFrom = new Date(Booking.from.val().replace(/(\d{2})-(\d{2})-(\d{4})/, "$2/$1/$3")), 89 dateTo = new Date(Booking.to.val().replace(/(\d{2})-(\d{2})-(\d{4})/, "$2/$1/$3")), 90 timeDiff = Math.abs(dateFrom.getTime() - dateTo.getTime()), 91 nights = Math.ceil(timeDiff / (1000 * 3600 * 24)); 92 if (!dateFrom.isValid() && !dateTo.isValid()) { 93 Booking.from.pickadate('picker').open(); 94 return; 95 } 96 97 // Booking.securebooking['nights'] = nights; 98 // Booking.securebooking['startdate'] = Booking.from.val().replace(/(\d{2})-(\d{2})-(\d{4})/, "$1/$2/$3"); 99 Booking.securebooking['startdate'] = Booking.from.val().replace(/(\d{2})-(\d{2})-(\d{4})/, "$3-$2-$1"); 100 Booking.securebooking['enddate'] = Booking.to.val().replace(/(\d{2})-(\d{2})-(\d{4})/, "$3-$2-$1"); 101 102 for(i = 1; i<= jQuery('[name="chambres"]').val(); i++){ 103 Booking.securebooking['adults' + i] = jQuery('[name="adults'+i+'"]').val(); 104 Booking.securebooking['children' + i] = jQuery('[name="children'+i+'"]').val(); 105 } 106 url = Booking.targetUrl+"&"+ Booking.serialize(Booking.securebooking); 107 console.log(url); 108 window.open(url); 109 }) 110 }, 111 serialize : function(obj) { 112 var str = []; 113 for (var p in obj) 114 if (obj.hasOwnProperty(p)) { 115 str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); 116 } 117 return str.join("&"); 118 }, 119 chambresChange: function () { 120 jQuery('[name=chambres]').on('change', function () { 121 var count = jQuery(this).val(); 122 123 jQuery('.peoples [data-count]').each(function (i, item) { 124 var currentCount = jQuery(this).attr('data-count'); 125 if (currentCount <= count ) { 126 jQuery(this).delay(currentCount*130).slideDown(300) 127 } else { 128 jQuery(this).slideUp(200) 129 } 130 }) 131 }) 132 }, 133 134}; 135 136jQuery(document).ready(function(){ 137 138 Booking.constructor(); 139 Booking.submit(); 140 //Booking.chambresChange(); 141 142}
142); 143Date.prototype.isValid = function () { 144 return this.getTime() === this.getTime(); 145}; 146 147//(function() { 148// [].slice.call(document.querySelectorAll('select.cs-select')).forEach(function (el) { 149// new SelectFx(el, { 150// onChange: function () { 151// jQuery(el).trigger('change'); 152// } 153// }); 154// }); 155// })();
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.