Copyright | (c) Marat Khafizov 2018 |
---|---|
License | BSD-3 |
Maintainer | xafizoff@gmail.com |
Stability | experimental |
Portability | not portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Nitro DSL to build interactive user interfaces
Synopsis
- data Element a
- data Action a
- data Event a = Event {
- eventTarget :: ByteString
- eventPostback :: a
- eventType :: ByteString
- eventSource :: [ByteString]
- wireEl :: Binary a => Element a -> N2O f a (Result a)
- wire :: forall f a. Binary a => Action a -> N2O f a (Result a)
- renderActions :: Binary a => [Action a] -> N2O f a ByteString
- renderAction :: Binary a => Action a -> N2O f a ByteString
- renderElements :: Binary a => [Element a] -> N2O f a ByteString
- renderElement :: Binary a => Element a -> N2O f a ByteString
- renderEvent :: Event a -> N2O f a ByteString
- baseElement :: Element a
- button :: Element a
- panel :: Element a
- text :: Text -> Element a
- br :: Element a
- textbox :: Element a
- updateText :: Binary a => ByteString -> Text -> N2O f a (Result a)
- insertBottom :: Binary a => ByteString -> Element a -> N2O f a (Result a)
- jsEscapeT :: Text -> Text
- jsEscape :: ByteString -> Text
- defPickle :: Show a => a -> ByteString
- defDePickle :: Read a => ByteString -> Maybe a
- getActions :: Binary a => N2O f a [Action a]
- putActions :: Binary a => [Action a] -> N2O f a ()
Documentation
An HTML element
Element | |
| |
Text Text |
Instances
Action that can be rendered as JavaScript events
Instances
Show a => Show (Action a) Source # | |
Generic (Action a) Source # | |
Binary a => Binary (Action a) Source # | |
type Rep (Action a) Source # | |
Defined in Network.N2O.Nitro type Rep (Action a) = D1 (MetaData "Action" "Network.N2O.Nitro" "n2o-nitro-0.11.2-G1wS1Q6cTxBAhnJBZy76MW" False) (C1 (MetaCons "AEvent" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Event a))) :+: (C1 (MetaCons "AElement" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Element a))) :+: C1 (MetaCons "ARaw" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))) |
A JavaScript event
Event | |
|
Instances
Show a => Show (Event a) Source # | |
Generic (Event a) Source # | |
Binary a => Binary (Event a) Source # | |
type Rep (Event a) Source # | |
Defined in Network.N2O.Nitro type Rep (Event a) = D1 (MetaData "Event" "Network.N2O.Nitro" "n2o-nitro-0.11.2-G1wS1Q6cTxBAhnJBZy76MW" False) (C1 (MetaCons "Event" PrefixI True) ((S1 (MetaSel (Just "eventTarget") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString) :*: S1 (MetaSel (Just "eventPostback") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) :*: (S1 (MetaSel (Just "eventType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString) :*: S1 (MetaSel (Just "eventSource") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [ByteString])))) |
renderActions :: Binary a => [Action a] -> N2O f a ByteString Source #
Render list of actions to JavaScript
renderAction :: Binary a => Action a -> N2O f a ByteString Source #
Render an action
renderElements :: Binary a => [Element a] -> N2O f a ByteString Source #
Render list of elements to the HTML
renderElement :: Binary a => Element a -> N2O f a ByteString Source #
Render element to the HTML
renderEvent :: Event a -> N2O f a ByteString Source #
Render event
baseElement :: Element a Source #
Element constructor
updateText :: Binary a => ByteString -> Text -> N2O f a (Result a) Source #
Update text content of the element with the specified id
insertBottom :: Binary a => ByteString -> Element a -> N2O f a (Result a) Source #
jsEscape :: ByteString -> Text Source #
Escape untrusted text to prevent XSS
defPickle :: Show a => a -> ByteString Source #
Default pickler
defDePickle :: Read a => ByteString -> Maybe a Source #
Default depickler