diff --git a/standalone/android/haskell-patches/file-embed-0.0.4.7-remove-TH.patch b/standalone/android/haskell-patches/file-embed-0.0.4.7-remove-TH.patch new file mode 100644 index 0000000000..df6016f698 --- /dev/null +++ b/standalone/android/haskell-patches/file-embed-0.0.4.7-remove-TH.patch @@ -0,0 +1,139 @@ +From 2e6f4a373fc05968e6dadcc49185d64a69eeddf4 Mon Sep 17 00:00:00 2001 +From: Joey Hess +Date: Mon, 15 Apr 2013 12:38:22 -0400 +Subject: [PATCH] remove TH + +--- + Data/.FileEmbed.hs.swp | Bin 4096 -> 0 bytes + Data/FileEmbed.hs | 77 +------------------------------------------------ + 2 files changed, 1 insertion(+), 76 deletions(-) + delete mode 100644 Data/.FileEmbed.hs.swp + +diff --git a/Data/.FileEmbed.hs.swp b/Data/.FileEmbed.hs.swp +deleted file mode 100644 +index 7570045ca90875097c2d56ba885d26dcf344bc27..0000000000000000000000000000000000000000 +GIT binary patch +literal 0 +HcmV?d00001 + +literal 4096 +zcmYc?2=nw+FxN9?00IF9h8Ufkz&R6G7!1T17_#zHD?!49Kzd#&Athk>I*@_-X_+~x +zx~aKIsVTY!dIowXdgl5ri6x2pZa{HYkg#4xF;T{iDjE%e(GVau1WHTNbS-!pjExKp +sl$8_}goQ$h)j6teGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONV3>pe0P*q}cmMzZ + +diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs +index 66f7004..b15e331 100644 +--- a/Data/FileEmbed.hs ++++ b/Data/FileEmbed.hs +@@ -1,31 +1,12 @@ +-{-# LANGUAGE TemplateHaskell #-} + {-# LANGUAGE CPP #-} + module Data.FileEmbed + ( -- * Embed at compile time +- embedFile +- , embedDir +- , getDir ++ getDir + -- * Inject into an executable +-#if MIN_VERSION_template_haskell(2,5,0) +- , dummySpace +-#endif + , inject + , injectFile + ) where + +-import Language.Haskell.TH.Syntax +- ( Exp (AppE, ListE, LitE, TupE, SigE) +-#if MIN_VERSION_template_haskell(2,5,0) +- , Lit (StringL, StringPrimL, IntegerL) +-#else +- , Lit (StringL, IntegerL) +-#endif +- , Q +- , runIO +-#if MIN_VERSION_template_haskell(2,7,0) +- , Quasi(qAddDependentFile) +-#endif +- ) + import System.Directory (doesDirectoryExist, doesFileExist, + getDirectoryContents) + import Control.Monad (filterM) +@@ -37,51 +18,12 @@ import Data.ByteString.Unsafe (unsafePackAddressLen) + import System.IO.Unsafe (unsafePerformIO) + import System.FilePath (()) + +--- | Embed a single file in your source code. +--- +--- > import qualified Data.ByteString +--- > +--- > myFile :: Data.ByteString.ByteString +--- > myFile = $(embedFile "dirName/fileName") +-embedFile :: FilePath -> Q Exp +-embedFile fp = +-#if MIN_VERSION_template_haskell(2,7,0) +- qAddDependentFile fp >> +-#endif +- (runIO $ B.readFile fp) >>= bsToExp +- +--- | Embed a directory recusrively in your source code. +--- +--- > import qualified Data.ByteString +--- > +--- > myDir :: [(FilePath, Data.ByteString.ByteString)] +--- > myDir = $(embedDir "dirName") +-embedDir :: FilePath -> Q Exp +-embedDir fp = do +- typ <- [t| [(FilePath, B.ByteString)] |] +- e <- ListE <$> ((runIO $ fileList fp) >>= mapM (pairToExp fp)) +- return $ SigE e typ +- + -- | Get a directory tree in the IO monad. + -- + -- This is the workhorse of 'embedDir' + getDir :: FilePath -> IO [(FilePath, B.ByteString)] + getDir = fileList + +-pairToExp :: FilePath -> (FilePath, B.ByteString) -> Q Exp +-pairToExp _root (path, bs) = do +-#if MIN_VERSION_template_haskell(2,7,0) +- qAddDependentFile $ _root ++ '/' : path +-#endif +- exp' <- bsToExp bs +- return $! TupE [LitE $ StringL path, exp'] +- +-bsToExp :: B.ByteString -> Q Exp +-bsToExp bs = do +- helper <- [| stringToBs |] +- let chars = B8.unpack bs +- return $! AppE helper $! LitE $! StringL chars +- + stringToBs :: String -> B.ByteString + stringToBs = B8.pack + +@@ -123,23 +65,6 @@ padSize i = + let s = show i + in replicate (sizeLen - length s) '0' ++ s + +-#if MIN_VERSION_template_haskell(2,5,0) +-dummySpace :: Int -> Q Exp +-dummySpace space = do +- let size = padSize space +- let start = magic ++ size +- let chars = LitE $ StringPrimL $ +-#if MIN_VERSION_template_haskell(2,6,0) +- map (toEnum . fromEnum) $ +-#endif +- start ++ replicate space '0' +- let len = LitE $ IntegerL $ fromIntegral $ length start + space +- upi <- [|unsafePerformIO|] +- pack <- [|unsafePackAddressLen|] +- getInner' <- [|getInner|] +- return $ getInner' `AppE` (upi `AppE` (pack `AppE` len `AppE` chars)) +-#endif +- + inject :: B.ByteString -- ^ bs to inject + -> B.ByteString -- ^ original BS containing dummy + -> Maybe B.ByteString -- ^ new BS, or Nothing if there is insufficient dummy space +-- +1.8.2.rc3 + diff --git a/standalone/android/haskell-patches/hamlet-1.1.6.1_0001-axe-murdered.patch b/standalone/android/haskell-patches/hamlet-1.1.6.1_0001-remove-TH.patch similarity index 93% rename from standalone/android/haskell-patches/hamlet-1.1.6.1_0001-axe-murdered.patch rename to standalone/android/haskell-patches/hamlet-1.1.6.1_0001-remove-TH.patch index c1188ee142..8a8ac29c18 100644 --- a/standalone/android/haskell-patches/hamlet-1.1.6.1_0001-axe-murdered.patch +++ b/standalone/android/haskell-patches/hamlet-1.1.6.1_0001-remove-TH.patch @@ -1,17 +1,19 @@ -From 7be8bf3ba75acc5209066e6ba31ae589c541f344 Mon Sep 17 00:00:00 2001 +From aa18210b7cc124e11fb71640d993de77492b63b1 Mon Sep 17 00:00:00 2001 From: Joey Hess -Date: Thu, 28 Feb 2013 23:30:01 -0400 -Subject: [PATCH] axe murdered +Date: Mon, 15 Apr 2013 15:08:31 -0400 +Subject: [PATCH] remove TH +Export functions referred to by TH splices, as these will be needed when +using the Evil Splicer --- - Text/Hamlet.hs | 215 +------------------------------------------------------- - 1 file changed, 2 insertions(+), 213 deletions(-) + Text/Hamlet.hs | 219 ++------------------------------------------------------- + 1 file changed, 6 insertions(+), 213 deletions(-) diff --git a/Text/Hamlet.hs b/Text/Hamlet.hs -index 4ac870a..bc8edd5 100644 +index 4ac870a..63b8555 100644 --- a/Text/Hamlet.hs +++ b/Text/Hamlet.hs -@@ -11,35 +11,22 @@ +@@ -11,35 +11,26 @@ module Text.Hamlet ( -- * Plain HTML Html @@ -46,10 +48,14 @@ index 4ac870a..bc8edd5 100644 , CloseStyle (..) + , condH + , maybeH ++ ++ -- referred to in TH splices ++ , attrsToHtml ++ , asHtmlUrl ) where import Text.Shakespeare.Base -@@ -90,14 +77,6 @@ type HtmlUrl url = Render url -> Html +@@ -90,14 +81,6 @@ type HtmlUrl url = Render url -> Html -- | A function generating an 'Html' given a message translator and a URL rendering function. type HtmlUrlI18n msg url = Translate msg -> Render url -> Html @@ -64,7 +70,7 @@ index 4ac870a..bc8edd5 100644 unIdent :: Ident -> String unIdent (Ident s) = s -@@ -159,169 +138,9 @@ recordToFieldNames conStr = do +@@ -159,169 +142,9 @@ recordToFieldNames conStr = do [fields] <- return [fields | RecC name fields <- cons, name == conName] return [fieldName | (fieldName, _, _) <- fields] @@ -234,7 +240,7 @@ index 4ac870a..bc8edd5 100644 data HamletRules = HamletRules { hrFromHtml :: Exp , hrWithEnv :: (Env -> Q Exp) -> Q Exp -@@ -333,36 +152,6 @@ data Env = Env +@@ -333,36 +156,6 @@ data Env = Env , msgRender :: Maybe ((Exp -> Q Exp) -> Q Exp) } @@ -272,5 +278,5 @@ index 4ac870a..bc8edd5 100644 varName _ "" = error "Illegal empty varName" varName scope v@(_:_) = fromMaybe (strToExp v) $ lookup (Ident v) scope -- -1.7.10.4 +1.8.2.rc3 diff --git a/standalone/android/haskell-patches/shakespeare-1.0.3_0001-export-symbol-used-by-TH-splices.patch b/standalone/android/haskell-patches/shakespeare-1.0.3_0001-export-symbol-used-by-TH-splices.patch new file mode 100644 index 0000000000..aa30b255a5 --- /dev/null +++ b/standalone/android/haskell-patches/shakespeare-1.0.3_0001-export-symbol-used-by-TH-splices.patch @@ -0,0 +1,139 @@ +From 3cb1056782c29b0b68bdcff8fa49d3ea92126956 Mon Sep 17 00:00:00 2001 +From: Joey Hess +Date: Mon, 15 Apr 2013 16:46:15 -0400 +Subject: [PATCH] export symbol used by TH splices + +--- + Text/.Shakespeare.hs.swp | Bin 24576 -> 0 bytes + Text/Shakespeare.hs | 2 ++ + 2 files changed, 2 insertions(+) + delete mode 100644 Text/.Shakespeare.hs.swp + +diff --git a/Text/.Shakespeare.hs.swp b/Text/.Shakespeare.hs.swp +deleted file mode 100644 +index 4d6cd6a0295fdfb59f32a66b4af556c0630dd5b0..0000000000000000000000000000000000000000 +GIT binary patch +literal 0 +HcmV?d00001 + +literal 24576 +zcmeI4e~et$RmWd`KnqD)L_(BS5xTW4?M$;fu@g0M7u$*LtdmXsW9?l#wDxBEJo9Gf +z#WU|s-h1QO^^dk7RGJp46wwy`NCj0Y(S!!1AgEe}NKk}8ErJRNG@z(KqJ@T13Q|#9 +zR6ghact2*x>kWSanvuTVnRm}U_uO;OJ@?*o&-2-xr{<5SdmDFqe16RHu3haOfAZ_E +z_a3Fwww7 +z0}~BQG%(S?|0fM({p-CS(4lL=qu?5g>-pOOzWx0}{5=c)#QwgHzc+z9s33JFpNR%0 +z8klHcqJfD9CK{M%V4{JE1|}MqXkem&i3TPb_}{AmzvX$m5$_9fi0A%aVgN6{(es`I +zzX&dZcYzu3y*GH??}AT&_ks{CfP2BM;5zUML4hxWFM!X2XTa0oxI;GN(`@b5q3 +zdEW+q1)c*R0v`lD@F2Ja+zkHk^`6%R`@wf#=Xt*dj)L33^FQo)>);_U2fj-nMfm&Z@;M38Pg{=v0;4eAEh}Oh1S2h`)X| +zaMUe7^VK8erq$k&-{go$)yw+d5jmw@!>_`_lJ=8eE^Ye#V16}jZGhf}|gJeHq%I3sW^nO}B(&sBOwLMuVwp$B8=cC!v3~8z{d^Yb`{L(y$e%RNGLh +zAjzeZ#-zQ6{PbKv@6P+(K>$gF-lS_ukPf=ptg3Cl=wH?vSz7N0i$-HjKN78?4mw5; +zOwXx?8hL_1s6wHyZrIeiQE^+iN`qM^PJ>+3lor~9s3{7pl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-NAPH%ay)TmS$7 + +diff --git a/Text/Shakespeare.hs b/Text/Shakespeare.hs +index d300951..fabbf66 100644 +--- a/Text/Shakespeare.hs ++++ b/Text/Shakespeare.hs +@@ -22,6 +22,8 @@ module Text.Shakespeare + #ifdef TEST_EXPORT + , preFilter + #endif ++ -- used by TH splices ++ , pack' + ) where + + import Data.List (intersperse) +-- +1.8.2.rc3 + diff --git a/standalone/android/haskell-patches/shakespeare-css-1.0.2_0002-expose-modules-used-by-TH.patch b/standalone/android/haskell-patches/shakespeare-css-1.0.2_0002-expose-modules-used-by-TH.patch new file mode 100644 index 0000000000..5bf57d527a --- /dev/null +++ b/standalone/android/haskell-patches/shakespeare-css-1.0.2_0002-expose-modules-used-by-TH.patch @@ -0,0 +1,26 @@ +From 23e96f0d948e7a26febf1745a4c373faf579c8ee Mon Sep 17 00:00:00 2001 +From: Joey Hess +Date: Mon, 15 Apr 2013 16:32:31 -0400 +Subject: [PATCH] expose modules used by TH + +--- + shakespeare-css.cabal | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/shakespeare-css.cabal b/shakespeare-css.cabal +index de2497b..468353a 100644 +--- a/shakespeare-css.cabal ++++ b/shakespeare-css.cabal +@@ -39,8 +39,8 @@ library + + exposed-modules: Text.Cassius + Text.Lucius +- other-modules: Text.MkSizeType + Text.Css ++ other-modules: Text.MkSizeType + Text.IndentToBrace + Text.CssCommon + ghc-options: -Wall +-- +1.8.2.rc3 + diff --git a/standalone/android/haskell-patches/wai-app-static-1.3.1-remove-TH.patch b/standalone/android/haskell-patches/wai-app-static-1.3.1-remove-TH.patch new file mode 100644 index 0000000000..30bf5256a0 --- /dev/null +++ b/standalone/android/haskell-patches/wai-app-static-1.3.1-remove-TH.patch @@ -0,0 +1,36 @@ +From c18ae75852b1340ca502528138bf421659f61a3d Mon Sep 17 00:00:00 2001 +From: Joey Hess +Date: Mon, 15 Apr 2013 12:44:15 -0400 +Subject: [PATCH] remove TH + +Should not need these icons in git-annex, so not worth using the Evil +Splicer. +--- + Network/Wai/Application/Static.hs | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/Network/Wai/Application/Static.hs b/Network/Wai/Application/Static.hs +index 3195fbb..b48aa01 100644 +--- a/Network/Wai/Application/Static.hs ++++ b/Network/Wai/Application/Static.hs +@@ -33,8 +33,6 @@ import Control.Monad.IO.Class (liftIO) + + import Blaze.ByteString.Builder (toByteString) + +-import Data.FileEmbed (embedFile) +- + import Data.Text (Text) + import qualified Data.Text as T + +@@ -198,8 +196,6 @@ staticAppPieces _ _ req + H.status405 + [("Content-Type", "text/plain")] + "Only GET is supported" +-staticAppPieces _ [".hidden", "folder.png"] _ = return $ W.responseLBS H.status200 [("Content-Type", "image/png")] $ L.fromChunks [$(embedFile "images/folder.png")] +-staticAppPieces _ [".hidden", "haskell.png"] _ = return $ W.responseLBS H.status200 [("Content-Type", "image/png")] $ L.fromChunks [$(embedFile "images/haskell.png")] + staticAppPieces ss rawPieces req = liftIO $ do + case toPieces rawPieces of + Just pieces -> checkPieces ss pieces req >>= response +-- +1.8.2.rc3 + diff --git a/standalone/android/haskell-patches/yesod-core-1.1.8_0002-replaced-TH-in-Yesod.Internal.Core.patch b/standalone/android/haskell-patches/yesod-core-1.1.8_0002-replaced-TH-in-Yesod.Internal.Core.patch index e0a3f9b5f3..af0b3d15b6 100644 --- a/standalone/android/haskell-patches/yesod-core-1.1.8_0002-replaced-TH-in-Yesod.Internal.Core.patch +++ b/standalone/android/haskell-patches/yesod-core-1.1.8_0002-replaced-TH-in-Yesod.Internal.Core.patch @@ -5,6 +5,9 @@ Subject: [PATCH 2/2] replaced TH in Yesod.Internal.Core Done by running a build with -ddump-splices and manually pasting in the spliced code, and then modifying it until it compiles. + +(This predated the Evil Splicer, and both this and the previous patch need +to be redone to use it.) --- Yesod/Internal/Core.hs | 211 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 201 insertions(+), 10 deletions(-) diff --git a/standalone/android/haskell-patches/yesod-core-1.1.8_0003-exports-for-TH-splices.patch b/standalone/android/haskell-patches/yesod-core-1.1.8_0003-exports-for-TH-splices.patch new file mode 100644 index 0000000000..440b57ac8b --- /dev/null +++ b/standalone/android/haskell-patches/yesod-core-1.1.8_0003-exports-for-TH-splices.patch @@ -0,0 +1,26 @@ +From b7e01a2fded6575678db234e1f2de1f104f11376 Mon Sep 17 00:00:00 2001 +From: Joey Hess +Date: Mon, 15 Apr 2013 15:25:07 -0400 +Subject: [PATCH 3/3] exports for TH splices + +--- + Yesod/Widget.hs | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/Yesod/Widget.hs b/Yesod/Widget.hs +index bf79150..01ae294 100644 +--- a/Yesod/Widget.hs ++++ b/Yesod/Widget.hs +@@ -52,6 +52,9 @@ module Yesod.Widget + , addScriptEither + -- * Internal + , unGWidget ++ ++ -- used by TH code ++ , liftW + ) where + + import Data.Monoid +-- +1.8.2.rc3 + diff --git a/standalone/android/haskell-patches/yesod-form-1.2.1.1-0001-prepare-for-Evil-Splicer.patch b/standalone/android/haskell-patches/yesod-form-1.2.1.1-0001-prepare-for-Evil-Splicer.patch new file mode 100644 index 0000000000..c24055b1f0 --- /dev/null +++ b/standalone/android/haskell-patches/yesod-form-1.2.1.1-0001-prepare-for-Evil-Splicer.patch @@ -0,0 +1,83 @@ +From a603bac40f0a0f6232fbfb056a778860270101de Mon Sep 17 00:00:00 2001 +From: Joey Hess +Date: Mon, 15 Apr 2013 15:59:56 -0400 +Subject: [PATCH 1/2] prepare for Evil Splicer + +--- + Yesod/Form/Functions.hs | 3 +-- + evilsplicer-headers.hs | 9 +++++++++ + yesod-form.cabal | 5 +++-- + 3 files changed, 13 insertions(+), 4 deletions(-) + create mode 100644 evilsplicer-headers.hs + +diff --git a/Yesod/Form/Functions.hs b/Yesod/Form/Functions.hs +index db3e493..89eb1e8 100644 +--- a/Yesod/Form/Functions.hs ++++ b/Yesod/Form/Functions.hs +@@ -54,10 +54,9 @@ import Text.Blaze (Markup, toMarkup) + #define toHtml toMarkup + import Yesod.Handler (GHandler, getRequest, runRequestBody, newIdent, getYesod) + import Yesod.Core (RenderMessage, SomeMessage (..)) +-import Yesod.Widget (GWidget, whamlet) ++import Yesod.Widget (GWidget) + import Yesod.Request (reqToken, reqWaiRequest, reqGetParams, languages) + import Network.Wai (requestMethod) +-import Text.Hamlet (shamlet) + import Data.Monoid (mempty) + import Data.Maybe (listToMaybe, fromMaybe) + import Yesod.Message (RenderMessage (..)) +diff --git a/evilsplicer-headers.hs b/evilsplicer-headers.hs +new file mode 100644 +index 0000000..865d043 +--- /dev/null ++++ b/evilsplicer-headers.hs +@@ -0,0 +1,9 @@ ++import qualified Data.Text.Lazy.Builder ++import qualified Text.Shakespeare ++import qualified Text.Hamlet ++import qualified Data.Monoid ++import qualified Text.Julius ++import qualified "blaze-markup" Text.Blaze.Internal ++import qualified "blaze-markup" Text.Blaze as Text.Blaze.Markup ++import qualified Yesod.Widget ++import qualified Data.Foldable +diff --git a/yesod-form.cabal b/yesod-form.cabal +index a0d2a80..ae99ddc 100644 +--- a/yesod-form.cabal ++++ b/yesod-form.cabal +@@ -18,7 +18,7 @@ library + , yesod-persistent >= 1.1 && < 1.2 + , time >= 1.1.4 + , hamlet >= 1.1 && < 1.2 +- , shakespeare-css >= 1.0 && < 1.1 ++ , shakespeare-css == 1.0.2 + , shakespeare-js >= 1.0.2 && < 1.2 + , persistent >= 1.0 && < 1.2 + , template-haskell +@@ -37,6 +37,7 @@ library + , attoparsec >= 0.10 && < 0.11 + , crypto-api >= 0.8 && < 0.11 + , aeson ++ , shakespeare + + exposed-modules: Yesod.Form + Yesod.Form.Class +@@ -45,7 +46,6 @@ library + Yesod.Form.Input + Yesod.Form.Fields + Yesod.Form.Jquery +- Yesod.Form.Nic + Yesod.Form.MassInput + Yesod.Form.I18n.English + Yesod.Form.I18n.Portuguese +@@ -56,6 +56,7 @@ library + Yesod.Form.I18n.Japanese + -- FIXME Yesod.Helpers.Crud + ghc-options: -Wall ++ Extensions: PackageImports + + test-suite test + type: exitcode-stdio-1.0 +-- +1.8.2.rc3 + diff --git a/standalone/android/haskell-patches/yesod-form-1.2.1.1-0002-expand-TH.patch b/standalone/android/haskell-patches/yesod-form-1.2.1.1-0002-expand-TH.patch new file mode 100644 index 0000000000..3ce48e5fcb --- /dev/null +++ b/standalone/android/haskell-patches/yesod-form-1.2.1.1-0002-expand-TH.patch @@ -0,0 +1,1606 @@ +From f98c22ec71695537e0e008a0bd54affdf8a60f64 Mon Sep 17 00:00:00 2001 +From: Joey Hess +Date: Mon, 15 Apr 2013 17:35:57 -0400 +Subject: [PATCH 2/2] expand TH + +Used the EvilSplicer, and then some manual fixups, as it is apparently +buggy. Also a few module import fixes. +--- + Yesod/Form/Fields.hs | 623 ++++++++++++++++++++++++++++++++++++++---------- + Yesod/Form/Functions.hs | 240 +++++++++++++++---- + Yesod/Form/Jquery.hs | 141 ++++++++--- + Yesod/Form/MassInput.hs | 228 ++++++++++++++---- + Yesod/Form/Nic.hs | 59 ++++- + 5 files changed, 1042 insertions(+), 249 deletions(-) + +diff --git a/Yesod/Form/Fields.hs b/Yesod/Form/Fields.hs +index 7917ce2..db76ea2 100644 +--- a/Yesod/Form/Fields.hs ++++ b/Yesod/Form/Fields.hs +@@ -46,11 +46,22 @@ module Yesod.Form.Fields + , optionsEnum + ) where + ++import qualified Data.Text.Lazy.Builder ++import qualified Text.Shakespeare ++import qualified Data.Monoid ++import qualified Text.Julius ++import qualified "blaze-markup" Text.Blaze.Internal ++import qualified "blaze-markup" Text.Blaze as Text.Blaze.Internal ++import qualified "blaze-html" Text.Blaze.Html ++import qualified Yesod.Widget ++import qualified Text.Css ++import qualified Control.Monad ++import qualified Data.Foldable + import Yesod.Form.Types + import Yesod.Form.I18n.English + import Yesod.Form.Functions (parseHelper) + import Yesod.Handler (getMessageRender) +-import Yesod.Widget (toWidget, whamlet, GWidget) ++import Yesod.Widget (toWidget, GWidget) + import Yesod.Message (RenderMessage (renderMessage), SomeMessage (..)) + import Text.Hamlet + import Text.Blaze (ToMarkup (toMarkup), preEscapedToMarkup, unsafeByteString) +@@ -108,10 +119,24 @@ intField = Field + Right (a, "") -> Right a + _ -> Left $ MsgInvalidInteger s + +- , fieldView = \theId name attrs val isReq -> toWidget [hamlet| +-$newline never +- +-|] ++ , fieldView = \theId name attrs val isReq -> toWidget $ \ _render_amMY ++ -> do { id ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + where +@@ -125,10 +150,24 @@ doubleField = Field + Right (a, "") -> Right a + _ -> Left $ MsgInvalidNumber s + +- , fieldView = \theId name attrs val isReq -> toWidget [hamlet| +-$newline never +- +-|] ++ , fieldView = \theId name attrs val isReq -> toWidget $ \ _render_amNa ++ -> do { id ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + where showVal = either id (pack . show) +@@ -136,10 +175,24 @@ $newline never + dayField :: RenderMessage master FormMessage => Field sub master Day + dayField = Field + { fieldParse = parseHelper $ parseDate . unpack +- , fieldView = \theId name attrs val isReq -> toWidget [hamlet| +-$newline never +- +-|] ++ , fieldView = \theId name attrs val isReq -> toWidget $ \ _render_amNk ++ -> do { id ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + where showVal = either id (pack . show) +@@ -147,10 +200,23 @@ $newline never + timeField :: RenderMessage master FormMessage => Field sub master TimeOfDay + timeField = Field + { fieldParse = parseHelper parseTime +- , fieldView = \theId name attrs val isReq -> toWidget [hamlet| +-$newline never +- +-|] ++ , fieldView = \theId name attrs val isReq -> toWidget $ \ _render_amNx ++ -> do { id ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + where +@@ -163,10 +229,18 @@ $newline never + htmlField :: RenderMessage master FormMessage => Field sub master Html + htmlField = Field + { fieldParse = parseHelper $ Right . preEscapedText . sanitizeBalance +- , fieldView = \theId name attrs val _isReq -> toWidget [hamlet| +-$newline never +-") } ++ + , fieldEnctype = UrlEncoded + } + where showVal = either id (pack . renderHtml) +@@ -192,10 +266,18 @@ instance ToHtml Textarea where + textareaField :: RenderMessage master FormMessage => Field sub master Textarea + textareaField = Field + { fieldParse = parseHelper $ Right . Textarea +- , fieldView = \theId name attrs val _isReq -> toWidget [hamlet| +-$newline never +-") } ++ + , fieldEnctype = UrlEncoded + } + +@@ -203,10 +285,19 @@ hiddenField :: (PathPiece p, RenderMessage master FormMessage) + => Field sub master p + hiddenField = Field + { fieldParse = parseHelper $ maybe (Left MsgValueRequired) Right . fromPathPiece +- , fieldView = \theId name attrs val _isReq -> toWidget [hamlet| +-$newline never +- +-|] ++ , fieldView = \theId name attrs val _isReq -> toWidget $ \ _render_amNZ ++ -> do { id ++ ((Text.Blaze.Internal.preEscapedText . pack) ++ "") } ++ + , fieldEnctype = UrlEncoded + } + +@@ -214,20 +305,50 @@ textField :: RenderMessage master FormMessage => Field sub master Text + textField = Field + { fieldParse = parseHelper $ Right + , fieldView = \theId name attrs val isReq -> +- [whamlet| +-$newline never +- +-|] ++ do { toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + + passwordField :: RenderMessage master FormMessage => Field sub master Text + passwordField = Field + { fieldParse = parseHelper $ Right +- , fieldView = \theId name attrs val isReq -> toWidget [hamlet| +-$newline never +- +-|] ++ , fieldView = \theId name attrs val isReq -> toWidget $ \ _render_amOg ++ -> do { id ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + +@@ -305,10 +426,24 @@ emailField = Field + then Right s + else Left $ MsgInvalidEmail s + #endif +- , fieldView = \theId name attrs val isReq -> toWidget [hamlet| +-$newline never +- +-|] ++ , fieldView = \theId name attrs val isReq -> toWidget $ \ _render_amOO ++ -> do { id ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + +@@ -317,20 +452,60 @@ searchField :: RenderMessage master FormMessage => AutoFocus -> Field sub master + searchField autoFocus = Field + { fieldParse = parseHelper Right + , fieldView = \theId name attrs val isReq -> do +- [whamlet|\ +-$newline never +- +-|] ++ do { toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + when autoFocus $ do + -- we want this javascript to be placed immediately after the field +- [whamlet| +-$newline never +-") } ++ ++ toWidget $ \ _render_amP5 ++ -> (Text.Css.CssNoWhitespace ++ . (foldr ($) [])) ++ [((++) ++ $ (map ++ Text.Css.Css ++ ((((:) ++ (Text.Css.Css' ++ (Data.Monoid.mconcat [toCss theId]) ++ [(Data.Monoid.mconcat ++ [(Text.Css.fromText ++ . Text.Css.pack) ++ "-webkit-appearance"], ++ Data.Monoid.mconcat ++ [(Text.Css.fromText ++ . Text.Css.pack) ++ "textfield"])])) ++ . (foldr (.) id [])) ++ [])))] ++ + , fieldEnctype = UrlEncoded + } + +@@ -341,10 +516,25 @@ urlField = Field + Nothing -> Left $ MsgInvalidUrl s + Just _ -> Right s + , fieldView = \theId name attrs val isReq -> +- [whamlet| +-$newline never +- +-|] ++ do { toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + , fieldEnctype = UrlEncoded + } + +@@ -353,18 +543,48 @@ selectFieldList = selectField . optionsPairs + + selectField :: (Eq a, RenderMessage master FormMessage) => GHandler sub master (OptionList a) -> Field sub master a + selectField = selectFieldHelper +- (\theId name attrs inside -> [whamlet| +-$newline never +-"); ++ toWidget inside; ++ toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) "") }) ++ -- outside ++ (\_theId _name isSel -> do { toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) ++ "") }) ++ -- onOpt ++ (\_theId _name _attrs value isSel text -> do { toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) "") }) ++ -- inside + + multiSelectFieldList :: (Eq a, RenderMessage master FormMessage, RenderMessage master msg) => [(msg, a)] -> Field sub master [a] + multiSelectFieldList = multiSelectField . optionsPairs +@@ -385,12 +605,40 @@ multiSelectField ioptlist = + view theId name attrs val isReq = do + opts <- fmap olOptions $ lift ioptlist + let selOpts = map (id &&& (optselected val)) opts +- [whamlet| +-$newline never +- "); ++ Data.Foldable.mapM_ ++ (\ (opt_amPV, optsel_amPW) ++ -> do { toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) "") }) ++ selOpts; ++ toWidget ++ ((Text.Blaze.Internal.preEscapedText . pack) "") } ++ + where + optselected (Left _) _ = False + optselected (Right vals) opt = (optionInternalValue opt) `elem` vals +@@ -400,41 +648,140 @@ radioFieldList = radioField . optionsPairs + + radioField :: (Eq a, RenderMessage master FormMessage) => GHandler sub master (OptionList a) -> Field sub master a + radioField = selectFieldHelper +- (\theId _name _attrs inside -> [whamlet| +-$newline never +-
^{inside} +-|]) +- (\theId name isSel -> [whamlet| +-$newline never +-