packages feed

fay-jquery 0.5 → 0.6

raw patch · 4 files changed

+119/−12 lines, 4 filesdep ~fay-base

Dependency ranges changed: fay-base

Files

+ CHANGELOG.md view
@@ -0,0 +1,27 @@+## Changelog++### 0.6 (unreleased)++* Constrain more free type variables to `Selectable`+* Change `getAttr :: Text -> JQuery -> Fay Text` to `Text -> JQuery -> Fay (Defined Text)`++### 0.5 (2013-11-07)++* Add `Selectable` typeclass (with instances for `Text`, `JQuery` and `Element`. `String` is not a valid instance.)+* `select` and `is` now accept `Selectable a => a` as the first argument.+* `selectElement`, `selectObject`, `isJQuery`, and `isElement` has been removed in favor of `select` and `is`.+* `createJQuery :: Text -> a -> Fay JQuery` has been replaced by `selectInContext :: (Selectable a, Selectable b) => a -> b -> Fay JQuery`+* `isWith :: (Double -> Bool) -> JQuery -> Fay JQuery` has changed to `isWith :: (Int -> Bool) -> JQuery -> Fay JQuery`+* Updated usage instructions in README++Bug fixes:+* `is` now returns `Bool`++### 0.4.0.1 (2013-09-24)++* Fixed bug in definition of `clone`+* Don't define `fromIntegral`.++### 0.4 (2013-08-27)++* Updated to use fay-text, which fixes bugs in ajax FFI calls.
+ README.md view
@@ -0,0 +1,78 @@+Fay jQuery+==========++[Changelog](CHANGELOG.md)++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+means that names and types may change in rapid and annoying ways until+conventions settle down.++The one consistent convention in the library is that the jQuery object on which+methods operate is the *last* parameter to every function. This allows simple+monadic composition:++```haskell+makeSquare :: JQuery -> Fay JQuery+makeSquare = addClass "square" >=>+             setWidth 400 >=>+             setHeight 400++main :: Fay ()+main = do+    makeSquare $ select "#elementToMakeSquare"+    return ()+```++Usage+-----+++Install:+```bash+cabal install fay-text fay-jquery+```++Compile your file:++```bash+fay --package fay-jquery,fay-text MyFile.hs+```+++Supported API calls+-------------------++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.++- Ajax+- Attributes+- Core+- CSS+- Effects (Basic, Fading)+- Manipulation+- Traversing+- Events++Still to do+-----------++- Data+- Deferred Object+- Effects (Custom, Sliding)+- Forms+- Internals+- Miscellaneous+- Offset+- Plugins+- Properties+- Utilities++Not Applicable+--------------++- Selectors
fay-jquery.cabal view
@@ -1,5 +1,5 @@ name:                fay-jquery-version:             0.5+version:             0.6 synopsis:            jQuery bindings for Fay. description:         jQuery bindings for Fay. homepage:            https://github.com/faylang/fay-jquery@@ -7,11 +7,14 @@ license:             BSD3 license-file:        LICENSE author:              Adam Bergmark, Brian Victor, Chris Done-maintainer:          Adam Bergmark+maintainer:          adam@bergmark.nl copyright:           Adam Bergmark, Brian Victor, Chris Done category:            Web, Fay build-type:          Simple cabal-version:       >=1.8+extra-source-files:+  README.md+  CHANGELOG.md data-files: src/JQuery.hs  source-repository head
src/JQuery.hs view
@@ -173,7 +173,7 @@ addClassWith :: (Double -> Text -> Fay Text) -> JQuery -> Fay JQuery addClassWith = ffi "%2['addClass'](%1)" -getAttr :: Text -> JQuery -> Fay Text+getAttr :: Text -> JQuery -> Fay (Defined Text) getAttr = ffi "%2['attr'](%1)"  setAttr :: Text -> Text -> JQuery -> Fay JQuery@@ -669,14 +669,13 @@ ---- Manipulation ---- --- Is there a better way to constrain the type here?-after :: a -> JQuery -> Fay JQuery+after :: Selectable => a -> JQuery -> Fay JQuery after = ffi "%2['after'](%1)"  afterWith :: (Double -> Fay JQuery) -> JQuery -> Fay JQuery afterWith = ffi "%2['after'](%1)" -append :: a -> JQuery -> Fay JQuery+append :: Selectable a => a -> JQuery -> Fay JQuery append = ffi "%2['append'](%1)"  appendJQuery :: JQuery -> JQuery -> Fay JQuery@@ -686,7 +685,7 @@ appendWith :: (Double -> Fay JQuery) -> JQuery -> Fay JQuery appendWith = ffi "%2['append'](%1)" -appendTo :: a -> JQuery -> Fay JQuery+appendTo :: Selectable a => a -> JQuery -> Fay JQuery appendTo = ffi "%2['appendTo'](%1)"  appendToJQuery :: JQuery -> JQuery -> Fay JQuery@@ -694,7 +693,7 @@   -before :: a -> JQuery -> Fay JQuery+before :: Selectable a => a -> JQuery -> Fay JQuery before = ffi "%2['before'](%1)"  beforeWith :: (Double -> Fay JQuery) -> JQuery -> Fay JQuery@@ -717,19 +716,19 @@ empty :: JQuery -> Fay JQuery empty = ffi "%1['empty']()" -insertAfter :: a -> JQuery -> Fay JQuery+insertAfter :: Selectable a => a -> JQuery -> Fay JQuery insertAfter = ffi "%2['insertAfter'](%1)" -insertBefore :: a -> JQuery -> Fay JQuery+insertBefore :: Selectable a => a -> JQuery -> Fay JQuery insertBefore = ffi "%2['insertBefore'](%1)" -prepend :: a -> JQuery -> Fay JQuery+prepend :: Selectable a => a -> JQuery -> Fay JQuery prepend = ffi "%2['prepend'](%1)"  prependWith :: (Double -> Fay JQuery) -> JQuery -> Fay JQuery prependWith = ffi "%2['prepend'](%1)" -prependTo :: a -> JQuery -> Fay JQuery+prependTo :: Selectable a => a -> JQuery -> Fay JQuery prependTo = ffi "%2['prependTo'](%1)"  remove :: JQuery -> Fay JQuery