1(function($){ 2 3 $(window).on('load', function(){ 4 $('.logos-slider').slick({ 5 dots: false, 6 infinite: true, 7 arrows: false, 8 speed: 6000, 9 cssEase: 'linear', 10 autoplay: true, 11 autoplaySpeed: 0, 12 slidesToShow: 4, 13 slidesToScroll: 1, 14 variableWidth: true, 15 responsive: [ 16 { 17 breakpoint: 1200, 18 settings: { 19 centerMode: false, 20 initialSlide: 0, 21 slidesToShow: 3 22 } 23 }, 24 { 25 breakpoint: 600, 26 settings: { 27 slidesToShow: 2 28 } 29 }, 30 { 31 breakpoint: 480, 32 settings: { 33 slidesToShow: 1 34 } 35 } 36 ] 37 }); 38 39 $(window).on('resize', function(){ 40 $('.logos-slider').slick('slickPlay'); 41 }); 42 }); 43 44 $(function(){ 45 46 var $body = $('body'), 47 $menu = $('#main-menu'); 48 49 const MOBILE_BREAKPOINT = 1024; 50 51 52 53 let $branches = $('#branches'); 54 let branches = parseInt($branches.data('num')); 55 // let branches = 0; 56 57 $body.on('click', '.add-branch', function(e) { 58 e.preventDefault(); 59 $('.rem-branch').addClass('active'); 60 if (branches < 10) { 61 ++branches; 62 console.log(branches); 63 $('.branch-' + branches).slideDown().find('.input-field.req').addClass('required'); 64 65 if (branches === 10) { 66 $(this).hide(); 67 } 68 $branches.val(branches); 69 } 70 }); 71 72 $body.on('click', '.rem-branch', function(e) { 73 e.preventDefault(); 74 $('.add-branch').show(); 75 if (branches > 0) { 76 $('.branch-' + branches).slideUp().find('.input-field').removeClass('required').find('input, textarea').removeClass('invalid').not('[type="checkbox"]').val(''); 77 --branches; 78 if (branches === 0) { 79 $(this).removeClass('active'); 80 } 81 $branches.val(branches); 82 } 83 }); 84 85 $('.menu > li > a').wrapInner('<span class="menu-item-inner"></span>'); 86 87 $body.on('click', '.row-link', function(e){ 88 if (!$(e.target).is('.more, .toggle, .toggle *')) { 89 window.location.href = $(this).find('.more').attr('href'); 90 } 91 }); 92 93 $body.on('change', '.checkbox-toggle', function(e){ 94 if ($(this).is(':checked')) { 95 $($(this).attr('data-target')).show(); 96 } else { 97 $($(this).attr('data-target')).hide(); 98 } 99 }); 100 101 $('.checkbox-toggle').trigger('change'); 102 103 $body.on('change', '.radio-toggle', function(e){ 104 if ($(this).val() === 'tak') { 105 $($(this).attr('data-target')).show(); 106 } else { 107 $($(this).attr('data-target')).hide(); 108 } 109 }); 110 111 $(['[name="regular_member"]', '[name="supporting_member"]']).trigger('change'); 112 113 $body.on('click', '.main-menu-toggle', function(e){ 114 e.preventDefault(); 115 $menu.toggleClass('open'); 116 $body.toggleClass('menu-open'); 117 $(this).find('.menu-toggle').toggleClass('is-active'); 118 }); 119 120 121 $body.on('click', '.search-toggle', function(e){ 122 e.preventDefault(); 123 $body.toggleClass('search-open'); 124 }); 125 126 $body.on('click', '.toggle', function(e){ 127 e.preventDefault(); 128 let $this = $(this), 129 $target = $($this.attr('href')), 130 $icon = $this.find('.material-icons'); 131 $target.slideToggle('normal', function() { 132 if ($target.is(':visible')) { 133 $icon.text('keyboard_arrow_up'); 134 } else { 135 $icon.text('keyboard_arrow_down'); 136 } 137 }); 138 139 }); 140 141 $body.on('click', '.toggle-subcategories', function(e){ 142 e.preventDefault(); 143 let $this = $(this), 144 $target = $($this.attr('href')), 145 $icon = $this.find('.material-icons'); 146 $target.slideToggle('fast', function() { 147 if ($target.is(':visible')) { 148 $icon.text('keyboard_arrow_down'); 149 } else { 150 $icon.text('keyboard_arrow_right'); 151 } 152 }); 153 154 }); 155 156 $body.on('click', '.trigger-click', function(e){ 157 e.preventDefault();
158 let $this = $(this), 159 $target = $($this.attr('href')); 160 $target.trigger('click'); 161 }); 162 163 164 $('.links-nav').on('click', 'a', function(e){ 165 e.preventDefault(); 166 let $this = $(this), 167 $target = $($this.attr('href')); 168 169 $('.individuals, .collective').hide(); 170 $target.show(); 171 $('.links-nav a').removeClass('active'); 172 $this.addClass('active'); 173 }); 174 175 176 177 178 $('#main-menu').hcOffcanvasNav({ 179 maxWidth: MOBILE_BREAKPOINT - 1, 180 labelClose: 'Zamknij', 181 labelBack: 'Wstecz', 182 customToggle: '.mobile-menu-toggle' 183 }); 184 185 186 $('.datepicker').datepicker({ 187 container: $('body'), 188 format: 'dd.mm.yyyy', 189 minDate: new Date(), 190 i18n: { 191 cancel: 'Anuluj', 192 clear: 'Skasuj', 193 done: 'Wybierz', 194 previousMonth: 'â¹', 195 nextMonth: 'âº', 196 months: [ 197 'StyczeÅ', 198 'Luty', 199 'Marzec', 200 'KwiecieÅ', 201 'Maj', 202 'Czerwiec', 203 'Lipiec', 204 'SierpieÅ', 205 'WrzesieÅ', 206 'Październik', 207 'Listopad', 208 'GrudzieÅ' 209 ], 210 monthsShort: [ 211 'Sty', 212 'Lut', 213 'Mar', 214 'Kwi', 215 'Maj', 216 'Cze', 217 'Lip', 218 'Sie', 219 'Wrz', 220 'Paź', 221 'Lis', 222 'Gru' 223 ], 224 weekdays: ['Niedziele', 'PoniedziaÅek', 'Wtorek', 'Åroda', 'Czwartek', 'PiÄ tek', 'Sobota'], 225 weekdaysShort: ['Nie', 'Pon', 'Wt', 'År', 'Czw', 'PiÄ ', 'Sob'], 226 weekdaysAbbrev: ['N', 'P', 'W', 'Å', 'C', 'P', 'S'] 227 }, 228 229 }); 230 231 232 M.updateTextFields(); 233 234 $('.form-wrapper select').not('.default-select').formSelect(); 235 236 // $('input[type="radio"]').parent().wrapInner('<label></label>'); 237 238 $('.input-field').each(function() { 239 let $this = $(this); 240 $this.find('br').remove(); 241 242 let $input = $this.find('.wpcf7-form-control').not('select'); 243 $input 244 .attr('id', $input.attr('name')) 245 .closest('.input-field') 246 .find('label') 247 .attr('for', $input.attr('name')) 248 .appendTo($input.parent()) 249 .parent() 250 .addClass('input-field') 251 .parent() 252 .removeClass('input-field') 253 .addClass('input-field-wrapper'); 254 255 256 257 let $select = $this.find('select.wpcf7-form-control'); 258 $select 259 .attr('id', $select.attr('name')) 260 .closest('.input-field') 261 .find('label') 262 .attr('for', $select.attr('name')) 263 .appendTo($select.parent().parent()) 264 .parent() 265 .addClass('input-field') 266 .parent() 267 .removeClass('input-field') 268 .addClass('input-field-wrapper'); 269 270 271 }); 272 273 $('.wpcf7-checkbox').find('input[type="checkbox"]').parent().wrap('<label></label>'); 274 275 $('input[type="radio"]').closest('.input-field-wrapper').addClass('radio-field-wrapper'); 276 277 if ($('#accounting-offices-form').length) { 278 279 280 $('#supporting_member_number').on('keyup', function() { 281 if ($(this).val().length >= 2) { 282 $('#supporting_member_division').closest('.input-field').addClass('required').find('label').find('sup').remove().end().append('<sup>*</sup>'); 283 284 let number = $(this).val().toUpperCase().replace('W/', '').substring(0, 2); 285 if (CITIES[number]) { 286 $('#supporting_member_division').val(CITIES[number]).closest('.form-row').find('.select-wrapper > input').val(CITIES[number]); 287 } 288 289 290 } else { 291 $('#supporting_member_division').closest('.input-field').removeClass('required').find('sup').remove().end().find('.invalid').removeClass('invalid'); 292 } 293 }); 294 295 $('#regular_member_number').on('keyup', function() { 296 297 if ($(this).val().length >= 2) { 298 $('#regular_member_division').closest('.input-field').addClass('required').find('label').find('sup').remove().end().append('<sup>*</sup>'); 299 300 let number = $(this).val().substring(0, 2); 301 if (CITIES[number]) { 302 $('#regular_member_division').val(CITIES[number]).closest('.form-row').find('.select-wrapper > input').val(CITIES[number]); 303 } 304 } else { 305 $('#regular_member_division').closest('.input-field').removeClass('required').find('sup').remove().end().find('.invali
305d').removeClass('invalid'); 306 } 307 }); 308 309 $('[name="services[]"]').on('change', function() { 310 if ($(this).val() === 'inne, jakie?') { 311 $('.input-field.other_services').show(); 312 } else { 313 $('.input-field.other_services').hide(); 314 } 315 }); 316 317 $('[name="services[]"]').trigger('change'); 318 319 $body.on('change', ['[name="supporting_member"]', '[name="regular_member"]', '[name="signatory"]', '[name="oc"]'], function() { 320 if ( 321 ($('[name="supporting_member"]:checked').val() === 'tak' || $('[name="regular_member"]:checked').val() === 'tak') 322 && $('[name="signatory"]:checked').val() === 'tak' 323 && $('[name="oc"]:checked').val() === 'tak' 324 ) { 325 $('.visualisation').show().find('.checkbox').addClass('required'); 326 } else { 327 $('.visualisation').hide().find('.checkbox').removeClass('required'); 328 } 329 }); 330 331 $('[name="supporting_member"]').trigger('change'); 332 333 334 $('[name="permissions[]"]').on('change', function() { 335 if ($(this).val() === 'inne, jakie?') { 336 $('.input-field.other_permissions').show(); 337 } else { 338 $('.input-field.other_permissions').hide(); 339 } 340 }); 341 342 $('[name="permissions[]"]').trigger('change'); 343 344 $('.copy-contact-data').on('click', function() { 345 if ($(this).is(':checked')) { 346 $('#contact_street').val($('#street').val()).trigger('focus'); 347 $('#contact_building_number').val($('#building_number').val()).trigger('focus'); 348 $('#contact_apartment_number').val($('#apartment_number').val()).trigger('focus'); 349 $('#contact_district').val($('#district').val()).trigger('focus'); 350 $('#contact_community').val($('#community').val()).trigger('focus'); 351 $('#contact_state').val($('#state').val()).closest('.form-row').find('.select-wrapper > input').val($('#state').val()); 352 // $('#contact_city').val($('#city').val()).closest('.form-row').find('.select-wrapper > input').val($('#city').val()); 353 $('#contact_city').val($('#city').val()).trigger('focus'); 354 $('#contact_zip').val($('#zip').val()).trigger('focus'); 355 $('#contact_office_phone').val($('#office_phone').val()).trigger('focus'); 356 $('#contact_office_email').val($('#office_email').val()).trigger('focus'); 357 } else { 358 $('#contact_street').val('').trigger('focus'); 359 $('#contact_building_number').val('').trigger('focus'); 360 $('#contact_apartment_number').val('').trigger('focus'); 361 $('#contact_district').val('').trigger('focus'); 362 $('#contact_community').val('').trigger('focus'); 363 $('#contact_state').val('').closest('.form-row').find('.select-wrapper > input').val(''); 364 // $('#contact_city').val('').closest('.form-row').find('.select-wrapper > input').val(''); 365 $('#contact_city').val('').trigger('focus'); 366 $('#contact_zip').val('').trigger('focus'); 367 $('#contact_office_phone').val('').trigger('focus'); 368 $('#contact_office_email').val('').trigger('focus'); 369 } 370 }); 371 372 $('.accounting-office-get-data').on('click', function (e) { 373 e.preventDefault(); 374 let url = $(this).attr('data-href'); 375 let nip = $('[name^="nip"]').val(); 376 let regon = $('[name^="regon"]').val(); 377 let nonce = $('#_wpnonce').val(); 378 if (nip || regon) { 379 $.post(url, {nip: nip, regon: regon, nonce: nonce}, function(data){ 380 381 if (data['error']) { 382 alert(data['error']); 383 } else { 384 if (data["name"].length !== 0) { 385 $('#name').val(data["name"]).trigger('focus'); 386 } 387 if (data["street"].length !== 0) { 388 $('#street').val(data["street"]).trigger('focus'); 389 } 390 if (data["propertyNumber"].length !== 0) { 391 $('#building_number').val(data["propertyNumber"]).trigger('focus'); 392 } 393 if (data["apartmentNumber"].length !== 0) { 394 $('#apartment_number').val(data["apartmentNumber"]).trigger('focus'); 395 } 396 397 if (data["district"].length !== 0) { 398 $('#district').val(data["district"]).trigger('focus'); 399 } 400 if (data["community"].length !== 0) { 401 $('#community').val(data["community"]).trigger('focus'); 402 } 403 if (data["province"].length !== 0) { 404 $('#state').val(data["province"]).closest('.form-row').find('.select-wrapper > input').val(data["province"]); 405 } 406 407 if (data["city"].length !== 0) { 408 $('#city').val(data["city"]).trigger('focus'); 409 // $('#city').val(data["city"]).closest('.form-row').find('.select-wrapper > input').val(data["city"]); 410 } 411 412 if (data["zipCode"].length !== 0) { 413 $('#zip').val(data["zipCode"]).trigger('focus'); 414 }
415 if (data["phone"].length !== 0) { 416 $('#office_phone').val(data["phone"]).trigger('focus'); 417 } 418 if (data["email"].length !== 0) { 419 $('#office_email').val(data["email"]).trigger('focus'); 420 } 421 if (data["nip"].length !== 0) { 422 $('#nip').val(data["nip"]).trigger('focus'); 423 } 424 if (data["regon"].length !== 0) { 425 $('#regon').val(data["regon"]).trigger('focus'); 426 } 427 428 if (data['type'] === 'f') { 429 $('#legal_form').val(LEGAL_FORMS['f']).closest('.form-row').find('.select-wrapper > input').val(LEGAL_FORMS['f']); 430 } else if (data['legal_form_detail'] && LEGAL_FORMS[data['legal_form_detail']]) { 431 $('#legal_form').val(LEGAL_FORMS[data['legal_form_detail']]).closest('.form-row').find('.select-wrapper > input').val(LEGAL_FORMS[data['legal_form_detail']]); 432 } 433 $('#legal_form').trigger('change'); 434 435 } 436 }); 437 } else { 438 alert('ProszÄ wpisaÄ NIP lub REGON aby pobraÄ dane z GUS'); 439 $('.scroll-to-nip').trigger('click'); 440 } 441 }); 442 443 // $('.supporting-member, .supporting-member-details, .regular-member, .regular-member-details, .label-1, .label-2').hide(); 444 445 $('#legal_form').on('change', function() { 446 $('.supporting-member-form, .supporting-member-details, .regular-member-form, .regular-member-details, .member-form').hide(); 447 if ($(this).val().length) { 448 let legal_form_id = LEGAL_FORMS_IDS[$(this).val()]; 449 if (legal_form_id === 'f') { 450 $('.regular-member-form').show().find('.label-1, .label-2').hide().filter('.label-1').show(); 451 } else if (legal_form_id === 19){ 452 $('.regular-member-form').show().find('.label-1, .label-2').hide().filter('.label-2').show(); 453 $('.supporting-member-form').show(); 454 } else { 455 $('.supporting-member-form').show(); 456 } 457 458 $('.member-form').show(); 459 } 460 461 $(['[name="supporting_member"]', '[name="regular_member"]']).trigger('change'); 462 // $(['#regular_member_number', '#supporting_member_number', '#regular_member_division', '#supporting_member_division']).val(''); 463 464 }); 465 466 $('#legal_form').trigger('change'); 467 468 469 $('[name="supporting_member"]').on('change', function() { 470 if ($('[name="supporting_member"]:checked').val() === 'tak') { 471 $('.supporting-member-details').show(); 472 } else { 473 $('.supporting-member-details').hide(); 474 } 475 }).trigger('change'); 476 477 478 $('[name="regular_member"]').on('change', function() { 479 if ($('[name="regular_member"]:checked').val() === 'tak') { 480 $('.regular-member-details').show(); 481 } else { 482 $('.regular-member-details').hide(); 483 } 484 }).trigger('change'); 485 486 487 488 489 $('[name="oc"]').on('change', function() { 490 if ($('[name="oc"]:checked').val() === 'tak') { 491 $('#oc-alert').hide(); 492 } else { 493 $('#oc-alert').show(); 494 } 495 }).trigger('change'); 496 497 498 } 499 500 if ($body.is('.page-template-declaration')) { 501 502 503 $('[name="profesional_titles[]"]').on('change', function(){ 504 let values = $('[name="profesional_titles[]"]:checked').map(function(){ return $(this).val();}); 505 506 if (values.toArray().indexOf('inne, wpisaÄ jakie') !== -1) { 507 $('.input-field.profesional_title_other').show(); 508 } else { 509 $('.input-field.profesional_title_other').hide(); 510 } 511 }); 512 513 $('[name="profesional_titles[]"]').first().trigger('change'); 514 515 $('#company_type').on('change', function() { 516 if ($(this).val() === 'spóÅka osobowa' || $(this).val() === 'spóÅka kapitaÅowa' || $(this).val() === 'inne, wpisaÄ jakie') { 517 $('.input-field.company_type_details').show(); 518 } else { 519 $('.input-field.company_type_details').hide(); 520 } 521 }); 522 523 $('#company_type').trigger('change'); 524 525 526 $('#activity_type').on('change', function() { 527 if ($(this).val() === 'inne, wpisaÄ jakie') { 528 $('.input-field.activity_type_other').show(); 529 } else { 530 $('.input-field.activity_type_other').hide(); 531 } 532 }); 533 534 $('#activity_type').trigger('change'); 535 536 537 $('#current_position').on('change', function() { 538 if ($(this).val() === 'inne, wpisaÄ jakie') { 539 $('.input-field.current_position_other').show(); 540 } else { 541 $('.input-field.current_position_other').hide(); 542 } 543 }); 544 545 $('#current_position').trigger('change'); 546 547 548 549 } 550
551 var $slider = $('.news-slider'), 552 $loader = $('.loader'), 553 sliderSpeed = 4000; 554 555 $slider.slick({ 556 arrows: false, 557 autoplay: true, 558 autoplaySpeed: sliderSpeed, 559 pauseOnHover: false, 560 dots: true 561 }); 562 563 $slider.on('beforeChange', function(event, slick, currentSlide, nextSlide){ 564 $loader.stop().css({width: '0%'}) 565 }); 566 567 $slider.on('afterChange', function(event, slick, currentSlide, nextSlide){ 568 $loader.stop().css({width: '0%'}).animate({width: '100%'}, sliderSpeed) 569 }).trigger('afterChange'); 570 571 var $gallery = $('.gallery'); 572 573 $gallery.slick({ 574 arrows: true, 575 dots: false, 576 slidesToShow: 4, 577 slidesToScroll: 1, 578 prevArrow: '<a href="" class="slick-prev"><i class="material-icons icon-flipped">arrow_right_alt</i></a>', 579 nextArrow: '<a href="" class="slick-next"><i class="material-icons">arrow_right_alt</i></a>', 580 responsive: [ 581 { 582 breakpoint: 767, 583 settings: { 584 slidesToShow: 3, 585 } 586 }, 587 { 588 breakpoint: 600, 589 settings: { 590 slidesToShow: 2 591 } 592 }, 593 { 594 breakpoint: 480, 595 settings: { 596 slidesToShow: 1 597 } 598 } 599 ] 600 }); 601 602 603 var $db_filters = $('.db-filters .filter'); 604 605 606 $body.on('click', '.letters a', function(e){ 607 e.preventDefault(); 608 let l = $(this).data('letter'); 609 $('.db-list tbody tr').show().not('.' + l).hide(); 610 }); 611 612 613 $body.on('click', '.section-letters a', function(e){ 614 e.preventDefault(); 615 $('.db-filters .filter').val(''); 616 let l = $(this).data('letter'); 617 $('.db-list').show().not('.' + l).hide(); 618 }); 619 620 $body.on('change', '.db-filters .filter', function(){ 621 $('.db-list tbody tr').show(); 622 $db_filters.each(function() { 623 var $f = $(this); 624 if ($f.val()) { 625 $('.db-list tbody tr').each(function(){ 626 if ($(this).find('.searchable').text().toUpperCase().indexOf($f.val().toUpperCase()) === -1) { 627 $(this).hide(); 628 } 629 }); 630 } 631 }); 632 }); 633 $body.on('change, keyup', '.db-filters .filter', function(){ 634 $('.db-list').show(); 635 $('.db-list tbody tr.disable-search').show(); 636 $('.db-list tbody tr td.searchable').show(); 637 $db_filters.each(function() { 638 var $f = $(this); 639 if ($f.val()) { 640 $('.db-list tbody tr').not('.disable-search').each(function(){ 641 if ($(this).text().toUpperCase().indexOf($f.val().toUpperCase()) === -1) { 642 $(this).hide(); 643 } 644 }); 645 $('.db-list tbody tr td.searchable').each(function(){ 646 if ($(this).text().toUpperCase().indexOf($f.val().toUpperCase()) === -1) { 647 $(this).hide(); 648 } 649 }); 650 } 651 }); 652 653 $('.db-list').each(function(){ 654 if ($(this).find('tbody td:visible').length === 0) { 655 $(this).hide(); 656 } else { 657 $(this).show(); 658 } 659 }); 660 }); 661 662 663 664 665 666 var $filters = $('.exams-filters .filter'); 667 668 $body.on('change', '.exams-filters .filter', function(){ 669 var hash = ''; 670 $('.terms-list tr').show(); 671 $filters.each(function() { 672 var $f = $(this); 673 if ($f.val()) { 674 hash += $f.attr('name') + ':' + $f.val() + ','; 675 $('.terms-list tr').not('.' + $f.attr('name') + '-' + $f.val()).hide(); 676 } 677 }); 678 if (hash) { 679 window.location.hash = '#filter:' + hash; 680 } else { 681 history.pushState("", document.title, window.location.pathname + window.location.search); 682 } 683 684 }); 685 686 687 $body.on('click', '.scroll-to', function(e){ 688 e.preventDefault(); 689 var scrollTop = $(window).scrollTop(); 690 var target = $(this).data('target') || $(this).attr('href'), 691 margin = parseInt($(this).data('margin')) || 0; 692 if (!target) return; 693 var offset = $(target).length ? $(target).offset() : { left:0, top:0 }; 694 $('html, body').stop(true).animate({scrollTop : (offset.top + margin - 170)}, 1250); 695 $body.removeClass('menu-open'); 696 }); 697 698 if (window.location.hash.indexOf('filter') === 1) { 699 let filters = window.location.hash.replace('#filter:', '').split(',').filter(function (t) { return !!t; }).map(function(f) { return f.split(':')}); 700 $.each(filters, function(index, value) { 701 $('[name="' + value[0] + '"]').val(value[1]); 702 }); 703 704 $('.filters .filter').trigger('change'); 705 } 706 707 var pageScrolled, 708 scrollTop; 709 710 $(window).on('scroll', function(e){ 711 scrollTop = $(window).scrollTop(); 712 713 if (scrollTop >= 100 && !pageScrolled) { 714 $body.addClass('scrolled'); 715 pageScrolled = !pageScrolled; 716 } else if (scrollTop < 100 && pageScrolled) { 717 $body.removeClass('scrolled'); 718 pageScrolled = !pageScrolled; 719 } 720 }); 721 722 723 $(window).on('resize', function(){ 724 $('a[data-rel^=lightcase]').lightcase({ 725 overlayOpacity: 1.0, 726 showTitle: true, 727 showCaption: true, 728 showSequenceInfo: false, 729 disableShrink: false, 730 closeOnOverlayClick: false, 731 maxWidth: Math.min(1050, (window.innerWidth * 0.9)), 732 maxHeight: Math.min(700, (window.innerHeight * 0.9)), 733 shrinkFactor: 1.0 734 }); 735 }).trigger('resize'); 736 737 $('#side-menu').find('a[href="' + window.location.href + '"]').parents('li').addClass('active'); 738 739 740 $('img').removeAttr('width').removeAttr('height'); 741 $('.page-content iframe').wrap('<div class="video-container"></div>'); 742 743 var $datepicker = $('#datepicker-wrapper'), 744 events = []; 745 746 if (typeof calendar_dates !== 'undefined') { 747 events = calendar_dates; 748 } 749 750 function getFullDate(date) { 751 let dayOfWeek = date.getDay(), 752 dayOfMonth = date.getDate(),
753 month = date.getMonth() + 1; 754 755 if (dayOfMonth < 10) { 756 dayOfMonth = '0' + dayOfMonth; 757 } 758 759 if (month < 10) { 760 month = '0' + month; 761 } 762 return date.getFullYear() + '-' + month + '-' + dayOfMonth; 763 } 764 765 $datepicker.datepicker({ 766 nextText: '<i class="material-icons">chevron_right</i>', 767 prevText: '<i class="material-icons">chevron_left</i>', 768 altField: "#date-input", 769 dateFormat: 'dd.mm.yy', 770 onSelect: function(date, inst) { 771 let dateArray = date.split('.'), 772 fullDate = dateArray[2] + '-' + dateArray[1] + '-' + dateArray[0]; 773 774 775 if (typeof events[fullDate] !== 'undefined') { 776 window.location.href = events[fullDate]; 777 } 778 }, 779 beforeShowDay: function(date) { 780 let fullDate = getFullDate(date); 781 782 if (typeof events[fullDate] !== 'undefined') { 783 return [true, 'ui-datepicker-event', '']; 784 } else { 785 return [true, '', '']; 786 } 787 } 788 }); 789 790 var $counters = $('.number'); 791 792 $counters.each(function(){ 793 794 var _counters = $(this), 795 counters = [], 796 countersStared = false; 797 798 _counters.find('.num').text('0'); 799 800 _counters.appear(); 801 802 _counters.on('appear', function(event, $all_appeared_elements) { 803 if (!countersStared) { 804 countersStared = true; 805 _counters.find('.num').each(function(){ 806 var $this = $(this), 807 max = parseInt($this.data('max')), 808 time = parseInt($this.data('time')); 809 $this.countup({ 810 startVal: 0, 811 endVal: max, 812 decimals: 0, 813 duration: time, 814 options: { 815 useEasing : true, 816 useGrouping : true, 817 separator : ' ', 818 decimal : ',', 819 prefix : '', 820 suffix : '' 821 } 822 }); 823 }); 824 } 825 }); 826 827 if (_counters.is(':appeared')) { 828 _counters.trigger('appear'); 829 } 830 831 }); 832 833 $('div.tab-content').not('[data-tab=1]').hide(); 834 835 $('.tabs').on('click', 'a', function(e) { 836 e.preventDefault(); 837 $(this).addClass('active'); 838 $('.tabs a').not(this).removeClass('active'); 839 840 var tab = $(this).data('tab'); 841 $('div[data-tab="' + tab + '"]').show(); 842 $('div.tab-content').not('[data-tab="' + tab + '"]').hide(); 843 window.location.hash = 'tab-' + tab; 844 }); 845 846 if (window.location.hash.indexOf('tab') === 1) { 847 let tab = window.location.hash.replace('#tab-', ''); 848 $('[data-tab="' + tab + '"]').trigger('click'); 849 } 850 851 852 let members = 1; 853 /* 854 $body.on('click', '.add-member', function(e) { 855 e.preventDefault(); 856 $('.rem-member').addClass('active'); 857 if (members < 10) { 858 ++members; 859 $('.member-' + members).slideDown().find('.input-field').addClass('required'); 860 if (members === 10) { 861 $(this).hide(); 862 } 863 } 864 }); 865 866 $body.on('click', '.rem-member', function(e) { 867 e.preventDefault(); 868 $('.add-member').show(); 869 if (members > 1) { 870 $('.member-' + members).slideUp().find('.input-field').removeClass('required').find('input, textarea').removeClass('invalid').val(''); 871 --members; 872 if (members === 1) { 873 $(this).removeClass('active'); 874 } 875 } 876 }); 877 */ 878 $body.on('change', '#invoice-check', function() { 879 if ($(this).is(':checked')) { 880 $('.invoice-data').slideDown().find('.input-field').addClass('required');; 881 } else { 882 $('.invoice-data').slideUp().find('.input-field').removeClass('required').find('input, textarea').removeClass('invalid').val(''); 883 } 884 885 }); 886 887 $body.on('change', '.check-all', function(e) { 888 $body.find($(this).attr('data-target')).filter(':visible').prop('checked', $(this).is(':checked')); 889 }); 890 891 892 let $membership_fee = $('#membership_fee'), 893 $membership_fee_desc = $('#membership_fee_desc'); 894 895 $membership_fee.on('change', function() { 896 let val = $(this).val(); 897 $membership_fee_desc.val($(this).find(':selected').text()); 898 }).trigger('change'); 899 900 901 902 $('.validate-form').on('submit', function(e) { 903 let valid = true, 904 $form = $(this); 905 // e.preventDefault(); 906 $form.find('.helper-text').remove(); 907 $form.find('.required').each(function(){ 908 let $input = $(this).find('input, input.select-dropdown, textarea').not('[type="hidden"]'), 909 field_valid = true, 910 message = 'Pole jest wymagane'; 911 if (!$input.length) { 912 return; 913 } 914 915 916 $input 917 .removeClass('invalid').addClass('valid') 918 .closest('.checkbox, .radio-field-wrapper').removeClass('invalid').addClass('valid'); 919 920 921 922 if ($input.is('.multiple-checkbox')) { 923 let $checkboxes = $input.closest('.checkboxes'); 924 $checkboxes.find('label').removeClass('invalid valid'); 925 if ($checkboxes.find('[type="checkbox"]:checked').length === 0) { 926 valid = field_valid = false; 927 $checkboxes.find('[type="checkbox"]').parent().addClass('invalid'); 928 message = 'Jedno z pól jest wymagane'; 929 } 930 } else if ($input.is('[type="checkbox"]') && !$input.is(':checked')) { 931 valid = field_valid = false;
932 $input.closest('.checkbox').removeClass('valid').addClass('invalid'); 933 } else if ($input.is('[type="radio"]') && !$input.filter(':checked').length) { 934 valid = field_valid = false; 935 $input.closest('.radio-field-wrapper').removeClass('valid').addClass('invalid'); 936 } else if ($input.val().length === 0 || $input.val() === 'wybierz'|| $input.val() === 'proszÄ wybraÄ' || $input.val() === '---') { 937 valid = field_valid = false; 938 $input.removeClass('valid').addClass('invalid'); 939 } 940 941 if ($input.is('[name^="pesel"]') && !isValidPesel($input.val())) { 942 valid = field_valid = false; 943 $input.removeClass('valid').addClass('invalid'); 944 message = 'Niepoprawny numer PESEL'; 945 } 946 947 if ($('#password_confirm').length) { 948 if ($input.is('[name^="password"]') && $('#password').val() !== $('#password_confirm').val()) { 949 valid = field_valid = false; 950 $input.removeClass('valid').addClass('invalid'); 951 message = 'Wpisane hasÅa nie sÄ identyczne'; 952 } 953 } 954 955 956 if ($input.is('[name^="nip"]') && !isValidNip($input.val())) { 957 valid = field_valid = false; 958 $input.removeClass('valid').addClass('invalid'); 959 message = 'Niepoprawny numer NIP'; 960 } 961 962 if ($input.is('[name*="phone"]') && !isValidPhone($input.val())) { 963 valid = field_valid = false; 964 $input.removeClass('valid').addClass('invalid'); 965 message = 'Niepoprawny numer telefonu'; 966 } 967 968 /* 969 if (!OFFICE_ID && $input.is('[name^="oc"]') && $input.filter(':checked').val() === 'nie') { 970 valid = field_valid = false; 971 $input.removeClass('valid').addClass('invalid'); 972 message = 'Aby dokonaÄ zapisu do bazy Biuro musi posiadaÄ aktualnÄ polisÄ OC'; 973 } 974 */ 975 976 if (typeof OFFICE_ID !== 'undefined' && !OFFICE_ID && $input.is('[name^="oc"]') && !$input.is(':checked')) { 977 valid = field_valid = false; 978 $input.closest('.checkbox').removeClass('valid').addClass('invalid'); 979 message = 'Aby dokonaÄ zapisu do bazy Biuro musi posiadaÄ aktualnÄ polisÄ OC'; 980 } 981 982 if (!field_valid) { 983 $input.closest('.input-field, .checkbox, .radio-field-wrapper').append('<span class="helper-text error">' + message + '</span>'); 984 } 985 986 }); 987 988 if (!valid) { 989 e.preventDefault(); 990 var offset = $form.length ? $form.offset() : { left:0, top:0 }; 991 $('html, body').stop(true).animate({scrollTop : (offset.top - 80)}, 1250); 992 return false; 993 } 994 }); 995 996 997 }); 998 999 $(window).on('load', function() { 1000 1001 if ($(window).width() >= 768) { 1002 1003 var topHeight= $('#top').outerHeight(), 1004 footerHeight= $('#footer').outerHeight(); 1005 /* 1006 $('#side-menu').sticky({ 1007 topSpacing: $('#top').outerHeight() + 20, 1008 bottomSpacing: $('#footer').outerHeight() + 20 1009 }); 1010 */ 1011 } 1012 1013 }); 1014 1015})(jQuery);
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.