Skip to content

Commit

Permalink
Merge branch '0.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
evancz committed Nov 14, 2016
2 parents c8fdd50 + 1d6a46c commit a8b4d2c
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 36 deletions.
16 changes: 8 additions & 8 deletions elm-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-lang/html": "1.0.0 <= v < 2.0.0",
"elm-lang/svg": "1.0.0 <= v < 2.0.0",
"elm-lang/websocket": "1.0.0 <= v < 2.0.0",
"evancz/elm-http": "3.0.1 <= v < 4.0.0",
"evancz/elm-markdown": "3.0.0 <= v < 4.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 3.0.0",
"elm-lang/http": "1.0.0 <= v < 2.0.0",
"elm-lang/svg": "2.0.0 <= v < 3.0.0",
"elm-lang/websocket": "1.0.2 <= v < 2.0.0",
"evancz/elm-markdown": "3.0.1 <= v < 4.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
}
"elm-version": "0.18.0 <= v < 0.19.0"
}
3 changes: 1 addition & 2 deletions examples/01-button.elm
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import Html exposing (Html, button, div, text)
import Html.App as App
import Html.Events exposing (onClick)



main =
App.beginnerProgram
Html.beginnerProgram
{ model = model
, view = view
, update = update
Expand Down
1 change: 0 additions & 1 deletion examples/02-field.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Html exposing (Html, div, input, text)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)
import String
Expand Down
7 changes: 3 additions & 4 deletions examples/03-form.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)

Expand Down Expand Up @@ -58,9 +57,9 @@ update msg model =
view : Model -> Html Msg
view model =
div []
[ input [ type' "text", placeholder "Name", onInput Name ] []
, input [ type' "password", placeholder "Password", onInput Password ] []
, input [ type' "password", placeholder "Re-enter Password", onInput PasswordAgain ] []
[ input [ type_ "text", placeholder "Name", onInput Name ] []
, input [ type_ "password", placeholder "Password", onInput Password ] []
, input [ type_ "password", placeholder "Re-enter Password", onInput PasswordAgain ] []
, viewValidation model
]

Expand Down
1 change: 0 additions & 1 deletion examples/04-random.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Html exposing (..)
import Html.App as Html
import Html.Events exposing (..)
import Random

Expand Down
17 changes: 7 additions & 10 deletions examples/05-http.elm
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Http
import Json.Decode as Json
import Task
import Json.Decode as Decode



Expand Down Expand Up @@ -40,8 +38,7 @@ init topic =

type Msg
= MorePlease
| FetchSucceed String
| FetchFail Http.Error
| NewGif (Result Http.Error String)


update : Msg -> Model -> (Model, Cmd Msg)
Expand All @@ -50,10 +47,10 @@ update msg model =
MorePlease ->
(model, getRandomGif model.topic)

FetchSucceed newUrl ->
NewGif (Ok newUrl) ->
(Model model.topic newUrl, Cmd.none)

FetchFail _ ->
NewGif (Err _) ->
(model, Cmd.none)


Expand Down Expand Up @@ -90,9 +87,9 @@ getRandomGif topic =
url =
"https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=" ++ topic
in
Task.perform FetchFail FetchSucceed (Http.get decodeGifUrl url)
Http.send NewGif (Http.get url decodeGifUrl)


decodeGifUrl : Json.Decoder String
decodeGifUrl : Decode.Decoder String
decodeGifUrl =
Json.at ["data", "image_url"] Json.string
Decode.at ["data", "image_url"] Decode.string
1 change: 0 additions & 1 deletion examples/06-clock.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Html exposing (Html)
import Html.App as Html
import Svg exposing (..)
import Svg.Attributes exposing (..)
import Time exposing (Time, second)
Expand Down
1 change: 0 additions & 1 deletion examples/07-websockets.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import WebSocket
Expand Down
7 changes: 3 additions & 4 deletions examples/08-checkboxes.elm
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Html exposing (Html, fieldset, input, label, text)
import Html.App as App
import Html.Attributes exposing (style, type')
import Html.Attributes exposing (style, type_)
import Html.Events exposing (onClick)



main =
App.beginnerProgram { model = optOut, update = update, view = view }
Html.beginnerProgram { model = optOut, update = update, view = view }



Expand Down Expand Up @@ -66,6 +65,6 @@ checkbox msg name =
label
[ style [("padding", "20px")]
]
[ input [ type' "checkbox", onClick msg ] []
[ input [ type_ "checkbox", onClick msg ] []
, text name
]
7 changes: 3 additions & 4 deletions examples/09-radio.elm
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import Html exposing (Html, Attribute, div, fieldset, input, label, text)
import Html.App as App
import Html.Attributes exposing (name, style, type')
import Html.Attributes exposing (name, style, type_)
import Html.Events exposing (onClick)
import Markdown



main =
App.beginnerProgram { model = chapter1, update = update, view = view }
Html.beginnerProgram { model = chapter1, update = update, view = view }



Expand Down Expand Up @@ -84,7 +83,7 @@ radio value msg =
label
[ style [("padding", "20px")]
]
[ input [ type' "radio", name "font-size", onClick msg ] []
[ input [ type_ "radio", name "font-size", onClick msg ] []
, text value
]

Expand Down

0 comments on commit a8b4d2c

Please sign in to comment.