1if (window.ontouchstart === null) { 2 document.addEventListener('touchstart', onTouchStart, { 3 passive: true 4 }); 5 $.event.special.touchstart = { 6 setup: function (_, ns, handle) { 7 this.addEventListener("touchstart", handle, { 8 passive: true 9 }); 10 } 11 }; 12} 13 14jQuery(function ($) { 15 'use strict'; 16 //Disable cut copy paste 17 $('body.page-template-pdf-viewer').bind('cut copy paste', function (e) { 18 e.preventDefault(); 19 }); 20 //Disable mouse right click 21 $("body.page-template-pdf-viewer").on("contextmenu", function (e) { 22 return false; 23 }); 24 25 // Post like 26 27 $('.like-button').click(function (e) { 28 e.preventDefault(); 29 var post_id = $(this).data('postid'); 30 $(this).parent().addClass('disable-like'); 31 32 $.ajax({ 33 type: "POST", 34 dataType: "json", 35 url: ajax_custom.ajaxurl, 36 data: { 37 'action': 'increment_like', 38 'post_id': post_id 39 }, 40 success: function (response) { 41 if (response.success) { 42 $('.like-button').parent().removeClass('disable-like'); 43 $('#like-count-' + post_id).text('+' + response.data); 44 } else { 45 var msg = '<span class="p-2 lime-btn" style="font-size: 14px;">' + response.data.message + '</span>'; 46 setTimeout(function () { 47 $('.post-like-dislike .post-like-dislike-error').html(msg).fadeIn(); 48 }, 500); 49 setTimeout(function () { 50 $('.post-like-dislike .post-like-dislike-error').fadeOut().empty(); 51 $('.like-button').parent().removeClass('disable-like'); 52 }, 5000); 53 } 54 }, 55 error: function (response) { 56 console.error('AJAX error', response); 57 } 58 }); 59 }); 60 61 // Post like 62 63 // Get Post like 64 65 fetchPostCounts('.like-button', 'get_like_count', 'like-count'); 66 67 // Get Post like 68 69 // Post Dislike 70 71 $('.dislike-button').click(function (e) { 72 e.preventDefault(); 73 var post_id = $(this).data('postid'); 74 $(this).parent().addClass('disable-dislike'); 75 76 $.ajax({ 77 type: "POST", 78 dataType: "json", 79 url: ajax_custom.ajaxurl, 80 data: { 81 'action': 'increment_dislike', 82 'post_id': post_id 83 }, 84 success: function (response) { 85 if (response.success) { 86 $('.dislike-button').parent().removeClass('disable-dislike'); 87 $('#dislike-count-' + post_id).text('+' + response.data); 88 } else { 89 var msg = '<span class="p-2 lime-btn" style="font-size: 14px;">' + response.data.message + '</span>'; 90 setTimeout(function () { 91 $('.post-like-dislike .post-like-dislike-error').html(msg).fadeIn(); 92 }, 500); 93 setTimeout(function () { 94 $('.post-like-dislike .post-like-dislike-error').fadeOut().empty(); 95 $('.dislike-button').parent().removeClass('disable-dislike'); 96 }, 5000); 97 } 98 }, 99 error: function (response) { 100 console.error('AJAX error', response); 101 } 102 }); 103 }); 104 105 // Post Dislike 106 107 // Get Post Dislike 108 109 fetchPostCounts('.dislike-button', 'get_dislike_count', 'dislike-count'); 110 111 // Get Post Dislike 112 //}); 113 114 function fetchPostCounts(buttonClass, actionName, countPrefix) { 115 $(buttonClass).each(function () { 116 var post_id = $(this).data('postid'); 117 118 $.ajax({ 119 type: "POST", 120 dataType: "json", 121 url: ajax_custom.ajaxurl, 122 data: { 123 'action': actionName, 124 'post_id': post_id 125 }, 126 success: function (response) { 127 if (response.success) { 128 $('.like-dislike-loader').addClass('d-none'); 129 $('.like-dislike').removeClass('d-none').addClass('d-flex'); 130 $('#' + countPrefix + '-' + post_id).text('+' + response.data); 131 } 132 } 133 }); 134 }); 135 } 136 137 document.addEventListener("keydown", function (e) { 138 // Disable F12 (Developer Tools) 139 if (e.keyCode == 123) { 140 e.preventDefault(); 141 } 142 // Disable Ctrl+Shift+I (Developer Tools) 143 if (e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) { 144 e.preventDefault(); 145 } 146 // Disable Ctrl+U (View Page Source) 147 if (e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) { 148 e.preventDefault(); 149 } 150 // Disable Ctrl+S (Save) 151 if (e.ctrlKey && e.keyCode == 'S'.charCodeAt(0)) { 152 e.preventDefault(); 153 } 154 // Disable Ctrl+P (Print) 155 if (e.ctrlKey && e.keyCode == 'P'.charCodeAt(0)) { 156 e.preventDefault(); 157 } 158 }); 159 160 function onTouchStart() { } 161 162 163 164 165 $('body').on('click', '.about-read-more-about', function () { 166 if ($(this).html() == 'Read More') 167 $(this).html('Read Less') 168 else 169 $(this).html('Read More') 170
171 $(this).parents('.welcome-box').toggleClass('active'); 172 }); 173 174 if ($('.df-ui .df-icon-more').length > 0) { 175 $('.df-ui .df-icon-more').remove(); 176 } 177 178 $('body').on('click', '.welcome-section-list .read-more-abouts', function () { 179 if ($(this).html() == 'Read More') 180 $(this).html('Read Less') 181 else 182 $(this).html('Read More') 183 184 $(this).parents('.welcome-section-list').toggleClass('active'); 185 }); 186 187 if ($(window).width() < 1430) { 188 $('body').on('click', '.service-details-banner .service-details-banner-inner .service-details-banner-details a.read-more-button', function () { 189 if ($(this).html() == 'Read More') 190 $(this).html('Read Less') 191 else 192 $(this).html('Read More') 193 194 $(this).prev('.service-details-banner-content').toggleClass('active'); 195 }); 196 $('body').on('click', '.list .list-inner .details a.read-more-button', function () { 197 if ($(this).html() == 'Read More') 198 $(this).html('Read Less') 199 else 200 $(this).html('Read More') 201 202 $(this).prev('div').toggleClass('active'); 203 }); 204 } 205 if ($('[data-fancybox="gallery"]').length > 0) { 206 $('[data-fancybox="gallery"]').fancybox({ 207 buttons: [ 208 "slideShow", 209 "thumbs", 210 "zoom", 211 "fullScreen", 212 "share", 213 "close" 214 ], 215 loop: false, 216 protect: true 217 }); 218 } 219 // $(function () { 220 // var h1 = $('.header-wapper .header-nav').outerHeight(); 221 // $('body').css('margin-top', h1); 222 // }); 223 224 225 226 /*============ Sticky header Start ============*/ 227 $(".hamburguer").click(function () { 228 $(this).toggleClass("active"); 229 if ($('.navbar-nav > .nav-item > .sub-class').hasClass('open')) { 230 $(".navbar-collapse > ul > li > i.sub-class.open").next(".navbar-collapse > ul > li > ul.sub-menu").slideToggle(); 231 $(".navbar-collapse > ul > li > i.sub-class").removeClass("open"); 232 } 233 }); 234 235 $('<div class="menu-icon"><i class="fa fa-angle-down"></i></div>').insertAfter(".navigation li.menu-item-has-children > a"); 236 237 $('.navigation li.menu-item-has-children .menu-icon').on('click', function () { 238 $('.navigation li.menu-item-has-children .sub-menu').not($(this).next()).slideUp(); 239 $(this).next('.sub-menu').slideToggle(); 240 }); 241 242 $(document).on("scroll", function () { 243 if ($(document).scrollTop() > 2) { 244 $(".navbar").addClass("position-fixed scroll"); 245 } else { 246 $(".navbar").removeClass("position-fixed scroll"); 247 } 248 }); 249 /*============ Sticky header End ============*/ 250 251 $('.search-btn').click(function () { 252 $(this).parent().find('.search-input').toggleClass('active'); 253 }); 254 255 256 257 /*============ Blog Slider Start ============*/ 258 if ($('.home-banner-new').length >= 1) { 259 $('.home-banner-new-listing').owlCarousel({ 260 loop: false, 261 items: 1, 262 nav: false, 263 dots: true, 264 autoplay: false, 265 autoplaySpeed: 1000, 266 slideTransition: 'linear', 267 smartSpeed: 1000 268 }); 269 } 270 /*============ Blog Slider End ============*/ 271 272 273 274 /*============ Blog Slider Start ============*/ 275 if ($('#blog-carousel').length >= 1) { 276 $('.blog-slider').owlCarousel({ 277 loop: false, 278 margin: 0, 279 nav: true, 280 dots: false, 281 smartSpeed: 450, 282 autoHeight: true, 283 autoplay: false, 284 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 285 responsive: { 286 0: { 287 items: 1 288 }, 289 575: { 290 items: 1 291 }, 292 768: { 293 items: 2 294 }, 295 1200: { 296 items: 3 297 298 } 299 } 300 }); 301 } 302 /*============ Blog Slider End ============*/ 303 304 /*============ Impact Slider Start ============*/ 305 306 if ($('.impact-slider-block').length > 0) { 307 $('.impact-slider').owlCarousel({ 308 center: true, 309 loop: true, 310 margin: 0, 311 nav: true, 312 dots: false, 313 touchDrag: false, 314 mouseDrag: false, 315 smartSpeed: 1500, 316 autoplay: false, 317 autoplayTimeout: 7000, 318 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 319 responsive: { 320 0: { 321 items: 1, 322 margin: 5 323 }, 324 575: { 325 items: 1, 326 margin: 10 327 }, 328 768: { 329 items: 1, 330 margin: 10 331 }, 332 1200: { 333 items: 3, 334 autoWidth: true, 335 autoHeight: true 336 } 337 } 338 }); 339 } 340 341 /*============ Impact Slider End ============*/ 342 343 /*============ CSR Certificate Slider Start ============*/ 344 345 if ($('.csr-certi-slider').length > 0) { 346 $('.csr-certi-slider').owlCarousel({ 347 loop: false, 348 items: 1, 349 margin: 8, 350 nav: false, 351 dots: false, 352 smartSpeed: 1500, 353 autoplay: false, 354 autoplayTimeout: 7000 355 }); 356 } 357 358 $('.csr-thumbnail').click(function (e) { 359 $('.modal-body').empty();
360 $($(this).parents('div').html()).appendTo('.modal-body'); 361 $('#CSRmodal').modal({ 362 show: true 363 }); 364 }); 365 /*============ CSR Certificate Slider End ============*/ 366 367 /*============ Related Slider Start ============*/ 368 if ($('.related-slider').length >= 1) { 369 $('.related-slider').owlCarousel({ 370 loop: true, 371 margin: 30, 372 nav: true, 373 dots: false, 374 smartSpeed: 450, 375 autoplay: false, 376 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 377 responsive: { 378 0: { 379 items: 1 380 }, 381 575: { 382 items: 1 383 }, 384 768: { 385 items: 2 386 }, 387 1000: { 388 items: 3 389 390 } 391 } 392 }); 393 } 394 /*============ Related Slider End ============*/ 395 396 if ($('.service-history').length >= 1) { 397 $('.service-history .listing').owlCarousel({ 398 loop: true, 399 margin: 30, 400 nav: true, 401 dots: false, 402 smartSpeed: 450, 403 autoplay: false, 404 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 405 responsive: { 406 0: { 407 items: 1, 408 rows: 1 409 }, 410 575: { 411 items: 2, 412 rows: 1 413 }, 414 768: { 415 items: 3, 416 rows: 2 417 }, 418 1000: { 419 items: 4, 420 rows: 2 421 422 } 423 } 424 }); 425 } 426 427 428 /*============ Product Variation Slider Start ============*/ 429 if ($("#main-slide").length >= 1) { 430 $(document).ready(function () { 431 var sync1 = $("#main-slide"); 432 var sync2 = $("#thumb-slide"); 433 var slidesPerPage = 3; //globaly define number of elements per page 434 var syncedSecondary = true; 435 sync1.owlCarousel({ 436 items: 1, 437 slideSpeed: 2000, 438 nav: false, 439 autoplay: false, 440 dots: false, 441 loop: true, 442 responsiveRefreshRate: 200 443 }).on('changed.owl.carousel', syncPosition); 444 sync2 445 .on('initialized.owl.carousel', function () { 446 sync2.find(".owl-item").eq(0).addClass("current"); 447 }) 448 .owlCarousel({ 449 items: slidesPerPage, 450 dots: true, 451 nav: false, 452 margin: 20, 453 smartSpeed: 200, 454 slideSpeed: 500, 455 slideBy: slidesPerPage, //alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel 456 responsiveRefreshRate: 100 457 }).on('changed.owl.carousel', syncPosition2); 458 459 function syncPosition(el) { 460 //if you set loop to false, you have to restore this next line 461 //var current = el.item.index; 462 463 //if you disable loop you have to comment this block 464 var count = el.item.count - 1; 465 var current = Math.round(el.item.index - (el.item.count / 2) - .5); 466 467 if (current < 0) { 468 current = count; 469 } 470 if (current > count) { 471 current = 0; 472 } 473 474 //end block 475 476 sync2 477 .find(".owl-item") 478 .removeClass("current") 479 .eq(current) 480 .addClass("current"); 481 var onscreen = sync2.find('.owl-item.active').length - 1; 482 var start = sync2.find('.owl-item.active').first().index(); 483 var end = sync2.find('.owl-item.active').last().index(); 484 485 if (current > end) { 486 sync2.data('owl.carousel').to(current, 100, true); 487 } 488 if (current < start) { 489 sync2.data('owl.carousel').to(current - onscreen, 100, true); 490 } 491 } 492 493 function syncPosition2(el) { 494 if (syncedSecondary) { 495 var number = el.item.index; 496 sync1.data('owl.carousel').to(number, 100, true); 497 } 498 } 499 500 sync2.on("click", ".owl-item", function (e) { 501 e.preventDefault(); 502 var number = $(this).index(); 503 sync1.data('owl.carousel').to(number, 300, true); 504 }); 505 }); 506 } 507 508 509 // var ll = new LazyLoad({ 510 // elements_selector: ".lazy", 511 // threshold: 0, 512 // }); 513 514 // $(document).on("scroll", lazyload); 515 // $(window).on("resize", lazyload); 516 517 518 /*============ Product Variation Slider End ============*/ 519 520 /*============ Custom Scrollbar Start ============*/ 521 /*if($(".product-about").length >= 1){ 522 $("#scroll-ver").mCustomScrollbar({ 523 theme:"rounded-dots", 524 scrollInertia:400, 525 scrollButtons:{ 526 enable:true 527 }, 528 }); 529 }*/ 530 /*============ Custom Scrollbar End ============*/ 531 532 /*============ FAQ Collapse Block Start ============*/ 533 $(document).ready(function () { 534 $(".collapse.show").each(function () { 535 $(this).prev(".card-header").find(".fa").addClass("fa-minus").removeClass("fa-plus"); 536 }); 537 $(".collapse").on('show.bs.collapse', function () { 538 $(this).prev(".card-header").find(".fa").removeClass("fa-plus").addClass("fa-minus"); 539 }).on('hide.bs.collapse', function () { 540 $(this).prev(".card-header").find(".fa").removeClass("fa-minus").addClass("fa-plus"); 541 }); 542 }); 543 /*============ FAQ Collapse Block End ============*/ 544 545 /*============ Lightbox Block Start ============*/ 546 /* 547 $(document).on('click', '[data-toggle="lightbox"]', function(event) { 548 event.preventDefault(); 549 $(this).ekkoLightbox(); 550 });*/ 551 /*============ Lightbox Block End ============*/ 552 553 /*============ NewsLatter Form Validation Start ============*/ 554 $(document).on('click', '.newslatter-submit-field', function (event) { 555 //var recapcha_response = grecaptcha.getResponse(); 556 event.preventDefault(); 557 $('.wp-mail-response-output').removeClass('mail-success'); 558 $('.wp-mail-response-output').removeClass('mail-error'); 559 $('.newslatter-text-field').next('.error_message').html(''); 560 $('.wp-mail-response-output').hide(); 561 var newslatter_email = $('.newslatter-text-field').val(); 562 var newslatteremailValidate = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i; 563 if (newslatter_email == "") { 564 $('.newslatter-text-field').next('.error_message').html('<span class="validate_message" aria-hidden="true">The Email is required.</span>'); 565 return false;
566 } 567 if (newslatter_email != "" && !newslatteremailValidate.test(newslatter_email)) { 568 $('.newslatter-text-field').next('.error_message').html('<span class="validate_message" aria-hidden="true">The e-mail address entered is invalid.</span>'); 569 return false; 570 } 571 572 $.ajax({ 573 type: "POST", 574 url: 'https://tactileindicators.in/wp-admin/admin-ajax.php', 575 data: { 576 action: 'newslatter_form_send_mail', 577 newslatter_email: newslatter_email 578 }, 579 dataType: 'text', 580 success: function (response) { 581 if (response == "success") { 582 $('.wp-mail-response-output').addClass('mail-success').html('Your Email has been subscribed.').show(); 583 $('.newslatter-text-field').val(""); 584 } else if (response == "already") { 585 $('.wp-mail-response-output').addClass('mail-error').html('Your Email has been already subscribed.').show(); 586 } 587 }, 588 }); 589 return true; 590 }); 591 /*============ NewsLatter Form Validation END ============*/ 592 593 /*============ Contact Form Validation Start ============*/ 594 $(document).on('click', '#wp_contact_form_submit_btn', function (event) { 595 596 var recapcha_response = grecaptcha.getResponse(); 597 event.preventDefault(); 598 var return_message = true; 599 var first_name = $('#wp_firstname').val(); 600 var lastname = $('#wp_lastname').val(); 601 var companyname = $('#wp_companyname').val(); 602 var phonecode = $('#wp_phone_code').val(); 603 var country = $('#wp_country').val(); 604 var phone = $('#wp_phone').val(); 605 var email = $('#wp_email').val(); 606 var textarea = $('#wp_textarea').val(); 607 var emailValidate = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\.)+[A-Z]{2,4}$/i; 608 var product_sku = $(this).find('.sku_number').html(); 609 var product_name = $(this).parents('.single-modal').find('.product_name').html(); 610 611 // Do whatever if it fails. 612 613 $('.wp_contact_form_submit .validate_message').remove(); 614 if (first_name == "") { 615 $('#wp_firstname').parent().find('.error_message').html('<span class="validate_message" aria-hidden="true">The First Name is required.</span>'); 616 return_message = false; 617 } 618 if (lastname == "") { 619 $('#wp_lastname').parent().find('.error_message').html('<span class="validate_message" aria-hidden="true">The Last Name is required.</span>'); 620 return_message = false; 621 } 622 if (companyname == "") { 623 $('#wp_companyname').parent().find('.error_message').html('<span class="validate_message" aria-hidden="true">The Company Name is required.</span>'); 624 return_message = false; 625 } 626 if (phone == "") { 627 $('#wp_phone').parent().find('.error_message').html('<span class="validate_message" aria-hidden="true">The Phone Number is required.</span>'); 628 return_message = false; 629 } 630 if (phone != "" && !$.isNumeric(phone)) { 631 $('#wp_phone').parent().find('.error_message').html('<span class="validate_message" aria-hidden="true">The phone number entered is invalid.</span>'); 632 return_message = false; 633 } 634 if (email == "") { 635 $('#wp_email').parent().find('.error_message').html('<span class="validate_message" aria-hidden="true">The Email is required.</span>'); 636 return_message = false; 637 } 638 if (email != "" && !emailValidate.test(email)) { 639 $('#wp_email').parent().find('.error_message').html('<span class="validate_message" aria-hidden="true">The e-mail address entered is invalid.</span>'); 640 return_message = false; 641 } 642 if (recapcha_response.length == 0) { 643 $('.g-recaptcha').append('<span class="validate_message" aria-hidden="true">Please verified recaptcha</span>'); 644 return_message = false; 645 } else { 646 $('.g-recaptcha .validate_message').remove(); 647 } 648 if (return_message == true) { 649 $(this).attr('disabled', 'disabled'); 650 $(this).addClass('btn-disabled'); 651 $.ajax({ 652 type: "POST", 653 url: 'https://tactileindicators.in/wp-admin/admin-ajax.php', 654 data: { 655 action: 'contact_form_send_mail', 656 first_name: first_name, 657 lastname: lastname, 658 companyname: companyname, 659 country: country, 660 phonecode: phonecode, 661 phone: phone, 662 email: email, 663 textarea: textarea, 664 product_sku: product_sku, 665 product_name: product_name 666 }, 667 dataType: 'text', 668 beforeSend: function () { 669 $('.mail-ajax-loader').addClass('loader-active'); 670 }, 671 success: function (response) { 672 $('.mail-ajax-loader').removeClass('loader-active'); 673 $('.wp-mail-response-output').show(); 674 if (response == "success") { 675 676 $('.product_mail_popup').remove();
677 $('.wp-mail-response-popup-message').html('Thank you for your message. <br>It has been sent.') 678 $('.wp_contact_form_submit :input[type="text"]').val(""); 679 $('.wp_contact_form_submit :input[type="email"]').val(""); 680 $('.wp_contact_form_submit textarea').val(""); 681 } else if (response == "fail") { 682 $('.wp-mail-response-popup-message').html('There was an error trying to send your message. Please try again.') 683 } 684 $('#wp_contact_form_submit_btn').removeAttr('disabled'); 685 $('#wp_contact_form_submit_btn').removeClass('btn-disabled'); 686 $('.wp-mail-response-output').fadeIn(300); 687 $('.wp-mail-response-output').addClass('open'); 688 $('body').addClass('popup-open'); 689 }, 690 }); 691 } 692 693 return return_message; 694 695 696 }); 697 698 $('.wp-mail-response-popup-close').on('click', function () { 699 $('.wp-mail-response-output').fadeOut(300); 700 $('.wp-mail-response-output').removeClass('open'); 701 $('body').removeClass('popup-open'); 702 }); 703 704 705 /*============ Contact Form Validation END ============*/ 706 707 /*============ Single product make an enquiry mail ============*/ 708 $("body").on('click', '#make-an-enquiry-form', function (event) { 709 event.preventDefault(); 710 var product_id = $(this).attr('data-product-id'); 711 var sku = $(this).parents('.product_variation_section').find('#product_variation_sku_number').val(); 712 var product_title = $(this).parents('.product_variation_section').find('#product_variation_title').val(); 713 //$('#ModalScrollable').css('display','block').addClass('show'); 714 /*$.ajax({ 715 type: "POST", 716 url: 'https://tactileindicators.in/wp-admin/admin-ajax.php', 717 data: {action:'single_product_mail_popup_box', product_id:product_id,sku:sku,product_title:product_title}, 718 dataType: 'text', 719 720 success: function(response){ 721 $('body.single-products').prepend(response); 722 $('.product_mail_popup').html(response); 723 $('#ModalScrollable').css('display','block').addClass('show'); 724 }, 725 });*/ 726 }); 727 728 $("body").on('click', '.wp_product_cat_pagination .page-numbers', function (event) { 729 event.preventDefault(); 730 var term_id = $(this).attr('data-term-id'); 731 var paged = $(this).attr('data-page-number'); 732 733 $('.wp_product_cat_pagination .page-numbers').removeClass('current'); 734 $(this).addClass('current'); 735 $.ajax({ 736 type: "POST", 737 url: 'https://tactileindicators.in/wp-admin/admin-ajax.php', 738 data: { 739 action: 'product_category_pagination_post', 740 term_id: term_id, 741 paged: paged 742 }, 743 dataType: 'text', 744 745 success: function (response) { 746 $('.product-cat-response-block').html(response); 747 $('html, body').animate({ 748 scrollTop: $('.product-list-block').position().top - 200 749 }, 'slow'); 750 }, 751 }); 752 }); 753 754 /*$(document).on('click','.product_info .close', function(){ 755 $('#ModalScrollable').hide(); 756 });*/ 757 758 // disable right click button 759 $(document).ready(function () { 760 if ($('.easyzoom').length >= 1) { 761 var $easyzoom = $('.easyzoom').easyZoom(); 762 $("body").on("contextmenu", function () { 763 return false; 764 }); 765 } 766 }); 767 768 $(document).ready(function () { 769 $(document).on('click', '.blog-detail-content li a[href^="#"]', function (event) { 770 event.preventDefault(); 771 console.log('scroll work'); 772 $('html, body').animate({ 773 scrollTop: $($.attr(this, 'href')).offset().top - 140 774 }, 1000); 775 }); 776 }); 777 /*============ Single product make an enquiry mail END ============*/ 778 779 /*============ Product variation ajax call START ============*/ 780 $(document).ready(function ($) { 781 $('body').on('click', '.product-comment-block .wp_ulike_btn', function () { 782 var isthis = $(this); 783 if ($(this).hasClass('disable')) 784 return false; 785 $(this).addClass('disable'); 786 var id = $(this).attr('data-ulike-id'); 787 $.ajax({ 788 type: "POST", 789 url: 'https://tactileindicators.in/wp-admin/admin-ajax.php', 790 data: { 791 action: 'ulike_cst', 792 id: id 793 }, 794 dataType: 'text', 795 success: function (response) { 796 isthis.next().html(response + '+'); 797 isthis.removeClass('disable'); 798 } 799 }); 800 }); 801 802 803 $('body').on('change', '#product_variation', function () { 804 var row_val = $(this).val(); 805 var product_id = $(this).attr('data-product-id'); 806 $.ajax({ 807 type: "POST", 808 url: 'https://tactileindicators.in/wp-admin/admin-ajax.php', 809 data: { 810 action: 'acf_variation_product', 811 row_val: row_val, 812 product_id: product_id 813 }, 814 dataType: 'json', 815 816 success: function (response) { 817 $('.product_variation_section').html(response.product_content); 818 $('.product-specification-block ').html(response.product_description); 819 var sync1 = $("#main-slide"); 820 var sync2 = $("#thumb-slide"); 821 var slidesPerPage = 4; //globaly define number of elements per page 822 var syncedSecondary = true; 823 sync1.owlCarousel({ 824 items: 1, 825 slideSpeed: 2000,
826 nav: false, 827 autoplay: false, 828 dots: false, 829 loop: true, 830 responsiveRefreshRate: 200 831 }).on('changed.owl.carousel', syncPosition); 832 sync2 833 .on('initialized.owl.carousel', function () { 834 sync2.find(".owl-item").eq(0).addClass("current"); 835 }) 836 .owlCarousel({ 837 items: slidesPerPage, 838 dots: false, 839 nav: false, 840 margin: 20, 841 smartSpeed: 200, 842 slideSpeed: 500, 843 slideBy: slidesPerPage, //alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel 844 responsiveRefreshRate: 100 845 }).on('changed.owl.carousel', syncPosition2); 846 847 function syncPosition(el) { 848 //if you set loop to false, you have to restore this next line 849 //var current = el.item.index; 850 851 //if you disable loop you have to comment this block 852 var count = el.item.count - 1; 853 var current = Math.round(el.item.index - (el.item.count / 2) - .5); 854 855 if (current < 0) { 856 current = count; 857 } 858 if (current > count) { 859 current = 0; 860 } 861 862 //end block 863 864 sync2 865 .find(".owl-item") 866 .removeClass("current") 867 .eq(current) 868 .addClass("current"); 869 var onscreen = sync2.find('.owl-item.active').length - 1; 870 var start = sync2.find('.owl-item.active').first().index(); 871 var end = sync2.find('.owl-item.active').last().index(); 872 873 if (current > end) { 874 sync2.data('owl.carousel').to(current, 100, true); 875 } 876 if (current < start) { 877 sync2.data('owl.carousel').to(current - onscreen, 100, true); 878 } 879 } 880 881 function syncPosition2(el) { 882 if (syncedSecondary) { 883 var number = el.item.index; 884 sync1.data('owl.carousel').to(number, 100, true); 885 } 886 } 887 888 sync2.on("click", ".owl-item", function (e) { 889 e.preventDefault(); 890 var number = $(this).index(); 891 sync1.data('owl.carousel').to(number, 300, true); 892 }); 893 894 var $easyzoom = $('.easyzoom').easyZoom(); 895 $("body").on("contextmenu", function () { 896 return false; 897 }); 898 899 /*if($(".product-about").length >= 1){ 900 $("#scroll-ver").mCustomScrollbar({ 901 theme:"rounded-dots", 902 scrollInertia:400, 903 scrollButtons:{ 904 enable:true 905 }, 906 }); 907 }*/ 908 }, 909 }); 910 }); 911 }); 912 /*============ Product variation ajax call END ============*/ 913 914 915 /*============ Contrast ration START ============*/ 916 if ($('#swap_contrast').length >= 1) { 917 $(document).ready(function ($) { 918 $(window).on("load", function () { 919 contrast_ration_load_script(); 920 }); 921 $('#swap_contrast').on('click', function () { 922 var background_contrast_val = $('#background_contrast').val(); 923 var text_contrast_val = $('#foreground_contrast').val(); 924 $('#foreground_contrast').val(background_contrast_val); 925 $('#background_contrast').val(text_contrast_val); 926 927 contrast_ration_load_script(); 928 }); 929 $('#background_contrast').on("input", function () { 930 var background_contrast = $(this).val(); 931 var text_contrast = $('#foreground_contrast').val(); 932 933 var background_color = tinycolor(background_contrast); 934 var text_color = tinycolor(text_contrast); 935 var hex = background_color.toHexString(); 936 var text_hex = text_color.toHexString(); 937 var color_light_back = tinycolor(hex).isLight(); 938 var color_light_text = tinycolor(text_hex).isLight(); 939 if (color_light_back == true) { 940 $('.background-color-box .output-results').css('color', '#000'); 941 } else { 942 $('.background-color-box .output-results').css('color', '#fff'); 943 } 944 if (color_light_text == true) { 945 $('.text-color-box .output-results').css('color', '#000'); 946 } else { 947 $('.text-color-box .output-results').css('color', '#fff'); 948 } 949 var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); 950 var text_result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(text_hex); 951 var rcolor = parseInt(result[1], 16); 952 var gcolor = parseInt(result[2], 16); 953 var bcolor = parseInt(result[3], 16); 954 955 var text_rcolor = parseInt(text_result[1], 16); 956 var text_gcolor = parseInt(text_result[2], 16); 957 var text_bcolor = parseInt(text_result[3], 16); 958 959 var rgb1 = [rcolor, gcolor, bcolor]; 960 var rgb2 = [text_rcolor, text_gcolor, text_bcolor]; 961 var lum1 = luminance(rgb1[0], rgb1[1], rgb1[2]); 962 var lum2 = luminance(rgb2[0], rgb2[1], rgb2[2]); 963 var brightest = Math.max(lum1, lum2); 964 var darkest = Math.min(lum1, lum2); 965 var main_ratio = (brightest + 0.05) / 966 (darkest + 0.05); 967 968 var RsRGB = rgb1[0] / 255; 969 var GsRGB = rgb1[1] / 255; 970 var BsRGB = rgb1[2] / 255; 971 972 var R = (RsRGB <= 0.03928) ? RsRGB / 12.92 : Math.pow((RsRGB + 0.055) / 1.055, 2.4); 973 var G = (GsRGB <= 0.03928) ? GsRGB / 12.92 : Math.pow((GsRGB + 0.055) / 1.055, 2.4); 974 var B = (BsRGB <= 0.03928) ? BsRGB / 12.92 : Math.pow((BsRGB + 0.055) / 1.055, 2.4); 975 976 // For the sRGB colorspace, the relative luminance of a color is defined as: 977 var background_single_ratio = 0.2126 * R + 0.7152 * G + 0.0722 * B; 978 979 $('.color-contrast-ratio').html(main_ratio); 980 $('.background-contrast-ratio').html(background_single_ratio); 981 $('.ratio-block .background-color-box').css({ 982 'background-color': background_contrast, 983 'color': text_contrast 984 }); 985 $('.ratio-block .text-color-box').css({ 986 'background-color': text_contrast 987 }); 988 var color_mixer = colorMixer(rgb1, rgb2, 0.5); 989 $('.ratio-block output.contrast').css({ 990 'background-color': color_mixer 991 }); 992 993 }); 994 995 $('#foreground_contrast').on("input", function () { 996 var background_contrast = $('#background_contrast').val(); 997 var text_contrast = $(this).val(); 998 999 var background_color = tinycolor(background_contrast); 1000 var text_color = tinycolor(text_contrast); 1001 var hex = background_color.toHexString(); 1002 var text_hex = text_color.toHexString(); 1003 var color_light_back = tinycolor(hex).isLight(); 1004 var color_light_text = tinycolor(text_hex).isLight(); 1005 if (color_light_back == true) { 1006 $('.background-color-box .output-results').css('color', '#000'); 1007 } else { 1008 $('.background-color-box .output-results').css('color', '#fff'); 1009 } 1010 if (color_light_text == true) { 1011 $('.text-color-box .output-results').css('color', '#000'); 1012 } else { 1013 $('.text-color-box .output-results').css('color', '#fff'); 1014 } 1015 1016 1017 var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); 1018 var text_result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(text_hex); 1019 var rcolor = parseInt(result[1], 16); 1020 var gcolor = parseInt(result[2], 16); 1021 var bcolor = parseInt(result[3], 16); 1022 1023 var text_rcolor = parseInt(text_result[1], 16); 1024 var text_gcolor = parseInt(text_result[2], 16); 1025 var text_bcolor = parseInt(text_result[3], 16); 1026 1027 var rgb1 = [rcolor, gcolor, bcolor]; 1028 var rgb2 = [text_rcolor, text_gcolor, text_bcolor]; 1029 var lum1 = luminance(rgb1[0], rgb1[1], rgb1[2]); 1030 var lum2 = luminance(rgb2[0], rgb2[1], rgb2[2]); 1031 var brightest = Math.max(lum1, lum2); 1032 var darkest = Math.min(lum1, lum2); 1033 var main_ratio = (brightest + 0.05) / 1034 (darkest + 0.05); 1035
1036 var SRsRGB = rgb2[0] / 255; 1037 var SGsRGB = rgb2[1] / 255; 1038 var SBsRGB = rgb2[2] / 255; 1039 1040 var SR = (SRsRGB <= 0.03928) ? SRsRGB / 12.92 : Math.pow((SRsRGB + 0.055) / 1.055, 2.4); 1041 var SG = (SGsRGB <= 0.03928) ? SGsRGB / 12.92 : Math.pow((SGsRGB + 0.055) / 1.055, 2.4); 1042 var SB = (SBsRGB <= 0.03928) ? SBsRGB / 12.92 : Math.pow((SBsRGB + 0.055) / 1.055, 2.4); 1043 1044 // For the sRGB colorspace, the relative luminance of a color is defined as: 1045 var text_single_ratio = 0.2126 * SR + 0.7152 * SG + 0.0722 * SB; 1046 $('.color-contrast-ratio').html(main_ratio); 1047 $('.text-contrast-ratio').html(text_single_ratio); 1048 $('.ratio-block .background-color-box').css({ 1049 'background-color': background_contrast, 1050 'color': text_contrast 1051 }); 1052 $('.ratio-block .text-color-box').css({ 1053 'background-color': text_contrast 1054 }); 1055 var color_mixer = colorMixer(rgb1, rgb2, 0.5); 1056 $('.ratio-block output.contrast').css({ 1057 'background-color': color_mixer 1058 }); 1059 console.log(color_mixer); 1060 }); 1061 }); 1062 1063 function luminance(r, g, b) { 1064 var a = [r, g, b].map(function (v) { 1065 v /= 255; 1066 return v <= 0.03928 ? 1067 v / 12.92 : 1068 Math.pow((v + 0.055) / 1.055, 2.4); 1069 }); 1070 return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722; 1071 } 1072 1073 function contrast_ration_load_script() { 1074 var background_contrast = $('#background_contrast').val(); 1075 var text_contrast = $('#foreground_contrast').val(); 1076 1077 var background_color = tinycolor(background_contrast); 1078 var text_color = tinycolor(text_contrast); 1079 var hex = background_color.toHexString(); 1080 var text_hex = text_color.toHexString(); 1081 var color_light_back = tinycolor(hex).isLight(); 1082 var color_light_text = tinycolor(text_hex).isLight(); 1083 if (color_light_back == true) { 1084 $('.background-color-box .output-results').css('color', '#000'); 1085 } else { 1086 $('.background-color-box .output-results').css('color', '#fff'); 1087 } 1088 if (color_light_text == true) { 1089 $('.text-color-box .output-results').css('color', '#000'); 1090 } else { 1091 $('.text-color-box .output-results').css('color', '#fff'); 1092 } 1093 var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); 1094 var text_result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(text_hex); 1095 var rcolor = parseInt(result[1], 16); 1096 var gcolor = parseInt(result[2], 16); 1097 var bcolor = parseInt(result[3], 16); 1098 1099 var text_rcolor = parseInt(text_result[1], 16); 1100 var text_gcolor = parseInt(text_result[2], 16); 1101 var text_bcolor = parseInt(text_result[3], 16); 1102 1103 var rgb1 = [rcolor, gcolor, bcolor]; 1104 var rgb2 = [text_rcolor, text_gcolor, text_bcolor]; 1105 var lum1 = luminance(rgb1[0], rgb1[1], rgb1[2]); 1106 var lum2 = luminance(rgb2[0], rgb2[1], rgb2[2]); 1107 var brightest = Math.max(lum1, lum2); 1108 var darkest = Math.min(lum1, lum2); 1109 var main_ratio = (brightest + 0.05) / 1110 (darkest + 0.05); 1111 1112 var RsRGB = rgb1[0] / 255; 1113 var GsRGB = rgb1[1] / 255; 1114 var BsRGB = rgb1[2] / 255; 1115 1116 var R = (RsRGB <= 0.03928) ? RsRGB / 12.92 : Math.pow((RsRGB + 0.055) / 1.055, 2.4); 1117 var G = (GsRGB <= 0.03928) ? GsRGB / 12.92 : Math.pow((GsRGB + 0.055) / 1.055, 2.4); 1118 var B = (BsRGB <= 0.03928) ? BsRGB / 12.92 : Math.pow((BsRGB + 0.055) / 1.055, 2.4); 1119 1120 var SRsRGB = rgb2[0] / 255;
1121 var SGsRGB = rgb2[1] / 255; 1122 var SBsRGB = rgb2[2] / 255; 1123 1124 var SR = (SRsRGB <= 0.03928) ? SRsRGB / 12.92 : Math.pow((SRsRGB + 0.055) / 1.055, 2.4); 1125 var SG = (SGsRGB <= 0.03928) ? SGsRGB / 12.92 : Math.pow((SGsRGB + 0.055) / 1.055, 2.4); 1126 var SB = (SBsRGB <= 0.03928) ? SBsRGB / 12.92 : Math.pow((SBsRGB + 0.055) / 1.055, 2.4); 1127 1128 // For the sRGB colorspace, the relative luminance of a color is defined as: 1129 var text_single_ratio = 0.2126 * SR + 0.7152 * SG + 0.0722 * SB; 1130 1131 var background_single_ratio = 0.2126 * R + 0.7152 * G + 0.0722 * B; 1132 var color_mixer = colorMixer(rgb1, rgb2, 0.5); 1133 $('.color-contrast-ratio').html(main_ratio); 1134 $('.text-contrast-ratio').html(text_single_ratio); 1135 $('.background-contrast-ratio').html(background_single_ratio); 1136 $('.ratio-block .background-color-box').css({ 1137 'background-color': background_contrast, 1138 'color': text_contrast 1139 }); 1140 $('.ratio-block .text-color-box').css({ 1141 'background-color': text_contrast 1142 }); 1143 $('.ratio-block output.contrast').css({ 1144 'background-color': color_mixer 1145 }); 1146 1147 } 1148 1149 function colorChannelMixer(colorChannelA, colorChannelB, amountToMix) { 1150 var channelA = colorChannelA * amountToMix; 1151 var channelB = colorChannelB * (1 - amountToMix); 1152 return parseInt(channelA + channelB); 1153 } 1154 1155 function colorMixer(rgbA, rgbB, amountToMix) { 1156 var r = colorChannelMixer(rgbA[0], rgbB[0], amountToMix); 1157 var g = colorChannelMixer(rgbA[1], rgbB[1], amountToMix); 1158 var b = colorChannelMixer(rgbA[2], rgbB[2], amountToMix); 1159 return "rgb(" + r + "," + g + "," + b + ")"; 1160 } 1161 } 1162 /*============ Contrast ration End ============*/ 1163 1164 1165 /*============ Blog Slide click START ============*/ 1166 $(document).ready(function ($) { 1167 $('.blog-slider .owl-item').on('click', function () { 1168 var blog_url = $(this).find('.blog-title a').attr('href'); 1169 if (blog_url != "") { 1170 window.location.href = blog_url; 1171 } 1172 }); 1173 $('body').on('click', '.read-more-about', function () { 1174 if ($(this).html() == 'Read More') 1175 $(this).html('Read Less') 1176 else 1177 $(this).html('Read More') 1178 1179 $(this).prev('.about-para-blck').toggleClass('active'); 1180 }); 1181 }); 1182 /*============ Blog Slide click End ============*/ 1183 1184 1185 /*============ Our Client logo slider Start ============*/ 1186 if ($('#clients-logo').length >= 1) { 1187 $('#clients-logo').owlCarousel({ 1188 loop: false, 1189 margin: 10, 1190 autoplay: false, 1191 smartSpeed: 450, 1192 autoplayTimeout: 1500, 1193 dots: false, 1194 nav: true, 1195 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 1196 responsive: { 1197 0: { 1198 items: 1, 1199 nav: true, 1200 margin: 0, 1201 }, 1202 768: { 1203 items: 3, 1204 dots: true, 1205 nav: false 1206 }, 1207 992: { 1208 items: 4, 1209 dots: true, 1210 nav: false 1211 }, 1212 1200: { 1213 items: 6, 1214 dots: false, 1215 nav: true 1216 } 1217 } 1218 }); 1219 } 1220 /*============ Our Client logo slider End ============*/ 1221 1222 $('body').on('click', '.read-author', function (e) { 1223 e.preventDefault(); 1224 if ($(this).html() == 'Read More') 1225 $(this).html('Read Less') 1226 else 1227 $(this).html('Read More') 1228 1229 $('.author--desc').toggleClass('active'); 1230 }); 1231 1232 1233 var $videoSrc; 1234 $('body').on('click', '.client-review-btn', function () { 1235 $videoSrc = $(this).data("src"); 1236 }); 1237 //console.log($videoSrc); 1238 $('#ClientmyModal').on('shown.bs.modal', function (e) { 1239 $("#video").attr('src', $videoSrc + "?autoplay=1&modestbranding=1&showinfo=0"); 1240 }); 1241 1242 // stop playing the youtube video when I close the modal 1243 $('#ClientmyModal').on('hide.bs.modal', function (e) { 1244 // a poor man's stop video 1245 $("#video").attr('src', $videoSrc); 1246 }); 1247 1248 var $getHeight = $('.product-box .product-bx').width() - 30; 1249 $('.product-box .product-bx').height($getHeight); 1250 1251 var $cateHeight = $('.grid-category--name').width() + 34; 1252 $('.grid-category--name').height($cateHeight); 1253 1254 $(window).resize(function () { 1255 var $getHeight = $('.product-box .product-bx').width() - 30; 1256 $('.product-box .product-bx').height($getHeight); 1257 1258 var $cateHeight = $('.grid-category--name').width() + 34; 1259 $('.grid-category--name').height($cateHeight); 1260 }); 1261 1262 1263 $(window).on('load', function () { 1264 if ($(window).width() > 768) { 1265 var maxHeight = 0; 1266 $("div#blog-carousel .owl-stage .blog-text").each(function () { 1267 if ($(this).height() > maxHeight) { maxHeight = $(this).height(); } 1268 }); 1269 $("div#blog-carousel .owl-stage .blog-text").height(maxHeight); 1270 } 1271 }); 1272 1273 var equalheight; 1274 equalheight = function (container) { 1275 var currentTallest = 0, 1276 currentRowStart = 0, 1277 rowDivs = new Array(), 1278 $el, 1279 topPosition = 0; 1280 $(container).each(function () { 1281 $el = $(this); 1282 $($el).height('auto') 1283 topPostion = $el.position().top; 1284 if (currentRowStart != topPostion) { 1285 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 1286 rowDivs[currentDiv].height(currentTallest); 1287 } 1288 rowDivs.length = 0; // empty the array 1289 currentRowStart = topPostion; 1290 currentTallest = $el.height(); 1291 rowDivs.push($el); 1292 } else { 1293 rowDivs.push($el); 1294 currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest); 1295 } 1296 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 1297 rowDivs[currentDiv].height(currentTallest); 1298 } 1299 }); 1300 } 1301 equalheight('.sameheight'); 1302}); 1303 1304
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.