diff options
author | google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> | 2025-06-03 01:45:26 +0000 |
---|---|---|
committer | google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> | 2025-06-03 01:45:26 +0000 |
commit | cf528618e2da29df23876ef2c95ed8c665a13bb3 (patch) | |
tree | 0751873f2d981c41e7c6af574e06c563ee76ee33 /.gitignore | |
parent | 819b25292ac794947ad4b29db7c1a57aab511df2 (diff) | |
download | neko-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.
- Added a minimal Backbone.$ shim to static/ui.js to address an
`instanceof` TypeError in Backbone's _setElement method when jQuery
is not present. This ensures Backbone's internal DOM handling and
type checks can function correctly.
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions