1$(function() { 2 // modal 3 var promoModal = new bootstrap.Modal(document.getElementById('promoModal'), { 4 keyboard: false 5 }); 6 promoModal.show(); 7}); 8 9// navbar change color scrolled 10const myNav = document.querySelector("nav"); 11const body = document.body; 12 13body.addEventListener("scroll", () => { 14 if (body.scrollTop > 80) { 15 myNav.classList.add("nav-color"); 16 } else if (body.scrollTop < 80) { 17 myNav.classList.remove("nav-color"); 18 } 19}); 20 21// smooth scroll 22document.querySelectorAll('a[href^="#"]').forEach((anchor) => { 23 anchor.addEventListener("click", function(e) { 24 e.preventDefault(); 25 26 document.querySelector(this.getAttribute("href")).scrollIntoView({ 27 behavior: "smooth", 28 }); 29 }); 30}); 31 32// navbar responsive 33function navbarTop(x) { 34 if (x.matches) { 35 // If media query matches 36 myNav.classList.add("fixed-top"); 37 myNav.classList.remove("sticky-top"); 38 } else { 39 myNav.classList.remove("fixed-top"); 40 myNav.classList.add("sticky-top"); 41 } 42} 43 44var mobile = window.matchMedia(" (max-width: 992px)"); 45navbarTop(mobile); // Call listener function at run time 46mobile.addListener(navbarTop); // Attach listener function on state changes 47
48const navbarCollapse = document.querySelector(".navbar-collapse"); 49const navbarToggler = document.querySelector(".navbar-toggler"); 50navbarToggler.addEventListener("click", () => { 51 if (navbarToggler.classList.contains("collapsed") && body.scrollTop < 150) { 52 myNav.classList.remove("nav-color"); 53 } else { 54 myNav.classList.add("nav-color"); 55 } 56}); 57 58// collapse when click nav item 59const navLinks = document.querySelectorAll(".nav-item"); 60const menuToggle = document.getElementById("navbarSupportedContent"); 61// const bsCollapse = new bootstrap.Collapse(menuToggle); 62navLinks.forEach((l) => { 63 l.addEventListener("click", () => { 64 // bsCollapse.toggle(); 65 }); 66}); 67 68// collapse when click outside 69$(document).mouseup(function(e) { 70 var container = $(".navbar-collapse "); 71 72 // if the target of the click isn't the container nor a descendant of the container 73 if (!container.is(e.target) && container.has(e.target).length === 0) { 74 container.collapse("hide"); 75 } 76}); 77 78// tabs tutorial 79var tabs = window.location.hash.split("#")[1]; 80if (tabs == "infoDetail1") { 81 $("#v-pills-regis-tab").addClass("active"); 82 $("#v-pills-regis").addClass("show active"); 83} else if (tabs == "infoDetail2") { 84 $("#v-pills-tambah").addClass("show active"); 85 $("#v-pills-tambah-tab").addClass("active"); 86} else if (tabs == "infoDetail3") { 87 $("#v-pills-cara").addClass("show active"); 88 $("#v-pills-cara-tab").addClass("active"); 89} else { 90 $("#opener").addClass("show active"); 91} 92 93// hubungi kami nik dan no hp 94// Restricts input for the given textbox to the given inputFilter. 95function setInputFilter(textbox, inputFilter) { 96 [ 97 "input", 98 "keydown", 99 "keyup", 100 "mousedown", 101 "mouseup", 102 "select", 103 "contextmenu", 104 "drop", 105 ].forEach(function(event) { 106 if (textbox) { 107 textbox.addEventListener(event, function() { 108 if (inputFilter(this.value)) { 109 this.oldValue = this.value; 110 this.oldSelectionStart = this.selectionStart; 111 this.oldSelectionEnd = this.selectionEnd; 112 } else if (this.hasOwnProperty("oldValue")) { 113 this.value = this.oldValue; 114 this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd); 115 } else { 116 this.value = ""; 117 } 118 }); 119 } 120 }); 121} 122 123setInputFilter(document.getElementById("nik"), function(value) { 124 return /^-?\d*$/.test(value); 125}); 126setInputFilter(document.getElementById("phone"), function(value) { 127 return /^-?\d*$/.test(value); 128});
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.