forked from rDrama/rDrama
fix
parent
c521c8fd75
commit
faf99c492a
|
@ -698,4 +698,37 @@
|
||||||
<script defer src="/assets/js/comments_v.js?v=74"></script>
|
<script defer src="/assets/js/comments_v.js?v=74"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% 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 %}
|
{% endblock %}
|
Loading…
Reference in New Issue