on master help sign in
Update reactor code for new elm/browser API
3d86d3cEvan Czaplicki
ui/browser/src/Errors.elm+3−4
@@ -15,12 +15,11 @@ import Elm.Error as Error
15
15
16
16
17main =
17main =
18− Browser.fullscreen
18+ Browser.document
19− { init = \env -> (D.decodeValue Error.decoder env.flags, Cmd.none)
19+ { init = \flags -> (D.decodeValue Error.decoder flags, Cmd.none)
20 , update = \_ exit -> (exit, Cmd.none)
20 , update = \_ exit -> (exit, Cmd.none)
21 , view = view
21 , view = view
22 , subscriptions = \_ -> Sub.none
22 , subscriptions = \_ -> Sub.none
23− , onNavigation = Nothing
24 }
23 }
25
24
26
25
@@ -28,7 +27,7 @@ main =
28-- VIEW
27-- VIEW
29
28
30
29
31−view : Result D.Error Error.Error -> Browser.Page msg
30+view : Result D.Error Error.Error -> Browser.Document msg
32view result =
31view result =
33 { title = "Problem!"
32 { title = "Problem!"
34 , body =
33 , body =
ui/browser/src/Index.elm+7−5
@@ -23,12 +23,11 @@ import Index.Skeleton as Skeleton
23
23
24main : Program D.Value Model Never
24main : Program D.Value Model Never
25main =
25main =
26− Browser.fullscreen
26+ Browser.document
27− { init = \env -> (D.decodeValue decoder env.flags, Cmd.none)
27+ { init = \flags -> (D.decodeValue decoder flags, Cmd.none)
28 , update = \_ model -> (model, Cmd.none)
28 , update = \_ model -> (model, Cmd.none)
29 , subscriptions = \_ -> Sub.none
29 , subscriptions = \_ -> Sub.none
30 , view = view
30 , view = view
31− , onNavigation = Nothing
32 }
31 }
33
32
34
33
@@ -88,7 +87,7 @@ type alias Model =
88-- VIEW
87-- VIEW
89
88
90
89
91−view : Model -> Browser.Page msg
90+view : Model -> Browser.Document msg
92view model =
91view model =
93 case model of
92 case model of
94 Err error ->
93 Err error ->
@@ -141,7 +140,10 @@ viewFiles : List String -> List File -> Html msg
141viewFiles dirs files =
140viewFiles dirs files =
142 Skeleton.box
141 Skeleton.box
143 { title = "File Navigation"
142 { title = "File Navigation"
143+ , items =
144− , items = List.filterMap viewDir dirs ++ List.filterMap viewFile files
144+ List.filterMap viewDir (List.sort dirs)
145+ ++
146+ List.filterMap viewFile (List.sortBy .name files)
145 , footer = Nothing
147 , footer = Nothing
146 }
148 }
147
149
ui/browser/src/NotFound.elm+2−2
@@ -9,15 +9,15 @@ import Html.Attributes exposing (..)
9
9
10main : Program () () ()
10main : Program () () ()
11main =
11main =
12− Browser.fullscreen
12+ Browser.document
13 { init = \_ -> ((), Cmd.none)
13 { init = \_ -> ((), Cmd.none)
14 , update = \_ _ -> ((), Cmd.none)
14 , update = \_ _ -> ((), Cmd.none)
15 , subscriptions = \_ -> Sub.none
15 , subscriptions = \_ -> Sub.none
16− , onNavigation = Nothing
17 , view = \_ -> page
16 , view = \_ -> page
18 }
17 }
19
18
20
19
20+page : Browser.Document ()
21page =
21page =
22 { title = "Page not found"
22 { title = "Page not found"
23 , body =
23 , body =
ui/terminal/src/Develop/Generate/Help.hs+1−1
@@ -29,7 +29,7 @@ makePageHtml moduleName flags =
29</head>
29</head>
30<body>
30<body>
31<script>
31<script>
32−Elm.|] <> N.toBuilder moduleName <> [r|.fullscreen(|] <> flags <> [r|);
32+Elm.|] <> N.toBuilder moduleName <> [r|.init({ flags: |] <> flags <> [r| });
33</script>
33</script>
34</body>
34</body>
35</html>
35</html>