From 819b25292ac794947ad4b29db7c1a57aab511df2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 01:49:57 +0000 Subject: Refactor: Remove jQuery dependency and use vanilla JavaScript. 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. --- static/ui.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'static/ui.html') diff --git a/static/ui.html b/static/ui.html index 214a544..5701d47 100644 --- a/static/ui.html +++ b/static/ui.html @@ -3,8 +3,6 @@ neko rss mode - -