1 2/* 3|-------------------------------------------------------------------------- 4| FORM 5|-------------------------------------------------------------------------- 6| 7*/ 8 9 10$('#form').on('submit', function (e) { 11 // always at forms to prevent default 12 e.preventDefault(); 13 var btn = $('.js-form_button'); 14 var form = $(this); 15 16 console.log(form.serialize()); 17 btn.hide(); 18 19 $.ajax({ 20 type: 'POST', 21 url: rootUrl + 'Frontend/form_processing', 22 data: form.serialize(), 23 success: function (data) { 24 var json = JSON.parse(data); 25 26 if (json.success == false) { 27 btn.show(); 28 } else { 29 $('#form').hide(); 30 } 31 32 $('#form_message').html(json.text).show(); 33 }, 34 }); 35}); 36 37 38 39 40if (screen.width < 650) { 41 var mvp = document.getElementById('vp'); 42 mvp.setAttribute('content', 'user-scalable=no,width=550'); 43} 44 45$(document).ready(function () { 46 addListeners(); 47 48 if ($('.editorialSlider').length > 0) { 49 $('.js-example-basic-single').select2(); 50 } 51 mark_scroll_position(); 52 53 // adjustImageRatio(); 54 55 $(window).resize(function () { 56 // adjustImageRatio(); 57 calculateHeightOfCardImgs(); 58 }); 59 60 calculateHeightOfCardImgs(); 61 62 function calculateHeightOfCardImgs() { 63 var cardWidth = $('.groupElemWrapper').width(); 64 var cardHeight = cardWidth; 65 66 $('.groupElemImg').each(function () { 67 $(this).height(cardHeight); 68 }); 69 // $('.groupElemImg img').each(function() { 70 // $(this).height(cardHeight) 71 // }) 72 } 73 74 $('.collapsibleButton').click(function () { 75 $(this).toggleClass('opened'); 76 $('.collapsibleContainer').slideToggle('opened'); 77 }); 78}); 79 80$(window).on('load', function () { 81 mark_scroll_position(); 82}); 83 84// $(document).scroll(function () { 85// localStorage.setItem(window.location.href, $(document).scrollTop()); 86// }); 87 88// scroll back in category pages 89 90function mark_scroll_position() { 91 current_url = window.location.href; 92 if (current_url.includes('/category/')) { 93 var current_scroll = localStorage.getItem(current_url); 94 if (current_scroll == null) { 95 // scroll to random locationon certain page if no scroll info stored 96 97 $('body').animate( 98 { 99 // scrollTop: getRandomInt($(document).height()), 100 }, 101 10, 102 ); 103 } else { 104 $(window).scrollTop(current_scroll); 105 } 106 } 107} 108// end scroll back in category pages 109 110function reloadWithAttributes(pageNum, categoryTabId) { 111 /* $('body').animate({opacity:0}
111,300, function(){ 112 //$('body').hide(); 113 }); 114 */ 115 setTimeout(function () { 116 if (pageNum == undefined) { 117 pageNum = 1; 118 } 119 120 if (categoryTabId == undefined) { 121 categoryTabId = 0; 122 } 123 124 var search_text = $('#search_text').val(); 125 var year_start = $('#filter_start_year').val(); 126 var year_end = $('#filter_end_year').val(); 127 var period = $('.clickable_filter_item.current.active').attr('atr'); 128 var sort = $('.clickable_filter_item.sorting.active').attr('atr'); 129 130 var url = location.protocol + '//' + location.host + location.pathname; 131 132 window.location.href = 133 url + 134 '?search_text=' + 135 search_text + 136 '&year_start=' + 137 year_start + 138 '&year_end=' + 139 year_end + 140 '&period=' + 141 period + 142 '&sort=' + 143 sort; 144 }, 350); 145} 146 147function reloadWithAttributesMembers(pageNum, categoryTabId) { 148 /* $('body').animate({opacity:0},300, function(){ 149 //$('body').hide(); 150 }); 151 */ 152 setTimeout(function () { 153 if (pageNum == undefined) { 154 pageNum = 1; 155 } 156 157 if (categoryTabId == undefined) { 158 categoryTabId = 0; 159 } 160 161 var search_text = $('#search_text').val(); 162 /* var year_start = $("#filter_start_year").val(); 163 var year_end = $("#filter_end_year").val();*/ 164 var member_start = $('#filter_start_member').val(); 165 var member_end = $('#filter_end_member').val(); 166 var active = $('#filter_member_active').val(); 167 var sort = $('.clickable_filter_item.sorting.active').attr('atr'); 168 var exhibited_in = $('#filter_exhibited_in').val(); 169 170 var url = location.protocol + '//' + location.host + location.pathname; 171 172 window.location.href = 173 url + 174 '?search_text=' + 175 search_text + 176 '&exhibited_in=' + 177 exhibited_in + 178 /* "&birthday_start=" + 179 year_start + 180 "&birthday_end=" + 181 year_end +*/ 182 '&member_start=' + 183 member_start + 184 '&member_end=' + 185 member_end + 186 /* "&active=" + 187 active +*/ 188 '&sort=' + 189 sort; 190 }, 350); 191} 192 193function reloadWithAttributesCalendar(pageNum, categoryTabId) { 194 /* $('body').animate({opacity:0}
194,300, function(){ 195 //$('body').hide(); 196 }); 197 */ 198 setTimeout(function () { 199 if (pageNum == undefined) { 200 pageNum = 1; 201 } 202 203 if (categoryTabId == undefined) { 204 categoryTabId = 0; 205 } 206 207 var search_text = $('#search_text').val(); 208 var year_start = $('#filter_start_year').val(); 209 var year_end = $('#filter_end_year').val(); 210 var sort = $('.clickable_filter_item.sorting.active').attr('atr'); 211 var category = $('#filter_category').val(); 212 213 var url = location.protocol + '//' + location.host + location.pathname; 214 215 window.location.href = 216 url + 217 '?search_text=' + 218 search_text + 219 '&year_start=' + 220 year_start + 221 '&year_end=' + 222 year_end + 223 '&category=' + 224 category + 225 '&sort=' + 226 sort; 227 }, 350); 228} 229 230function addListeners() { 231 $('.lang_btn').click(function () { 232 var lang = $(this).attr('lang'); 233 $.ajax({ 234 type: 'POST', 235 url: rootUrl + 'Frontend/change_lang', 236 data: { 237 lang: lang, 238 }, 239 success: function (data) { 240 location.reload(); 241 }, 242 }); 243 }); 244 245 $('#submit_filter').click(function () { 246 reloadWithAttributes(); 247 }); 248 249 $('#submit_filter_calendar').click(function () { 250 reloadWithAttributesCalendar(); 251 }); 252 253 $('#submit_members_filter').click(function () { 254 reloadWithAttributesMembers(); 255 }); 256 257 $('#reset_filter').click(function () { 258 var url = location.protocol + '//' + location.host + location.pathname; 259 260 window.location.href = url; 261 }); 262 263 $('.clickable_filter_item.current').click(function () { 264 $('.clickable_filter_item.current').removeClass('active'); 265 $(this).addClass('active'); 266 }); 267 268 $('.clickable_filter_item.sorting').click(function () { 269 $('.clickable_filter_item.sorting').removeClass('active'); 270 $(this).addClass('active'); 271 }); 272 273 $('#category_filter_title').click(function () { 274 $(this).toggleClass('active'); 275 $('#filtering_inner_holder').slideToggle(); 276 }); 277 278 // cookies 279 $( 280 '#cookie_warning button, #data_cookies button, #cookie_overview button', 281 ).click(function () { 282 console.log('checked'); 283 var btn = $(this); 284 if (btn.hasClass('cookieAcceptAll')) { 285 $('#cookie_mark_check').prop('checked', true); 286 $('#cookie_nec_check').prop('checked', true); 287 288 } 289 290 291 var cookie_mark = $('#cookie_mark_check').prop('checked'); 292 var cookie_warning = $('#cookie_nec_check').prop('checked'); 293 294 //document.cookie = "cookie_warning=1; expires=Thu, 18 Dec 2030 12:00:00 UTC; path=/;secure=true"; 295 btn.css('opacity', '0.5'); 296 $('#cookie_warning').fadeOut(); 297 $.ajax({ 298 type: 'POST', 299 url: rootUrl + 'Frontend/saveCookie', 300 data: { 301 cookie_mark, 302 cookie_warning, 303 }, 304 success: function (data) { 305 if ($('#cookie_warning').is(':visible')) { 306 // location.reload(); 307 } else { 308 btn.css('opacity', '1'); 309 var succ_msg = 310 lang == 0 311 ? 'Cookie-Einstellungen gespeichert.' 312 : 'Cookie settings saved.'; 313 $('#cookie_msg').text(succ_msg); 314 setTimeout(function () { 315 $('#cookie_msg').text(''); 316 }, 3000); 317 } 318 319 if (cookie_mark) { 320 // add GA 321 var ga = 322 "
vendor: 63 bytes, line 322
322<script async src='https://www.googletagmanager.com/gtag/js?id=
322G-J9PZ320L17
vendor: 11 bytes, line 322
322'></script>
322<script>
vendor: 124 bytes, line 322
322window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '
322G-J9PZ320L17
vendor: 3 bytes, line 322
322');
322</script>" 323 $("head").append(ga); 324 // console.log('added GA'); 325 } 326 // location.reload(); 327 }, 328 }); 329 }); 330 331 332 //** MENU 333 334 $('#mobile_menu_right').on('click', function () { 335 if ($('#overlay_bg').css('display') == 'none') { 336 $('#overlay_bg').css('display', 'flex'); 337 $('body').addClass('noScroll'); 338 } else { 339 $('#overlay_bg').hide(); 340 $('body').removeClass('noScroll'); 341 } 342 }); 343 //** footer 344 345 //** landing page 346 347 $('.filterBarInput, .filterBarButton').on('click', function (e) { 348 if ( 349 !$(e.target).hasClass('closeImg') && 350 !$(e.target).hasClass('filterElem') 351 ) { 352 $('.filterInputHolder').toggleClass('opened'); 353 $('.filterCollapse').toggleClass('opened'); 354 } 355 }); 356 357 $('.elemVideoWrapper').on('click', function () { 358 $(this).toggleClass('playing'); 359 }); 360 361 $('.selectElement').on('click', function () { 362 // $(this).hide(); 363 $(this).addClass('hiddenTag'); 364 365 var text = $(this).text(); 366 var tid = $(this).attr('tid'); 367 $('.newFilterCollect').append( 368 '<div class="filterElem" tid="' + 369 tid + 370 '">' + 371 text + 372 '<div class="filterElemClose">' + 373 "<img class='closeImg' src=" + 374 rootUrl + 375 '/items/frontend/img/logo/close.svg alt="">' + 376 '</div>' + 377 '</div>', 378 ); 379 380 console.log('selectelemtn', $('.selectElement').length); 381 console.log('hidden', $('.hiddenTag').length); 382 383 handleBorder(); 384 }); 385 386 // tags 387 $('.filterBar .selectElement').on('click', function () { 388 update_by_tags(); 389 }); 390 391 $('.filterBar').on('click', '.filterElemClose', function () { 392 var tid = $(this).parent().attr('tid'); 393 $(this).parent().remove(); 394 // $(".selectElement[tid=" + tid + "]").show(); 395 $('.selectElement[tid=' + tid + ']').removeClass('hiddenTag'); 396 update_by_tags(); 397 398 handleBorder(); 399 }); 400 401 function handleBorder() { 402 if ($('.selectElement').length === $('.hiddenTag').length) { 403 $('.filterCollapse').css('border', 'none'); 404 } else { 405 $('.filterCollapse').css('border', '1px solid black'); 406 $('.filterCollapse').css('border-top', 'none'); 407 } 408 } 409 410 // if (selected_tag) { 411 // $('.collapsibleContainer').slideToggle(); 412 // $('.filterCollapsibleWrapper').toggleClass('opened'); 413 // $('.filterBar .selectElement[tid=' + selected_tag + ']').click(); 414 // } 415 416 //Timer 417 $('.video_timer').each(function () { 418 var timer = $(this); 419 var timer_text = timer.find('.video_timer_text'); 420 var timer_bar = timer.find('.video_timer_bar'); 421 var bar_width = 80; 422 423 var start_time = timer.attr('start_time').trim().replace(' ', 'T'); 424 var end_time = timer.attr('end_time').trim().replace(' ', 'T'); 425 426 setInterval(function () { 427 // end date 428 var countDownDate = new Date(end_time).getTime(); 429 var now = new Date().getTime(); 430 var distance = countDownDate - now; 431 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 432 var hours = Math.floor( 433 (distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60), 434 ); 435 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 436 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 437 438 // start date 439 if (start_time != '30') { 440 var startDate = new Date(start_time).getTime(); 441 var start_end_distance = countDownDate - startDate; 442 var start_days = Math.floor(start_end_distance / (1000 * 60 * 60 * 24)); 443 var start_hours = Math.floor( 444 (start_end_distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60), 445 ); 446 var start_minutes = Math.floor( 447 (start_end_distance % (1000 * 60 * 60)) / (1000 * 60), 448 ); 449 var start_seconds = Math.floor( 450 (start_end_distance % (1000 * 60)) / 1000, 451 ); 452 } else { 453 var start_end_distance = 1296000000; // 14 days before 454 } 455 456 bar_width = 457 days > 13 458 ? 2 459 : ((start_end_distance - distance) / start_end_distance) * 100; 460 461 if (days > 0) { 462 var txt = start_time == '30' ? ' DAYS TILL START' : ' DAYS LEFT'; 463 timer_text.text(days + 1 + txt); 464 } else if (hours > 0) { 465 var txt = start_time == '30' ? ' HOURS TILL START' : ' HOURS LEFT'; 466 timer_text.text(hours + 1 + txt); 467 } else if (minutes > 0) { 468 var txt = start_time == '30' ? ' MINUTES TILL START' : ' MINUTES LEFT'; 469 timer_text.text(minutes + 1 + txt); 470 } else if (seconds > 0) { 471 var txt = start_time == '30' ? ' SECONDS TILL START' : ' SECONDS LEFT'; 472 timer_text.text(seconds + 1 + txt); 473 } else { 474 bar_width = 100; 475 var txt = start_time == '30' ? ' SECONDS TILL START' : ' SECONDS LEFT'; 476 timer_text.text(0 + txt); 477 478 setTimeout(function () { 479 location.reload(); 480 }, 2000); 481 } 482 483 // loading 484 if (start_time == '30' && days > 0) { 485 bar_width = days > 30 ? 2 : Math.floor(((30 - days) / 30) * 100); 486 } else { 487 } 488 489 timer_bar.width(bar_width + '%'); 490 }, 1000); 491 }); 492 $('.video_play').click(function () { 493 var video = $(this).parent().parent().find('.embed_holder video').get(0); 494 video.play(); 495 $(this).hide(); 496 $(this).parent().find('.video_pause').show(); 497 }); 498 499 $('.video_pause').click(function () { 500 var video = $(this).parent().parent().find('.embed_holder video').get(0); 501 video.pause(); 502 $(this).hide(); 503 $(this).parent().find('.video_play').show(); 504 }); 505
506 $('.video_mute').click(function () { 507 var video = $(this).parent().parent().find('.embed_holder video'); 508 video.prop('muted', true); 509 //v = document.getElementById("current_video") 510 //v.textTracks[0].mode = "showing"; 511 $(this).hide(); 512 $(this).parent().find('.video_unmute').show(); 513 }); 514 515 $('.video_unmute').click(function () { 516 var video = $(this).parent().parent().find('.embed_holder video'); 517 video.prop('muted', false); 518 //v = document.getElementById("current_video") 519 //v.textTracks[0].mode = "hidden"; 520 521 $(this).hide(); 522 $(this).parent().find('.video_mute').show(); 523 }); 524 525 //**** detail page 526 527 // gallery module normal/slider 528 var gc = 1; 529 $('.gallery_item').each(function () { 530 var gallery_container = $(this).parent().parent(); 531 if (!gallery_container.hasClass('gallery_slider_1')) { 532 var img_container = $(this).parent(); 533 var img_width = $(this).width(); 534 var module_width = gallery_container.width(); 535 536 //console.log(img_container); 537 538 if ((img_width * 100) / module_width >= 70) { 539 img_container.addClass('gallery_full'); 540 } else { 541 img_container.addClass('gallery_half'); 542 543 $('.last_uneven').removeClass('last_uneven'); 544 if (gc % 2 != 0) { 545 img_container.addClass('last_uneven'); 546 } 547 548 img_container.remove(); 549 gallery_container.append(img_container); 550 } 551 gc++; 552 } 553 }); 554 555 $('.gallery_container_1').each(function () { 556 var container = $(this); 557 558 var gallery = container.find('.gallery_slider_1'); 559 var images = gallery.find('a'); 560 561 var current_count_el = container.find('.current'); 562 var total_count = parseInt(container.find('.total').text()); 563 var arrow_right_id = 564 '#' + container.find('.gallery_slider_nav_right').attr('id'); 565 var arrow_left_id = 566 '#' + container.find('.gallery_slider_nav_left').attr('id'); 567 568 images.each(function (img) { 569 var img_text = $(this).attr('data-title'); 570 $(this) 571 .find('.gallery_item') 572 .append('<div class="gallery_item_text">' + img_text + '</div>'); 573 }); 574 575 gallery.slick({ 576 dots: false, 577 arrows: true, 578 appendArrows: '#slider_arrows_container', 579 nextArrow: arrow_right_id, 580 prevArrow: arrow_left_id, 581 draggable: true, 582 rows: 1, 583 infinite: false, 584 adaptiveHeight: true, 585 speed: 300, 586 slidesToShow: 1, 587 slidesToScroll: 1, 588 }); 589 590 gallery.on('afterChange', function (event, slick, currentSlide, nextSlide) { 591 current_count_el.text(currentSlide + 1); 592 }); 593 }); 594 595 //***** category pages 596 597 //***** end SKV ****/ 598 599 //******** stand alone functions and animation tools ********/ 600 601 // collapsable items 602 $('.collapse_controler').click(function () { 603 var filter_id = $(this).attr('controle'); 604 var arrow = $(this).find('.arrow'); 605 if ($(this).hasClass('active')) { 606 $(this).removeClass('active'); 607 arrow.removeClass('active'); 608 $('#' + filter_id).slideUp(); 609 } else { 610 $(this).addClass('active'); 611 $(arrow).addClass('active'); 612 $('#' + filter_id).slideDown(); 613 } 614 }); 615 616 $('div[collapse_default="closed"]').slideUp(0); 617 $('div[collapse_default="open"]').each(function () { 618 var id = $(this).attr('id'); 619 var controler = $('.collapse_controler[controle="' + id + '"]'); 620 var arrow = controler.find('.arrow'); 621 controler.addClass('active'); 622 $(arrow).addClass('active'); 623 }); 624 625 // activation 626 $('.activation_controler').click(function () { 627 var target = $(this).attr('activate'); 628 var sibling = $(this).attr('sibling'); 629 var arrow = $(this).find('.arrow'); 630 631 if ($(this).hasClass('active')) { 632 $(this).removeClass('active'); 633 arrow.removeClass('active'); 634 $(target).removeClass('active'); 635 $(sibling).removeClass('active'); 636 } else { 637 $(this).addClass('active'); 638 $(arrow).addClass('active'); 639 $(target).addClass('active'); 640 $(sibling).addClass('active'); 641 } 642 }); 643 644 $('.slider_controler').click(function () { 645 var target = $(this).attr('activate'); 646 $(this).toggleClass('active'); 647 $(target).slideToggle(); 648 }); 649 650 // overlays 651 $('.overlay_trigger').click(function () { 652 var target = $(this).attr('trigger'); 653 $('#' + target).fadeIn(); 654 $('#overlay_bg , #overlay_close').fadeIn().addClass('active_overlay'); 655 }); 656 657 // closing overlays 658 $('#overlay_bg , #overlay_close').click(function () { 659 // reset overlay form after closing 660 $('.overlay form').trigger('reset'); 661 $('.overlay .js-example-basic-single').select2(); 662 663 // general 664 $('.overlay').fadeOut(); 665 $('#overlay_bg , #overlay_close').fadeOut().removeClass('active_overlay'); 666 }); 667 668 // scroll hock 669 $('.scroll_hock').click(function () { 670 var target = $('#' + $(this).attr('scroll_to')); 671 target.css({ 672 'box-shadow': ' 0 0 80px 4px #8e8c8c', 673 transform: 'scale(1.01)', 674 'background-color': 'white', 675 padding: '0 5px', 676 }); 677 $([document.documentElement, document.body]).animate( 678 { 679 scrollTop: target.offset().top - 150, 680 }, 681 1500, 682 function () { 683 target.css({ 684 transition: 'all 1s ease-in-out', 685 'box-shadow': ' 0 0 0px 0px #8e8c8c', 686 transform: 'scale(1.0)', 687 'background-color': 'transparent', 688 padding: '0', 689 }); 690 }, 691 ); 692 }); 693 694 // right left scroll 695 $('.side_scroll_icon').click(function () { 696 var target = $(this).attr('scroll'); 697 var direction = $(this).attr('direction') == 'left' ? '-=' : '+='; 698 $(target).animate({ scrollLeft: direction + $(target).width() }, 500); 699 }); 700 701 // counter 702 count(); 703 function count() { 704 setTimeout(function () { 705 $('.counter').each(function () { 706 counter = $(this); 707 count_items = $('.' + $(this).attr('count') + ':visible').length; 708 counter.text('(' + count_items + ')'); 709 }); 710 }, 300); 711 } 712 713 // img frontend replace 714 $('.img_replace').click(function () { 715 var target = $('#' + $(this).attr('replace')); 716 var img = $(this).attr('src'); 717 var replaced_img = target.attr('src'); 718 target.attr('src', img); 719 $(this).attr('src', replaced_img); 720 }); 721 722 $('.reload_btn').click(function () { 723 setTimeout(function () { 724 location.reload(); 725 }, 500); 726 }); 727 728 // frontend search 729 $('#tagFilterInput').on('keyup', function () { 730 console.log('KJLKJLFKJ'); 731 var val = $(this).val().trim().toLowerCase(); 732 var target = $(this).attr('search'); 733 //console.log(val); 734 if (val != '') { 735 $(target).each(function () { 736 var target_html = $(this).html().toLowerCase(); 737 if (target_html.includes(val)) { 738 $(this).show(); 739 } else { 740 $(this).hide(); 741 } 742 }); 743 } else { 744 $(target).show(0); 745 } 746 747 // var 748 749 // if($('.selectElement').) 750 }); 751 752 // // frontend search 753 // $("#container").on("keyup", ".filterInput", function () { 754 // var val = $(this).val().trim().toLowerCase(); 755 // var target = $(this).attr("search"); 756 // //console.log("searching.."); 757 // if (val != "") { 758 // //console.log("val"); 759 // $(target).each(function () { 760 // //console.log("loop"); 761 // var target_html = $(this).html().toLowerCase(); 762 // if (target_html.includes(val)) { 763 // $(this).parent().show(); 764 // // console.log("shown"); 765 // } else { 766 // $(this).parent().hide(); 767 // //console.log("hidden"); 768 // } 769 // }); 770 // } else { 771 // $(target).show(0); 772 // } 773 // }); 774 775 //******** end stand alone functions ********/ 776 777 //******** forms ********/ 778 // log in and reset password 779 $('#log_in_email, #log_in_password').on('keyup', function (event) { 780 $(this).removeClass('err'); 781 $('#login_container .treat_error_msg').text(''); 782 var keycode = event.keyCode ? event.keyCode : event.which; 783 if ($('#log_in_password:visible').length != 0) { 784 if (keycode == '13') { 785 $('#log_in_btn').click(); 786 } 787 } else { 788 if (keycode == '13') { 789 $('#reset_password_btn').click(); 790 } 791 } 792 }); 793 794 $('#log_in_btn').click(function () { 795 var email = $('#log_in_email').val().trim(); 796 var password = $('#log_in_password').val().trim(); 797 798 if (email != '') { 799 $.ajax({ 800 type: 'POST', 801 url: rootUrl + 'Frontend/user_login', 802 data: { 803 email: email, 804 password: password, 805 }, 806 807 success: function (data) { 808 if (data == 'false') { 809 $('#log_in_email').addClass('err'); 810 $('#log_in_password').addClass('err'); 811 $('#login_container .treat_error_msg') 812 .text('This E-mail is not registered.') 813 .addClass('err'); 814 } else if (data == 'password') { 815 $('#log_in_password').addClass('err'); 816 $('#login_container .treat_error_msg') 817 .text('Incorrect password.') 818 .addClass('err'); 819 } else if (data == 'ok') { 820 window.location.reload(); 821 } else { 822 $('#log_in_password').addClass('err'); 823 $('#login_container .treat_error_msg') 824 .text('sorry, this user is either expired or not registered.') 825 .addClass('err'); 826 //console.log(data); 827 } 828 }, 829 }); 830 } else { 831 $('#log_in_email').addClass('err'); 832 $('#login_container .treat_error_msg').text( 833 'Please provide an E-mail to log in.', 834 ); 835 } 836 }); 837 838 // reset password 839 // ToDo set emailing first 840 $('#reset_password_btn').click(function () { 841 if ($(this).hasClass('active')) { 842 var email = $('#log_in_email').val().trim(); 843 if (email != '') { 844 $.ajax({ 845 type: 'POST', 846 url: rootUrl + 'Frontend/reset_password', 847 data: { 848 email: email, 849 }, 850 851 success: function (data) { 852 if (data == 'false') { 853 $('.treat_error_msg') 854 .text('If you were registered: e-mail sent.') 855 .css('color', 'red'); 856 857 setTimeout(function () {
858 $('.treat_error_msg').text('').css('color', '#a90000'); 859 }, 3000); 860 } else if (data == 'true') { 861 $('.treat_error_msg') 862 .text('If you were registered: e-mail sent.') 863 .css('color', 'green'); 864 865 setTimeout(function () { 866 $('.treat_error_msg').text('').css('color', '#a90000'); 867 }, 2000); 868 } else { 869 //console.log(data); 870 } 871 }, 872 }); 873 } else { 874 $('#log_in_email').addClass('err'); 875 $('#login_container .treat_error_msg').text( 876 'Please provide an E-mail to reset the password.', 877 ); 878 } 879 } else { 880 $(this).addClass('active treat_btn'); 881 $('#log_in_email').attr('placeholder', 'E-mail'); 882 $(this).text('Reset password'); 883 $('#log_in_password,#log_in_btn').hide(); 884 } 885 }); 886 887 $('#reset_password_final_btn').click(function () { 888 var password = $('#reset_password_field').val().trim(); 889 var password_repeat = $('#reset_password_r_field').val().trim(); 890 var user_id = $(this).attr('user_id'); 891 892 $.ajax({ 893 type: 'POST', 894 url: rootUrl + 'Frontend/reset_password_final', 895 data: { 896 password: password, 897 password_repeat: password_repeat, 898 user_id: user_id, 899 }, 900 901 success: function (data) { 902 if (data.includes('true')) { 903 $('#login_container .treat_error_msg') 904 .text('Done! you can now log in .') 905 .css('color', 'green'); 906 setTimeout(function () { 907 window.location.href = rootUrl + 'backend'; 908 }, 2500); 909 } else { 910 $('#login_container .treat_error_msg').text(data); 911 } 912 }, 913 }); 914 }); 915 916 917 $('#reset_password_backend_btn').click(function () { 918 var password = $('#reset_password_field').val().trim(); 919 var password_repeat = $('#reset_password_r_field').val().trim(); 920 var user_id = $(this).attr('user_id'); 921 922 $.ajax({ 923 type: 'POST', 924 url: rootUrl + 'Frontend/reset_password_backend', 925 data: { 926 password: password, 927 password_repeat: password_repeat, 928 user_id: user_id, 929 }, 930 931 success: function (data) { 932 data = JSON.parse(data); 933 if (data.success == true) { 934 $('.treat_error_msg').text(data.message).css('color', 'green'); 935 936 setTimeout(function () { 937 window.location.href = rootUrl + 'backend'; 938 }, 1500); 939 } else { 940 $('.treat_error_msg').text(data.message); 941 } 942 }, 943 }); 944 }); 945 946 // logout 947 $('#logout_btn').click(function () { 948 $.ajax({ 949 type: 'POST', 950 url: rootUrl + 'Frontend/logout', 951 data: {}, 952 953 success: function (data) { 954 window.location.reload(); 955 //console.log(data); 956 }, 957 }); 958 }); 959 // end log in and reset password 960 961 $('.treat_input').on('keyup', function () { 962 add_fields_titles(); 963 }); 964 965 function add_fields_titles() { 966 $('.treat_input_container').each(function () { 967 var input = $(this).find('.treat_input'); 968 var val = input.val().trim(); 969 var placeholder = input.attr('placeholder'); 970 971 if (val != '') { 972 if (!$(this).hasClass('has_title')) { 973 $(this).addClass('has_title'); 974 $(this).append( 975 '<div class="treat_input_field_title semibold">' + 976 placeholder + 977 '</div>', 978 ); 979 } 980 } else { 981 $(this).removeClass('has_title'); 982 $(this).find('.treat_input_field_title').remove(); 983 } 984 }); 985 } 986 add_fields_titles(); 987 988 //******** end forms ********/ 989 990 // lazy load the result images 991 lazy_load_start(); 992 993 var lazy_int = setInterval(function () { 994 lazy_load_start(); 995 }, 100); 996 997 setTimeout(function () { 998 clearInterval(lazy_int); 999 }, 10000); 1000 1001 function lazy_load_start() { 1002 if ($('.lazy').length != 0) { 1003 $('.lazy').Lazy({ 1004 // your configuration goes here 1005 scrollDirection: 'vertical', 1006 effect: 'fadeIn', 1007 visibleOnly: true, 1008 threshold: 1000, 1009 onError: function (element) {}, 1010 afterLoad: function (element) { 1011 //console.log("loaded"); 1012 }, 1013 }); 1014 } 1015 } 1016} 1017 1018// search LP tags 1019 1020function update_by_tags() { 1021 if ($('.filterBarInput .filterElem').length > 0) { 1022 $('.filterBarInput .filterElem').each(function () { 1023 var val = $(this).text().trim().toLowerCase(); 1024 var target = $('.groupElemWrapper'); 1025 1026 $(target).each(function () { 1027 var target_html = $(this).find('.groupElemCat').html().toLowerCase(); 1028 if (target_html.includes(val)) { 1029 $(this).show(); 1030 } else { 1031 $(this).hide(); 1032 } 1033 }); 1034 1035 $('.groupContainer').each(function () { 1036 var children = $(this).find('.groupElemWrapper:visible'); 1037 if (children.length == 0) { 1038 $(this).hide(); 1039 } 1040 }); 1041 }); 1042 } else { 1043 $('.groupElemWrapper').show(); 1044 $('.groupContainer').show(); 1045 } 1046}
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.