1if (typeof window.Roomadmin === "undefined") { 2 window.Roomadmin = {}; 3} 4 5window.Roomadmin.openReservationFormModal = function (options) { 6 var oh = options.oh || ""; 7 var fh = options.fh || ""; 8 var arrival = options.arrival || ""; 9 var departure = options.departure || ""; 10 var background = options.background || "white"; 11 var lang = options.lang || "pl"; 12 var filter = options.filter || "{}"; 13 var numberOfGuests = options.numberOfGuests || 2; 14 15 var roomId = options.roomId || ""; 16 if (roomId != "" && filter == "{}") { 17 filter = '%7B%22room_id_in%22%3A%5B%22' + roomId + '%22%5D%7D'; 18 } 19 20 21 22 var htmlTemplate = jQuery("#ra-reservation-form-template").text(); 23 24 htmlTemplate = htmlTemplate 25 .replace("XARRIVALX", arrival) 26 .replace("XDEPARTUREX", departure) 27 .replace("XOHX", oh) 28 .replace("XLANGX", lang) 29 .replace("XFILTERX", filter) 30 .replace("XNUMBEROFGUESTSX", numberOfGuests) 31 .replace("XFHX", fh); 32 33 var htmlElement = jQuery(htmlTemplate); 34 var rand = Math.floor(Math.random() * 999999); 35 htmlElement.css({ "margin-top": "18vh" }); 36 htmlElement.find("iframe").css({ height: "100%" }); 37 htmlElement.find("iframe").attr('id', 'ra-reservation-form-v2-modal-'+rand); 38 htmlElement.attr('id', 'ra-reservation-form-modal-'+rand); 39 htmlElement.find("div.ra-reservation-form-container").css({ paddingTop: "10px", background: background, borderRadius: "5px" }); 40 jQuery("body").append(htmlElement); 41 42 var modal = new Custombox.modal({ 43 content: { 44 id: 'reservation-form-modal-'+rand, 45 effect: 'fadein', 46 target: "#ra-reservation-form-modal-"+rand, 47 width: jQuery(window).width() < 1200 ? "98%" : "1200px", 48 positionY: "top", 49 onComplete: function () { 50 51 52 var iframe = window.document.getElementById('ra-reservation-form-v2-modal-'+rand); 53 function raMessageReceiver(event) { 54 55 if (iframe && !event.data.sender || "modalForm"+rand !== event.data.sender) { return; } 56 57 if (iframe && event.data.height) { 58 jQuery("#ra-reservation-form-v2-modal-"+rand).css("height", (event.data.height + 10) + "px"); 59 jQuery("#ra-reservation-form-modal-"+rand).css("height", (event.data.height + 10) + "px"); 60 } 61 62 if (window.Roomadmin.eventHandlers) { 63 if (iframe && event.data.event && window.Roomadmin.eventHandlers[event.data.event.name]) { 64 window.Roomadmin.eventHandlers[event.data.event.name](event.data.event.data); 65 } 66 } 67 } 68 window.addEventListener("message", raMessageReceiver, false); 69 function setup() { 70 try { 71 iframe.contentWindow.postMessage({ 72 location: window.location.toString(), 73 setup: { 74 autoHeight: true, 75 senderName: "modalForm"+rand 76 } 77 }, "*"); 78 } catch (e) { } 79 } 80 setInterval(setup, 500); 81 iframe.addEventListener("load", setup); 82 83 document.addEventListener('custombox:content:close', function (oo) { 84 jQuery("body").find('#ra-reservation-form-modal-'+rand).remove(); 85 jQuery("body").find('.custombox-reference').remove(); 86 jQuery("body").find('.custombox-overlay').remove(); 87 jQuery("body").find('.custombox-loader').remove(); 88 }); 89 } 90 } 91 }); 92 93 modal.open(); 94 95}; 96
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.