All Projects → kevinburke → Hulk

kevinburke / Hulk

Licence: mit
In-browser JSON editor

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Hulk

Esp8266 Wifi Relay
simple sketch of using ESP8266WebServer to switch relays on GPIO pins. It serves a simple website with toggle buttons for each relay
Stars: ✭ 13 (-95.7%)
Mutual labels:  json, jquery
Tabulator
Interactive Tables and Data Grids for JavaScript
Stars: ✭ 4,329 (+1333.44%)
Mutual labels:  json, jquery
Form
jQuery Form Plugin
Stars: ✭ 5,122 (+1596.03%)
Mutual labels:  json, jquery
Rest Api Examples
Test and Prototype with Fake Online REST/OAuth 2 APIs Examples
Stars: ✭ 13 (-95.7%)
Mutual labels:  json, jquery
Bootstrap
Open Source JS plugins
Stars: ✭ 13 (-95.7%)
Mutual labels:  json, jquery
Jquery.json Viewer
jQuery plugin for displaying JSON data
Stars: ✭ 295 (-2.32%)
Mutual labels:  json, jquery
Funiture
慕课网课程推荐 Java并发编程与高并发解决方案:http://coding.imooc.com/class/195.html Java开发企业级权限管理系统:http://coding.imooc.com/class/149.html github: https://github.com/kanwangzjm/funiture, spring项目,权限管理、系统监控、定时任务动态调整、qps限制、sql监控(邮件)、验证码服务、短链接服务、动态配置等
Stars: ✭ 1,786 (+491.39%)
Mutual labels:  json, jquery
Survey Library
JavaScript Survey and Form Library
Stars: ✭ 3,060 (+913.25%)
Mutual labels:  json, jquery
Anime Offline Database
Updated every week: A JSON based offline anime database containing the most important meta data as well as cross references to various anime sites such as MAL, ANIDB, ANILIST, KITSU and more...
Stars: ✭ 292 (-3.31%)
Mutual labels:  json
Validate
A simple jQuery plugin to validate forms.
Stars: ✭ 298 (-1.32%)
Mutual labels:  jquery
Tmuxp
💻 tmux session manager. built on libtmux
Stars: ✭ 3,269 (+982.45%)
Mutual labels:  json
Windows 95 Ui Kit
💾 Windows 95 UI Kit made with Bootstrap 4 components
Stars: ✭ 294 (-2.65%)
Mutual labels:  jquery
Python Json Patch
Applying JSON Patches in Python
Stars: ✭ 298 (-1.32%)
Mutual labels:  json
Easyjson
Fast JSON serializer for golang.
Stars: ✭ 3,512 (+1062.91%)
Mutual labels:  json
Artdialog
经典的网页对话框组件
Stars: ✭ 3,110 (+929.8%)
Mutual labels:  jquery
Envfile
EnvFile 3.0 is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
Stars: ✭ 293 (-2.98%)
Mutual labels:  json
Json Schema Validator
A fast Java JSON schema validator that supports draft V4, V6, V7 and V2019-09
Stars: ✭ 292 (-3.31%)
Mutual labels:  json
Ikigajson
A high performance JSON library in Swift
Stars: ✭ 302 (+0%)
Mutual labels:  json
Jquery Match Height
a responsive equal heights plugin
Stars: ✭ 3,100 (+926.49%)
Mutual labels:  jquery
Angular Slickgrid
Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
Stars: ✭ 298 (-1.32%)
Mutual labels:  jquery

Hulk

Hulk is an in-browser JSON editor. View an example

Usage

$.hulk('#selector', {foo: "bar"}, function(data) {
    console.log("Here's the updated data: " + data);
});

Will insert the JSON editor into the div with id "selector". Generally ID's are preferred.

The third argument is a callback that will execute when the user presses "Save". Alternatively, you can retrieve the state of the world at any point by calling:

$.hulkSmash('#selector');

There are two CSS files, hulk.css and hulk-colors.css, which make the layout much more readable. Of course, you are happy to style the inputs however you desire.

Argument documentation

The $.hulk function takes the following arguments in this order:

  • selector (string) - Any valid jQuery selector. The input nodes will be inserted into the DOM based on the selector you give. This argument is required.

  • data (object) - Any valid JSON object. This will be serialized and splayed into the DOM. This argument is required.

  • callback (function) - When the user presses "Save" hulk will re-serialize the data and pass it as an argument to the function you provide. This argument is optional.

  • options (object) - A dictionary of optional settings for hulk. The possible options are outlined below. This argument is optional.

The $.hulkSmash function takes the following arguments in this order:

  • selector (string) - Any valid jQuery selector. The input nodes will be inserted into the DOM based on the selector you give. This argument is required.

  • options (object) - A dictionary of optional settings for hulk. The possible options are outlined below. This argument is optional.

Optional settings

These are options that you can pass to either $.hulk or $.hulkSmash.

  • separator (string) - Define a custom separator between keys and values. By default, the separator is "=>".

  • emptyString (string) - Serialize an empty text input field back into JSON using the empty string ("") instead of null. Defaults to false.

  • depth (int) - Collapse all dictionaries and lists that are nested deeper than depth. depth=0 will collapse everything. depth=-1 will expand everything. The default is to show all JSON.

  • smartParsing (boolean) - Try to parse text inputs into matching data types, eg turn the string "5.53" into the number 5.53 when serializing into JSON, and turn "true" into true. If set to false, all objects will be serialized as strings. The default is true.

  • showSaveButton (boolean) - Whether to show the "Save" button. The default is to show the button.

  • permissions (array of strings) - Define how customizable and editable the custom JSON dictionary is. For example, you may only want to update existing values, not add new objects. This takes a few different values

    • "all" - allow the user to edit everything. This is the default.
    • "values-only" - only allow the user to edit the leaf nodes. Keys cannot be added or modified.
    • "no-append" - User can edit keys and values, but can't add or delete nodes from the object.

Why?

Editing raw JSON is error-prone and not friendly to non-technical people. This makes it easy to edit and serialize JSON. This also makes it easy for a programmer and a non-technical user to collaborate.

We also use this tool internally at Twilio to edit configuration files.

Notes

  • Javascript objects do not maintain a sorted order. This means, when serializing an object from HTML to JSON, the keys will not be sorted. To maintain some semblance of order, keys are presented on the page in alphabetical order when serializing from JSON to HTML (this is something we can control). Consider sorting keys once they are received on the server or whichever sane language is dealing with your new JSON object.

  • There is inherent uncertainty in using text inputs for data entry. Does the entry "5.5" represent the number 5.5 or the string "5.5"? In this case we do some basic parsing.

    • if the value looks like a number, it's converted to a number
    • if the value looks like a boolean ("true" or "false"), it's converted to a boolean
    • if the value is empty, or the word "null", it's converted to the null value.

    That said, if you set the smartParsing option to false, all inputs will be serialized and returned as strings.

Installation

  1. Include the jQuery source on your page

  2. Include the hulk plugin.

  3. Call away

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].