1var isBookinPageLoaded = false; 2var initalFrameLoad = function () { 3 jQuery('.iframe_loader').hide(); 4 jQuery('#iframeContent').show(); 5 6 var fancyBoxHeight = $('#setmore-fancy-box').height(); 7 var iframewindowHeight = jQuery(window).height(); 8 9 if (iframewindowHeight > fancyBoxHeight) { 10 $('#setmore-fancy-box-content').css('height', '635px'); 11 } else { 12 $('#setmore-fancy-box-content').css('height', iframewindowHeight - 50); 13 } 14}; 15 16var setmorePopup = function (e, bookingPageLink) { 17 if (e) { 18 e.preventDefault(); 19 e.stopPropagation(); 20 e.stopImmediatePropagation(); 21 } 22 23 var windowWidth = jQuery(window).width(); 24 if (windowWidth < 600) { 25 window.open(bookingPageLink, '_blank'); 26 return; 27 } 28 29 var templ = {}; 30 templ.overlay = '<div id="setmore-overlay"></div>'; 31 templ.popup = 32 '<div id="setmore-fancy-box" style= " background-color: #FFFFFF;height: auto;left: 50%;position: absolute;top: 0;width: 545px;z-index: 9999;">' + 33 '<button id="setmore-fancy-box-close-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="11" viewB
33ox="0 0 12 11" fill="none"><path d="M1.3335 0.674316L10.6668 10.0076" stroke="#EFF3F9" stroke-linecap="round" stroke-linejoin="round"/><path d="M10.6668 0.674316L1.3335 10.0076" stroke="#EFF3F9" stroke-linecap="round" stroke-linejoin="round"/></svg></button>' + 34 '<div id="setmore-fancy-box-content">' + 35 '<div class="int-loader-wrap iframe_loader">' + 36 '<div aria-hidden="true" id=":ri:" role="img" style="width:48px; height:48px; stroke-width:1; position:relative;" data-eds-component="true"><svg aria-hidden="true" data-eds-component="true" fill-rule="evenodd" focusable="false" preserveAspectRatio="xMidYMid meet" role="img" viewBox="0 0 480 480" xmlns="http://www.w3.org/2000/svg" style="height:20px; width:20px; fill: #111111; position:absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);"><path d="M210.833 216.666h-.583c0 64.948-38.039 140-116.084 140v-64.167c96.084.056 116.667-69.133 116.667-110.833V100h-.583c0 64.948-38.039 140-116.084 140v-64.167C190.25 175.889 210.834 106.7 210.834 65h58.334c0 41.7 20.582 110.889 116.666 110.833V240c-78.044 0-116.083-75.052-116.083-140h-.583v81.666c0 41.7 20.582 110.889 116.666 110.833v64.167c-78.044 0-116.083-75.052-116.083-140h-.583v198.333h-58.334V216.666z"></path></svg><svg fill="none" focusable="false" preserveAspectRatio="xMidYMid meet" viewBox="0 0 50 50" class="animate-loading-spin block"><circle cx="25" cy="25" r="20" stroke-linecap="round" style="stroke:#111111;" class="animate-loading-dash"></circle></svg></div>' + 37 '</div>' + 38 // '<div class="iframe_loader" style="position: absolute; left: 50%;top: 50%; -ms-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%)"><img src="https://storage.googleapis.com/setmore-assets/2.0/Images/Logos/setmore-loader.gif" width="48" height="48" ></div>' + 39 '<div id="iframeContent" style="height:100%;width:100%" ">' + 40 '</div>' + 41 '</div>'; 42 var init = function () { 43 if (!isBookinPageLoaded) { 44 isBookinPageLoaded = true; 45 renderTempl(); 46 } else { 47 loadIframe(); 48 positionPopup(); 49 showPopup(); 50 } 51 }; 52 var renderTempl = function () { 53 jQuery('body').append(templ.overlay).append(templ.popup); 54 positionPopup(); 55 loadIframe(); 56 bindEvents(); 57 }; 58 var loadIframe = function () { 59 jQuery('.iframe_loader').show(); 60 jQuery('#iframeContent').hide(); 61 62 jQuery('#iframeContent').html( 63 '<iframe allow="web-share; payment" id="setmore-fancy-box-iframe" frameborder="0" hspace="0" scrolling="auto" src="' + 64 bookingPageLink + 65 '"></>' 66 ); 67 console.log(jQuery('#iframeContent').html()); 68 document.getElementById('setmore-fancy-box-iframe').onload = function () { 69 return initalFrameLoad(); 70 }; 71 }; 72 var bindEvents = function () { 73 // var self = this; 74 jQuery('#setmore-overlay , #setmore-fancy-box-close-icon').bind('click', function () { 75 hidePopup(); 76 }); 77 }; 78 var positionPopup = function () { 79 var windowHeight = jQuery(window).height(); 80 var windowScrollHeight = jQuery(document).height(); 81 var windowScrollTop = jQuery(document).scrollTop(); 82 var popupWidth = jQuery('#setmore-fancy-box').width(); 83 var popupHeight = windowHeight - 100; 84 85 jQuery('#setmore-overlay').height(windowScrollHeight + 'px'); 86 jQuery('#setmore-fancy-box').css({ 87 'margin-left': '-' + popupWidth / 2 + 'px', 88 'margin-top': (windowHeight - popupHeight) / 2 + windowScrollTop + 'px', 89 }); 90 jQuery('html,body').css('overflow', 'hidden'); 91 }; 92 var hidePopup = function () { 93 jQuery('#setmore-overlay,#setmore-fancy-box').hide(); 94 jQuery('html,body').css('overflow', 'auto'); 95 }; 96 var showPopup = function () { 97 jQuery('#setmore-overlay,#setmore-fancy-box').show(); 98 }; 99 init(); 100}; 101 102// include required css file 103var loadCss = function () { 104 var cssFilePath = 105 '<link href="https://assets.setmore.com/integration/static/setmorePopupStaging.css" rel="stylesheet" type="text/css" />'; 106 107 var appendCssFiles = function () { 108 jQuery('head').append(cssFilePath); 109 setTimeout(function () { 110 loadSetmoreFancyBox(); 111 }, 600); 112 }; 113 114 // Binding click event to the "a" tag. Added this to override the 115 // FancyBox plugin 116 var loadSetmoreFancyBox = function () { 117 jQuery('[id=Setmore_button_iframe]').on('click', function (e) { 118 e.preventDefault(); 119 e.stopPropagation(); 120 e.stopImmediatePropagation(); 121 122 var bookingPageLink = jQuery(this).attr('href');
123 var parsedBookingUrl = new URL(bookingPageLink); 124 125 if (parsedBookingUrl.hostname.endsWith('setmore.com')) { 126 setmorePopup(e, bookingPageLink); 127 } else { 128 var invalidPath = parsedBookingUrl.pathname + parsedBookingUrl.search; 129 var newBookingUrl = 'https://booking.setmore.com' + invalidPath; 130 131 if (invalidPath === '/' || invalidPath === '') { 132 newBookingUrl = 'https://booking.setmore.com/invalidurl'; 133 } 134 135 setmorePopup(e, newBookingUrl); 136 } 137 }); 138 }; 139 140 if (typeof jQuery !== 'undefined') { 141 appendCssFiles(); 142 } else { 143 var script = document.createElement('SCRIPT'); 144 script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'; 145 script.type = 'text/javascript'; 146 document.getElementsByTagName('head')[0].appendChild(script); 147 148 var checkReady = function (callback) { 149 if (window.jQuery) { 150 callback(jQuery); 151 } else { 152 window.setTimeout(function () { 153 checkReady(callback); 154 }, 100); 155 } 156 }; 157 158 checkReady(function (jQuery) { 159 appendCssFiles(); 160 windowHeight = window.innerHeight; 161 }); 162 } 163}; 164loadCss();
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.