// moved into wordpress itself jQuery("section .column:nth-child(2) .building-block .row .color-dark.grey .clipped-content").load("/library/hours.php?view=home"); /* var mores = ["", "students.html", "/library/resources-for/faculty-3/"]; for(var i = 0; i < mores.length; i++){ var link = jQuery(jQuery(".content-hover-card .card-content > a")[i]).attr("href"); if(mores[i] !== "") jQuery(jQuery(".content-hover-card .card-content")[i]).append("
"); } */ jQuery(jQuery(".content-hover-card .card-content")[1]).append(""); jQuery(jQuery(".content-hover-card .card-content")[2]).append(""); jQuery(".content-hover-card .card-content > a").remove(); jQuery(jQuery("#libSearch h3 span.tab")[0]).click(function(){ jQuery("#libSearch form").hide(); jQuery(jQuery("#libSearch form")[0]).show(); jQuery("#libSearch h3").removeClass(); jQuery(jQuery("#libSearch h3")[1]).addClass("inactive"); }); jQuery(jQuery("#libSearch h3 span.tab")[1]).click(function(){ jQuery("#libSearch form").hide(); jQuery(jQuery("#libSearch form")[1]).show(); jQuery("#libSearch h3").removeClass(); jQuery(jQuery("#libSearch h3")[0]).addClass("inactive"); });; jQuery(jQuery("#libSearch h3 span.library-help")[0]).click(function(){ window.open("https://www.law.berkeley.edu/library/library-information/collections/collection-search/", "libraryHelp"); });; jQuery(jQuery("#libSearch h3 span.library-help")[1]).click(function(){ window.open("https://www.law.berkeley.edu/library/library-information/collections/collection-search/", "libraryHelp"); }); jQuery("#library-ticker .arrow").click(function(){ location.href = "https://www.law.berkeley.edu/library/whatsNew.php"; }); function renderTodaysHours(){ const todaysHours = document.getElementById('todaysHours'); if(todaysHours){ var yyyymmdd = new Date().toISOString().split('T')[0].replace(/-/g, ''); var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://www.law.berkeley.edu/library/hours/hours.json'); xhr.responseType = 'json'; xhr.onload = function() { console.log('here'); if (this.status === 200) { const data = this.response; // Already an object const filteredWeeks = data.weeks.filter(week => week.thisWeek == true); const thisWeek = filteredWeeks[0]; const today = thisWeek[new Date().toLocaleDateString('en-US', { weekday: 'long'}).substring(0,2).toLowerCase()]; if(today.hours.mrr && today.hours.sa){ todaysHours.innerHTML = `Today's Hours