Simplify elFinder (dark) mode scripting#90
Merged
pxpm merged 4 commits intoMar 31, 2026
Conversation
Contributor
|
Hey @jnoordsij care to rebase this so I can give it another look? Thanks 🙏 |
93e8274 to
a4f476e
Compare
@bassetBlock does not support any way of passing/preserving the type=module attribute yet, so we should probably be safe here
Contributor
Author
|
@pxpm done! Also slightly adjusted. |
Contributor
|
Thanks @jnoordsij 🙏 |
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.
WHY
BEFORE - What was wrong? What was happening before this PR?
The previous scripting was both somewhat computationally heavy (leveraging lots of loops and regexes) and hard to understand.
AFTER - What is happening after this PR?
In the new script, a simple strategy is applied:
linkelements, one for light mode and one for dark mode stylesheetsrel=prefetch, so that the corresponding asset may be fetched if browser supports this directive and prioritizes it at some point, but neither of the stylesheets are 'active'rel=stylesheet, while disabling the other by usingrel=prefetchAlso some related code has been slightly cleaned up.
HOW
How did you achieve that, in technical terms?
Refactor
Is it a breaking change or non-breaking change?
Non-breaking
How can we test the before & after?
Behavior should remain practically identical