Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
Merge f050e31 into 680dc8f
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Jackson committed Nov 3, 2015
2 parents 680dc8f + f050e31 commit 3bc1d94
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,25 @@ var CollectionView = Orchestra.CollectionView.extend({});
Orchestra.mixin(CollectionView, MyMixins.SelectMixin, MyMixins.SomeOtherMixin);
```

### Backbone.Syphon
[repo](https://github.com/marionettejs/backbone.syphon)

_"Backbone.Syphon aims to make it easy to serialize the fields of a Backbone.View into a simple JSON object that contains all of the values."_

To easily serialize forms fields into a JSON representation with Orchestra, follow this API:

```
Orchestra.LayoutView.extend({
events: {
"submit form": "formSubmitted"
},
formSubmitted: function(e){
e.preventDefault();
var data = Backbone.Syphon.serialize(this);
},
});
```

### jQuery
[repo](https://github.com/jquery/jquery) | [docs](http://api.jquery.com/)

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"backbone.service": "^0.5.0",
"backbone.stickit": "^0.8.0",
"backbone.storage": "^0.1.0",
"backbone.syphon": "^0.6.3",
"hammerjs": "^2.0.4",
"handlebars": "~1.3.0",
"i18next-client": "^1.7.4",
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Cocktail from 'backbone.cocktail';
import Radio from 'backbone.radio';
import Service from 'backbone.service';
import Storage from 'backbone.storage';
import Syphon from 'backbone.syphon';
import Collection from './mvc/collection';
import Currency from './helpers/currency';
import LocalStorage from './helpers/localStorage';
Expand Down Expand Up @@ -39,6 +40,7 @@ _.extend(Orchestra, {
Radio,
Service,
Storage,
Syphon,
Cocktail,
Route,
Router,
Expand Down
4 changes: 4 additions & 0 deletions tests/spec/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ describe('Orchestra', function() {
expect(Orchestra.Radio).to.be.an('object');
});

it('should expose the Backbone.Syphon object', function() {
expect(Orchestra.Syphon).to.be.an('object');
});

it('should expose the Backbone.Cocktail object', function() {
expect(Orchestra.Cocktail).to.be.an('object');
});
Expand Down

0 comments on commit 3bc1d94

Please sign in to comment.