view comment functionality

pull/42/head
Zlatin Balevsky 2020-03-13 03:54:30 +00:00
parent 488f2964ee
commit b339784826
1 changed files with 25 additions and 0 deletions

View File

@ -244,6 +244,31 @@ function configure(b64) {
// TODO: implement
}
function showComment(infoHash) {
expandedComments.set(infoHash, true)
var commentText = itemsByInfoHash.get(infoHash).comment
var commentDiv = document.getElementById("comment-" + infoHash);
var comment = "<pre class='comment'>"+ commentText + "</pre>";
commentDiv.innerHTML = comment
var hideLink = new Link(_t("Hide Comment"), "hideComment", [infoHash])
var linkSpan = document.getElementById("comment-link-" + infoHash)
linkSpan.innerHTML = hideLink.render()
}
function hideComment(infoHash) {
expandedComments.delete(infoHash)
var commentDiv = document.getElementById("comment-" + infoHash);
commentDiv.innerHTML = ""
var showLink = new Link(_t("Show Comment"), "showComment", [infoHash])
var linkSpan = document.getElementById("comment-link-" + infoHash);
linkSpan.innerHTML = showLink.render();
}
function showCertificates(hostB64, infoHash) {
var fetch = new CertificateFetch(hostB64, infoHash)
certificateFetches.set(fetch.divId, fetch)