You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

25 lines
797 B

// Choose language confirmation button
document.querySelectorAll('#confirm_btn').forEach((confirm_btn) => {
confirm_btn.addEventListener('click', (e) => {
window.location.href = '/' + document.getElementById('language_select').value
})
})
// Copy link to clipboard
document.querySelectorAll('[data-share-url]').forEach((share_btn) => {
share_btn.addEventListener('click', (e) => {
navigator.clipboard.writeText(e.currentTarget.getAttribute('data-share-url'))
alert('URL copied to clipboard!')
})
})
// Open all external links in ny tab
for (const link of document.links) {
if (link.hostname.replace(/^www\./i, "") != window.location.hostname.replace(/^www\./i, "") && (link.protocol == 'https:' || link.protocol == 'http:'))
link.target = '_blank'
}