From 230d1e21b013839b32e1ec9d0314752a9d3906f3 Mon Sep 17 00:00:00 2001 From: Kesha Date: Wed, 15 Apr 2026 15:03:35 +0530 Subject: [PATCH 1/2] Add AJAX-based like with localStorage one-like-per-7-days enforcement Intercept emoji-form submissions with fetch to /api/like (existing JSON endpoint) so the page no longer redirects on like. The like count updates in-place on the UI. A localStorage key per URL+emoji (with 7-day expiry) prevents repeat likes from the same browser. The server-side like() endpoint and /favorite alias are untouched so older clients, extensions, and JS-disabled browsers keep working via the original form-post-and-redirect flow. Made-with: Cursor --- app/templates/index.html | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/app/templates/index.html b/app/templates/index.html index 0a90870d..f98222f5 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -411,5 +411,91 @@

{% endif %} + From 30dc7bd245a752c2ade09f4e56ea258c87008837 Mon Sep 17 00:00:00 2001 From: Kesha Date: Wed, 15 Apr 2026 15:31:40 +0530 Subject: [PATCH 2/2] adding sweep functionality to remove old localstorage likes --- app/templates/index.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/templates/index.html b/app/templates/index.html index f98222f5..2fcb76f5 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -414,6 +414,22 @@