1(function ($) { 2 "use strict"; 3 4 if ($(".scroll-to-target").length) { 5 $(".scroll-to-target").on("click", function () { 6 var target = $(this).attr("data-target"); 7 $("html, body").animate({ 8 scrollTop: $(target).offset().top, 9 }, 10 1000 11 ); 12 return false; 13 }); 14 } 15 16 if ($(".main-menu__list").length && $(".mobile-nav__container").length) { 17 let navContent = document.querySelector(".main-menu__list").outerHTML; 18 let mobileNavContainer = document.querySelector(".mobile-nav__container"); 19 mobileNavContainer.innerHTML = navContent; 20 } 21 if ($(".sticky-header__content").length) { 22 let navContent = document.querySelector(".main-menu").innerHTML; 23 let mobileNavContainer = document.querySelector(".sticky-header__content"); 24 mobileNavContainer.innerHTML = navContent; 25 } 26 27 if ($(".mobile-nav__container .main-menu__list").length) { 28 let dropdownAnchor = $( 29 ".mobile-nav__container .main-menu__list .menu-item-has-children > a" 30 ); 31 dropdownAnchor.each(function () { 32 let self = $(this); 33 let toggleBtn = document.createElement("BUTTON"); 34 toggleBtn.setAttribute("aria-label", "dropdown toggler"); 35 toggleBtn.innerHTML = "<i class='fa fa-angle-down'></i>"; 36 self.append(function () { 37 return toggleBtn; 38 }); 39 self.find("button").on("click", function (e) { 40 e.preventDefault(); 41 let self = $(this); 42 self.toggleClass("expanded"); 43 self.parent().toggleClass("expanded"); 44 self.parent().parent().children("ul").slideToggle(); 45 }); 46 }); 47 } 48 49 if ($(".mobile-nav__toggler").length) { 50 $(".mobile-nav__toggler").on("click", function (e) { 51 e.preventDefault(); 52 $(".mobile-nav__wrapper").toggleClass("expanded"); 53 $("body").toggleClass("locked"); 54 }); 55 } 56 57 if ($(".search-toggler").length) { 58 $(".search-toggler").on("click", function (e) { 59 e.preventDefault(); 60 $(".search-popup").toggleClass("active"); 61 $(".mobile-nav__wrapper").removeClass("expanded"); 62 $("body").toggleClass("locked"); 63 }); 64 } 65 66 67 if ($(".dynamic-year").length) { 68 let date = new Date(); 69 $(".dynamic-year").html(date.getFullYear()); 70 } 71 72 73 74 function SmoothMenuScroll() { 75 var anchor = $(".scrollToLink"); 76 if (anchor.length) { 77 anchor.children("a").bind("click", function (event) { 78 if ($(window).scrollTop() > 10) { 79 var headerH = "90"; 80 } else { 81 var headerH = "90"; 82 } 83 var target = $(this); 84 $("html, body") 85 .stop() 86 .animate({ 87 scrollTop: $(target.attr("href")).offset().top - headerH + "px" 88 }, 89 1200, 90 "easeInOutExpo" 91 ); 92 anchor.removeClass("current"); 93 anchor.removeClass("current-menu-ancestor"); 94 anchor.removeClass("current_page_item"); 95 anchor.removeClass("current-menu-parent"); 96 target.parent().addClass("current"); 97 event.preventDefault(); 98 }); 99 } 100 } 101 SmoothMenuScroll(); 102 103 function OnePageMenuScroll() { 104 var windscroll = $(window).scrollTop(); 105 if (windscroll >= 117) { 106 var menuAnchor = $(".one-page-scroll-menu .scrollToLink").children("a"); 107 menuAnchor.each(function () { 108 var sections = $(this).attr("href"); 109 $(sections).each(function () { 110 if ($(this).offset().top <= windscroll + 100) { 111 var Sectionid = $(sections).attr("id"); 112 $(".one-page-scroll-menu").find("li").removeClass("current"); 113 $(".one-page-scroll-menu").find("li").removeClass("current-menu-ancestor"); 114 $(".one-page-scroll-menu").find("li").removeClass("current_page_item"); 115 $(".one-page-scroll-menu").find("li").removeClass("current-menu-parent"); 116 $(".one-page-scroll-menu") 117 .find("a[href*=\\#" + Sectionid + "]") 118 .parent() 119 .addClass("current"); 120 } 121 }); 122 }); 123 } else { 124 $(".one-page-scroll-menu li.current").removeClass("current"); 125 $(".one-page-scroll-menu li:first").addClass("current"); 126 } 127 } 128 129 $(window).on("load", function () { 130 if ($(".preloader").length) { 131 $(".preloader").fadeOut(); 132 } 133 }); 134 135 $(window).on("scroll", function () { 136 if ($(".stricked-menu").length) { 137 var headerScrollPos = 130; 138 var stricky = $(".stricked-menu"); 139 if ($(window).scrollTop() > headerScrollPos) {
140 stricky.addClass("stricky-fixed"); 141 } else if ($(this).scrollTop() <= headerScrollPos) { 142 stricky.removeClass("stricky-fixed"); 143 } 144 } 145 if ($(".scroll-to-top").length) { 146 var strickyScrollPos = 100; 147 if ($(window).scrollTop() > strickyScrollPos) { 148 $(".scroll-to-top").fadeIn(500); 149 } else if ($(this).scrollTop() <= strickyScrollPos) { 150 $(".scroll-to-top").fadeOut(500); 151 } 152 } 153 154 OnePageMenuScroll(); 155 }); 156 157 // Accrodion 158 if ($(".accrodion-grp").length) { 159 var accrodionGrp = $(".accrodion-grp"); 160 accrodionGrp.each(function () { 161 var accrodionName = $(this).data("grp-name"); 162 var Self = $(this); 163 var accordion = Self.find(".accrodion"); 164 Self.addClass(accrodionName); 165 Self.find(".accrodion .accrodion-content").hide(); 166 Self.find(".accrodion.active").find(".accrodion-content").show(); 167 accordion.each(function () { 168 $(this) 169 .find(".accrodion-title") 170 .on("click", function () { 171 if ($(this).parent().hasClass("active") === false) { 172 $(".accrodion-grp." + accrodionName) 173 .find(".accrodion") 174 .removeClass("active"); 175 $(".accrodion-grp." + accrodionName) 176 .find(".accrodion") 177 .find(".accrodion-content") 178 .slideUp(); 179 $(this).parent().addClass("active"); 180 $(this) 181 .parent() 182 .find(".accrodion-content") 183 .slideDown(); 184 } 185 }); 186 }); 187 }); 188 } 189 190 // Popular Causes Progress Bar 191 if ($(".count-bar").length) { 192 $(".count-bar").appear( 193 function () { 194 var el = $(this); 195 var percent = el.data("percent"); 196 $(el).css("width", percent).addClass("counted"); 197 }, { 198 accY: -50 199 } 200 ); 201 } 202 203 //Progress Bar / Levels 204 if ($(".progress-levels .progress-box .bar-fill").length) { 205 $(".progress-box .bar-fill").each( 206 function () { 207 $(".progress-box .bar-fill").appear(function () { 208 var progressWidth = $(this).attr("data-percent"); 209 $(this).css("width", progressWidth + "%"); 210 }); 211 }, { 212 accY: 0 213 } 214 ); 215 } 216 217 if ($(".add").length) { 218 $(document).on("click", '.add', function () { 219 if ($(this).prev().val() < 999) { 220 $(this) 221 .prev() 222 .val(+$(this).prev().val() + 1); 223 } 224 $(this).prev().trigger('change'); 225 }); 226 } 227 228 if ($(".sub").length) { 229 $(document).on("click", '.sub', function () { 230 if ($(this).next().val() > 0) { 231 if ($(this).next().val() > 0) 232 $(this) 233 .next() 234 .val(+$(this).next().val() - 1); 235 } 236 $(this).next().trigger('change'); 237 }); 238 } 239 240})(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.