@@ -138,6 +138,7 @@ dynComment t = do
138display :: (PostBuild t m, DomBuilder t m, Show a) => Dynamic t a -> m ()
138display :: (PostBuild t m, DomBuilder t m, Show a) => Dynamic t a -> m ()
139display = dynText . fmap (T.pack . show)
139display = dynText . fmap (T.pack . show)
141+{-# DEPRECATED button "Use 'elAttr'' in combination with 'domEvent' instead" #-}
141button :: DomBuilder t m => Text -> m (Event t ())
142button :: DomBuilder t m => Text -> m (Event t ())
142button t = do
143button t = do
143 (e, _) <- element "button" def $ text t
144 (e, _) <- element "button" def $ text t
@@ -145,7 +146,9 @@ button t = do
146--TODO: Should this be renamed to 'widgetView' for consistency with 'widgetHold'?
147--TODO: Should this be renamed to 'widgetView' for consistency with 'widgetHold'?
147-- | Given a Dynamic of widget-creating actions, create a widget that is recreated whenever the Dynamic updates.
148-- | Given a Dynamic of widget-creating actions, create a widget that is recreated whenever the Dynamic updates.
148−-- The returned Event of widget results occurs when the Dynamic does.
149+-- The returned Event occurs whenever the child widget is updated, which is
150+-- at post-build in addition to the times at which the input Dynamic is
151+-- updated, and its value is the result of running the widget.
149-- Note: Often, the type @a@ is an 'Event', in which case the return value is an Event-of-Events that would typically be flattened (via 'switchHold').
152-- Note: Often, the type @a@ is an 'Event', in which case the return value is an Event-of-Events that would typically be flattened (via 'switchHold').
150dyn :: (Adjustable t m, NotReady t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
153dyn :: (Adjustable t m, NotReady t m, PostBuild t m) => Dynamic t (m a) -> m (Event t a)
151dyn = networkView
154dyn = networkView
@@ -269,45 +272,25 @@ dynamicAttributesToModifyAttributesWithInitial attrs0 d = do
269 return $ if Map.null p then Nothing else Just p
272 return $ if Map.null p then Nothing else Just p
270 return modificationsNeeded
273 return modificationsNeeded
272−--------------------------------------------------------------------------------
275+{-# DEPRECATED Link "Will be removed when 'linkClass' and 'link' are removed. Follow those functions' deprecation instructions." #-}
273−-- Copied and pasted from Reflex.Widget.Class
274−--------------------------------------------------------------------------------
277−schedulePostBuild x = performEvent_ . (x <$) =<< getPostBuild
279−elDynHtml' :: DomBuilder t m => Text -> Dynamic t Text -> m (El t)
280−elDynHtml' elementTag html = do
281− e <- buildEmptyElement elementTag (Map.empty :: Map Text Text)
282− schedulePostBuild $ setInnerHTML e . Just =<< sample (current html)
283− performEvent_ $ fmap (setInnerHTML e . Just) $ updated html
284− wrapElement defaultDomEventHandler e
286−elDynHtmlAttr' :: DomBuilder t m => Text -> Map Text Text -> Dynamic t Text -> m (El t)
287−elDynHtmlAttr' elementTag attrs html = do
288− e <- buildEmptyElement elementTag attrs
289− schedulePostBuild $ setInnerHTML e . Just =<< sample (current html)
290− performEvent_ $ fmap (setInnerHTML e . Just) $ updated html
291− wrapElement defaultDomEventHandler e
294newtype Link t
276newtype Link t
295 = Link { _link_clicked :: Event t ()
277 = Link { _link_clicked :: Event t ()
298−-- | >>> linkClass "Click here" "link-class"
280+{-# DEPRECATED linkClass "Use 'elAttr'' in combination with 'domEvent' for just clicks. Use 'routeLink' for Obelisk navigation" #-}
299−-- > <a class="link-class">Click here</a>
300linkClass :: DomBuilder t m => Text -> Text -> m (Link t)
281linkClass :: DomBuilder t m => Text -> Text -> m (Link t)
301linkClass s c = do
282linkClass s c = do
302 (l,_) <- elAttr' "a" ("class" =: c) $ text s
283 (l,_) <- elAttr' "a" ("class" =: c) $ text s
303 return $ Link $ domEvent Click l
284 return $ Link $ domEvent Click l
286+{-# DEPRECATED link "Use 'elAttr'' in combination with 'domEvent' for just clicks. Use 'routeLink' for Obelisk navigation" #-}
305link :: DomBuilder t m => Text -> m (Link t)
287link :: DomBuilder t m => Text -> m (Link t)
306link s = linkClass s ""
288link s = linkClass s ""
308divClass :: forall t m a. DomBuilder t m => Text -> m a -> m a
290divClass :: forall t m a. DomBuilder t m => Text -> m a -> m a
309divClass = elClass "div"
291divClass = elClass "div"
293+{-# DEPRECATED dtdd "Use an application specific widget generating function" #-}
311dtdd :: forall t m a. DomBuilder t m => Text -> m a -> m a
294dtdd :: forall t m a. DomBuilder t m => Text -> m a -> m a
312dtdd h w = do
295dtdd h w = do
313 el "dt" $ text h
296 el "dt" $ text h
@@ -316,7 +299,9 @@ dtdd h w = do
316blank :: forall m. Monad m => m ()
299blank :: forall m. Monad m => m ()
317blank = return ()
300blank = return ()
302+-- TODO: Move to an example project.
319-- | A widget to display a table with static columns and dynamic rows.
303-- | A widget to display a table with static columns and dynamic rows.
304+{-# DEPRECATED tableDynAttr "Use an application specific widget generating function" #-}
320tableDynAttr :: forall t m r k v. (Ord k, DomBuilder t m, MonadHold t m, PostBuild t m, MonadFix m)
305tableDynAttr :: forall t m r k v. (Ord k, DomBuilder t m, MonadHold t m, PostBuild t m, MonadFix m)
321 => Text -- ^ Class applied to <table> element
306 => Text -- ^ Class applied to <table> element
322 -> [(Text, k -> Dynamic t r -> m v)] -- ^ Columns of (header, row key -> row value -> child widget)
307 -> [(Text, k -> Dynamic t r -> m v)] -- ^ Columns of (header, row key -> row value -> child widget)
@@ -332,9 +317,11 @@ tableDynAttr klass cols dRows rowAttrs = elAttr "div" (Map.singleton "style" "zo
332 dAttrs <- rowAttrs k
317 dAttrs <- rowAttrs k
333 elDynAttr' "tr" dAttrs $ mapM (\x -> el "td" $ snd x k r) cols)
318 elDynAttr' "tr" dAttrs $ mapM (\x -> el "td" $ snd x k r) cols)
320+-- TODO: Move to an example project.
335-- | A widget to construct a tabbed view that shows only one of its child widgets at a time.
321-- | A widget to construct a tabbed view that shows only one of its child widgets at a time.
336-- Creates a header bar containing a <ul> with one <li> per child; clicking a <li> displays
322-- Creates a header bar containing a <ul> with one <li> per child; clicking a <li> displays
337-- the corresponding child and hides all others.
323-- the corresponding child and hides all others.
324+{-# DEPRECATED tabDisplay "Use an application specific widget generating function" #-}
338tabDisplay :: forall t m k. (MonadFix m, DomBuilder t m, MonadHold t m, PostBuild t m, Ord k)
325tabDisplay :: forall t m k. (MonadFix m, DomBuilder t m, MonadHold t m, PostBuild t m, Ord k)
339 => Text -- ^ Class applied to <ul> element
326 => Text -- ^ Class applied to <ul> element
340 -> Text -- ^ Class applied to currently active <li> element
327 -> Text -- ^ Class applied to currently active <li> element