dsfsdf
parent
6e54b9dccf
commit
c000a05b48
|
@ -106,36 +106,6 @@
|
||||||
|
|
||||||
{% macro single_comment(c, level=1) %}
|
{% macro single_comment(c, level=1) %}
|
||||||
|
|
||||||
{% if p and not (v and v.id==c.author_id) and (not v or v.highlightcomments) %}
|
|
||||||
<script>
|
|
||||||
window.addEventListener("load",function(event) {
|
|
||||||
comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
|
|
||||||
lastCount = comments['{{p.id}}']
|
|
||||||
if (lastCount && {{c.created_utc*1000}} > lastCount.t) {
|
|
||||||
document.getElementById("reddot-{{c.id}}").innerHTML = '<i style="color:red !important" class="text-admin fas fa-circle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Unread"></i>'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<script>
|
|
||||||
window.addEventListener("load",function(event) {
|
|
||||||
(() => {
|
|
||||||
const date = new Date({{c.created_utc*1000}});
|
|
||||||
document.getElementById('timestamp-{{c.id}}').title = date.toString();
|
|
||||||
|
|
||||||
{% if c.is_pinned %}
|
|
||||||
const pinned_info = document.getElementById('pinned-{{c.id}}')
|
|
||||||
{% if c.is_pinned.startswith('t:') %}
|
|
||||||
pinned_info.setAttribute("data-bs-original-title", `Pinned until ${new Date({{c.is_pinned[2:]}} * 1000).toString()}`)
|
|
||||||
{% else %}
|
|
||||||
pinned_info.setAttribute("data-bs-original-title", "Pinned by @{{c.is_pinned}}")
|
|
||||||
{%endif%}
|
|
||||||
{%endif%}
|
|
||||||
})()
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div style="display:none" id="popover-{{c.id}}">
|
<div style="display:none" id="popover-{{c.id}}">
|
||||||
<div class="popover-user-profile" role="tooltip">
|
<div class="popover-user-profile" role="tooltip">
|
||||||
<img class="w-100 h-64 object-cover" src="{{c.author.banner_url}}">
|
<img class="w-100 h-64 object-cover" src="{{c.author.banner_url}}">
|
||||||
|
@ -872,6 +842,10 @@
|
||||||
<script defer src="/assets/js/comments_admin.js?v=54"></script>
|
<script defer src="/assets/js/comments_admin.js?v=54"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% include "expanded_image_modal.html" %}
|
||||||
|
|
||||||
|
<script defer src="/assets/js/popover.js?v=9"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function collapse_comment(comment_id) {
|
function collapse_comment(comment_id) {
|
||||||
const comment = "comment-" + comment_id
|
const comment = "comment-" + comment_id
|
||||||
|
@ -890,33 +864,59 @@
|
||||||
var myToast = new bootstrap.Toast(document.getElementById('toast-success'));
|
var myToast = new bootstrap.Toast(document.getElementById('toast-success'));
|
||||||
myToast.show();
|
myToast.show();
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
|
||||||
{% include "expanded_image_modal.html" %}
|
function poll_vote(cid, parentid) {
|
||||||
|
{% if v %}
|
||||||
<script>
|
for(let el of document.getElementsByClassName('presult-'+parentid)) {
|
||||||
function poll_vote(cid, parentid) {
|
el.classList.remove('d-none');
|
||||||
{% if v %}
|
}
|
||||||
for(let el of document.getElementsByClassName('presult-'+parentid)) {
|
for(let el of document.getElementsByClassName('presult')) {
|
||||||
el.classList.remove('d-none');
|
el.classList.remove('d-none');
|
||||||
}
|
}
|
||||||
for(let el of document.getElementsByClassName('presult')) {
|
var type = document.getElementById(cid).checked;
|
||||||
el.classList.remove('d-none');
|
var scoretext = document.getElementById('poll-' + cid);
|
||||||
}
|
var score = Number(scoretext.textContent);
|
||||||
var type = document.getElementById(cid).checked;
|
if (type == true) scoretext.textContent = score + 1;
|
||||||
var scoretext = document.getElementById('poll-' + cid);
|
else scoretext.textContent = score - 1;
|
||||||
var score = Number(scoretext.textContent);
|
post('/vote/poll/' + cid + '?vote=' + type);
|
||||||
if (type == true) scoretext.textContent = score + 1;
|
{% else %}
|
||||||
else scoretext.textContent = score - 1;
|
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||||
post('/vote/poll/' + cid + '?vote=' + type);
|
myToast.show();
|
||||||
{% else %}
|
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
|
||||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
{% endif %}
|
||||||
myToast.show();
|
}
|
||||||
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
|
|
||||||
{% endif %}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("load",function(event) {
|
window.addEventListener("load",function(event) {
|
||||||
|
{% if p and (not v or v.highlightcomments) %}
|
||||||
|
comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
|
||||||
|
lastCount = comments['{{p.id}}']
|
||||||
|
redhtml = '<i style="color:red !important" class="text-admin fas fa-circle" data-bs-toggle="tooltip" data-bs-placement="bottom" title="" data-bs-original-title="Unread"></i>'
|
||||||
|
if (lastCount)
|
||||||
|
{
|
||||||
|
{% for c in comments %}
|
||||||
|
{% if not (v and v.id==c.author_id) %}
|
||||||
|
if ({{c.created_utc*1000}} > lastCount.t) document.getElementById("reddot-{{c.id}}").innerHTML = redhtml
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
(() => {
|
||||||
|
{% for c in comments %}
|
||||||
|
date = new Date({{c.created_utc*1000}});
|
||||||
|
document.getElementById('timestamp-{{c.id}}').title = date.toString();
|
||||||
|
|
||||||
|
{% if c.is_pinned %}
|
||||||
|
const pinned_info = document.getElementById('pinned-{{c.id}}')
|
||||||
|
{% if c.is_pinned.startswith('t:') %}
|
||||||
|
pinned_info.setAttribute("data-bs-original-title", `Pinned until ${new Date({{c.is_pinned[2:]}} * 1000).toString()}`)
|
||||||
|
{% else %}
|
||||||
|
pinned_info.setAttribute("data-bs-original-title", "Pinned by @{{c.is_pinned}}")
|
||||||
|
{%endif%}
|
||||||
|
{%endif%}
|
||||||
|
{% endfor %}
|
||||||
|
})()
|
||||||
|
|
||||||
const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
|
const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
|
||||||
|
|
||||||
const popoverList = popoverTriggerList.map(function(popoverTriggerEl) {
|
const popoverList = popoverTriggerList.map(function(popoverTriggerEl) {
|
||||||
|
@ -930,6 +930,4 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script defer src="/assets/js/popover.js?v=9"></script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
Loading…
Reference in New Issue