diff --git a/README.md b/README.md index a85ca3c..d8c3c61 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ Fay jQuery ========== -jQuery bindings for Fay. This project is experimental and not suitable for -production purposes. +jQuery bindings for Fay. This project is experimental, but seems to work pretty well! The short-term goals of this project are to help discover the real world requirements of Fay and to invite bikeshedding over the fay-jquery API. That @@ -28,24 +27,23 @@ main = do Usage ----- -To use this with fay, cabal install the package which will put the -source files in fay ~/.cabal/share/fay-jquery-0.1.0.0/src. You can then -compile with fay using -in fay >= 0.12: +Install: ```bash -fay --package fay-jquery MyFile.hs +cabal install fay-text fay-jquery ``` -in fay < 0.12: -``` -fay --include=~/.cabal/share/fay-jquery-0.1.0.0/src MyFile.hs +Compile your file: + +```bash +fay --package fay-jquery,fay-text MyFile.hs ``` + Supported API calls ------------------- -This binding is a work in progress. I'm adding calls by section of the jQuery +This binding is a work in progress. We're adding calls by section of the jQuery docs. There is some overlap in the sections, but the following sections are (mostly) complete. @@ -56,6 +54,7 @@ docs. There is some overlap in the sections, but the following sections are - Effects (Basic, Fading) - Manipulation - Traversing +- Events Still to do ----------- @@ -63,7 +62,6 @@ Still to do - Data - Deferred Object - Effects (Custom, Sliding) -- Events - Forms - Internals - Miscellaneous diff --git a/fay-jquery.cabal b/fay-jquery.cabal index bfd6738..8ca8b4b 100644 --- a/fay-jquery.cabal +++ b/fay-jquery.cabal @@ -21,6 +21,7 @@ source-repository head library hs-source-dirs: src + ghc-options: -Wall exposed-modules: JQuery build-depends: fay-base >= 0.18 , fay-text >= 0.2 diff --git a/src/JQuery.hs b/src/JQuery.hs index f28e792..e142f09 100644 --- a/src/JQuery.hs +++ b/src/JQuery.hs @@ -12,7 +12,7 @@ data types all subject to drastic change. import Fay.Text import FFI -import Prelude +import Prelude hiding (succ) data JQuery @@ -399,7 +399,7 @@ anim :: AnimationType -> JQuery -> Animation anim ty el = Animation ty Fast Nothing el speed :: Speed -> Animation -> Animation -speed spd anim = anim { _speed = spd } +speed spd ani = ani { _speed = spd } chainAnim :: Animation -> Animation -> Animation chainAnim a1 a2 = a1 { _nextAnimation = Just a2 } @@ -407,6 +407,7 @@ chainAnim a1 a2 = a1 { _nextAnimation = Just a2 } chainAnims :: [Animation] -> Animation chainAnims [a] = a chainAnims (a:as) = a `chainAnim` chainAnims as +chainAnims [] = error (unpack "chainAnims: empty list") runAnimation :: Animation -> Fay () runAnimation a = do