aboutsummaryrefslogtreecommitdiffstats
path: root/static/public.html
diff options
context:
space:
mode:
authorgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>2025-05-27 01:49:57 +0000
committergoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>2025-05-27 01:49:57 +0000
commit819b25292ac794947ad4b29db7c1a57aab511df2 (patch)
treeb25ac9c23fd795c103ff04ed948768924592c92f /static/public.html
parent39ed5fcfe9327ab4eb81c4863d9e6353f08f6c07 (diff)
downloadneko-remove-jquery.tar.gz
neko-remove-jquery.tar.bz2
neko-remove-jquery.zip
Refactor: Remove jQuery dependency and use vanilla JavaScript.remove-jquery
This commit removes jQuery and the jQuery.tmpl plugin from the frontend, refactoring all JavaScript code in static/ui.js and relevant HTML files to use vanilla JavaScript APIs. Key changes include: - Replaced jQuery selectors ($) with document.querySelector/querySelectorAll. - Replaced jQuery DOM manipulation methods with native equivalents (classList, style, appendChild, etc.). - Replaced jQuery event handling (ready, on, keydown) with addEventListener. - Replaced $.getJSON with the fetch API. - Replaced $.each with Array.prototype.forEach. - Implemented a custom vanilla JS templating function (`renderTemplate`) to replace jquery.tmpl.js functionality, including support for variable interpolation, conditionals (if/else), and raw HTML rendering. - Updated Backbone.js views to handle their own DOM interactions and event delegation using vanilla JS, removing the `events` hash and using manual event listener attachment in `render` or `attachEvents` methods. - Removed script tags for jquery and jquery.tmpl from HTML files. - Replaced inline jQuery calls in HTML onclick attributes with vanilla JS.
Diffstat (limited to 'static/public.html')
-rw-r--r--static/public.html4
1 files changed, 1 insertions, 3 deletions
diff --git a/static/public.html b/static/public.html
index a4ba406..bd28730 100644
--- a/static/public.html
+++ b/static/public.html
@@ -3,8 +3,6 @@
<head>
<title>neko rss mode</title>
<link rel="stylesheet" href="/static/style.css" />
- <script src="/static/jquery.min.js"></script>
- <script src="/static/jquery.tmpl.min.js"></script>
<script src="/static/underscore.min.js"></script>
<script src="/static/backbone.min.js"></script>
<script>
@@ -21,7 +19,7 @@
<p style="font-size: 10px;">this is an rss aggregator</p>
<a href="/login/">LOGIN</a>
- <h4 onclick="$('#feeds').toggle();">Feeds</h4>
+ <h4 onclick="document.querySelector('#feeds').style.display = document.querySelector('#feeds').style.display === 'none' ? '' : 'none';">Feeds</h4>
<ul id="feeds" style="display: none;">
</ul>