From 4a52a1f3e32c7079f532868dfcc03c4787220cb1 Mon Sep 17 00:00:00 2001 From: akuma06 Date: Thu, 18 May 2017 02:49:48 +0200 Subject: [PATCH 1/2] Fix JS error + Seeding Mobile View https://my.mixtape.moe/cvmemz.png --- public/js/main.js | 11 +++++------ templates/view.html | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index baaa62a9..127fed56 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -34,13 +34,12 @@ for(var i in list) { e.innerText = new Date(e.innerText).toLocaleString(lang); } -var list = document.getElementsByClassName("date-comments"); -for(var i in list) { - var e = list[i]; - e.title = e.innerText; - e.innerText = new Date(e.title).toLocaleDateString(lang, { year: "numeric", month: "short", day: "numeric"}) + " "; - $(e).append($('').text(new Date(e.title).toLocaleTimeString(lang, { hour:"numeric", minute:"numeric" }))) +$(".date-comments").each(function(index, el) { + $(this).attr("title", el.innerText); + $(this).text(new Date($(this).attr("title")).toLocaleDateString(lang, { year: "numeric", month: "short", day: "numeric"}) + " "); + $(this).append($('').text(new Date($(this).attr("title")).toLocaleTimeString(lang, { hour:"numeric", minute:"numeric" }))) } +); /*Fixed-Navbar offset fix*/ window.onload = function() { var shiftWindow = function() { scrollBy(0, -70) }; diff --git a/templates/view.html b/templates/view.html index 8a7bf30f..57db5de9 100644 --- a/templates/view.html +++ b/templates/view.html @@ -70,11 +70,15 @@

{{.WebsiteLink}}


{{end}} +
+
{{T "seeders"}}
{{T "leechers"}}
{{T "completed"}}
+
+
{{if .LastScrape.IsZero}}
{{T "unknown"}}
@@ -82,9 +86,19 @@
{{.Seeders}}
{{.Leechers}}
{{.Completed}}
-
{{T "last_scraped"}}
-
{{ formatDateRFC .LastScrape }}
{{end}} +
+
+
+
+ {{if not .LastScrape.IsZero}} +
{{T "last_scraped"}}
+
{{ formatDateRFC .LastScrape }}
+ {{end}} +
+
+
+
From 54cd4f2217ab21896a107a73a37f137bed391bee Mon Sep 17 00:00:00 2001 From: akuma06 Date: Thu, 18 May 2017 02:51:53 +0200 Subject: [PATCH 2/2] Update main.js --- public/js/main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 127fed56..02643461 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -38,11 +38,10 @@ $(".date-comments").each(function(index, el) { $(this).attr("title", el.innerText); $(this).text(new Date($(this).attr("title")).toLocaleDateString(lang, { year: "numeric", month: "short", day: "numeric"}) + " "); $(this).append($('').text(new Date($(this).attr("title")).toLocaleTimeString(lang, { hour:"numeric", minute:"numeric" }))) -} -); +}); /*Fixed-Navbar offset fix*/ window.onload = function() { var shiftWindow = function() { scrollBy(0, -70) }; if (location.hash) shiftWindow(); window.addEventListener("hashchange", shiftWindow); -}; \ No newline at end of file +};