1 2var ismobile = $('#ismobile').is(":visible"); 3var istablet = $('#istablet').is(":visible"); 4var bodypage = $('body').data("page"); 5var topWaveH = 3000; 6var topWaveT = -3000; 7var topWaveTimeout1 = ''; 8var topWaveTimeout2 = ''; 9var topWaveTimeout3 = ''; 10var setPagelinesTimeoutId = ''; 11 12if( 1 ){ window.onresize = resizes; } 13 14$(window).bind('scroll', function () 15{ 16 ismobile = $('#ismobile').is(":visible"); 17 var st = $(document).scrollTop(); 18 // if($('body').hasClass('invertheader')) { 19 // if (st > 100 /*$(window).height()*/) { 20 // $('body').addClass('invertheaderdisabled'); 21 // } else { 22 // $('body').removeClass('invertheaderdisabled'); 23 // } 24 // } 25 // else 26 if (st < 30) 27 { 28 if (st == 0) { resizes() } 29 $('body').removeClass('fixheader'); 30 } 31 else if (st > 225) { 32 $('body').removeClass('menu-x'); 33 $('#menu').removeClass('x'); 34 $('body').addClass('fixheader'); 35 } 36 else { 37 $('body').addClass('fixheader'); 38 } 39}); 40 41$(document).ready(function () 42{ 43 bodypage = $('body').data("page"); 44 var ismobile = $('#ismobile').is(":visible"); 45 var istablet = $('#istablet').is(":visible"); 46 if( site.host.length ) $('a').each(function () 47 { 48 if( $(this).attr('href') && $(this).attr('href').substr(0, 4) == 'http' && -1 == $(this).attr('href').indexOf(site.host) ) 49 { 50 $(this).attr('target', '_blank'); 51 } 52 }); 53 // 54 if (ismobile) 55 { 56 if (site.page == 'kiallitok') 57 { 58 $('body').removeClass('inverthead headbg'); 59 $('body').css('background-image', 'unset'); 60 } 61 else if (site.page == 'blog') 62 { 63 var post_color_top_h = 0; 64 if ($('#post .content img').eq(1).length) { 65 var o = $('#post .content img').eq(1).offset(); 66 var it = o.top; 67 if (it) { 68 post_color_top_h = it - $('#post.color-top').offset().top + 50; 69 } 70 } else { 71 var post_color_top_h = $('#post .content').height() + 20; 72 } 73 if (post_color_top_h) { 74 $('body').append('<style>#post.color-top:before{height: ' + post_color_top_h + 'px;}</style>'); 75 } 76 } 77 78 } 79 80 if (window.location.hash == '#jelentkezes') 81 { 82 setTimeout(function(){ 83 $('html, body').animate({ 84 scrollTop: $(window.location.hash).offset().top-$('#header-wrap').outerHeight()-70 85 }, 350); 86 }, 200); 87 } 88 89 $('body > *').each(function() 90 { 91 if ($(this).attr('id') != 'pagebg' && $(this).attr('id') != 'header-wrap' /*&& $(this).attr('id') != 'firstSlider-wrap'*/) 92 { 93 $(this).addClass('hidemenux'); 94 } 95 }); 96 97 $('.link-button').each(function() 98 { 99 $(this).append('<span style="display: inline-block;vertical-align: bottom;padding-bottom: 2px;"> â</span>'); 100 }); 101 102 // $( ".pagewidth-half-left, .pagewidth-half-left+.pagewidth-half-right" ).wrapAll( '<div class="pagewidth-half-wrap bgcolor"><div class="inner pagewidth mb240"></div></div>' ); 103 104 // sitebuild auto reload 105 if (site.is_dev) { 106 setInterval(function () { 107 $.ajax({ 108 url: site.base_script_url, 109 type: "GET", 110 data: {reloadSitebuild: 1}, 111 dataType: "json", 112 // async: true, 113 // cache: true, 114 success: function ( data, textStatus, jqXHR ) { 115 // pp( '--' ); 116 if (data.reload) { 117 window.location.reload(); 118 } 119 }, 120 error: function ( jqXHR, textStatus, errorThrown ) { 121 if(typeof console !== 'undefined') console.log( textStatus ); 122 }, 123 complete: function ( jqXHR, textStatus ) { 124 // if(typeof console !== 'undefined') console.log( textStatus ); 125 // if(typeof console !== 'undefined') console.log( jqXHR.responseJSON ); 126 }, 127 }); 128 }, 2000); 129 } 130 // 131 /* 132 if ($('body').hasClass('testsite')) 133 { 134 setPagelines = function () 135 { 136 var exhibitors_height = $('#exhibitors').height(); 137 var lines = [ 138 // ['body.page-fooldal #jegyek table:gt(0):lt(2)', -700], 139 // ['body.page-fooldal #jegyek table:gt(1)', -900], 140 ['body.page-fooldal #jegyek table:gt(0):lt(2)', -100], 141 ['body.page-fooldal #jegyek table:gt(1)', -300], 142 ['body.page-rolunk .box-registration-opener', -1300, 2700, 0.5], 143 ['body.page-rolunk .box-registration-opener .text', -500, 1800, 0.5], 144 // ['body.page-fooldal .box-registration-opener', -50, 900, 1], 145 ['body.page-jegyek #jegyek table:gt(0):lt(2)', 0], 146 ['body.page-jegyek #jegyek table:gt(1):lt(3)', -500], 147 ['body.page-jegyek #jegyek table:gt(1)', -300], 148 ['body.page-kiallitok .newsletter-signup .text', -400, 900, null, null, 20], 149 ['footer .linkek', 100, 300, 0.5], 150 ['.section-szinpadi-programok .day', -200, 2500, 0.7], 151 ['#publicTransport .cell:nth-child(2)', -50, 900, null, null, null, exhibitors_height], 152 ['#exhibitors-list .item:nth-child(2)', -50, 11500, null, 'curt', null, exhibitors_height], 153 ['#exhibitors-list .item:nth-child(3)', -50, 11500, null, 'curt', null, exhibitors_height], 154 ['#exhibitors-list .item:nth-child(4)', -300, 11500, null, 'curt', null, exhibitors_height], 155 ['#exhibitor .text', 50, 900], 156 ['#partners .items.catid-3 .item:nth-child(2)', -50, 1500], 157 ['#partners .items.catid-3 .item:nth-child(3)', -50, 1500], 158 ['#partners .items.catid-3 .item:nth-child(4)', -300, 1500], 159 ['#informacio .cell:nth-child(2)', -300, 900, 0.3],
160 ['#jelentkezes .inputs .cell:nth-child(1)', -250, 900, 0.3], 161 ['#jelentkezes .inputs .cell:nth-child(2)', 100, 900, 0.3], 162 ] 163 for( i in lines ) 164 { 165 $(lines[i][0]).each(function(){setPageline($(this), lines[i][0], lines[i][1], lines[i][2], lines[i][3], lines[i][4], lines[i][5], lines[i][6]);}); 166 } 167 } 168 setPageline = function (obj, s, offset, height, opacity, addclass, zindex, maxh) 169 { 170 if( !obj.data('pageline') ) 171 { 172 var id = random_str(10); 173 $('<div id="'+id+'"></div>').appendTo('#pagelines'); 174 if(typeof console !== 'undefined') console.log( (maxh && maxh < height) ? maxh : height ); 175 if( height ) $('#'+id).height( ((maxh && maxh < height) ? maxh : height) ); 176 if( zindex ) $('#'+id).css('z-index', zindex); 177 if( opacity ) $('#'+id).css('opacity', opacity); 178 if( addclass ) $('#'+id).addClass(addclass); 179 $('#'+id).attr('s', s); 180 obj.data('pageline', id); 181 } 182 alignPageline(obj, offset); 183 } 184 alignPageline = function (obj, offset) 185 { 186 var p = obj.offset(); 187 // var top = parseInt(p.top)+offset; 188 var top = parseInt(p.top); 189 var zoom = $('body').css('zoom'); 190 // pp( zoom ); 191 // pp( top ); 192 // pp( top * zoom ); 193 // if (zoom && !isNaN(zoom)) top = top / (zoom*10) * 10; 194 if (zoom == 0.9) { 195 top = top / 0.9 - 70; 196 // offset = offset / 0.92; 197 }; 198 var top = top + offset; 199 $('#'+obj.data('pageline')).css({ 200 top: top, 201 left: parseInt(p.left), 202 }); 203 } 204 hidePagelines = function () 205 { 206 $('#pagelines').hide(); 207 } 208 showPagelines = function () 209 { 210 $('#pagelines').show(); 211 } 212 setPagelines(); 213 setTimeout(function () { setPagelines(); }, 1000); 214 setTimeout(function () { setPagelines(); }, 2000); 215 setTimeout(function () { setPagelines(); }, 3000); 216 setTimeout(function () { setPagelines(); }, 4000); 217 setTimeout(function () { setPagelines(); }, 5000); 218 } 219 */ 220 221 // 222 var nav_opener_click_function = function(click) 223 { 224 var ismobile = $('#ismobile').is(":visible"); 225 var istablet = $('#istablet').is(":visible"); 226 if (!click) { 227 // inicialize 228 } else { 229 $('#menu').toggleClass('x'); 230 $('body').toggleClass('menu-x'); 231 } 232 var transitionduration = parseFloat($('#menu .default').css('transition-duration'))*1000; 233 if (istablet) 234 { 235 if ($('#menu').hasClass('x')) 236 { 237 $('#menu').css({ 238 height: 'unset', 239 overflow: 'auto' 240 }); 241 } 242 setTimeout(function() { 243 if (!$('#menu').hasClass('x')) // && istablet 244 { 245 $('#menu').css({ 246 height: '1px', 247 overflow: 'hidden' 248 }); 249 } 250 }, transitionduration); 251 } 252 else 253 { 254 if ($('#menu').hasClass('x')) 255 { 256 // $('#menu .default').css('visibility', 'hidden'); 257 $('#menu .more').css('visibility', 'visible'); 258 }else { 259 $('#menu .default').css('visibility', 'visible'); 260 // $('#menu .more').css('visibility', 'hidden'); 261 } 262 setTimeout(function() { 263 if ($('#menu').hasClass('x')) 264 { 265 $('#menu .default').css('visibility', 'hidden'); 266 // $('#menu .more').css('visibility', 'visible'); 267 }else { 268 // $('#menu .default').css('visibility', 'visible'); 269 $('#menu .more').css('visibility', 'hidden'); 270 } 271 }, transitionduration); 272 } 273 274 // if ($('#menu').hasClass('x')) 275 // { 276 // if (istablet) { 277 // $('#menu .default').css('visibility', 'visible'); 278 // $('#menu .more').css('visibility', 'visible'); 279 // } else { 280 // // $('#menu .default').css('visibility', 'hidden'); 281 // $('#menu .more').css('visibility', 'visible'); 282 // } 283 // }else { 284 // if (istablet) { 285 // // $('#menu .default').css('visibility', 'hidden'); 286 // // $('#menu .more').css('visibility', 'hidden'); 287 // } else { 288 // $('#menu .default').css('visibility', 'visible'); 289 // // $('#menu .more').css('visibility', 'hidden'); 290 // } 291 // } 292 // setTimeout(function() { 293 // if ($('#menu').hasClass('x')) 294 // { 295 // if (istablet) { 296 // // $('#menu .default').css('visibility', 'visible'); 297 // // $('#menu .more').css('visibility', 'visible'); 298 // } else { 299 // $('#menu .default').css('visibility', 'hidden'); 300 // // $('#menu .more').css('visibility', 'visible'); 301 // } 302 // }else { 303 // if (istablet) { 304 // $('#menu .default').css('visibility', 'hidden'); 305 // $('#menu .more').css('visibility', 'hidden'); 306 // } else { 307 // // $('#menu .default').css('visibility', 'visible'); 308 // $('#menu .more').css('visibility', 'hidden'); 309 // } 310 // } 311 // }, transitionduration); 312 313 /*if ($('#menu').hasClass('x')) 314 { 315 if (istablet) { 316 // if (0) { 317 $('#menu .default').fadeIn(300, function() {}); 318 $('#menu .more').fadeIn(300, function() {}); 319 } else { 320 $('#menu .default').fadeOut(300, function() {}); 321 $('#menu .more').fadeIn(300, function() {}); 322 } 323 }else { 324 if (istablet) { 325 // if (0) { 326 $('#menu .default').fadeOut(300, function() {}); 327 $('#menu .more').fadeOut(300, function() {}); 328 } else { 329 $('#menu .default').fadeIn(300, function() {}); 330 $('#menu .more').fadeOut(300, function() {}); 331 } 332 }*/ 333 } 334 $('#nav-opener').click(function () { 335 nav_opener_click_function(true); 336 }); 337 nav_opener_click_function(false); 338 339 // 340 $('#exhibitors .categories .link-button').click(function(event) { 341 $('#exhibitors .categories .list').fadeToggle(200, function() { 342 343 }); 344 }); 345 346 // $('#tickets .shaddow2h.akt').hover( 347 // function () {}, 348 // function () { $(this).removeClass('akt'); } 349 // ); 350 351 // var noSlideMobil = ($('.salonSlider02').hasClass('noSlideMobil')); 352 353 // $('#post .content img').each(function(index, el) 354 // { 355 // var img = $(this); 356 // getImgSize(img.attr("src"), function (size) 357 // { 358 // if (size.width > size.height*1.1) { 359 // img.css({ 360 // 'width': '200%', 361 // 'max-width': '200%', 362 // 'margin-left': '-50%' 363 // }); 364 // } 365 // }); 366 // }); 367 368 369 $('input[data-emptyvalue]').each(function () 370 { 371 var v = $(this).attr('data-emptyvalue'); 372 $(this).val(v); 373 $(this).focus(function () 374 { 375 if( v == $(this).val() ) $(this).val("") 376 }); 377 $(this).blur(function () 378 { 379 if( '' == $(this).val() ) $(this).val(v) 380 }); 381 }) 382 383 // 384 $('form.newsletter-signup, .newsletter-signup form, #newsletter-popup form').submit(function(e) 385 { 386 e.preventDefault(); 387 var form = $(this); 388 var failure = $(this).find(".failure").slideUp(200);
389 var success = $(this).find(".success").slideUp(200); 390 $.ajax({ 391 url: "/api/subscribe/", 392 type: "POST", 393 data: { 394 name: form.find("input[name=name]").val(), 395 email: form.find("input[name=email]").val() 396 }, 397 dataType: "json", 398 success: function (data, textStatus, jqXHR) { 399 if(typeof console !== 'undefined') console.log( data ); 400 if( data.success ) 401 { 402 failure.slideUp(400); 403 success.slideDown(400); 404 form.find('.text, .inputs').slideUp(400); 405 scrollTo('form.newsletter-signup, .newsletter-signup form'); 406 } 407 else if (Array.isArray(data.messages) && data.messages[0]) { 408 // 409 success.html(''); 410 failure.html(''); 411 // 412 for( i in data.messages ) { 413 if (data.messages[i].type == 'error') { 414 failure.append('<div>'+data.messages[i].message+'</div>'); 415 failure.slideDown(200); 416 scrollTo(failure); 417 } else { 418 if (!success.hasClass('static-message')) 419 success.append('<div>'+data.messages[i].message+'</div>'); 420 else success.html(success.data('default-message')); 421 success.slideDown(200); 422 scrollTo(success); 423 } 424 } 425 } 426 else { 427 if( data.message ) failure.text(data.message); 428 else failure.text("Hiba történt! (2)"); 429 failure.slideDown(200); 430 success.slideUp(200); 431 } 432 }, 433 error: function (jqXHR, textStatus, errorThrown) { 434 if(typeof console !== 'undefined') console.log( textStatus ); 435 failure.text("Hiba történt! (1)"); 436 failure.slideDown(200); 437 success.slideUp(200); 438 }, 439 complete: function (jqXHR, textStatus) { 440 // if(typeof console !== 'undefined') console.log( textStatus ); 441 if(typeof console !== 'undefined') console.log( jqXHR.responseJSON ); 442 } 443 }); 444 }); 445 446 // 447 $('form#registration').submit(function(e) 448 { 449 e.preventDefault(); 450 var form = $(this); 451 var failure = $(this).find(".failure").slideUp(300); 452 var success = $(this).find(".success").slideUp(300); 453 $.ajax({ 454 url: "/api/user/registration/", 455 type: "POST", 456 data: form.serializeArray(), 457 dataType: "json", 458 success: function (data, textStatus, jqXHR) { 459 if(typeof console !== 'undefined') console.log( data ); 460 if( data.success === true ) 461 { 462 failure.slideUp(300); 463 var msg = success.data('message'); 464 success.html(msg).slideDown(300); 465 form.find('.inputs').slideUp(300); 466 scrollTo('form#registration'); 467 } else { 468 scrollTo(failure); 469 if( jQuery.type(data.message) === 'string' ) 470 failure.text(data.message); 471 else if(Array.isArray(data.messages) && data.messages[0]) { 472 success.html(''); 473 failure.html(''); 474 for( i in data.messages ) { 475 if (data.messages[i].type == 'error') { 476 failure.append('<div>'+data.messages[i].message+'</div>'); 477 failure.slideDown(400); 478 } else { 479 success.append('<div>'+data.messages[i].message+'</div>'); 480 success.slideDown(400); 481 } 482 } 483 } 484 else failure.text("Hiba történt! (2)"); 485 failure.slideDown(300); 486 success.slideUp(300); 487 } 488 }, 489 error: function (jqXHR, textStatus, errorThrown) { 490 // if(typeof console !== 'undefined') console.log( textStatus ); 491 failure.text("Hiba történt! (1)"); 492 failure.slideDown(300); 493 success.slideUp(300); 494 }, 495 complete: function (jqXHR, textStatus) { 496 if(typeof console !== 'undefined') console.log( textStatus ); 497 if(typeof console !== 'undefined') console.log( jqXHR.responseJSON ); 498 } 499 }); 500 }); 501 502 // kapcsolat és jelentkezés 503 $('form#jelentkezes').submit(function(e) 504 { 505 e.preventDefault(); 506 var form = $(this); 507 var failure = $(this).find(".failure").slideUp(200);
508 var success = $(this).find(".success").slideUp(200); 509 $.ajax({ 510 url: "/api/message/", 511 type: "POST", 512 data: form.serializeArray(), 513 dataType: "json", 514 success: function (data, textStatus, jqXHR) { 515 // if(typeof console !== 'undefined') console.log( data ); 516 if( data.success ) 517 { 518 failure.slideUp(400); 519 success.slideDown(400); 520 form.find('.success-hide, .inputs, button, .checkbox').slideUp(400); 521 scrollTo('form#jelentkezes'); 522 } else { 523 if( data.message ) failure.text(data.message); 524 else if(Array.isArray(data.messages)) failure.text(data.messages[0].message); 525 else failure.text("Hiba történt! (2)"); 526 failure.slideDown(200); 527 success.slideUp(200); 528 scrollTo('form#jelentkezes'); 529 } 530 }, 531 error: function (jqXHR, textStatus, errorThrown) { 532 // if(typeof console !== 'undefined') console.log( textStatus ); 533 failure.text("Hiba történt! (1)"); 534 failure.slideDown(200); 535 success.slideUp(200); 536 }, 537 complete: function (jqXHR, textStatus) { 538 if(typeof console !== 'undefined') console.log( textStatus ); 539 if(typeof console !== 'undefined') console.log( jqXHR.responseJSON ); 540 } 541 }); 542 }); 543 544 // popup 545 $('.popup').each(function(index, el) 546 { 547 var popup = $(this); 548 if (!$(this).attr('id')) { 549 $(this).attr('id', 'popup'+$(this).data('block')) 550 } 551 var id = $(this).attr('id'); 552 var sess_closed = $.session.get("popupClosed_"+id); 553 if (sess_closed && sess_closed !== '0') { 554 if ($(this).hasClass('right_bottom')) { 555 $(this).addClass('closed'); 556 } 557 else return ''; 558 } 559 if (popup.hasClass('right_bottom')) { 560 popup.prepend('<div class="close">x</div>').show(); 561 } else { 562 popup.hide().delay(1000).prepend('<div class="close">x</div>').fadeIn(300); 563 } 564 popup.find('.close').click(function(event) 565 { 566 var closed = popup.hasClass('closed'); 567 if (closed) 568 { 569 popup.removeClass('closed'); 570 $.session.set("popupClosed_"+id, 0); 571 $(this).text('x'); 572 } else { 573 popup.addClass('closed'); 574 $.session.set("popupClosed_"+id, 1); 575 $(this).text('+'); 576 } 577 // if (popup.hasClass('right_bottom')) { 578 // popup.fadeOut(300, function() { 579 // $.session.set("popupClosed_"+id, true); 580 // }); 581 // } else { 582 // popup.fadeOut(300, function() { 583 // $.session.set("popupClosed_"+id, true); 584 // }); 585 // } 586 }); 587 }); 588 // 589 $('.popup.right_bottom').each(function(index, el) 590 { 591 var popup = $(this) 592 var items_len = $('.item', popup).length; 593 var step = function(dir, click) { 594 if (!click && popup.data('hover')) { 595 return ''; 596 } 597 var next_index = $('.item:visible', popup).index()-1+dir; 598 if (dir > 0) { if (next_index > items_len-1) next_index = 0; } 599 else { if (next_index < 0) next_index = items_len-1; } 600 $('.item', popup).hide(); 601 $('.item', popup).eq(next_index).show(); 602 $('.state', popup).text((next_index+1)+'/'+items_len); 603 } 604 if (items_len > 1) 605 { 606 $('<span class="state noselect"></span>').appendTo(popup); 607 $('<span class="prev noselect">‹</span>').appendTo(popup).click(function () { step(-1, true) }); 608 $('<span class="next noselect">›</span>').appendTo(popup).click(function () { step(1, true) }); 609 } 610 popup.hover( 611 function() {$(this).data('hover', true);}, 612 function() {$(this).data('hover', false);} 613 ); 614 setInterval(function () { step(1); }, 5000); 615 }); 616 617 618 // 619 $('.popup1 .close').click(function(event) { 620 $(this).closest('.popup1').toggleClass('show'); 621 var storagek = "popup_close_" + $(this).closest('.popup1').attr('id'); 622 localStorage.setItem(storagek, Date.now()); 623 }); 624 625 // $(".touchTouch").touchTouch(); 626 627 $('form.search, .search form').each(function(index, el) { 628 $(this).submit(function(event) { 629 event.preventDefault(); 630 var val = $(this).find('input[name=keres]').val() 631 if (val) { 632 location.replace($(this).attr('action')+val); 633 } else { 634 location.replace($(this).attr('action').split('/kereses').join('')); 635 } 636 }); 637 }); 638 639 $(".siteCustomAutocomplete").each(function() 640 { 641 // 642 // TODO: 643 // - Ãrott szó teljes kiegészÃtése az elsõ ajánlattal 644 // - adatforrás kÃvülrõl 645 // - ha már szerepel a hozzáadandó jelezze 646 // 647 var inputObj = $(this); 648 var select_id = "siteCustomAutocomplete"+Math.floor(Math.random()*99999); 649 var selectObj = $("<div/>") 650 .attr({id: select_id, class: "siteCustomAutocomplete_select"}) 651 .insertAfter($(this)); 652 inputObj.relistTimeoutId = ''; 653 if (typeof inputObj.data('source') === 'string') { 654 // var list_data = inputObj.get_list_data(); 655 } else { 656 // var list_data = availableTags; 657 } 658 inputObj.bind( "keydown", function (event) 659 { 660 var step = (event.keyCode == 38 || event.keyCode == 40); 661 if (step) { 662 event.preventDefault(); 663 if(typeof selectObj.option_focus === "undefined") selectObj.option_focus = -1; 664 } 665 if (event.keyCode == 38) { 666 selectObj.option_focus--; 667 if (selectObj.option_focus < 0) selectObj.option_focus = selectObj.options_length-1; 668 } 669 else if (event.keyCode == 40) { 670 selectObj.option_focus++; 671 if (selectObj.option_focus > selectObj.options_length-1) selectObj.option_focus = 0; 672 } 673 if (step) { 674 $('.siteCustomAutocomplete_option', selectObj).removeClass('focus'); 675 $('.siteCustomAutocomplete_option', selectObj).eq(selectObj.option_focus).addClass('focus'); 676 inputObj.val($('.siteCustomAutocomplete_option', selectObj).eq(selectObj.option_focus).data('value')); 677 } 678 }); 679 inputObj.bind( "keypress", function( event ) 680 { 681 if (event.keyCode == 13 || event.keyCode == 38 || event.keyCode == 40) { 682 if (selectObj.is(':visible')) 683 { 684 event.preventDefault(); 685 } 686 if (event.keyCode == 13) 687 { 688 $('.siteCustomAutocomplete_option', selectObj).eq(selectObj.option_focus).trigger('click'); 689 selectObj.hide(); 690 // selectObj.option_focus = -1; 691 } 692 } 693 }); 694 inputObj.bind( "blur", function( event ) 695 { 696 // timeout nélkül a siteCustomAutocomplete_option click nem fut le 697 setTimeout(function () { 698 selectObj.hide(); 699 // selectObj.option_focus = -1; 700 }, 100); 701 }); 702 inputObj.relist = function (request) 703 { 704 var request = $.trim(request); 705 if (request.length < 2) { 706 inputObj.redraw([]); 707 } 708 else { 709 $.ajax({ 710 url: '/api/search/autocomplete/'+request, 711 type: "POST", 712 data: {}, 713 dataType: "json", 714 // async: true, 715 // cache: true, 716 success: function ( data, textStatus, jqXHR ) { 717 if(typeof console !== 'undefined') console.log( data ); 718 inputObj.redraw(data.result.list); 719 // inputObj.redraw(availableTags); 720 }, 721 error: function ( jqXHR, textStatus, errorThrown ) { 722 // if(typeof console !== 'undefined') console.log( textStatus ); 723 }, 724 complete: function ( jqXHR, textStatus ) { 725 // if(typeof console !== 'undefined') console.log( textStatus ); 726 }, 727 }); 728 } 729 } 730 inputObj.redraw = function (list_data) 731 { 732 // if(typeof console !== 'undefined') console.log( 'this' ); 733 selectObj.options_length = 0; 734 var select_html = ""; 735 // var list_data = inputObj.get_list_data(); 736 var len = list_data.length; 737 for (var i = 0; i < len; i++) 738 { 739 // if( list_data[i].indexOf(request) !== -1 ) 740 // { 741 select_html += '<div class="siteCustomAutocomplete_option" data-value="'+list_data[i].word+'">'+list_data[i].word; 742 if (list_data[i].rows != undefined) { 743 select_html += ' <span class="option-inf">'+list_data[i].rows+'</span>'; 744 } 745 select_html += '</div>'; 746 selectObj.options_length++; 747 // } 748 } 749 if (select_html) 750 { 751 selectObj 752 .html(select_html) 753 .css({width: $(this).outerWidth()}) 754 .show(); 755 $('.siteCustomAutocomplete_option', selectObj).eq(selectObj.option_focus).addClass('focus'); 756 $('.siteCustomAutocomplete_option', selectObj).bind('click', function(event) { 757 758 var cursorPosition = inputObj.prop("selectionStart"); 759 var selected = $(this).data('value'); 760 var exists_str = inputObj.val(); 761 var exists_arr = exists_str.split(","); 762 var len = exists_arr.length; 763 while (len--) { 764 exists_arr[len] = $.trim(exists_arr[len]); 765 } 766 if (exists_arr.indexOf( selected ) == -1) { 767 // ha nem a lista végén, de egy vesszõ elõtt vagyunk 768 if (exists_str.substr(cursorPosition, 1)==',') { 769 var inside_count = (exists_str.substr(0, cursorPosition).match(/,/g) || []).length; 770 exists_arr.splice(inside_count, 1, selected); 771 } else { 772 exists_arr.splice(exists_arr.length-1, 1); 773 exists_arr.push(selected); 774 } 775 inputObj.val(exists_arr.join(", ")); 776 } 777 $(this).closest('.siteCustomAutocomplete').hide(); 778 }); 779 selectObj.option_focus = 0; 780 } 781 else { 782 selectObj.hide(); 783 } 784 } 785 inputObj.bind( "keyup", function( event ) 786 { 787 var cursorPosition = $(this).prop("selectionStart"); 788 var request = $(this).val(); 789 // ha nem a lista végén, de egy vesszõ elõtt vagyunk 790 if (request.substr(cursorPosition, 1)==',') { 791 var request = request.substr(0, cursorPosition).split(","); 792 } else { 793 var request = request.split(","); 794 } 795 request = $.trim(request[request.length-1]); 796 if (event.keyCode != 13 && event.keyCode != 38 && event.keyCode != 40) 797 { 798 // 799 // TODO: 800 // - ne keyup eseménnyel, hanem setInterval-al 801 // (Ãgy ha gyorsan sokat gépel, akkor is látszik, az autocomplete) 802 // - lekérés akkor, ha változott a beviteli szöveg 803 // - és ha nincs folyamatban a korábbi lekérés 804 // 805 clearTimeout(inputObj.relistTimeoutId); 806 inputObj.relistTimeoutId = setTimeout(function () { 807 inputObj.relist(request); 808 }, 200); 809 } 810 }) 811 }); 812 813 $('.addtocalendar').each(function(index, el) 814 { 815 var addToCalendar = $(this); 816 // ha link (<a /> tag) 817 addToCalendar.click(function(event) { event.preventDefault(); }); 818 // options 819 $('<ul class="options">\ 820 <li class="option" data-calendar="apple">Apple Calendar</li>\ 821 <li class="option" data-calendar="google">Google Calendar</li>\ 822 <li class="option" data-calendar="outlook">Outlook</li>\ 823 <li class="option" data-calendar="outlookcom">Outlook.com</li>\ 824 <li class="option" data-calendar="yahoo">Yahoo Calendar</li>\ 825 </ul>') 826 .appendTo(addToCalendar); 827 // clicks 828 $('.option', this).each(function(index, el) { 829 $(this).click(function(event) { 830 var query_data = { 831 calendar : $(this).data('calendar'), 832 title : addToCalendar.data('addtocalendar').title, 833 location : addToCalendar.data('addtocalendar').location, 834 details : addToCalendar.data('addtocalendar').details, 835 dates : addToCalendar.data('addtocalendar').dates, 836 busy : addToCalendar.data('addtocalendar').busy, 837 url : addToCalendar.data('addtocalendar').url, 838 } 839 var query_delimer = (site.base_script_url.indexOf('?') > -1) ? '&' : '?';
840 var url = site.base_script_url+'api/addtocalendar'+query_delimer+$.param( query_data ); 841 window.open(url,'addtocalendar',''); // status=yes,resizable=yes,scrollbars=yes,width=500,height=350 842 }); 843 }); 844 }); 845 846 $('.imageslines--x1').each(function() 847 { 848 $(this).find('img').wrapAll('<section id="imagesLines-wrap" class="mmSlider1-wrap"><div id="imagesLines" class="mmSlider1" data-showitems="1" data-ratio="1150x650" data-padding="0" data-autoplay="5000" data-loop="1"><div class="items"></div></div></section>'); 849 $(this).find('img').each(function() 850 { 851 $(this).wrap('<div class="item"></div>'); 852 }); 853 }); 854 $('.mmSlider1').each(function(){mmSlider1_initialize($(this))}); 855 856 // var postList_item_padding = $('.postList .items .item').eq(1).css('margin-left'); 857 var loader_image_path = site.theme_url+'images/loader2.gif'; 858 $('<img/>')[0].src = loader_image_path; 859 $('#postList .categorys a').click(function(e) 860 { 861 e.preventDefault(); 862 var linkObj = $(this); 863 var tag = $(this).data('tag'); 864 // if ($('body').hasClass('tesztoldal')) 865 if (1) 866 { 867 var loaderImg = $( "<img>" ).insertAfter( $(this) ) 868 .attr('src', loader_image_path) 869 .css({ 870 position: 'absolute', 871 'vertical-align': 'middle', 872 width: '18px', 873 height: 'auto', 874 opacity: '0.7', 875 'margin-left': '5px', 876 'margin-top': '4px' 877 }); 878 879 } 880 setTimeout(function () { 881 $.ajax({ 882 url: site.base_script_url+'blog/?view=null&tag='+tag, 883 type: "POST", 884 data: {}, 885 dataType: "html", 886 // async: true, 887 // cache: true, 888 success: function ( data, textStatus, jqXHR ) { 889 // setTimeout(function () { 890 $('#postList .postList').html(data); 891 $('#postList .categorys a').removeClass('underline'); 892 linkObj.addClass('underline'); 893 // $('#postList .postList .items .item').fadeTo(1000, 1); 894 // }, 600); 895 }, 896 error: function ( jqXHR, textStatus, errorThrown ) { 897 // if(typeof console !== 'undefined') console.log( textStatus ); 898 }, 899 complete: function ( jqXHR, textStatus ) { 900 // setTimeout(function () { 901 loaderImg.fadeOut('fast', function() { this.remove(); }); 902 // }, 150); 903 // if(typeof console !== 'undefined') console.log( textStatus ); 904 // if(typeof console !== 'undefined') console.log( jqXHR.responseJSON ); 905 }, 906 }); 907 }, 250); 908 909 // $('.postList .items .item').each(function() 910 // { 911 // if( $(this).data('tag') == tag ) { 912 // $(this).show('250'); 913 // } else { 914 // $(this).hide('250'); 915 // } 916 // }); 917 }); 918 919 $("a[href^='#']").each(function() 920 { 921 $(this).click(function(event) { 922 event.preventDefault(); 923 var h = $(this).attr('href'); 924 if ($(h).length) {scrollTo(h)} 925 else if ($("a[name='"+h.substr(1)+"']").length) {scrollTo("a[name='"+h.substr(1)+"']")} 926 }); 927 }); 928 929 // 930 var drop_down_checkbox_change = function (obj) { 931 var viewtexts = []; 932 var drop_down = obj.closest('.drop-down'); 933 drop_down.find('input[type=checkbox]').each(function() { 934 if ($(this).is(':checked')) { viewtexts.push($.trim($(this).parent().text())) } 935 }); 936 drop_down.find('.drop-down-viewtext').html(viewtexts.join('; ')+' '); 937 } 938 $('.drop-down input').on('change', function(event) { 939 drop_down_checkbox_change($(this)); 940 }); 941 $('.drop-down input').eq(0).trigger('change'); 942 943 resizes(); 944 // setTimeout(function () { resizes(); }, 1000); 945 946}); 947 948function validateEmail(email) 949{ 950 var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; 951 return re.test(String(email).toLowerCase()); 952} 953 954function validatePhone(phoneNum) 955{ 956 return (phoneNum.replace(/\D+/g, '').length > 10); 957} 958 959function scrollTo(e) { 960 var obj = ($.type(e) === 'string') ? $(e) : e; 961 $('html,body').animate({ 962 scrollTop: obj.offset().top-115 963 },'slow'); 964} 965 966function pp(argument) { 967 if(typeof console !== 'undefined') console.log( argument ); 968} 969 970function random_str( len ) 971{ 972 var text = ""; 973 var possible = "ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789"; // 0, 1, l (kis L) direkt nincs 974 975 for( var i=0; i < len; i++ ) 976 text += possible.charAt(Math.floor(Math.random() * possible.length)); 977 978 return text; 979} 980 981/** 982 * 983 */ 984function popup_login( url ) 985{ 986 popup_login_window = window.open(url,'popup_login','status=yes,resizable=yes,scrollbars=yes,width=500,height=350'); 987 popup_login_window.focus(); 988} 989 990function resizes() 991{
992 ismobile = $('#ismobile').is(":visible"); 993 istablet = $('#istablet').is(":visible"); 994 // if ($('body').hasClass('testsite')) 995 // { 996 // clearTimeout(setPagelinesTimeoutId); 997 // setPagelinesTimeoutId = setTimeout(function () { 998 // if( ismobile ) hidePagelines(); 999 // else { showPagelines(); setPagelines(); } 1000 // }, 100); 1001 // } 1002 // if(typeof console !== 'undefined') console.log( 'resizes' ); 1003 // if (istablet && !$('footer').data('seted')) 1004 // { 1005 // var fotamogato = $('footer .fotamogato').html(); 1006 // var contact = $('footer .contact').html(); 1007 // $('footer .fotamogato').html(contact); 1008 // $('footer .contact').html(fotamogato); 1009 // $('footer .fotamogato, footer .contact, footer .copyright').css({ 'text-align': 'left', }); 1010 // $('footer .fotamogato .text').css({ 'font-size': '15px', 'margin-top': '20px' }); 1011 // $('footer').data('seted', true) 1012 // } 1013 // // 1014 // if (!istablet && !ismobile) { 1015 // $('#top-wave svg').attr('preserveAspectRatio', 'none'); 1016 // } else { 1017 // $('#top-wave svg').attr('preserveAspectRatio', 'xMidYMax meet'); 1018 // } 1019 // wave height 1020 // set_wave_top(); 1021 1022 // bg 1023 // var defW = 1440 + 110; 1024 // var wW = $(window).width(); 1025 // var wR = wW/defW; 1026 // $('.bgPattern').each(function(index, el) { 1027 // // pos 1028 // var thisO = $(this).offset(); 1029 // var leftOrig = $(this).data('leftOrig'); 1030 // if (!leftOrig) { 1031 // leftOrig = thisO.left 1032 // $(this).data('leftOrig', leftOrig) 1033 // } 1034 // $(this).css('left', (leftOrig+$('header').offset().left)*wR); 1035 // if (ismobile) { 1036 // $(this).css('top', thisO.top - 50); 1037 // } 1038 // // color 1039 // var color = (thisO.top < $('#top-wave').offset().top + topWaveH) ? '#FFFFFF' : '#73bbe1'; 1040 // $(this).find('path').attr('fill', color); 1041 // }); 1042} 1043 1044function set_wave_top() 1045{ 1046 /*var topWaveY = 0; 1047 var wave_heights = $('.wave-height'); 1048 bodypage = $('body').data("page"); 1049 if (wave_heights.length) 1050 { 1051 wave_heights.each(function(index, el) { 1052 topWaveY = $(this).offset().top + $(this).height() + parseInt($(this).css('padding-bottom')) + 80; 1053 }); 1054 } 1055 else { 1056 switch (bodypage) 1057 { 1058 case 'fooldal': if($('#firstSlider').length) topWaveY = $('#firstSlider').offset().top+20+$('#firstSlider').height()/2.1; break; 1059 case 'kiallitok': 1060 if($('.page-head').length) topWaveY = $('.page-head').offset().top+$('.page-head').height()/1.6; 1061 else topWaveY = $('.titlebox').offset().top+$('.titlebox').height()/1.6 + 87; 1062 break; 1063 case 'partnerek': if($('.page-head').length) topWaveY = $('.page-head').offset().top+$('.page-head').height()+((ismobile) ? 65 : 160); break; 1064 case 'regisztracio': if($('#registration').length) topWaveY = $('#registration').offset().top+$('#registration').height()+410; break; 1065 case 'kapcsolat': if($('#informacio').length) topWaveY = $('#informacio').offset().top+$('#informacio').height()+140; break; 1066 default: topWaveY = $('#header-wrap').height()+450 1067 } 1068 } 1069 if (topWaveY) 1070 { 1071 topWaveT = -topWaveH+topWaveY; 1072 $('#top-wave').css('top', topWaveT); 1073 clearTimeout(topWaveTimeout1); 1074 clearTimeout(topWaveTimeout2); 1075 clearTimeout(topWaveTimeout3); 1076 var topWaveTimeout1 = setTimeout(function () { if (topWaveY) { $('#top-wave').css('top', topWaveT); } }, 500); 1077 var topWaveTimeout2 = setTimeout(function () { if (topWaveY) { $('#top-wave').css('top', topWaveT); } }, 1000); 1078 var topWaveTimeout3 = setTimeout(function () { if (topWaveY) { $('#top-wave').css('top', topWaveT); } }, 1500); 1079 }*/ 1080} 1081 1082function copy_to_clipboard(obj) 1083{ 1084 if (obj) window.clipboardData.setData('Text', obj.val()); 1085} 1086 1087function getUrlParameterByName(name) 1088{ 1089 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 1090 var regexS = "[\\?&]" + name + "=([^&#]*)"; 1091 var regex = new RegExp(regexS); 1092 var results = regex.exec(window.location.href); 1093 if(results == null) 1094 return ""; 1095 else 1096 return decodeURIComponent(results[1].replace(/\+/g, " ")); 1097} 1098 1099function getImgSize(src, callback) 1100{ 1101 var image = new Image(); 1102 image.onload = function() { 1103 if (callback != undefined) callback({width: image.width, height: image.height}); 1104 } 1105 image.src = src; 1106} 1107 1108$(document).ready(function() { 1109 1110 var cooltix_id = '69695f69a77b5c3f6efc2c3b'; 1111 var jegyvasarlas_url = 'https://cooltix.hu/event/'+cooltix_id; 1112 var refererUrl = 'https%3A%2F%2Fgardenexpo.hu%2Fjegyek'; 1113 var jegyvasarlas_embed_url = 'https://cooltix.com/widget/event-products/'+cooltix_id+'?theme=light&primaryColorHex=7e392e&referrerUrl='+refererUrl+'&heroStyle=hidden&cookieConsent=accepted&locale='; 1114 1115 var openPopup = function() { 1116 var locale = 'hu'; 1117 if (typeof site !== 'undefined' && site.lang) { 1118 locale = site.lang; 1119 } 1120 var popupHtml = '<div id="jegyvasarlas-popup" class="jegyvasarlas-popup"><div class="jegyvasarlas-popup-wrap"><button>
1120â</button><iframe src="'+jegyvasarlas_embed_url+locale+'"></iframe></div></div>'; 1121 $('body').append(popupHtml); 1122 $('body').css('overflow', 'hidden'); 1123 }; 1124 $(window).on('hashchange', function() { 1125 if (window.location.hash == '#jegyvasarlas') { 1126 openPopup(); 1127 } 1128 else { 1129 $('#jegyvasarlas-popup').remove(); 1130 $('body').css('overflow', ''); 1131 } 1132 }); 1133 var jegyvasarlas = window.location.hash == '#jegyvasarlas'; 1134 // var tesztoldal = window.location.href.indexOf('tesztoldal') > -1; 1135 // if (tesztoldal || jegyvasarlas) { 1136 if (jegyvasarlas) { 1137 openPopup(); 1138 } 1139 $(document).on('click', 'a[href="'+jegyvasarlas_url+'"]', function(e) { 1140 e.preventDefault(); 1141 openPopup(); 1142 }); 1143 1144 $(document).on('click', '#jegyvasarlas-popup button', function() { 1145 $('#jegyvasarlas-popup').remove(); 1146 $('body').css('overflow', ''); 1147 }); 1148 // } 1149});
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.