Software /
code /
prosody-modules
Comparison
mod_http_muc_log/static/timestamps.js @ 5104:d4b0a995e5e3
mod_http_muc_log: Move CSS and JS out of template
This allows applying different cache and security policies to the static
resources, while reducing the size of all pages.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 04 Dec 2022 22:10:07 +0100 |
parent | 4990:mod_http_muc_log/res/http_muc_log.html@d55b10878e43 |
child | 5106:630887a50a7d |
comparison
equal
deleted
inserted
replaced
5103:4fb922aa0ace | 5104:d4b0a995e5e3 |
---|---|
1 /* | |
2 * Local timestamps | |
3 */ | |
4 (function () { | |
5 var timeTags = document.getElementsByTagName("time"); | |
6 var i = 0, tag, date; | |
7 while(timeTags[i]) { | |
8 tag = timeTags[i++]; | |
9 if(date = tag.getAttribute("datetime")) { | |
10 date = new Date(date); | |
11 tag.textContent = date.toLocaleTimeString(navigator.language); | |
12 tag.setAttribute("title", date.toString()); | |
13 } | |
14 } | |
15 document.forms[0].elements.p.addEventListener("change", function() { | |
16 document.forms[0].submit(); | |
17 }); | |
18 })(); | |
19 |