Open main menu

Changes

1,393 bytes added ,  10:11, 25 August 2020
no edit summary
/* Any JavaScript here will be loaded for all users on every page load. Javascript filter---------------------------------*/
filterSelection// animate divs on startvar items = document.querySelectorAll('.filter-sections li');animate("all"items); // filter on clickeach('.filter-links li', function filterSelection(cel) { var xel.addEventListener('click', ifunction(e) { e.preventDefault(); filterLinks(el); });}); // filter links functionsfunction filterLinks(element) { // get text x var el = documentelement.textContent, // convert to lowercase// linksTolowerCase = el.getElementsByClassNametoLowerCase("ManualsfilterLi"); linksTolowerCase = el; // if all remove all elements if (c el === "all"'All') c = "";{ // Add the "first show" all view class each(display:block'.view', function(e) to the filtered elements, and { e.classList.remove the "show" class from the elements that are not selected for (i = 0'view'); i < x.length }); i++) { w3RemoveClass// no show init animation animate(x[i], "Manualsshow"items); } else { // if not click all remove all elements each(x[i]'.classNameview', function(e) { e.indexOfclassList.remove(c'view') > -1) w3AddClass(x[i], "Manualsshow"; });
}
// show animation for current elements animate(document.querySelectorAll('.' + linksTolowerCase));};// forech arraysfunction each(el, callback) { var allDivs = document.querySelectorAll(el), alltoArr = Array.prototype.slice.call(allDivs); Array.prototype.forEach.call(alltoArr, function(selector, index) { if (callback) return callback(selector); });};// animate functionfunction animate(item) { (function show(counter) { setTimeout(function() { item[counter].classList.add('view'); counter++; if (counter < item.length) show(counter); },2); })(0);};
// Show filtered elements function w3AddClassopenForm(elementevt, nameformName) { // Declare all variables var i, arr1tabcontent, arr2tablinks; arr1 = element evt.className.splitpreventDefault(" "); arr2 = name.split(" "); for (i = 0; i < arr2.length; i++) { if (arr1.indexOf(arr2[i]) == -1) { element.className += " " + arr2[i]; } }}
// Hide Get all elements that are not selectedfunction w3RemoveClass(element, name) { var i, arr1, arr2; arr1 with class= element.className.split(" tabcontent");and hide them arr2 //tabcontent = namedocument.splitgetElementsByClassName(" contextxmlform"); //for (i = 0; i < arr2tabcontent.length; i++) { while (arr1.indexOf(arr2 // tabcontent[i]) > -1) { arr1.splice(arr1style.indexOf(arr2[i]), 1); } } element.className display = arr1.join(" none"); //}
// Add Show the current tab, and add an "active " class to the current control button link that opened the tab if (evt.currentTarget.className.includes(highlight it' active')){var btnContainer = document evt.currentTarget.className.getElementByIdreplace("myBtnContaineractive", "");var btns // Get all elements with class= btnContainer"tablinks" and remove the class "active" tablinks = document.getElementsByClassName("Manualsbtntablinks"); for (var i = 0; i < btnstablinks.length; i++) { btns tablinks[i].className = tablinks[i].addEventListenerclassName.replace("clickactive", function""); } document.getElementById(formName) .style.display = "none"; } else { var current // Get all elements with class="tablinks" and remove the class "active" tablinks = document.getElementsByClassName("activetablinks"); current for (i = 0; i < tablinks.length; i++) { tablinks[0i].className = currenttablinks[0i].className.replace(" active", ""); this } document.getElementById(formName).style.display = "block"; evt.currentTarget.className += " active"; }); }