Archipelago/WebHostLib/templates
Remy Jette 77e3f9fbef
WebHost: Fix NamedRange values clamping to the range (#3613)
If a NamedRange has a `special_range_names` entry outside the
`range_start` and `range_end`, the HTML5 range input will clamp the
submitted value to the closest value in the range.

These means that, for example, Pokemon RB's "HM Compatibility" option's
"Vanilla (-1)" option would instead get posted as "0" rather than "-1".

This change updates NamedRange to behave like TextChoice, where the
select element has a `name` attribute matching the option, and there is
an additional element to be able to provide an option other than the
select element's choices.

This uses a different suffix of `-range` rather than `-custom` that
TextChoice uses. The reason is we need some way to decide whether to use
the custom value or the select value, and that method needs to work
without JavaScript. For TextChoice this is easy, if the custom field is
empty use the select element. For NamedRange this is more difficult as
the browser will always submit *something*. My choice was to only use
the value from the range if the select box is set to "custom". Since
this only happens with JS as "custom' is hidden, I made the range hidden
under no-JS. If it's preferred, I could make the select box hidden
instead. Let me know.

This PR also makes the `js-required` class set `display: none` with
`!important` as otherwise the class wouldn't work on any rule that
had `display: flex` with more specificity than a single class.
2024-07-29 20:13:44 -04:00
..
header [Webhost] header closing tag moved after mobile menu (#1650) 2023-04-05 19:27:56 -04:00
playerOptions WebHost: Fix NamedRange values clamping to the range (#3613) 2024-07-29 20:13:44 -04:00
weightedOptions WebHost: Fix Named Range displays on Player Options page (#3521) 2024-06-13 17:29:39 -04:00
404.html
autotablepage.html
check.html
checkResult.html
faq.html
gameInfo.html
generate.html
genericTracker.html
glossary.html
hostGame.html
hostRoom.html WebHost: Better host room (#3496) 2024-07-01 21:47:49 +02:00
islandFooter.html
landing.html
macros.html Webhost: add file downloads to the room api endpoint (#2780) 2024-04-11 05:05:52 +02:00
multispheretracker.html Webhost: Sphere Tracker (#3412) 2024-06-01 14:43:11 +02:00
multitracker.html WebHost: update trackers only if they're visible. (#3407) 2024-06-01 17:07:58 +02:00
multitrackerHintTable.html
multitrackerNavigation.html WebHost: Refactor `tracker.py`, removal of dead code, and tweaks to layouts of some tracker pages. (#2438) 2023-11-18 12:29:35 -06:00
multitracker__ALinkToThePast.html ALTTP: Updates and refactors to multi-tracker and player tracker. (#3183) 2024-04-20 18:29:41 -04:00
multitracker__Factorio.html
pageWrapper.html
seedError.html
siteMap.html WebHost: Massive overhaul of options pages (#2614) 2024-05-18 00:11:57 -04:00
startPlaying.html Webhost: Fix a typo on Start Playing page (#3122) 2024-04-11 19:31:42 -04:00
stats.html
supportedGames.html WebHost: Massive overhaul of options pages (#2614) 2024-05-18 00:11:57 -04:00
tablepage.html
templates.html
tracker__ALinkToThePast.html ALTTP: Updates and refactors to multi-tracker and player tracker. (#3183) 2024-04-20 18:29:41 -04:00
tracker__ChecksFinder.html
tracker__Minecraft.html
tracker__OcarinaOfTime.html
tracker__Starcraft2.html
tracker__SuperMetroid.html
tracker__Timespinner.html
tutorial.html Website Style Upgrade (#353) 2022-03-28 20:12:17 -04:00
tutorialLanding.html
userContent.html
viewSeed.html
waitSeed.html