[openbiblio-dev] JS editor component for BibJSON?

Tom Oinn tom.oinn at okfn.org
Wed Aug 8 01:36:45 UTC 2012


I've now implemented a relatively unobtrusive editor for a BibJSON
object. Code is here :
https://github.com/okfn/textus/blob/master/src/public/js/views/editBibJsonView2.js
and you can see it in action at http://mytextus.herokuapp.com/#test

If you have a play and wonder why fields are vanishing it's probably
because you left them empty and there's some pruning going on -
basically empty strings and empty lists are culled at various points.
I've configured it with the most common parts of the BibJSON spec, it
won't delete anything it doesn't recognize from the object you give it
(in this example it's starting from scratch but it can be passed an
existing BibJSON object) and it would be easy enough to add new fields
- see the start of the source for how it works.

At the moment I don't think there's anything particularly textus
specific in the code, it uses require.js but nothing out of the
ordinary otherwise - any use to anyone?

-- 
Tom Oinn
+44 (0) 20 8123 5142 or Skype ID 'tomoinn'
http://www.crypticsquid.com




More information about the openbiblio-dev mailing list