master
kek7198 2021-12-10 18:44:40 -06:00
parent 81aef872fb
commit c521c8fd75
1 changed files with 2 additions and 35 deletions

View File

@ -693,42 +693,9 @@
{% include "/submission/SubmissionAwards.html" %}
{% if v %}
<script defer src="/assets/js/vote.js?v=1"></script>
{% if not p.comment_count %}
<script defer src="/assets/js/comments_v.js?v=74"></script>
{% endif %}
{% endif %}
<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 %}