diff options
author | Sacha Chua <sacha@sachachua.com> | 2023-09-22 17:57:37 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2023-09-22 17:57:37 -0400 |
commit | 3ebd0fbcc8511bf682b9f4ba36e168035a5c0bed (patch) | |
tree | 4efee5e7309f6167d8fc5ffa43cd6eb1fc753864 /templates | |
parent | 7f7936e805a01807ada346c3d5e519fad3bc4693 (diff) | |
download | emacsconf-wiki-3ebd0fbcc8511bf682b9f4ba36e168035a5c0bed.tar.xz emacsconf-wiki-3ebd0fbcc8511bf682b9f4ba36e168035a5c0bed.zip |
add devel
Diffstat (limited to 'templates')
-rw-r--r-- | templates/page.tmpl | 26 | ||||
-rw-r--r-- | templates/time.md | 1 |
2 files changed, 19 insertions, 8 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl index 7cf2eb50..b3600e2c 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -307,18 +307,28 @@ Last edited <TMPL_VAR MTIME> document.querySelector('.times').querySelector('.others').style.display = 'none'; } } + if (document.querySelector('.time-overlay')) { + document.querySelectorAll('.time-overlay').forEach(function (o) { + if (o.getAttribute('title')) return; + var dateOptions = {dateStyle: 'short', timeStyle: 'short'}; + 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]')) { var transcriptLink = document.createElement('a'); transcriptLink.setAttribute('href', '#transcript'); transcriptLink.textContent = 'View transcript'; -var video = document.querySelector('.mainVideo video'); -if (video) { - var resources = document.querySelector('.mainVideo video').closest('.vid').querySelector('.resources'); - var transcriptDiv = document.createElement('div'); -transcriptDiv.appendChild(transcriptLink) - if (resources) { resources.prepend(transcriptDiv); } - } -} + var video = document.querySelector('.mainVideo video'); + if (video) { + var resources = document.querySelector('.mainVideo video').closest('.vid').querySelector('.resources'); + var transcriptDiv = document.createElement('div'); + transcriptDiv.appendChild(transcriptLink) + if (resources) { resources.prepend(transcriptDiv); } + } + } var chat = document.querySelector('.chat-iframe'); if (chat) { if (chat.getAttribute('data-track')) { diff --git a/templates/time.md b/templates/time.md new file mode 100644 index 00000000..b3f3c90e --- /dev/null +++ b/templates/time.md @@ -0,0 +1 @@ +<span class="time-overlay" data-start="<TMPL_VAR startutc>" data-end="<TMPL_VAR endutc>"><TMPL_VAR time></span> |