-
Notifications
You must be signed in to change notification settings - Fork 10
/
example.html
executable file
·51 lines (46 loc) · 1.46 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<link href="build/jquery.json-editor.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="vendor/jquery-1.11.1.js"></script>
<script type="text/javascript" src="vendor/json2.js"></script>
<script type="text/javascript" src="build/jquery.json-editor.js"></script>
<style>
.wrapper {
width: 500px;
height: 500px;
margin-top: 50px;
}
</style>
<script>
$(document).ready(function(){
JSONEditor.prototype.ADD_IMG = 'lib/images/add.png';
JSONEditor.prototype.DELETE_IMG = 'lib/images/delete.png';
var example1 = new JSONEditor($("#example1"), { showWipe: false });
example1.doTruncation(true);
example1.showFunctionButtons();
var example2 = new JSONEditor($("#example2"), { showWipe: true });
example2.doTruncation(true);
example2.showFunctionButtons(false);
});
</script>
</head>
<body>
<textarea id="example1" rows="20">
{
"names": ["andy", "ben", "sam"],
"some_object": {
"foo": "bar",
"baz": [{ "woah": "there"}],
"long_line": "a b c d e f g h i j | a b c d e f g h i j | match(/dflkjdfkjhdfkjhdf/) | dfjkhsdfh | a b c d e f g h i j"
}
}
</textarea>
<div class="wrapper">
<textarea id="example2" rows="10">
{
"names": ["andy", "ben", "sam"]
}
</textarea>
</div>
</body>
</html>