1 2 3var ajaxurl = ajax.ajaxurl; 4var front_page = ajax.front_page; 5if(front_page ==false){ 6 function setCookie(cname, cvalue, exdays) { 7 const d = new Date(); 8 d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); 9 let expires = "expires="+d.toUTCString(); 10 document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; 11 } 12 13 function getCookie(cname) { 14 let name = cname + "="; 15 let ca = document.cookie.split(';'); 16 for(let i = 0; i < ca.length; i++) { 17 let c = ca[i]; 18 while (c.charAt(0) == ' ') { 19 c = c.substring(1); 20 } 21 if (c.indexOf(name) == 0) { 22 return c.substring(name.length, c.length); 23 } 24 } 25 return ""; 26 } 27 function checkCookie() { 28 let user = getCookie("frequent_visitors_count"); 29 if (user != "" && user > 0) { 30 jQuery('body').hide(); 31 jQuery('.loader').show(); 32 window.location.href = "/sports-news/"; 33 } else { 34 console.log('NONE'); 35 if (user == ""){ 36 user = 0; 37 } 38 39 user = parseInt(user) + 1; 40 console.log(user); 41 if (user != "" && user != null) { 42 setCookie("frequent_visitors_count", user, 365); 43 } 44 } 45 } 46 checkCookie(); 47 console.log(getCookie('frequent_visitors_count')); 48} 49/* 50* 51*/ 52jQuery(document).ready(function($){ 53 54 if(jQuery('#login-form').find('.woocommerce-notices-wrapper ul').hasClass('woocommerce-error')){ 55 jQuery('#loginModal').modal('show'); 56 //console.log('error'); 57 } 58 59 60 jQuery('#remove_user_logo').click(function(){ 61 if (confirm("Are you sure to delete profile image?")) 62 { 63 var userid = jQuery(this).attr('data-user-id'); 64 // alert(userid); 65 $('.loader').show(); 66 $.ajax({ 67 url: ajax.ajaxurl, 68 type: 'post', 69 data: { 70 action:'delete_user_photo', 71 userid:userid 72 73 }, 74 success: function (response) { 75 $response = JSON.parse(response); 76 $('.loader').hide(); 77 if($response.status == 'success'){ 78 location.reload(); 79 } 80 else 81 { 82 83 } 84 85 86 } 87 }); 88 89 } 90 return false; 91 92 }); 93}); 94 95 96 97jQuery(document).ready(function($){ 98 $('#testimonial').owlCarousel({ 99 margin: 0, 100 loop: true, 101 smartSpeed: 2000, 102 dotsSpeed: 1000, 103 dragEndSpeed: 1000, 104 autoplay:true, 105 pagination:true, 106 dots: false, 107 singleItem: true, 108 responsive: { 109 0: { 110 items: 1 111 }, 112 600: { 113 items: 1 114 }, 115 1000: { 116 items: 1 117 } 118 } 119 }); 120 /* 121 * 122 */ 123 $('.profile-menu').on('click',function(e){ 124 e.preventDefault(); 125 $('.profile-sub').toggle(); 126 }); 127 $('.click-to-login').on('click',function(){ 128 $('.login-btn').trigger('click'); 129 }); 130}); 131jQuery(document).ready(function($){ 132 var owl = $('#owl-carousel-home'); 133 owl.owlCarousel({ 134 margin: 0, 135 loop: true, 136 autoplay:true, 137 pagination:true, 138 dots: true, 139 singleItem: true, 140 responsive: { 141 0: { 142 items: 1 143 }, 144 600: { 145 items: 1 146 }, 147 1000: { 148 items: 1 149 } 150 } 151 }); 152 153 154 155 window.onscroll = function() { 156 if($('.main-wrap').find('#searchBar').length > 0){ 157 myFunctionsticky(); 158 } 159 myFunction(); 160 }; 161 var header = document.getElementById("mainHeader"); 162 var sticky = header.offsetTop; 163 164 function myFunction() { 165 if (window.pageYOffset > sticky) { 166 header.classList.add("sticky"); 167 } else { 168 header.classList.remove("sticky"); 169 } 170 } 171 if($('.main-wrap').find('#searchBar').length > 0){ 172 173 var searchbar = document.getElementById("searchBar"); 174 var stickybar = searchbar.offsetTop; 175 176 function myFunctionsticky() { 177 if (window.pageYOffset > stickybar) { 178 //searchbar.classList.add("stickysearch"); 179 } else { 180 //searchbar.classList.remove("stickysearch"); 181 } 182 } 183 } 184 185 186}); 187 188 189jQuery(document).ready(function($){ 190 /* 191 *@Login 192 */ 193// $('#login-form').validate({ 194// rules: { 195// username:{ 196// required: true, 197// }, 198// password:{ 199// required: true, 200// } 201// }, 202// messages:{ 203// username:"Enter Username.", 204// password:"Enter Password." 205// }, 206// beforeSend: function() { 207// $('.loading').show(); 208// }, 209// submitHandler: function (form) { // for demo 210 211// $form_data = $(form).serializeArray(); 212 213// $('.loader').show(); 214// $.ajax({ 215// url: ajax.ajaxurl, 216// type: 'post', 217// data: { 218// action:'user_login', 219// form_data:$form_data 220 221// }, 222 223// success: function (response) { 224// $response = JSON.parse(response); 225// $('.loader').hide(); 226// if($response.status == 'success'){ 227 228// $('#loginModal').hide(); 229// // swal({ 230// // icon:$response.status, 231// // title:$response.message, 232// // }); 233// // location.reload(); 234// window.location.href = $response.redirect; 235// }else{ 236 237 238// if($response.status == 'success'){ 239// $icon = '<i class="fa fa-check-circle" aria-hidden="true"></i>'; 240// }else{ 241// $icon = '<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>'; 242// } 243// $(form).find('.sub-heading').html('<span class="'+$response.status+'">'+$icon+$response.message+'</span>'); 244// $(form).find('.sub-heading').show(); 245// } 246 247 248// } 249// }); 250// // }); 251 252// return false; // for demo 253// } 254// }); 255 256 257 258 259 /* 260 *@registration 261 */ 262 263 264$.validator.addMethod("uniqueUserName", function(value, element) { 265 266 var isSuccess = false;
267 $.ajax({ 268 url: ajax.ajaxurl, 269 type: 'post', 270 async: false, 271 data: { 272 action:'check_username', 273 username:value 274 275 }, 276 success: function (msg) { 277 if(msg == 1) 278 { 279 isSuccess = false; 280 } 281 else 282 { 283 isSuccess = true; 284 } 285 286 287 } 288 }); 289 290 return isSuccess; 291 292 }); 293 $('#registration-form').validate({ 294 rules: { 295 firstname:{ 296 required: true, 297 }, 298 lastname:{ 299 required: true, 300 }, 301 email:{ 302 required: true, 303 email: true, 304 uniqueUserName: true 305 }, 306 password:{ 307 required: true, 308 minlength: 8 309 }, 310 conf_pass:{ 311 required: true, 312 minlength: 8, 313 equalTo: ".password" 314 } 315 }, 316 messages:{ 317 firstname:"Enter First Name.", 318 lastname:"Enter Last Name.", 319 email: 320 { 321 required: "Enter Email Id.", 322 email: "Enter a Valid Email Id.", 323 uniqueUserName: "There is already an account with this email.", 324 }, 325 password:"Password must be 8 charecters long.", 326 conf_pass:"Passwords do not match.", 327 }, 328 beforeSend: function() { 329 $('.loading').show(); 330 }, 331 submitHandler: function (form) { // for demo 332 333 $form_data = $(form).serializeArray(); 334 335 $('.loader').show(); 336 $.ajax({ 337 url: ajax.ajaxurl, 338 type: 'post', 339 data: { 340 action:'register_user', 341 form_data:$form_data 342 343 }, 344 345 success: function (response) { 346 $response = JSON.parse(response); 347 348 if($response.status == 'success'){ 349 $('.loader').hide(); 350 $('#loginModal').hide(); 351 swal({ 352 icon:$response.status, 353 title:$response.message, 354 buttons:{ 355 confirm:{ 356 text:'Ok', 357 value:true 358 } 359 } 360 }).then((value) => { 361 if(value){ 362 window.location.href = $response.redirect; 363 //location.reload(); 364 } 365 }); 366 }else{ 367 $('.loader').hide(); 368 } 369 370 371 } 372 }); 373 // }); 374 375 return false; // for demo 376 } 377 }); 378 /* 379 *@Lost password 380 */ 381 $('#lostpass-form').validate({ 382 rules: { 383 email:{ 384 required: true, 385 email: true 386 }, 387 }, 388 messages:{ 389 email:"Enter a Valid Email Id.", 390 }, 391 beforeSend: function() { 392 $('.loading').show(); 393 }, 394 submitHandler: function (form) { // for demo 395 396 $form_data = $(form).serializeArray(); 397 398 $('.loader').show(); 399 $.ajax({ 400 url: ajax.ajaxurl, 401 type: 'post', 402 data: { 403 action:'lost_password', 404 form_data:$form_data 405 406 }, 407 success: function (response) { 408 $response = JSON.parse(response); 409 $('.loader').hide(); 410 if($response.status == 'success'){ 411 $icon = '<i class="fa fa-check-circle" aria-hidden="true"></i>'; 412 }else{ 413 $icon = '<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>'; 414 } 415 $(form).find('.sub-heading').html('<span class="'+$response.status+'">'+$icon+$response.message+'</span>'); 416 $(form).find('.sub-heading').show(); 417 $(form)[0].reset(); 418 } 419 }); 420 return false; // for demo 421 } 422 }); 423}); 424/* 425*@header Menu 426*/ 427jQuery(document).ready(function($){ 428 $('#menu-main-menu').find('.menu-item-has-children').each(function(){ 429 $(this).addClass('dropdown-submenu'); 430 }); 431 432 $('.menu-item-has-children').on('click',function(){ 433 $obj = $(this); 434 $objid = $obj.attr('id'); 435 // if($obj.closest('#mySidenav')){ 436 // console.log($obj.attr('class')); 437 // $obj.toggleClass('open'); 438 // } 439 $('#menu-main-menu').find('.menu-item-has-children').each(function(key,val){ 440 441 if($objid === $(this).attr('id')){ 442 if($(this).hasClass('open')){ 443 $(this).removeClass('open'); 444 }else{ 445 $(this).addClass('open'); 446 } 447 448 }else{ 449 $(this).removeClass('open'); 450 } 451 }); 452 453 $('#menu-main-menu-1').find('.menu-item-has-children').each(function(key,val){ 454 //$(this).toggleClass('open'); 455 if($obj.attr('class') === $(this).attr('class')){ 456 if($(this).hasClass('open')){ 457 458 $(this).removeClass('open'); 459 }else{ 460 // console.log($(this).attr('class'),'@@@'); 461 $(this).addClass('open'); 462 } 463 464 }else{ 465 $(this).removeClass('open'); 466 } 467 }); 468 // $obj.toggleClass('open'); 469 470 }); 471 // $(document).find('.dropdown-menu').each(function(){ 472 // $(this).prev().append('<span class="caret"></span>'); 473 // }); 474}); 475jQuery(document).ready(function($){ 476 /* 477 * 478 */ 479 var owl1 = $('#owl-demo1'); 480 owl1.owlCarousel({ 481 margin: 0, 482 loop: true, 483 autoplay:true, 484 pagination:true, 485 dots: true, 486 singleItem: true, 487 nav: true, 488 navText: ["",""], 489 responsive: { 490 0: { 491 items: 1 492 }, 493 600: { 494 items: 1 495 }, 496 1000: { 497 items: 1 498 } 499 } 500 }) 501 502 503 var owl2 = $("#owl-demo2"); 504 owl2.owlCarousel({ 505 margin: 30, 506 nav: true, 507 //loop: true, 508 autoplay:true, 509 //center: true, 510 navText: ["",""], 511 responsive: { 512 0: { 513 items: 1 514 }, 515 600: { 516 items: 2 517 }, 518 1000: { 519 items: 3 520 } 521 } 522 523 }); 524 525 $(".next").click(function(){owl1.trigger('owl.next');}); 526 $(".prev").click(function(){owl1.trigger('owl.prev');}); 527 $(".next").click(function(){owl2.trigger('owl.next');}); 528 $(".prev").click(function(){owl2.trigger('owl.prev');}); 529 530 531}); 532/* 533* 534*/ 535jQuery(document).ready(function($){ 536 $('.signup-link').on('click','a',function(e){ 537 e.preventDefault(); 538 $form_open = $(this).data('form'); 539 $(this).closest('form').hide() 540 $($form_open).show(); 541 542 }); 543 $('.sub-heading a').on('click',function(e){ 544 e.preventDefault(); 545 $('#lostpass-form').show(); 546 $('#login-form').hide(); 547 }); 548 $('.lostpassword').on('click',function(e){ 549 e.preventDefault(); 550 $('#lostpass-form').show(); 551 $('#login-form').hide(); 552 }); 553 $('.show-pass').on('click',function(){ 554 if($(this).next().attr('type') == 'password'){ 555 $(this).next().attr('type','text'); 556 $(this).find('i').removeClass('fa-eye'); 557 $(this).find('i').addClass('fa-eye-slash'); 558 }else{ 559 $(this).next().attr('type','password'); 560 $(this).find('i').removeClass('fa-eye-slash'); 561 $(this).find('i').addClass('fa-eye'); 562 } 563 564 }); 565}); 566/* 567*@reset Password 568*/ 569jQuery(document).ready(function($){ 570 $("#resetpass").modal(); 571 $('.change-pass').validate({ 572 rules: { 573 newpassword:{ 574 required: true, 575 minlength:8 576 }, 577 resetpassword: { 578 required: true, 579 equalTo: "#newpassword", 580 minlength:8 581 } 582 }, 583 submitHandler: function (form){ 584 $newpass = $('.change-pass').find('.resetpassword').val(); 585 $user_id = $('.change-pass').find('.resetsubmit').data('id'); 586 $('.loader').show(); 587 $.post( 588 ajax.ajaxurl, 589 { 590 'action' : 'change_password_action', 591 'newpass': $newpass, 592 'user_id': $user_id 593 }, 594 function(response) { 595 596 $response = jQuery.parseJSON(response); 597 if($response.status === "success"){ 598 $("#resetpass").hide(); 599 $('.loader').hide(); 600 swal({ 601 title: $response.message, 602 text: $response.sub_message, 603 icon: $response.status, 604 buttons: true, 605 dangerMode: true,
606 showConfirmButton: false, 607 buttons: { 608 confirm: { 609 text: "Confirm", 610 value: true, 611 } 612 }, 613 }) 614 .then((willDelete) => { 615 window.location.href = $response.redirect; 616 617 }); 618 }else{ 619 swal({ 620 title: $response.message, 621 text: $response.sub_message, 622 icon: $response.status, 623 buttons: true, 624 dangerMode: true, 625 showConfirmButton: false, 626 buttons: { 627 confirm: { 628 text: "Confirm", 629 value: true, 630 } 631 }, 632 }) 633 .then((willDelete) => { 634 635 }); 636 } 637 638 639 } 640 ); 641 return false; 642 } 643}); 644}); 645/* 646*@News search 647*/ 648function updateQueryStringParam(key, value) { 649 var baseUrl = [location.protocol, '//', location.host, location.pathname].join(''), 650 urlQueryString = document.location.search, 651 newParam = key + '=' + value, 652 params = '?' + newParam; 653 654 if (urlQueryString) { 655 keyRegex = new RegExp('([\?&])' + key + '[^&]*'); 656 657 if (urlQueryString.match(keyRegex) !== null) { 658 params = urlQueryString.replace(keyRegex, "$1" + newParam); 659 } else { 660 params = urlQueryString + '&' + newParam; 661 } 662 } 663 window.history.replaceState({}, "", baseUrl + params); 664}; 665jQuery(document).ready(function($){ 666 $('.bestPlanButton').on('click',function(e){ 667 e.preventDefault(); 668 $('#prod-options').toggle(); 669 }); 670}); 671/* 672* 673*/ 674/*jQuery(document).ready(function($){ 675 if($('body').hasClass('error404')){ 676 function randomNum() 677 { 678 "use strict"; 679 return Math.floor(Math.random() * 9)+1; 680 } 681 var loop1,loop2,loop3,time=30, i=0, number, selector3 = document.querySelector('.thirdDigit'), selector2 = document.querySelector('.secondDigit'), 682 selector1 = document.querySelector('.firstDigit'); 683 loop3 = setInterval(function() 684 { 685 "use strict"; 686 if(i > 40) 687 { 688 clearInterval(loop3); 689 selector3.textContent = 4; 690 }else 691 { 692 selector3.textContent = randomNum(); 693 i++; 694 } 695 }, time); 696 loop2 = setInterval(function() 697 { 698 "use strict"; 699 if(i > 80) 700 { 701 clearInterval(loop2); 702 selector2.textContent = 0; 703 }else 704 { 705 selector2.textContent = randomNum(); 706 i++; 707 } 708 }, time); 709 loop1 = setInterval(function() 710 { 711 "use strict"; 712 if(i > 100) 713 { 714 clearInterval(loop1); 715 selector1.textContent = 4; 716 }else 717 { 718 selector1.textContent = randomNum(); 719 i++; 720 } 721 }, time); 722 } 723 724});*/ 725function getUrlVars() { 726 var vars = [], hash; 727 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 728 for(var i = 0; i < hashes.length; i++) 729 { 730 hash = hashes[i].split('='); 731 vars.push(hash[0]); 732 vars[hash[0]] = hash[1]; 733 } 734 return vars; 735} 736/*********************************************/ 737jQuery(document).ready(function($){ 738 739 var paged = ''; 740 if($('.archive').hasClass('category')){ 741 $('.inner-contentwrap').on('click','.wp-pagenavi a',function(e){ 742 e.preventDefault(); 743 var url = $(this).attr('href'); 744 var array = []; 745 746 if(url.indexOf('wp-admin') != -1){ 747 console.log(url.indexOf('=')); 748 if(url.indexOf('=') != -1){ 749 array = url.split('='); 750 paged = array[array.length-1]; 751 }else{ 752 paged = 1; 753 } 754 755 }else{ 756 array = url.split('/'); 757 paged = array[array.length-2]; 758 console.log(paged); 759 } 760 761 updateQueryStringParam('page',paged); 762 $('#news-filter').find('.paged').val(paged); 763 $('#news-filter').submit(); 764 }); 765 } 766 /***/ 767 $('.splitter').find('a').on('click',function(e){ 768 e.preventDefault(); 769 770 $news_meta = $(this).data('value'); 771 $('.splitter').find('a').each(function(){ 772 $(this).parent().removeClass('selected-0'); 773 }); 774 $(this).parent().addClass('selected-0'); 775 776 var uri = window.location.toString(); 777 if (uri.indexOf("?") > 0) { 778 var clean_uri = uri.substring(0, uri.indexOf("?")); 779 window.history.replaceState({}, document.title, clean_uri); 780 $('#news-filter').find('.paged').val(""); 781 } 782 783 updateQueryStringParam('meta',$news_meta); 784 $('#news-filter').find('.meta').val($news_meta); 785 $('#news-filter').submit(); 786 }); 787 /***/ 788 $('#news-filter').on('submit',function(e){ 789 e.preventDefault(); 790 $('.loader').show(); 791 $filter_data = $(this).serializeArray(); 792 $.ajax({ 793 url: ajax.ajaxurl, 794 type: 'post', 795 data: { 796 action:'news_search', 797 filter_data:$filter_data, 798 }, 799 success: function (response) { 800 // 801 802 if(getUrlVars()['page'] > 0){ 803 $('.loader').hide(); 804 $('.image-grid').html(response); 805 806 console.log(parseInt(getUrlVars()['page'])); 807 console.log(getUrlVars()['page']); 808 }else{ 809 location.reload(); 810 811 } 812 //console.log(getUrlVars()['page']); 813 // 814 /*$('.loader').hide(); 815 $('.image-grid').html(response);*/ 816 } 817 }); 818 }); 819}); 820jQuery(document).ready(function($){ 821 $('.subscribe-redirect').on('click',function(e){ 822 e.preventDefault(); 823 $email = $(this).parent().find('.email').val(); 824 localStorage.setItem("subscribe_email", $email); 825 $(this).closest('form').submit(); 826 827 }); 828 if($("body").hasClass('page-id-106553')){ 829 var subscribe_email = localStorage.getItem("subscribe_email"); 830 $(document).find('input[name="EMAIL"]').val( subscribe_email); 831 } 832 833 /* 834 *Cart 835 */ 836 $('.cart-menu').on('click',function(){ 837 $('.mini-cart').toggle(); 838 }); 839}); 840jQuery(document).ready(function($){ 841 $('.company-logo-wrap li').on('click','a',function(){ 842 $(this).find('input').prop("checked", true); 843 }); 844 $('.wc_nav .has_child').on('click','.toggle-menu',function(e){ 845 e.preventDefault(); 846 $(this).parent().find('ul').toggle(); 847 if($(this).parent().find('ul').is(':visible')){ 848 //alert('hi'); 849 $(this).parent().find('i').removeClass("fa-angle-down"); 850 $(this).parent().find('i').addClass("fa-angle-up"); 851 }else{ 852 $(this).parent().find('i').removeClass("fa-angle-up"); 853 $(this).parent().find('i').addClass("fa-angle-down"); 854 } 855 856 }); 857 $('#place_order').click(function(){ 858 $(document).ajaxcomplete(function(){ 859 if ($('.woocommerce-error').children().length == 0){ 860 $('.woocommerce-error').hide(); 861 } 862 }) 863 864 }); 865 866}); 867/* 868*@form validation 869*/ 870jQuery(document).ready(function($){ 871 872 $("#submit-job-form").validate({ 873 rules: { 874 job_title: { 875 required: true, 876 }, 877 job_type:{ 878 required: true, 879 }, 880 job_category:{ 881 required: true, 882 } 883 884 }, 885 errorPlacement: function(error, element) { 886 console.log(error); 887 if(+error.length > 0){ 888 $('.loader').hide(); 889 } 890 891 }, 892 messages: { 893 job_title: "Enter Job title.", 894 job_type: "Select Job type.", 895 job_category:"Select Job category.", 896 application:"Enter Application email.", 897 company_name:"Enter Company name." 898 } 899 }); 900/***/ 901 902 $('.login-button').on('click',function(e){ 903 e.preventDefault(); 904 $('#loginModal').modal(); 905 }); 906 907}); 908jQuery(document).ready(function($){ 909$('#c_post_date').datepicker(); 910 911 912/****/ 913$.validator.addMethod("charectorlength", function(value, element) { 914 if(value.length <= 70){ 915 return true; 916 } 917 918}, "Title must be within 70 characters."); 919$.validator.addMethod("allcaps", function(value, element) { 920 if(value === value.toUpperCase()){ 921 //return false;
922 }else{ 923 return true; 924 } 925}, "Please do NOT use ALL CAPS."); 926 jQuery(".submit-press-release").validate({ 927 //debug: true, 928 rules:{ 929 post_date:{ 930 required:true, 931 }, 932 post_title:{ 933 required:true, 934 // charectorlength:true, 935 // allcaps:true, 936 }, 937 post_documentupload:{ 938 required: true, 939 extension: "doc|docx", 940 }, 941 featured_image:{ 942 943 extension: "jpg|jpeg|gif|png", 944 }, 945 post_organization_name:{ 946 required:true, 947 948 }, 949 post_url:{ 950 required:true, 951 }, 952 post_email:{ 953 required:true, 954 email:true, 955 }, 956 // post_phone:{ 957 // required: true 958 // }, 959 post_phone_contact:{ 960 required: true 961 }, 962 'post_cats[]':{ 963 required:true 964 }, 965 terms_conditions:{ 966 required:true, 967 } 968 }, 969 messages:{ 970 post_date:"Select distribution date.", 971 post_documentupload:"Upload release content.", 972 //post_title:"Enter title.", 973 post_organization_name:"Enter organization name.", 974 // featured_image: { 975 // required: "You must insert an image" 976 // }, 977 post_url:"Enter company website.", 978 post_displayname:"Enter media contact.", 979 post_email:"Enter valid email", 980 //post_phone:"Enter valid phone no", 981 post_phone_contact:"Enter your contact no.", 982 'post_cats[]':"Select categories.", 983 terms_conditions:"Select Terms and Conditions" 984 }, 985 errorPlacement: function(error, element) { 986 987 if(+error.length > 0){ 988 $('.loader').hide(); 989 $('#release_submit').val('Submit Press Release'); 990 $('#release_submit').removeAttr("disabled"); 991 $('#processingicon').removeClass('show'); 992 $('#processingicon').addClass('hide'); 993 $('#processingtext').removeClass('show'); 994 $('#processingtext').addClass('hide'); 995 console.log('%%%%&&&&&@@@'); 996 $(".submit-press-release").scrollTop(0); 997 } 998 if (element.attr("type") == "post_date") { 999 error.insertAfter(element); 1000 }else if(element.attr("name") == "post_title"){ 1001 error.insertAfter(element.parent().parent()); 1002 }else if(element.attr("name") == "post_cats[]"){ 1003 error.insertAfter(element.parent().parent().parent()); 1004 } else if(element.attr("name") == "post_documentupload"){ 1005 error.insertAfter(element.parent()); 1006 }else if(element.attr("name") == "featured_image"){ 1007 error.insertAfter(element.parent()); 1008 }else if(element.attr("name") == "terms_conditions"){ 1009 1010 error.insertAfter(element.parent()); 1011 }else{ 1012 error.insertAfter(element); 1013 } 1014 }, 1015 submitHandler: function(form) { 1016 $('#release_submit').prop('disabled', true); 1017 $('#release_submit').prop('disabled', true); 1018 $('#release_submit').val("Processing..."); 1019 1020 $('#processingicon').removeClass('hide'); 1021 // $('#processingicon').addClass('show'); 1022 $('#processingicon').css('display','inline-block !important'); 1023 $('#processingtext').removeClass('hide'); 1024 $('.loader').show(); 1025 form.submit(); 1026 } 1027 }); 1028 /*if(front_page == true){ 1029 $('.job-manager-jobs').DataTable(); 1030 }*/ 1031 1032 $('.apply-job').on('click',function(e){ 1033 e.preventDefault(); 1034 $href = $('.application_details').find('a').attr('href'); 1035 console.log('$$',$href); 1036 //window.location.href = $href; 1037 window.open($href, '_blank'); 1038 /*var $container = $("html,body"); 1039 var $scrollTo = $('.application_button'); 1040 1041 $container.animate({scrollTop: $scrollTo.offset().top - $container.offset().top + $container.scrollTop(), scrollLeft: 0},300); 1042 1043 $('.application_button').trigger('click');*/ 1044 }); 1045 $('.application_button').on('click',function(){ 1046 1047 $href = $('.application_details').find('a').attr('href'); 1048 console.log('$$',$href); 1049 window.location.href = $href; 1050 }); 1051}); 1052jQuery(document).ready(function($){ 1053 $('.update-profile').submit(function(){ 1054 $('.loader').show(); 1055 }); 1056 var url = window.location.pathname; 1057 var n = url.includes("my-profile"); 1058 if(n){ 1059 $('.woocommerce-MyAccount-navigation-link').each(function(){ 1060 $(this).removeClass('is-active'); 1061 }); 1062 $('.woocommerce-MyAccount-navigation-link--my-profile').addClass('is-active'); 1063 } 1064 /* 1065 * 1066 */ 1067//$('.business-category').chosen(); 1068$('.business-category').chosen({ 1069 allow_single_deselect: true 1070}); 1071$.validator.setDefaults({ ignore: ":hidden:not(select)" }); 1072$('#diectory-submit').validate({ 1073 rules: { 1074 business_category:{ 1075 required:true, 1076 }, 1077 business_name:{ 1078 required:true, 1079 }, 1080 company_url:{ 1081 required:true, 1082 }, 1083 business_directory_desc:{ 1084 required:true, 1085 }, 1086 website:{ 1087 required:true, 1088 }, 1089 email:{ 1090 required:true, 1091 }, 1092 phone:{ 1093 required:true, 1094 } 1095 }, 1096 messages:{ 1097 business_category:"Select a Category",
1098 business_name:"Enter Business Name", 1099 business_directory_desc:"Enter Description", 1100 company_url:"Enter Company Url", 1101 }, 1102 errorPlacement: function(error, element) { 1103 if (element.attr("name") == "business_category") { 1104 $('.chosen-container').after(error); 1105 }else if(element.attr("name") == "business_directory_desc"){ 1106 error.insertAfter(element.parent()); 1107 }else{ 1108 error.insertAfter(element); 1109 } 1110 }, 1111 submitHandler: function (form) { 1112 $('.loader').show(); 1113 $form_data = $(form).serializeArray(); 1114 $.ajax({ 1115 url: ajaxurl, 1116 type: 'post', 1117 data: { 1118 action:'directory_form', 1119 form_data:$form_data 1120 1121 }, 1122 1123 success: function (response) { 1124 $response = JSON.parse(response); 1125 $('.loader').hide(); 1126 if($response.status == 'success'){ 1127 swal({ 1128 icon:'success', 1129 title:$response.message, 1130 buttons:{ 1131 confirm:{ 1132 text:'Ok', 1133 value:true 1134 } 1135 } 1136 }).then((value) => { 1137 if(value){ 1138 // window.location.href = $response.redirect; 1139 location.reload(); 1140 } 1141 }); 1142 }else{ 1143 $('.loader').show(); 1144 swal({ 1145 icon:'success', 1146 title:$response.message, 1147 buttons:{ 1148 confirm:{ 1149 text:'Ok', 1150 value:true 1151 } 1152 } 1153 }).then((value) => { 1154 if(value){ 1155 1156 $('.loader').hide(); 1157 } 1158 }); 1159 } 1160 1161 1162 } 1163 }); 1164 return false; 1165 } 1166}); 1167 1168}); 1169/* 1170* 1171*/ 1172jQuery(document).ready(function($){ 1173 $(document).on('click','.custom_add_to_cart',function(){ 1174 1175 var arr = []; 1176 $.each($("input[name='syndication']:checked"), function(){ 1177 arr.push($(this).val()); 1178 }); 1179 $('.loader').show(); 1180 $.ajax({ 1181 url: ajax.ajaxurl, 1182 type: 'post', 1183 data: { 1184 action:'addtocart', 1185 products:arr 1186 1187 }, 1188 success: function (response) { 1189 1190 window.location.href= "/checkout"; 1191 //$('.loader').hide(); 1192 } 1193 }); 1194 }); 1195 1196 /* 1197 * 1198 */ 1199 $('#release_submit').on('click',function(){ 1200 // console.log(validate_from_submission); 1201 $('.loader').show(); 1202 //$('#release_submit').val("Processing..."); 1203 setTimeout(() => { 1204 $('.loader').hide(); 1205 }, 10000); 1206 }); 1207}); 1208 1209jQuery(document).ready(function($){ 1210 $('.pack-product').change(function(){ 1211 // $select_id = $(this).val(); 1212 $('.packwrap').toggle(); 1213 }); 1214 $('.corporate').change(function(){ 1215 //$select_id = $(this).val(); 1216 $('.corporateitem').toggle(); 1217 }); 1218}); 1219 1220 1221 1222jQuery(function ($) { 1223 'use strict'; 1224 1225 $('#beehiivForm').on('submit', function (e) { 1226 e.preventDefault(); 1227 1228 var $form = $(this); 1229 var $input = $form.find('input.email'); 1230 var email = $.trim($input.val()); 1231 var $button = $form.find('button[type="submit"]'); 1232 var $modal = $('#oswBeehiivModal'); 1233 var $message = $('#beehiivMessage'); 1234 1235 if (!email || email.indexOf('@') === -1) { 1236 $message.html('<p class="text-danger">Please enter a valid email address.</p>'); 1237 $modal.modal('show'); 1238 return; 1239 } 1240 1241 $button.prop('disabled', true); 1242 $message.html('<p>Subscribing...</p>'); 1243 $modal.modal('show'); 1244 1245 $.ajax({ 1246 url: ajax.ajaxurl, 1247 type: 'POST', 1248 dataType: 'json', 1249 data: { 1250 action: 'email_subscription', 1251 //nonce: oswEmailSub.nonce, 1252 email: email 1253 }, 1254 success: function (response) { 1255 if (response.success) { 1256 $message.html('<p class="text-success">' + response.data.message + '</p>'); 1257 $input.val(''); 1258 } else { 1259 $message.html('<p class="text-danger">' + response.data.message + '</p>'); 1260 } 1261 }, 1262 error: function () { 1263 $message.html('<p class="text-danger">Something went wrong. Please try again.</p>'); 1264 }, 1265 complete: function () { 1266 $button.prop('disabled', false); 1267 } 1268 }); 1269 }); 1270}); 1271
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.