MFlow 0.1.5.2 → 0.1.5.3
raw patch · 3 files changed
+25/−20 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Demos/demos.hs +4/−5
- MFlow.cabal +1/−1
- src/MFlow/Forms.hs +20/−14
Demos/demos.hs view
@@ -21,9 +21,8 @@ forkIO $ run 80 waiMessageFlow adminLoop -- stdheader c= p << "you can press the back button to go to the menu"+++ c+ mainf= do setHeader stdheader r <- ask $ wlink Ints (bold << "increase an Int")@@ -34,7 +33,7 @@ <++ (br +++ linkShop) -- this is an ordinary XHtml link case r of- Ints -> clickn 0+ Ints -> clickn 0 Strings -> clicks "1" Actions -> actions 1 Ajax -> ajaxsample@@ -72,8 +71,8 @@ ajaxsample= do setHeader ajaxheader- ajaxc <- ajaxCommand "document.getElementById('text1').value"- (\n -> return $ "document.getElementById('text1').value='"++show(read n +1)++"'")+ ajaxc <- ajaxCommand "document.getElementById('text1').value"+ (\n -> return $ "document.getElementById('text1').value='"++show(read n +1)++"'") ask $ (getInt (Just 0) <! [("id","text1"),("onclick", ajaxc)]) breturn()
MFlow.cabal view
@@ -1,5 +1,5 @@ name: MFlow-version: 0.1.5.2+version: 0.1.5.3 cabal-version: >= 1.6 build-type: Simple license: BSD3
src/MFlow/Forms.hs view
@@ -124,10 +124,7 @@ > import qualified Data.Vector as V > import Data.Maybe >->->-> data Ops= Ints | Strings | Actions | Ajax | Shop deriving(Typeable,Read, Show)->+> data Ops= Ints | Strings | Actions | Ajax | Opt deriving(Typeable,Read, Show) > main= do > setFilesPath "" > addFileServerWF@@ -136,27 +133,35 @@ > forkIO $ run 80 waiMessageFlow > adminLoop >->-> > stdheader c= p << "you can press the back button to go to the menu"+++ c+> > mainf= do > setHeader stdheader > r <- ask $ wlink Ints (bold << "increase an Int") > <|> br ++> wlink Strings (bold << "increase a String") > <|> br ++> wlink Actions (bold << "Example of a string widget with an action") > <|> br ++> wlink Ajax (bold << "Simple AJAX example")+> <|> br ++> wlink Opt (bold << "select options") > <++ (br +++ linkShop) -- this is an ordinary XHtml link > > case r of-> Ints -> clickn 0+> Ints -> clickn 0 > Strings -> clicks "1" > Actions -> actions 1 > Ajax -> ajaxsample->+> Opt -> options > mainf > where > linkShop= toHtml $ hotlink "shop" << "shopping" >+> options= do+> r <- ask $ getSelect (setOption "blue" (bold << "blue") <|>+> setSelectedOption "Red" (bold << "red") ) <! dosummit+> ask $ p << (r ++ " selected") ++> wlink () (p<< " menu")+> breturn()+> where+> dosummit= [("onchange","this.form.submit()")]+> > clickn (n :: Int)= do > setHeader stdheader > r <- ask $ wlink "menu" (p << "menu")@@ -178,8 +183,8 @@ > > ajaxsample= do > setHeader ajaxheader-> ajaxc <- ajaxCommand "document.getElementById('text1').value"-> (\n -> return $ "document.getElementById('text1').value='"++show(read n +1)++"'")+> ajaxc <- ajaxCommand "document.getElementById('text1').value"+> (\n -> return $ "document.getElementById('text1').value='"++show(read n +1)++"'") > ask $ (getInt (Just 0) <! [("id","text1"),("onclick", ajaxc)]) > breturn() >@@ -212,7 +217,6 @@ > shopCart1 newCart > where > linkHome= (toHtml $ hotlink noScript << bold << "home")- -} @@ -570,9 +574,10 @@ --, permanently or for a certain time. this is very useful for complex widgets that present information. Specially it they must access to databases. -- -- @--- import Mflow.Wai.XHtm.All+-- import MFlow.Wai.XHtm.All -- import Some.Time.Library--- main= run 80 waiMessageFlow [(noscript, time)]+-- addMessageFlows [(noscript, time)]+-- main= run 80 waiMessageFlow -- time=do ask $ cachedWidget \"time\" 5 -- $ wlink () bold << \"the time is \" ++ show (execute giveTheTime) ++ \" click here\" -- time@@ -631,7 +636,8 @@ `waiMessageFlow` or `addMessageFlows` @main= do- forkIO $ run 80 $ waiMessageFlow [(\"noscript\",transient $ runFlow mainf)]+ addMessageFlows [(\"noscript\",transient $ runFlow mainf)]+ forkIO . run 80 $ waiMessageFlow adminLoop @ -}