fix
parent
d22735b28a
commit
61732562a4
|
@ -346,34 +346,5 @@
|
|||
|
||||
<script defer src="/assets/js/new_comments_count.js?v=53"></script>
|
||||
|
||||
<script defer>
|
||||
(() => {
|
||||
const date = new Date({{p.created_utc*1000}});
|
||||
document.getElementById('timestamp').title = date.toString();
|
||||
{% if p.edited_utc %}
|
||||
const dateEdited = new Date({{p.edited_utc*1000}});
|
||||
document.getElementById('edited_timestamp').title = dateEdited.toString();
|
||||
{% endif %}
|
||||
|
||||
{% if (not v or v.highlightcomments) %}
|
||||
showNewCommentCounts('{{p.id}}', {{p.comment_count}})
|
||||
{% endif %}
|
||||
|
||||
{% if "?context" not in request.full_path %}
|
||||
const comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
|
||||
const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || { c: 0 }).c + 1)
|
||||
comments['{{p.id}}'] = { c: newTotal, t: Date.now() }
|
||||
window.localStorage.setItem("comment-counts", JSON.stringify(comments))
|
||||
{% endif %}
|
||||
|
||||
{% if p.stickied %}
|
||||
const pinned_info = document.getElementById('pinned-{{p.id}}')
|
||||
{% if p.stickied.startswith('t:') %}
|
||||
pinned_info.setAttribute("data-bs-original-title", `Pinned until ${new Date({{p.stickied[2:]}} * 1000).toString()}`)
|
||||
{% else %}
|
||||
pinned_info.setAttribute("data-bs-original-title", "Pinned by @{{p.stickied}}")
|
||||
{%endif%}
|
||||
{%endif%}
|
||||
})()
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue