aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorWeedSmokingJew <59340248+KushBlazingJudah@users.noreply.github.com>2021-08-17 20:15:44 -0300
committerGitHub <noreply@github.com>2021-08-17 20:15:44 -0300
commit17e54854794dacac8409cd10ffb77005d74b8dbe (patch)
tree1ef3612a0063e3c8bc4293e5ba31dc50097f7c7e /client.go
parent21917eb2ea72fe40d70c2c991e821aace5430c23 (diff)
parent9552ec24b1631032acbf1efbe21479ff44b29a63 (diff)
Merge pull request #1 from KushBlazingJudah/darkmode
merge in darkmode
Diffstat (limited to 'client.go')
-rw-r--r--client.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/client.go b/client.go
index 85a327e..1be926a 100644
--- a/client.go
+++ b/client.go
@@ -216,7 +216,7 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co
"parseReplyLink": func(actorId string, op string, id string, content string) template.HTML {
actor := FingerActor(actorId)
title := strings.ReplaceAll(ParseLinkTitle(actor.Id, op, content), `/\&lt;`, ">")
- link := "<a href=\"" + actor.Name + "/" + shortURL(actor.Outbox, op) + "#" + shortURL(actor.Outbox, id) + "\" title=\"" + title + "\">&gt;&gt;" + shortURL(actor.Outbox, id) + "</a>"
+ link := "<a href=\"" + actor.Name + "/" + shortURL(actor.Outbox, op) + "#" + shortURL(actor.Outbox, id) + "\" title=\"" + title + "\" class=\"replyLink\">&gt;&gt;" + shortURL(actor.Outbox, id) + "</a>"
return template.HTML(link)
},
"add": func(i, j int) int {
@@ -403,7 +403,7 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB) {
"parseReplyLink": func(actorId string, op string, id string, content string) template.HTML {
actor := FingerActor(actorId)
title := strings.ReplaceAll(ParseLinkTitle(actor.Id, op, content), `/\&lt;`, ">")
- link := "<a href=\"" + actor.Name + "/" + shortURL(actor.Outbox, op) + "#" + shortURL(actor.Outbox, id) + "\" title=\"" + title + "\">&gt;&gt;" + shortURL(actor.Outbox, id) + "</a>"
+ link := "<a href=\"" + actor.Name + "/" + shortURL(actor.Outbox, op) + "#" + shortURL(actor.Outbox, id) + "\" title=\"" + title + "\" class=\"replyLink\">&gt;&gt;" + shortURL(actor.Outbox, id) + "</a>"
return template.HTML(link)
},
"sub": func(i, j int) int { return i - j }}).ParseFiles("./static/main.html", "./static/npost.html", "./static/top.html", "./static/bottom.html", "./static/posts.html"))
@@ -886,17 +886,12 @@ func ParseLinkComments(db *sql.DB, board Actor, op string, content string, threa
}
}
- var style string
- if board.Restricted {
- style = "color: #af0a0f;"
- }
-
//replace link with quote format
replyID, isReply := IsReplyToOP(db, op, parsedLink)
if isReply {
id := shortURL(board.Outbox, replyID)
- content = strings.Replace(content, match[i][0], "<a class=\"reply\" style=\""+style+"\" title=\""+quoteTitle+"\" href=\"/"+board.Name+"/"+shortURL(board.Outbox, op)+"#"+id+"\">&gt;&gt;"+id+""+isOP+"</a>", -1)
+ content = strings.Replace(content, match[i][0], "<a class=\"reply\" title=\""+quoteTitle+"\" href=\"/"+board.Name+"/"+shortURL(board.Outbox, op)+"#"+id+"\">&gt;&gt;"+id+""+isOP+"</a>", -1)
} else {
@@ -909,7 +904,7 @@ func ParseLinkComments(db *sql.DB, board Actor, op string, content string, threa
}
if actor.Id != "" {
- content = strings.Replace(content, match[i][0], "<a class=\"reply\" style=\""+style+"\" title=\""+quoteTitle+"\" href=\""+link+"\">&gt;&gt;"+shortURL(board.Outbox, parsedLink)+isOP+" →</a>", -1)
+ content = strings.Replace(content, match[i][0], "<a class=\"reply\" title=\""+quoteTitle+"\" href=\""+link+"\">&gt;&gt;"+shortURL(board.Outbox, parsedLink)+isOP+" →</a>", -1)
}
}
}