Skip to content

refactor(webserver): replace JS nav rollovers with CSS :hover - #92

Merged
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/css-hover-nav
Jun 11, 2026
Merged

refactor(webserver): replace JS nav rollovers with CSS :hover#92
ngosang merged 1 commit into
amule-org:masterfrom
ngosang:fix/css-hover-nav

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

The navigation bar in every page of the default template swapped its _0.png/_1.png icon pairs through the Dreamweaver-generated MM_swapImage/MM_swapImgRestore handlers, plus an MM_preloadImages call in each . Do the swap in pure CSS instead:

  • style.css: add a .navbutton block (52x50) and one nav-* class per button setting the *_0.png background image, with a :hover rule swapping it to *_1.png.
  • All 8 main pages: replace the six <a onMouseOver/onMouseOut>
    nav cells with plain class-based anchors (title attributes keep the tooltips), and drop the MM_preloadImages call from onLoad (prefs keeps its init_data() call).
  • index.html: drop the onLoad MM_preloadImages call, which referenced a function never defined on that page and threw on every load.
  • common.js: delete the now-unused MM_swapImgRestore, MM_preloadImages and MM_swapImage. MM_findObj and MM_nbGroup stay, still used by the per-page toolbars.

Verified against a running amuleweb: all 8 pages serve the new markup with a clean JS console, hovering a nav button swaps its background to the *_1.png variant, and the layout is unchanged.

The navigation bar in every page of the default template swapped its
*_0.png/*_1.png icon pairs through the Dreamweaver-generated
MM_swapImage/MM_swapImgRestore handlers, plus an MM_preloadImages call
in each <body onLoad>. Do the swap in pure CSS instead:

- style.css: add a .navbutton block (52x50) and one nav-* class per
  button setting the *_0.png background image, with a :hover rule
  swapping it to *_1.png.
- All 8 main pages: replace the six <a onMouseOver/onMouseOut><img>
  nav cells with plain class-based anchors (title attributes keep the
  tooltips), and drop the MM_preloadImages call from onLoad
  (prefs keeps its init_data() call).
- index.html: drop the onLoad MM_preloadImages call, which referenced
  a function never defined on that page and threw on every load.
- common.js: delete the now-unused MM_swapImgRestore, MM_preloadImages
  and MM_swapImage. MM_findObj and MM_nbGroup stay, still used by the
  per-page toolbars.

No files added or removed, so the CMake INSTALL list is unchanged.

Verified against a running amuleweb: all 8 pages serve the new markup
with a clean JS console, hovering a nav button swaps its background to
the *_1.png variant, and the layout is unchanged.
@ngosang
ngosang merged commit f7e44bf into amule-org:master Jun 11, 2026
9 checks passed
@ngosang
ngosang deleted the fix/css-hover-nav branch June 11, 2026 10:03
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