mozilla-appmaker/appmaker — pull request #842 by rorito (2014-01-24 08:38:25+00:00)
Title: Firebase integration

I know there are whitespace issues here, I'll fix those in the morning

Current state, fork and clone:
https://github.com/rorito/component-addform
https://github.com/rorito/component-dataview

as
component-addform-firebase
component-dataview-firebase

add this to your layout.ejs

Fixes thus far:
1. fixed some problems with various events causing the app to load multiple times or change appid multiple times
2. figured out that loading an app from the DB and overwriting the ceci-app element (using the outerHTML that was saved in) was making the app load twice
3. Implemented some basic events to indicate the firebase connection is ready, the ceci-app is ready and the ceci-cards are ready

What's working:
Add Addform-Firebase to the app, create an input, enter data and wire in a button. When you click, the data and the form schema are saved to firebase. You can reload and it should re-initialize the data from firebase. The dataview-firebase displays data in firebase correctly, but edit and delete don't work.

- [ ] Get edit and delete working on the dataview
- [ ] Seeing a syntax error from Localized Error: SyntaxError: Unexpected token } l10n.js:72 in the console, but maybe that's related to something else?
- [ ] Need to do better checking for current app, we kind of naively trust what's in localstorage. If you blow away your DB and refresh, you'll get an error from the ajax request to loadAppByName
- [ ] Is it an issue to not save the ceci-app tag in the DB? We can obviously publish with it, but if we need it in there, we should figure out a better solution than getting the current ceci-app parent node, removing the child and replacing it with a new ceci app.