From 3b2c8a4c78ade9e819b61aa055039ae00e517a3e Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Thu, 22 Jul 2021 13:50:11 -0700 Subject: fixed quote bug and moved comment parsing server side without javascript --- static/posts.html | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'static/posts.html') diff --git a/static/posts.html b/static/posts.html index d16f780..7552188 100644 --- a/static/posts.html +++ b/static/posts.html @@ -7,7 +7,7 @@
{{ end }}
-
+
{{ if eq $board.ModCred $board.Domain $board.Actor.Id }} [Delete Post] {{ end }} @@ -22,7 +22,6 @@
{{ end }} - {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} -

{{.Content}}

+ {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} +

{{.ContentHTML}}

{{ if .Replies }} {{ $replies := .Replies }} {{ if gt $replies.TotalItems 5 }} @@ -94,7 +93,7 @@ {{ end }} {{ end }} {{ range $replies.OrderedItems }} -
+
>>
@@ -176,7 +175,7 @@ } {{ end }} - {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} + {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} {{ $parentId := .Id }} {{ if .Replies.OrderedItems }} {{ range .Replies.OrderedItems }} @@ -187,7 +186,7 @@ {{ end }} {{ end }} -

{{.Content}}

+

{{.ContentHTML}}

@@ -196,17 +195,6 @@ document.getElementById("{{ .Id }}-size").innerText = " (" + convertSize({{ (index .Attachment 0).Size }}) + ")"; document.getElementById("{{ .Id }}-img").innerText = shortImg("{{ (index .Attachment 0).Name }}"); {{ end }} - - document.getElementById("{{ .Id }}-link").innerText = shortURL("{{ $board.Actor.Id }}", "{{ .Id }}"); - - document.getElementById("{{ .Id }}-anchor").href = "/{{ $board.Name }}/" + shortURL("{{$board.Actor.Id}}", "{{ $opId }}") + - "#" + shortURL("{{$board.Actor.Id}}", "{{ .Id }}"); - document.getElementById("{{ .Id }}").setAttribute("id", shortURL("{{$board.Actor.Id}}", "{{ .Id }}")); - - var content = document.getElementById("{{ .Id }}-content"); - - content.innerHTML = convertContent('{{$board.Actor.Id}}', content.innerText, '{{ $opId }}') - {{ end }} {{ end }} @@ -217,17 +205,6 @@ document.getElementById("{{ .Id }}-size").innerText = " (" + convertSize({{ (index .Attachment 0).Size }}) + ")"; document.getElementById("{{ .Id }}-img").innerText = shortImg("{{ (index .Attachment 0).Name }}"); {{ end }} - - document.getElementById("{{ .Id }}-link").innerText = shortURL("{{ $board.Actor.Id }}", "{{ .Id }}"); - - document.getElementById("{{ .Id }}").setAttribute("id", shortURL("{{ $board.Actor.Id }}", "{{ .Id }}")); - - document.getElementById("{{ .Id }}-anchor").href = "/{{ $board.Name }}/" + shortURL("{{$board.Actor.Id}}", "{{ $opId }}") + - "#" + shortURL("{{$board.Actor.Id}}", "{{ .Id }}"); - - var content = document.getElementById("{{ .Id }}-content"); - - content.innerHTML = convertContent('{{$board.Actor.Id}}', content.innerText, '{{ $opId }}') {{ end }} {{ end }} -- cgit v1.2.3 From fa895350a8bdf2eb93495dbf569fa3fe0680d2af Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Thu, 22 Jul 2021 15:14:14 -0700 Subject: removed media javascript parsing it on server --- static/posts.html | 86 ++----------------------------------------------------- 1 file changed, 3 insertions(+), 83 deletions(-) (limited to 'static/posts.html') diff --git a/static/posts.html b/static/posts.html index 7552188..b638a10 100644 --- a/static/posts.html +++ b/static/posts.html @@ -19,7 +19,7 @@ File: {{ (index .Attachment 0).Name }}({{ (index .Attachment 0).Size }}) -
+
{{ parseAttachment . false }}
{{ end }} {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} @@ -109,7 +70,7 @@
-
+
{{ parseAttachment . false }}
{{ end }} {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} -- cgit v1.2.3 From 16b4165e5102fc9b4766e1bd1204ca9cf23199aa Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Thu, 22 Jul 2021 19:03:28 -0700 Subject: added banning media by saving hash in database --- static/posts.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'static/posts.html') diff --git a/static/posts.html b/static/posts.html index b638a10..d7f46b9 100644 --- a/static/posts.html +++ b/static/posts.html @@ -12,7 +12,8 @@ [Delete Post] {{ end }} {{ if .Attachment }} - {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + [Ban Media] [Delete Attachment] [Mark Sensitive] {{ end }} @@ -41,7 +42,6 @@ sensitive.style = "display: block" media.style = "display: none;" } - {{ end }} {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }} {{ .TripCode }} {{ .Published }} No. {{ short $board.Actor.Outbox .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} @@ -62,9 +62,10 @@ [Delete Post] {{ end }} {{ if .Attachment }} - {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} + [Ban Media] [Delete Attachment] - [Mark Sensitive] + [Mark Sensitive] {{ end }} File {{ (index .Attachment 0).Name }} ({{ (index .Attachment 0).Size }}) -- cgit v1.2.3 From 8f7386f2906716d40099fb50f029d48796dd1bbd Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Fri, 23 Jul 2021 22:45:44 -0700 Subject: added cross post support. could blow up if referencing a link that is not local to the database or cache. --- static/posts.html | 4 ---- 1 file changed, 4 deletions(-) (limited to 'static/posts.html') diff --git a/static/posts.html b/static/posts.html index d7f46b9..5810348 100644 --- a/static/posts.html +++ b/static/posts.html @@ -101,10 +101,6 @@ {{ if .Replies.OrderedItems }} {{ range .Replies.OrderedItems }} - {{ end }} {{ end }}

{{.ContentHTML}}

-- cgit v1.2.3 From 6846150cb48d080112981633d6dddabef5ce4439 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 25 Jul 2021 16:00:25 -0700 Subject: fixed bug with escaping html less than symbol for parsing content --- static/posts.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'static/posts.html') diff --git a/static/posts.html b/static/posts.html index 5810348..17421af 100644 --- a/static/posts.html +++ b/static/posts.html @@ -54,7 +54,7 @@ {{ end }} {{ end }} {{ range $replies.OrderedItems }} -
+
>>
-- cgit v1.2.3 From 87fc54c9d41bdbe7eaa8769386776a3723580b34 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 25 Jul 2021 17:35:41 -0700 Subject: showing post replies bug fix --- static/posts.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'static/posts.html') diff --git a/static/posts.html b/static/posts.html index 17421af..67a755c 100644 --- a/static/posts.html +++ b/static/posts.html @@ -54,7 +54,7 @@ {{ end }} {{ end }} {{ range $replies.OrderedItems }} -
+
>>
@@ -100,7 +100,7 @@ {{ $parentId := .Id }} {{ if .Replies.OrderedItems }} {{ range .Replies.OrderedItems }} - + {{ parseReplyLink $board.Actor.Id $opId .Id .Content }} {{ end }} {{ end }}

{{.ContentHTML}}

-- cgit v1.2.3