[openbiblio-dev] JS editor component for BibJSON?

Mark MacGillivray mark at cottagelabs.com
Mon Aug 6 09:23:28 UTC 2012


On Mon, Aug 6, 2012 at 10:14 AM, Tom Oinn <tom.oinn at okfn.org> wrote:

> On 6 August 2012 10:06, Mark MacGillivray <mark at cottagelabs.com> wrote:
> > check out jtedit and see if it helps you :
> >
> > https://github.com/CottageLabs/jtedit
> >
> >
> > You may not want to use it as it stands, but the method it employs for
> > presenting data on the page may be informative. I found that trying to
> > present JSON in an editor was too restrictive when the JSON can have
> > multiple levels of complexity, so instead it displays a simple text box
> with
> > the JSON plus scans for input fields tagged with class .jtedit_blah, and
> > when they change it updates the JSON. That way, when you know your
> complex
> > JSON layout, you can design a page e.g. with lists, tables or whatever,
> and
> > drop jtedit in to handle the updates.
>
> Oh, I've no intention of displaying anything that looks like JSON,
> that would be a usability nightmare :)


Absolutely.



> Is there a demo of jtedit
> anywhere? The github page with 'docs are on the way' doesn't encourage
> much further exploration!
>

Indeed - it is just something I have been working on recently, but have not
done much with it. What may help you is that it tracks text boxes with a
given class, and inserts their values into a JSON object when they get
changed. So if you pull that out, you could watch changes to fields on a
page and trigger updates to a hidden JSON object. Then save that on change
or on request.

When users create a new part of a record, then as long as you can tag that
with the right class and bind the functionality to it, you could make an
editor that allows people to extend a JSON object by clicking around on a
web page.

As mentioned, it may not be of any use to you, but thought I would point it
out.



> On a related note I saw a commit message (I think) on facetview
> mentioning the ability to plug in custom renderers for results, did I
> imagine that?
>

Facetview now allows you to tell it in the settings how the results should
be displayed. You can tell it how to wrap the entire result set - e.g. put
it in a table, then tell it how to wrap each result object - e.g. wrap it
in a row, and you can provide the result display layout as used in
bibserver - e.g. you specify which fields of the record you want displayed,
and what html you want pre and post each of those fields. Check out how
this is done in bibserver as an example.

Mark




>
> --
> Tom Oinn
> +44 (0) 20 8123 5142 or Skype ID 'tomoinn'
> http://www.crypticsquid.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openbiblio-dev/attachments/20120806/df777c73/attachment.html>


More information about the openbiblio-dev mailing list