You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Benoit Chesneau <bc...@gmail.com> on 2012/12/11 16:04:36 UTC

json editor in js

Hello,

I am actually working on a couchapp and need to add a json editor to it.
Any idea about it ? Maybe something that could work with codemirror but
that isn't a strong requirement.

Anyway any recommendation is appreciated.

- benoît

Re: json editor in js

Posted by Benoit Chesneau <bc...@gmail.com>.
On Thu, Dec 13, 2012 at 9:07 PM, Russell Branca <ch...@gmail.com>wrote:

> We've been using CodeMirror in Fauxton, and I wired up JSHint to it for
> live linting feedback, which seems to work pretty well and was fairly easy
> to add in. Code here:
>
> https://github.com/cloudant-labs/couchdb/blob/fauxton/src/fauxton/app/modules/documents/views.js#L303-L316
>
>
> -Russell
>
>
Thanks for the link and code :) I am playing with it right now.

Re: json editor in js

Posted by Russell Branca <ch...@gmail.com>.
We've been using CodeMirror in Fauxton, and I wired up JSHint to it for
live linting feedback, which seems to work pretty well and was fairly easy
to add in. Code here:
https://github.com/cloudant-labs/couchdb/blob/fauxton/src/fauxton/app/modules/documents/views.js#L303-L316


-Russell


On Tue, Dec 11, 2012 at 10:22 AM, Mark Hahn <ma...@hahnca.com> wrote:

> I'm using jsoneditor in my futon replacement and it is awesome.
> https://github.com/mark-hahn/ftn
>
>
> On Tue, Dec 11, 2012 at 9:48 AM, Benoit Chesneau <bc...@gmail.com>
> wrote:
> > On Tue, Dec 11, 2012 at 5:06 PM, Dave Cottlehuber <dc...@jsonified.com>
> wrote:
> >
> >> On 11 December 2012 16:04, Benoit Chesneau <bc...@gmail.com> wrote:
> >> > Hello,
> >> >
> >> > I am actually working on a couchapp and need to add a json editor to
> it.
> >> > Any idea about it ? Maybe something that could work with codemirror
> but
> >> > that isn't a strong requirement.
> >> >
> >> > Anyway any recommendation is appreciated.
> >> >
> >> > - benoît
> >>
> >> Garren already had a crack for futon2
> >>
> >>
> https://github.com/garrensmith/futon2/commit/781ef9be3729f44c2c879e8e7aed7ac86e69db47
> >> which uses
> >>  https://github.com/wjosdejong/jsoneditoronline
> >> http://www.jsoneditoronline.org/ under the hood.
> >>
> >> There's also Ben's https://github.com/bigbluehat/reformed
> >>
> >> A+
> >> Dave
> >>
> >
> > Thanks for the links :) WIll see what can I do with them.
> >
> > - benoit
>

Re: json editor in js

Posted by Mark Hahn <ma...@hahnca.com>.
I'm using jsoneditor in my futon replacement and it is awesome.
https://github.com/mark-hahn/ftn


On Tue, Dec 11, 2012 at 9:48 AM, Benoit Chesneau <bc...@gmail.com> wrote:
> On Tue, Dec 11, 2012 at 5:06 PM, Dave Cottlehuber <dc...@jsonified.com> wrote:
>
>> On 11 December 2012 16:04, Benoit Chesneau <bc...@gmail.com> wrote:
>> > Hello,
>> >
>> > I am actually working on a couchapp and need to add a json editor to it.
>> > Any idea about it ? Maybe something that could work with codemirror but
>> > that isn't a strong requirement.
>> >
>> > Anyway any recommendation is appreciated.
>> >
>> > - benoît
>>
>> Garren already had a crack for futon2
>>
>> https://github.com/garrensmith/futon2/commit/781ef9be3729f44c2c879e8e7aed7ac86e69db47
>> which uses
>>  https://github.com/wjosdejong/jsoneditoronline
>> http://www.jsoneditoronline.org/ under the hood.
>>
>> There's also Ben's https://github.com/bigbluehat/reformed
>>
>> A+
>> Dave
>>
>
> Thanks for the links :) WIll see what can I do with them.
>
> - benoit

Re: json editor in js

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Dec 11, 2012 at 5:06 PM, Dave Cottlehuber <dc...@jsonified.com> wrote:

> On 11 December 2012 16:04, Benoit Chesneau <bc...@gmail.com> wrote:
> > Hello,
> >
> > I am actually working on a couchapp and need to add a json editor to it.
> > Any idea about it ? Maybe something that could work with codemirror but
> > that isn't a strong requirement.
> >
> > Anyway any recommendation is appreciated.
> >
> > - benoît
>
> Garren already had a crack for futon2
>
> https://github.com/garrensmith/futon2/commit/781ef9be3729f44c2c879e8e7aed7ac86e69db47
> which uses
>  https://github.com/wjosdejong/jsoneditoronline
> http://www.jsoneditoronline.org/ under the hood.
>
> There's also Ben's https://github.com/bigbluehat/reformed
>
> A+
> Dave
>

Thanks for the links :) WIll see what can I do with them.

- benoit

Re: json editor in js

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Dec 11, 2012 at 5:16 PM, matt j. sorenson <ma...@sorensonbros.net>wrote:

> Is ace (the editor/engine in c9.io) an option? or is that more, less, or
> just different than a highly purposed json editor would be?
>

That's a good question... I am not sur eactually what I'm looking for. I'm
looking for a simple way to edit json & visualize them.

- benoît

Re: json editor in js

Posted by "matt j. sorenson" <ma...@sorensonbros.net>.
Is ace (the editor/engine in c9.io) an option? or is that more, less, or
just different than a highly purposed json editor would be?

https://github.com/ajaxorg/ace

--
*matt j. sorenson*
mobile: 320-424-0309

phone calls always welcome :)



On Tue, Dec 11, 2012 at 10:06 AM, Dave Cottlehuber <dc...@jsonified.com>wrote:

> On 11 December 2012 16:04, Benoit Chesneau <bc...@gmail.com> wrote:
> > Hello,
> >
> > I am actually working on a couchapp and need to add a json editor to it.
> > Any idea about it ? Maybe something that could work with codemirror but
> > that isn't a strong requirement.
> >
> > Anyway any recommendation is appreciated.
> >
> > - benoît
>
> Garren already had a crack for futon2
>
> https://github.com/garrensmith/futon2/commit/781ef9be3729f44c2c879e8e7aed7ac86e69db47
> which uses
>  https://github.com/wjosdejong/jsoneditoronline
> http://www.jsoneditoronline.org/ under the hood.
>
> There's also Ben's https://github.com/bigbluehat/reformed
>
> A+
> Dave
>

Re: json editor in js

Posted by Dave Cottlehuber <dc...@jsonified.com>.
On 11 December 2012 16:04, Benoit Chesneau <bc...@gmail.com> wrote:
> Hello,
>
> I am actually working on a couchapp and need to add a json editor to it.
> Any idea about it ? Maybe something that could work with codemirror but
> that isn't a strong requirement.
>
> Anyway any recommendation is appreciated.
>
> - benoît

Garren already had a crack for futon2
https://github.com/garrensmith/futon2/commit/781ef9be3729f44c2c879e8e7aed7ac86e69db47
which uses
 https://github.com/wjosdejong/jsoneditoronline
http://www.jsoneditoronline.org/ under the hood.

There's also Ben's https://github.com/bigbluehat/reformed

A+
Dave

Re: json editor in js

Posted by Volker Mische <vo...@gmail.com>.
On 12/11/2012 04:04 PM, Benoit Chesneau wrote:
> Hello,
> 
> I am actually working on a couchapp and need to add a json editor to it.
> Any idea about it ? Maybe something that could work with codemirror but
> that isn't a strong requirement.
> 
> Anyway any recommendation is appreciated.
> 
> - benoît
> 

Hi Benoit,

I've created a JSON mode for CodeMirror2 ages ago, but never found the
time to get it release ready. I squashed it into two sensible commits
[1] . Please note that it only works with CodeMirror2 2.33 as
"onHighlightComplete" got broken afterwards [2]. But it's probably not
to hard to get it working again. You probably want to port it to
CodeMirror3 anyway.

To try it, just open mode/json/index.html. The visual errors it supports
is trailing and missing commas in objects and duplicated keys.

[1] https://github.com/vmx/CodeMirror2/tree/json-mode
[2] http://codemirror.net/2/doc/oldrelease.html

Cheers,
  Volker