Module

Web.Chain.DOM

Package
purescript-web-chain
Repository
david-sledge/purescript-web-chain

DOM manipulation tools that can be chained together.

#(+<) Source

Operator alias for Web.Chain.DOM.appendsNodes (non-associative / precedence 9)

#(+<<) Source

Operator alias for Web.Chain.DOM.appendsNodesM (non-associative / precedence 9)

#(>+) Source

Operator alias for Web.Chain.DOM.appendNodes (non-associative / precedence 9)

#(>>+) Source

Operator alias for Web.Chain.DOM.appendNodesM (non-associative / precedence 9)

#appendNodes Source

appendNodes :: forall m p f. Foldable f => MonadEffect m => NodeOp p => f (m Node) -> p -> m p

Extracts child nodes from a Foldable of continuations and appends them to a parent node. Returns the given parent node.

#appendNodesM Source

appendNodesM :: forall m p f. NodeOp p => Foldable f => MonadEffect m => f (m Node) -> m p -> m p

Extracts child nodes from a Foldable of continuations and appends them to a monadic parent node. Returns the given parent node.

#appendsNodes Source

appendsNodes :: forall m p f. NodeOp p => Foldable f => MonadEffect m => p -> f (m Node) -> m p

#appendsNodesM Source

appendsNodesM :: forall m p f. NodeOp p => Foldable f => MonadEffect m => m p -> f (m Node) -> m p

#attr Source

attr :: forall m e. MonadEffect m => ElementOp e => String -> e -> m (Maybe String)

Gets the value of the named attibute.

#attrM Source

attrM :: forall m e. MonadEffect m => ElementOp e => String -> m e -> m (Maybe String)

Gets the value of the named attibute.

#detach Source

detach :: forall c m. MonadEffect m => NodeOp c => c -> m c

Detatches a node from its parent node and returns the detached node. Descendant nodes and event listeners are not affected. The detatched node is returned.

#detachM Source

detachM :: forall c m. MonadEffect m => NodeOp c => m c -> m c

Detatches a node from its parent node and returns the detached node. Descendant nodes and event listeners are not affected. The detatched node is returned.

#doc Source

doc :: forall m. MonadEffect m => m HTMLDocument

#el Source

el :: forall m f1 f2. Bind m => MonadEffect m => Foldable f1 => Foldable f2 => String -> f1 (String /\ String) -> f2 (m Node) -> m Element

Creates an element, set attributes, and appends child nodes.

#eln Source

eln :: forall m f1 f2. Bind m => MonadEffect m => Foldable f1 => Foldable f2 => String -> f1 (String /\ String) -> f2 (m Node) -> m Node

Calls el and applies the result to nd: nd <<< el tagName attributes.

#empty Source

empty :: forall m p. MonadEffect m => NodeOp p => p -> m p

Calls remove on the all of the node's children. The emptied node is returned.

#emptyM Source

emptyM :: forall m p. MonadEffect m => NodeOp p => m p -> m p

Calls remove on the all of the node's children. The emptied node is returned.

#nd Source

nd :: forall n m. NodeOp n => Applicative m => n -> m Node

#ndM Source

ndM :: forall n m. Functor m => NodeOp n => m n -> m Node

Put an instance of a NodeOp in a continuation.

#remove Source

remove :: forall c m. MonadEffect m => NodeOp c => c -> m c

Calls detach on the node and its descendants, and in addition removes all event listeners from the detached node and descendants. The event listners are removed provided that they were added using Web.Event.Class.EventTargetOp.on or derivation thereof such as Web.Event.Class.EventTargetOp.change or Web.Event.Class.EventTargetOp.ready. The removed node is returned.

#removeM Source

removeM :: forall c m. MonadEffect m => NodeOp c => m c -> m c

Calls detach on the node and its descendants, and in addition removes all event listeners from the detached node and descendants. The event listners are removed provided that they were added using Web.Event.Class.EventTargetOp.on or derivation thereof such as Web.Event.Class.EventTargetOp.change or Web.Event.Class.EventTargetOp.ready. The removed node is returned.

#rmAttr Source

rmAttr :: forall m e. MonadEffect m => ElementOp e => String -> e -> m e

Removes an attribute from an element. The element is returned.

#rmAttrM Source

rmAttrM :: forall m e. MonadEffect m => ElementOp e => String -> m e -> m e

Removes an attribute from an element. The element is returned.

#setAttrs Source

setAttrs :: forall e f m. Foldable f => ElementOp e => MonadEffect m => f (String /\ String) -> e -> m e

Sets the attributes of an element. Existing attributes of the same names are overwritten. New names create new attributes. The element is returned.

#setAttrsM Source

setAttrsM :: forall e f m. Foldable f => ElementOp e => MonadEffect m => f (String /\ String) -> m e -> m e

Sets the attributes of an element. Existing attributes of the same names are overwritten. New names create new attributes. The element is returned.

#tx Source

tx :: forall m. MonadEffect m => String -> m Text

Creates a text node from a String.

#txn Source

txn :: forall m. MonadEffect m => String -> m Node

Calls tx and applies the result to nd: nd <<< tx.