fix for joan

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-10-14 20:41:03 +02:00
parent f59263c42d
commit c49ae42205
4 changed files with 34 additions and 27 deletions

View File

@ -39,28 +39,3 @@ if (typeof showNewCommentCounts === 'undefined') {
setTimeout(cleanCache, 500)
}
function pinPost(t, id) {
t.disabled = true;
t.classList.add("disabled");
post_toast_callback(`/sticky/${id}`,
{
},
(xhr) => {
if(xhr.status == 200) {
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin permanently')
}
else if(xhr.status == 201) {
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin for 1 hour')
t.classList.add('d-none')
}
t.nextElementSibling.classList.remove('d-none')
t.disabled = false;
t.classList.remove("disabled");
}
);
setTimeout(() => {
t.disabled = false;
t.classList.remove("disabled");
}, 2000);
}

View File

@ -0,0 +1,24 @@
function pinPost(t, id) {
t.disabled = true;
t.classList.add("disabled");
post_toast_callback(`/sticky/${id}`,
{
},
(xhr) => {
if(xhr.status == 200) {
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin permanently')
}
else if(xhr.status == 201) {
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin for 1 hour')
t.classList.add('d-none')
}
t.nextElementSibling.classList.remove('d-none')
t.disabled = false;
t.classList.remove("disabled");
}
);
setTimeout(() => {
t.disabled = false;
t.classList.remove("disabled");
}, 2000);
}

View File

@ -1099,7 +1099,11 @@
{% endif %}
{% if not v or v.highlightcomments %}
<script defer src="{{'js/submission+submission_listing.js' | asset}}"></script>
<script defer src="{{'js/highlightcomments.js' | asset}}"></script>
{% endif %}
{% if v and v.admin_level > 1 %}
<script defer src="{{'js/pinpost.js' | asset}}"></script>
{% endif %}
<script defer src="{{'js/clipboard.js' | asset}}"></script>

View File

@ -11,7 +11,11 @@
{% endif %}
{% if not v or v.highlightcomments %}
<script defer src="{{'js/submission+submission_listing.js' | asset}}"></script>
<script defer src="{{'js/highlightcomments.js' | asset}}"></script>
{% endif %}
{% if v and v.admin_level > 1 %}
<script defer src="{{'js/pinpost.js' | asset}}"></script>
{% endif %}
{% include "popover.html" %}