codeforamerica / wand

Let's make wizards!
MIT License
6 stars 4 forks source link

Be able to generate a wizard from an external json file #46

Open ErnieAtLYD opened 9 years ago

ErnieAtLYD commented 9 years ago

Per @bsmithgall:

  1. You drop in wand.js or wand.min.js into your website.
  2. You either directly include your spec on the page, or we host them on some sort of github.io/blocks type thing. I think there should probably be some sort of loadFromUrl or initFromUrl type thing to do an async fetch.

Per @mapsam this ties in to the idea of the wand editor just saving as an anonymous gist

Wand.initURL('https://gist.github.com/anonymous/1f7e70a460620fe64c64');

And can use this xhr work from dropchop: https://github.com/cugos/dropchop/blob/master/src/js/operations/FileExecute.js#L81-L98

mapsam commented 9 years ago

I put this together in a branch last week taking most of it from dropchop (many thanks to @alukach) - take a look!

https://github.com/codeforamerica/wand/blob/load-from-url/src/js/wand.js#L48-L64

bsmithgall commented 9 years ago

:+1: I would recommend that you throw an error and surface a notification instead of just erroring in the console.

mapsam commented 9 years ago

Totally - that console was just a placeholder. I'm going to wait for the api trigger stuff to get merged in, sync it, then work on this (unless @ErnieAtLYD would like to take it on, or should a mob session spontaneously appear and want to handle it)

ErnieAtLYD commented 9 years ago

@mapsam: It's all yours!