1/*! 2 * Reservit Hotel JS 3 * Version: 1.4 4 * By Reservit 5 * 6 * Contact: http://www.reservit.com/hebergement 7 * Created: 2017 8 * Modified: 15/05/2019 9 * 10 * Copyright (c) 2017, Reservit. All rights reserved. 11 * 12 * Licensed under the GPLv2 license - https://www.gnu.org/licenses/gpl-2.0.html 13 * 14 */ 15 16console.log('reservit-hotel.js loaded'); 17var divWidth; 18var divHeight; 19//var clickUrl = rsvitHotelScript.reservitClickUrl; 20//console.log(clickUrl); 21 22function creerCookie(nom, valeur, jours) { 23// Le nombre de jours est spécifié 24 if (jours) { 25 var date = new Date(); 26 // Converti le nombre de jour en millisecondes 27 date.setTime(date.getTime() + (jours * 24 * 60 * 60 * 1000)); 28 var expire = "; expires=" + date.toGMTString(); 29 } 30 // Aucune valeur de jours spécifiée 31 else 32 var expire = ""; 33 document.cookie = nom + "=" + valeur + expire + "; path=/"; 34} 35 36function getCookie(name) { 37 if (document.cookie.length == 0) 38 return null; 39 40 var regSepCookie = new RegExp('(; )', 'g'); 41 var cookies = document.cookie.split(regSepCookie); 42 43 for (var i = 0; i < cookies.length; i++) { 44 var regInfo = new RegExp('=', 'g'); 45 var infos = cookies[i].split(regInfo); 46 if (infos[0] == name) { 47 return unescape(infos[1]); 48 } 49 } 50 return null; 51} 52 53//Form window content 54function fill_the_box($HotelId, $CustdId, paramsWidget) { 55 /* BESTPRICE WIDGET CONFIGURATION - ProxIT v1.7 56 Copyright (c) 2014-2016, Interface Technologies. All rights reserved. */ 57 var reservitHotelId = $HotelId; // Votre Hotelid chez Interface Technologies 58 var reservitCustdId = $CustdId; // Votre Custid chez Interface Technologies 59 60 61 62 // Core - DO NOT MODIFY 63 function buildWidgetUrl() { 64 var urlToCall = 'https://secure.reservit.com/front' + reservitHotelId + '/front.do?m=widget&mode=init&custid=' + reservitCustdId + '&hotelid=' + reservitHotelId; 65 for (key in paramsWidget) { 66 urlToCall += '&' + key + '=' + paramsWidget[key]; 67 } 68 if (typeof _gaq != 'undefined' && typeof _gat != 'undefined') { 69 var pageTracker = _gat._getTrackerByName(); 70 var linkerUrl = pageTracker._getLinkerUrl(urlToCall); 71 urlToCall = linkerUrl; 72 } 73 return urlToCall; 74 } 75 function getWidgetInIframe(frameid) { 76 document.getElementById(frameid).src = buildWidgetUrl(); 77 } 78 79 getWidgetInIframe('ReservitBestPriceWidget'); 80} 81 82//Showing the button 83function show_the_btn($closedalready) { 84 setTimeout(function () { 85 //If the user use a mobile device or he already has closed the widget window 86 if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || $closedalready === "yes") { 87 //show the button 88 89 jQuery('#rsvit_btn').fadeIn('swing'); 90 } else { 91 //show the widget window 92 jQuery('#ReservitBestPriceWidgetbox1').fadeIn('swing'); 93 } 94 }, 2000); 95} 96 97//on the pop-up window button click 98jQuery('#box_btn').click(function () { 99 jQuery('#ReservitBestPriceWidgetbox1').fadeOut('swing'); 100 jQuery('#rsvit_btn').fadeIn('swing'); 101 102 //When the user close the widget window 103 //We set the cookie to "yes" value for one year 104 creerCookie("rsvit_box_closed", "yes", 365); 105 //--NOT used-- We send "yes" value for the session variable RsvitWidgetboxClosed with ajax 106 //jQuery.post(clickUrl+"/reservit-hotel-click.php", { RsvitWidgetboxClosed: "yes", }); 107}); 108 109//on the reservit button click 110jQuery('#rsvit_btn').click(function () { 111 jQuery('#rsvit_btn').fadeOut('swing'); 112 jQuery('#ReservitBestPriceWidgetbox1').fadeIn('swing'); 113}); 114
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.