2020-03-31 03:22:27 +00:00
|
|
|
|
module Main exposing (main)
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
import Browser
|
|
|
|
|
import Browser.Navigation
|
2020-03-31 03:22:27 +00:00
|
|
|
|
import Html
|
|
|
|
|
exposing
|
|
|
|
|
( Html
|
2020-04-10 08:13:50 +00:00
|
|
|
|
, a
|
2020-07-02 13:00:54 +00:00
|
|
|
|
, button
|
2020-03-31 03:22:27 +00:00
|
|
|
|
, div
|
2020-04-10 08:13:50 +00:00
|
|
|
|
, footer
|
2020-03-31 03:22:27 +00:00
|
|
|
|
, header
|
2020-04-10 08:13:50 +00:00
|
|
|
|
, img
|
2020-03-31 03:22:27 +00:00
|
|
|
|
, li
|
2020-06-04 23:13:52 +00:00
|
|
|
|
, span
|
2020-03-31 03:22:27 +00:00
|
|
|
|
, text
|
|
|
|
|
, ul
|
|
|
|
|
)
|
|
|
|
|
import Html.Attributes
|
|
|
|
|
exposing
|
2020-07-02 13:00:54 +00:00
|
|
|
|
( attribute
|
|
|
|
|
, class
|
2020-05-08 13:24:58 +00:00
|
|
|
|
, classList
|
2020-04-10 08:13:50 +00:00
|
|
|
|
, href
|
2020-06-04 23:13:52 +00:00
|
|
|
|
, id
|
2020-04-10 08:13:50 +00:00
|
|
|
|
, src
|
2020-07-02 13:00:54 +00:00
|
|
|
|
, type_
|
2020-03-31 03:22:27 +00:00
|
|
|
|
)
|
2020-05-08 13:24:58 +00:00
|
|
|
|
import Page.Home
|
|
|
|
|
import Page.Options
|
|
|
|
|
import Page.Packages
|
|
|
|
|
import Route
|
2020-06-03 23:33:54 +00:00
|
|
|
|
import Search
|
2020-05-08 13:24:58 +00:00
|
|
|
|
import Url
|
2020-06-10 12:03:44 +00:00
|
|
|
|
import Url.Builder
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- MODEL
|
|
|
|
|
|
|
|
|
|
|
2020-04-07 05:05:50 +00:00
|
|
|
|
type alias Flags =
|
2020-06-03 23:33:54 +00:00
|
|
|
|
{ elasticsearchMappingSchemaVersion : Int
|
|
|
|
|
, elasticsearchUrl : String
|
2020-04-07 05:05:50 +00:00
|
|
|
|
, elasticsearchUsername : String
|
|
|
|
|
, elasticsearchPassword : String
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-03-28 04:09:01 +00:00
|
|
|
|
type alias Model =
|
2020-05-08 13:24:58 +00:00
|
|
|
|
{ navKey : Browser.Navigation.Key
|
2020-10-28 23:38:46 +00:00
|
|
|
|
, route : Route.Route
|
2020-06-03 19:02:12 +00:00
|
|
|
|
, elasticsearch : Search.Options
|
2020-03-28 04:09:01 +00:00
|
|
|
|
, page : Page
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type Page
|
2020-05-08 13:24:58 +00:00
|
|
|
|
= NotFound
|
|
|
|
|
| Home Page.Home.Model
|
|
|
|
|
| Packages Page.Packages.Model
|
|
|
|
|
| Options Page.Options.Model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init :
|
|
|
|
|
Flags
|
|
|
|
|
-> Url.Url
|
|
|
|
|
-> Browser.Navigation.Key
|
|
|
|
|
-> ( Model, Cmd Msg )
|
|
|
|
|
init flags url navKey =
|
2020-04-10 08:13:50 +00:00
|
|
|
|
let
|
|
|
|
|
model =
|
2020-05-08 13:24:58 +00:00
|
|
|
|
{ navKey = navKey
|
|
|
|
|
, elasticsearch =
|
2020-06-03 19:02:12 +00:00
|
|
|
|
Search.Options
|
2020-06-03 23:33:54 +00:00
|
|
|
|
flags.elasticsearchMappingSchemaVersion
|
2020-05-08 13:24:58 +00:00
|
|
|
|
flags.elasticsearchUrl
|
|
|
|
|
flags.elasticsearchUsername
|
|
|
|
|
flags.elasticsearchPassword
|
|
|
|
|
, page = NotFound
|
2020-10-28 23:38:46 +00:00
|
|
|
|
, route = Route.Home
|
2020-04-10 08:13:50 +00:00
|
|
|
|
}
|
|
|
|
|
in
|
2020-05-08 13:24:58 +00:00
|
|
|
|
changeRouteTo model url
|
2020-04-10 08:13:50 +00:00
|
|
|
|
|
|
|
|
|
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
|
|
|
|
-- UPDATE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type Msg
|
2020-05-08 13:24:58 +00:00
|
|
|
|
= ChangedUrl Url.Url
|
|
|
|
|
| ClickedLink Browser.UrlRequest
|
|
|
|
|
| HomeMsg Page.Home.Msg
|
|
|
|
|
| PackagesMsg Page.Packages.Msg
|
|
|
|
|
| OptionsMsg Page.Options.Msg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateWith :
|
|
|
|
|
(subModel -> Page)
|
|
|
|
|
-> (subMsg -> Msg)
|
|
|
|
|
-> Model
|
|
|
|
|
-> ( subModel, Cmd subMsg )
|
|
|
|
|
-> ( Model, Cmd Msg )
|
|
|
|
|
updateWith toPage toMsg model ( subModel, subCmd ) =
|
|
|
|
|
( { model | page = toPage subModel }
|
|
|
|
|
, Cmd.map toMsg subCmd
|
|
|
|
|
)
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
|
|
|
|
|
2020-11-28 23:02:59 +00:00
|
|
|
|
attemptQuery : ( Model, Cmd Msg ) -> ( Model, Cmd Msg )
|
|
|
|
|
attemptQuery (( model, _ ) as pair) =
|
2020-05-08 13:24:58 +00:00
|
|
|
|
let
|
2020-11-28 23:02:59 +00:00
|
|
|
|
-- We intentially throw away Cmd
|
|
|
|
|
-- because we don't want to perform any effects
|
|
|
|
|
-- in this cases where route itself doesn't change
|
|
|
|
|
noEffects =
|
|
|
|
|
Tuple.mapSecond (always Cmd.none)
|
|
|
|
|
|
|
|
|
|
submitQuery msg makeRequest searchModel =
|
|
|
|
|
Tuple.mapSecond
|
|
|
|
|
(\cmd ->
|
|
|
|
|
Cmd.batch
|
|
|
|
|
[ cmd
|
|
|
|
|
, Cmd.map msg <|
|
|
|
|
|
makeRequest
|
|
|
|
|
model.elasticsearch
|
|
|
|
|
searchModel.channel
|
|
|
|
|
(Maybe.withDefault "" searchModel.query)
|
|
|
|
|
searchModel.from
|
|
|
|
|
searchModel.size
|
|
|
|
|
searchModel.sort
|
|
|
|
|
]
|
2020-05-08 13:24:58 +00:00
|
|
|
|
)
|
2020-11-28 23:02:59 +00:00
|
|
|
|
pair
|
|
|
|
|
in
|
|
|
|
|
case model.page of
|
|
|
|
|
Packages searchModel ->
|
|
|
|
|
if Search.shouldLoad searchModel then
|
|
|
|
|
submitQuery PackagesMsg Page.Packages.makeRequest searchModel
|
2020-05-08 21:59:14 +00:00
|
|
|
|
|
|
|
|
|
else
|
2020-11-28 23:02:59 +00:00
|
|
|
|
noEffects pair
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
2020-11-28 23:02:59 +00:00
|
|
|
|
Options searchModel ->
|
|
|
|
|
if Search.shouldLoad searchModel then
|
|
|
|
|
submitQuery OptionsMsg Page.Options.makeRequest searchModel
|
2020-05-08 21:59:14 +00:00
|
|
|
|
|
2020-11-28 23:02:59 +00:00
|
|
|
|
else
|
|
|
|
|
noEffects pair
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
2020-11-28 23:02:59 +00:00
|
|
|
|
_ ->
|
|
|
|
|
pair
|
2020-05-08 21:59:14 +00:00
|
|
|
|
|
2020-11-28 23:02:59 +00:00
|
|
|
|
|
|
|
|
|
pageMatch : Page -> Page -> Bool
|
|
|
|
|
pageMatch m1 m2 =
|
|
|
|
|
case ( m1, m2 ) of
|
|
|
|
|
( NotFound, NotFound ) ->
|
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
( Home _, Home _ ) ->
|
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
( Packages _, Packages _ ) ->
|
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
( Options _, Options _ ) ->
|
|
|
|
|
True
|
|
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
|
False
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
|
|
|
|
|
2020-06-11 16:29:51 +00:00
|
|
|
|
changeRouteTo :
|
|
|
|
|
Model
|
|
|
|
|
-> Url.Url
|
|
|
|
|
-> ( Model, Cmd Msg )
|
2020-10-28 23:38:46 +00:00
|
|
|
|
changeRouteTo currentModel url =
|
|
|
|
|
case Route.fromUrl url of
|
2020-05-08 13:24:58 +00:00
|
|
|
|
Nothing ->
|
2020-10-28 23:38:46 +00:00
|
|
|
|
( { currentModel | page = NotFound }
|
2020-05-08 13:24:58 +00:00
|
|
|
|
, Cmd.none
|
|
|
|
|
)
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
2020-10-28 23:38:46 +00:00
|
|
|
|
Just route ->
|
2020-06-11 16:29:51 +00:00
|
|
|
|
let
|
2020-10-28 23:38:46 +00:00
|
|
|
|
model =
|
|
|
|
|
{ currentModel | route = route }
|
2020-11-28 23:02:59 +00:00
|
|
|
|
|
|
|
|
|
avoidReinit ( newModel, cmd ) =
|
|
|
|
|
if pageMatch currentModel.page newModel.page then
|
|
|
|
|
( model, Cmd.none )
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
( newModel, cmd )
|
2020-06-11 16:29:51 +00:00
|
|
|
|
in
|
2020-10-28 23:38:46 +00:00
|
|
|
|
case route of
|
|
|
|
|
Route.NotFound ->
|
|
|
|
|
( { model | page = NotFound }, Cmd.none )
|
|
|
|
|
|
|
|
|
|
Route.Home ->
|
|
|
|
|
-- Always redirect to /packages until we have something to show
|
|
|
|
|
-- on the home page
|
2020-12-07 07:53:56 +00:00
|
|
|
|
( model, Browser.Navigation.replaceUrl model.navKey "/packages" )
|
2020-10-28 23:38:46 +00:00
|
|
|
|
|
2020-10-30 18:13:55 +00:00
|
|
|
|
Route.Packages searchArgs ->
|
2020-10-28 23:38:46 +00:00
|
|
|
|
let
|
|
|
|
|
modelPage =
|
|
|
|
|
case model.page of
|
|
|
|
|
Packages x ->
|
|
|
|
|
Just x
|
|
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
|
Nothing
|
|
|
|
|
in
|
2020-10-30 18:13:55 +00:00
|
|
|
|
Page.Packages.init searchArgs modelPage
|
2020-10-28 23:38:46 +00:00
|
|
|
|
|> updateWith Packages PackagesMsg model
|
2020-11-28 23:02:59 +00:00
|
|
|
|
|> avoidReinit
|
|
|
|
|
|> attemptQuery
|
2020-10-28 23:38:46 +00:00
|
|
|
|
|
2020-10-30 18:13:55 +00:00
|
|
|
|
Route.Options searchArgs ->
|
2020-10-28 23:38:46 +00:00
|
|
|
|
let
|
|
|
|
|
modelPage =
|
|
|
|
|
case model.page of
|
|
|
|
|
Options x ->
|
|
|
|
|
Just x
|
|
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
|
Nothing
|
|
|
|
|
in
|
2020-10-30 18:13:55 +00:00
|
|
|
|
Page.Options.init searchArgs modelPage
|
2020-10-28 23:38:46 +00:00
|
|
|
|
|> updateWith Options OptionsMsg model
|
2020-11-28 23:02:59 +00:00
|
|
|
|
|> avoidReinit
|
|
|
|
|
|> attemptQuery
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
|
|
|
|
|
2020-03-28 04:09:01 +00:00
|
|
|
|
update : Msg -> Model -> ( Model, Cmd Msg )
|
2020-05-08 13:24:58 +00:00
|
|
|
|
update msg model =
|
|
|
|
|
case ( msg, model.page ) of
|
|
|
|
|
( ClickedLink urlRequest, _ ) ->
|
|
|
|
|
case urlRequest of
|
|
|
|
|
Browser.Internal url ->
|
2020-03-31 00:59:06 +00:00
|
|
|
|
( model
|
2020-10-28 23:38:46 +00:00
|
|
|
|
, Browser.Navigation.pushUrl model.navKey <| Url.toString url
|
2020-03-31 00:59:06 +00:00
|
|
|
|
)
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
Browser.External href ->
|
2020-04-10 08:13:50 +00:00
|
|
|
|
( model
|
2020-11-28 23:02:59 +00:00
|
|
|
|
, case href of
|
|
|
|
|
-- ignore links with no `href` attribute
|
|
|
|
|
"" ->
|
|
|
|
|
Cmd.none
|
|
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
|
Browser.Navigation.load href
|
2020-04-10 08:13:50 +00:00
|
|
|
|
)
|
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
( ChangedUrl url, _ ) ->
|
|
|
|
|
changeRouteTo model url
|
2020-04-10 08:13:50 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
( HomeMsg subMsg, Home subModel ) ->
|
|
|
|
|
Page.Home.update subMsg subModel
|
|
|
|
|
|> updateWith Home HomeMsg model
|
|
|
|
|
|
|
|
|
|
( PackagesMsg subMsg, Packages subModel ) ->
|
2020-07-24 21:01:16 +00:00
|
|
|
|
Page.Packages.update model.navKey subMsg subModel
|
2020-05-08 13:24:58 +00:00
|
|
|
|
|> updateWith Packages PackagesMsg model
|
|
|
|
|
|
|
|
|
|
( OptionsMsg subMsg, Options subModel ) ->
|
2020-07-24 21:01:16 +00:00
|
|
|
|
Page.Options.update model.navKey subMsg subModel
|
2020-05-08 13:24:58 +00:00
|
|
|
|
|> updateWith Options OptionsMsg model
|
|
|
|
|
|
|
|
|
|
( _, _ ) ->
|
|
|
|
|
-- Disregard messages that arrived for the wrong page.
|
|
|
|
|
( model, Cmd.none )
|
2020-04-10 08:13:50 +00:00
|
|
|
|
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- VIEW
|
|
|
|
|
|
|
|
|
|
|
2020-06-12 10:20:28 +00:00
|
|
|
|
view :
|
|
|
|
|
Model
|
|
|
|
|
->
|
|
|
|
|
{ title : String
|
|
|
|
|
, body : List (Html Msg)
|
|
|
|
|
}
|
2020-03-28 04:09:01 +00:00
|
|
|
|
view model =
|
2020-06-12 10:20:28 +00:00
|
|
|
|
let
|
|
|
|
|
title =
|
|
|
|
|
case model.page of
|
|
|
|
|
Packages _ ->
|
|
|
|
|
"NixOS Search - Packages"
|
|
|
|
|
|
|
|
|
|
Options _ ->
|
|
|
|
|
"NixOS Search - Options"
|
|
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
|
"NixOS Search"
|
|
|
|
|
in
|
|
|
|
|
{ title = title
|
|
|
|
|
, body =
|
|
|
|
|
[ div []
|
|
|
|
|
[ header []
|
|
|
|
|
[ div [ class "navbar navbar-static-top" ]
|
|
|
|
|
[ div [ class "navbar-inner" ]
|
|
|
|
|
[ div [ class "container" ]
|
2020-07-02 13:00:54 +00:00
|
|
|
|
[ button
|
|
|
|
|
[ type_ "button"
|
|
|
|
|
, class "btn btn-navbar"
|
|
|
|
|
, attribute "data-toggle" "collapse"
|
|
|
|
|
, attribute "data-target" ".nav-collapse"
|
|
|
|
|
]
|
|
|
|
|
[ span [ class "icon-bar" ] []
|
|
|
|
|
, span [ class "icon-bar" ] []
|
|
|
|
|
, span [ class "icon-bar" ] []
|
|
|
|
|
]
|
|
|
|
|
, a [ class "brand", href "https://nixos.org" ]
|
2020-06-12 10:20:28 +00:00
|
|
|
|
[ img [ src "https://nixos.org/logo/nix-wiki.png", class "logo" ] []
|
|
|
|
|
]
|
|
|
|
|
, div [ class "nav-collapse collapse" ]
|
|
|
|
|
[ ul [ class "nav pull-left" ]
|
2020-10-28 23:38:46 +00:00
|
|
|
|
(viewNavigation model.route)
|
2020-06-12 10:20:28 +00:00
|
|
|
|
]
|
2020-06-11 07:14:21 +00:00
|
|
|
|
]
|
2020-04-10 08:13:50 +00:00
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
]
|
2020-06-12 10:20:28 +00:00
|
|
|
|
, div [ class "container main" ]
|
|
|
|
|
[ div [ id "content" ] [ viewPage model ]
|
|
|
|
|
, footer
|
|
|
|
|
[ class "container text-center" ]
|
|
|
|
|
[ div []
|
2020-08-07 12:44:19 +00:00
|
|
|
|
[ span [] [ text "Please help us improve the search by " ]
|
|
|
|
|
, a
|
|
|
|
|
[ href "https://github.com/NixOS/nixos-search/issues"
|
|
|
|
|
]
|
|
|
|
|
[ text "reporting issues" ]
|
2020-06-12 10:20:28 +00:00
|
|
|
|
, span [] [ text "." ]
|
|
|
|
|
]
|
|
|
|
|
, div []
|
2020-08-07 12:44:19 +00:00
|
|
|
|
[ span [] [ text "❤️ " ]
|
|
|
|
|
, span [] [ text "Elasticsearch instance graciously provided by " ]
|
|
|
|
|
, a [ href "https://bonsai.io" ] [ text "Bonsai" ]
|
|
|
|
|
, span [] [ text ". Thank you! ❤️ " ]
|
2020-06-12 10:20:28 +00:00
|
|
|
|
]
|
2020-06-04 23:13:52 +00:00
|
|
|
|
]
|
|
|
|
|
]
|
2020-03-28 04:09:01 +00:00
|
|
|
|
]
|
|
|
|
|
]
|
2020-06-12 10:20:28 +00:00
|
|
|
|
}
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
|
|
|
|
|
2020-10-28 23:38:46 +00:00
|
|
|
|
viewNavigation : Route.Route -> List (Html Msg)
|
|
|
|
|
viewNavigation route =
|
2020-06-10 12:03:44 +00:00
|
|
|
|
let
|
2020-10-28 23:38:46 +00:00
|
|
|
|
toRoute f =
|
|
|
|
|
case route of
|
|
|
|
|
-- Preserve arguments
|
2020-10-30 18:13:55 +00:00
|
|
|
|
Route.Packages searchArgs ->
|
|
|
|
|
f searchArgs
|
2020-06-10 12:03:44 +00:00
|
|
|
|
|
2020-10-30 18:13:55 +00:00
|
|
|
|
Route.Options searchArgs ->
|
|
|
|
|
f searchArgs
|
2020-06-10 12:03:44 +00:00
|
|
|
|
|
2020-10-28 23:38:46 +00:00
|
|
|
|
_ ->
|
2020-10-30 18:13:55 +00:00
|
|
|
|
f <| Route.SearchArgs Nothing Nothing Nothing Nothing Nothing Nothing
|
2020-06-10 12:03:44 +00:00
|
|
|
|
in
|
2020-10-28 23:38:46 +00:00
|
|
|
|
li [] [ a [ href "https://nixos.org" ] [ text "Back to nixos.org" ] ]
|
|
|
|
|
:: List.map
|
|
|
|
|
(viewNavigationItem route)
|
|
|
|
|
[ ( toRoute Route.Packages, "Packages" )
|
|
|
|
|
, ( toRoute Route.Options, "Options" )
|
|
|
|
|
]
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
viewNavigationItem :
|
2020-10-28 23:38:46 +00:00
|
|
|
|
Route.Route
|
|
|
|
|
-> ( Route.Route, String )
|
2020-05-08 13:24:58 +00:00
|
|
|
|
-> Html Msg
|
2020-10-28 23:38:46 +00:00
|
|
|
|
viewNavigationItem currentRoute ( route, title ) =
|
2020-05-08 13:24:58 +00:00
|
|
|
|
li
|
2020-10-28 23:38:46 +00:00
|
|
|
|
[ classList [ ( "active", currentRoute == route ) ] ]
|
|
|
|
|
[ a [ Route.href route ] [ text title ] ]
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
2020-04-10 09:04:03 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
viewPage : Model -> Html Msg
|
|
|
|
|
viewPage model =
|
|
|
|
|
case model.page of
|
|
|
|
|
NotFound ->
|
|
|
|
|
div [] [ text "Not Found" ]
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
Home _ ->
|
|
|
|
|
div [] [ text "Welcome" ]
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
Packages packagesModel ->
|
|
|
|
|
Html.map (\m -> PackagesMsg m) <| Page.Packages.view packagesModel
|
2020-04-10 08:13:50 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
Options optionsModel ->
|
|
|
|
|
Html.map (\m -> OptionsMsg m) <| Page.Options.view optionsModel
|
2020-04-07 05:05:50 +00:00
|
|
|
|
|
2020-03-31 03:22:27 +00:00
|
|
|
|
|
2020-05-08 13:24:58 +00:00
|
|
|
|
|
|
|
|
|
-- SUBSCRIPTIONS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subscriptions : Model -> Sub Msg
|
|
|
|
|
subscriptions _ =
|
|
|
|
|
Sub.none
|
2020-03-28 04:09:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- MAIN
|
|
|
|
|
|
|
|
|
|
|
2020-04-07 05:05:50 +00:00
|
|
|
|
main : Program Flags Model Msg
|
2020-03-28 04:09:01 +00:00
|
|
|
|
main =
|
|
|
|
|
Browser.application
|
|
|
|
|
{ init = init
|
2020-05-08 13:24:58 +00:00
|
|
|
|
, onUrlRequest = ClickedLink
|
|
|
|
|
, onUrlChange = ChangedUrl
|
|
|
|
|
, subscriptions = subscriptions
|
2020-03-28 04:09:01 +00:00
|
|
|
|
, update = update
|
2020-06-12 10:20:28 +00:00
|
|
|
|
, view = view
|
2020-03-28 04:09:01 +00:00
|
|
|
|
}
|