-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from uklibraries/click-behavior
Click behavior
- Loading branch information
Showing
7 changed files
with
374 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Usage | ||
This is a mostly complete version of the script. The only thing needed to change to make this work for a specific site is knowledge of which config you require (e.g., "atlas", "exploreuk", "nkaa"). You change the `data-base_path` to that name and the script will take care of the rest, including fallback behavior. | ||
|
||
```html | ||
<script | ||
id="ukl-header-script" | ||
type="module" | ||
src="./js/universalheader.js" | ||
data-base_path="[YOUR CONFIG NAME HERE]" | ||
onerror=" | ||
(() => { | ||
this_script = document.querySelector('#ukl-header-script'); | ||
// Use the fallback css | ||
const styles = document.querySelector('#ukl-header-styles'); | ||
styles.href='https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@dev/css/global_header_footer.css' | ||
// Create a new script and use fallback js | ||
const script = document.createElement('script'); | ||
script.id = 'ukl-header-script'; | ||
script.type = 'module'; | ||
script.src = 'https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@dev/js/universalheader.js'; | ||
script.dataset.base_path = this_script.dataset.base_path; | ||
document.head.appendChild(script); | ||
// Remove footer script and footer | ||
const old_footer=document.querySelector('#ukl-footer'); | ||
if (old_footer) old_footer.remove(); | ||
const old_footer_script=document.querySelector('#ukl-footer-script'); | ||
if (old_footer_script) old_footer_script.remove(); | ||
// Create a new footer script and use fallback js | ||
const footer_script = document.createElement('script'); | ||
footer_script.src='https://cdn.jsdelivr.net/gh/uklibraries/UKL_HeaderFooter@dev/js/combofootershared.js'; | ||
document.body.appendChild(footer_script); | ||
if (this_script) this_script.remove(); | ||
})(); | ||
" | ||
></script> | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
export default { | ||
DangerTitleText: "0 - UK ALERT - DELAYED OPENING", | ||
DangerMsgText: | ||
danger_title_text: "0 - UK ALERT - DELAYED OPENING", | ||
danger_msg_text: | ||
"URGENT: University of Kentucky campus operations on a 2-hour delay. All library facilities will open at 10 am, today, Friday, Jan 19.", | ||
DangerMsgToggle: "off", | ||
DangerMsgBackground: "#c12c2b", | ||
DangerMsgColor: "#fff", | ||
DangerLinkColor: "#fff", | ||
WarningTitleText: "0 - UK ALERT - EARLY CANCELLATION", | ||
WarningMsgText: | ||
danger_msg_toggle: "off", | ||
danger_msg_background: "#c12c2b", | ||
danger_msg_color: "#fff", | ||
danger_link_color: "#fff", | ||
warning_title_text: "0 - UK ALERT - EARLY CANCELLATION", | ||
warning_msg_text: | ||
"We are currently experiencing technical difficulties with some online databases. We are working to resolve this issue as soon as possible. Thank you for your patience. ", | ||
WarningMsgToggle: "on", | ||
WarningMsgBackground: "#FFDC00", | ||
WarningMsgColor: "#000", | ||
WarningLinkColor: "#0033A0", | ||
AnnouncementTitleText: "0 - UK ALERT - EARLY CANCELLATION", | ||
AnnouncementMsgText: | ||
warning_msg_toggle: "on", | ||
warning_msg_background: "#FFDC00", | ||
warning_msg_color: "#000", | ||
warning_link_color: "#0033A0", | ||
announcement_title_text: "0 - UK ALERT - EARLY CANCELLATION", | ||
announcement_msg_text: | ||
"We are currently experiencing technical difficulties with some online databases. We are working to resolve this issue as soon as possible. Thank you for your patience. ", | ||
AnnouncementMsgToggle: "off", | ||
AnnouncementMsgBackground: "#a1d3ed", | ||
AnnouncementMsgColor: "#000", | ||
AnnouncementLinkColor: "#0033A0", | ||
SurveyTitleText: "Help us improve library services, spaces, and collections!", | ||
SurveyMsgText: "Take the ", | ||
SurveyMsgLinkLabel: "LibQUAL+ survey", | ||
SurveyMsgLinkURL: "https://www.libqual.org/survey/RWSLDQ72YU886X8HRA", | ||
SurveyMsgToggle: "on", | ||
SurveyMsgBackground: "#4CBCC0", | ||
SurveyMsgColor: "#0033a0", | ||
announcement_msg_toggle: "off", | ||
announcement_msg_background: "#a1d3ed", | ||
announcement_msg_color: "#000", | ||
announcement_link_color: "#0033A0", | ||
survey_title_text: "Help us improve library services, spaces, and collections!", | ||
survey_msg_text: "Take the ", | ||
survey_msg_link_label: "LibQUAL+ survey", | ||
survey_msg_link_url: "https://www.libqual.org/survey/RWSLDQ72YU886X8HRA", | ||
survey_msg_toggle: "on", | ||
survey_msg_background: "#4CBCC0", | ||
survey_msg_color: "#0033a0", | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.