diff --git a/css/style.css b/css/style.css index 406f043a..5dd91a5c 100644 --- a/css/style.css +++ b/css/style.css @@ -16,7 +16,7 @@ nav#mainmenu { position: fixed; color: white; width: 100%; - z-index: 3; + z-index: 4; } nav#mainmenu a { @@ -72,6 +72,11 @@ a { white-space: nowrap; } +.table > tbody > tr > td { + /* fix bootstrap uglyness */ + vertical-align: middle; +} + div.container div.blockBody:nth-of-type(2) table{table-layout:fixed;} div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:first-of-type, div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(5){width:10%;} div.container div.blockBody:nth-of-type(2) table tr:first-of-type th:nth-of-type(3){width:15%;} diff --git a/js/main.js b/js/main.js index 04089014..2e9e87fa 100644 --- a/js/main.js +++ b/js/main.js @@ -22,12 +22,18 @@ var maxId = 5; for (var i = 0; i < maxId; i++) { var el = document.getElementById('page-' + i), n = prev + i; + if (el == null) + continue; el.href = pageString + n + query; el.innerHTML = n; } - document.getElementById('page-next').href = pageString + next + query; - document.getElementById('page-prev').href = pageString + prev + query; + var e = document.getElementById('page-next'); + if (e != null) + e.href = pageString + next + query; + var e = document.getElementById('page-prev'); + if (e != null) + e.href = pageString + prev + query; // Used by spoiler tags function toggleLayer(elem) { @@ -36,3 +42,33 @@ function toggleLayer(elem) { else elem.classList.add("hide"); } + +function formatDate(date) { // thanks stackoverflow + var monthNames = [ + "January", "February", "March", + "April", "May", "June", "July", + "August", "September", "October", + "November", "December" + ]; + + var day = date.getDate(); + var monthIndex = date.getMonth(); + var year = date.getFullYear(); + + return day + ' ' + monthNames[monthIndex] + ' ' + year; +} + +var list = document.getElementsByClassName("date-short"); +for(var i in list) { + var e = list[i]; + e.title = e.innerText; + e.innerText = formatDate(new Date(e.innerText)); +} + +var list = document.getElementsByClassName("date-full"); +for(var i in list) { + var e = list[i]; + e.title = e.innerText; + var date = new Date(e.innerText); + e.innerText = date.toDateString() + " " + date.toLocaleTimeString(); +} diff --git a/templates/home.html b/templates/home.html index ae84b500..a64d064c 100644 --- a/templates/home.html +++ b/templates/home.html @@ -31,7 +31,7 @@ {{.Name}} -