summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
Diffstat (limited to 'assets')
-rw-r--r--assets/js/main.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/assets/js/main.js b/assets/js/main.js
index 3dc536d..f0910eb 100644
--- a/assets/js/main.js
+++ b/assets/js/main.js
@@ -2,6 +2,22 @@ const main = {
body: document.getElementById('main'),
url: window.location.href
}
+const test = () => {
+ const links = document.getElementsByClassName('footer-links')
+
+ for (let i = 0; i < links.length; i++) {
+ links[i].addEventListener('click', () => {
+ copy(links[i].textContent)
+ })
+ }
+}
+const copy = (x) => {
+ navigator.clipboard.writeText(x).then(() => {
+ console.log('copied')
+ }).catch((err) => {
+ console.error(err)
+ })
+}
const getPage = async () => {
const object = {
@@ -16,7 +32,10 @@ const getPage = async () => {
})
})
.then(response => response.text())
- .then(text => main.body.innerHTML = DOMPurify.sanitize(text))
+ .then(text => {
+ main.body.innerHTML = DOMPurify.sanitize(text)
+ test()
+ })
}
// ! Loading screen
@@ -109,6 +128,7 @@ const eventListener = () => {
helpinghands: document.getElementById('helpinghands'),
goodhandhauling: document.getElementById('goodhandhauling')
}
+ console.log(readblogs)
menuIcon.addEventListener('click', () => openMenu(menuList, menuIcon, closeButton, list))
closeButton[0].addEventListener('click', () => closeMenu(menuList, menuIcon, closeButton, list))