{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Miso.Svg.Event
(
onBegin
, onEnd
, onRepeat
, onAbort
, onError
, onResize
, onScroll
, onZoom
, onActivate
, onClick
, onFocusIn
, onFocusOut
, onMouseDown
, onMouseMove
, onMouseOut
, onMouseOver
, onMouseUp
) where
import Miso.Event (on, emptyDecoder)
import Miso.Html.Event (onClick)
import Miso.Types (Attribute)
onBegin :: action -> Attribute model action
onBegin :: forall action model. action -> Attribute model action
onBegin action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"begin" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onEnd :: action -> Attribute model action
onEnd :: forall action model. action -> Attribute model action
onEnd action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"end" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onRepeat :: action -> Attribute model action
onRepeat :: forall action model. action -> Attribute model action
onRepeat action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"repeat" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onAbort :: action -> Attribute model action
onAbort :: forall action model. action -> Attribute model action
onAbort action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"abort" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onError :: action -> Attribute model action
onError :: forall action model. action -> Attribute model action
onError action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"error" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onResize :: action -> Attribute model action
onResize :: forall action model. action -> Attribute model action
onResize action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"resize" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onScroll :: action -> Attribute model action
onScroll :: forall action model. action -> Attribute model action
onScroll action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"scroll" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onZoom :: action -> Attribute model action
onZoom :: forall action model. action -> Attribute model action
onZoom action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"zoom" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onActivate :: action -> Attribute model action
onActivate :: forall action model. action -> Attribute model action
onActivate action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"activate" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onFocusIn :: action -> Attribute model action
onFocusIn :: forall action model. action -> Attribute model action
onFocusIn action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"focusin" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onFocusOut :: action -> Attribute model action
onFocusOut :: forall action model. action -> Attribute model action
onFocusOut action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"focusout" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onMouseDown :: action -> Attribute model action
onMouseDown :: forall action model. action -> Attribute model action
onMouseDown action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"mousedown" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onMouseMove :: action -> Attribute model action
onMouseMove :: forall action model. action -> Attribute model action
onMouseMove action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"mousemove" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onMouseOut :: action -> Attribute model action
onMouseOut :: forall action model. action -> Attribute model action
onMouseOut action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"mouseout" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onMouseOver :: action -> Attribute model action
onMouseOver :: forall action model. action -> Attribute model action
onMouseOver action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"mouseover" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action
onMouseUp :: action -> Attribute model action
onMouseUp :: forall action model. action -> Attribute model action
onMouseUp action
action = MisoString
-> Decoder ()
-> (() -> model -> DOMRef -> action)
-> Attribute model action
forall result model action.
MisoString
-> Decoder result
-> (result -> model -> DOMRef -> action)
-> Attribute model action
on MisoString
"mouseup" Decoder ()
emptyDecoder ((() -> model -> DOMRef -> action) -> Attribute model action)
-> (() -> model -> DOMRef -> action) -> Attribute model action
forall a b. (a -> b) -> a -> b
$ \() model
_ DOMRef
_ -> action
action