Website

Check-in [8975f5e2dc]
Login
Overview
Comment:Playground now has a working textarea for editing source code.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8975f5e2dcdeabddfa4e49d91d12a00c4f0a1d82ec3cede8a283a58aa64ae0ef
User & Date: robin.hansen on 2020-11-03 05:29:29
Other Links: manifest | tags
Context
2020-11-03
06:09
Add feature to switch between different lessons in playground check-in: 114740dc32 user: robin.hansen tags: trunk
05:29
Playground now has a working textarea for editing source code. check-in: 8975f5e2dc user: robin.hansen tags: trunk
04:47
Setup elm architecture in playground. check-in: 50d720c73f user: robin.hansen tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified playground/src/Playground.elm from [e1b3cf3a0a] to [fa65de9674].

1
2
3
4


5
6
7
8
9
10
11
..
20
21
22
23
24
25
26
27
28
29
30
31



32

33
34
35
36
37
38
39
40






41






42
43
44
45
46
47
48
module Playground exposing (main)

import Browser
import Html exposing (Html)





-- MODEL


type alias Model =
................................................................................



-- Update


type Msg
    = NoOp


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =



    ( model, Cmd.none )




-- VIEW


view : Model -> Html Msg
view model =






    Html.text "Hello"









-- MAIN


main : Program () Model Msg




>
>







 







|




>
>
>
|
>








>
>
>
>
>
>
|
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
..
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module Playground exposing (main)

import Browser
import Html exposing (Html)
import Html.Attributes as Attributes
import Html.Events as Events



-- MODEL


type alias Model =
................................................................................



-- Update


type Msg
    = EditSource String


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
        EditSource newSource ->
            ( { model | source = newSource }
            , Cmd.none
            )



-- VIEW


view : Model -> Html Msg
view model =
    Html.div
        [ Attributes.style "height" "100vh"
        ]
        [ Html.h1
            []
            [ Html.text "Playground" ]
        , Html.textarea
            [ Attributes.style "width" "50vw"
            , Attributes.style "height" "50%"
            , Events.onInput EditSource
            ]
            [ Html.text model.source ]
        ]



-- MAIN


main : Program () Model Msg