Skip to content

Replace Bootstrap 3 popover (jQuery) with a vanilla popover (#1288) - #1292

Merged
jonfroehlich merged 1 commit into
masterfrom
1288-vanilla-citation-popover
Jun 15, 2026
Merged

Replace Bootstrap 3 popover (jQuery) with a vanilla popover (#1288)#1292
jonfroehlich merged 1 commit into
masterfrom
1288-vanilla-citation-popover

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

Fourth step of Track A (#1288), the JS half of the Bootstrap+jQuery removal (#1253). Follows #1289, #1290, #1291.

What

citationPopoverSimple.js was already ~95% vanilla — the only jQuery left was the Bootstrap 3 popover API (init / toggle / hide). This replaces that with a small self-contained popover that builds Bootstrap-3-styled markup (.popover / .popover-title / .popover-content / .arrow), so the existing Bootstrap + custom popover CSS applies unchanged.

  • Placement mirrors Bootstrap's auto right: right of the trigger, flipping left when there's no room, vertically centered, viewport-clamped, with the arrow tracking the trigger.
  • Content rebuilds from data-content on each open (format toggle resets to "Text", same as before); one popover open at a time.
  • Moves the trigger's title to data-original-title so the browser's native tooltip doesn't appear (Bootstrap did this for us before).
  • Adds Escape-to-close (restoring focus to the trigger) as an a11y improvement.

All existing vanilla logic (copy, download, BibTeX/Text toggle, aria state, "Copied!" feedback) is unchanged. No jQuery / Bootstrap-JS dependency remains in this module.

Why

Removes the last popover dependency on Bootstrap JS, a major step toward dropping jQuery + Bootstrap-JS entirely (#1253). Bootstrap 3 popovers have no data-api auto-init, so nothing else needs to change.

Verification

  • No $(...) / .popover(...) calls remain; all pages 200; triggers present (6 on homepage, 115 on /publications).
  • Manually verified in-browser by the maintainer: open/flip placement, Text⇄BibTeX, copy, download (.txt/.bib), close on outside-click / other-trigger / Escape, and no native tooltip on hover.

Parity notes: reopens on "Text" (same as before); no fade-in animation (instant).

Refs #1253.

Track A (#1253). citationPopoverSimple.js was already ~95% vanilla; the only
jQuery left was the Bootstrap popover API (init/toggle/hide). This swaps that
for a small self-contained popover that builds Bootstrap-3-styled markup
(.popover / .popover-title / .popover-content / .arrow), so the existing
Bootstrap + custom popover CSS still applies unchanged.

- Placement mirrors Bootstrap's "auto right": right of the trigger, flipping
  left when there's no room, vertically centered and viewport-clamped with the
  arrow tracking the trigger.
- Content is rebuilt from data-content on each open (format toggle resets to
  "Text", same as before); only one popover open at a time.
- Moves the trigger's title to data-original-title so the browser's native
  tooltip doesn't show (Bootstrap did this for us before).
- Adds Escape-to-close (restoring focus to the trigger) as an a11y improvement.

All the existing vanilla logic (copy, download, BibTeX/text toggle, aria
state, "Copied!" feedback) is unchanged. No jQuery / Bootstrap JS dependency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich
jonfroehlich merged commit 1efb361 into master Jun 15, 2026
1 check passed
jonfroehlich added a commit that referenced this pull request Jun 15, 2026
Bumps ML_WEBSITE_VERSION 2.4.0 -> 2.5.0. Marks the completion of Track A
(#1288): the frontend is now jQuery-free and Bootstrap-JS-free. Navbar (#1290),
citation popover (#1292), and carousels (#1293) rewritten in vanilla JS; dead
scrollspy (#1291), jQuery UI, jQuery Easing, and back-to-top removed
(#1289/#1290); jQuery 1.9.1 + Bootstrap 3.3.6 JS script tags dropped (#1295).
Bootstrap CSS unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich mentioned this pull request Jun 15, 2026
20 tasks
mechanicjay pushed a commit to mechanicjay/makeabilitylabwebsite that referenced this pull request Jun 17, 2026
Final step of Track A (makeabilitylab#1253). With the navbar (makeabilitylab#1290), scrollspy (makeabilitylab#1291),
citation popover (makeabilitylab#1292), and carousel (makeabilitylab#1293) all converted to vanilla JS,
nothing in the site's frontend uses jQuery or Bootstrap's JS any longer
(verified: zero `$(...)` calls, zero Bootstrap data-api attributes besides the
inert `data-toggle="popover"` selector). This removes the two now-unused CDN
script tags from base.html:

  - jQuery 1.9.1 (2013; known XSS issues)
  - Bootstrap 3.3.6 JS

Bootstrap's CSS (bootstrap.min.css) stays — only the JavaScript is removed;
the grid/CSS migration is the separate Track B.

Also tidied a now-stale comment in project-sidebar-sticky.js (the rest of the
codebase no longer uses jQuery).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich
jonfroehlich deleted the 1288-vanilla-citation-popover branch June 22, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant