1$(document).ready(function(){ 2 generalScripts(); 3 var isMobile = $(window).width() > 640 ? false : true; 4 if(isMobile) mobileScripts(); 5 else desktopScripts(); 6 $('input, textarea').placeholder(); 7}); 8function generalScripts(){ 9 initDiningsTabs(); 10 initializeGoogleMap(); 11 initSliders(); 12 initMenuDropdown(); 13 initFancybox(); 14 initNewsletterForm(); 15 initMobileMenu(); 16 initCorrectHTMLStructure(); 17 initMacStyleFix(); 18 initNewsletterPopup(); 19 initformValidate(); 20 setTimeout(initOfferPopup, 2000); 21} 22function desktopScripts(){ 23 initTabs(); 24 initTabNavScroll(); 25} 26function mobileScripts(){ 27 initMobileHomepage(); 28 initBookingStyles(); 29 $('.homepage-menus-navigation li a').click(function(){ 30 return false; 31 }); 32} 33$(window).resize(function(){ 34 initCorrectHTMLStructure(); 35}); 36$(document).scroll(function(){ 37 var isMobile = $(window).width() > 640 ? false : true; 38 if (!isMobile) { 39 initFixedHeader(); 40 initTabNavScroll(); 41 } 42 if(isMobile) initMobileBook(); 43}); 44 45function initDiningsTabs(){ 46 if($('.private-dining-accordion')){ 47 48 var accHolder = $('.private-dining-accordion'); 49 var liCount = accHolder.children('h4').length; 50 51 var collapse = true; 52 53 if(liCount == 1){collapse = false} 54 55 accHolder.accordion({ 56 collapsible: collapse, 57 active:false, 58 animate: 1000, 59 heightStyle: "content" 60 }); 61 } 62 if($('.menus-accordion > div')){ 63 $('.menus-accordion > div').accordion({ 64 collapsible: true, 65 active:false, 66 animate: 1000, 67 heightStyle: "content" 68 }); 69 var accHeader = $('.ui-accordion-header'); 70 71 accHeader.click(function(){ 72 var headerTop = $('.ui-accordion').offset().top; 73 $('html,body').animate({ 74 scrollTop: headerTop - 100 75 }, 0); 76 }) 77 } 78} 79function initMobileHomepage(){ 80 var holderTitle = $('.homepage-accordion-title'); 81 var bookLinkHeight = $('.mobile-book-link').height(); 82 var isCall = true; 83 84 holderTitle.click(function(){ 85 86 var currentHolder = $(this).closest('.panel-grid').next('.panel-grid').find('.homepage-accordion-holder'); 87 88 var activeHolderHeight = $('.homepage-accordion-holder.active-section').height(); 89 90 var activeTitle = $('.homepage-accordion-title.active-section-title'); 91 92 var headerTop = $(this).offset().top; 93 94 var activeTop = activeTitle.length ? activeTitle.offset().top : 0; 95 96 var heightCorrect = ((headerTop < activeTop) ? 0 : activeHolderHeight); 97 98 $('html,body').animate({ 99 scrollTop: headerTop - heightCorrect - bookLinkHeight + 1 100 }, 500); 101 102 if($(this).hasClass('active-section-title')){ 103 $(this).removeClass('active-section-title'); 104 currentHolder.slideUp(500).removeClass('active-section'); 105 } 106 else{ 107 $('.homepage-accordion-title').each(function(){ 108 $(this).removeClass('active-section-title'); 109 }); 110 $(this).addClass('active-section-title'); 111 112 $('.homepage-accordion-holder').each(function(){ 113 $(this).slideUp(500).removeClass('active-section'); 114 }); 115 116 currentHolder.slideDown(500).addClass('active-section'); 117 118 if(currentHolder.hasClass('menus-tabs')){ 119 120 if(isCall){ 121 initMenusSyncSliders(); 122 isCall = false; 123 } 124 } 125 if(currentHolder.hasClass('location-wrapper')){ 126 initializeGoogleMap(); 127 } 128 } 129 130 }) 131} 132function initSliders(){ 133 if($('.private-dining-slider')){ 134 $('.private-dining-slider').bxSlider({ 135 mode:'fade' 136 }); 137 } 138 if($('.text-slider')){ 139 $('.text-slider').bxSlider({ 140 mode:'fade', 141 slideWidth: 'auto' 142 }); 143 $('.text-slider').parents('.bx-wrapper').css('max-width','1000px'); 144 } 145 if($('.menus-slider')){ 146 $('.menus-slider').bxSlider({ 147 mode:'fade', 148 pager:false, 149 adaptiveHeight: true 150 }); 151 } 152} 153function initMenuDropdown(){ 154 var dropdown = $('#menu-main-menu .sub-menu'); 155 dropdown.wrap('<div class="dropdown-holder"></div>'); 156 157 var menuOpenBtn = $('.menus-link > a'); 158 159 var eventhandler = ('ontouchstart' in document.documentElement ? "touchstart" : "click"); 160 161 menuOpenBtn.on(eventhandler,function(){ 162 $(this).closest('.menus-link').toggleClass('show-dropdown'); 163 return false; 164 }) 165 $('body').on(eventhandler,function(){ 166 //$('.menus-link').removeClass('show-dropdown'); 167 }) 168 169} 170function initFixedHeader(){ 171 var body = $('body'); 172 var header = $('#header'); 173 174 if ($(document).scrollTop() > 90) { 175 body.addClass('fixed'); 176 } 177 else { 178 body.removeClass('fixed'); 179 } 180} 181function initMobileBook(){ 182 var body = $('body'); 183 var link = $('.mobile-book-link'); 184 var bannerHeight = $(".banner-holder").outerHeight(); 185 var headerHeight = $("#header").outerHeight(); 186 187 var totalTopHeight = bannerHeight + headerHeight; 188 189 if ($(document).scrollTop() > totalTopHeight){ 190 body.addClass('fixed'); 191 192 } 193 else { 194 body.removeClass('fixed'); 195 } 196} 197function initializeGoogleMap() { 198 if(!$('#gmap').length)return; 199 var mapCanvas = document.getElementById('gmap'); 200 201 if(latitude.length && longitude.length){ 202 var mapCoord = new google.maps.LatLng(latitude,longitude); 203 } 204 205 var mapOptions = { 206 scrollwheel: false, 207 center: mapCoord, 208 zoom: 16, 209 mapTypeId: google.maps.MapTypeId.ROADMAP 210 } 211 var map = new google.maps.Map(mapCanvas, mapOptions); 212 213 var marker = new google.maps.Marker({ 214 position: mapCoord, 215 map: map 216 }); 217} 218function initTabs(){ 219 $(".menus-tabs").tabs({ 220 activate: function( event, ui ) { 221 222 if(!($('.menus-tabs').length)) return; 223 var tabsHolder = $('.menus-tabs'); 224 var itemHeight = tabsHolder.find('.homepage-menus-navigation span').outerHeight(); 225 var scrollTop = $(document).scrollTop(); 226 227 var containerHeight = $('.homepage-menus-navigation').outerHeight(); 228 229 var containerTop = tabsHolder.offset().top; 230 var containerBottom = containerTop + containerHeight - itemHeight; 231 232 233 if(scrollTop < containerBottom){ 234 $('html, body').animate({ 235 scrollTop: $('.homepage-menus-navigation').offset().top 236 }, 500); 237 } 238 } 239 }); 240} 241function initFancybox(){ 242 var imgLink = $('.room-plan'); 243 imgLink.fancybox({ 244 padding:[0,0,0,0] 245 }); 246} 247function initNewsletterForm(){ 248 var submit = $('.wpfes_form_btn'); 249 250 submit.before("<label> </label>"); 251 submit.closest('.wpfes_form_label').addClass('submit-holder'); 252} 253function initMobileMenu(){ 254 var menuOpenBtn = $('.open-mobile'); 255 var menuCloseBtn = $('.close-mobile'); 256 var mobileMenu = $('.header-bottom'); 257 mobileMenu.find('.main-nav').css({ 258 right: -mobileMenu.width(), 259 }) 260 261 var eventhandler = ('ontouchstart' in document.documentElement ? "touchstart" : "click"); 262 263 menuOpenBtn.on(eventhandler,function(){ 264 if(mobileMenu.css('display') !== 'block'){ 265 mobileMenu.fadeIn(300).find('.main-nav').animate({ 266 right:0 267 },300); 268 } 269 else{ 270 mobileMenu.fadeOut(300).find('.main-nav').animate({ 271 right:-mobileMenu.width() 272 },300); 273 } 274 $('body').toggleClass('show-mobile-menu'); 275 return false; 276 }); 277 menuCloseBtn.on(eventhandler,function(){ 278 mobileMenu.fadeOut(300).find('.main-nav').animate({ 279 right:-mobileMenu.width() 280 },300); 281 $('body').removeClass('show-mobile-menu'); 282 return false; 283 }); 284} 285function initBookingStyles(){ 286 var item = $('#main .booking-calendar .textwidget p + div'); 287 item.css({ 288 width: '100% !important', 289 height: '140px !important' 290 }); 291 var itemLink = $('#main .booking-calendar .textwidget p + div a'); 292 itemLink.css({ 293 paddingTop: '0 !important', 294 height: '100% !important' 295 }) 296} 297function initCorrectHTMLStructure(){ 298 if($('.offers-events-cpt')){ 299 var pageClass = $('.offers-events-cpt'); 300 pageClass.closest('body').addClass('offers-events'); 301 } 302 var bannerImage = $('.banner-holder img'); 303 if($(window).width() > 1440){ 304 bannerImage.css({ 305 width:'100%' 306 }) 307 } 308 else{ 309 bannerImage.css({ 310 width:'auto' 311 }) 312 } 313} 314function initMenusSyncSliders(){ 315 var slider = $('.homepage-menus-navigation').bxSlider({ 316 pager:false, 317 touchEnabled:false, 318 onSlideNext: doThis, 319 onSlidePrev: doThis 320 }); 321 var slider1 = $('.menus-tab-holder').bxSlider({ 322 pager:false, 323 touchEnabled:false 324 }); 325 function doThis(ele, old, newi){ 326 slider.goToSlide(newi); 327 slider1.goToSlide(newi); 328 } 329} 330function initMacStyleFix(){ 331 if(navigator.userAgent.indexOf('Windows') < 0) { 332 $('body').addClass('non-windows'); 333 } 334} 335function initNewsletterPopup(){ 336 var popup = $('#wpfes_newsletter_message_box'); 337 popup.appendTo(".newsletter-section"); 338 $('.newsletter-section').attr('id', 'wpfesw'); 339} 340function initformValidate(){ 341 var form = $('.newsletter-section form'); 342 343 form.validate({ 344 rules: { 345 'cm-name': "required", 346 'cm-ydiylr-ydiylr': { 347 required: true, 348 customemail: true 349 }, 350 'cm-jhmlr-jhmlr': { 351 required: true, 352 customemail: true 353 } 354 }, 355 messages: { 356 'cm-name': { 357 required: "Please enter your name" 358 }, 359 'cm-ydiylr-ydiylr': { 360 required: "Please enter your email address ", 361 email: "Please re-enter your email address. </br>For example: [email protected]" 362 }, 363 'cm-jhmlr-jhmlr': { 364 required: "Please enter your email address ", 365 email: "Please re-enter your email address. </br>For example: [email protected]" 366 } 367 }, 368 onkeyup: false, 369 focusInvalid: false, 370 onfocusout:false, 371 showErrors: function(errorMap, errorList) { 372 var errors_html = ''; 373 for( var key in errorMap){ 374 var error = errorMap[key]; 375 errors_html += error + '<br>'; 376 } 377 378
379 $("#summary").html('<div id="wpfes_newsletter_message_box2" class="widget-container newsletter-box" style="height:auto;">' 380 +'<h3 class="widget-title">Newsletter subscription status</h3><div class="newsletter-box-text" id="wpfes_newsletter_message">' + errors_html + '</div>' 381 +'<div class="submit-holder"><label> </label><a href="#">Back</a></div></div>'); 382 $('#wpfes_newsletter_message_box2 .submit-holder a').click(function(){ 383 $(this).closest('#wpfes_newsletter_message_box2').hide(); 384 return false; 385 386 387 }) 388 this.defaultShowErrors(); 389 } 390 391 }) 392 393 function getQueryVariable(variable) { 394 var query = window.location.search.substring(1); 395 var vars = query.split("&"); 396 for (var i=0;i<vars.length;i++) { 397 var pair = vars[i].split("="); 398 if (pair[0] == variable) { 399 return pair[1]; 400 } 401 } 402 } 403 var team = getQueryVariable('subscribed'); 404 if(team){ 405 $("#summary").html('<div id="wpfes_newsletter_message_box2" class="widget-container newsletter-box" style="height:auto;">' 406 +'<h3 class="widget-title">Newsletter subscription status</h3><div class="newsletter-box-text" id="wpfes_newsletter_message">Thank you for subscribing</div>' 407 +'<div class="submit-holder"><label> </label><a href="#">OK</a></div></div>'); 408 $('#wpfes_newsletter_message_box2 .submit-holder a').click(function(){ 409 $(this).closest('#wpfes_newsletter_message_box2').hide(); 410 return false; 411 }) 412 } 413} 414function initTabNavScroll(){ 415 416 if(!($('.menus-tabs').length)) return; 417 var tabsHolder = $('.menus-tabs'); 418 var itemHeight = tabsHolder.find('.homepage-menus-navigation span').outerHeight(); 419 var scrollTop = $(document).scrollTop(); 420 421 var containerHeight = $('.homepage-menus-navigation').outerHeight(); 422 423 var containerTop = tabsHolder.offset().top; 424 var containerBottom = containerTop + containerHeight - itemHeight; 425 var fixedHeaderHeight = $('.header-bottom').outerHeight(); 426 427 428 if((scrollTop >= (containerTop - fixedHeaderHeight))&& (scrollTop <= (containerBottom - fixedHeaderHeight))){ 429 tabsHolder.removeClass('absolute-nav'); 430 tabsHolder.addClass('fixed-nav'); 431 } 432 else if(scrollTop >= (containerBottom - fixedHeaderHeight)){ 433 tabsHolder.removeClass('fixed-nav') 434 tabsHolder.addClass('absolute-nav'); 435 } 436 else{ 437 tabsHolder.removeClass('fixed-nav') 438 } 439} 440function initOfferPopup(){ 441 442 if(('.offer-popup').length){ 443 var popup = $('.offer-popup'); 444 var popupID = ''; 445 var activePopup = ''; 446 447 popup.each(function(){ 448 popupID = $(this).attr('id'); 449 activePopup = $(this); 450 initShowPopup(); 451 }) 452 453 454 455 popupLocation(); 456 $(window).resize(function(){ 457 popupLocation(); 458 }); 459 var closeBtn = popup.find('.close-popup'); 460 closeBtn.click(function(){ 461 $(this).closest('.offer-popup').fadeOut(500); 462 return false; 463 }) 464 465 } 466 function initShowPopup(){ 467 468 if (!$.cookie(popupID)) { 469 activePopup.fadeIn(500); 470 } 471 $.cookie(popupID, true, { 472 expires: 365, 473 path: '/' 474 }); 475 } 476 477 function popupLocation(){ 478 479 var windowWidth = $(window).width(); 480 var windowHeight = $(window).height(); 481 482 483 var popupWidth = popup.outerWidth(); 484 var popupHeight = popup.outerHeight(); 485 486 var popupTop = windowHeight/2 - popupHeight/2; 487 var popupLeft = windowWidth/2 - popupWidth/2; 488 489 popup.css({ 490 top:popupTop, 491 left:popupLeft 492 }) 493 } 494}
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.