openannotation / annotator

Annotation tools for the web. Select text, images, or (nearly) anything else, and add your notes.
http://annotatorjs.org
Other
2.68k stars 531 forks source link

Support fallback data formats in Annotator Store #180

Closed aron closed 11 years ago

aron commented 11 years ago

This ticket stems from issue #172 and arises from the difficulty of working with the Annotator store as it stands at the moment.

Basically this would involve supporting application/x-www-form-urlencoded data as well as application/json and the X-HTTP-Method-Override header (or (_method) param in addition to PUT and DELETE.

Backbone has a nice example of this with it's .emulateHTTP and .emulateJSON flags.

http://backbonejs.org/#Sync-emulateHTTP

nickstenning commented 11 years ago

:+1:

nickstenning commented 11 years ago

I've added this functionality to master in the form of options to the Store plugin.

Let me know what you think.

r25s commented 11 years ago

Hi @nickstenning,

I posted a response in https://github.com/okfn/annotator/issues/172 also:

It is working great!

I would suggest that you add another option to the Store plugin so that users can choose the name of the POST variable, in case the default name 'json' conflicts with another variable.

nickstenning commented 11 years ago

@ronwhiz: I'm going mark this as resolved, even without allowing you to configure another POST variable. If anyone desperately needs that it should be easy enough to add and submit a pull request.