0.0.5 • Published 6 years ago

pretty-json-warfares v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

PRETTY JSON ==

Simple library to render/format a JS obj to an HTML view. pretty-json-min.js

Live Demo

This is an live demo

Dependecies

  • Backbone 1.1.2 (code structure)
  • Underscore 1.7.0
  • JQuery 1.11.1 (DOM manipulation)

Usage

Properties.

el: DOM elem to append the JSON-HTML view. data: the JSON data. dateFormat: (optional) format date, ex: "DD/MM/YYYY HH24:MI:SS".

  • YYYY : year
  • YY : year
  • MM : month
  • DD : day
  • HH24 : hour 24-format
  • HH : hours
  • MI : minutes
  • SS : seconds

Methods

Node expandAll: recursive open & render all nodes. (lazy render: the node will render only if it's expanded) collapseAll: close (Hide) all nodes.

Events

Node collapse: trigger when a node is show or hide. (event) mouseover: trigger when mouse over a node. (path) mouseout: trigger when mouse out the node (event)

  • Note: "node" is an Obj or an Array.
  • Note : only tested in Chrome & FireFox.
0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago