1(function($) { 2 $(document).ready(function () { 3 4 var modalContent = $('#modal'); 5 var modalText = $('#modalPR'); 6 var modalHome = $('#modalHomeText'); 7 var modalTrigger = $('#modalTrigger'); 8 var homeTrigger = $('#modalTriggerHome'); 9 10 /* 11 * Automatically open popup only when the user 12 * has not interacted with it within the last 7 days. 13 */ 14 if (modalContent.length && !Cookies.get('modal_visited')) { 15 16 $.fancybox.open({ 17 src: '#modal', 18 type: 'inline', 19 backFocus: false, 20 autoFocus: false, 21 touch: false, 22 23 afterClose: function() { 24 25 Cookies.set('modal_visited', 'true', { 26 expires: 7, 27 path: '/' 28 }); 29 30 if (modalText.length) { 31 modalText.show(); 32 $('.form-message').remove(); 33 } 34 } 35 }); 36 } 37 38 /* 39 * Suppress automatic popup when user clicks 40 * "Book Now & Save". 41 */ 42 $('#modalPR').on( 43 'click', 44 'a[href*="/special-offers/stay-a-little-longer/"]', 45 function () { 46 47 Cookies.set('modal_visited', 'true', { 48 expires: 7, 49 path: '/' 50 }); 51 } 52 ); 53 54 var args = { 55 type: 'inline', 56 backFocus: false, 57 autoFocus: false, 58 touch: false, 59 60 afterClose: function() { 61 62 if (modalText.length) { 63 modalText.show(); 64 $('.form-message').remove(); 65 } 66 } 67 }; 68 69 /* 70 * Manual Get Offer popup. 71 * 72 * This remains available even when 73 * modal_visited cookie exists. 74 */ 75 modalTrigger.fancybox(args); 76 homeTrigger.fancybox(args); 77 78 if (modalText.length) { 79 $('#modalPR #revinate_contact_api_form').on('submit', function() { 80 81 modalText.hide(); 82 83 $(this) 84 .parents('.pr-modal') 85 .append( 86 '<div class="form-message">' + 87 form_messages.success + 88 '</div>' 89 ); 90 }); 91 } 92 93 function popUp() { 94 $.fancybox.open({ 95 src: '#modal', 96 type: 'inline', 97 backFocus: false, 98 autoFocus: false, 99 touch: false, 100 101 afterClose: function() { 102 103 if (modalText.length) { 104 modalText.show(); 105 $('.form-message').remove(); 106 } 107 } 108 }); 109 } 110 111 $('#popTag').on('click', function(e) { 112 e.preventDefault(); 113 popUp(); 114 }); 115 116 $("[data-fancybox]").fancybox({ 117 autoFocus: false, 118 touch: false 119 }); 120 121 }); 122})(jQuery);
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.