1// Main Site JS 2window.onload = function() { 3 hashChanged(window.location.hash); 4 //fix the footer if needed 5 if ($(document.body).height() < $(window).height()) { 6 document.getElementById("footer_wrapper").style.position = "fixed"; 7 document.getElementById("footer_wrapper").style.bottom = "0"; 8 document.getElementById("footer_wrapper").style.width = "100%"; 9 } 10 11 if ( $(window).width() > 768 ) { 12 $('[data-toggle="popover"]').popover() 13 }; 14 15 // window.setInterval(function() {checkFooter();}, 500); 16 17 if (window.innerWidth > 991) { 18 $('#events-courses .col-sm-6:first-child .events-courses-hover').hover( 19 function() { 20 $('#events-courses .col-sm-6:first-child .events-courses-slider').css('transform', 'translateX(-350px)'); 21 }, function() { 22 $('#events-courses .col-sm-6:first-child .events-courses-slider').css('transform', 'translateX(0px)'); 23 } 24 ); 25 $('#events-courses .col-sm-6:last-child .events-courses-hover').hover( 26 function() { 27 $('#events-courses .col-sm-6:last-child .events-courses-slider').css('transform', 'translateX(350px)'); 28 }, function() { 29 $('#events-courses .col-sm-6:last-child .events-courses-slider').css('transform', 'translateX(0px)'); 30 } 31 ); 32 }; 33 34 if (window.innerWidth > 991) { 35 $('.staff-picture').hover( 36 function() { 37 $(this).find('img').css('opacity', 0.5); 38 }, function() { 39 $(this).find('img').css('opacity', 1); 40 } 41 ); 42 }; 43 44 $('#event-schedule-print-button').click(function() { 45 var contents = $('#desktop-event-schedule').html(); 46 w = window.open(); 47 w.document.write(contents); 48 w.print(); 49 w.close(); 50 }); 51}; 52 53function checkFooter() { 54 //var sel = document.getElementById("footer_wrapper"); 55 //if (($(document.body).height() + $("#footer_wrapper").height()) < $(window).height()) { 56 //sel.style.position = "fixed"; 57 //sel.style.bottom = "0"; 58 //sel.style.width = "100%"; 59 //}else{ 60 //sel.style.position = ""; 61 //sel.style.bottom = ""; 62 //sel.style.width = ""; 63 //} 64} 65 66function internationalAddr() { 67 if (document.getElementById("isInter").checked) { 68 document.getElementById("addr1").style.display = "none"; 69 document.getElementById("addr2").style.display = "none"; 70 document.getElementById("state").style.display = "none"; 71 document.getElementById("city").style.display = "none"; 72 document.getElementById("zip").style.display = "none"; 73 document.getElementById("international").style.display = "block"; 74 }else{ 75 document.getElementById("addr1").style.display = "block"; 76 document.getElementById("addr2").style.display = "block"; 77 document.getElementById("state").style.display = "block"; 78 document.getElementById("city").style.display = "block"; 79 document.getElementById("zip").style.display = "block"; 80 document.getElementById("international").style.display = "none"; 81 } 82} 83 84 85//Tab config 86 var aboutTab = new Array( 87 "overview", 88 "mission", 89 "philosophy", 90 "dls", 91 "licensure", 92 "accreditation", 93 "nondiscrimination", 94 "styles", 95 "note" 96 ); 97 98 var programsTab = new Array( 99 "tab1", 100 "tab2", 101 "tab3", 102 "tab4" 103 ); 104 105//aboutTabNames 106function returnName(name) { 107 if (name == "overview") return "Overview"; 108 if (name == "mission") return "Our Mission"; 109 if (name == "philosophy") return "Our Philosophy"; 110 if (name == "dls") return "Direct Learning Studies"; 111 if (name == "licensure") return "Licensure"; 112 if (name == "accreditation") return "Accreditation"; 113 if (name == "nondiscrimination") return "Nondiscrimination"; 114 if (name == "styles") return "Methods of Learning"; 115 if (name == "note") return "Director's Note"; 116} 117 118function returnTabName(name) { 119 if (name == "tab1") return "Welcome to Trinity"; 120 if (name == "tab2") return "The Difference"; 121 if (name == "tab3") return "Easier Than You Think"; 122 if (name == "tab4") return "Get Started Today"; 123} 124 125//hash events 126var sHash = window.location.hash; 127 128window.setInterval(function() { 129 if (window.location.hash != sHash) { 130 sHash = window.location.hash; 131 hashChanged(sHash); 132 } 133}, 100); //100 ms timeout 134 135function hashChanged(h) { 136 //check if it is for us 137 var action = h.substring(1); 138 139 //about tab handle 140 if (aboutTab.indexOf(action) != -1) { 141 handleAboutTab(action); 142 } else if (programsTab.indexOf(action) != -1) { 143 handleProgramsTab(action); 144 } 145} 146 147 148function handleAboutTab(a) { 149 //reset all elements 150 for (var i = 0; i < aboutTab.length; i++) { 151 document.getElementById(aboutTab[i] + "-tab").className = "tab-pane"; 152 document.getElementById(aboutTab[i] + "-handle").className = ""; 153 } 154 155 //set active 156 document.getElementById(a + "-tab").className = "tab-pane active"; 157 document.getElementById(a + "-handle").className = "handle-active"; 158 159 //if mobile update the mobile item thing 160 document.getElementById("mobileAboutText").innerHTML = returnName(a); 161 162 var nav = document.getElementById("mobileAboutContent"); 163 164 if (nav.className.indexOf("mnavactive") == -1) 165 nav.className = "about-nav mnavactive"; 166 else 167 nav.className = "about-nav"; 168 169 170 //focus browser on about 171 if (!isOnScreen(document.getElementById("feature_about"))) document.getElementById("feature_about").scrollIntoView(); 172} 173 174function handleProgramsTab(a) { 175 //reset all elements 176 for (var i = 0; i < programsTab.length; i++) { 177 document.getElementById(programsTab[i] + "-tab").className = "tab-pane"; 178 document.getElementById(programsTab[i] + "-handle").className = ""; 179 } 180 181 //set active 182 document.getElementById(a + "-tab").className = "tab-pane active"; 183 document.getElementById(a + "-handle").className = "active"; 184 185 //focus browser on about 186 //document.getElementById("feature_tabs").scrollIntoView(); 187 188 //if mobile update the mobile item thing 189 document.getElementById("tabsMobileText").innerHTML = returnTabName(a); 190 191 var nav = document.getElementById("tabsMobileContent"); 192 193 if (nav.className.indexOf("mnavactive") == -1) 194 nav.className = "about-nav mnavactive"; 195 else 196 nav.className = "about-nav"; 197} 198
199function lightbox_video(vuid) { 200 window.lbP = new Popup({ 201 "title": "", 202 "body": "<div id=\"vid-" + vuid + "\" class=\"embed-container\"></div><div style=\"background-color: #efefef; font-size: 14px; padding: 20px; top: -23px; position: relative; max-height: 390px; overflow-y: auto;\"><a onclick=\"window.lbP.destroy();\" style=\"float: right; cursor: pointer;position:relative;top:-10px;color: #b20d00;\">Close</a><div id=\"vid-desc-" + vuid + "\"></div></div>", 203 "maxWidth": "800px", 204 "lightbox": true, 205 "onCreate": function() { 206 vod.put(vuid, document.getElementById("vid-" + vuid), true, document.getElementById("vid-desc-" + vuid)); 207 } 208 }).show(); 209} 210 211function toggleMobileNav() { 212 var nav = document.getElementById("studentnav"); 213 var mnav = document.getElementById("mobile-nav"); 214 215 if (nav.className.indexOf("mnavactive") == -1) 216 nav.className = "studentnav2 mnavactive"; 217 else 218 nav.className = "studentnav2"; 219} 220 221function toggleTabsMobile() { 222 var nav = document.getElementById("tabsMobileContent"); 223 224 if (nav.className.indexOf("mnavactive") == -1) 225 nav.className = "about-nav mnavactive"; 226 else 227 nav.className = "about-nav"; 228} 229 230function toggleMobileAbout() { 231 var nav = document.getElementById("mobileAboutContent"); 232 233 if (nav.className.indexOf("mnavactive") == -1) 234 nav.className = "about-nav mnavactive"; 235 else 236 nav.className = "about-nav"; 237} 238 239function toggleVertNav() { 240 var nav = document.getElementById("vertnav"); 241 242 if (nav.className.indexOf("mnavactive") == -1) 243 nav.className = "vertnav mnavactive"; 244 else 245 nav.className = "vertnav"; 246} 247 248 249function isOnScreen(element) { 250 var screen_top_position = window.scrollY; 251 var screen_bottom_position = screen_top_position + window.innerHeight; 252 253 var element_top_position = element.offsetTop; 254 var element_bottom_position = element_top_position + element.offsetHeight; 255 256 return (inRange(element_top_position, screen_top_position, screen_bottom_position) 257 || inRange(element_bottom_position, screen_top_position, screen_bottom_position)); 258} 259 260function inRange(x, a, b) { 261 return (x >= a && x <= b); 262} 263 264function doGradSearch() { 265 if (document.getElementById('grad_search').value == "") { 266 document.getElementById('grad_search').className = 'col-sm-5 ierror'; return; 267 } 268 window.location = '/gradlist/search/' + document.getElementById('grad_search').value + "/" + document.getElementById('grad_search_type').value; 269}
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.