refactor(webserver): replace JS nav rollovers with CSS :hover - #92
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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).
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.