1(function (window, document, $, undefined) { 2 "use strict"; 3 4 var eduJs = { 5 i: function (e) { 6 eduJs.d(); 7 eduJs.methods(); 8 }, 9 10 d: function (e) { 11 (this._window = $(window)), 12 (this._document = $(document)), 13 (this._body = $("body")), 14 (this._html = $("html")), 15 (this.sideNav = $(".rbt-search-dropdown")); 16 }, 17 methods: function (e) { 18 eduJs.salActive(); 19 eduJs.menuCurrentLink(); 20 eduJs.eduSwiperActive(); 21 eduJs.eduBgCardHover(); 22 eduJs.magnigyPopup(); 23 eduJs.counterUp(); 24 eduJs.pricingPlan(); 25 eduJs.courseView(); 26 eduJs.stickyHeader(); 27 eduJs.masonryActivation(); 28 eduJs._clickDoc(); 29 eduJs.wowActivation(); 30 eduJs.radialProgress(); 31 eduJs.marqueImage(); 32 eduJs.popupMobileMenu(); 33 eduJs.headerSticky(); 34 eduJs.qtyBtn(); 35 eduJs.checkoutPage(); 36 eduJs.offCanvas(); 37 eduJs.onePageNav(); 38 eduJs.transparentHeader(); 39 eduJs.categoryMenuHover(); 40 eduJs.cartSidenav(); 41 eduJs.filterClickButton(); 42 eduJs.selectPicker(); 43 eduJs.headerTopActivation(); 44 eduJs.magnificPopupActivation(); 45 eduJs.showMoreBtn(); 46 eduJs.sidebarVideoHidden(); 47 eduJs.courseActionBottom(); 48 eduJs.topbarExpend(); 49 eduJs.categoryOffcanvas(); 50 eduJs.autoslidertab(); 51 eduJs.moveAnimation(); 52 eduJs.contactForm(); 53 eduJs.player(); 54 eduJs.quizAns(); 55 eduJs.lessonAccor(); 56 eduJs.unloadImage(); 57 eduJs.searchValue();
58 eduJs.lessonToggle(); 59 eduJs.categoryMenuHover2(); 60 eduJs.typeField(); // new added 61 eduJs.countDown(); // new added 62 eduJs.editor(); // new added 63 eduJs.toggleModal(); // new added 64 eduJs.dnd(); // new added 65 eduJs.multiStepForm(); // new added 66 eduJs.cursorFollow(); // new added 67 eduJs.quickMenuTabs(); // new added 68 }, 69 dnd: function () { 70 // Select the sortable containers 71 const dnd1 = document.getElementById("dnd1"); 72 const dnd2 = document.getElementById("dnd2"); 73 // const dnd3 = document.getElementById("dnd3"); 74 75 // Initialize Sortable only if the element exists 76 if (dnd1) { 77 new Sortable(dnd1, { 78 animation: 150, 79 }); 80 } 81 82 if (dnd2) { 83 new Sortable(dnd2, { 84 animation: 150, 85 }); 86 } 87 88 // if (dnd3) { 89 // new Sortable(dnd3, { 90 // animation: 150, 91 // }); 92 // } 93 }, 94 editor: function initializeJoditEditors() { 95 Jodit.plugins.add("stat", function (editor) { 96 const statusbar = document.createElement("div"); 97 statusbar.style.backgroundColor = "#fff"; 98 statusbar.style.fontSize = "16px"; 99 statusbar.style.padding = "1px 4px"; 100 101 function calcStat() { 102 var text = Jodit.modules.Helpers.trim(editor.editor.innerText), 103 wordCount = text.split(/[\s\n\r\t]+/).filter(function (value) { 104 return value; 105 }).length, 106 charCount = text.replace(/[\s\n\r\t]+/, "").length; 107 108 statusbar.innerText = "words: " + wordCount + " chars: " + charCount; 109 } 110 111 editor.events 112 .on("change afterInit", editor.async.debounce(calcStat, 100)) 113 .on("afterInit", function () { 114 editor.container.appendChild(statusbar); 115 }); 116 }); 117 118 // Check if the element exists before initializing Jodit 119 const editor1Element = document.querySelector("#editor1"); 120 const editor2Element = document.querySelector("#editor2"); 121 const editor3Element = document.querySelector("#editor3"); 122 123 if (editor1Element) { 124 Jodit.make(editor1Element); 125 } 126 if (editor2Element) { 127 Jodit.make(editor2Element); 128 } 129 if (editor3Element) { 130 Jodit.make(editor3Element); 131 } 132 }, 133 134 multiStepForm: function () { 135 document.addEventListener('DOMContentLoaded', () => { 136 const DOMstrings = { 137 stepsBtnClass: 'multisteps-form__progress-btn', 138 stepsBtns: document.querySelectorAll('.multisteps-form__progress-btn'), 139 stepsBar: document.querySelector('.multisteps-form__progress'), 140 stepsForm: document.querySelector('.multisteps-form__form'), 141 stepsFormTextareas: document.querySelectorAll('.multisteps-form__textarea'), 142 stepFormPanelClass: 'multisteps-form__panel', 143 stepFormPanels: document.querySelectorAll('.multisteps-form__panel'), 144 stepPrevBtnClass: 'rbt-step-btn-prev', 145 stepNextBtnClass: 'rbt-step-btn-next', 146 }; 147 148 // Function to remove classes 149 const removeClasses = (elemSet, className) => { 150 elemSet.forEach(elem => { 151 elem.classList.remove(className); 152 }); 153 }; 154 155 // Find parent of an element 156 const findParent = (elem, parentClass) => { 157 let currentNode = elem; 158 while (!currentNode.classList.contains(parentClass)) { 159 currentNode = currentNode.parentNode; 160 } 161 return currentNode; 162 }; 163 164 // Get active step 165 const getActiveStep = elem => { 166 return Array.from(DOMstrings.stepsBtns).indexOf(elem); 167 }; 168 169 // Set active step 170 const setActiveStep = activeStepNum => { 171 removeClasses(DOMstrings.stepsBtns, 'rbt-active'); 172 DOMstrings.stepsBtns.forEach((elem, index) => { 173 if (index <= activeStepNum) { 174 elem.classList.add('rbt-active'); 175 } 176 }); 177 }; 178 179 // Get active panel 180 const getActivePanel = () => { 181 let activePanel;
182 DOMstrings.stepFormPanels.forEach(elem => { 183 if (elem.classList.contains('rbt-active')) { 184 activePanel = elem; 185 } 186 }); 187 return activePanel; 188 }; 189 190 // Set active panel 191 const setActivePanel = activePanelNum => { 192 removeClasses(DOMstrings.stepFormPanels, 'rbt-active'); 193 DOMstrings.stepFormPanels.forEach((elem, index) => { 194 if (index === activePanelNum) { 195 elem.classList.add('rbt-active'); 196 } 197 }); 198 }; 199 200 // Add event listener to stepsBar 201 if (DOMstrings.stepsBar) { 202 DOMstrings.stepsBar.addEventListener('click', e => { 203 const eventTarget = e.target; 204 205 if (!eventTarget.classList.contains(DOMstrings.stepsBtnClass)) { 206 return; 207 } 208 209 const activeStep = getActiveStep(eventTarget); 210 setActiveStep(activeStep); 211 setActivePanel(activeStep); 212 }); 213 } 214 215 // Add event listener to stepsForm 216 if (DOMstrings.stepsForm) { 217 DOMstrings.stepsForm.addEventListener('click', e => { 218 const eventTarget = e.target; 219 220 if ( 221 !( 222 eventTarget.classList.contains(DOMstrings.stepPrevBtnClass) || 223 eventTarget.classList.contains(DOMstrings.stepNextBtnClass) 224 ) 225 ) { 226 return; 227 } 228 229 const activePanel = findParent(eventTarget, DOMstrings.stepFormPanelClass); 230 let activePanelNum = Array.from(DOMstrings.stepFormPanels).indexOf(activePanel); 231 232 if (eventTarget.classList.contains(DOMstrings.stepPrevBtnClass)) { 233 activePanelNum--; 234 } else { 235 activePanelNum++; 236 } 237
238 setActiveStep(activePanelNum); 239 setActivePanel(activePanelNum); 240 }); 241 } 242 }); 243 }, 244 245 cursorFollow: function () { 246 let mouseX = 0, mouseY = 0; 247 let xp = 0, yp = 0; 248 const cursorFollower = document.getElementById("cursorFollower"); 249 const container = document.querySelector(".cf_boundary"); 250 251 if (container) { 252 document.addEventListener("mousemove", (e) => { 253 const rect = container.getBoundingClientRect(); 254 255 mouseX = e.clientX - rect.left; 256 mouseY = e.clientY - rect.top; 257 258 const maxX = rect.width - cursorFollower.offsetWidth / 2; 259 const maxY = rect.height - cursorFollower.offsetHeight / 2; 260 const minX = cursorFollower.offsetWidth / 2; 261 const minY = cursorFollower.offsetHeight / 2; 262 263 mouseX = Math.max(minX, Math.min(mouseX, maxX)); 264 mouseY = Math.max(minY, Math.min(mouseY, maxY)); 265 }); 266 267 function animateCursor() { 268 xp += (mouseX - xp) * 0.1; 269 yp += (mouseY - yp) * 0.1; 270 271 cursorFollower.style.left = `${xp}px`; 272 cursorFollower.style.top = `${yp}px`; 273 274 requestAnimationFrame(animateCursor); 275 } 276 277 animateCursor(); 278 } 279 280 }, 281 282 toggleModal: function () { 283 var currentQuestion = 1; 284 var totalQuestions = $(".question").length; 285 showQuestion(currentQuestion); 286 287 $("#next-btn, #next-btn-2").click(function () { 288 if (currentQuestion < totalQuestions) { 289 markQuestionAsComplete(currentQuestion); // Mark the current question as complete 290 currentQuestion++; 291 updateProgressBar(currentQuestion); 292 showQuestion(currentQuestion); 293 } 294 }); 295 296 $("#prev-btn").click(function () { 297 if (currentQuestion > 1) { 298 currentQuestion--; 299 updateProgressBar(currentQuestion); 300 showQuestion(currentQuestion); 301 } 302 }); 303 304 function showQuestion(questionNumber) { 305 $(".question").hide(); 306 $("#question-" + questionNumber).show(); 307 308 if (questionNumber == 1) { 309 $("#prev-btn").prop("disabled", true); 310 } else { 311 $("#prev-btn").prop("disabled", false); 312 } 313 314 if (questionNumber == totalQuestions) { 315 $("#next-btn-2").show(); 316 $("#submit-btn").show(); 317 } else { 318 $("#next-btn-2").show(); 319 $("#submit-btn").hide(); 320 } 321 } 322 323 function updateProgressBar(questionNumber) { 324 var progressPercentage = (questionNumber / totalQuestions) * 100; 325 $(".progress-bar").css("width", progressPercentage + "%"); 326 $(".progress").attr("aria-valuenow", progressPercentage); 327 } 328 329 function markQuestionAsComplete(questionNumber) { 330 const buttonSelector = `.quiz-modal-btn:nth-child(${questionNumber})`; 331 const button = $(buttonSelector); 332 333 button.html('<i class="feather-check"></i>'); 334 button.addClass("quiz-modal__active"); 335 336 if (questionNumber == 3) { 337 button.html('<i class="feather-check"></i>'); 338 button.addClass("quiz-modal__active"); 339 } 340 } 341 342 $("#quiz-form").submit(function (event) { 343 event.preventDefault(); 344 }); 345 }, 346 typeField: function () { 347 const textarea = document.getElementById("answerTextArea"); 348 const charCountSpan = document.querySelector(".chr"); 349 350 // Check if the textarea element exists before adding the event listener 351 if (textarea && charCountSpan) { 352 textarea.addEventListener("input", () => { 353 const currentLength = textarea.value.length; 354 const remainingChars = 500 - currentLength; 355 356 if (remainingChars >= 0) { 357 charCountSpan.textContent = `Character Remaining: ${remainingChars}`; 358 } else { 359 textarea.value = textarea.value.substring(0, 500); 360 charCountSpan.textContent = `Character Remaining: 0`; 361 } 362 }); 363 } 364 }, 365 countDown: function () { 366 let time = 3600; 367 let isTimeEnd = false; 368 369 function updateTimer() { 370 const timerText = document.getElementById("timerText"); 371 372 if (timerText) { 373 if (time <= 0) { 374 isTimeEnd = true; 375 timerText.textContent = "0h 0m 0s"; 376 return; 377 } 378 379 const getHours = Math.floor(time / 3600); 380 const getMinutes = Math.floor((time % 3600) / 60); 381 const getSeconds = time % 60; 382 383 timerText.textContent = `${getHours}h ${getMinutes}m ${getSeconds}s`; 384 385 time -= 1;
386 } else { 387 clearInterval(interval); 388 } 389 } 390 391 const interval = setInterval(() => { 392 updateTimer(); 393 394 if (isTimeEnd) { 395 clearInterval(interval); 396 } 397 }, 1000); 398 }, 399 autoslidertab: function (params) { 400 function tabChange() { 401 var tabs = $(".nav-tabs.splash-nav-tabs > li"); 402 var active = tabs.find("a.active"); 403 var next = active.parent("li").next("li").find("a"); 404 if (next.length === 0) { 405 next = tabs.first().find("a").on("click"); 406 } 407 next.tab("show"); 408 } 409 var tabCycle = setInterval(tabChange, 5000); 410 }, 411 412 offCanvas: function (params) { 413 if ($("#rbt-offcanvas-activation").length) { 414 $("#rbt-offcanvas-activation").on("click", function () { 415 $(".side-menu").addClass("side-menu-active"), 416 $("body").addClass("offcanvas-menu-active"); 417 }), 418 $(".close_side_menu").on("click", function () { 419 $(".side-menu").removeClass("side-menu-active"), 420 $("body").removeClass("offcanvas-menu-active"); 421 }), 422 $(".side-menu .side-nav .navbar-nav li a").on("click", function () { 423 $(".side-menu").removeClass("side-menu-active"), 424 $("body").removeClass("offcanvas-menu-active"); 425 }), 426 $("#btn_sideNavClose").on("click", function () { 427 $(".side-menu").removeClass("side-menu-active"), 428 $("body").removeClass("offcanvas-menu-active"); 429 }); 430 } 431 }, 432 433 cartSidenav: function (params) { 434 if ($(".rbt-cart-sidenav-activation").length) { 435 $(".rbt-cart-sidenav-activation").on("click", function () { 436 $(".rbt-cart-side-menu").addClass("side-menu-active"), 437 $("body").addClass("cart-sidenav-menu-active"); 438 }), 439 $(".minicart-close-button").on("click", function () { 440 $(".rbt-cart-side-menu").removeClass("side-menu-active"), 441 $("body").removeClass("cart-sidenav-menu-active"); 442 }), 443 $(".side-menu .side-nav .navbar-nav li a").on("click", function () { 444 $(".rbt-cart-side-menu").removeClass("side-menu-active"), 445 $("body").removeClass("cart-sidenav-menu-active"); 446 }), 447 $("#btn_sideNavClose, .close_side_menu").on("click", function () { 448 $(".rbt-cart-side-menu").removeClass("side-menu-active"), 449 $("body").removeClass("cart-sidenav-menu-active"); 450 }); 451 } 452 }, 453 454 menuCurrentLink: function () { 455 var currentPage = location.pathname.split("/"), 456 current = currentPage[currentPage.length - 1]; 457 $( 458 ".mainmenu li a, .dashboard-mainmenu li a, .for-right-content .rbt-course-main-content li a" 459 ).each(function () { 460 var $this = $(this); 461 if ($this.attr("href") === current) { 462 $this.addClass("active"); 463 $this.parents(".has-menu-child-item").addClass("menu-item-open"); 464 } 465 }); 466 }, 467 468 salActive: function () { 469 sal({ 470 threshold: 0.01, 471 once: true, 472 }); 473 }, 474 475 eduParalax: function () { 476 var scene = document.getElementById("scene"); 477 var parallaxInstance = new Parallax(scene); 478 }, 479 480 eduSwiperActive: function () { 481 var swiper = new Swiper(".banner-swiper-active", { 482 effect: "cards", 483 grabCursor: true, 484 pagination: { 485 el: ".rbt-swiper-pagination", 486 clickable: true, 487 }, 488 }); 489 490 var swiper = new Swiper(".team-slide-activation", { 491 slidesPerView: 1, 492 spaceBetween: 30, 493 loop: true, 494 pagination: { 495 el: ".rbt-swiper-pagination", 496 clickable: true, 497 }, 498 navigation: { 499 nextEl: ".rbt-arrow-right", 500 prevEl: ".rbt-arrow-left", 501 clickable: true, 502 }, 503 breakpoints: { 504 575: { 505 slidesPerView: 1, 506 }, 507 768: { 508 slidesPerView: 2, 509 }, 510 992: { 511 slidesPerView: 3, 512 }, 513 }, 514 }); 515 516 var swiper = new Swiper(".team-slide-activation-4", { 517 slidesPerView: 1, 518 spaceBetween: 30, 519 loop: true, 520 pagination: { 521 el: ".rbt-swiper-pagination", 522 clickable: true, 523 }, 524 navigation: { 525 nextEl: ".rbt-arrow-right", 526 prevEl: ".rbt-arrow-left", 527 clickable: true, 528 }, 529 breakpoints: { 530 575: { 531 slidesPerView: 1, 532 }, 533 768: { 534 slidesPerView: 2, 535 }, 536 992: { 537 slidesPerView: 3, 538 }, 539 540 1200: { 541 slidesPerView: 4, 542 }, 543 }, 544 }); 545 546 var swiper = new Swiper(".blog-post-gallery-activation", { 547 slidesPerView: 1, 548 autoHeight: true, 549 loop: true, 550 navigation: { 551 nextEl: ".rbt-arrow-right", 552 prevEl: ".rbt-arrow-left", 553 clickable: true, 554 }, 555 }); 556 557 var swiper = new Swiper(".team-slide-activation-2", { 558 slidesPerView: 3, 559 spaceBetween: 0, 560 loop: true, 561 pagination: { 562 el: ".rbt-swiper-pagination", 563 clickable: true, 564 }, 565 breakpoints: { 566 320: { 567 slidesPerView: 1, 568 }, 569 480: { 570 slidesPerView: 2, 571 }, 572 768: { 573 slidesPerView: 2, 574 }, 575 992: { 576 slidesPerView: 3, 577 }, 578 }, 579 }); 580 581 var swiper = new Swiper(".service-item-3-activation", { 582 slidesPerView: 1, 583 spaceBetween: 0, 584 loop: false, 585 navigation: { 586 nextEl: ".rbt-arrow-right", 587 prevEl: ".rbt-arrow-left", 588 clickable: true, 589 }, 590 breakpoints: { 591 480: { 592 slidesPerView: 1, 593 }, 594 481: { 595 slidesPerView: 2, 596 }, 597 768: { 598 slidesPerView: 3, 599 }, 600 992: { 601 slidesPerView: 3, 602 }, 603 }, 604 }); 605 606 var swiper = new Swiper(".viral-banner-activation", { 607 slidesPerView: 1, 608 spaceBetween: 0, 609 loop: false, 610 navigation: { 611 nextEl: ".rbt-arrow-right", 612 prevEl: ".rbt-arrow-left", 613 clickable: true, 614 }, 615 }); 616 617 var swiper = new Swiper(".udemy-affilite-activation", { 618 slidesPerView: 1, 619 spaceBetween: 0, 620 loop: true, 621 navigation: { 622 nextEl: ".rbt-arrow-right", 623 prevEl: ".rbt-arrow-left", 624 clickable: true, 625 }, 626 }); 627 628 var swiperThumb = new Swiper(".rbtmySwiperThumb", { 629 spaceBetween: 10, 630 slidesPerView: 2, 631 freeMode: true, 632 watchSlidesProgress: true, 633 }); 634 635 var thumbsSwiper = new Swiper(".rbt-banner-activation-thumbs", { 636 spaceBetween: 10, 637 slidesPerView: 4, 638 freeMode: true, 639 watchSlidesProgress: true, 640 }); 641 642 var swiper = new Swiper(".rbt-banner-activation", { 643 slidesPerView: 1, 644 spaceBetween: 0, 645 loop: true, 646 effect: "creative", 647 creativeEffect: { 648 prev: { 649 shadow: true, 650 translate: ["-20%", 0, -1], 651 }, 652 next: { 653 translate: ["100%", 0, 0], 654 }, 655 },
656 speed: 800, 657 autoHeight: true, 658 autoplay: { 659 delay: 4000, 660 }, 661 navigation: { 662 nextEl: ".rbt-arrow-right", 663 prevEl: ".rbt-arrow-left", 664 clickable: true, 665 }, 666 thumbs: { 667 swiper: thumbsSwiper, 668 }, 669 }); 670 671 var swiper = new Swiper(".rbt-banner-activation-2", { 672 slidesPerView: 1, 673 spaceBetween: 0, 674 loop: false, 675 autoHeight: true, 676 navigation: { 677 nextEl: ".rbt-arrow-right", 678 prevEl: ".rbt-arrow-left", 679 clickable: true, 680 }, 681 }); 682 683 var swiper = new Swiper(".rbt-gif-banner-area", { 684 slidesPerView: 1, 685 spaceBetween: 0, 686 loop: true, 687 navigation: { 688 nextEl: ".rbt-arrow-right", 689 prevEl: ".rbt-arrow-left", 690 clickable: true, 691 }, 692 }); 693 694 var swiper = new Swiper(".testimonial-item-3-activation", { 695 slidesPerView: 1, 696 spaceBetween: 0, 697 loop: false, 698 navigation: { 699 nextEl: ".rbt-arrow-right", 700 prevEl: ".rbt-arrow-left", 701 clickable: true, 702 }, 703 pagination: { 704 el: ".rbt-swiper-pagination", 705 clickable: true, 706 }, 707 breakpoints: { 708 575: { 709 slidesPerView: 1, 710 }, 711 712 768: { 713 slidesPerView: 2, 714 }, 715 716 992: { 717 slidesPerView: 3, 718 }, 719 }, 720 }); 721 722 var swiper = new Swiper(".testimonial-activation-1", { 723 slidesPerView: 1, 724 spaceBetween: 0, 725 loop: true, 726 pagination: { 727 el: ".rbt-swiper-pagination", 728 clickable: true, 729 }, 730 }); 731 732 var swiper = new Swiper(".modern-course-carousel-activation", { 733 slidesPerView: 1, 734 spaceBetween: 0, 735 loop: true, 736 navigation: { 737 nextEl: ".rbt-arrow-right", 738 prevEl: ".rbt-arrow-left", 739 clickable: true, 740 }, 741 }); 742 743 var swiper = new Swiper(".category-activation-one", { 744 slidesPerView: 1, 745 spaceBetween: 0, 746 loop: true, 747 navigation: { 748 nextEl: ".rbt-arrow-right", 749 prevEl: ".rbt-arrow-left", 750 clickable: true, 751 }, 752 pagination: { 753 el: ".rbt-swiper-pagination", 754 clickable: true, 755 }, 756 breakpoints: { 757 481: { 758 slidesPerView: 1, 759 }, 760 768: { 761 slidesPerView: 2, 762 }, 763 992: { 764 slidesPerView: 3, 765 }, 766 1200: { 767 slidesPerView: 4, 768 }, 769 }, 770 }); 771 772 var swiper = new Swiper(".category-activation-two", { 773 slidesPerView: 1, 774 spaceBetween: 0, 775 loop: false, 776 navigation: { 777 nextEl: ".rbt-arrow-right", 778 prevEl: ".rbt-arrow-left", 779 clickable: true, 780 }, 781 scrollbar: { 782 el: ".swiper-scrollbar", 783 draggable: true, 784 hide: true, 785 snapOnRelease: true, 786 }, 787 breakpoints: { 788 480: { 789 slidesPerView: 1, 790 }, 791 481: { 792 slidesPerView: 2, 793 }, 794 768: { 795 slidesPerView: 2, 796 }, 797 992: { 798 slidesPerView: 3, 799 }, 800 801 1200: { 802 slidesPerView: 6, 803 }, 804 }, 805 }); 806 807 var swiper = new Swiper(".category-activation-three", { 808 slidesPerView: 1, 809 spaceBetween: 0, 810 loop: true, 811 navigation: { 812 nextEl: ".rbt-arrow-right", 813 prevEl: ".rbt-arrow-left", 814 clickable: true, 815 }, 816 scrollbar: { 817 el: ".swiper-scrollbar", 818 draggable: true, 819 hide: true, 820 snapOnRelease: true, 821 }, 822 breakpoints: { 823 480: { 824 slidesPerView: 1, 825 }, 826 481: { 827 slidesPerView: 2, 828 }, 829 768: { 830 slidesPerView: 2, 831 }, 832 992: { 833 slidesPerView: 3, 834 }, 835 1200: { 836 slidesPerView: 4, 837 }, 838 }, 839 }); 840 841 var swiper = new Swiper(".category-activation-four", { 842 slidesPerView: 1, 843 spaceBetween: 30, 844 loop: true, 845 navigation: { 846 nextEl: ".rbt-arrow-right", 847 prevEl: ".rbt-arrow-left", 848 clickable: true, 849 }, 850 scrollbar: { 851 el: ".swiper-scrollbar", 852 draggable: true, 853 hide: true, 854 snapOnRelease: true, 855 }, 856 breakpoints: { 857 480: { 858 slidesPerView: 1, 859 }, 860 481: { 861 slidesPerView: 2, 862 }, 863 768: { 864 slidesPerView: 2, 865 }, 866 992: { 867 slidesPerView: 3, 868 }, 869 1200: { 870 slidesPerView: 4, 871 }, 872 }, 873 }); 874 875 var swiper = new Swiper(".event-activation-1", { 876 slidesPerView: 1, 877 slidesPerGroup: 1, 878 loop: true, 879 spaceBetween: 30, 880 navigation: { 881 nextEl: ".rbt-arrow-right", 882 prevEl: ".rbt-arrow-left", 883 clickable: true, 884 }, 885 scrollbar: { 886 el: ".swiper-scrollbar", 887 draggable: true, 888 hide: true, 889 snapOnRelease: true, 890 }, 891 pagination: { 892 el: ".rbt-swiper-pagination", 893 clickable: true, 894 }, 895 896 breakpoints: { 897 575: { 898 slidesPerView: 1, 899 }, 900 901 768: { 902 slidesPerView: 2, 903 }, 904 905 992: { 906 slidesPerView: 3, 907 }, 908 1200: { 909 slidesPerView: 3, 910 slidesPerGroup: 3, 911 }, 912 }, 913 }); 914 915 var swiper = new Swiper(".banner-splash-inner-layout-active", { 916 effect: "cards", 917 grabCursor: true, 918 clickable: true, 919 loop: true, 920 pagination: { 921 el: ".rbt-swiper-pagination", 922 clickable: true, 923 type: "fraction", 924 }, 925 navigation: { 926 nextEl: ".rbt-arrow-right", 927 prevEl: ".rbt-arrow-left", 928 clickable: true, 929 }, 930 }); 931 }, 932 933 eduBgCardHover: function () {
934 $(".rbt-hover-active").mouseenter(function () { 935 var self = this; 936 setTimeout(function () { 937 $(".rbt-hover-active.active").removeClass("active"); 938 $(self).addClass("active"); 939 }, 0); 940 }); 941 }, 942 943 magnigyPopup: function () { 944 $(document).on("ready", function () { 945 $(".popup-video").magnificPopup({ 946 type: "iframe", 947 mainClass: "mfp-fade", 948 removalDelay: 160, 949 preloader: false, 950 fixedContentPos: false, 951 }); 952 }); 953 }, 954 955 counterUp: function () { 956 var odo = $(".odometer"); 957 odo.each(function () { 958 $(".odometer").appear(function (e) { 959 var countNumber = $(this).attr("data-count"); 960 $(this).html(countNumber); 961 }); 962 }); 963 }, 964 965 pricingPlan: function () { 966 var mainPlan = $(".rbt-pricing-area"); 967 mainPlan.each(function () { 968 var yearlySelectBtn = $(".yearly-plan-btn"), 969 monthlySelectBtn = $(".monthly-plan-btn"), 970 monthlyPrice = $(".monthly-pricing"), 971 yearlyPrice = $(".yearly-pricing"), 972 buttonSlide = $(".pricing-checkbox"); 973 974 $(monthlySelectBtn).on("click", function () { 975 buttonSlide.prop("checked", true); 976 $(this) 977 .addClass("active") 978 .parent(".nav-item") 979 .siblings() 980 .children() 981 .removeClass("active"); 982 monthlyPrice.css("display", "block"); 983 yearlyPrice.css("display", "none"); 984 }); 985 986 $(yearlySelectBtn).on("click", function () { 987 buttonSlide.prop("checked", false); 988 $(this) 989 .addClass("active") 990 .parent(".nav-item") 991 .siblings() 992 .children() 993 .removeClass("active"); 994 monthlyPrice.css("display", "none"); 995 yearlyPrice.css("display", "block"); 996 }); 997 998 $(buttonSlide).change(function () { 999 if ($('input[class="pricing-checkbox"]:checked').length > 0) { 1000 monthlySelectBtn.addClass("active"); 1001 yearlySelectBtn.removeClass("active"); 1002 monthlyPrice.css("display", "block"); 1003 yearlyPrice.css("display", "none"); 1004 } else { 1005 yearlySelectBtn.addClass("active"); 1006 monthlySelectBtn.removeClass("active"); 1007 monthlyPrice.css("display", "none"); 1008 yearlyPrice.css("display", "block"); 1009 } 1010 }); 1011 }); 1012 }, 1013 1014 courseView: function () { 1015 var gridViewBtn = $(".rbt-grid-view"), 1016 listViewBTn = $(".rbt-list-view"); 1017 1018 $(gridViewBtn).on("click", function () { 1019 $(this) 1020 .addClass("active") 1021 .parent(".course-switch-item") 1022 .siblings() 1023 .children() 1024 .removeClass("active"); 1025 $(".rbt-course-grid-column").addClass("active-grid-view"); 1026 $(".rbt-course-grid-column").removeClass("active-list-view"); 1027 $(".rbt-card").removeClass("card-list-2"); 1028 }); 1029 1030 $(listViewBTn).on("click", function () { 1031 $(this) 1032 .addClass("active") 1033 .parent(".course-switch-item") 1034 .siblings() 1035 .children() 1036 .removeClass("active"); 1037 $(".rbt-course-grid-column").removeClass("active-grid-view"); 1038 $(".rbt-course-grid-column").addClass("active-list-view"); 1039 $(".rbt-card").addClass("card-list-2"); 1040 }); 1041 }, 1042 1043 stickyHeader: function () { 1044 // Header Transparent 1045 if ($("header").hasClass("header-transparent")) { 1046 $("body").addClass("active-header-transparent"); 1047 } else { 1048 $("body").removeClass("active-header-transparent"); 1049 } 1050 }, 1051 1052 masonryActivation: function name(params) { 1053 $(window).load(function () { 1054 $(".masonary-wrapper-activation").imagesLoaded(function () { 1055 // filter items on button click 1056 $(".messonry-button").on("click", "button", function () { 1057 var filterValue = $(this).attr("data-filter"); 1058 $(this).siblings(".is-checked").removeClass("is-checked"); 1059 $(this).addClass("is-checked"); 1060 $grid.isotope({ 1061 filter: filterValue, 1062 }); 1063 }); 1064 // init Isotope 1065 var $grid = $(".mesonry-list").isotope({ 1066 percentPosition: true, 1067 transitionDuration: "0.7s", 1068 layoutMode: "masonry", 1069 masonry: { 1070 columnWidth: ".resizer", 1071 }, 1072 }); 1073 }); 1074 }); 1075 1076 $(window).load(function () { 1077 $(".splash-masonary-wrapper-activation").imagesLoaded(function () { 1078 // filter items on button click 1079 $(".messonry-button").on("click", "button", function () { 1080 var filterValue = $(this).attr("data-filter"); 1081 $(this).siblings(".is-checked").removeClass("is-checked"); 1082 $(this).addClass("is-checked"); 1083 $grid.isotope({ 1084 filter: filterValue, 1085 }); 1086 }); 1087 // init Isotope 1088 var $grid = $(".splash-mesonry-list").isotope({ 1089 percentPosition: true, 1090 transitionDuration: "0.7s", 1091 layoutMode: "masonry", 1092 masonry: { 1093 columnWidth: ".resizer", 1094 }, 1095 }); 1096 }); 1097 }); 1098 }, 1099 1100 _clickDoc: function () { 1101 var inputblur, inputFocus, openSideNav, closeSideNav; 1102 inputblur = function (e) { 1103 if (!$(this).val()) { 1104 $(this).parent(".form-group").removeClass("focused"); 1105 } 1106 }; 1107 inputFocus = function (e) { 1108 $(this).parents(".form-group").addClass("focused"); 1109 }; 1110 openSideNav = function (e) { 1111 e.preventDefault(); 1112 eduJs.sideNav.addClass("active"); 1113 $(".search-trigger-active").addClass("open"); 1114 eduJs._html.addClass("side-nav-opened"); 1115 }; 1116 1117 closeSideNav = function (e) { 1118 if ( 1119 !$( 1120 '.rbt-search-dropdown, .rbt-search-dropdown *:not(".search-trigger-active, .search-trigger-active *")' 1121 ).is(e.target) 1122 ) { 1123 eduJs.sideNav.removeClass("active"); 1124 $(".search-trigger-active").removeClass("open"); 1125 eduJs._html.removeClass("side-nav-opened"); 1126 } 1127 }; 1128 eduJs._document 1129 .on("blur", "input,textarea,select", inputblur) 1130 .on( 1131 "focus", 1132 'input:not([type="radio"]),input:not([type="checkbox"]),textarea,select', 1133 inputFocus 1134 ) 1135 .on("click", ".search-trigger-active", openSideNav) 1136 .on("click", ".side-nav-opened", closeSideNav); 1137 }, 1138 1139 wowActivation: function () { 1140 new WOW().init(); 1141 }, 1142 1143 radialProgress: function () { 1144 $(window).scroll(function () { 1145 /* Check the location of each desired element */ 1146 $(".radial-progress").each(function (i) { 1147 var bottom_of_object = $(this).offset().top + $(this).outerHeight(); 1148 var bottom_of_window = $(window).scrollTop() + $(window).height(); 1149 /* If the object is completely visible in the window, fade it in */ 1150 if (bottom_of_window > bottom_of_object) { 1151 $(".radial-progress").easyPieChart({ 1152 lineWidth: 10, 1153 scaleLength: 0, 1154 rotate: 0, 1155 trackColor: false, 1156 lineCap: "round", 1157 size: 180, 1158 onStep: function (from, to, percent) { 1159 $(this.el).find(".percent").text(Math.round(percent)); 1160 }, 1161 }); 1162 } 1163 }); 1164 }); 1165 }, 1166 1167 marqueImage: function () { 1168 $(".edumarque").each(function () { 1169 var t = 0; 1170 var i = 1; 1171 var $this = $(this); 1172 setInterval(function () { 1173 t += i; 1174 $this.css("background-position-x", -t + "px"); 1175 }, 10); 1176 }); 1177 }, 1178 1179 popupMobileMenu: function (e) { 1180 // Clone desktop menu to mobile menu 1181 var desktopMenuItems = ""; 1182 $(".rbt-main-navigation .mainmenu-nav .mainmenu > li").each(function () { 1183 desktopMenuItems += $(this)[0].outerHTML; 1184 }); 1185 if (desktopMenuItems) { 1186 $(".popup-mobile-menu .mainmenu-nav").html('<ul class="mainmenu">' + desktopMenuItems + '</ul>'); 1187 } 1188 1189 $(".hamberger-button").on("click", function (e) { 1190 $(".popup-mobile-menu").addClass("active"); 1191 }); 1192 1193 $(".close-button").on("click", function (e) { 1194 $(".popup-mobile-menu").removeClass("active"); 1195 $( 1196 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a, .popup-mobile-menu .mainmenu .has-menu-child-item > a" 1197 ) 1198 .siblings(".submenu, .rbt-megamenu") 1199 .removeClass("active") 1200 .slideUp("400"); 1201 $( 1202 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a, .popup-mobile-menu .mainmenu .has-menu-child-item > a" 1203 ).removeClass("open"); 1204 }); 1205 1206 $( 1207 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a, .popup-mobile-menu .mainmenu .has-menu-child-item > a" 1208 ).on("click", function (e) { 1209 var $submenu = $(this).siblings(".submenu, .rbt-megamenu"); 1210 if ($submenu.length) { 1211 e.preventDefault(); 1212 $submenu 1213 .toggleClass("active") 1214 .slideToggle("400"); 1215 $(this).toggleClass("open"); 1216 } 1217 }); 1218 1219 $(".popup-mobile-menu, .popup-mobile-menu .mainmenu.onepagenav li a").on( 1220 "click", 1221 function (e) { 1222 e.target === this && 1223 $(".popup-mobile-menu").removeClass("active") && 1224 $( 1225 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a, .popup-mobile-menu .mainmenu .has-menu-child-item > a" 1226 ) 1227 .siblings(".submenu, .rbt-megamenu") 1228 .removeClass("active") 1229 .slideUp("400") && 1230 $( 1231 ".popup-mobile-menu .mainmenu .has-dropdown > a, .popup-mobile-menu .mainmenu .with-megamenu > a, .popup-mobile-menu .mainmenu .has-menu-child-item > a" 1232 ).removeClass("open"); 1233 } 1234 ); 1235 }, 1236 1237 headerSticky: function () { 1238 $(window).on("scroll", function () { 1239 if ($("body").hasClass("rbt-header-sticky")) { 1240 var stickyPlaceHolder = $(".rbt-sticky-placeholder"), 1241 headerConainer = $(".rbt-header-wrapper"), 1242 headerConainerH = headerConainer.outerHeight(), 1243 topHeaderH = $(".rbt-header-top").outerHeight() || 0, 1244 targrtScroll = topHeaderH + 200; 1245 if ($(window).scrollTop() > targrtScroll) { 1246 headerConainer.addClass("rbt-sticky"); 1247 stickyPlaceHolder.height(headerConainerH); 1248 } else { 1249 headerConainer.removeClass("rbt-sticky"); 1250 stickyPlaceHolder.height(0); 1251 } 1252 } 1253 }); 1254 }, 1255
1256 qtyBtn: function () { 1257 $(".pro-qty").prepend('<span class="dec qtybtn">-</span>'); 1258 $(".pro-qty").append('<span class="inc qtybtn">+</span>'); 1259 $(".qtybtn").on("click", function () { 1260 var $button = $(this); 1261 var oldValue = $button.parent().find("input").val(); 1262 if ($button.hasClass("inc")) { 1263 var newVal = parseFloat(oldValue) + 1; 1264 } else { 1265 if (oldValue > 0) { 1266 var newVal = parseFloat(oldValue) - 1; 1267 } else { 1268 newVal = 0; 1269 } 1270 } 1271 $button.parent().find("input").val(newVal); 1272 }); 1273 }, 1274 1275 checkoutPage: function () { 1276 $("[data-shipping]").on("click", function () { 1277 if ($("[data-shipping]:checked").length > 0) { 1278 $("#shipping-form").slideDown(); 1279 } else { 1280 $("#shipping-form").slideUp(); 1281 } 1282 }); 1283 $('[name="payment-method"]').on("click", function () { 1284 var $value = $(this).attr("value"); 1285 $(".single-method p").slideUp(); 1286 $('[data-method="' + $value + '"]').slideDown(); 1287 }); 1288 }, 1289 1290 onePageNav: function () { 1291 $(".onepagenav").onePageNav({ 1292 currentClass: "current", 1293 changeHash: false, 1294 scrollSpeed: 500, 1295 scrollThreshold: 0.2, 1296 filter: "", 1297 easing: "swing", 1298 }); 1299 }, 1300 1301 transparentHeader: function () { 1302 if ($(".rbt-header").hasClass("rbt-transparent-header")) { 1303 var mainHeader = $(".rbt-header").outerHeight(); 1304 $("body").addClass("rbt-header-transpernt-active"); 1305 $(".header-transperent-spacer").css("padding-top", mainHeader + "px"); 1306 } 1307 }, 1308 1309 categoryMenuHover: function () { 1310 $(".vertical-nav-menu li.vertical-nav-item").mouseover(function () { 1311 $(".rbt-vertical-inner").hide(); 1312 $(".vertical-nav-menu li.vertical-nav-item").removeClass("active"); 1313 $(this).addClass("active"); 1314 var selected_tab = $(this).find("a").attr("href"); 1315 $(selected_tab).stop().fadeIn(); 1316 return false; 1317 }); 1318 }, 1319 1320 selectPicker: function () { 1321 $("select").selectpicker(); 1322 }, 1323 1324 filterClickButton: function () { 1325 $(".discover-filter-activation").on("click", function () { 1326 $(this).toggleClass("open"); 1327 $(".default-exp-expand").slideToggle("400"); 1328 }); 1329 $("#slider-range").slider({ 1330 range: true, 1331 min: 10, 1332 max: 500, 1333 values: [100, 300], 1334 slide: function (event, ui) { 1335 $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]); 1336 }, 1337 }); 1338 $("#amount").val( 1339 "$" + 1340 $("#slider-range").slider("values", 0) + 1341 " - $" + 1342 $("#slider-range").slider("values", 1) 1343 ); 1344 }, 1345 1346 headerTopActivation: function () { 1347 $(".bgsection-activation").on("click", function () { 1348 $(this).parents(".rbt-header-campaign").addClass("deactive"); 1349 }); 1350 }, 1351 1352 magnificPopupActivation: function () { 1353 $(".parent-gallery-container").magnificPopup({ 1354 delegate: ".child-gallery-single", // child items selector, by clicking on it popup will open 1355 type: "image", 1356 mainClass: "mfp-with-zoom", 1357 // other options 1358 gallery: { 1359 enabled: true, 1360 }, 1361 zoom: { 1362 enabled: true, // By default it's false, so don't forget to enable it 1363 duration: 300, // duration of the effect, in milliseconds 1364 easing: "ease-in-out", // CSS transition easing function 1365 // The "opener" function should return the element from which popup will be zoomed in 1366 // and to which popup will be scaled down 1367 // By defailt it looks for an image tag: 1368 opener: function (openerElement) { 1369 // openerElement is the element on which popup was initialized, in this case its <a> tag 1370 // you don't need to add "opener" option if this code matches your needs, it's defailt one. 1371 return openerElement.is("img") 1372 ? openerElement 1373 : openerElement.find("img"); 1374 }, 1375 }, 1376 }); 1377 }, 1378 1379 showMoreBtn: function () { 1380 $.fn.hasShowMore = function () { 1381 return this.each(function () { 1382 $(this).toggleClass("active"); 1383 $(this).text("Show Less"); 1384 $(this).parent(".has-show-more").toggleClass("active"); 1385 if ($(this).parent(".has-show-more").hasClass("active")) { 1386 $(this).text("Show Less"); 1387 } else { 1388 $(this).text("Show More"); 1389 } 1390 }); 1391 }; 1392 $(document).on("click", ".rbt-show-more-btn", function () { 1393 $(this).hasShowMore(); 1394 }); 1395 }, 1396 1397 sidebarVideoHidden: function () { 1398 var scrollTop = $(".sidebar-video-hidden"); 1399 $(window).scroll(function () { 1400 // declare variable 1401 var topPos = $(this).scrollTop(); 1402 // if user scrolls down - show scroll to top button 1403 if (topPos > 250) { 1404 $(scrollTop).css("display", "none"); 1405 } else { 1406 $(scrollTop).css("display", "block"); 1407 } 1408 }); 1409 }, 1410 1411 courseActionBottom: function () { 1412 var scrollBottom = $(".rbt-course-action-bottom"); 1413 $(window).scroll(function () { 1414 var topPos = $(this).scrollTop(); 1415 var targetPossition = $(document).height() * 0.66; 1416 var filled = 1417 ($(document).scrollTop() + window.innerHeight) / $(document).height(); 1418 if (topPos > targetPossition && filled != 1) { 1419 $(scrollBottom).addClass("rbt-course-action-active"); 1420 } else { 1421 $(scrollBottom).removeClass("rbt-course-action-active"); 1422 } 1423 }); 1424 }, 1425 1426 topbarExpend: function () { 1427 var windowWidth = $(window).width(); 1428 { 1429 if (windowWidth < 1199) { 1430 $(".top-bar-expended").on("click", function () { 1431 $(".top-expended-activation").hasClass("active") 1432 ? ($(".top-expended-activation").removeClass("active"), 1433 $(".top-expended-activation") 1434 .find(".top-expended-wrapper") 1435 .css({ height: "32px" })) 1436 : ($(".top-expended-activation").addClass("active"), 1437 $(".top-expended-activation") 1438 .find(".top-expended-wrapper") 1439 .css({ 1440 height: $(".top-expended-inner").outerHeight() + "px", 1441 })); 1442 }); 1443 $(window).on("hresize", function () { 1444 $(".top-expended-activation").hasClass("active") && 1445 $(".top-expended-activation") 1446 .find(".top-expended-inner") 1447 .css({ 1448 height: $(".top-expended-inner").outerHeight() + "px", 1449 }); 1450 }); 1451 } 1452 } 1453 }, 1454 1455 categoryOffcanvas: function () { 1456 var windowWidth = $(window).width(); 1457 if (windowWidth < 1200) { 1458 $(".rbt-side-offcanvas-activation").on("click", function () { 1459 $(".rbt-offcanvas-side-menu").addClass("active-offcanvas"); 1460 }); 1461 $(".rbt-close-offcanvas").on("click", function () { 1462 $(".rbt-offcanvas-side-menu").removeClass("active-offcanvas"); 1463 }); 1464 $(".rbt-offcanvas-side-menu").on("click", function (e) { 1465 e.target === this && 1466 $(".rbt-offcanvas-side-menu").removeClass("active-offcanvas"); 1467 }); 1468 $(".rbt-vertical-nav-list-wrapper .vertical-nav-item a").on( 1469 "click", 1470 function (e) { 1471 e.preventDefault(); 1472 $(this) 1473 .siblings(".vartical-nav-content-menu-wrapper") 1474 .toggleClass("active") 1475 .slideToggle("400"); 1476 $(this).toggleClass("active"); 1477 } 1478 ); 1479 } 1480 }, 1481 1482 moveAnimation: function () {
1483 $(".scene").each(function () { 1484 new Parallax($(this)[0]); 1485 }); 1486 }, 1487 1488 contactForm: function () { 1489 $(".rainbow-dynamic-form").on("submit", function (e) { 1490 e.preventDefault(); 1491 var _self = $(this); 1492 var __selector = _self.closest("input,textarea"); 1493 _self.closest("div").find("input,textarea").removeAttr("style"); 1494 _self.find(".error-msg").remove(); 1495 _self 1496 .closest("div") 1497 .find('button[type="submit"]') 1498 .attr("disabled", "disabled"); 1499 var data = $(this).serialize(); 1500 $.ajax({ 1501 url: "mail.php", 1502 type: "post", 1503 dataType: "json", 1504 data: data, 1505 success: function (data) { 1506 _self 1507 .closest("div") 1508 .find('button[type="submit"]') 1509 .removeAttr("disabled"); 1510 if (data.code == false) { 1511 _self.closest("div").find('[name="' + data.field + '"]'); 1512 _self 1513 .find(".rainbow-btn") 1514 .after('<div class="error-msg"><p>*' + data.err + "</p></div>"); 1515 } else { 1516 $(".error-msg").hide(); 1517 $(".form-group").removeClass("focused"); 1518 _self 1519 .find(".rainbow-btn") 1520 .after( 1521 '<div class="success-msg"><p>' + data.success + "</p></div>" 1522 ); 1523 _self.closest("div").find("input,textarea").val(""); 1524 1525 setTimeout(function () { 1526 $(".success-msg").fadeOut("slow"); 1527 }, 5000); 1528 } 1529 }, 1530 }); 1531 }); 1532 }, 1533 1534 player: function () { 1535 var player = new Plyr(".rbtplayer", { 1536 muted: false, 1537 volume: 1, 1538 controls: [ 1539 "play-large", 1540 "play", 1541 "progress", 1542 "current-time", 1543 "mute", 1544 "volume", 1545 "fullscreen", 1546 ], 1547 }); 1548 }, 1549 1550 quizAns: function () { 1551 var currentQuestion = 1; 1552 showQuestion(currentQuestion); 1553 1554 $("#next-btn").click(function () { 1555 if (currentQuestion < $(".question").length) { 1556 currentQuestion++; 1557 showQuestion(currentQuestion); 1558 } 1559 }); 1560 1561 $("#prev-btn").click(function () { 1562 if (currentQuestion > 1) { 1563 currentQuestion--; 1564 showQuestion(currentQuestion); 1565 } 1566 }); 1567 1568 function showQuestion(questionNumber) { 1569 $(".question").hide(); 1570 $("#question-" + questionNumber).show(); 1571 1572 if (questionNumber == 1) { 1573 $("#prev-btn").prop("disabled", true); 1574 } else { 1575 $("#prev-btn").prop("disabled", false); 1576 } 1577 1578 if (questionNumber == $(".question").length) { 1579 $("#next-btn").hide(); 1580 $("#submit-btn").show(); 1581 } else { 1582 $("#next-btn").show(); 1583 $("#submit-btn").hide(); 1584 } 1585 } 1586 $("#quiz-form").submit(function (event) { 1587 event.preventDefault(); 1588 1589 // Here, you can add your logic to grade the quiz and show the results to the user 1590 // alert("Quiz submitted!"); 1591 }); 1592 }, 1593 1594 lessonAccor: function () { 1595 // Get saved data from sessionStorage 1596 let selectedCollapse = sessionStorage.getItem("selectedCollapse"); 1597 if (selectedCollapse != null) { 1598 $(".accordion .collapse").removeClass("show"); 1599 $(".accordion-button") 1600 .addClass("collapsed") 1601 .attr("aria-expanded", false); 1602 $(selectedCollapse).addClass("show"); 1603 $(selectedCollapse) 1604 .siblings() 1605 .find("button") 1606 .removeClass("collapsed") 1607 .attr("aria-expanded", true); 1608 } 1609 // To set, which one will be opened 1610 $(".accordion .accordion-button").on("click", function () { 1611 let target = $(this).data("bs-target"); 1612 // Save data to sessionStorage 1613 sessionStorage.setItem("selectedCollapse", target); 1614 }); 1615 }, 1616 1617 unloadImage: function name() { 1618 $("#createfileImage").click(function (e) { 1619 $("#createinputfile").click(); 1620 }); 1621 function rbtPreview() { 1622 const [file2] = createinputfile.files; 1623 if (file2) { 1624 createfileImage.src = URL.createObjectURL(file2); 1625 } 1626 } 1627 $("#createinputfile").change(function () { 1628 rbtPreview(this); 1629 }); 1630 }, 1631 1632 searchValue: function () { 1633 $(document).on("keyup", ".rbt-search-active", function () { 1634 var value = $(this).val().toLowerCase(); 1635 $(".rbt-search-activation .accordion .accordion-item").filter( 1636 function () { 1637 $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); 1638 } 1639 ); 1640 }); 1641 }, 1642 1643 lessonToggle: function () { 1644 $(".lesson-toggle-active").on("click", function () { 1645 $(this).toggleClass("sidebar-hide"); 1646 $(".rbt-lesson-leftsidebar").toggleClass("sibebar-none"); 1647 }); 1648 }, 1649 1650 categoryMenuHover2: function () { 1651 $(".dropdown-parent-wrapper li.dropdown-parent-list").mouseover( 1652 function () { 1653 $(".dropdown-child-wrapper").hide(); 1654 $(".dropdown-parent-wrapper li.dropdown-parent-list").removeClass( 1655 "active" 1656 ); 1657 $(this).addClass("active"); 1658 var selected_tab = $(this).find("a").attr("href"); 1659 $(selected_tab).stop().fadeIn(); 1660 return false; 1661 } 1662 ); 1663 }, 1664 1665 quickMenuTabs: function () { 1666 const tabs = document.querySelectorAll('.rbt-quick-menu-tabs .rbt-btn'); 1667 const panes = document.querySelectorAll('.rbt-quick-menu-wrapper .tab-pane'); 1668 1669 if (tabs.length > 0) {
1670 tabs.forEach(tab => { 1671 tab.addEventListener('click', function (e) { 1672 e.preventDefault(); 1673 1674 // Remove active class from all tabs 1675 tabs.forEach(t => t.classList.remove('active')); 1676 // Add active class to clicked tab 1677 this.classList.add('active'); 1678 1679 // Hide all panes 1680 panes.forEach(pane => { 1681 pane.classList.remove('show', 'active'); 1682 }); 1683 1684 // Show target pane 1685 const targetId = this.getAttribute('data-tab'); 1686 const targetPane = document.getElementById(targetId); 1687 if (targetPane) { 1688 targetPane.classList.add('show', 'active'); 1689 } 1690 }); 1691 }); 1692 } 1693 }, 1694 }; 1695 eduJs.i(); 1696})(window, document, 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.