1$(document).ready(function () { 2 3 //########################### GLOBAL VARS 4 window.App = { 5 Link : { 6 'currentUrl' : window.location.href, 7 'hostName' : window.location.hostname 8 } 9 } 10 11 //############################ ACTIVATE ANIMATION 12 var wow = new WOW({ 13 mobile:false 14 }); 15 wow.init(); 16 17 //############################ ACCORDION 18 $('.accordion_wrap h4').click(function() { 19 var content = $(this).next('ul'); 20 21 if(content.hasClass('vissible')) { 22 content.slideUp(500); 23 $(this).removeClass('add'); 24 content.removeClass('vissible'); 25 } else { 26 content.addClass('vissible'); 27 content.slideDown(500); 28 $(this).addClass('add'); 29 } 30 }); 31 32 //########################## SUB MENU and HEADER 33 34 var navLinks = $('header nav ul li a'), 35 submenu = $('.submenu'), 36 submenuLinks = $('.submenu a'); 37 38 var posHeader=$('header').offset().top; 39 var startPos = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop; 40 41 if(startPos > 0) { 42 $('header').addClass('fixed'); 43 } 44 45 $(window).scroll(function() { 46 if ($(window).scrollTop()>posHeader) { 47 if ($('header').hasClass()==false) $('header').addClass('fixed'); 48 } else $('header').removeClass('fixed'); 49 }); 50 51 function detectWith() { 52 var windowWith = window.screen.width, 53 windowLokation = window.location.hostname; 54 55 $('header nav ul li a').unbind('click'); 56 57 function showSubMenu(e) { 58 var detectData = e.target; 59 if(detectData.hasAttribute('data-select-package')) { 60 var checkAttr = detectData.getAttribute('data-select-package'); 61 62 if(checkAttr==='packages') { 63 submenuLinks[0].setAttribute('href', 'http://' + windowLokation + '/pakiety-orange'); 64 submenuLinks[0].removeAttribute('target'); 65 submenuLinks[1].setAttribute('href', 'http://' + windowLokation + '/pakiety-play'); 66 submenuLinks[1].removeAttribute('target'); 67 submenuLinks[2].setAttribute('href', 'http://' + windowLokation + '/pakiety-plus'); 68 submenuLinks[2].removeAttribute('target'); 69 submenuLinks[3].setAttribute('href', 'http://' + windowLokation + '/pakiety-t-mobile'); 70 submenuLinks[3].removeAttribute('target'); 71 $(submenuLinks[4]).parent().css('display', 'none'); 72 73 $(submenuLinks).each(function() { 74 var package = $(this).attr('data-set-cookie'); 75 76 $(this).bind({ 77 'click' : function() { 78 setCookie('chosen_package', package, {expires:0, path: '/'}); 79 } 80 }) 81 }); 82 } else if(checkAttr==='login') { 83 submenuLinks[0].setAttribute('href', 'https://gdziejestdziecko.pl/orange/public/sc01-localize.jsf?srv=bd'); 84 submenuLinks[0].setAttribute('target', '_blank'); 85 86 submenuLinks[1].setAttribute('href', 'https://gdziejestdziecko.pl/play/public/sc01-localize.jsf?srv=bd'); 87 submenuLinks[1].setAttribute('target', '_blank'); 88 89 submenuLinks[2].setAttribute('href', 'https://gdziejestdziecko.pl/plus/public/sc01-localize.jsf?srv=bd'); 90 submenuLinks[2].setAttribute('target', '_blank'); 91 92 submenuLinks[3].setAttribute('href', 'https://gdziejestdziecko.pl/t-mobile/public/sc01-localize.jsf?srv=bd'); 93 submenuLinks[3].setAttribute('target', '_blank'); 94 95 submenuLinks[4].setAttribute('href', 'https://gdziejestdziecko.pl/netia/public/sc01-localize.jsf?srv=bd'); 96 submenuLinks[4].setAttribute('target', '_blank'); 97 98 $(submenuLinks[4]).parent().css('display', 'inline-block'); 99 } 100 101 $(detectData).next('div').addClass('active'); 102 103 $(detectData).next('div').fadeIn(500); 104 $(submenu).fadeIn(500); 105 }else { 106 $('.rect.active').fadeOut(100); 107 $(submenu).fadeOut(500); 108 } 109 } 110 111 if(windowWith > 991) { 112 $('header nav ul li a').bind({ 113 'mouseover': function(e) { 114 showSubMenu(e); 115 } 116 }); 117 $('header nav ul li a').bind({ 118 'click': function(e) { 119 var detectData = e.target; 120 121 if(detectData.hasAttribute('data-select-package')) { 122 e.preventDefault(); 123 } 124 } 125 }); 126
127 $(submenu).mouseleave(function() { 128 $('.rect.active').fadeOut(100); 129 $(submenu).fadeOut(500); 130 }); 131 132 } else { 133 134 $('header nav ul li a').unbind('mouseover'); 135 $('header nav ul li a').bind({ 136 'click': function(e) { 137 var detectData = e.target; 138 console.log(detectData); 139 if(detectData.hasAttribute('data-select-package')) { 140 e.preventDefault(); 141 var submenu = $(this).siblings('ul'); 142 143 if(submenu.hasClass('vissible')) { 144 $(this).removeClass('active'); 145 submenu.slideUp(500); 146 submenu.removeClass('vissible'); 147 return false; 148 } else { 149 $(this).addClass('active'); 150 submenu.slideDown(500); 151 submenu.addClass('vissible'); 152 return false; 153 } 154 } else if ($(detectData).hasClass('zastosow')) { 155 e.preventDefault(); 156 var submenu = $(this).siblings('ul'); 157 158 if(submenu.hasClass('vissible')) { 159 $(this).removeClass('active'); 160 submenu.slideUp(500); 161 submenu.removeClass('vissible'); 162 return false; 163 } else { 164 $(this).addClass('active'); 165 submenu.slideDown(500); 166 submenu.addClass('vissible'); 167 return false; 168 } 169 } 170 } 171 }); 172 173 $('a.pakiet_cookie').click(function(e) { 174 var package = $(this).attr('data-set-cookie'); 175 setCookie('chosen_package', package, {expires:0, path: '/'}); 176 }); 177 } 178 } 179 180 detectWith(); 181 182 $(window).resize(function() { 183 detectWith(); 184 }); 185 186 $('header .btn').click(function() { 187 $('.nav_container').addClass('active'); 188 }); 189 190 var rwdWrapMenu = $('.nav_container'); 191 rwdWrapMenu.click(function(event) { 192 e = event || window.event 193 if (e.target == this) { 194 $(rwdWrapMenu).removeClass('active'); 195 } 196 }); 197 $('.close').click(function() { 198 $(rwdWrapMenu).removeClass('active'); 199 }); 200 201 //########################### DRAW SVG 202 203 var polys = document.querySelectorAll('polygon,polyline'); 204 //[].forEach.call(polys,convertPolyToPath); 205 206 function convertPolyToPath(poly){ 207 var svgNS = poly.ownerSVGElement.namespaceURI; 208 var path = document.createElementNS(svgNS,'path'); 209 var points = poly.getAttribute('points').split(/\s+|,/); 210 211 var stroke = poly.getAttribute('stroke'); 212 var strokeWidth = poly.getAttribute('stroke-width'); 213 var fill = poly.getAttribute('fill'); 214 215 var x0=points.shift(), y0=points.shift(); 216 var pathdata = 'M'+x0+','+y0+'L'+points.join(' '); 217 if (poly.tagName=='polygon') pathdata+='z'; 218 path.setAttribute('d',pathdata); 219 220 path.setAttribute('stroke', stroke); 221 path.setAttribute('stroke-width', strokeWidth); 222 path.setAttribute('fill', fill); 223 224 poly.parentNode.replaceChild(path,poly); 225 } 226 227 var mainContent = $('.header_wrap').next('div'); 228 229 if(mainContent.hasClass('services_container')) { 230 231 } else if(mainContent.hasClass('about_container')) { 232 233 } else if(mainContent.hasClass('contacts_container')) { 234 235//########################## CONTACT FORM 236 237 $('#problemsList').selectbox(); 238 239 $('#date').datepicker({ 240 'language':'pl', 241 'orientation':'bottom', 242 'autoclose': true, 243 'todayHighlight': true, 244 'format': 'dd/mm/yyyy' 245 }); 246 247 } else if (mainContent.hasClass('glowna_container')) { 248 $(".time").TimeCircles({ 249 circle_bg_color: "transparent", 250 time: { 251 Days: { 252 text: "dni", 253 color: "#transparent", 254 }, 255 Hours: { 256 text: "godz", 257 color: "transparent" 258 }, 259 Minutes: { 260 text: "min", 261 color: "transparent" 262 }, 263 Seconds: { 264 text: "sek", 265 color: "transparent" 266 } 267 } 268 }); 269 270 $('.tabs').tabs(); 271 } else if (mainContent.hasClass('zastosowanie_container')) { 272 } else if (mainContent.hasClass('product_detail')) { 273 $(".nav_page a").mPageScroll2id(); 274 } else if (mainContent.hasClass('operators_container')) { 275 var p_container = $('.pop_up_container'); 276 $('input[name="countPakiets"]').val(1); 277 278 $('a[data-detect-pakiet]').click(function(e) { 279 e.preventDefault(); 280 p_container.fadeIn(600); 281 282 var detectOperator = e.target.getAttribute('data-detect-pakiet'), 283 valInput = +$('input[name="countPakiets"]').val(), 284 detectCount = valInput - 1, 285 controllers = $('.controller_wrap span'); 286 287 getDataFromPackage (detectOperator, detectCount, p_container); 288 289 $(controllers).click(function() { 290 if ($(this).hasClass('minus')&& detectCount > 0) { 291 detectCount--; 292 var newVal = detectCount + 1; 293 $('input[name="countPakiets"]').val(newVal); 294 295 getDataFromPackage (detectOperator, detectCount, p_container); 296 } else if ($(this).hasClass('plus')&& detectCount < 4) { 297 detectCount++; 298 var newVal = detectCount + 1; 299 if(newVal === 5) { 300 newVal = 4; 301 } 302 $('input[name="countPakiets"]').val(newVal); 303 304 getDataFromPackage (detectOperator, detectCount, p_container); 305 } 306 }); 307 }); 308 309 $('.before_pop_up span').click(function() { 310 var input = $(this).siblings('input[name="countPakiets"]'), 311 currentValue = +$(input).val(), 312 price = $(this).parent().parent().siblings('.padding').find('strong.price'), 313 currentPackage = $(this).parent().parent().siblings('a').attr('data-t-mob-pakiet'); 314 315 if($(this).hasClass('minus') && currentValue > 0) { 316 currentValue--; 317 var newValue = currentValue, 318 valArr = currentValue - 1; 319 if(newValue == 0) { 320 newValue = 1; 321 valArr = 0; 322 } 323 } else if($(this).hasClass('plus')&& currentValue < 5) { 324 currentValue++; 325 var newValue = currentValue, 326 valArr = currentValue - 1; 327 if(newValue == 5) { 328 newValue = 4; 329 valArr = 3; 330 } 331 } 332 $(input).val(newValue); 333 if(currentPackage === 'standard') { 334 $(price).text(tMobObj[0][valArr]['price']); 335 } else if (currentPackage === 'premium') { 336 $(price).text(tMobObj[1][valArr]['price']); 337 } 338 }); 339 340 var controllers = $('.in_popup span'); 341 342 $(controllers).click(function() { 343 var input = $(this).siblings('input[name="countPakiets"]'), 344 currentValue = +$(input).val(), 345 detectOperator = $(input).attr('class'); 346 347 if($(this).hasClass('minus') && currentValue > 0) { 348 currentValue--; 349 console.log(currentValue); 350 var newValue = currentValue, 351 valArr = currentValue - 1; 352 if(newValue === 0) { 353 newValue = 1; 354 valArr = 0; 355 } 356 getPakiegesFromTMob(detectOperator, valArr, p_container); 357 } else if($(this).hasClass('plus')&& currentValue < 5) { 358 currentValue++; 359 console.log(currentValue); 360 var newValue = currentValue, 361 valArr = currentValue - 1; 362 if(newValue === 5) { 363 newValue = 4; 364 valArr = 3; 365 } 366 getPakiegesFromTMob(detectOperator, valArr, p_container); 367 } 368 $(input).val(newValue); 369 }); 370 371 $('a[data-t-mob-pakiet]').click(function(e) { 372 373 console.log('JESTEM TUTAJ'); 374 375 e.preventDefault(); 376 p_container.fadeIn(600); 377 378 var detectOperator = e.target.getAttribute('data-t-mob-pakiet'), 379 currentValue = +$(this).siblings('.controller_container').find('input[name="countPakiets"]').val(); 380 381 console.log(detectOperator); 382 console.log(currentValue); 383 384 385 getPakiegesFromTMob(detectOperator, currentValue - 1, p_container); 386 $(controllers).siblings('input[name="countPakiets"]').val(currentValue).addClass(detectOperator); 387 $(p_container).find('h3 font').text(detectOperator); 388 }); 389 390 p_container.click(function(event) { 391 e = event || window.event 392 if (e.target == this) { 393 $(p_container).fadeOut(600); 394 } 395 }); 396 397 $('.close_wrap').click(function() { 398 p_container.css('display', 'none'); 399 }); 400 } 401 402}); 403 404 405 406 //####################### PARALLAX 407$(document).ready(function() { 408 var windowWidth = document.documentElement.clientWidth; 409 if(windowWidth > 991) { 410 $('*[data-type="background"]').each(function(){ 411 var $bgobj = $(this); 412 $(window).scroll(function() { 413 var yPos = -($(window).scrollTop() / $bgobj.data('speed')); 414 var coords = 'center '+ yPos + 'px'; 415 416 $bgobj.css({ backgroundPosition: coords }); 417 418 }); 419 }); 420 } else { 421 $('*[data-type="background"]').each(function(){ 422 var $bgobj = $(this); 423 $bgobj.css({ 424 backgroundAttachment: 'scroll', 425 backgroundRepeat: 'no-repeat', 426 backgroundSize: 'cover' 427 }); 428 }); 429 } 430 431}); 432 433//######################## You-Tube 434if($('.youtube_wrap').length > 0) { 435 var tag = document.createElement('script'); 436 437 tag.src = "https://www.youtube.com/iframe_api"; 438 var firstScriptTag = document.getElementsByTagName('script')[0]; 439 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 440 441 var player, 442 done = false;
443 444 function onYouTubeIframeAPIReady() { 445 $('.youtube_wrap').each(function() { 446 var videoId = $(this).attr('data-id'), 447 id = $(this).find('.insert_iframe').attr('id'); 448 449 player = new YT.Player( id, { 450 videoId: videoId, 451 playerVars: { 452 rel: 0 453 } 454 }); 455 456 $(this).find('.close_popap').click(function() { 457 pauseVideo(); 458 }); 459 460 }); 461 } 462 463} 464 465//######################## POP-UP VIDEO 466$(document).ready(function() { 467 468 var p = $('.video_popap'); 469 470 $('.video').click(function(e) { 471 e.preventDefault(); 472 p.fadeIn(600); 473 }); 474 p.click(function(event) { 475 e = event || window.event 476 if (e.target == this) { 477 $(p).fadeOut(600); 478 } 479 }); 480 $('.close').click(function() { 481 p.css('display', 'none'); 482 }); 483 $('.close_popap').click(function() { 484 p.css('display', 'none'); 485 }); 486 487}); 488 489//######################## NEWS LETTER 490$(document).ready(function() { 491 var form = $('#nl'), 492 form_blog = $('#blog'), 493 form_all = $('.to_subscribe'); 494 495 496 var validator = $(form_blog).validate({ 497 rules: { 498 new_newsletter : { 499 required: true 500 }, 501 add_to_nl : { 502 required: true 503 } 504 }, 505 messages: { 506 new_newsletter : { 507 required: "Pole wymagane.", 508 email: "ProszÄ wprowadź prawidÅowy adres email." 509 }, 510 add_to_nl : { 511 required: "Pole wymagane.", 512 email: "ProszÄ wprowadź prawidÅowy adres email." 513 } 514 } 515 }); 516 var validator2 = $(form).validate({ 517 rules: { 518 new_newsletter : { 519 required: true 520 }, 521 add_to_nl : { 522 required: true 523 } 524 }, 525 messages: { 526 new_newsletter : { 527 required: "Pole wymagane.", 528 email: "ProszÄ wprowadź prawidÅowy adres email." 529 }, 530 add_to_nl : { 531 required: "Pole wymagane.", 532 email: "ProszÄ wprowadź prawidÅowy adres email." 533 } 534 } 535 }); 536 537 $(form_blog).submit(function() { 538 if( valid(validator) == false) { 539 return false; 540 } 541 if($('input[name="agree"]').prop('checked')) { 542 $(this).find('div.error').hide(); 543 544 save_newsletter($(this)); 545 546 return false; 547 } else { 548 $(this).find('div.error').show(); 549 return false; 550 } 551 }); 552 553 $(form).submit(function() { 554 if( valid(validator2) == false) { 555 return false; 556 } 557 558 save_newsletter($(this)); 559 return false; 560 }); 561}); 562 563//#################### OPERATORS PRICES AND COMMANDS 564var operatorsObj = [ 565 [ 566 { 567 price: '4,92 zÅ', 568 command: 'BD', 569 number: '60404' 570 }, 571 { 572 price: '9,84 zÅ', 573 command: 'BD', 574 number: '60804' 575 }, 576 { 577 price: '14,76 zÅ', 578 command: 'BD', 579 number: '61204' 580 }, 581 { 582 price: '19,68 zÅ', 583 command: 'BD', 584 number: '61604' 585 } 586 ], 587 [ 588 { 589 price: '9,84 zÅ', 590 command: 'BDP', 591 number: '60804' 592 }, 593 { 594 price: '15,99 zÅ', 595 command: 'BDP', 596 number: '61304' 597 }, 598 { 599 price: ' 22,14 zÅ', 600 command: 'BDP', 601 number: '61804' 602 }, 603 { 604 price: '28,29 zÅ', 605 command: 'BDP', 606 number: '62304' 607 } 608 ], 609 [ 610 { 611 price: '4,92 zÅ', 612 command: 'BD', 613 number: '60404' 614 }, 615 { 616 price: '9,84 zÅ', 617 command: 'BD', 618 number: '60804' 619 }, 620 { 621 price: ' 14,76 zÅ', 622 command: 'BD', 623 number: '61204' 624 }, 625 { 626 price: '19,68 zÅ', 627 command: 'BD', 628 number: '61604' 629 } 630 ], 631 [ 632 { 633 price: '4,92 zÅ', 634 command: 'BD', 635 number: '60404' 636 }, 637 { 638 price: '9,84 zÅ', 639 command: 'BD', 640 number: '60804' 641 }, 642 { 643 price: ' 14,76 zÅ', 644 command: 'BD', 645 number: '61204' 646 }, 647 { 648 price: '19,68 zÅ', 649 command: 'BD', 650 number: '61604' 651 } 652 ] 653 ], 654 tMobObj = [ 655 [ 656 { 657 price: '4,92 zÅ', 658 command: 'BD', 659 number: '60404' 660 }, 661 { 662 price: '11,07 zÅ', 663 command: 'BD', 664 number: '60904' 665 }, 666 { 667 price: '17,22 zÅ', 668 command: 'BD', 669 number: '61404' 670 }, 671 { 672 price: '23,37 zÅ', 673 command: 'BD', 674 number: '61904' 675 } 676 ], 677 [ 678 { 679 price: '9,84 zÅ', 680 command: 'BDP', 681 number: '60804' 682 }, 683 { 684 price: '15,99 zÅ', 685 command: 'BDP', 686 number: '61304' 687 }, 688 { 689 price: '22,14 zÅ', 690 command: 'BDP', 691 number: '61804' 692 }, 693 { 694 price: '28,29 zl', 695 command: 'BDP', 696 number: '62304' 697 } 698 ] 699 ]; 700//######################## CHAT 701/*$('#startChat').click(function(e) { 702 e.preventDefault(); 703 open_czat(); 704});*/ 705 706//######################## SEARCH 707$('input[name="search"]').keyup(function(event) { 708 search_ajax(event, $(this)); 709}); 710 711//######################## FUNCTIONS 712 713//pause video 714function pauseVideo() { 715 player.pauseVideo(); 716} 717//saving NL 718function save_newsletter(submit){ 719 720var form = submit, 721 inp = form.find('input[type="email"]'); 722 723 submit.value = ''; 724 var plus = 0; 725 726 var data = {
727 action : 'newsletter', 728 email : inp.attr('value'), 729 page : document.location.href 730 }; 731 732 $.ajax({ 733 type: 'POST', 734 url: window.wp_data.ajax_url, 735 data: { 736 action: 'newsletter', 737 email: inp.attr('value'), 738 page: document.location.href 739 }, 740 dataType:'json' 741 }).done(function(json) { 742 if(json.err) { 743 $('.pop_up_freashmail_container p.error').text(json.err).css('display', 'block'); 744 $('.pop_up_freashmail_container').show(); 745 setTimeout(function() { 746 $('.pop_up_freashmail_container').hide(); 747 $('.pop_up_freashmail_container p.error').css('display', 'none'); 748 }, 2000); 749 } else if(json.response && json.response.status=='OK') { 750 $('.pop_up_freashmail_container p.good').css('display', 'block'); 751 $('.pop_up_freashmail_container').show(); 752 setTimeout(function() { 753 $('.pop_up_freashmail_container').hide(); 754 $('.pop_up_freashmail_container p.good').css('display', 'none'); 755 }, 2000); 756 } 757 return false; 758 }).error(function() { 759 console.log('not-connect'); 760 }); 761 } 762 763//get data packege 764function getPakiegesFromTMob(detectOperator, val, p_container) { 765 766 console.log(detectOperator); 767 768 if(detectOperator === 'standard') { 769 currentPackage = 0; 770 $(p_container).find('.iframe_wrap2').show(); 771 $(p_container).find('.iframe_wrap1').hide(); 772 //$(p_container).find('.iframe_wrap1').display('none'); 773 } else if (detectOperator === 'premium') { 774 currentPackage = 1; 775 $(p_container).find('.iframe_wrap1').show(); 776 $(p_container).find('.iframe_wrap2').hide(); 777 //$(p_container).find('.iframe_wrap2').display('true'); 778 } 779 780 $(p_container).find('.price').text(tMobObj[currentPackage][val]['price']); 781 $(p_container).find('.commend').text(tMobObj[currentPackage][val]['command']); 782 $(p_container).find('.number').text(tMobObj[currentPackage][val]['number']); 783 784 785 786 787} 788 789function getDataFromPackage (detectOperator, detectCount, p_container) { 790 var detectCount = detectCount, 791 detectOperator = detectOperator, 792 p_container = p_container; 793 794 if(detectOperator === 'orange') { 795 var numberArrayItem = 0; 796 } else if (detectOperator === 't_mobile') { 797 var numberArrayItem = 1; 798 } else if (detectOperator === 'plus') { 799 var numberArrayItem = 2; 800 } else if (detectOperator === 'play') { 801 var numberArrayItem = 3; 802 } 803 804 for (key in operatorsObj[numberArrayItem][detectCount]) { 805 if(key === 'price') { 806 $(p_container).find('.price').text(operatorsObj[numberArrayItem][detectCount][key]); 807 } else if(key === 'command') { 808 $(p_container).find('.commend').text(operatorsObj[numberArrayItem][detectCount][key]); 809 } else if(key === 'number') { 810 $(p_container).find('.number').text(operatorsObj[numberArrayItem][detectCount][key]); 811 } 812 } 813} 814 815 816//check valid form 817function valid(validator) { 818 if((validator.numberOfInvalids()!= 0)) { 819 $('.massage_block').show(); 820 return false; 821 } else { 822 $('.massage_block').hide(); 823 return true; 824 } 825} 826 827//search 828function search_ajax(e,inp) { 829 var txt = $(inp).val().replace(/\s+/g, '').toLowerCase(); 830 831 if(txt.length > 0) { 832 $.ajax({ 833 type: 'POST', 834 dataType: "json", 835 url: window.wp_data.ajax_url, 836 data: { 837 action: 'get_posts', 838 str: txt 839 }, 840 success: function (JSONObject) { 841 $(inp).siblings("#search_res").find('ul').empty(); 842 if(JSONObject.length > 0) { 843 for(var i = 0; i < JSONObject.length; i++) { 844 var li = $('<li><a href="http://' +window.App.Link.hostName+ '/' +JSONObject[i]['parent_url']+ '/' +J
844SONObject[i]['current_url']+ '">' +JSONObject[i]['title']+ '</a></li>'); 845 $(inp).siblings("#search_res").find('ul').append(li); 846 } 847 } else { 848 var li = $('<li class="no_res">Wyszukiwanie nie daÅo rezultatu</li>'); 849 $(inp).siblings("#search_res").find('ul').append(li); 850 } 851 $(inp).siblings("#search_res").find('ul').addClass('active'); 852 } 853 }); 854 } else { 855 $(inp).siblings("#search_res").find('ul').removeClass('active'); 856 $(inp).siblings("#search_res").find('ul').empty(); 857 } 858 859 $(document).click(function(event){ 860 if ( ($(event.target).closest('.border_main').length) || ($(event.target).closest('#search_res').length) ) { 861 return; 862 } else { 863 $(inp).siblings("#search_res").find('ul').removeClass('active'); 864 } 865 }); 866} 867 868//set cookie 869function setCookie(name, value, options) { 870 options = options || {}; 871 872 var expires = options.expires; 873 874 if (typeof expires == "number" && expires) { 875 var d = new Date(); 876 d.setTime(d.getTime() + expires * 1000); 877 expires = options.expires = d; 878 } 879 if (expires && expires.toUTCString) { 880 options.expires = expires.toUTCString(); 881 } 882 883 value = encodeURIComponent(value); 884 885 var updatedCookie = name + "=" + value; 886 887 for (var propName in options) { 888 updatedCookie += "; " + propName; 889 var propValue = options[propName]; 890 if (propValue !== true) { 891 updatedCookie += "=" + propValue; 892 } 893 } 894 895 document.cookie = updatedCookie; 896} 897 898//get cookie 899function getCookie(name) { 900 var matches = document.cookie.match(new RegExp( 901 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 902 )); 903 return matches ? decodeURIComponent(matches[1]) : undefined; 904} 905 906//delete cookie 907function deleteCookie(name) { 908 setCookie(name, "", { 909 expires: -1 910 }) 911}
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.