2023-08-03 06:50:22 +00:00
|
|
|
function option_vote_no_v() {
|
2022-10-20 20:45:56 +00:00
|
|
|
showToast(false, "Only logged-in users can vote!");
|
2022-07-16 21:00:02 +00:00
|
|
|
}
|
|
|
|
|
2023-02-27 01:37:53 +00:00
|
|
|
function expandMarkdown(fullname) {
|
|
|
|
const ta = document.getElementById('markdown-'+fullname);
|
2022-07-16 21:00:02 +00:00
|
|
|
ta.classList.toggle('d-none');
|
2023-02-27 01:37:53 +00:00
|
|
|
document.getElementsByClassName('text-expand-icon-'+fullname)[0].classList.toggle('fa-expand-alt');
|
|
|
|
document.getElementsByClassName('text-expand-icon-'+fullname)[0].classList.toggle('fa-compress-alt');
|
2022-07-16 21:00:02 +00:00
|
|
|
|
2023-02-27 01:37:53 +00:00
|
|
|
const items = document.getElementsByClassName(`expand-text-${fullname}`)
|
2022-07-16 21:00:02 +00:00
|
|
|
for (let i=0; i < items.length; i++)
|
2022-09-04 23:15:37 +00:00
|
|
|
{
|
2022-07-16 21:00:02 +00:00
|
|
|
const e = items[i]
|
2024-01-29 03:21:30 +00:00
|
|
|
if (e.innerHTML == 'View Source') e.innerHTML = 'Hide source'
|
|
|
|
else e.innerHTML = 'View Source'
|
2022-07-16 21:00:02 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-12-30 12:14:18 +00:00
|
|
|
function collapse_comment(id) {
|
|
|
|
const element = document.getElementById(`comment-${id}`)
|
2022-07-16 21:00:02 +00:00
|
|
|
const closed = element.classList.toggle("collapsed")
|
|
|
|
const top = element.getBoundingClientRect().y
|
|
|
|
|
|
|
|
if (closed && top < 0) {
|
|
|
|
element.scrollIntoView()
|
2023-09-29 01:10:05 +00:00
|
|
|
window.scrollBy(0, - 100)
|
2022-07-16 21:00:02 +00:00
|
|
|
}
|
|
|
|
|
2023-06-23 16:49:23 +00:00
|
|
|
const reports = document.getElementById(`reports-${id}`)
|
|
|
|
if (reports) reports.classList.add('d-none')
|
2022-07-16 21:00:02 +00:00
|
|
|
|
|
|
|
vids = element.getElementsByTagName('video')
|
|
|
|
for (let i=0; i < vids.length; i++)
|
|
|
|
{
|
|
|
|
vids[i].pause()
|
|
|
|
}
|
|
|
|
|
2023-02-27 01:37:53 +00:00
|
|
|
const ta = document.getElementById('markdown-c_'+id);
|
2023-03-24 16:08:55 +00:00
|
|
|
if (ta && !ta.classList.contains('d-none'))
|
2023-02-27 01:37:53 +00:00
|
|
|
expandMarkdown(`c_${id}`)
|
2024-04-20 00:00:29 +00:00
|
|
|
|
|
|
|
if (closed) {
|
|
|
|
const children_count = document.getElementById(`replies-of-c_${id}`).getElementsByClassName('comment-body').length
|
2024-04-20 00:09:19 +00:00
|
|
|
let children = children_count == 1 ? 'child' : 'children'
|
|
|
|
document.getElementById(`children-count-${id}`).innerHTML = ` (${children_count} ${children})`
|
2024-04-20 00:00:29 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
document.getElementById(`children-count-${id}`).innerHTML = ''
|
|
|
|
}
|
2022-12-30 12:14:18 +00:00
|
|
|
};
|