begin making covid alert inline with dropdowns

This commit is contained in:
Mark Eaton
2021-04-23 22:40:33 -04:00
parent af3d990d6f
commit 9dbacdeb70
2 changed files with 486 additions and 250 deletions
+242 -49
View File
@@ -2,21 +2,39 @@
body {
color: #111;
overflow-x: hidden;
}
/* style alert */
#corona-alert {
text-align: center;
background-color: #faf870;
padding: 5px;
border-radius: 5px;
}
#corona-alert-text {
color: #111;
}
/* style header */
#header-div {
padding: 30px 30px 0px 30px;
}
/* style navbar */
.navbar-default {
background-color: #eee;
nav.navbar-default.yamm {
background-color: white;
border: none;
font-size: 1.4em;
color: #111;
margin-top: -15px;
margin-bottom: 28px;
margin-top: -30px;
border-radius: 0px;
}
.navbar-default .navbar-nav>li>a {
color: #111;
}
@@ -25,15 +43,25 @@ body {
margin-left: 16px;
}
/* style background image */
.kbcc-background-image {
background: linear-gradient(to bottom, rgba(255,255,255,0.4) 0%,rgba(255,255,255,0.4) 100%), url("https://www1.kingsborough.edu/photo_album/kcc_campus_06/images/KG_Kibbee_3_jpg.jpg");
padding: 20px 0px;
border-radius: 5px;
background-size: cover;
margin: -30px 0px 30px 0px;
}
/* style jumbotron */
.onesearch-jumbotron {
text-align: center;
margin-top: 45px;
margin-top: -40px;
}
#onesearch-header {
color: #003466;
font-size: 10em;
margin-bottom: 0px;
}
.zero-margin {
@@ -49,23 +77,28 @@ a.searchmenu {
color: #111;
}
.highlight-menu-item {
padding: 2px;
}
.highlight-menu-item:hover {
background-color: #eee;
cursor: pointer;
}
/* style link list */
.link-list {
font-size: 2em;
font-size: 1.5em;
}
/* style for nav by the jumbotron */
.nav-by-jumbotron {
margin-top: -6px;
margin-bottom: 40px;
}
.nav-divs-by-jumbotron {
border: solid #003466 1px;
text-align: center;
padding: 6px;
margin: 6px 0px;
color: #003466;
color: white;
background-color: #003466;
border-radius: 3px;
}
.nav-divs-by-jumbotron>h2 {
@@ -74,21 +107,20 @@ a.searchmenu {
margin-top: 4px;
}
a.no-underline {
text-decoration: none;
}
.nav-divs-by-jumbotron:hover {
background-color: #ddd;
background-color: #444;
}
/* style the panels with the text content */
.panel>.show-panel > .panel-title {
color: #003466;
.panel>.show-panel {
background-color: #003466;
text-align: center;
}
.panel > .show-panel {
background-color: white;
border-bottom: solid #003466 7px;
}
.hide-body-border {
border: none;
box-shadow: none;
@@ -112,12 +144,10 @@ a.searchmenu {
padding: 2px;
}
/* style the gallery */
.slick-slide img {
padding: 2px;
}
/* style the gallery */
img {
max-height: 350px !important;
object-fit: contain;
margin: 0px;
@@ -137,7 +167,7 @@ img {
}
.hours-panel-body {
padding: 10px 5px 10px 5px;
padding: 10px 5px 0px 5px;
}
.padding-0 {
@@ -160,7 +190,9 @@ img {
}
.panel-outline-color {
border: solid #003466 1px;
border: solid #555 1px;
font-size: 1.2em;
line-height: 1.4em;
}
.vertical-align {
@@ -179,6 +211,10 @@ img {
margin-right: 50px;
}
.bigger-fancy-text {
font-size: 1.2em;
}
.yamm1 {
max-width: 900px;
}
@@ -192,7 +228,143 @@ img {
}
.yamm4 {
max-width: 450px;
max-width: 460px;
}
#yamm4-margins {
margin: -15px 0px;
}
/* style footer */
#orange-line {
height:10px;
background-color: #ff4e00;
}
#main-blue-footer {
background-color: #003466;
color: white;
padding: 30px;
}
.whiteahrefs a:link, .whiteahrefs a:hover, .whiteahrefs a:visited, .whiteahrefs a:active {
color: white;
text-decoration:none;
}
.whiteahrefs {
margin-top: 10px;
}
#lighthouse-logo > img {
max-width: 150px;
}
/* media queries */
@media only screen and (min-width: 1px) {
#library-logo {
max-width: 100%;
}
#kb-cuny-logo {
max-width: 100%;
}
.form-width {
width: 220px;
}
.zero-margin {
margin: 7px auto;
}
.nav-by-jumbotron {
margin-top: 40px !important;
}
#main-blue-footer {
min-height: 450px;
}
.library-address {
float: left;
}
#cuny-logo {
float: left;
clear: both;
margin-top: 10px;
}
.libapps {
float: left;
clear: left;
}
}
@media only screen and (min-width: 767px) {
.zero-margin {
margin: -2px;
}
.nav-by-jumbotron {
margin-top: 0px !important;
}
#lighthouse-logo {
display: inline-block;
float: left;
}
#main-blue-footer {
min-height: 210px;
}
.library-address {
display: inline-block;
margin: -10px 30px;
font-size: 1.1em;
}
#cuny-logo {
float: right;
clear: none;
margin: -10px 0px;
}
.libapps {
float: right;
clear: both;
}
}
@media only screen and (min-width: 992px) {
#kb-cuny-logo {
max-width: 30%;
margin-top: 10px;
}
#library-logo {
float: right;
max-width: 60%;
margin-top: -70px;
margin-right: -80px;
}
.form-width {
width: 350px;
}
}
@media only screen and (min-width: 1200px) {
#kb-cuny-logo {
margin-top: 25px;
}
}
/*!
@@ -229,26 +401,32 @@ img {
<!-- the code for the hours widget -->
<script type="text/javascript">
window.onload = function () {
const h = JSON.parse(hours)
const h = JSON.parse(hours);
const options_weekday = { weekday: 'long' };
const options_date = { month: 'short', day: 'numeric' }
const options_weekday_short = { weekday: 'short' };
const options_date = { month: 'short', day: 'numeric' };
for (var i = 0; i < h.length; i++) {
let targetDate = new Date(h[i]["Date"] + "T00:00:00.000-05:00");
let targetDate = new Date(h[i].Date + "T00:00:00.000-05:00");
let today = new Date();
if (window.innerWidth < 500) {
weekday = targetDate.toLocaleDateString("en-US", options_weekday_short)
} else {
weekday = targetDate.toLocaleDateString("en-US", options_weekday)
}
if (targetDate.getFullYear() === today.getFullYear() &&
targetDate.getMonth() === today.getMonth() &&
targetDate.getDate() === today.getDate()) {
document.getElementById('hours0').innerHTML = "<p><strong>Today</strong><br />" + targetDate.toLocaleDateString("en-US", options_date) + "</p><p>" + h[i]["Hours"] + "</p>"
document.getElementById('hours0').innerHTML = "<p><strong>Today</strong><br />" + targetDate.toLocaleDateString("en-US", options_date) + "<br />" + h[i].Hours + "</p>";
var start = true;
var count = 1;
} else if (start === true && count < 5 && h[i]["Hours"] === "Closed" ) {
document.getElementById('hours' + count).innerHTML = "<span style='color:#666;'><p>" + targetDate.toLocaleDateString("en-US", options_weekday) + "<br />" + targetDate.toLocaleDateString("en-US", options_date) + "</p><p>" + h[i]["Hours"] + "</p></span>"
} else if (start === true && count < 3 && h[i].Hours === "Closed" ) {
document.getElementById('hours' + count).innerHTML = "<span style='color:#666;'><p>" + weekday + "<br />" + targetDate.toLocaleDateString("en-US", options_date) + "<br />" + h[i].Hours + "</p></span>";
count++;
} else if (start === true && count < 5 && h[i]["Hours"] != "Closed") {
document.getElementById('hours' + count).innerHTML = "<p>" + targetDate.toLocaleDateString("en-US", options_weekday) + "<br />" + targetDate.toLocaleDateString("en-US", options_date) + "</p><p>" + h[i]["Hours"] + "</p>"
} else if (start === true && count < 3 && h[i].Hours != "Closed") {
document.getElementById('hours' + count).innerHTML = "<p>" + weekday + "<br />" + targetDate.toLocaleDateString("en-US", options_date) + "<br />" + h[i].Hours + "</p>";
count++;
};
};
}
}
};
</script>
@@ -256,7 +434,8 @@ window.onload = function () {
<script type="text/javascript">
function customizeSearch(facet) {
// re-render the dropdown menu with the current pick
document.getElementById('dropdownMenu1').innerHTML = facet + ' <span class="caret"></span>';
document.getElementById('dropdownMenu1').innerHTML = facet + ' <span class="caret"></span>';
document.getElementById("primoQueryTemp").setAttribute("placeholder", "Enter search term here");
// reset any previously selected facets
document.querySelectorAll('.deleteWithDropdownChange').forEach(e => e.remove());
@@ -276,20 +455,34 @@ function customizeSearch(facet) {
} else if (facet === "Newspapers") {
document.getElementById("formToAppendInputsTo").setAttribute('action', 'https://onesearch.cuny.edu/discovery/npsearch');
} else {
console.log("no match")
};
};
console.log("no match");
}
}
</script>
<!-- OneSearch widget script from OLS. Used without modification -->
<!-- OneSearch widget script from OLS, modified -->
<script type="text/javascript">
function addPrimoQuery() {
document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value.replace(/[,]/g, " ");
/* If you changed the form name at the top, change it below to match */
document.forms["searchPrimoForm1"].submit();
function addPrimoQuery(e) {
// prevent the user from submitting the form if no dropdown item has been selected. Added by ME.
e.preventDefault();
e.stopPropagation();
if (document.getElementById("dropdownMenu1").innerHTML.includes('Define') === true) {
$("#dropdownMenu1").trigger('click.bs.dropdown.data-api');
document.getElementById("primoQueryTemp").value = "";
document.getElementById("primoQueryTemp").setAttribute("placeholder", "Please make a selection");
return true;
};
// original OLS widget
document.getElementById("primoQuery").value = "any,contains," + document.getElementById("primoQueryTemp").value.replace(/[,]/g, " ");
/* If you changed the form name at the top, change it below to match */
document.forms.searchPrimoForm1.submit();
}
</script>
<!-- Load bootstrap accessibility libraries (https://github.com/paypal/bootstrap-accessibility-plugin) -->
<link rel="stylesheet" type="text/css" href="//libapps.s3.amazonaws.com/sites/2365/include/bootstrap-accessibility.min.css">
<script type="text/javascript" src="//libapps.s3.amazonaws.com/sites/2365/include/bootstrap-accessibility.min.js"></script>
<!-- FontAwesome -->
<script type="text/javascript" src="//libapps.s3.amazonaws.com/sites/2365/include/fa.js"></script>