1var ST = {"disable_header_floating":"y"}; 2 3 4// Call isotope when all images are loaded 5function run_isotope(){ 6 "use strict"; 7 jQuery(".cpt-items").isotope(); 8} 9 10// Reservation Form 11function ST_Reservation_Form(){ 12 "use strict"; 13 var error_report; 14 jQuery('#reservation_submit').bind("click",function(){ 15 jQuery("#reservation_form .notice_ok").hide(); 16 jQuery("#reservation_form .notice_error").hide(); 17 18 error_report = false; 19 jQuery("#reservation_form input, #reservation_form textarea, #reservation_form radio, #reservation_form select").each(function(i){ 20 var form_element = jQuery(this); 21 var form_element_value = jQuery(this).val(); 22 var form_element_id = jQuery(this).attr("id"); 23 //var form_element_class = jQuery(this).attr("class"); 24 var form_element_required = jQuery(this).hasClass("required"); 25 26 // Check email validation 27 if(form_element_id === "reservation_email"){ 28 form_element.removeClass("error valid"); 29 if(!form_element_value.match(/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/)){ 30 form_element.addClass("error"); 31 error_report = true; 32 } else { 33 form_element.addClass("valid"); 34 } 35 } 36 37 // Check input required validation 38 if(form_element_required && form_element_id !== "reservation_email"){ 39 form_element.removeClass("error valid"); 40 if(form_element_value === ""){ 41 form_element.addClass("error"); 42 error_report = true; 43 } else { 44 form_element.addClass("valid"); 45 } 46 } 47 48 if(jQuery("#reservation_form input, #reservation_form textarea, #reservation_form radio, #reservation_form select").length === i+1){ 49 if(error_report === false){ 50 jQuery("#reservation_form .loading").show(); 51 52 var $string = "ajax=true"; 53 jQuery("#reservation_form input, #reservation_form textarea, #reservation_form radio, #reservation_form select").each(function(){ 54 var $form_element_name = jQuery(this).attr("name"); 55 var $form_element_value = encodeURIComponent(jQuery(this).val()); 56 $string = $string + "&" + $form_element_name + "=" + $form_element_value; 57 }); 58 59 jQuery.ajax({ 60 type: "POST", 61 url: "./page-reservation-ajax.php", 62 data:$string, 63 success: function(response){ 64 jQuery("#reservation_form .loading").hide(); 65 if(response === 'success'){ 66 jQuery("#reservation_form .notice_ok").show(); 67 jQuery("#reservation_form .field_submit").hide(); 68 } else { 69 jQuery("#reservation_form .notice_error").show(); 70 jQuery("#reservation_form .field_submit").hide(); 71 } 72 } 73 }); 74 } 75 } 76 }); 77 78 return false; 79 }); 80} 81 82// Contact Form 83function ST_Contact_Form(){ 84 85 "use strict"; 86 87 var error_report; 88 jQuery("#contact_submit").bind("click",function(){ 89 90 // Hide notice message when submit 91 jQuery("#contact_form .notice_ok").hide(); 92 jQuery("#contact_form .notice_error").hide(); 93 error_report = false; 94 95 jQuery("#contact_form input, #contact_form select, #contact_form textarea, #contact_form radio").each(function(i){ 96 97 var form_element = jQuery(this); 98 var form_element_value = jQuery(this).val(); 99 var form_element_id = jQuery(this).attr("id"); 100 //var form_element_class = jQuery(this).attr("class"); 101 var form_element_required = jQuery(this).hasClass("required"); 102 103 // Check email validation 104 if(form_element_id === "contact_email"){ 105 form_element.removeClass("error valid"); 106 if(!form_element_value.match(/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/)){ 107 form_element.addClass("error"); 108 error_report = true; 109 } else {
110 form_element.addClass("valid"); 111 } 112 } 113 114 // Check input required validation 115 if(form_element_required && form_element_id !== "contact_email"){ 116 form_element.removeClass("error valid"); 117 if(form_element_value === ""){ 118 form_element.addClass("error"); 119 error_report = true; 120 } else { 121 form_element.addClass("valid"); 122 } 123 } 124 125 if(jQuery("#contact_form input, #contact_form select, #contact_form textarea, #contact_form radio").length === i+1){ 126 if(error_report === false){ 127 jQuery("#contact_form .loading").show(); 128 129 var $string = "ajax=true"; 130 jQuery("#contact_form input, #contact_form select, #contact_form textarea, #contact_form radio").each(function(){ 131 var $form_element_name = jQuery(this).attr("name"); 132 var $form_element_value = encodeURIComponent(jQuery(this).val()); 133 $string = $string + "&" + $form_element_name + "=" + $form_element_value; 134 }); 135 136 jQuery.ajax({ 137 type: "POST", 138 url: "./page-contact-ajax.php", 139 data:$string, 140 success: function(response){ 141 jQuery("#contact_form .loading").hide(); 142 if(response === 'success'){ 143 jQuery("#contact_form .notice_ok").show(); 144 jQuery("#contact_form .field_submit").hide(); 145 } else { 146 jQuery("#contact_form .notice_error").show(); 147 jQuery("#contact_form .field_submit").hide(); 148 } 149 } 150 }); 151 } 152 } 153 154 155 }); 156 return false; 157 }); 158 159} 160 161// // Add Calendar to ID 162// function ST_Add_Calendar(id){ 163// "use strict";
164// jQuery('<div class="calendar" />') 165// .insertAfter( jQuery(id) ) 166// .datepicker({ 167// dateFormat: 'dd-mm-yy', 168// minDate: new Date(), 169// maxDate: '+1y', 170// altField: id, 171// firstDay: 1, 172// showOtherMonths: true, 173// dayNamesMin: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], 174// beforeShowDay: ST_Date_Available }) 175// .prev().hide(); 176// } 177 178 179// Date Available For Select 180function ST_Date_Available(date){ 181 "use strict"; 182 var dateAsString = date.getFullYear().toString() + "-" + (date.getMonth()+1).toString() + "-" + date.getDate(); 183 var result = jQuery.inArray( dateAsString ) ===-1 ? [true] : [false]; 184 return result; 185} 186 187 188jQuery(document).ready(function(){ 189 "use strict"; 190 191 192 var top_bar= jQuery('#header .top-bar-wrapper').eq(0); 193 var p_top = top_bar.position().top; 194 var top_h = p_top + top_bar.height(); 195 var fixed_e = jQuery('#header .header-outer-wrapper').eq(0); 196 fixed_e.attr('logo-height', jQuery('.logo-wrapper img',fixed_e).height()); 197 198 var is_changed_e_s = false; 199 var down_pd = 24; // 10px; 200 var logo_rs_h = 30; 201 202 function setTopPos(){ 203 if(ST.disable_header_floating==='y'){ 204 return false ; 205 } 206 207 if(jQuery(window).width()< 959){ 208 return ; 209 } 210 211 var win_top = jQuery(window).scrollTop(); 212 213 if(win_top > top_h) 214 { 215 fixed_e.addClass('fixed'); 216 217 if(is_changed_e_s=== false){ 218 is_changed_e_s = true; 219 220 jQuery('.logo-wrapper',fixed_e).animate({ 221 paddingTop: '-='+(down_pd-4)+'px' 222 },200); 223 224 jQuery('.logo-wrapper img',fixed_e).animate({ 225 height: (logo_rs_h)+'px' 226 },200); 227 228 jQuery('.primary-nav > ul >li >a',fixed_e).animate({ 229 paddingTop: '-='+down_pd+'px', 230 paddingBottom: '-='+down_pd+'px' 231 },200); 232 jQuery('.btn',fixed_e).animate({ 233 marginTop: '-='+down_pd+'px' 234 },200); 235 236 jQuery('.primary-nav > ul >li > ul',fixed_e).animate({ 237 top: '-='+(down_pd*2)+'px' 238 },200); 239 240 } 241 242 }else{ 243 244 if(is_changed_e_s===true){ 245 246 jQuery('.logo-wrapper img',fixed_e).animate({ 247 height: (fixed_e.attr('logo-height')) 248 },200); 249 250 jQuery('.logo-wrapper',fixed_e).animate({ 251 paddingTop: '+='+(down_pd-4)+'px' 252 },200); 253 254 jQuery('.primary-nav > ul >li >a',fixed_e).animate({ 255 paddingTop: '+='+down_pd+'px', 256 paddingBottom: '+='+down_pd+'px' 257 },{ queue: false, duration: 200 }); 258 jQuery('.btn',fixed_e).animate({ 259 marginTop: '+='+down_pd+'px' 260 },200); 261 262 jQuery('.primary-nav > ul >li > ul',fixed_e).animate({ 263 top: '+='+(down_pd*2)+'px' 264 },200); 265 266 is_changed_e_s = false; 267 } 268 269 fixed_e.removeClass('fixed'); 270 fixed_e.css({'top' : ''}); 271 } 272 } 273 274 275 jQuery(window).scroll(function () { 276 setTopPos(); 277 }); 278 279 280 281 // Call the reservation and contact form 282 new ST_Reservation_Form(); 283 new ST_Contact_Form(); 284 285 //Select Box 286 jQuery('.select-box select').fadeTo(0, 0); 287 jQuery('.select-box').each(function() { 288 if(jQuery(this).find('option:selected').length) { 289 jQuery(this).find('span').text(jQuery(this).find('option:selected').text()); 290 } 291 }); 292 jQuery('.select-box select').change(function() { 293 jQuery(this).parent().find('span').text(jQuery(this).find('option:selected').text()); 294 }); 295 296 // Call The Calendar Plugin 297 //new ST_Add_Calendar('#reservation_arrival'); 298 //new ST_Add_Calendar('#reservation_departure'); 299 300 //ddsmoothmenu for top-bar navigation 301 ddsmoothmenu.init({ 302 mainmenuid: "top-nav-id", //menu DIV id 303 orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v" 304 classname: 'top-nav slideMenu', //class added to menu's outer DIV 305 contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"] 306 }); 307 308 //ddsmoothmenu for primary navigation 309 ddsmoothmenu.init({ 310 mainmenuid: "primary-nav-id", //menu DIV id 311 orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v" 312 classname: 'primary-nav slideMenu', //class added to menu's outer DIV 313 contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"] 314}); 315 316 // Primary Navigation for mobile. 317 var primary_nav_mobile_button = jQuery('#primary-nav-mobile'); 318 var primary_nav_cloned; 319 var primary_nav = jQuery('#primary-nav-id > ul'); 320 321 primary_nav.clone().attr('id','primary-nav-mobile-id').removeClass().appendTo( primary_nav_mobile_button ); 322 primary_nav_cloned = primary_nav_mobile_button.find('> ul'); 323 jQuery('#primary-nav-mobile-a').click(function(){ 324 if(jQuery(this).hasClass('primary-nav-close')){ 325 jQuery(this).removeClass('primary-nav-close').addClass('primary-nav-opened'); 326 primary_nav_cloned.slideDown( 400 ); 327 } else { 328 jQuery(this).removeClass('primary-nav-opened').addClass('primary-nav-close'); 329 primary_nav_cloned.slideUp( 400 ); 330 } 331 return false;
332 }); 333 primary_nav_mobile_button.find('a').click(function(event){ 334 event.stopPropagation(); 335 }); 336 337 // Call LayerSlider 338 339 jQuery('#layerslider').layerSlider({ 340 skinsPath : '/css/assets/ls_skins/', 341 skin : 'fullwidth', 342 thumbnailNavigation : 'disabled', 343 hoverPrevNext : false, 344 responsive : true, 345 responsiveUnder : 1366, 346 sublayerContainer : 978, 347 navStartStop:false, 348 imgPreload:true 349 }); 350 351 //comments 352 jQuery('.comments-list').on('click', '.comment-reply-link', function (e) { 353 e.preventDefault(); 354 jQuery('#comments-parent_id').val(jQuery(this).attr('data-reply-id')); 355 return jQuery.scrollTo('#submit-comment',1000); 356 }); 357 358 //scroll-pane 359 jQuery('.scroll-pane').jScrollPane(); 360 361 //form message 362 jQuery('.booking__form').on('click', '.message label', function () { 363 return jQuery(this).next('textarea').toggle(); 364 }); 365 366 // Fitvideos 367 jQuery(".page-wrapper").fitVids(); 368 369 // Thumbnail Hover 370 jQuery(".thumb-wrapper").hover(function(){ 371 jQuery(this).find(".thumb-control-wrapper").animate({ opacity: 1 }, 500).addClass('hover'); 372 }, function(){ 373 jQuery(this).find(".thumb-control-wrapper").animate({ opacity: 0 }, 500).removeClass('hover'); 374 }); 375 376 //lightbox 377 var size = jQuery(window).width(); 378 if(size > 767) { 379 jQuery('img.is_lightbox').each(function () { 380 var src = jQuery(this).attr('src'), 381 title = jQuery(this).attr('title'); 382 jQuery(this).wrap('<a href="' + src + '" rel="prettyPhoto[100]" title=""></a>'); 383 }); 384 } 385 386 // PrettyPhoto 387 jQuery("a[rel^='prettyPhoto']").prettyPhoto({ 388 theme: 'facebook', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ 389 show_title: false 390 }); 391 392 // Hash Change 393 jQuery(window).bind("hashchange", function(){ 394 var url = jQuery.url(); // parse the current page URL 395 var hashOptions = url.fparam('filter'); 396 397 if(typeof(hashOptions)!=="undefined") 398 { 399 jQuery(".cpt-filters a").removeClass("selected"); 400 if(jQuery(".cpt-filters a[href='#filter="+hashOptions+"']").length){ 401 jQuery(".cpt-filters a[href='#filter="+hashOptions+"']").addClass("selected"); 402 } 403 else{ 404 jQuery(".cpt-filters li:first a").addClass("selected"); 405 } 406 407 jQuery(".cpt-items").isotope({filter: hashOptions}); 408 } 409 410 }).trigger("hashchange"); 411 412 //isotope 413 jQuery(".cpt-items").imagesLoaded(run_isotope); 414 415 var FS = {"animation":"slide","pauseOnHover":"true","controlNav":"true","directionNav":"false","animationDuration":"500","slideshowSpeed":"5000","pauseOnAction":"false"}; 416 // Flexslider 417 FS.pauseOnHover = (FS.pauseOnHover === 'true')? true: false; 418 FS.pauseOnAction = (FS.pauseOnAction === 'true')? true: false; 419 FS.controlNav = (FS.controlNav === 'true')? true: false; 420 FS.directionNav = (FS.directionNav === 'true')? true: false; 421 422 jQuery('.flexslider').each(function(){ 423 jQuery(this).flexslider( FS ); 424 }); 425 426 // Browser Resize Event 427 428 jQuery(window).resize(function() { 429 jQuery('.thumb-control-wrapper').each(function(i,el){ 430 431 var new_overlay_w = jQuery(el).prev('img:first').width() - 20; 432 var new_overlay_h = jQuery(el).prev('img:first').height() - 20; 433 434 jQuery(el).css({'width':new_overlay_w,'height':new_overlay_h}); 435 }); 436 437 //isotope 438 //jQuery(".cpt-items").imagesLoaded(run_isotope); /// don't need 439 // run_isotope(); 440 }); 441 442 //datepicker 443 jQuery('.date input').datepicker({ 444 'autoClose': true, 445 'dateFormat': 'dd.mm.yyyy', 446 'minDate': new Date() 447 }); 448 449 jQuery('#booking_main_form, #booking_form').on('click', '.calendar_icon', function () { 450 return jQuery(this).closest('div').find('label').click(); 451 }); 452 453 //comments click 454 jQuery('.blog-comment').on('click', 'a', function () { 455 return jQuery.scrollTo('#submit-comment',1000); 456 }); 457 458 //images in mobile 459 var images = ''; 460 if(size <= 767){ 461 jQuery('.gallery__box_items > a').each(function(i){ 462 images += '<img src="'+ jQuery(this).attr('href') +'">'; 463 }); 464 jQuery('.gallery__box_items').html(images); 465 } 466 467 // Page Load Event 468 // jQuery('.thumb-control-wrapper').each(function(i,el){ 469 // var new_overlay_w = jQuery(el).prev('img:first').width() - 20; 470 // var new_overlay_h = jQuery(el).prev('img:first').height() - 20; 471 // jQuery(el).css({'width':new_overlay_w,'height':new_overlay_h}); 472 // console.log(new_overlay_w,new_overlay_h); 473 // }); 474 475 if(size <= 767 && !device.iphone()){ 476 var phone = jQuery('.call__phone'), 477 callPhoneBox = jQuery('.call__phone-box'), 478 bgBox = jQuery('.call__phone-bg'); 479 480 phone.on('click', function () { 481 var _this = jQuery(this); 482 callPhoneBox.find('.phone').text(_this.attr('data-phone')); 483 callPhoneBox.find('.btn_call').attr('href', 'tel:' + _this.attr('data-phone')); 484 return callPhoneBox.fadeIn() && bgBox.fadeIn(); 485 }); 486 487 callPhoneBox.on('click', '.btn_cancel', function () { 488 return callPhoneBox.fadeOut() && bgBox.fadeOut(); 489 }); 490 491 bgBox.on('click', function () { 492 return callPhoneBox.fadeOut() && bgBox.fadeOut(); 493 }); 494 } 495 496 var roomName = window.location.href.split("#")[1]; 497 if(roomName){ 498 jQuery("form option[value='" + decodeURIComponent(roomName) + "']").prop("selected", true); 499 } 500 roomName = jQuery('.page-title').text(); 501 if(roomName){ 502 jQuery("form option[value='" + roomName + "']").prop("selected", true); 503 } 504 505 jQuery("#carousel_block").owlCarousel({ 506 navigation : true, 507 navigationText: ['',''], 508 items: 2, 509 itemsTablet: [768,2], 510 itemsDesktopSmall: [979,2], 511 itemsDesktop: [1199,2], 512 itemsMobile: [479,1], 513 pagination: false, 514 center: true, 515 margin: 20 516 }); 517 518 madeAjaxForm('#reviews__form'); 519 madeAjaxForm('#booking_form'); 520 madeAjaxForm('#booking_main_form'); 521 522}); // END Document Ready // 523 524function madeAjaxForm(selector){ 525 jQuery(document).on("submit", selector, function(e){ 526 e.preventDefault(); 527 var self = this; 528 var url = jQuery(self).attr('action'); 529 var data = jQuery(self).serialize(); 530 if (!jQuery(self).find('.alert').length){ 531 jQuery(self).append('<div class="alert"></div>'); 532 } 533 534 jQuery.ajax({ 535 type: "POST", 536 dataType: "json", 537 url: url, 538 data: data 539 }).done(function(data){ 540 jQuery(self).find('.alert__box .alert') 541 .removeClass('alert-danger') 542 .removeClass('robot') 543 .removeClass('alert-success') 544 .addClass('alert-' + data.status) 545 .show(); 546 jQuery(self).find('.alert__box').show(); 547 jQuery(self).find('.alert__box .message').html(data.message); 548 549 if (data.status == 'success') { 550 jQuery(self).trigger('reset'); 551 } 552 }); 553 }); 554}
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.