Maintainer | Thomas Hallgren |
---|---|
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
Haste Extras for WebFudgets
- imgElem :: MonadIO m => AttrValue -> m Elem
- imgElem' :: MonadIO m => [Attribute] -> AttrValue -> m Elem
- src :: AttrName
- alt :: AttrName
- canvasElem :: MonadIO m => (Int, Int) -> m Elem
- canvasElem' :: MonadIO m => Int -> (Int, Int) -> m Elem
- devicePixelRatio :: Int
- select :: MonadIO m => Elem -> m ()
- setChecked :: MonadIO m => Elem -> Bool -> m ()
- getChecked :: MonadIO m => Elem -> m Bool
- setBool :: MonadIO m => Elem -> PropID -> Bool -> m ()
- getBool :: MonadIO m => Elem -> PropID -> m Bool
- setValue :: (IsElem e, MonadIO m) => e -> String -> m ()
- documentHead :: Elem
- addStyleLink :: MonadIO m => AttrValue -> m ()
- metaViewport :: IO Elem
- addMetaViewport :: IO ()
- wrap1 :: (IsElem child, MonadIO m) => String -> child -> m Elem
- wrap :: (Foldable t, IsElem child, MonadIO m) => String -> t child -> m Elem
- wrap' :: (Foldable t, IsElem child, MonadIO m) => String -> [Attribute] -> t child -> m Elem
- cls :: (IsElem e, MonadIO m) => m e -> AttrValue -> m e
- ajaxGet :: MonadConc f => String -> f (Maybe String)
Creating specific elements
canvasElem :: MonadIO m => (Int, Int) -> m Elem
canvasElem' :: MonadIO m => Int -> (Int, Int) -> m Elem
Use canvasElem'
to make things look good on
high resolution screensdevicePixelRatio
Screen resolution
window.devicePixelRatio
(shouldn't really be a constant, since it might change if the users zooms)
Element properties
select :: MonadIO m => Elem -> m ()
Makes the text in an element selected (without moving the focus to the element)
setChecked :: MonadIO m => Elem -> Bool -> m ()
Set the boolean checked
property of an element
(useful for <input type="checkbox">
elements)
getChecked :: MonadIO m => Elem -> m Bool
Get the boolean checked
property of an element
(useful for <input type="checkbox">
elements)
setBool :: MonadIO m => Elem -> PropID -> Bool -> m ()
Set a boolean property of an element (e.g. "checked"
and "disabled"
)
getBool :: MonadIO m => Elem -> PropID -> m Bool
Get a boolean property of an element (e.g. "checked"
and "disabled"
)
Things for the document head
documentHead :: Elem
Reference to the document's <head>
element, analogous to documentBody
addStyleLink :: MonadIO m => AttrValue -> m ()
Add a link to a style sheet to the document head,
<link rel="stylesheet" type="text/css" href="url">
metaViewport :: IO Elem
<meta name="viewport" content="width=device-width">
addMetaViewport :: IO ()
Add metaViewport to the document head. Usually good for mobile browsers, no effect on desktop browsers.
Wrapping tags around elements
wrap :: (Foldable t, IsElem child, MonadIO m) => String -> t child -> m Elem
wrap "tag" children = <tag>children</tag>