Update client.js

This commit is contained in:
nune 2024-12-19 23:46:42 -05:00 committed by GitHub
parent 7df9789695
commit f657f6a470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,18 @@ document.addEventListener('DOMContentLoaded', async () => {
setCookie('autoCopyEnabled', autoCopyCheckbox.checked, 365); setCookie('autoCopyEnabled', autoCopyCheckbox.checked, 365);
}); });
// Fetch ASCII art and display it
try {
const response = await fetch('/ascii');
const data = await response.json();
if (data.enabled) {
const asciiArtContainer = document.getElementById('asciiArtContainer');
asciiArtContainer.textContent = data.art;
}
} catch (error) {
console.error('Failed to fetch ASCII art:', error);
}
// Handle "Go to Raw Paste" button click // Handle "Go to Raw Paste" button click
fetchBtn.addEventListener('click', async () => { fetchBtn.addEventListener('click', async () => {
const urlInput = pasteUrlInput.value.trim(); const urlInput = pasteUrlInput.value.trim();