Skip to content

Commit 4912e06

Browse files
authored
revamp JavaScript on the download page
Fixes #120 three bugs: - Remove an extra "Variant" widget. - Remove redundant "Platform" options - Add extension information to variants Additionally, it replaces the current implementation to a declarative approach similar to big-bang / React framework. The current approach is _extremely_ complicated due to its imperative nature, generating multiple selection widgets, embedding several information in non-standard attributes of DOM elements, and showing/hiding them via JS. This is very error prone due to multiple levels of the selection widgets, and how the number of levels is dynamic. Additionally, it is very difficult to modify this page. The new approach is similar to big-bang. We supply the framework the initial state and the toDraw function, which constructs the DOM tree based on the input state. Each DOM element can have a handler (such as onclick) which will transition the current state into the next state. This makes it much easier to reason about it.
1 parent ec343fd commit 4912e06

File tree

4 files changed

+439
-226
lines changed

4 files changed

+439
-226
lines changed

download/data.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
[(equal? cpu "ppc") "PPC"]
2525
[(equal? cpu "i386") "Intel 32-bit"]
2626
[(equal? cpu "x86_64") "Intel 64-bit"]
27-
[else (error "unregonized cpu!")])))]
27+
[else (error "unrecognized cpu!")])))]
2828
["(ppc|68k)-mac-classic" "Macintosh Classic (\\1)"]
2929
["(ppc|i386)-darwin"
3030
,(λ (_ cpu)

0 commit comments

Comments
 (0)