1jQuery(document).ready(function( $ ){ 2 3$(window).load(function(){ 4 setTimeout(function(){ 5 if( !localStorage.getItem('popup_show') ){ 6 localStorage.setItem('popup_show', 1); 7 $('._popup').modal('show'); 8 } 9 }, 4000); 10}); 11 12/* 13* config 14*------------------------------*/ 15var screen = { 16 'window_width' : $(window).width(), 17 'window_height' : $(window).height(), 18 'document_width' : $(document).width(), 19 'document_height' : $(document).height() 20}; 21 22var device = { 23 'tablet_land' : 1024, // landscape 24 'tablet_port' : 768, // portrait 25 'smartphone' : 600 // smartphone 26}; 27 28var device = { 29 'is_desktop' : ( screen.window_width > device.tablet_land ) ? true : false, 30 'is_tablet_land' : ( screen.window_width <= device.tablet_land && screen.window_width >= device.tablet_port ) ? true : false, 31 'is_tablet_port' : ( screen.window_width <= device.tablet_port && screen.window_width >= screen.smartphone ) ? true : false, 32 'is_smartphone' : ( screen.window_width < device.tablet_port) ? true : false 33}; 34 35$('.menu-btn').click(function(){ 36 $(this).find('.burger').toggleClass('open'); 37}) 38 39$('.menu-btn').click(function(){ 40 $('.menu-wrapper').toggleClass('open'); 41 $('.menu-items').toggleClass('hidden'); 42}); 43 44if(!device.is_smartphone && !device.is_tablet_port){ 45 $(window).scroll(function(){ 46 var scroll = $(window).scrollTop(); 47 if(scroll > 100){ 48 $('.menu-wrapper').addClass('sticky'); 49 }else{ 50 $('.menu-wrapper').removeClass('sticky'); 51 } 52 }); 53} 54 55/* 56* pushy menu 57*------------------------------*/ 58// $('.pushy-submenu>a').click(function(e){ 59// e.preventDefault(); 60// $(this).click(function(){ 61// window.location.href = $(this).attr('href'); 62// }); 63// }); 64 65/* 66* enllax 67*------------------------------*/ 68$(window).enllax(); 69 70/* 71* matchHeight 72*------------------------------*/ 73if(device.is_tablet_land || device.is_desktop) 74 initMatchHeight(); 75function initMatchHeight(){ 76 77 // home repertoire 78 $('.home-repertoire .item .inner').matchHeight({ 79 property: 'min-height' 80 }); 81 $('.home-genres .inner').matchHeight({ 82 property: 'min-height' 83 }); 84 85 // event item 86 $('.event-item .inner').matchHeight(); 87 88 //event entry 89 $('.event-entry ._col').matchHeight(); 90 91 // info item 92 $('.info-items .item').matchHeight(); 93 94 // post item 95 $('.post-item .inner').matchHeight(); 96 97 // post item title 98 $('.post-item .title').matchHeight(); 99 100 // home grid 101 $('.home-grid .inner').matchHeight(); 102 103 // home events 104 $('.home-events .item').matchHeight(); 105 $('.home-events .event-title').matchHeight(); 106 107 $('._roles .item').matchHeight(); 108 $('.info-items .item .inner').matchHeight(); 109 110 111} 112 113 114/* 115* slick sliders 116*------------------------------*/ 117$('.home-headline').slick({ 118 autoplay : true, 119 autoplaySpeed : 3000, 120 arrows : true, 121 dots : false, 122 infinite : true, 123 speed : 300, 124 slidesToShow : 1, 125 adaptiveHeight : false, 126 fade : true, 127 pauseOnHover : false, 128 pauseOnFocus : false, 129}).find('.item').fadeIn(300); 130 131$('.initSlideshow').slick({ 132 arrows : true, 133 dots : false, 134 infinite : true, 135 speed : 300, 136 slidesToShow : 3, 137 slidesToScroll : 1, 138 autoplay : true, 139 pauseOnHover : false, 140 pauseOnHover : false, 141 responsive : [ 142 { 143 breakpoint: 1025 , settings: {slidesToShow : 3, slidesToScroll: 3, infinite: true, dots: true } }, 144 { breakpoint: 600 , settings: { slidesToShow: 2, slidesToScroll: 2 } }, 145 { breakpoint: 480 , settings: { slidesToShow: 1, slidesToScroll : 1 } } 146 ] 147}).find('.item').fadeIn(); 148 149$('.parallax-carousel').slick({ 150 arrows : false, 151 dots : false, 152 infinite : true, 153 speed : 300, 154 slidesToShow : 3, 155 slidesToScroll : 1, 156 autoplay : true, 157 pauseOnHover : false, 158 pauseOnHover : false, 159 responsive : [ 160 { 161 breakpoint: 1025 , settings: {slidesToShow : 3, slidesToScroll: 3, infinite: true} }, 162 { breakpoint: 767 , settings: { slidesToShow: 1, slidesToScroll: 1 } }, 163 { breakpoint: 480 , settings: { slidesToShow: 1, slidesToScroll : 1 } } 164 ] 165}).find('.item').fadeIn(); 166 167$('.initVideoSlideshow').slick({ 168 arrows : false, 169 dots : false, 170 infinite : true, 171 speed : 800, 172 slidesToShow : 4, 173 slidesToScroll : 1, 174 autoplay : true, 175 pauseOnHover : false, 176 pauseOnHover : false, 177 responsive : [ 178 { 179 breakpoint: 1025 , settings: {slidesToShow : 3, slidesToScroll: 3, infinite: true} }, 180 { breakpoint: 767 , settings: { slidesToShow: 1, slidesToScroll: 1 } }, 181 { breakpoint: 480 , settings: { slidesToShow: 1, slidesToScroll : 1 } } 182 ] 183}).find('.item').fadeIn(); 184 185 186$('.orchestraSlideshow').slick({ 187 arrows : true, 188 dots : true, 189 infinite : true, 190 speed : 300, 191 slidesToShow : 4, 192 slidesToScroll : 1, 193 autoplay : true, 194 pauseOnHover : false, 195 pauseOnHover : false, 196 responsive : [ 197 { 198 breakpoint: 1025 , settings: {slidesToShow : 3, slidesToScroll: 3, infinite: true, dots: true } }, 199 { breakpoint: 768 , settings: { slidesToShow: 2, slidesToScroll: 2 } }, 200 { breakpoint: 600 , settings: { slidesToShow: 1, slidesToScroll : 1, arrows: fal
200se } } 201 ] 202}).find('.item').fadeIn(); 203 204 205if(device.is_desktop || device.is_tablet_land){ 206 $('.soloistsSlideshow').slick({ 207 arrows : true, 208 dots : true, 209 infinite : true, 210 speed : 300, 211 slidesPerRow : 4, 212 rows : 3, 213 slidesToScroll : 1, 214 autoplay : false, 215 pauseOnHover : false, 216 pauseOnHover : false, 217 responsive : [ 218 { 219 breakpoint: 1025 , settings: { rows: 1, slidesPerRow:2 } }, 220 { breakpoint: 768 , settings: { rows: 1, slidesPerRow:2 } }, 221 { breakpoint: 600 , settings: { rows: 1, slidesPerRow: 1, arrows: false } } 222 ] 223 }).find('.item').fadeIn(); 224} 225 226 227$('.__gallery').slick({ 228 autoplay : true, 229 autoplaySpeed : 3000, 230 arrows : true, 231 dots : true, 232 infinite : true, 233 speed : 300, 234 slidesToShow : 1, 235 adaptiveHeight : false, 236 fade : false, 237 pauseOnHover : false, 238 pauseOnFocus : false, 239}).find('.item').fadeIn(300); 240 241$('.organigramSlideshow').slick({ 242 arrows : true, 243 dots : false, 244 infinite : true, 245 speed : 300, 246 slidesToShow : 4, 247 slidesToScroll : 1, 248 autoplay : true, 249 pauseOnHover : false, 250 pauseOnHover : false, 251 responsive : [ 252 { 253 breakpoint: 1025 , settings: {slidesToShow : 3, slidesToScroll: 3, infinite: true, dots: true } }, 254 { breakpoint: 600 , settings: { slidesToShow: 2, slidesToScroll: 2 } }, 255 { breakpoint: 480 , settings: { slidesToShow: 1, slidesToScroll : 1 } } 256 ] 257}).find('.item').fadeIn(); 258 259/** 260* event terms filter 261*------------------------------*/ 262event_terms_filter(); 263function event_terms_filter(){ 264 $('.terms-filter>li>a').click(function(e){ 265 e.preventDefault(); 266 var _this = $(this); 267 if(!_this.hasClass('active') ){ 268 269 var loading = $('.loading-overlay'); 270 271 $.ajax({ 272 type: 'POST', 273 url: ajax_url, 274 data: { 275 'action': 'event_terms_filter', 276 'term_id' : _this.data('term'), 277 }, 278 beforeSend: function(){ 279 loading.removeClass('hidden'); 280 $('.event-loop-items').empty(); 281 $('.terms-filter>li>a').removeClass('active'); 282 _this.addClass('active'); 283 }, 284 success:function(html){ 285 $('.event-ajax-response').html(html); 286 initMatchHeight(); 287 loading.addClass('hidden'); 288 } 289 }); 290 } 291 292 }); 293} 294 295/** 296* tersm filter - mobile 297*------------------------------*/ 298$('.terms-filter .mobile-menu-btn').click(function(){ 299 $(this).toggleClass('opened'); 300 $('.terms-filter>li').slideToggle(300); 301}); 302 303 304/** 305* video popup 306*------------------------------*/ 307$('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 308 disableOn : 700, 309 type : 'iframe', 310 mainClass : 'mfp-fade', 311 removalDelay : 160, 312 preloader : false, 313 fixedContentPos : false, 314 disableOn: function() { 315 if( $(window).width() < 600 ) { 316 return true; 317 } 318 return true; 319 } 320}); 321 322 323/** 324* newsletter 325*------------------------------*/ 326$('._subscribe').on('submit', function(e){ 327 328 e.preventDefault(); 329 330 var _this = $(this); 331 332 var name = _this.find('input[name=name]'); 333 var email = _this.find('input[name=email_address]'); 334 335 var error = _this.find('.error'); 336 337 var email_err = _this.find('.email-error'); 338 var name_err = _this.find('.name-error'); 339 340 error.hide(); 341 342 // get values 343 var values = { 344 email : email.val(), 345 name : name.val() 346 }; 347 348 // email validation 349 if( !is_valid_email(values.email) || values.email == '' ){ 350 email_err.show(); 351 } 352 353 // name validation 354 if(values.name == ''){ 355 name_err.show(); 356 } 357 358 //success 359 else if ( is_valid_email(values.email) && values.email != '' && values.name != '' ) { 360 361 //send data 362 $.ajax({ 363 type: 'POST', 364 url: ajax_url , 365 data: { action: 'subscribe', data: values }, 366 success: function( response ){ 367 _this.find('.response').empty().append(response.message); 368 } 369 }); 370 } 371}); 372 373function is_valid_email($email){ 374 var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; 375 return emailReg.test( $email ); 376} 377 378 379/** 380* nicescroll 381*------------------------------*/ 382nicescroll(); 383function nicescroll(){ 384 //if(!device.is_smartphone){
385 $('.nicescroll').niceScroll({ 386 cursorcolor: '#fff', 387 cursoropacitymin: 0.5, 388 horizrailenabled: false, 389 railpadding: { top: 0, right: -9, left: 3, bottom: 0 }, 390 }); 391 //} 392} 393 394/** 395* ensemle popup 396*------------------------------*/ 397$('.open-popup').click(function(){ 398 var tar = $(this).attr('href'); 399 $('.popup'+tar).fadeIn(100); 400}); 401$('.popup .close').click(function(e){ 402 $('.popup').fadeOut(100); 403}); 404 405$('.open-popup-image').click(function(e){ 406 var img = $(this).data('image'); 407 var caption = $(this).data('caption'); 408 $('#press-images img').attr('src', img); 409 $('#press-images .caption').empty().append(caption); 410 $('#press-images .download').attr('href', img); 411}); 412 413/** 414* Calendar 415*------------------------------*/ 416$('.open-calendar').click(function(){ 417 var dates = $(this).data('dates'); 418 if(typeof dates != undefined && dates.length){ 419 $('.calendar').fullCalendar('removeEventSources'); 420 $('.calendar').fullCalendar('addEventSource', dates); 421 if(clang == 'sq'){ 422 $('.calendar').fullCalendar({ 423 themeSystem: 'standard', 424 header: { 425 left: 'prev, next today', 426 center: 'title', 427 right: 'month, basicWeek, basicDay' 428 }, 429 buttonText: { 430 today: 'sot', 431 month: 'muaj', 432 week: 'javë', 433 day: 'ditë', 434 list: 'list' 435 }, 436 firstDay: 1, 437 todayName: 'Sot', 438 monthNames: ['Janar','Shkurt','Mars','Prill','Maj','Qershor','Korrik','Gusht','Shtator','Tetor','Nëntor','Dhjetor'], 439 monthNamesShort: ['Janar','Shkurt','Mars','Prill','Maj','Qershor','Korrik','Gusht','Shtator','Tetor','Nentor','Dhjetor'], 440 dayNames: ['E Dielë','E Henë','E Martë','E Mërkurë','E Enjte','E Premte','E Shtune'], 441 dayNamesShort: ['Die','Hën','Mar','Mër','Enj','Pre','Sht'], 442 events: dates, 443 eventClick: function(event) { 444 if (event.permalink) { 445 window.location.href = event.permalink; 446 return false; 447 } 448 }, 449 eventRender: function(event, element){ 450 element.find('.fc-title').append("<br/>"); 451 } 452 }); 453 }else{ 454 $('.calendar').fullCalendar({ 455 themeSystem: 'standard', 456 header: { 457 left: 'prev, next today', 458 center: 'title', 459 right: 'month, basicWeek, basicDay' 460 }, 461 firstDay: 1, 462 events: dates, 463 eventClick: function(event) { 464 if (event.permalink) { 465 window.location.href = event.permalink; 466 return false; 467 } 468 }, 469 eventRender: function(event, element){ 470 element.find('.fc-title').append("<br/>"); 471 } 472 }); 473 } 474 475 // uh, finally, go to the first event date 476 $('.calendar').fullCalendar( 'gotoDate', dates[0]['start'] ); 477 } 478}); 479 480/** 481* Sroll to target element 482*------------------------------*/ 483scroll_to(); 484function scroll_to(){ 485 $('a[data-scroll]').click(function(e){ 486 e.preventDefault(); 487 var elem = $(this).data('scroll'); 488 $('html, body').animate({ 489 scrollTop: $(elem).offset().top 490 }, 300); 491 }); 492} 493 494book_hash(); 495function book_hash(){ 496 var hash = window.location.hash; 497 if(hash == '#book'){ 498 $('.buttons .ticket-btn').trigger('click'); 499 } 500} 501 502/** 503* Reservation form 504*------------------------------*/ 505reservation_form(); 506function reservation_form(){ 507 $events = _OBJ.events; 508 if( typeof $events != 'undefined' ){ 509 $('._show_').empty(); 510 $.each($events, function(idx, event){ 511 $('._show_').append('<option>'+event.name+'</option>'); 512 }); 513 } 514} 515 516 517/** 518* Media Gallery 519*------------------------------*/ 520$('.media-gallery').slick({ 521 dots: false, 522 arrow: false, 523 infinite: false, 524 speed: 300, 525 slidesToShow: 1, 526 slidesToScroll: 1, 527 adaptiveHeight: ( $('.main-content').length ) ? true : false, 528 responsive: [ 529 { 530 breakpoint: 1200, 531 settings: { 532 adaptiveHeight: true 533 } 534 }, 535 ] 536}); 537 538$('._hover-preview') 539.hover( 540 function(){ 541 $(this).find('.preview').fadeIn(200); 542 }, 543 function(){ 544 $(this).find('.preview').fadeOut(200); 545}); 546 547/** 548* GMap 549*------------------------------*/ 550map_init(); 551function map_init(){ 552 553 var mapdata = $('#gmap').attr( 'data-map' ); 554 555 if( typeof mapdata != 'undefined' ){ 556 557 mapdata = $.parseJSON( mapdata ); 558 559 var coords = { 560 lat : parseFloat( mapdata.lat ), 561 lng : parseFloat( mapdata.lng ) 562 }; 563 564 map = new google.maps.Map( document.getElementById( 'gmap' ), { 565 center : coords, 566 zoom : 16, 567 mapTypeId : 'roadmap', 568 draggable : true, 569 scrollwheel : false 570 }); 571 572 var infowindow = new google.maps.InfoWindow(); 573 var marker, i; 574 575 var marker = new google.maps.Marker({ 576 position : coords, 577 map : map, 578 //icon : map_marker 579 }); 580 581 google.maps.event.addListener(marker, 'click', (function(marker, i) { 582 return function() { 583 infowindow.setContent(mapdata.address); 584 infowindow.open(map, marker); 585 } 586 })(marker, i)); 587 } 588} 589 590/* 591* magnific popup - media gallery 592*------------------------------*/ 593$('.open-gallery').click(function(e){
594 e.preventDefault(); 595 596 var items = $(this).attr('data-gallery'); 597 598 $.magnificPopup.open({ 599 items: $.parseJSON( items ), 600 gallery : { 601 enabled : true 602 }, 603 type : 'image', 604 mainClass: 'mfp-fade', 605 }); 606}); 607 608// var cookie = { 609// 'name' : 'tob_lang', 610// 'value' : 'sq', 611// 'lifetime' : 30 // days 612// }; 613 614// // get cookie 615// function getCookie(name) { 616// return localStorage.getItem(name); 617// } 618 619// // set cookie (local storage) 620// function setCookie(name, value, lifetime) { 621// return localStorage.setItem(name, value); 622// } 623 624// // set cookie for the first time (sq by default) 625// if( getCookie( cookie.name ) == null || getCookie(cookie.name == undefined ) ){ 626// setCookie( cookie.name, cookie.value, cookie.lifetime); 627// } 628 629// lang_switcher(); 630// function lang_switcher(){ 631// $('.flags a').click(function(e){ 632// e.preventDefault(); 633// var lang = $(this).attr('href'); 634// document.cookie = "tob_lang="+lang; 635// setTimeout(function(){ 636// location.reload(); 637// }, 300); 638// }); 639// } 640 641/** 642* Contact form 643*------------------------------*/ 644contact_form(); 645function contact_form(){ 646 647 var i = 0; 648 649 var arrIndex = 0; 650 if( clang !='sq' ) 651 arrIndex = 1; 652 653 $('.vfb-item').each(function(index, value){ 654 655 var label = $(this).find('label').text(); 656 var submitText = $(this).find('input[type=submit]').val(); 657 658 var label = label.split('|'); 659 660 if(typeof submitText !='undefined') 661 var submitText = submitText.split('|'); 662 663 $(this).find('label').text(label[arrIndex]); 664 665 if(typeof submitText != 'undefined') 666 $(this).find('input[type=submit]').attr('value', submitText[arrIndex]); 667 668 i++; 669 }); 670} 671 672 673allow_reservation(); 674function allow_reservation(){ 675 $('[not-available]').click(function(e){ 676 e.preventDefault(); 677 }); 678 $('[not-available]').attr('disabled', true); 679} 680 681$('.open-on-render').click(function(){ 682 $('.hidden-on-render').toggle(); 683 $('.remove-on-cv').toggle(); 684}); 685 686});// document ready
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.