forked from rDrama/rDrama
fdsfds
parent
e7fa3cac06
commit
4135990c84
|
@ -16,13 +16,19 @@
|
||||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js"></script>
|
||||||
<script src="/assets/js/new_comments_count.js?v=1"></script>
|
<script src="/assets/js/new_comments_count.js?v=1"></script>
|
||||||
<script>
|
<script>
|
||||||
function poll_vote(cid) {
|
function poll_vote(cid) {
|
||||||
var type = document.getElementById(cid).checked;
|
{% if v %}
|
||||||
var scoretext = document.getElementById('poll-' + cid);
|
var type = document.getElementById(cid).checked;
|
||||||
var score = Number(scoretext.textContent);
|
var scoretext = document.getElementById('poll-' + cid);
|
||||||
if (type == true) scoretext.textContent = score + 1;
|
var score = Number(scoretext.textContent);
|
||||||
else scoretext.textContent = score - 1;
|
if (type == true) scoretext.textContent = score + 1;
|
||||||
post('/vote/poll/' + cid + '?vote=' + type);
|
else scoretext.textContent = score - 1;
|
||||||
|
post('/vote/poll/' + cid + '?vote=' + type);
|
||||||
|
{% else %}
|
||||||
|
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
|
||||||
|
myToast.show();
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Only logged-in users can vote!";
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue