Scaffolding update
This commit is contained in:
parent
b38abdba0f
commit
a689b0b268
@ -1 +1,3 @@
|
|||||||
|
__1.4.0.8__ Updated postgres-fay scaffolding for yesod-fay 0.7.0
|
||||||
|
|
||||||
__1.4.0.7__ Fix a bug in `yesod devel` when cabal config has `tests: True` #864
|
__1.4.0.7__ Fix a bug in `yesod devel` when cabal config has `tests: True` #864
|
||||||
|
|||||||
@ -13,11 +13,13 @@
|
|||||||
dist*
|
dist*
|
||||||
static/tmp/
|
static/tmp/
|
||||||
static/combined/
|
static/combined/
|
||||||
|
static/fay-runtime.js
|
||||||
|
static/faygen*.js
|
||||||
config/client_session_key.aes
|
config/client_session_key.aes
|
||||||
*.hi
|
*.hi
|
||||||
*.o
|
*.o
|
||||||
*.sqlite3
|
*.sqlite3
|
||||||
fay/Language/Fay/Yesod.hs
|
fay/Fay/Yesod.hs
|
||||||
.hsenv*
|
.hsenv*
|
||||||
cabal-dev/
|
cabal-dev/
|
||||||
yesod-devel/
|
yesod-devel/
|
||||||
@ -469,8 +471,8 @@ library
|
|||||||
, yesod-auth >= 1.4.0 && < 1.5
|
, yesod-auth >= 1.4.0 && < 1.5
|
||||||
, yesod-static >= 1.4.0 && < 1.5
|
, yesod-static >= 1.4.0 && < 1.5
|
||||||
, yesod-form >= 1.4.0 && < 1.5
|
, yesod-form >= 1.4.0 && < 1.5
|
||||||
, yesod-fay >= 0.5.0.1
|
, yesod-fay >= 0.7 && < 0.8
|
||||||
, fay >= 0.16
|
, fay >= 0.21.2.1 && < 0.22
|
||||||
, bytestring >= 0.9 && < 0.11
|
, bytestring >= 0.9 && < 0.11
|
||||||
, text >= 0.11 && < 2.0
|
, text >= 0.11 && < 2.0
|
||||||
, persistent >= 2.0 && < 2.2
|
, persistent >= 2.0 && < 2.2
|
||||||
@ -619,6 +621,7 @@ fayFile' staticR moduleName
|
|||||||
{ yfsSeparateRuntime = Just ("static", staticR)
|
{ yfsSeparateRuntime = Just ("static", staticR)
|
||||||
-- , yfsPostProcess = readProcess "java" ["-jar", "closure-compiler.jar"]
|
-- , yfsPostProcess = readProcess "java" ["-jar", "closure-compiler.jar"]
|
||||||
, yfsExternal = Just ("static", staticR)
|
, yfsExternal = Just ("static", staticR)
|
||||||
|
, yfsPackages = ["fay-dom"]
|
||||||
}
|
}
|
||||||
|
|
||||||
data Extra = Extra
|
data Extra = Extra
|
||||||
@ -1069,55 +1072,53 @@ module SharedTypes where
|
|||||||
|
|
||||||
import Prelude
|
import Prelude
|
||||||
import Data.Data
|
import Data.Data
|
||||||
import Language.Fay.Yesod
|
import Fay.Yesod
|
||||||
#ifdef FAY
|
|
||||||
import FFI
|
|
||||||
#else
|
|
||||||
--import Language.Fay.FFI
|
|
||||||
#endif
|
|
||||||
|
|
||||||
data Command = GetFib Int (Returns Int)
|
data Command = GetFib Int (Returns Int)
|
||||||
deriving (Read, Typeable, Data)
|
deriving (Typeable, Data)
|
||||||
|
|
||||||
|
|
||||||
{-# START_FILE fay/Home.hs #-}
|
{-# START_FILE fay/FFIExample.hs #-}
|
||||||
{-# LANGUAGE NoImplicitPrelude #-}
|
-- | Example of defining FFI functions.
|
||||||
{-# LANGUAGE EmptyDataDecls #-}
|
--
|
||||||
module Home where
|
-- The `ffi' method is currently incompatible with 'RebindableSyntax',
|
||||||
|
-- so these are defined in another module.
|
||||||
|
|
||||||
import Prelude
|
module FFIExample where
|
||||||
import Fay.FFI
|
|
||||||
import Language.Fay.Yesod
|
|
||||||
import SharedTypes
|
|
||||||
|
|
||||||
data Element
|
import Data.Text (Text)
|
||||||
|
import DOM
|
||||||
getElementById :: String -> Fay Element
|
import FFI
|
||||||
getElementById = ffi "document.getElementById(%1)"
|
|
||||||
|
|
||||||
getAttribute :: String -> Element -> Fay String
|
|
||||||
getAttribute = ffi "%2[%1]"
|
|
||||||
|
|
||||||
setInnerHTML :: Element -> String -> Fay ()
|
|
||||||
setInnerHTML = ffi "%1.innerHTML=%2"
|
|
||||||
|
|
||||||
onKeyUp :: Element -> Fay () -> Fay ()
|
onKeyUp :: Element -> Fay () -> Fay ()
|
||||||
onKeyUp = ffi "%1.onkeyup=%2"
|
onKeyUp = ffi "%1.onkeyup=%2"
|
||||||
|
|
||||||
alert :: String -> Fay ()
|
setInnerHTML :: Element -> Text -> Fay ()
|
||||||
alert = ffi "window.alert(%1)"
|
setInnerHTML = ffi "%1.innerHTML=%2"
|
||||||
|
|
||||||
parseInt :: String -> Fay Int
|
{-# START_FILE fay/Home.hs #-}
|
||||||
parseInt = ffi "window.parseInt(%1, 10)"
|
{-# LANGUAGE RebindableSyntax #-}
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
|
||||||
|
module Home where
|
||||||
|
|
||||||
|
import FFIExample
|
||||||
|
|
||||||
|
import DOM
|
||||||
|
import Data.Text (fromString)
|
||||||
|
import qualified Data.Text as T
|
||||||
|
import Fay.Yesod
|
||||||
|
import Prelude
|
||||||
|
import SharedTypes
|
||||||
|
|
||||||
main :: Fay ()
|
main :: Fay ()
|
||||||
main = do
|
main = do
|
||||||
input <- getElementById "fibindex"
|
input <- getElementById "fibindex"
|
||||||
result <- getElementById "fibresult"
|
result <- getElementById "fibresult"
|
||||||
onKeyUp input $ do
|
onKeyUp input $ do
|
||||||
indexS <- getAttribute "value" input
|
indexS <- getValue input
|
||||||
index <- parseInt indexS
|
index <- parseInt indexS
|
||||||
call (GetFib index) $ setInnerHTML result . show
|
call (GetFib index) $ setInnerHTML result . T.pack . show
|
||||||
|
|
||||||
{-# START_FILE messages/en.msg #-}
|
{-# START_FILE messages/en.msg #-}
|
||||||
Hello: Hello
|
Hello: Hello
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-bin
|
name: yesod-bin
|
||||||
version: 1.4.0.7
|
version: 1.4.0.8
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user