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 WebHost: Support multi-select during check/generate file upload (#2138) 2023-09-11 16:57:14 -04:00
checkResult.html WebHost: offer combined yaml file on /check if successful (#2337) 2023-10-22 02:02:30 +02:00
faq.html
gameInfo.html
generate.html Core: set consistent server defaults (#2566) 2024-01-14 21:24:34 +01:00
genericTracker.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
glossary.html
hostGame.html
hostRoom.html WebHost: Better host room (#3496) 2024-07-01 21:47:49 +02:00
islandFooter.html WebHost: Copyright update time. (#2660) 2024-01-03 18:43:41 -06:00
landing.html WebHost: link to stats from the use statistics directly on landing (#2242) 2023-10-02 20:52:58 -04:00
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 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
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 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
pageWrapper.html WebHost: flash each message only once (#2547) 2023-12-01 21:19:41 +01:00
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 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
tracker__Minecraft.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
tracker__OcarinaOfTime.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
tracker__Starcraft2.html SC2: Fix HERC upgrades (#3044) 2024-03-28 15:38:34 +01:00
tracker__SuperMetroid.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
tracker__Timespinner.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
tutorial.html
tutorialLanding.html
userContent.html WebHost: allow deleting Rooms and Seeds, as well as their associated data (#3071) 2024-04-02 16:45:07 +02:00
viewSeed.html WebHost: fix indentation (#2240) 2023-10-02 20:07:31 +02:00
waitSeed.html