GithubHelp home page GithubHelp logo

dardesantis / djson-viewer Goto Github PK

View Code? Open in Web Editor NEW
40.0 7.0 8.0 878 KB

Makes JSON/JSONP easy to read.

Home Page: https://chrome.google.com/webstore/detail/djson-viewer/chaeijjekipecdajnijdldjjipaegdjc

Ruby 0.07% JavaScript 74.04% CSS 21.22% HTML 4.66%
json json-viewer chrome-extension jsonviewer json-formatters

djson-viewer's People

Contributors

bitdeli-chef avatar bjhomer avatar bricker avatar callumlocke avatar dardesantis avatar ddesantis avatar johan avatar markmarkoh avatar yannickoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

djson-viewer's Issues

Add a new option preference to collapse children for big JSON only

It will be interesting to add a new option preference: Format JSON with collapsed children only for big JSON.

It's not an absolute must have, but will be useful for user working with very big JSON and normal size JSON. When the JSON is big, show collapsed children will avoid Chrome to lag during scrolling. For JSON with normal size, there is no reason to show collapsed children.

I don't know wether it's hard to do, but it can be an interesting new feature.

Extend Collapse children logic to Collapse All button

Thx @dardesantis, the Format JSON with collapsed children option works perfectly in v0.4.3. The option is very useful now!

Maybe we can extend the same logic to the Collapse All button as well, because it's also useless to show totally collapsed JSON here, what do you think?

The option behaviour will be more consistent. And if an user really wants to show a totally collapsed JSON, he can do it manually very easily.

Nested JSON buttons not working with inline response formatting

I could swear this worked until fairly recently. When I plug JSON directly into the extension popup dialog and display it, the "view Nested JSON" buttons work as expected. But when it kicks in as a response formatter when retrieving a JSON-like response from a URL, they don't.

Inspecting with dev tools shows that when the extension creates the page, there are onClick event handlers (among others) that handle those buttons. When the response is formatted inline, there are not any event handlers. That being said, the raw/parsed, expand/collapse, options buttons all work, so the original Callum Locke options bar still functions. It's only the stuff inline to the content.

I couldn't find a public URL with nested JSON to test, but I used the following literal both pasted in, and served from a local textfile with python3 -m http.server:

{
    "field": "{\"nestedContent\": { \"nestedValue\": 1 }}"
}

If, for some reason, it turns out you can't put active decorations on displayed text files anymore (i.e. can only attach JS to HTML, etc) you might consider an inline expansion a la the one done by Nested JSON Object Parser.

It just displays the subobject in place of the text values as if it weren't a nested string. That has its own issues because they don't have any way of controlling it or showing you they did that, but you could add an "expand embedded JSON" toggle button to the original options bar and maybe hint in the gutter.

Unfortunately, it's a sloppy fork (looks like a personal project) and they haven't posted their own URL while the metadata still points at the Callum Locke repo. So their code and licensing isn't readily available, but I assume it's pretty straightforward to rewrite the response.

Honestly, I'd prefer that flow over the new page for every nest flow we currently have. That one is a bit painful, especially since reloading the page by mistake breaks it. The files I'm practically having to use this on have multiple levels of nesting, so anything recursive is far easier.

Edit: should clarify, this from the Chrome Web Store, using version 0.6.0. The Chrome version is Version 81.0.4044.122 (Official Build) (64-bit) on Mac.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.