changed office hours banner to use ical#1221
Conversation
… disable mkdocs2 warning
|
Test deployment successful!! (2026-04-08T03:20:51Z) See all deployed demo sites |
|
STRAIGHT TO PROD! |
There was a problem hiding this comment.
Code Review
Avast! Ye've overhauled the office hours page by ditchin' the Google iframe for a dynamic ICAL-based table, while also battlin' the winds of change by pinnin' MkDocs and updatin' yer dependencies. But yer navigation is off, ye scallywag! Ye've loaded yer scripts in the wrong order in mkdocs.yml, leavin' general.js to search for ICAL in a fog. Furthermore, ye've got scripts firin' before the page is ready, a reliance on global variables that'll lead to mutiny, and a 'Add to Calendar' link so broken it couldn't find its way out of a bathtub. Even yer CSS is bloated with redundant padding. Clean up this mess or prepare to walk the plank!
| - https://status.nesi.org.nz/embed/script.js | ||
| - assets/javascripts/mathjax.js | ||
| - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js | ||
| - https://cdnjs.cloudflare.com/ajax/libs/ical.js/1.3.0/ical.min.js |
There was a problem hiding this comment.
Arrr! Ye've put the cart before the horse, ye scurvy dog! Ye be callin' upon the ICAL spirits in general.js, but ye don't invite 'em onto the ship until the very end of the extra_javascript list. Swap the order so ical.min.js is aboard before general.js tries to use it, or yer banner will be lost in the fog!
| return new Date(dateStringFormatted); | ||
| } | ||
|
|
||
| showOfficeBanner(); |
There was a problem hiding this comment.
Arrr! Ye be firin' the cannons before the ship is even in the water! Callin' showOfficeBanner() immediately is risky business. Better to wait for the load event like ye did in the other scroll, or ye might find the ICAL library hasn't even boarded yet.
| showOfficeBanner(); | |
| window.addEventListener("load", showOfficeBanner); |
| title: summary, | ||
| start, | ||
| description, | ||
| meetingLink: urlMatch ? urlMatch[1] : MEETING_LINK, |
| <tr> | ||
| <td>${event.day}, ${event.date}</td> | ||
| <td>${event.time}</td> | ||
| <td><a href=" webcal://assets/training_calendar.ics" download class="md-button md-button--addcal"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80Zm-480-80q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h40v-80h80v80h240v-80h80v80h40q33 0 56.5 23.5T760-720v244q-20-3-40-3t-40 3v-84H200v320h280q0 20 3 40t11 40H200Zm0-480h480v-80H200v80Zm0 0v-80 80Z"/></svg>Add to Calendar</a></td> |
There was a problem hiding this comment.
Arrr! That link be a mess, ye barnacle-brained lubber! Ye've got a leadin' space, a webcal:// protocol with a relative path, and a download attribute all fightin' for control. If ye want 'em to download the scroll, use a proper path like /assets/training_calendar.ics. If ye want 'em to subscribe, ye need the full coordinates (URL). Fix it before the crew mutinies!
| <td><a href=" webcal://assets/training_calendar.ics" download class="md-button md-button--addcal"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80Zm-480-80q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h40v-80h80v80h240v-80h80v80h40q33 0 56.5 23.5T760-720v244q-20-3-40-3t-40 3v-84H200v320h280q0 20 3 40t11 40H200Zm0-480h480v-80H200v80Zm0 0v-80 80Z"/></svg>Add to Calendar</a></td> | |
| <td><a href="/assets/training_calendar.ics" download class="md-button md-button--addcal"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80Zm-480-80q-33 0-56.5-23.5T120-240v-480q0-33 23.5-56.5T200-800h40v-80h80v80h240v-80h80v80h40q33 0 56.5 23.5T760-720v244q-20-3-40-3t-40 3v-84H200v320h280q0 20 3 40t11 40H200Zm0-480h480v-80H200v80Zm0 0v-80 80Z"/></svg>Add to Calendar</a></td> |
| padding: 0.1em; | ||
| margin: auto; | ||
| font-size: medium; | ||
| padding: 0.5em; |
There was a problem hiding this comment.
Ye be paintin' the hull twice! Why set the padding to 0.1em only to slap 0.5em over it a few lines later? It's a waste of good ink and makes ye look like a fresh-faced cabin boy. Clean up yer redundant styles!
| padding: 0.1em; | |
| margin: auto; | |
| font-size: medium; | |
| padding: 0.5em; | |
| margin: auto; | |
| font-size: medium; | |
| padding: 0.5em; |
. replace ms embed with table.… disable mkdocs2 warning