MFlow 0.4.5.7 → 0.4.5.8
raw patch · 3 files changed
+29/−14 lines, 3 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ MFlow.Forms: rawSend :: (FormInput v, MonadIO m, Functor m) => ByteString -> View v m ()
Files
- MFlow.cabal +7/−5
- src/MFlow/Forms.hs +16/−6
- src/MFlow/Forms/Widgets.hs +6/−3
MFlow.cabal view
@@ -1,5 +1,5 @@ name: MFlow -version: 0.4.5.7 +version: 0.4.5.8 cabal-version: >=1.8 build-type: Simple license: BSD3 @@ -43,6 +43,8 @@ The interfaces and communications are abstract, but there are bindings for blaze-html, HSP, Text.XHtml and byteString, Hack and WAI but it can be extended to non Web based architectures. . Bindings for hack, and hsp >= 0.8, are not compiled by Hackage, and do not appear, but are included in the package files. To use them, add then to the exported modules and execute cabal install + .+ 0.4.5.8 added rawSend . The version 0.4.5.4 add compatibility with ghc 7.8 . @@ -120,16 +122,16 @@ hs-source-dirs: src . other-modules: MFlow.Wai.Response - + --executable demos-blaze -- build-depends: MFlow , RefSerialize , TCache , -- tcache-AWS , directory , Workflow , base , -- blaze-html , bytestring , containers , mtl , -- old-time , stm , text , transformers , vector , --- hamlet , shakespeare, monadloc , aws , network , hscolour , +-- hamlet , shakespeare, monadloc , aws == 0.9.1 , network , hscolour , -- persistent-template , persistent-sqlite , persistent , -- conduit , http-conduit , monad-logger , safecopy , --- time, acid-state, data-default, haste-compiler +-- time, acid-state ==0.12.2, data-default, auto-update == 0.1.0.0 -- main-is: demos-blaze.hs -- buildable: True -- hs-source-dirs: Demos @@ -143,4 +145,4 @@ -- InitialConfig GenerateForm GenerateFormUndo GenerateFormUndoMsg WebService -- LazyLoad CachingDataset -- ghc-options: -iDemos -threaded -rtsopts --- +
src/MFlow/Forms.hs view
@@ -211,7 +211,7 @@ ,encryptedLogout, userWidget, paranoidUserWidget, encryptedUserWidget, login, paranoidLogin, encryptedLogin, userName, -- * User interaction -ask, page, askt, clearEnv, wstateless, pageFlow, +ask, page, askt, clearEnv, wstateless, pageFlow, -- * formLets -- | They usually produce the HTML form elements (depending on the FormInput instance used) -- It is possible to modify their attributes with the `<!` operator. @@ -248,6 +248,9 @@ -- * ByteString tags ,btag,bhtml,bbody ++-- * send raw bytestring data+,rawSend -- * Normalization ,flatten, normalize @@ -1616,13 +1619,20 @@ -- !> ("END CHILD pageflow. prefix="++ str)) --- | send raw data to the client.+-- | send raw bytestring data to the client. usable for -- -- example--- --- >rawSend $ HttpData [("Content-Type","text/plain"), ("Cache-Control", "max-age=360000")] [] "hello" -rawSend :: (FormInput v,MonadIO m) => HttpData -> View v m ()+--+-- > do+-- setHttpHeader "Content-Type" "text//plain"+-- maxAge 36000+-- rawSend longdata++rawSend :: (FormInput v,MonadIO m, Functor m) => ByteString -> View v m () rawSend dat= do+ setCachePolicy+ st <- get tok <- getToken- liftIO $ sendFlush tok dat+ liftIO $ sendFlush tok $ HttpData ( mfHttpHeaders st) (mfCookies st) dat modify $ \st -> st{mfAutorefresh= True} + stop
src/MFlow/Forms/Widgets.hs view
@@ -67,10 +67,11 @@ import Control.Workflow(killWF) import Unsafe.Coerce import Control.Exception -import MFlow.Forms.Cache +import MFlow.Forms.Cache + --jqueryScript= "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" --jqueryScript1="//code.jquery.com/jquery-1.9.1.js" -- @@ -235,10 +236,12 @@ addEdited selector (key,cw) FormElm form _ <- runView cw let elem= toByteString form - return . FormElm mempty . Just $ selector <> "." <> modifier <>"('" <> elem <> "');" + return . FormElm mempty . Just $ selector <> "." <> modifier <> "('" <> elem <> "');" where typ :: View v m a -> a - typ = undefined + typ = undefined++ -- | Return the javascript to be executed on the browser to prepend a widget to the location -- identified by the selector (the bytestring parameter), The selector must have the form of a jquery expression