From 3d480edaef645b91ee8d00733dccc59f7296df28 Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Thu, 28 Jan 2021 13:53:56 -0800 Subject: reporting requires captcha --- static/bottom.html | 25 +++++++++++++++++++++++-- static/js/posts.js | 24 ++++++++++++++++++++++++ static/main.html | 2 +- static/posts.html | 4 ++-- 4 files changed, 50 insertions(+), 5 deletions(-) (limited to 'static') diff --git a/static/bottom.html b/static/bottom.html index 0542c41..25339b5 100644 --- a/static/bottom.html +++ b/static/bottom.html @@ -1,10 +1,10 @@ {{ define "bottom" }} -
+ + {{ end }} diff --git a/static/js/posts.js b/static/js/posts.js index a6963de..805c1c1 100644 --- a/static/js/posts.js +++ b/static/js/posts.js @@ -149,6 +149,12 @@ function closeReply() document.getElementById("reply-comment").value = ""; } +function closeReport() +{ + document.getElementById("report-box").style.display = "none"; + document.getElementById("report-comment").value = ""; +} + function previous(actorName, page) { @@ -192,6 +198,24 @@ function quote(actorName, opid, id) dragElement(header); +} + +function report(actorName, id) +{ + var box = document.getElementById("report-box"); + var header = document.getElementById("report-header"); + var comment = document.getElementById("report-comment"); + var inReplyTo = document.getElementById("report-inReplyTo-box"); + + var w = window.innerWidth / 2 - 200; + var h = document.getElementById(id + "-content").offsetTop - 448; + + box.setAttribute("style", "display: block; position: absolute; width: 400px; height: 480px; z-index: 9; top: " + h + "px; left: " + w + "px; padding: 5px;"); + + header.innerText = "Report Post No. " + shortURL(actorName, id); + inReplyTo.value = id; + + dragElement(header); } function dragElement(elmnt) { diff --git a/static/main.html b/static/main.html index 180e91f..fc3d5ed 100644 --- a/static/main.html +++ b/static/main.html @@ -27,7 +27,7 @@ {{ end }} } - #reply-box { + .popup-box { {{ if .Board.Restricted }} border: 4px solid #d3caf0; background-color: #eff5ff; diff --git a/static/posts.html b/static/posts.html index 9e3e8ce..a7b18a9 100644 --- a/static/posts.html +++ b/static/posts.html @@ -60,7 +60,7 @@ } {{ end }} - {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }}{{ .Published }} No. {{ .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} + {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }}{{ .Published }} No. {{ .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }}{{.Content}}
{{ if .Replies }} {{ $replies := .Replies }} @@ -124,7 +124,7 @@ } {{ end }} - {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }}{{ .Published }} No. {{ .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} + {{ .Name }}{{ if .AttributedTo }} {{.AttributedTo }} {{ else }} Anonymous {{ end }}{{ .Published }} No. {{ .Id }} {{ if ne .Type "Tombstone" }}[Report]{{ end }} {{ $parentId := .Id }} {{ if .Replies.OrderedItems }} {{ range .Replies.OrderedItems }} -- cgit v1.2.3