1/** 2 * JCDSRI Faculty -- frontend JS v1.0.3 3 */ 4(function () { 5 'use strict'; 6 7 function overlay() { return document.getElementById('jcdsf-modal-overlay'); } 8 function content() { return document.getElementById('jcdsf-modal-content'); } 9 10 var activeInfo = null; // scroll container of the currently open modal 11 12 // Toggle the fade + scrollbar state based on whether the bio overflows. 13 function updateScrollState() { 14 var ov = overlay(); 15 if (!ov || !activeInfo) return; 16 var modal = ov.querySelector('.jcdsf-modal'); 17 if (!modal) return; 18 var scrollable = activeInfo.scrollHeight > activeInfo.clientHeight + 4; 19 modal.classList.toggle('jcdsf-scroll', scrollable); 20 var atEnd = activeInfo.scrollTop + activeInfo.clientHeight >= activeInfo.scrollHeight - 6; 21 modal.classList.toggle('jcdsf-at-end', atEnd); 22 } 23 24 window.jcdsfOpen = function (card) { 25 var detail = card.querySelector('.jcdsf-detail'); 26 var ov = overlay(), ct = content(); 27 if (!detail || !ov || !ct) return; 28 29 ct.innerHTML = detail.innerHTML; 30 ov.classList.add('jcdsf-open'); 31 document.documentElement.style.overflow = 'hidden'; 32 33 var modal = ov.querySelector('.jcdsf-modal'); 34 if (modal) modal.classList.remove('jcdsf-scroll', 'jcdsf-at-end'); 35 36 activeInfo = ct.querySelector('.jcdsf-modal-info'); 37 if (activeInfo) { 38 activeInfo.addEventListener('scroll', updateScrollState); 39 requestAnimationFrame(updateScrollState); 40 setTimeout(updateScrollState, 80); 41 setTimeout(updateScrollState, 300); 42 } 43 44 var closeBtn = ov.querySelector('.jcdsf-modal-close'); 45 if (closeBtn) closeBtn.focus(); 46 }; 47 48 window.jcdsfClose = function () { 49 var ov = overlay(); 50 if (!ov) return; 51 ov.classList.remove('jcdsf-open'); 52 document.documentElement.style.overflow = ''; 53 if (activeInfo) { activeInfo.removeEventListener('scroll', updateScrollState); activeInfo = null; } 54 var modal = ov.querySelector('.jcdsf-modal'); 55 if (modal) modal.classList.remove('jcdsf-scroll', 'jcdsf-at-end'); 56 var ct = content(); 57 setTimeout(function () { if (ct && !ov.classList.contains('jcdsf-open')) ct.innerHTML = ''; }, 200); 58 }; 59 60 window.jcdsfOverlayClick = function (e) { 61 if (e.target === overlay()) jcdsfClose(); 62 }; 63 64 document.addEventListener('keydown', function (e) { 65 if (e.key === 'Escape') { 66 var ov = overlay(); 67 if (ov && ov.classList.contains('jcdsf-open')) jcdsfClose(); 68 } 69 }); 70 71 window.addEventListener('resize', function () { 72 if (activeInfo) updateScrollState(); 73 }); 74 75})();
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.