summaryrefslogtreecommitdiffstats
path: root/templates/page.tmpl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/page.tmpl21
1 files changed, 20 insertions, 1 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl
index b3600e2c..ba832af6 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -314,7 +314,7 @@ Last edited <TMPL_VAR MTIME>
var localStart = (new Date(o.getAttribute('start'))).toLocaleString([], dateOptions);
var localEnd = (new Date(o.getAttribute('end'))).toLocaleString([], dateOptions);
o.setAttribute('title', 'Your local time: ~ ' + localStart + ' to ~ ' + localEnd);
- }
+ });
}
if (document.querySelector('a[name=transcript]')) {
@@ -419,6 +419,25 @@ if (video) {
}
// @license-end
+ // @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt txt CC0-1.0
+ // Copyright (c) 2023 Sacha Chua - CC0 Public Domain
+ function highlightTalks() {
+ // highlight any talk mentioned in the highlight URL parameter
+ var params = new URLSearchParams(window.location.search);
+ if (!params.get('highlight')) return;
+ var talks = params.get('highlight').split(',').filter(function(o) { return o.match(/^[-a-z0-9]+$/); });
+ var regexp = new RegExp('/talks/(' + talks.join('|') + ')/?$');
+ document.querySelectorAll('a[href]').forEach(function(link) {
+ console.debug(link.getAttribute('href'), link.getAttribute('href').match(regexp));
+ if (link.getAttribute('href').match(regexp)) {
+ console.debug(link);
+ link.classList.add('highlight');
+ }
+ });
+ }
+
+ addEventListener('DOMContentLoaded', highlightTalks);
+ // @license-end
</script>
</body>
</html>