Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a DSL of Events found on HTML elements.
This DSL is entirely optional. You may use the Prop
s PListener
constructor
provided by Shpadoinkle core and completely ignore this module.
You can use the listener
, listen
, listenRaw
, listenC
, and listenM
convenience
functions as well without using this module. For those who like a typed
DSL with named functions and overloading, this is for you.
All listeners come in 4 flavors. Unctuous flavors. Plain (onInput
), continuous (onInputC
), monadic (onInputM
), and forgetful (onInputM_
).
A flavor providing access to the RawNode
and the RawEvent
are not provided
here. If you want access to these, try the listenRaw
constructor. The intent
of this DSL is to provide simple named functions.
Right now this module features limited specialization, but ideally we specialize
all of these listeners. For example, the onInput
listener takes a function
(Text -> a -> a)
where Text
is the current value of the input and onKeyup
takes
a function of type (KeyCode -> a -> a)
from Keyboard
. Mouse move
listeners, for example, should take a function of ((Float, Float) -> a -> a)
, but
this work is not yet done.
Documentation
mkWithFormVal :: (JSVal -> JSM v) -> Text -> JSString -> (v -> Continuation m a) -> (Text, Prop m a) Source #
onBeforeinputC :: (Text -> Continuation m a) -> (Text, Prop m a) Source #
onKeydownC :: (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
onKeypressC :: (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
preventDefault :: RawEvent -> JSM () Source #
stopPropagation :: RawEvent -> JSM () Source #
mkGlobalMailbox :: Continuation m a -> JSM (JSM (), STM (Continuation m a)) Source #
mkGlobalMailboxAfforded :: (b -> Continuation m a) -> JSM (b -> JSM (), STM (Continuation m a)) Source #
onClickAwayC :: Continuation m a -> (Text, Prop m a) Source #
onClickAway :: (a -> a) -> (Text, Prop m a) Source #
mkGlobalKey :: Text -> (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
mkGlobalKeyNoRepeat :: Text -> (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
onGlobalKeyPressC :: (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
onGlobalKeyDownC :: (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
onGlobalKeyUpC :: (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
onGlobalKeyDownNoRepeatC :: (KeyCode -> Continuation m a) -> (Text, Prop m a) Source #
onWaitingC :: Continuation m a -> (Text, Prop m a) Source #
onVolumechange :: (a -> a) -> (Text, Prop m a) Source #
onVolumechangeC :: Continuation m a -> (Text, Prop m a) Source #
onTransitionstart :: (a -> a) -> (Text, Prop m a) Source #
onTransitionstartC :: Continuation m a -> (Text, Prop m a) Source #
onTransitionrun :: (a -> a) -> (Text, Prop m a) Source #
onTransitionrunC :: Continuation m a -> (Text, Prop m a) Source #
onTransitionend :: (a -> a) -> (Text, Prop m a) Source #
onTransitionendC :: Continuation m a -> (Text, Prop m a) Source #
onTransitioncancel :: (a -> a) -> (Text, Prop m a) Source #
onTransitioncancelC :: Continuation m a -> (Text, Prop m a) Source #
onTouchstart :: (a -> a) -> (Text, Prop m a) Source #
onTouchstartC :: Continuation m a -> (Text, Prop m a) Source #
onTouchmove :: (a -> a) -> (Text, Prop m a) Source #
onTouchmoveC :: Continuation m a -> (Text, Prop m a) Source #
onTouchend :: (a -> a) -> (Text, Prop m a) Source #
onTouchendC :: Continuation m a -> (Text, Prop m a) Source #
onTouchcancel :: (a -> a) -> (Text, Prop m a) Source #
onTouchcancelC :: Continuation m a -> (Text, Prop m a) Source #
onTimeupdate :: (a -> a) -> (Text, Prop m a) Source #
onTimeupdateC :: Continuation m a -> (Text, Prop m a) Source #
onSuspendC :: Continuation m a -> (Text, Prop m a) Source #
onStorageC :: Continuation m a -> (Text, Prop m a) Source #
onStalledC :: Continuation m a -> (Text, Prop m a) Source #
onSeekingC :: Continuation m a -> (Text, Prop m a) Source #
onRatechange :: (a -> a) -> (Text, Prop m a) Source #
onRatechangeC :: Continuation m a -> (Text, Prop m a) Source #
onProgress :: (a -> a) -> (Text, Prop m a) Source #
onProgressC :: Continuation m a -> (Text, Prop m a) Source #
onPopstate :: (a -> a) -> (Text, Prop m a) Source #
onPopstateC :: Continuation m a -> (Text, Prop m a) Source #
onPointerup :: (a -> a) -> (Text, Prop m a) Source #
onPointerupC :: Continuation m a -> (Text, Prop m a) Source #
onPointerover :: (a -> a) -> (Text, Prop m a) Source #
onPointeroverC :: Continuation m a -> (Text, Prop m a) Source #
onPointerout :: (a -> a) -> (Text, Prop m a) Source #
onPointeroutC :: Continuation m a -> (Text, Prop m a) Source #
onPointermove :: (a -> a) -> (Text, Prop m a) Source #
onPointermoveC :: Continuation m a -> (Text, Prop m a) Source #
onPointerleave :: (a -> a) -> (Text, Prop m a) Source #
onPointerleaveC :: Continuation m a -> (Text, Prop m a) Source #
onPointerenter :: (a -> a) -> (Text, Prop m a) Source #
onPointerenterC :: Continuation m a -> (Text, Prop m a) Source #
onPointerdown :: (a -> a) -> (Text, Prop m a) Source #
onPointerdownC :: Continuation m a -> (Text, Prop m a) Source #
onPointercancel :: (a -> a) -> (Text, Prop m a) Source #
onPointercancelC :: Continuation m a -> (Text, Prop m a) Source #
onPlayingC :: Continuation m a -> (Text, Prop m a) Source #
onPageshow :: (a -> a) -> (Text, Prop m a) Source #
onPageshowC :: Continuation m a -> (Text, Prop m a) Source #
onPagehide :: (a -> a) -> (Text, Prop m a) Source #
onPagehideC :: Continuation m a -> (Text, Prop m a) Source #
onOfflineC :: Continuation m a -> (Text, Prop m a) Source #
onMousewheel :: (a -> a) -> (Text, Prop m a) Source #
onMousewheelC :: Continuation m a -> (Text, Prop m a) Source #
onMouseupC :: Continuation m a -> (Text, Prop m a) Source #
onMouseover :: (a -> a) -> (Text, Prop m a) Source #
onMouseoverC :: Continuation m a -> (Text, Prop m a) Source #
onMouseout :: (a -> a) -> (Text, Prop m a) Source #
onMouseoutC :: Continuation m a -> (Text, Prop m a) Source #
onMousemove :: (a -> a) -> (Text, Prop m a) Source #
onMousemoveC :: Continuation m a -> (Text, Prop m a) Source #
onMouseleave :: (a -> a) -> (Text, Prop m a) Source #
onMouseleaveC :: Continuation m a -> (Text, Prop m a) Source #
onMouseenter :: (a -> a) -> (Text, Prop m a) Source #
onMouseenterC :: Continuation m a -> (Text, Prop m a) Source #
onMousedown :: (a -> a) -> (Text, Prop m a) Source #
onMousedownC :: Continuation m a -> (Text, Prop m a) Source #
onMessageC :: Continuation m a -> (Text, Prop m a) Source #
onLostpointercapture :: (a -> a) -> (Text, Prop m a) Source #
onLostpointercaptureC :: Continuation m a -> (Text, Prop m a) Source #
onLoadstart :: (a -> a) -> (Text, Prop m a) Source #
onLoadstartC :: Continuation m a -> (Text, Prop m a) Source #
onLoadedmetadata :: (a -> a) -> (Text, Prop m a) Source #
onLoadedmetadataC :: Continuation m a -> (Text, Prop m a) Source #
onLoadeddata :: (a -> a) -> (Text, Prop m a) Source #
onLoadeddataC :: Continuation m a -> (Text, Prop m a) Source #
onInvalidC :: Continuation m a -> (Text, Prop m a) Source #
onHashchange :: (a -> a) -> (Text, Prop m a) Source #
onHashchangeC :: Continuation m a -> (Text, Prop m a) Source #
onGotpointercapture :: (a -> a) -> (Text, Prop m a) Source #
onGotpointercaptureC :: Continuation m a -> (Text, Prop m a) Source #
onFocusout :: (a -> a) -> (Text, Prop m a) Source #
onFocusoutC :: Continuation m a -> (Text, Prop m a) Source #
onFocusinC :: Continuation m a -> (Text, Prop m a) Source #
onEmptiedC :: Continuation m a -> (Text, Prop m a) Source #
onDurationchange :: (a -> a) -> (Text, Prop m a) Source #
onDurationchangeC :: Continuation m a -> (Text, Prop m a) Source #
onDragstart :: (a -> a) -> (Text, Prop m a) Source #
onDragstartC :: Continuation m a -> (Text, Prop m a) Source #
onDragover :: (a -> a) -> (Text, Prop m a) Source #
onDragoverC :: Continuation m a -> (Text, Prop m a) Source #
onDragleave :: (a -> a) -> (Text, Prop m a) Source #
onDragleaveC :: Continuation m a -> (Text, Prop m a) Source #
onDragenter :: (a -> a) -> (Text, Prop m a) Source #
onDragenterC :: Continuation m a -> (Text, Prop m a) Source #
onDragendC :: Continuation m a -> (Text, Prop m a) Source #
onDblclick :: (a -> a) -> (Text, Prop m a) Source #
onDblclickC :: Continuation m a -> (Text, Prop m a) Source #
onContextmenu :: (a -> a) -> (Text, Prop m a) Source #
onContextmenuC :: Continuation m a -> (Text, Prop m a) Source #
onCanplaythrough :: (a -> a) -> (Text, Prop m a) Source #
onCanplaythroughC :: Continuation m a -> (Text, Prop m a) Source #
onCanplayC :: Continuation m a -> (Text, Prop m a) Source #
onBeforeunload :: (a -> a) -> (Text, Prop m a) Source #
onBeforeunloadC :: Continuation m a -> (Text, Prop m a) Source #
onBeforeprint :: (a -> a) -> (Text, Prop m a) Source #
onBeforeprintC :: Continuation m a -> (Text, Prop m a) Source #
onAnimationstart :: (a -> a) -> (Text, Prop m a) Source #
onAnimationstartC :: Continuation m a -> (Text, Prop m a) Source #
onAnimationiteration :: (a -> a) -> (Text, Prop m a) Source #
onAnimationiterationC :: Continuation m a -> (Text, Prop m a) Source #
onAnimationend :: (a -> a) -> (Text, Prop m a) Source #
onAnimationendC :: Continuation m a -> (Text, Prop m a) Source #
onAnimationcancel :: (a -> a) -> (Text, Prop m a) Source #
onAnimationcancelC :: Continuation m a -> (Text, Prop m a) Source #
onAfterprint :: (a -> a) -> (Text, Prop m a) Source #
onAfterprintC :: Continuation m a -> (Text, Prop m a) Source #