Sha256: 13a5507b73d00655e0feebc8a7fc1bd1d24dd5ca281992cb824cc77b9c734931

Contents?: true

Size: 1.6 KB

Versions: 11

Compression:

Stored size: 1.6 KB

Contents

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
<head>
<title>Beautify JSON</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
	@import "../../../dojo/resources/dojo.css";
	@import "../../../dijit/tests/css/dijitTests.css";
</style>
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
<script type="text/javascript">

trimPath = function(o){
	if(o instanceof Array){
		for(var i = 0; i < o.length; ++i){
			trimPath(o[i]);
		}
		return;
	}
	if(("shape" in o) && ("path" in o.shape)){
		o.shape.path = dojo.trim(o.shape.path.replace(/\s\s+/g, " "));
	}
	if("children" in o){
		trimPath(o.children);
	}
};

beautify = function(){
	var t = dojo.byId("io");
	var v = dojo.fromJson(t.value);
	if(dojo.byId("path").checked){
		trimPath(v);
	}
	t.value = dojo.toJson(v, dojo.byId("pprint").checked);
};

</script>
</head>
<body>
	<h1>Beautify JSON</h1>
	<p>Paste valid JSON in this textarea and receive a pretty-printed version of it. Use Firefox, if you want to be able to read comma-ended sequences (Python style).
	Additionally it knows how to remove extra spaces from path elements.</p>
	<p><textarea id="io" cols="80" rows="10" wrap="off"></textarea></p>
	<p><button onclick="beautify()">Beautify!</button>
	&nbsp;&nbsp;&nbsp;<input type="checkbox" id="path" checked="checked" />&nbsp;Process "path" elements
	&nbsp;&nbsp;&nbsp;<input type="checkbox" id="pprint" checked="checked" />&nbsp;Pretty-print JSON</p>
	<p><em>This program is a companion for inspector.html.</em></p>
</body>
</html>

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
dojo_src-1.5.0 dojo/dojox/gfx/demos/beautify.html
dojo_src-1.4.3 dojo/dojox/gfx/demos/beautify.html
dojo_src-1.4.102 dojo/dojox/gfx/demos/beautify.html
dojo-pkg-1.132.0 data/dojo-release-1.3.2-src/dojox/gfx/demos/beautify.html
dojo-pkg-1.111.0 data/dojo-release-1.1.1-src/dojox/gfx/demos/beautify.html
dojo-pkg-1.120.0 data/dojo-release-1.2.0-src/dojox/gfx/demos/beautify.html
dojo-pkg-1.121.0 data/dojo-release-1.2.1-src/dojox/gfx/demos/beautify.html
dojo-pkg-1.122.0 data/dojo-release-1.2.2-src/dojox/gfx/demos/beautify.html
dojo-pkg-1.123.0 data/dojo-release-1.2.3-src/dojox/gfx/demos/beautify.html
dojo-pkg-1.130.0 data/dojo-release-1.3.0-src/dojox/gfx/demos/beautify.html
dojo-pkg-1.131.0 data/dojo-release-1.3.1-src/dojox/gfx/demos/beautify.html