diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-06-23 03:11:14 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-06-23 03:15:54 +0900 |
| commit | e95b823f6554f5bad24be1c7f04b2adc763a9f92 (patch) | |
| tree | 3cb3e220143cf51e4e60b26283a905393aa6ba94 /static | |
| parent | 27bfc8f1d9588322d85197e31b7346601cc680b3 (diff) | |
| download | feedaka-e95b823f6554f5bad24be1c7f04b2adc763a9f92.tar.gz feedaka-e95b823f6554f5bad24be1c7f04b2adc763a9f92.tar.zst feedaka-e95b823f6554f5bad24be1c7f04b2adc763a9f92.zip | |
refactor: change directory structure
Diffstat (limited to 'static')
| -rw-r--r-- | static/favicon.svg | 7 | ||||
| -rw-r--r-- | static/index.js | 47 |
2 files changed, 0 insertions, 54 deletions
diff --git a/static/favicon.svg b/static/favicon.svg deleted file mode 100644 index 3602b2c..0000000 --- a/static/favicon.svg +++ /dev/null @@ -1,7 +0,0 @@ -<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"> - <rect x="0" y="0" width="100" height="100" rx="8" ry="8" fill="skyblue" /> - <path d="M 0,18 L 74,18 A 8,8 0 0 1 82,26 L 82,100 L 0,100 L 0,18" fill="white" /> - <path d="M 0,36 L 56,36 A 8,8 0 0 1 64,44 L 64,100 L 0,100 L 0,36" fill="skyblue" /> - <path d="M 0,54 L 38,54 A 8,8 0 0 1 46,62 L 46,100 L 0,100 L 0,54" fill="white" /> - <rect x="0" y="72" width="28" height="28" rx="8" ry="8" fill="skyblue" /> -</svg> diff --git a/static/index.js b/static/index.js deleted file mode 100644 index 6354bbd..0000000 --- a/static/index.js +++ /dev/null @@ -1,47 +0,0 @@ -const markAllArticles = (feedId, el, read) => { - const basePath = window.BASE_PATH; - const apiUrl = `${basePath}/api/feeds/${feedId}/${read ? "read" : "unread"}`; - fetch(apiUrl, { method: "PUT" }) - .then((_data) => { - el.parentNode.nextElementSibling.remove(); - el.parentNode.remove(); - }) - .catch((error) => { - alert(error); - }); -}; - -const markOneArticle = (articleId, el, read) => { - const basePath = window.BASE_PATH; - const apiUrl = `${basePath}/api/articles/${articleId}/${read ? "read" : "unread"}`; - fetch(apiUrl, { method: "PUT" }) - .then((_data) => { - el.parentNode.remove(); - }) - .catch((error) => { - alert(error); - }); -}; - -document.addEventListener("DOMContentLoaded", () => { - document.querySelectorAll(".js-unread-feed").forEach((el) => { - el.addEventListener("click", () => { - markAllArticles(el.dataset.feedId, el, false); - }); - }); - document.querySelectorAll(".js-unread-article").forEach((el) => { - el.addEventListener("click", () => { - markOneArticle(el.dataset.articleId, el, false); - }); - }); - document.querySelectorAll(".js-read-feed").forEach((el) => { - el.addEventListener("click", () => { - markAllArticles(el.dataset.feedId, el, true); - }); - }); - document.querySelectorAll(".js-read-article").forEach((el) => { - el.addEventListener("click", () => { - markOneArticle(el.dataset.articleId, el, true); - }); - }); -}); |
