From 1f06679a739ba0be3b6b91c10bfd762a06c9573a Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 10 May 2015 13:06:08 +0200 Subject: Migrationg to Elm 0.15 --- src/View/Timer.elm | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'src/View/Timer.elm') diff --git a/src/View/Timer.elm b/src/View/Timer.elm index a88f9dd..c4b3bbb 100644 --- a/src/View/Timer.elm +++ b/src/View/Timer.elm @@ -2,29 +2,29 @@ module View.Timer ( timerView ) where -import Html (..) -import Html.Attributes (..) -import Html.Events (..) -import Time (Time) +import Html exposing (..) +import Html.Attributes exposing (..) +import Html.Events exposing (..) +import Time exposing (Time) import Signal import Maybe import List import String -import Model.Model (..) -import Model.Timer (..) -import Model.Edition.Edition (..) -import Model.Edition.NameEdition (..) -import Model.Edition.TimeEdition (..) -import Model.TimerState (..) -import Model.Id (..) +import Model.Model exposing (..) +import Model.Timer exposing (..) +import Model.Edition.Edition exposing (..) +import Model.Edition.NameEdition exposing (..) +import Model.Edition.TimeEdition exposing (..) +import Model.TimerState exposing (..) +import Model.Id exposing (..) -import Update.Update (..) -import Update.UpdateTimer (..) +import Update.Update exposing (..) +import Update.UpdateTimer exposing (..) -import View.ActivatedClasses (..) +import View.ActivatedClasses exposing (..) -import Utils.Maybe (..) +import Utils.Maybe exposing (..) timerView : Model -> (Id, Timer) -> Html timerView model (id, timer) = @@ -41,7 +41,7 @@ nameBlockReadOnly : Id -> Timer -> Html nameBlockReadOnly id timer = div [ class "name block" - , onClick (Signal.send updates (Edit id Name)) + , onClick actions.address (Edit id Name) ] [ text (timerName id timer) ] @@ -52,7 +52,7 @@ nameBlockEdition id timer edition = , (isEmpty edition, "empty") ] |> activatedClasses - , onClick (Signal.send updates NoOp) + , onClick actions.address NoOp ] [ if isEmpty edition then @@ -75,10 +75,9 @@ timeBlockReadOnly id timer = , (timer.state == Running, "isRunning") ] |> activatedClasses - , onClick - <| if timer.state == Ringing - then Signal.send updates (UpdateTimer id Stop) - else Signal.send updates (Edit id Time) + , if timer.state == Ringing + then onClick actions.address (UpdateTimer id Stop) + else onClick actions.address (Edit id Time) ] [ timeWithProgressBar timer ] @@ -89,7 +88,7 @@ timeBlockEdition timer edition = , (isEmpty edition, "empty") ] |> activatedClasses - , onClick (Signal.send updates NoOp) + , onClick actions.address NoOp ] [ if isEmpty edition then @@ -134,7 +133,7 @@ playPauseBlock : (Id, Timer) -> Html playPauseBlock (id, timer) = button [ class <| "playPause block" - , onClick (Signal.send updates (UpdateTimer id ToggleRunning)) + , onClick actions.address (UpdateTimer id ToggleRunning) ] [ let icon = if timer.state == Running then "fa-pause" else "fa-play" in i @@ -146,7 +145,7 @@ stopBlock : (Id, Timer) -> Html stopBlock (id, timer) = button [ class <| "stop block" - , onClick (Signal.send updates (UpdateTimer id Stop)) + , onClick actions.address (UpdateTimer id Stop) ] [ i [ class "fa fa-fw fa-stop" ] [] ] @@ -154,7 +153,7 @@ removeBlock : (Id, Timer) -> Html removeBlock (id, timer) = button [ class <| "remove block" - , onClick (Signal.send updates (RemoveTimer id)) + , onClick actions.address (RemoveTimer id) ] [ i [ class "fa fa-fw fa-remove" ] [] ] -- cgit v1.2.3