Skip to content

Convert jQuery code to Vanilla JS - #1876

Open
tw2113 wants to merge 15 commits into
equalizedigital:developfrom
tw2113:feature/jquery-extraction
Open

Convert jQuery code to Vanilla JS#1876
tw2113 wants to merge 15 commits into
equalizedigital:developfrom
tw2113:feature/jquery-extraction

Conversation

@tw2113

@tw2113 tw2113 commented Aug 7, 2026

Copy link
Copy Markdown

Helps handle #1875

This isn't an urgent PR, and I can continue to work on other spots not touched yet. However I wanted to get a PR started and in front of ED eyes early.

Checklist

  • PR is linked to the main issue in the repo
  • Tests are added that cover changes

Summary by CodeRabbit

  • Accessibility

    • Accessibility statement controls now reliably enable or disable related link options.
    • Simplified-summary sections update correctly when selections change.
  • Bug Fixes

    • Improved summary panel activation, loading-state cleanup, navigation controls, and notice dismissal.
    • Improved panel detection and textarea value handling.
    • Enhanced JSON parsing reliability and error handling to prevent incomplete updates.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 550c804d-799f-4148-8357-2828f914beab

📥 Commits

Reviewing files that changed from the base of the PR and between 6900959 and 71302c5.

📒 Files selected for processing (1)
  • src/admin/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/admin/index.js

📝 Walkthrough

Walkthrough

The admin script replaces jQuery DOM operations and JSON parsing with native DOM APIs. It updates accessibility controls, summary panels, arrow buttons, notices, AJAX responses, and textarea access.

Changes

Admin DOM migration

Layer / File(s) Summary
Control and panel behavior
src/admin/index.js
Accessibility controls, summary panels, loading states, and arrow buttons now use native DOM queries, event listeners, properties, styles, and classes.
AJAX data access
src/admin/index.js
AJAX responses now use JSON.parse with error logging. Simplified-summary textarea access now uses native element access.
Notice and panel initialization
src/admin/index.js
Notice handlers, notice response parsing, and panel existence checks now use native DOM APIs. Initialization preserves summary, details, ignore-submit, and readability setup.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change from jQuery to vanilla JavaScript.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/admin/index.js`:
- Line 152: In src/admin/index.js, update the JSON.parse(response.data) calls in
the success-payload handlers at lines 152, 190, and 274 to catch malformed
responses, report errors non-disruptively, and reset the loading UI before
returning. Remove the unused JSON.parse(response.data) calls at lines 554 and
606, preserving their boolean-result handling without parsing.
- Around line 29-60: Guard dependent DOM elements in src/admin/index.js lines
29-60: require footerA11yStatementLink before changing its attributes or checked
state, and require simplifiedSummaryOptionCode before reading or updating its
style in the initial check and change handler. In src/admin/index.js lines
89-101, move the aria-labelledby lookup inside the summaryPanel guard so it is
only accessed when summaryPanel exists.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bf0ba563-e1a5-4f35-a500-16b4f974b49c

📥 Commits

Reviewing files that changed from the base of the PR and between 4ff4383 and 6900959.

📒 Files selected for processing (1)
  • src/admin/index.js

Comment thread src/admin/index.js
Comment thread src/admin/index.js Outdated
@tw2113 tw2113 changed the title Feature/jquery extraction Convert jQuery code to Vanilla JS Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants