1 2var debugging = true; // or true 3if (typeof console == "undefined") var console = { log: function() {} }; 4else if (!debugging || typeof console.log == "undefined") console.log = function() {}; 5 6var log = function(val){ 7 console.log(val); 8} 9var tyw = {}; 10 11const slideUp = (target, duration = 333) => { 12 target.style.transitionProperty = 'height, margin, padding'; 13 target.style.transitionDuration = duration + 'ms'; 14 target.style.boxSizing = 'border-box'; 15 target.style.height = target.offsetHeight + 'px'; 16 target.offsetHeight; 17 target.style.overflow = 'hidden'; 18 target.style.height = 0; 19 target.style.paddingTop = 0; 20 target.style.paddingBottom = 0; 21 target.style.marginTop = 0; 22 target.style.marginBottom = 0; 23 window.setTimeout(() => { 24 target.style.display = 'none'; 25 target.style.removeProperty('height'); 26 target.style.removeProperty('padding-top'); 27 target.style.removeProperty('padding-bottom'); 28 target.style.removeProperty('margin-top'); 29 target.style.removeProperty('margin-bottom'); 30 target.style.removeProperty('overflow'); 31 target.style.removeProperty('transition-duration'); 32 target.style.removeProperty('transition-property'); 33 //alert("!"); 34 }, duration); 35} 36 37const slideDown = (target, duration = 333) => { 38 target.style.removeProperty('display'); 39 let display = window.getComputedStyle(target).display; 40 41 if (display === 'none') 42 display = 'block'; 43 44 target.style.display = display; 45 let height = target.offsetHeight; 46 target.style.overflow = 'hidden'; 47 target.style.height = 0; 48 target.style.paddingTop = 0; 49 target.style.paddingBottom = 0; 50 target.style.marginTop = 0; 51 target.style.marginBottom = 0; 52 target.offsetHeight; 53 target.style.boxSizing = 'border-box'; 54 target.style.transitionProperty = "height, margin, padding"; 55 target.style.transitionDuration = duration + 'ms'; 56 target.style.height = height + 'px'; 57 target.style.removeProperty('padding-top'); 58 target.style.removeProperty('padding-bottom'); 59 target.style.removeProperty('margin-top'); 60 target.style.removeProperty('margin-bottom'); 61 window.setTimeout(() => { 62 target.style.removeProperty('height'); 63 target.style.removeProperty('overflow'); 64 target.style.removeProperty('transition-duration'); 65 target.style.removeProperty('transition-property'); 66 }, duration); 67} 68const slideToggle = (target, duration = 333) => { 69 if (window.getComputedStyle(target).display === 'none') { 70 return slideDown(target, duration); 71 } else { 72 return slideUp(target, duration); 73 } 74} 75 76tyw.init = function(){ 77 tyw.mainnav = document.getElementById('mainnav'); 78 tyw.all = document.getElementById('all'); 79 document.getElementById('navtoggle').addEventListener('click', function(){ 80 slideToggle(tyw.mainnav); 81 tyw.all.classList.toggle('shownav'); 82 }); 83 84 toggleAcc = function(){ 85 slideToggle( this.parentNode.getElementsByTagName('div')[0] ); 86 this.parentNode.classList.toggle('open'); 87 }; 88 document.querySelectorAll('.frame-accordion header').forEach(el => el.addEventListener('click', toggleAcc)); 89} 90 91window.addEventListener("load", tyw.init);
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.