1(function ($) { 2 "use strict"; 3 4 //*=============menu sticky js =============*// 5 var $window = $(window); 6 var didScroll, 7 lastScrollTop = 0, 8 delta = 5, 9 $mainNav = $(".sticky-nav"), 10 $body = $("body"), 11 $mainNavHeight = $mainNav.outerHeight() + 15, 12 scrollTop; 13 14 $window.on("scroll", function () { 15 didScroll = true; 16 scrollTop = $(this).scrollTop(); 17 }); 18 19 setInterval(function () { 20 if (didScroll) { 21 if (Math.abs(lastScrollTop - scrollTop) <= delta) { 22 return; 23 } 24 if (scrollTop > lastScrollTop && scrollTop > $mainNavHeight) { 25 $mainNav 26 .removeClass("fadeInDown") 27 .addClass("fadeInUp") 28 .css("top", -$mainNavHeight); 29 $body.removeClass("remove").addClass("add"); 30 } else { 31 if (scrollTop + $(window).height() < $(document).height()) { 32 $mainNav 33 .removeClass("fadeInUp") 34 .addClass("fadeInDown") 35 .css("top", 0) 36 .addClass("gap"); 37 $body.removeClass("add").addClass("remove"); 38 } 39 } 40 lastScrollTop = scrollTop; 41 didScroll = false; 42 } 43 }, 200); 44 45 if ($(".sticky-nav").length) { 46 $(window).scroll(function () { 47 var scroll = $(window).scrollTop(); 48 if (scroll) { 49 $(".sticky-nav").addClass("navbar_fixed"); 50 $(".sticky-nav-doc .body_fixed").addClass("body_navbar_fixed"); 51 } else { 52 $(".sticky-nav").removeClass("navbar_fixed"); 53 $(".sticky-nav-doc .body_fixed").removeClass("body_navbar_fixed"); 54 } 55 }); 56 } 57 58 $(document).ready(function () { 59 $(window).scroll(function () { 60 if ($(document).scrollTop() > 500) { 61 $("body").addClass("test"); 62 } else { 63 $("body").removeClass("test"); 64 } 65 }); 66 }); 67 68 function navbarFixedTwo() { 69 if ($("#stickyTwo").length) { 70 $(window).scroll(function () { 71 var scroll = $(window).scrollTop(); 72 if (scroll) { 73 $("#stickyTwo").addClass("navbar_fixed"); 74 } else { 75 $("#stickyTwo").removeClass("navbar_fixed"); 76 } 77 }); 78 } 79 } 80 navbarFixedTwo(); 81 82 /*------------------------------------------------------------------------------- 83 Navbar Fixed 84 -------------------------------------------------------------------------------*/ 85 86 function tabFixed() { 87 var windowWidth = $(window).width(); 88 if ($(".header_tabs_area").length) { 89 if (windowWidth > 576) { 90 var tops = $(".header_tabs_area"); 91 var tabs = $(".header_tab_items").height() + 100; 92 var leftOffset = tops.offset().top + tabs; 93 94 $(window).on("scroll", function () { 95 var scroll = $(window).scrollTop(); 96 if (scroll >= leftOffset) { 97 tops.addClass("tab_fixed"); 98 } else { 99 tops.removeClass("tab_fixed"); 100 } 101 }); 102 } 103 } 104 } 105 106 tabFixed(); 107 108 $(".count_div").on("click", function () { 109 $(".count").html(function (i, val) { 110 return val * 1 + 1; 111 }); 112 $(this).addClass("active"); 113 return false; 114 }); 115 116 //*=============menu sticky js =============*// 117 118 // page scroll 119 function bodyFixed() { 120 var windowWidth = $(window).width(); 121 if ($("#sticky_doc").length) { 122 if (windowWidth > 576) { 123 var tops = $("#sticky_doc"); 124 var leftOffset = tops.offset().top; 125 126 $(window).on("scroll", function () { 127 var scroll = $(window).scrollTop(); 128 if (scroll >= leftOffset) { 129 tops.addClass("body_fixed"); 130 } else { 131 tops.removeClass("body_fixed"); 132 } 133 }); 134 } 135 } 136 } 137 138 bodyFixed(); 139 140 /* Menu Click js */ 141 function Menu_js() { 142 if ($(".submenu").length) { 143 $(".submenu > .dropdown-toggle").click(function () { 144 var location = $(this).attr("href"); 145 window.location.href = location; 146 return false; 147 }); 148 } 149 } 150 151 Menu_js(); 152 153 $('.doc_menu a[href^="#"]:not([href="#"]').on("click", function (event) { 154 var $anchor = $(this); 155 $("html, body") 156 .stop() 157 .animate( 158 { 159 scrollTop: $($anchor.attr("href")).offset().top, 160 }, 161 900 162 ); 163 event.preventDefault(); 164 }); 165 166 $(window).on("load", function () { 167 if ($(".scroll").length) { 168 $(".scroll").mCustomScrollbar({ 169 mouseWheelPixels: 50, 170 scrollInertia: 0, 171 }); 172 } 173 }); 174 175 /*--------------- doc_documentation_area Switcher js--------*/ 176 if ($(".doc_documentation_area").length > 0) { 177 //switcher 178 var switchs = true; 179 $("#right").on("click", function (e) { 180 e.preventDefault(); 181 if (switchs) { 182 $(".doc_documentation_area,#right").addClass("overlay"); 183 $(".doc_right_mobile_menu").animate( 184 { 185 right: "0px", 186 }, 187 100 188 ); 189 switchs = false;
190 } else { 191 $(".doc_documentation_area,#right").removeClass("overlay"); 192 $(".doc_right_mobile_menu").animate( 193 { 194 right: "-250px", 195 }, 196 100 197 ); 198 switchs = true; 199 } 200 }); 201 202 $("#left").on("click", function (e) { 203 e.preventDefault(); 204 if (switchs) { 205 $(".doc_documentation_area,#left").addClass("overlay"); 206 $(".doc_mobile_menu").animate( 207 { 208 left: "0px", 209 }, 210 300 211 ); 212 switchs = false; 213 } else { 214 $(".doc_documentation_area,#left").removeClass("overlay"); 215 $(".doc_mobile_menu").animate( 216 { 217 left: "-245px", 218 }, 219 300 220 ); 221 switchs = true; 222 } 223 }); 224 } 225 226 if ($(".mobile_menu").length > 0) { 227 var switchs = true; 228 $(".mobile_btn").on("click", function (e) { 229 if (switchs) { 230 $(".mobile_menu").addClass("open"); 231 } 232 }); 233 } 234 235 /*--------------- slick js--------*/ 236 if ($(".doc_feedback_slider").length) { 237 $(".doc_feedback_slider").slick({ 238 autoplay: true, 239 slidesToShow: 1, 240 slidesToScroll: 1, 241 autoplaySpeed: 2000, 242 speed: 1000, 243 dots: false, 244 arrows: true, 245 prevArrow: ".prev", 246 nextArrow: ".next", 247 }); 248 } 249 250 /*--------------- parallaxie js--------*/ 251 function parallax() { 252 if ($(".parallaxie").length) { 253 $(".parallaxie").parallaxie({ 254 speed: 0.5, 255 }); 256 } 257 } 258 259 parallax(); 260 261 /*--------------- tooltip js--------*/ 262 function tooltip() { 263 if ($(".tooltips").length) { 264 $(".tooltips").tooltipster({ 265 interactive: true, 266 arrow: true, 267 animation: "grow", 268 delay: 200, 269 }); 270 } 271 } 272 273 tooltip(); 274 $(".tooltips_one").data("tooltip-custom-class", "tooltip_blue").tooltip(); 275 $(".tooltips_two").data("tooltip-custom-class", "tooltip_danger").tooltip(); 276 277 $(document).on("inserted.bs.tooltip", function (e) { 278 var tooltip = $(e.target).data("bs.tooltip"); 279 $(tooltip.tip).addClass($(e.target).data("tooltip-custom-class")); 280 }); 281 282 /*--------------- wavify js--------*/ 283 if ($(".animated-waves").length) { 284 $("#animated-wave-three").wavify({ 285 height: 40, 286 bones: 4, 287 amplitude: 70, 288 color: "rgba(188, 214, 234, 0.14)", 289 speed: 0.3, 290 }); 291 292 $("#animated-wave-four").wavify({ 293 height: 60, 294 bones: 5, 295 amplitude: 90, 296 color: "rgba(188, 214, 234, 0.14)", 297 speed: 0.2, 298 }); 299 } 300 301 /*--------------- nav-sidebar js--------*/ 302 303 $(".nav-sidebar > li ").each(function () { 304 var $this = $(this); 305 if($this.find('.dropdown_nav li a').hasClass("active")){ 306 $this.addClass('active') 307 } 308 }); 309 310 if ($(".nav-sidebar > li").hasClass("active")) { 311 $(".nav-sidebar > li.active").find("ul").slideDown(700); 312 } 313 314 315 316 317 function active_dropdown() { 318 $(".nav-sidebar > li .icon").on("click", function (e) { 319 $(this).parent().find("ul").first().toggle(300); 320 $(this).parent().siblings().find("ul").hide(300); 321 }); 322 } 323 324 active_dropdown(); 325 326 $(".nav-sidebar > li .icon").each(function () { 327 var $this = $(this); 328 $this.on("click", function (e) { 329 var has = $this.parent().hasClass("active"); 330 $(".nav-sidebar li").removeClass("active"); 331 if (has) { 332 $this.parent().removeClass("active"); 333 } else { 334 $this.parent().addClass("active"); 335 } 336 }); 337 }); 338 339 /*--------------- blog-single2-sidebar js--------*/ 340 if ( 341 $(".blog_single2_left_sidebarlist .nav-sidebar > li").hasClass("active") 342 ) { 343 $(".blog_single2_left_sidebarlist .nav-sidebar > li.active") 344 .find("ul") 345 .slideDown(700); 346 } 347 348 function active_dropdown3() { 349 $(".blog_single2_left_sidebarlist .nav-sidebar > li > a").on( 350 "click", 351 function (e) { 352 event.preventDefault(); 353 $(this).parent().find("ul").first().toggle(300); 354 $(this).parent().siblings().find("ul").hide(300); 355 } 356 ); 357 } 358 359 active_dropdown3(); 360 361 $(".blog_single2_left_sidebarlist .nav-sidebar > li > a").each(function () { 362 var $this = $(this); 363 $this.on("click", function (e) { 364 event.preventDefault(); 365 var has = $this.parent().hasClass("active"); 366 $(".nav-sidebar li").removeClass("active"); 367 if (has) { 368 $this.parent().removeClass("active"); 369 } else { 370 $this.parent().addClass("active"); 371 } 372 }); 373 }); 374 375 /*--------------- mobile dropdown js--------*/ 376 function active_dropdown2() { 377 $(".menu > li .mobile_dropdown_icon").on("click", function (e) { 378 $(this).parent().find("ul").first().slideToggle(300); 379 $(this).parent().siblings().find("ul").hide(300); 380 }); 381 } 382 383 active_dropdown2(); 384 385 /*--------------- search js--------*/ 386 $(".search a").on("click", function () { 387 if ($(this).parent().hasClass("open")) { 388 $(this).parent().removeClass("open"); 389 } else { 390 $(this).parent().addClass("open"); 391 } 392 return false;
393 }); 394 395 /*--------------- counterUp js--------*/ 396 function counterUp() { 397 if ($(".counter").length) { 398 $(".counter").counterUp({ 399 delay: 1, 400 time: 250, 401 }); 402 } 403 } 404 405 counterUp(); 406 407 /*--------------- popup-js--------*/ 408 function popupGallery() { 409 if ($(".img_popup").length) { 410 $(".img_popup").each(function () { 411 $(".img_popup").magnificPopup({ 412 type: "image", 413 closeOnContentClick: true, 414 closeBtnInside: false, 415 fixedContentPos: true, 416 removalDelay: 300, 417 mainClass: "mfp-no-margins mfp-with-zoom", 418 image: { 419 enabled: true, 420 navigateByImgClick: true, 421 preload: [0, 1], // Will preload 0 - before current, and 1 after the current image, 422 }, 423 }); 424 }); 425 } 426 } 427 428 popupGallery(); 429 430 if ($(".pointing_img_container").length) { 431 $(".pointing_img_container").magnificPopup({ 432 type: "inline", 433 delegate: "a", 434 fixedContentPos: false, 435 fixedBgPos: true, 436 437 overflowY: "auto", 438 closeBtnInside: true, 439 preloader: false, 440 gallery: { 441 enabled: true, 442 preload: [0, 1], 443 navigateByImgClick: true, 444 arrowMarkup: 445 '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir% zoom-anim-dialog"></button>', 446 }, 447 midClick: true, 448 449 removalDelay: 300, 450 mainClass: "my-mfp-zoom-in gallery_content", 451 }); 452 } 453 454 const multipleSwiperSlides = function () { 455 let sliderMain = document.querySelectorAll( 456 ".swiper-container.js-slider--main" 457 ); 458 let sliderNav = document.querySelectorAll( 459 ".swiper-container.js-slider--nav" 460 ); 461 462 // Arrays to hold swiper instances 463 let mainArray = []; 464 let navArray = []; 465 466 // Slider Main 467 sliderMain.forEach(function (element, i) { 468 // Push swiper instance to array 469 mainArray.push( 470 new Swiper(element, { 471 loopedSlides: 3, 472 paginationClickable: true, 473 effect: "coverflow", 474 loop: true, 475 centeredSlides: true, 476 slidesPerView: "auto", 477 coverflow: { 478 rotate: 0, 479 stretch: 100, 480 depth: 150, 481 modifier: 1.5, 482 slideShadows: false, 483 }, 484 }) 485 ); 486 }); 487 488 // Slider Nav 489 sliderNav.forEach(function (element, i) { 490 var self = sliderNav; 491 // Push swiper instance to array 492 navArray.push( 493 new Swiper(element, { 494 slidesPerView: 3, 495 loop: true, 496 loopedSlides: 3, 497 slideToClickedSlide: true, 498 spaceBetween: 5, 499 navigation: { 500 nextEl: self[i].querySelector(".swiper-button-next"), 501 prevEl: self[i].querySelector(".swiper-button-prev"), 502 }, 503 }) 504 ); 505 }); 506 507 const checkOnPage = function () { 508 if (sliderMain.length > 0 && sliderNav.length > 0) { 509 let numberOfSlides = mainArray.length || navArray.length || 0; 510 511 if (mainArray.length !== navArray.length) { 512 console.warn( 513 "multipleSwiperSlides: Number of main slides and nav slides is different. Expect incorrect behaviour." 514 ); 515 } 516 517 for (let i = 0; i < numberOfSlides; i++) { 518 mainArray[i].controller.control = navArray[i]; 519 navArray[i].controller.control = mainArray[i]; 520 } 521 522 console.log("multipleSwiperSlides: Things should be working fine. B)"); 523 } 524 }; 525 526 checkOnPage(); 527 }; 528 529 multipleSwiperSlides(); 530 531 function customPlayer(count) { 532 // console.log(count); 533 var player = videojs("player_" + count); 534 player.nuevo({ 535 theaterButton: true, 536 }); 537 player.on("mode", function (event, mode) { 538 var width; 539 if (mode == "large") width = "100%"; 540 else width = "100%"; 541 document.querySelector(".video_slider_area").style.width = width; 542 $(".video_slider_area").toggleClass("theatermode"); 543 $(".gallery-thumbs").slick("refresh"); 544 }); 545 } 546 547 /*=========== Font size switcher/controller ===========*/ 548 if ($(".rvfs-section").length > 0) { 549 $.rvFontsize({ 550 targetSection: ".rvfs-section", 551 store: true, // store.min.js required! 552 controllers: { 553 appendTo: "#rvfs-controllers", 554 showResetButton: true, 555 }, 556 }); 557 } 558 559 /*=========== anchors js ===========*/ 560 if ($(".shortcode_info h4").length) { 561 var Anchor1 = new AnchorJS(); 562 document.addEventListener("DOMContentLoaded", function (event) { 563 Anchor1 = new AnchorJS(); 564 Anchor1.add(".shortcode_info h4"); 565 }); 566 } 567 568 /*--------- WOW js-----------*/ 569 function bodyScrollAnimation() { 570 var scrollAnimate = $("body").data("scroll-animation"); 571 if (scrollAnimate === true) { 572 new WOW({ 573 mobile: false, 574 }).init(); 575 } 576 } 577 bodyScrollAnimation(); 578 579 /*------------ Cookie functions and color js ------------*/ 580 function createCookie(name, value, days) { 581 var expires = ""; 582 if (days) { 583 var date = new Date(); 584 date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); 585 expires = "; expires=" + date.toUTCString(); 586 } 587 document.cookie = name + "=" + value + expires + "; path=/"; 588 } 589 590 function readCookie(name) { 591 var nameEQ = name + "="; 592 var ca = document.cookie.split(";"); 593 for (var i = 0; i < ca.length; i++) { 594 var c = ca[i]; 595 while (c.charAt(0) == " ") c = c.substring(1, c.length); 596 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 597 } 598 return null; 599 } 600
601 function eraseCookie(name) { 602 createCookie(name, "", -1); 603 } 604 605 var prefersDark = 606 window.matchMedia && 607 window.matchMedia("(prefers-color-scheme: dark)").matches; 608 var selectedNightTheme = readCookie("body_dark"); 609 610 if ( 611 selectedNightTheme == "true" || 612 (selectedNightTheme === null && prefersDark) 613 ) { 614 applyNight(); 615 $(".dark_mode_switcher").prop("checked", true); 616 } else { 617 applyDay(); 618 $(".dark_mode_switcher").prop("checked", false); 619 } 620 621 function applyNight() { 622 $("body").addClass("body_dark"); 623 } 624 625 function applyDay() { 626 $("body").removeClass("body_dark"); 627 } 628 629 $(".dark_mode_switcher").change(function () { 630 if ($(this).is(":checked")) { 631 applyNight(); 632 $(".tab-btns").css("color", "#6B707F"); 633 createCookie("body_dark", true, 999); 634 } else { 635 applyDay(); 636 $(".tab-btns").css("color", "#007CBA"); 637 createCookie("body_dark", false, 999); 638 } 639 }); 640 641 $(".mobile_menu_btn").on("click", function () { 642 $("body").removeClass("menu-is-closed").addClass("menu-is-opened"); 643 }); 644 $(".close_nav").on("click", function (e) { 645 if ($(".side_menu").hasClass("menu-opened")) { 646 $(".side_menu").removeClass("menu-opened"); 647 $("body").removeClass("menu-is-opened"); 648 } else { 649 $(".side_menu").addClass("menu-opened"); 650 } 651 }); 652 653 $(".click_capture").on("click", function () { 654 $("body").removeClass("menu-is-opened").addClass("menu-is-closed"); 655 $(".side_menu").removeClass("menu-opened"); 656 }); 657 658 /*--------------- Tab button js--------*/ 659 $(".next").on("click", function () { 660 $(".v_menu .nav-item > .active") 661 .parent() 662 .next("li") 663 .find("a") 664 .trigger("click"); 665 }); 666 667 $(".previous").on("click", function () { 668 $(".v_menu .nav-item > .active") 669 .parent() 670 .prev("li") 671 .find("a") 672 .trigger("click"); 673 }); 674 /*------------ MAILCHIMP js ------------*/ 675 if ($(".mailchimp").length > 0) { 676 $(".mailchimp").ajaxChimp({ 677 callback: mailchimpCallback, 678 url: "http://droitlab.us15.list-manage.com/subscribe/post?u=0fa954b1e090d4269d21abef5&id=a80b5aedb0", //Replace this with your own mailchimp post URL. Don't remove the "". Just paste the url inside "". 679 }); 680 } 681 if ($(".mailchimp_two").length > 0) { 682 $(".mailchimp_two").ajaxChimp({ 683 callback: mailchimpCallback, 684 url: "https://droitthemes.us19.list-manage.com/subscribe/post?u=5d334217e146b083fe74171bf&id=0e45662e8c", //Replace this with your own mailchimp post URL. Don't remove the "". Just paste the url inside "". 685 }); 686 } 687 $(".memail").on("focus", function () { 688 $(".mchimp-errmessage").fadeOut(); 689 $(".mchimp-sucmessage").fadeOut(); 690 }); 691 $(".memail").on("keydown", function () { 692 $(".mchimp-errmessage").fadeOut(); 693 $(".mchimp-sucmessage").fadeOut(); 694 }); 695 $(".memail").on("click", function () { 696 $(".memail").val(""); 697 }); 698 699 function mailchimpCallback(resp) { 700 if (resp.result === "success") { 701 $(".mchimp-errmessage").html(resp.msg).fadeIn(1000); 702 $(".mchimp-sucmessage").fadeOut(500); 703 } else if (resp.result === "error") { 704 $(".mchimp-errmessage").html(resp.msg).fadeIn(1000); 705 } 706 } 707 708 function Click_menu_hover() { 709 if ($(".tab-demo").length) { 710 $.fn.tab = function (options) { 711 var opts = $.extend({}, $.fn.tab.defaults, options); 712 return this.each(function () { 713 var obj = $(this); 714 715 $(obj) 716 .find(".tabHeader li") 717 .on(opts.trigger_event_type, function () { 718 $(obj).find(".tabHeader li").removeClass("active"); 719 $(this).addClass("active"); 720 721 $(obj).find(".tabContent .tab-pane").removeClass("active show"); 722 $(obj) 723 .find(".tabContent .tab-pane") 724 .eq($(this).index()) 725 .addClass("active show"); 726 }); 727 }); 728 }; 729 $.fn.tab.defaults = { 730 trigger_event_type: "click", //mouseover | click é»Ë认æË¯click 731 }; 732 } 733 } 734 735 Click_menu_hover(); 736 737 function Tab_menu_activator() { 738 if ($(".tab-demo").length) { 739 $(".tab-demo").tab({ 740 trigger_event_type: "mouseover", 741 }); 742 } 743 } 744 745 Tab_menu_activator(); 746 747 function fAqactive() { 748 $(".doc_faq_info .card").on("click", function () { 749 $(".doc_faq_info .card").removeClass("active"); 750 $(this).addClass("active"); 751 }); 752 } 753 754 fAqactive(); 755 756 function chartJs() { 757 var windowSize = $(window).width(); 758 759 if (windowSize <= 767) { 760 var leg = true, 761 ratio = false;
762 } else { 763 var leg = false, 764 ratio = true; 765 } 766 767 var data = [ 768 { 769 name: "35 out of 205 issues unanswered", 770 value: 36, 771 }, 772 { 773 name: "We are working on 42 out of 205 issues", 774 value: 40, 775 }, 776 { 777 name: "20 Out of 205 issues haven't got a reply", 778 value: 44, 779 }, 780 { 781 name: "90 Out of 205 issues resolved in last tow monthsSent", 782 value: 50, 783 }, 784 ]; 785 786 var labels = []; 787 var datasets = []; 788 var sent = data[0]; 789 var opened = data[1]; 790 var response = data[2]; 791 var secured = data[3]; 792 793 data.forEach(function (items) { 794 labels.push(items.name); 795 }); 796 797 datasets.push({ 798 data: [sent.value, opened.value, response.value, secured.value], 799 backgroundColor: ["#f9327a", "#ecb939", "#35bae9", "#42dabf"], 800 borderWidth: 0, 801 label: [sent.name, opened.name, response.name, secured.name], 802 }); 803 804 $("#Docy-chart").each(function () { 805 var canvas = $("#Docy-chart"); 806 canvas.attr("height", 125); 807 // chart.canvas.parentNode.style.height = '128px'; 808 // chart.canvas.parentNode.style.width = '128px'; 809 810 var chart = new Chart(canvas, { 811 type: "polarArea", 812 borderWidth: 0, 813 hover: false, 814 data: { 815 datasets: datasets, 816 labels: labels, 817 }, 818 819 options: { 820 responsive: true, 821 maintainAspectRatio: ratio, 822 legend: { 823 position: "top", 824 display: leg, 825 fullWidth: false, 826 padding: 10, 827 align: "start", 828 }, 829 scale: { 830 display: false, 831 }, 832 tooltips: { 833 enabled: false, 834 backgroundColor: "white", 835 borderColor: "#868e96", 836 borderWidth: 0.5, 837 bodyFontColor: "#868e96", 838 bodyFontSize: 14, 839 bodySpacing: 5, 840 caretSize: 0, 841 cornerRadius: 0, 842 displayColors: true, 843 xPadding: 10, 844 yPadding: 15, 845 }, 846 }, 847 }); 848 }); 849 } 850 851 $(window).on("load", function () { 852 chartJs(); 853 }); 854 855 function general() { 856 $(".collapse-btn").on("click", function (e) { 857 e.preventDefault(); 858 $(this).toggleClass("active"); 859 $(".collapse-wrap").slideToggle(500); 860 }); 861 862 $(".short-by a").click(function () { 863 $(this) 864 .toggleClass("active-short") 865 .siblings() 866 .removeClass("active-short"); 867 }); 868 } 869 general(); 870 871 $(".share_gropu .eye, .share_icon").click(function () { 872 $(".share_gropu, .modal_social").addClass("active"); 873 return false; 874 }); 875 $(".close_btn").click(function () { 876 $(".share_gropu, .modal_social").removeClass("active"); 877 return false; 878 }); 879 880 /*------------------------------------- 881 Intersection Observer 882 -------------------------------------*/ 883 if (!!window.IntersectionObserver) { 884 let observer = new IntersectionObserver( 885 (entries, observer) => { 886 entries.forEach((entry) => { 887 if (entry.isIntersecting) { 888 entry.target.classList.add("active-animation"); 889 //entry.target.src = entry.target.dataset.src; 890 observer.unobserve(entry.target); 891 } 892 }); 893 }, 894 { 895 rootMargin: "0px 0px -100px 0px", 896 } 897 ); 898 document.querySelectorAll(".has-animation").forEach((block) => { 899 observer.observe(block); 900 }); 901 } else { 902 document.querySelectorAll(".has-animation").forEach((block) => { 903 block.classList.remove("has-animation"); 904 }); 905 } 906 907 // === Image Magnify 908 if ($(".zoom").length) { 909 $(".zoom").magnify({ 910 afterLoad: function () { 911 console.log("Magnification powers activated!"); 912 }, 913 }); 914 } 915 916 // === Focus Search Form 917 $(document).on("keydown", function (e) { 918 if (e.keyCode === 191) { 919 e.preventDefault(); 920 $("input[type=search]").focus(); 921 return; 922 } 923 }); 924 925 $('.header_search_form,.banner_search_form').on('submit',function (e) { 926 e.preventDefault(); 927 $('#search-hero-results li:first-child').find(".search_item li:first-child a")[0].click(); 928 }) 929 930 let doc_banner_area = $(".doc_banner_area input[type=search]"); 931 doc_banner_area.on("focus", function () { 932 $("body").addClass("search-focused"); 933 $(".doc_banner_content").css({ position: "relative", "z-index": "999" }); 934 }); 935 936 doc_banner_area.on("focusout", function () { 937 $("body").removeClass("search-focused"); 938 $(".doc_banner_content").removeAttr("style"); 939 }); 940 941 // === YouTube Channel Videos Playlist 942 if ($("#ycp").length) { 943 $("#ycp").ycp({ 944 apikey: "AIzaSyBS5J1A7o-M8X78JuiqF5h103XLmSQiReE", 945 playlist: 6, 946 autoplay: true, 947 related: true, 948 }); 949 } 950 951 // === Back to Top Button 952 var back_top_btn = $("#back-to-top"); 953 954 $(window).scroll(function () { 955 if ($(window).scrollTop() > 300) { 956 back_top_btn.addClass("show"); 957 } else { 958 back_top_btn.removeClass("show"); 959 } 960 }); 961 962 back_top_btn.on("click", function (e) { 963 e.preventDefault(); 964 $("html, body").animate({ scrollTop: 0 }
964, "300"); 965 }); 966 967 /** 968 * OS select dropdown 969 */ 970 /*--------------- niceSelect js--------*/ 971 function select() { 972 if ($(".custom-select, .nice_select").length) { 973 $(".custom-select, .nice_select").niceSelect(); 974 } 975 if ($("#mySelect").length) { 976 $("#mySelect").selectpicker(); 977 } 978 } 979 select(); 980 981 if ($("#mySelect").val() == "windows") { 982 $(".windows").show(); 983 } else { 984 $(".windows").hide(); 985 } 986 987 if ($("#mySelect").val() == "ios") { 988 $(".ios").show(); 989 } else { 990 $(".ios").hide(); 991 } 992 993 $("#mySelect").change(function () { 994 if ($("#mySelect").val() == "windows") { 995 $(".windows").show(); 996 } else { 997 $(".windows").hide(); 998 } 999 if ($("#mySelect").val() == "ios") { 1000 $(".ios").show(); 1001 } else { 1002 $(".ios").hide(); 1003 } 1004 }); 1005 1006 if ($(".doc_testimonial_area").length) { 1007 $(".doc_testimonial_slider").slick({ 1008 autoplay: true, 1009 slidesToShow: 1, 1010 slidesToScroll: 1, 1011 autoplaySpeed: 2000, 1012 speed: 1000, 1013 dots: true, 1014 arrows: false, 1015 asNavFor: ".doc_img_slider", 1016 }); 1017 $(".doc_img_slider").slick({ 1018 slidesToShow: 1, 1019 slidesToScroll: 1, 1020 asNavFor: ".doc_testimonial_slider", 1021 arrows: false, 1022 fade: true, 1023 focusOnSelect: true, 1024 }); 1025 } 1026 1027 /*------------------------------------------------------------------------------- 1028 MAILCHIMP js 1029 -------------------------------------------------------------------------------*/ 1030 if ($(".mailchimp").length > 0) { 1031 $(".mailchimp").ajaxChimp({ 1032 callback: mailchimpCallback, 1033 url: "http://droitlab.us15.list-manage.com/subscribe/post?u=0fa954b1e090d4269d21abef5&id=a80b5aedb0", //Replace this with your own mailchimp post URL. Don't remove the "". Just paste the url inside "". 1034 }); 1035 } 1036 if ($(".mailchimp_two").length > 0) { 1037 $(".mailchimp_two").ajaxChimp({ 1038 callback: mailchimpCallback, 1039 url: "https://droitthemes.us19.list-manage.com/subscribe/post?u=5d334217e146b083fe74171bf&id=0e45662e8c", //Replace this with your own mailchimp post URL. Don't remove the "". Just paste the url inside "". 1040 }); 1041 } 1042 $(".memail").on("focus", function () { 1043 $(".mchimp-errmessage").fadeOut(); 1044 $(".mchimp-sucmessage").fadeOut(); 1045 }); 1046 $(".memail").on("keydown", function () { 1047 $(".mchimp-errmessage").fadeOut(); 1048 $(".mchimp-sucmessage").fadeOut(); 1049 }); 1050 $(".memail").on("click", function () { 1051 $(".memail").val(""); 1052 }); 1053 1054 function mailchimpCallback(resp) { 1055 if (resp.result === "success") { 1056 $(".mchimp-errmessage").html(resp.msg).fadeIn(1000); 1057 $(".mchimp-sucmessage").fadeOut(500); 1058 } else if (resp.result === "error") { 1059 $(".mchimp-errmessage").html(resp.msg).fadeIn(1000); 1060 } 1061 } 1062 1063 /** 1064 * Doc : On this page 1065 * @param str 1066 * @returns {string} 1067 */ 1068 var slug = function (str) { 1069 str = str.replace(/^\s+|\s+$/g, ""); // trim 1070 str = str.toLowerCase(); 1071 1072 // remove accents, swap ñ for n, etc 1073 var from = "ãà áäâẽèéëêìÃïîõòóöôùúüûñç·/_,:;"; 1074 var to = "aaaaaeeeeeiiiiooooouuuunc------"; 1075 for (var i = 0, l = from.length; i < l; i++) { 1076 str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i)); 1077 } 1078 1079 str = str 1080 .replace(/[^a-z0-9 -]/g, "") // remove invalid chars 1081 .replace(/\s+/g, "-") // collapse whitespace and replace by - 1082 .replace(/-+/g, "-"); // collapse dashes 1083 1084 return str; 1085 }; 1086 1087 function capitalizeFirstLetter(string) { 1088 return string.charAt(0).toUpperCase() + string.slice(1); 1089 } 1090 1091 function convertToTitle(Text) { 1092 let title = Text.replaceAll("-", " ").replaceAll("_", "."); 1093 return capitalizeFirstLetter(title); 1094 } 1095 1096 function onThisPageTitles(divs) { 1097 var titles = []; 1098 jQuery(divs).each(function () { 1099 titles.push(jQuery(this).attr("id")); 1100 });
1101 titles.forEach(onThisPage); 1102 1103 function onThisPage(item, index) { 1104 if ($("#navbar-example3").length) { 1105 document.getElementById("navbar-example3").innerHTML += 1106 "<a class='nav-link' href='#" + 1107 item + 1108 "'>" + 1109 convertToTitle(item) + 1110 "</a>"; 1111 } 1112 } 1113 } 1114 1115 $(document).ready(function () { 1116 onThisPageTitles($(".shortcode_info h4").toArray()); 1117 if($(".shortcode_info .changelog_info")){ 1118 onThisPageTitles($(".shortcode_info .changelog_info").toArray()); 1119 } 1120 }); 1121 1122 $(".shadow-sm").hover( 1123 function () { 1124 $(this).addClass("shadow-lg"); 1125 }, 1126 function () { 1127 $(this).removeClass("shadow-lg"); 1128 } 1129 ); 1130 1131 // blog_single2_sidebar js 1132 function bodyFixed2() { 1133 var windowWidth = $(window).width(); 1134 var bottom = $(window).height() - $(".blog_single2_info").height() - 50; 1135 if ($("#sticky_doc2").length) { 1136 if (windowWidth > 576) { 1137 var tops = $("#sticky_doc2"); 1138 var leftOffset = tops.offset().top; 1139 var content = $(".blog-single-2-comment-form"); 1140 var contentTop = content.offset().top - 300; 1141 1142 $(window).on("scroll", function () { 1143 var scroll = $(window).scrollTop(); 1144 if (scroll >= leftOffset && scroll <= contentTop) { 1145 tops.addClass("stick"); 1146 } else { 1147 tops.removeClass("stick"); 1148 } 1149 }); 1150 } 1151 } 1152 } 1153 //console.log($(window).height() - $('#sticky_doc2').height()); 1154 bodyFixed2(); 1155 1156 //smoothscroll 1157 // Select all links with hashes 1158 $('a[href*="#"]') 1159 // Remove links that don't actually link to anything 1160 .not('[href="#"]') 1161 .not('[href="#0"]') 1162 .click(function (event) { 1163 // On-page links 1164 if ( 1165 location.pathname.replace(/^\//, "") == 1166 this.pathname.replace(/^\//, "") && 1167 location.hostname == this.hostname 1168 ) { 1169 // Figure out element to scroll to 1170 var target = $(this.hash); 1171 target = target.length 1172 ? target 1173 : $("[name=" + this.hash.slice(1) + "]"); 1174 // Does a scroll target exist? 1175 if (target.length) { 1176 // Only prevent default if animation is actually gonna happen 1177 event.preventDefault(); 1178 $("html, body").animate( 1179 { 1180 scrollTop: target.offset().top, 1181 }, 1182 1000, 1183 function () { 1184 // Callback after animation 1185 // Must change focus! 1186 var $target = $(target); 1187 $target.focus(); 1188 if ($target.is(":focus")) { 1189 // Checking if the target was focused 1190 return false; 1191 } else { 1192 $target.attr("tabindex", "-1"); // Adding tabindex for elements not focusable 1193 $target.focus(); // Set focus again 1194 } 1195 } 1196 ); 1197 } 1198 } 1199 }); 1200})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.