Rev 8 | Blame | Compare with Previous | Last modification | View Log | RSS feed
$(document).ready(function() {$("a[href^='#']").click(function(event){event.preventDefault();$('html,body').animate({scrollTop:$(this.hash).offset().top}, 500);});});function openPage(pageName, elmnt) {var i, tablinks;// Show spinnerdocument.getElementById("content").innerHTML = '<div class="d-flex justify-content-center p-5"><div class="spinner-border"><span class="sr-only">Loading...</span></div></div>';// Get and display snippet from servergetPage(pageName);// Remove the background color of all nav-links/buttonstablinks = document.getElementsByClassName("nav-link");for (i = 0; i < tablinks.length; i++) {tablinks[i].style.backgroundColor = "";}// Scroll to toptopFunction();// Change color for active buttonelmnt.style.backgroundColor = "#5e5e5e";}function initIframes() {var iframeDefer = document.getElementsByTagName('iframe');for (var i = 0; i < iframeDefer.length; i++) {if (iframeDefer[i].getAttribute('data-src')) {iframeDefer[i].setAttribute('src', iframeDefer[i].getAttribute('data-src'));}}}window.onload = initIframes;jQuery(document).on('copy', function(e) {var sel = window.getSelection();var copyFooter = "<br /><br /> Source: <a href='" + document.location.href + "'>" + document.location.href + "</a>";var copyHolder = $('<div>', {html: sel+copyFooter, style: {position: 'absolute', left: '-99999px'}});$('body').append(copyHolder);sel.selectAllChildren( copyHolder[0] );window.setTimeout(function() {copyHolder.remove();},0);});function getPage(pageName) {$.post("getpage.php",{page: pageName},function(data, status) {if (status == "success") {document.getElementById("content").innerHTML = data;$("a[href^='#']").click(function(event){event.preventDefault();var pos = $(this.hash).parent().parent().offset().top - $("#topNav").outerHeight();window.location.hash = "" + $(this).attr("href");$('html,body').animate({scrollTop:pos}, 500, 'swing');});initIframes();handleCollabsible();}});}// collapsible contentfunction handleCollabsible() {var coll = document.getElementsByClassName("collapsible");var i;for (i = 0; i < coll.length; i++) {coll[i].addEventListener("click", function() {this.classList.toggle("active");var content = this.nextElementSibling;if (content.style.maxHeight){content.style.maxHeight = null;} else {content.style.maxHeight = content.scrollHeight + "px";}});}}// Read url parameter or get the element with id="defaultOpen", and click on itvar parameterValue = null;var parameterPage = window.location.search.match(/(\?|&)page\=([^&]*)/);if (parameterPage !== null) {parameterValue = decodeURIComponent(parameterPage[2]);document.getElementById(parameterValue + "Open").click();} else {document.getElementById("defaultOpen").click();}// Floating Top Navigation Button:mybutton = document.getElementById("topBtn");window.onscroll = function() {scrollFunction()};function scrollFunction() {if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {mybutton.style.display = "block";} else {mybutton.style.display = "none";}}function topFunction() {document.body.scrollTop = document.documentElement.scrollTop = 0;}