1/*! * imagesLoaded PACKAGED v4.1.0 * JavaScript is all like "You images are done yet or what?" * MIT License */ 2!function (t, e) { 3 "function" == typeof define && define.amd ? define("ev-emitter/ev-emitter", e) : "object" == typeof module && module.exports ? module.exports = e() : t.EvEmitter = e() 4}(this, function () { 5 function t() { 6 } 7 8 var e = t.prototype; 9 return e.on = function (t, e) { 10 if (t && e) { 11 var i = this._events = this._events || {}, n = i[t] = i[t] || []; 12 return -1 == n.indexOf(e) && n.push(e), this 13 } 14 }, e.once = function (t, e) { 15 if (t && e) { 16 this.on(t, e); 17 var i = this._onceEvents = this._onceEvents || {}, n = i[t] = i[t] || []; 18 return n[e] = !0, this 19 } 20 }, e.off = function (t, e) { 21 var i = this._events && this._events[t]; 22 if (i && i.length) { 23 var n = i.indexOf(e); 24 return -1 != n && i.splice(n, 1), this 25 } 26 }, e.emitEvent = function (t, e) { 27 var i = this._events && this._events[t]; 28 if (i && i.length) { 29 var n = 0, o = i[n]; 30 e = e || []; 31 for (var r = this._onceEvents && this._onceEvents[t]; o;) { 32 var s = r && r[o]; 33 s && (this.off(t, o), delete r[o]), o.apply(this, e), n += s ? 0 : 1, o = i[n] 34 } 35 return this 36 } 37 }, t 38}), function (t, e) { 39 "use strict"; 40 "function" == typeof define && define.amd ? define(["ev-emitter/ev-emitter"], function (i) { 41 return e(t, i) 42 }) : "object" == typeof module && module.exports ? module.exports = e(t, require("ev-emitter")) : t.imagesLoaded = e(t, t.EvEmitter) 43}(window, function (t, e) { 44 function i(t, e) { 45 for (var i in e) t[i] = e[i]; 46 return t 47 } 48 49 function n(t) { 50 var e = []; 51 if (Array.isArray(t)) e = t; else if ("number" == typeof t.length) for (var i = 0; i < t.length; i++) e.push(t[i]); else e.push(t); 52 return e 53 } 54 55 function o(t, e, r) { 56 return this instanceof o ? ("string" == typeof t && (t = document.querySelectorAll(t)), this.elements = n(t), this.options = i({}, this.options), "function" == typeof e ? r = e : i(this.options, e), r && this.on("always", r), this.getImages(), h && (this.jqDeferred = new h.Deferred), void setTimeout(function () { 57 this.check() 58 }.bind(this))) : new o(t, e, r) 59 } 60 61 function r(t) { 62 this.img = t 63 } 64 65 function s(t, e) { 66 this.url = t, this.element = e, this.img = new Image 67 } 68 69 var h = t.jQuery, a = t.console; 70 o.prototype = Object.create(e.prototype), o.prototype.options = {}, o.prototype.getImages = function () { 71 this.images = [], this.elements.forEach(this.addElementImages, this) 72 }, o.prototype.addElementImages = function (t) { 73 "IMG" == t.nodeName && this.addImage(t), this.options.background === !0 && this.addElementBackgroundImages(t); 74 var e = t.nodeType; 75 if (e && d[e]) { 76 for (var i = t.querySelectorAll("img"), n = 0; n < i.length; n++) { 77 var o = i[n]; 78 this.addImage(o) 79 } 80 if ("string" == typeof this.options.background) { 81 var r = t.querySelectorAll(this.options.background); 82 for (n = 0; n < r.length; n++) { 83 var s = r[n]; 84 this.addElementBackgroundImages(s) 85 } 86 } 87 } 88 }; 89 var d = {1: !0, 9: !0, 11: !0}; 90 return o.prototype.addElementBackgroundImages = function (t) { 91 var e = getComputedStyle(t); 92 if (e) for (var i = /url\((['"])?(.*?)\1\)/gi, n = i.exec(e.backgroundImage); null !== n;) { 93 var o = n && n[2]; 94 o && this.addBackground(o, t), n = i.exec(e.backgroundImage) 95 } 96 }, o.prototype.addImage = function (t) { 97 var e = new r(t); 98 this.images.push(e) 99 }
99, o.prototype.addBackground = function (t, e) { 100 var i = new s(t, e); 101 this.images.push(i) 102 }, o.prototype.check = function () { 103 function t(t, i, n) { 104 setTimeout(function () { 105 e.progress(t, i, n) 106 }) 107 } 108 109 var e = this; 110 return this.progressedCount = 0, this.hasAnyBroken = !1, this.images.length ? void this.images.forEach(function (e) { 111 e.once("progress", t), e.check() 112 }) : void this.complete() 113 }, o.prototype.progress = function (t, e, i) { 114 this.progressedCount++, this.hasAnyBroken = this.hasAnyBroken || !t.isLoaded, this.emitEvent("progress", [this, t, e]), this.jqDeferred && this.jqDeferred.notify && this.jqDeferred.notify(this, t), this.progressedCount == this.images.length && this.complete(), this.options.debug && a && a.log("progress: " + i, t, e) 115 }, o.prototype.complete = function () { 116 var t = this.hasAnyBroken ? "fail" : "done"; 117 if (this.isComplete = !0, this.emitEvent(t, [this]), this.emitEvent("always", [this]), this.jqDeferred) { 118 var e = this.hasAnyBroken ? "reject" : "resolve"; 119 this.jqDeferred[e](this) 120 } 121 }, r.prototype = Object.create(e.prototype), r.prototype.check = function () { 122 var t = this.getIsImageComplete(); 123 return t ? void this.confirm(0 !== this.img.naturalWidth, "naturalWidth") : (this.proxyImage = new Image, this.proxyImage.addEventListener("load", this), this.proxyImage.addEventListener("error", this), this.img.addEventListener("load", this), this.img.addEventListener("error", this), void (this.proxyImage.src = this.img.src)) 124 }, r.prototype.getIsImageComplete = function () { 125 return this.img.complete && void 0 !== this.img.naturalWidth 126 }, r.prototype.confirm = function (t, e) { 127 this.isLoaded = t, this.emitEvent("progress", [this, this.img, e]) 128 }, r.prototype.handleEvent = function (t) { 129 var e = "on" + t.type; 130 this[e] && this[e](t) 131 }, r.prototype.onload = function () { 132 this.confirm(!0, "onload"), this.unbindEvents() 133 }, r.prototype.onerror = function () { 134 this.confirm(!1, "onerror"), this.unbindEvents() 135 }, r.prototype.unbindEvents = function () { 136 this.proxyImage.removeEventListener("load", this), this.proxyImage.removeEventListener("error", this), this.img.removeEventListener("load", this), this.img.removeEventListener("error", this) 137 }, s.prototype = Object.create(r.prototype), s.prototype.check = function () { 138 this.img.addEventListener("load", this), this.img.addEventListener("error", this), this.img.src = this.url; 139 var t = this.getIsImageComplete(); 140 t && (this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), this.unbindEvents()) 141 }, s.prototype.unbindEvents = function () { 142 this.img.removeEventListener("load", this), this.img.removeEventListener("error", this) 143 }, s.prototype.confirm = function (t, e) { 144 this.isLoaded = t, this.emitEvent("progress", [this, this.element, e]) 145 }, o.makeJQueryPlugin = function (e) { 146 e = e || t.jQuery, e && (h = e, h.fn.imagesLoaded = function (t, e) { 147 var i = new o(this, t, e); 148 return i.jqDeferred.promise(h(this)) 149 }) 150 }, o.makeJQueryPlugin(), o 151}); 152 153/* smartresize */ 154!function (n, r) { 155 var t = function (n, r, t) { 156 var e; 157 return function () { 158 function i() { 159 t || n.apply(u, a), e = null 160 } 161 162 var u = this, a = arguments; 163 e ? clearTimeout(e) : t && n.apply(u, a), e = setTimeout(i, r || 100) 164 } 165 }; 166 jQuery.fn[r] = function (n) { 167 return n ? this.bind("resize", t(n)) : this.trigger(r) 168 } 169}(jQuery, "smartresize"); 170 171////////////// JQUERY CONFLICT NO PLEASE 172(function ($) { 173 //Simplified 'Supersized': keeps original image aspect ratio and centers image; 174 function resizeAndCenterImages(imagesContainerSelector) { 175 if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) { 176 console.log('slideshow resiz ' + imagesContainerSelector.size); 177 } 178 var slides = $(imagesContainerSelector).find('>div'); 179 var screen_width = $(imagesContainerSelector).width(); 180 var screen_height = $(imagesContainerSelector).height(); 181 var image_width = sshow_images_w; 182 var image_height = sshow_images_h; 183 var imageWRatio = image_width / image_height; 184 var imageHRatio = image_height / image_width; 185 var res_w; 186 var res_h; 187 var res_ox; 188 var res_oy; 189 if ((res_h = screen_height) && (res_w = res_h * imageWRatio) >= screen_width) { 190 ; 191 } else { 192 if ((res_w = screen_width) && (res_h = res_w * imageHRatio) >= screen_height) { 193 ; 194 } 195 } 196 res_ox = (res_w == screen_width ? 0 : '-' + ((res_w - screen_width) / 2)); 197 res_oy = (res_h == screen_height ? 0 : '-' + ((res_h - screen_height) / 2)); 198 $.each(slides, function (index, slide) { 199 $(slide).find('img').css({ 200 'width': res_w + 'px', 201 'height': res_h + 'px', 202 'left': res_ox + 'px', 203 'top': res_oy + 'px' 204 }); 205 }); 206 207 } 208 209 // Resized 2.0 : keeps original image aspect ratio and centers image; 210 function resize_images(divs) { 211 var boxes = jQuery('[data-resize=true]'); 212 if (boxes.length == 0) { 213 if (typeof (divs) === 'undefined') return; 214 boxes = jQuery(divs); 215 } 216 217 if (boxes.length > 0) { 218 jQuery.each(boxes, function (index, box) { 219 var screen_width = jQuery(box).outerWidth(); 220 var screen_height = jQuery(box).outerHeight(); 221 var img = jQuery(box).find('img'); 222 var img_w = img.outerWidth(); 223 var img_h = img.outerHeight(); 224 //console.log(img.outerWidth()+'w'); 225 //console.log(img.outerHeight()+'h'); 226 //console.log(screen_width+'screen_width'); 227 //console.log(screen_height+'screen_height'); 228 var image_w = (typeof (img_w) !== 'undefined') ? img_w : jQuery(box).data('img_width'); 229 var image_h = (typeof (img_h) !== 'undefined') ? img_h : jQuery(box).data('img_height'); 230 var imageWRatio = image_w / image_h; 231 var imageHRatio = image_h / image_w; 232 var res_w; 233 var res_h; 234 var res_ox; 235 var res_oy; 236 237 if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) { 238 //console.log( $(box) ); 239 console.log('resize ' + $(box) + ' w:' + image_w + ' h:' + image_h); 240 } 241 if ((res_h = screen_height) && (res_w = res_h * imageWRatio) >= screen_width) { 242 ; 243 } else { 244 if ((res_w = screen_width) && (res_h = res_w * imageHRatio) >= screen_height) { 245 ; 246 } 247 } 248 res_ox = (res_w == screen_width ? 0 : '-' + ((res_w - screen_width) / 2)); 249 res_oy = (res_h == screen_height ? 0 : '-' + ((res_h - screen_height) / 2)); 250 251 img.css({ 252 'width': res_w + 'px', 253 'height': res_h + 'px', 254 'left': res_ox + 'px', 255 'top': res_oy + 'px' 256 }); 257 }); 258 } 259 } 260 261 //Post-loads images and starts slideshow 262 function doSlideshow(imagesContainerSelector) { 263 if (typeof (sshow_image_data) !== 'undefined' && sshow_image_data.length > 0) { 264 $.each(sshow_image_data, function (index, imgset) { 265 266 var img = $('<img/>').attr('src', imgset['url']).attr('alt', imgset['title']),
267 slider = $('<div class="slide"/>'); 268 slider.append(img); 269 if (typeof (imgset['caption']) !== 'undefined') { 270 // var caption = $('<div class="caption_box" />').append(imgset['caption']) ; 271 var caption = imgset['caption']; 272 slider.append(caption); 273 } 274 $(imagesContainerSelector).append(slider); 275 276 }); 277 //initialize deferred object for imagesLoaded 278 var dfd = $(imagesContainerSelector).imagesLoaded(function ($images, $proper, $broken) { 279 $('.loading_sshow .total').html($images.length + '...'); 280 }); 281 var counter = 0; 282 //Everytime an image ends loading... 283 dfd.progress(function (isOk, $image, $proper, $broken) { 284 counter++; 285 $('.loading_sshow .progress').html(counter); 286 }); 287 //When all images are loaded... 288 dfd.always(function () { 289 if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) { 290 console.log('slideshow loaded'); 291 } 292 // resize ss box 293 resizeSlideBox(); 294 // resize ss images 295 resizeAndCenterImages(imagesContainerSelector); 296 297 $(window).resize(function () { 298 // resize ss box 299 resizeSlideBox(); 300 // resize ss images 301 resizeAndCenterImages(imagesContainerSelector); 302 303 }); 304 if (sshow_image_data.length == 1) { 305 $('.loading_sshow').html('').fadeOut(2000); 306 } else { 307 $(imagesContainerSelector).cycle({ 308 timeout: 9000, 309 speed: 3000, 310 'slides': ' > div ', 311 // pager :"#slideshow_wrapper .pager", 312 next: "#slideshow_wrapper .next", 313 prev: "#slideshow_wrapper .prev", 314 }).on('cycle-after', function () { 315 $('.caption').addClass('visible'); 316 }).on('cycle-before', function () { 317 $('.caption').removeClass('visible'); 318 }); 319 resizeAndCenterImages(imagesContainerSelector); 320 $('.loading_sshow').html('').fadeOut(2000); 321 } 322 323 }); 324 } 325 } 326 327 // check for mobiles and tablets 328 function refresh_size_queries() { 329 var classes = []; 330 window_width = $(window).width(); 331 window_height = $(window).height(); 332 333 is_mobile = (window_width < 768); 334 is_tablet_portrait = (window_width >= 768 && window_width < 992); 335 is_tablet_landscape = (window_width >= 992 && window_width < 1200 && window_height <= 768); 336 is_tablet = is_tablet_portrait || is_tablet_landscape; 337 338 if (is_mobile) { 339 classes.push('mq_mobile'); 340 } 341 if (is_tablet_portrait) { 342 classes.push('mq_tablet_portrait'); 343 } 344 if (is_tablet_landscape) { 345 classes.push('mq_tablet_landscape'); 346 } 347 if (is_tablet) { 348 classes.push('mq_tablet'); 349 } 350 351 $('html').removeClass('mq_mobile'); 352 $('html').removeClass('mq_tablet_portrait'); 353 $('html').removeClass('mq_tablet_landscape'); 354 $('html').removeClass('mq_tablet'); 355
356 $('html').addClass(classes.join(' ')); 357 } 358 359 360 // slideshow box resizing 361 function resizeSlideBox() { 362 var slide_h = 0; 363 var window_width = jQuery(window).width(); 364 var window_height = jQuery(window).height(); 365 var mobile_bar_h = jQuery('#mobile_bar').height(); 366 //var mobile_head_h = jQuery('#mobile_container').height(); 367 var divs = jQuery('#slideshow_wrapper'); 368 369 if (window_width > 1200) { 370 slide_h = window_height; 371 } 372 if (window_width >= 992 && window_width < 1200) { 373 slide_h = window_height; 374 } 375 if (window_width < 992) { 376 slide_h = window_height - mobile_bar_h; 377 } 378 if (window_width < 767) { 379 slide_h = window_height - mobile_bar_h; 380 } 381 divs.css({ 382 height: slide_h 383 }); 384 } 385 386 // menu scrolling 387 function menu() { 388 // elems 389 var header_wrap = jQuery("#header_wrapper"); 390 var sshow = jQuery("#slideshow_wrapper"); 391 // waypoint 392 var waypoint; //// header_wrap.outerHeight(true) 393 waypoint = parseInt(sshow.outerHeight(true) - header_wrap.outerHeight(true) - 70); 394 395 // LALLA 396 if (!is_mobile) { 397 if (jQuery(window).scrollTop() >= waypoint) { 398 if (header_wrap.hasClass('scrolled')) return; 399 header_wrap.addClass("scrolled"); 400 } else { 401 header_wrap.removeClass("scrolled"); 402 } 403 } else { 404 header_wrap.removeClass("scrolled"); 405 } 406
407 /////////////// WINDOW SCROLL 408 jQuery(window).scroll(function () { 409 if (!is_mobile) { 410 if (jQuery(window).scrollTop() >= waypoint) { 411 if (header_wrap.hasClass('scrolled')) return; 412 header_wrap.addClass("scrolled"); 413 } else { 414 header_wrap.removeClass("scrolled"); 415 } 416 } else { 417 header_wrap.removeClass("scrolled"); 418 } 419 }); 420 // rooms action 421 // action on link 422 jQuery('.menu li.menu-nolink a').on('click', function (e) { 423 if (jQuery(this).closest('li.dropdown').hasClass('current-menu-item')) { 424 e.stopPropagation(); 425 e.preventDefault(); 426 // 427 var href_uri_pcs = jQuery(this).attr('href').split('#'); 428 console.log(href_uri_pcs); 429 $('html,body').animate({ 430 scrollTop: jQuery('#' + href_uri_pcs[1]).offset().top - jQuery('#header_wrapper').outerHeight(true) 431 }, 1000); 432 window.location.hash = '#' + href_uri_pcs[1]; 433 } else { 434 return true; 435 } 436 }); 437 // arriving from another page to rooms page with # 438 var hash = window.location.hash; 439 if ((hash) !== '') { 440 setTimeout(function () { 441 $('html,body').animate({ 442 scrollTop: $(hash).offset().top - jQuery('#header_wrapper').outerHeight(true) 443 }, 2000); 444 }, 800); 445 } 446 447 } 448 449 450 // menu for mobile 451 function mobileMenu() { 452 var mobile_menu_wrap = $('#mobile_menu_wrap'); 453 $('a#open_menu_mobile').on('click tap', function (e) { 454 e.preventDefault(); 455 console.log(mobile_menu_wrap); 456 console.log(mobile_menu_wrap.hasClass('open')); 457 if (mobile_menu_wrap.hasClass('open')) { 458 459 mobile_menu_wrap.stop().animate({ 460 height: 0 461 }, 300, function () { 462 $(this).removeClass('open'); 463 console.log('removeClass '); 464 }); 465 } else { 466 // calculate height 467 var mobile_menu_cont_h = parseInt($(window).height() - $('#mobile_container').outerHeight() - $('#mobile_bar').outerHeight()); 468 console.log($(window).outerHeight()); 469 console.log($('#mobile_container').outerHeight()); 470 console.log($('#mobile_bar').outerHeight()); 471 console.log(mobile_menu_cont_h); 472 mobile_menu_wrap.stop().animate({ 473 height: mobile_menu_cont_h 474 // top: $('#mobile_container').outerHeight() 475 }, 300, function () { 476 console.log('addclass '); 477 $(this).addClass('open'); 478 }); 479 } 480 }); 481 482 483 // $(window).resize(function(){ 484 // if($('#open_menu_mobile').hasClass('open')) { 485 // // $('#mobile_menu').css({display: 'block', 'max-height': $(window).height()-100}); 486 // if (!is_mobile ) { 487 // if($('html,body').hasClass('noscroll')){ 488 // $('html,body').removeClass('noscroll'); 489 // } 490 // } else { 491 // if(!$('html,body').hasClass('noscroll')){ 492 // $('html,body').addClass('noscroll'); 493 // } 494 // } 495 // } 496 // }); 497 498 // menu sub 499 $('#mobile_menu ul > li.menu-item-has-children > a').on('click tap', function (e) { 500 e.preventDefault(); 501 console.log('click'); 502 var parent_li = $(this).parent('li'); 503 if (!parent_li.hasClass('open')) { 504 $('#menu_mobile .sub-menu').fadeOut().parent('li').removeClass('open'); 505 parent_li.addClass('open').find('.sub-menu').fadeIn(); 506 } else { 507 parent_li.removeClass('open').find('.sub-menu').fadeOut(); 508 509 } 510 }); 511 $('#mobile_menu ul > li.menu-item-has-children').each(function () { 512 var element = $(this), 513 ul = element.find('ul'), 514 text = element.find('>a').text(), 515 url = element.find('>a').attr('href'), 516 new_element = $('<li/>').append($('<a/>', {'href': url}).html(text)); 517 if (!$(this).hasClass('rooms_label')) { 518 ul.prepend(new_element); 519 } 520 }); 521 522 523 } 524 525 function animations() { 526 527 $('.waypoint_50').waypoint(function () { 528 $(this).addClass('animated'); 529 }, {offset: '50%'});
530 531 $('.waypoint_70').waypoint(function () { 532 $(this).addClass('animated'); 533 }, {offset: '70%'}); 534 535 $('.waypoint_80').waypoint(function () { 536 $(this).addClass('animated'); 537 }, {offset: '80%'}); 538 539 } 540 541 // function for index pages 542 function box_logo() { 543 if ($('.box_content_row ').length == 0) return; 544 $('.box_content_row').each(function () { 545 var box = $(this); 546 box.imagesLoaded() 547 .progress(function (instance, image) { 548 }) 549 .always(function (instance) { 550 }) 551 .done(function (instance) { 552 var my_height = box.find('.box_content').outerHeight(true); 553 box.find('.thumb.box_content_col a').css({ 554 'height': my_height 555 }); 556 resize_images(); 557 }) 558 .fail(function () { 559 }); 560 }); 561 } 562 563 // function for rooms page 564 function rooms_box_logo() { 565 if ($('.thumb_services').length == 0) return; 566 $('.thumb_services').each(function () { 567 var box = $(this); 568 box.imagesLoaded() 569 .progress(function (instance, image) { 570 }) 571 .always(function (instance) { 572 }) 573 .done(function () { 574 var rooms_box = box.closest('.single_room'); 575 var content_box = rooms_box.find('.col_big .content'); 576 var my_height = content_box.outerHeight(true); 577 box.css({ 578 'height': my_height 579 }); 580 resize_images(box); 581 }) 582 .fail(function () { 583 }); 584 }); 585 } 586 587 // valign 588 /*function valign(){ 589 if( $('.valign').length == 0) return; 590 $('.valign').each(function(){ 591 if( jQuery(window).width() < 767 ){ 592 $(this).css({ 593 "margin-top" : 0 594 }); 595 } else { 596 var parent_h = $(this).parent().height(); 597 var box_h = $(this).outerHeight(); 598 var margin_top = parseInt( (parent_h-box_h)/ 2,10); 599 if(parent_h<box_h) return; 600 $(this).css({ 601 "margin-top" : margin_top 602 }); 603 } 604 605 }); 606 }*/ 607 608 609 //Post-loads images and starts slideshow 610 function doGallery(imagesContainerSelector) { 611 if (typeof (photogallery_image_data) !== 'undefined' && photogallery_image_data.length > 0) { 612 $.each(photogallery_image_data, function (index, imgset) { 613 614 var img = $('<img/>').attr('src', imgset['url']).attr('alt', imgset['title']); 615 var img_box = $('<div class="image" data-resize="true" data-img_width="' + photogallery_images_w + '" data-img_height="' + photogallery_images_h + '"/>'); 616 img_box.append(img); 617 if (typeof (imgset['caption']) !== 'undefined') { 618 var caption = $('<div class="caption_box transition_03" />').append(imgset['caption']); 619 img_box.append(caption); 620 } 621 slider = $('<div class="slide"/>'); 622 slider.append(img_box); 623 $(imagesContainerSelector).append(slider); 624 625 }); 626 //initialize deferred object for imagesLoaded 627 $(imagesContainerSelector).imagesLoaded() 628 .progress(function (instance, image) { 629 }) 630 .always(function (instance) { 631 }) 632 .done(function (instance) { 633 if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) { 634 console.log('photogallery loaded'); 635 } 636 637 var doGalleryRooms = function () { 638 // var window_w = $(window).outerWidth(); 639 var window_w = $('#photogallery').outerWidth(); 640 //var cycle_w = Math.floor(window_w*0.8); 641 var cycle_w = Math.floor($('#page .container-fluid.custom_container').width()); 642 $(imagesContainerSelector).css('width', cycle_w + 'px'); 643 $(imagesContainerSelector).find('.slide').css('width', cycle_w + 'px'); 644 $(imagesContainerSelector).attr('data-cycle-carou
644sel-visible', "1").cycle({ 645 // 'cycle-carousel-visible': 1, 646 'cycle-carousel-fluid': true, 647 fx: 'carousel', 648 timeout: 0, 649 'slides': ' > div ', 650 next: "#photogallery .next", 651 prev: "#photogallery .prev", 652 'slide-dimension': cycle_w 653 }); 654 var overlay_w = Math.floor((window_w - cycle_w) / 2); 655 $('#photogallery .overlay').css('width', overlay_w + 'px'); 656 resize_images('.slideshow_wrapper .image'); 657 }; 658 doGalleryRooms(); 659 660 $(window).smartresize(function () { 661 // slideshow resizing 662 if ($('#photogallery ').length > 0) { 663 // destroy 664 $(imagesContainerSelector).cycle('destroy'); 665 $(imagesContainerSelector + ' .cycle-sentinel').remove(); 666 $(imagesContainerSelector).attr('style', ''); 667 $(imagesContainerSelector).css('left', 0); 668 // rebuild 669 doGalleryRooms(); 670 } 671 }); 672 }) 673 .fail(function () { 674 }); 675 } 676 } 677 678 /////////////// WINDOW RESIZE 679 $(window).smartresize(function () { 680 681 // resizing images 682 resize_images(); 683 684 // detecting screen dimensions 685 refresh_size_queries(); 686 687 // vertical align 688 //valign(); 689 690 // menu 691 menu(); 692 693 // menu mobile 694 // mobileMenu(); 695 696 // logo resizing 697 box_logo(); 698 699 // rooms logo 700 rooms_box_logo(); 701 702 }); 703 704 /////////////// WINDOW SCROLL 705 $(window).scroll(function () { 706 707 708 }); 709 710 711 /////////////// DOM READY 712 $(document).ready(function () { 713 714 // detecting screen dimensions 715 refresh_size_queries(); 716 717 // background slideshow 718 if ($('#slideshow .cycle').length > 0) { 719 doSlideshow('#slideshow .cycle'); 720 } 721 722 // SEO ? 723 $('#seobar').html($('#seobar_wrapper ').html()); 724 $('#seobar_wrapper').html(''); 725 726 // language menu 727 $('#lang_list a').fancybox({ 728 'closeBtn': false, 729 'padding': 0 730 }); 731 $('#close_lang').on('click', function () { 732 $.fancybox.close(); 733 }); 734 735 // menu 736 menu(); 737 738 // menu mobile 739 mobileMenu(); 740 741 // go down btn 742 $('#btn_down').on('click', function () { 743 $('html,body').animate({ 744 scrollTop: $(window).height() - $('#header_wrapper').outerHeight() + 79 745 }, 1000); 746 }); 747 748 // animations 749 animations(); 750 751 // logo resizing 752 box_logo(); 753 754 // vertical align 755 //valign(); 756 757
758 /////// OFFERS INIT 759 OffersManager.init(); 760 // callback on error: 761 OffersManager.callbacks.onError = function (selector) { 762 763 //if( selector=='#FB_so_home ul' || selector=='#FB_so_preview ul' ) { 764 // container 765 var container_selector = selector.replace('ul', ''); 766 jQuery(container_selector).html('No Offers Available'); 767 //} 768 769 }; 770 //This callback will be called when a snippet loads stuff inside our window. 771 OffersManager.callbacks.onSingle = function (selector) { 772 if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) { 773 console.log('offers manager selector: ' + selector); 774 } 775 // ALL OFFERS except roooms 776 if ($('.room_special_offer').length > 0) return; 777 // wrapping 778 jQuery(selector).find('.promotion').addClass('clearfix').wrap('<div class="promotion_wrap"></div>'); 779 // boostrapping 780 // dots on preview 781 jQuery(selector).find(".promotion .description").wrap("<div class='ellipsis'></div>"); 782 // bind fancy on details buttons 783 jQuery('.promo-wrapper').each(function () { 784 var el = $(this); 785 var details = el.find('.details'); 786 var details_html = details.html(); 787 html = '<div class="promotion_details">' + details_html + '<a href="javascript:;" class="close_off transition_03"><span class="fa fa-times"></span></a></div>'; 788 el.append(html); 789 el.find('.promotion >div').wrapAll('<div class="promo_content"></div>'); 790 jQuery(this).find('.more a').removeAttr('onclick'); 791 jQuery(this).find('.more a, .title, .price, .image').click(function () { 792 console.log('click'); 793 $(this).closest('.promo-wrapper').addClass('animate'); 794 }); 795 796 }); 797 // close button 798 $('.close_off').on('click', function () { 799 $(this).closest('.promo-wrapper').removeClass('animate'); 800 }); 801 802 // home offers 803 if (selector == '#FB_so_home ul') { // || selector=='#FB_so_preview ul' 804 jQuery(selector).find('.promo-wrapper').addClass('col-custom-md-4 col-custom-sm-6 col-custom-xs-12'); 805 // wmoved 806 jQuery(selector).find('.promo-wrapper').addClass('wmoved waypoint_50 transition_08'); 807 // retrigger animations 808 animations(); 809 } 810 811 // PAGE OFFERS 812 if (selector == '#FB_so ul') { 813 jQuery(selector).find('.promo-wrapper').addClass('col-custom-md-4 col-custom-sm-6 col-custom-xs-12'); 814 } 815 816 }; // end offers Management 817 818 // general gallery 819 $('a.fancy').fancybox({ 820 padding: 0, 821 wrapCSS: 'fb_style_fancy' 822 }); 823 824 // map 825 if ($('#map_canvas').length > 0) { 826 initialize_map('map_canvas'); 827 } 828 829 // gallery 830 if ($('#photogallery').length > 0) { 831 doGallery('#photogallery .cycle'); 832 } 833 834 // rooms gallery 835 $('.fancy_gallery').fancybox({ 836 padding: 0, 837 helpers: { 838 thumbs: { 839 width: 150, 840 height: 100 841 } 842 } 843 }); 844 845 // rooms logo 846 rooms_box_logo(); 847 848 // location page 849 jQuery('#destinationSubmit').on('click', function () { 850 var start = jQuery('input[name=location]:checked').val(); 851 calcRoute(start); 852 }); 853 854 // gallery page 855 if ($('#gallery').length > 0) { 856 $('#gallery').imagesLoaded() 857 .progress(function (instance, image) { 858 }) 859 .always(function (instance) { 860 }) 861 .done(function () { 862 // isotope 863 var $grid = $('.all_filter_gallery').isotope(); 864 $('.filter-button-group').on('click', 'button', function () { 865 $('.filter-button-group button').removeClass('active'); 866 $(this).addClass('active'); 867 var filterValue = $(this).attr('data-filter'); 868 $grid.isotope({ 869 filter: filterValue 870 /*masonry: { 871 gutter: 0 872 }*/ 873 }); 874 }); 875 876 $grid.on('arrangeComplete', function (event, filteredItems) { 877 }); 878 879 $grid.isotope(); 880 }) 881 .fail(function () { 882 if ((typeof (window.console) !== 'undefined') && (typeof (console.log) === 'function')) { 883 console.log('all images loaded, at least one is broken'); 884 } 885 }); 886 887 $('#gallery .thumb_gallery').mouseenter(function () { 888 $('.thumb_gallery').addClass('no_hover'); 889 $(this).removeClass('no_hover'); 890 }) 891 $('#gallery .thumb_gallery').mouseleave(function () { 892 $('.thumb_gallery').removeClass('no_hover'); 893 }) 894 } 895 896 // history gallery 897 if ($('#mini_gallery').length > 0) { 898 $('#mini_gallery .carousel').owlCarousel({ 899 loop: true, 900 margin: 10, 901 nav: false, 902 autoplay: true, 903 responsive: { 904 0: { 905 items: 2 906 }, 907 600: { 908 items: 4 909 }, 910 1000: { 911 items: 5 912 } 913 } 914 }) 915 } 916 // footer menu - move the el with custom class move_last_el at the end of the list 917 var moveLastEl = $('#footer_menu .menu .move_last_el'); 918 moveLastEl.appendTo('#menu-footer-menu-it'); 919 }); /* END DOCUMENT READY */ 920 921})(jQuery); 922 923 924
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.