2023-04-29 15:55:35 +00:00
|
|
|
function expandText(id) {
|
2023-05-05 02:02:18 +00:00
|
|
|
document.getElementById('post-text-'+id).classList.toggle('d-none');
|
2023-02-27 01:37:53 +00:00
|
|
|
for (const e of document.getElementsByClassName('text-expand-icon-p_'+id))
|
2022-07-16 21:00:02 +00:00
|
|
|
{
|
|
|
|
e.classList.toggle('fa-expand-alt');
|
|
|
|
e.classList.toggle('fa-compress-alt');
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
function togglevideo(pid) {
|
|
|
|
const e = this.event
|
2023-08-06 03:33:34 +00:00
|
|
|
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey)
|
2022-11-07 10:49:49 +00:00
|
|
|
return;
|
2022-07-16 21:00:02 +00:00
|
|
|
e.preventDefault();
|
|
|
|
let vid = document.getElementById(`video-${pid}`).classList
|
|
|
|
vid.toggle('d-none')
|
|
|
|
let vid2 = document.getElementById(`video2-${pid}`)
|
|
|
|
if (vid.contains('d-none')) vid2.pause()
|
|
|
|
else vid2.play()
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleyoutube(pid) {
|
|
|
|
const e = this.event
|
2023-08-06 03:33:34 +00:00
|
|
|
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey)
|
2022-11-07 10:49:49 +00:00
|
|
|
return;
|
2022-07-16 21:00:02 +00:00
|
|
|
e.preventDefault();
|
2023-07-22 22:26:01 +00:00
|
|
|
const el = document.getElementById(`video-${pid}`)
|
|
|
|
el.classList.toggle('d-none')
|
|
|
|
|
2023-07-23 00:27:11 +00:00
|
|
|
const iframe = el.getElementsByTagName('iframe')[0]
|
|
|
|
|
2023-07-22 22:26:01 +00:00
|
|
|
if (el.classList.contains('d-none')) {
|
2023-07-23 00:27:11 +00:00
|
|
|
iframe.dataset.src = iframe.src;
|
|
|
|
iframe.src = '';
|
2023-07-22 22:26:01 +00:00
|
|
|
}
|
|
|
|
else {
|
2023-07-23 00:27:11 +00:00
|
|
|
if (iframe && iframe.dataset.src)
|
|
|
|
iframe.src = iframe.dataset.src;
|
2023-07-22 22:26:01 +00:00
|
|
|
const playbtn = el.getElementsByClassName('lty-playbtn')[0]
|
|
|
|
playbtn.click()
|
|
|
|
}
|
2022-11-07 10:49:49 +00:00
|
|
|
}
|