Skip to content

Commit

Permalink
fix read post
Browse files Browse the repository at this point in the history
  • Loading branch information
rystaf committed Apr 28, 2024
1 parent 88aff9c commit 410e151
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions public/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function request(url, params, callback, errorcallback = function(){}) {
if (xmlHttp.status == 200) {
return callback(xmlHttp.responseText);
}
if (errorcallback) errorcallback(xmlHttp.responseText);
errorcallback(xmlHttp.responseText);
}
var method = "GET"
if (params) method = "POST"
Expand Down Expand Up @@ -33,7 +33,12 @@ function postClick(e) {
var url = targ.getElementsByClassName("url")[0].href
if (bdy.querySelector("img.image") && localStorage.getItem("markRead") == "true") {
bdy.parentNode.querySelector(".title").className = "title visited"
request(bdy.parentNode.querySelector('.buttons a').href, { op: "read_post", submit: "mark read"})
var data = new FormData();
data.append("op", "read_post")
data.append("submit", "mark read")
data.append("xhr", "1")
data.append("postid", bdy.parentNode.parentNode.id.slice(1))
request("", data)
}
if (id = parseYoutube(url)) {
targ.getElementsByClassName("embed")[0].innerHTML = youtubeIframe(id)
Expand Down

0 comments on commit 410e151

Please sign in to comment.