mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-22 10:55:15 -04:00
Make JS in HTML templates more consistent
This commit is contained in:
parent
9aba36fce5
commit
e8f8c47dbd
1 changed files with 13 additions and 13 deletions
|
@ -725,18 +725,17 @@
|
|||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
document.querySelectorAll('.chatlog__sticker--media[data-source]').forEach(e => {
|
||||
const imageDataUrl = e.getAttribute('data-source');
|
||||
|
||||
const anim = lottie.loadAnimation({
|
||||
container: e,
|
||||
renderer: 'svg',
|
||||
loop: true,
|
||||
autoplay: true,
|
||||
path: imageDataUrl
|
||||
container: e,
|
||||
renderer: 'svg',
|
||||
loop: true,
|
||||
autoplay: true,
|
||||
path: e.getAttribute('data-source')
|
||||
});
|
||||
|
||||
anim.addEventListener('data_failed', () =>
|
||||
e.innerHTML = '<strong>[Sticker cannot be rendered]</strong>'
|
||||
anim.addEventListener(
|
||||
'data_failed',
|
||||
() => e.innerHTML = '<strong>[Sticker cannot be rendered]</strong>'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -745,7 +744,7 @@
|
|||
@{/* Scripts */}
|
||||
<script>
|
||||
function scrollToMessage(event, id) {
|
||||
var element = document.getElementById('chatlog__message-container-' + id);
|
||||
const element = document.getElementById('chatlog__message-container-' + id);
|
||||
if (!element)
|
||||
return;
|
||||
|
||||
|
@ -757,9 +756,10 @@
|
|||
behavior: 'smooth'
|
||||
});
|
||||
|
||||
window.setTimeout(function() {
|
||||
element.classList.remove('chatlog__message-container--highlighted');
|
||||
}, 2000);
|
||||
window.setTimeout(
|
||||
() => element.classList.remove('chatlog__message-container--highlighted'),
|
||||
2000
|
||||
);
|
||||
}
|
||||
|
||||
function showSpoiler(event, element) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue