fdsfds
This commit is contained in:
parent
cd749ad88f
commit
68dfecdb35
2 changed files with 18 additions and 20 deletions
|
@ -815,7 +815,6 @@
|
||||||
{% include "expanded_image_modal.html" %}
|
{% include "expanded_image_modal.html" %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("load",function(event) {
|
|
||||||
function poll_vote(cid, parentid) {
|
function poll_vote(cid, parentid) {
|
||||||
{% if v %}
|
{% if v %}
|
||||||
for(let el of document.getElementsByClassName('presult-'+parentid)) {
|
for(let el of document.getElementsByClassName('presult-'+parentid)) {
|
||||||
|
@ -837,6 +836,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.addEventListener("load",function(event) {
|
||||||
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) {
|
||||||
|
|
|
@ -875,25 +875,23 @@
|
||||||
|
|
||||||
{% if not p.comment_count %}
|
{% if not p.comment_count %}
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("load",function(event) {
|
function poll_vote(cid) {
|
||||||
function poll_vote(cid) {
|
{% if v %}
|
||||||
{% if v %}
|
for(let el of document.getElementsByClassName('presult')) {
|
||||||
for(let el of document.getElementsByClassName('presult')) {
|
el.classList.remove('d-none');
|
||||||
el.classList.remove('d-none');
|
}
|
||||||
}
|
var type = document.getElementById(cid).checked;
|
||||||
var type = document.getElementById(cid).checked;
|
var scoretext = document.getElementById('poll-' + cid);
|
||||||
var scoretext = document.getElementById('poll-' + cid);
|
var score = Number(scoretext.textContent);
|
||||||
var score = Number(scoretext.textContent);
|
if (type == true) scoretext.textContent = score + 1;
|
||||||
if (type == true) scoretext.textContent = score + 1;
|
else scoretext.textContent = score - 1;
|
||||||
else scoretext.textContent = score - 1;
|
post('/vote/poll/' + cid + '?vote=' + type);
|
||||||
post('/vote/poll/' + cid + '?vote=' + type);
|
{% else %}
|
||||||
{% else %}
|
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
myToast.show();
|
||||||
myToast.show();
|
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
|
||||||
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
|
{% endif %}
|
||||||
{% endif %}
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue