jsoneditor/examples/06_custom_styling.html

52 lines
1.2 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
<html>
<head>
2017-05-16 14:20:30 +08:00
<title>JSONEditor | Custom styling</title>
2017-05-16 14:20:30 +08:00
<link href="../dist/jsoneditor.css" rel="stylesheet" type="text/css">
<script src="../dist/jsoneditor.js"></script>
2017-05-15 12:31:20 +08:00
2017-05-16 14:20:30 +08:00
<style type="text/css">
#jsoneditor {
width: 500px;
height: 500px;
}
2017-05-16 14:20:30 +08:00
p {
width: 500px;
font-family: "DejaVu Sans", sans-serif;
}
</style>
2017-05-16 14:20:30 +08:00
<link href="./css/darktheme.css" rel="stylesheet" type="text/css">
</head>
<body>
2017-05-16 14:20:30 +08:00
<p>
This example demonstrates how to customize the look of JSONEditor,
the editor below has a dark theme. Note that the example isn't worked
out for the mode <code>code</code>. To do that, you can load and configure
a custom theme for the Ace editor.
</p>
2017-05-16 14:20:30 +08:00
<div id="jsoneditor"></div>
2017-05-16 14:20:30 +08:00
<script>
// create the editor
2017-05-16 14:20:30 +08:00
var container = document.getElementById('jsoneditor');
var options = {
2017-05-16 14:20:30 +08:00
modes: ['text', 'tree']
};
var json = {
'array': [1, 2, 3],
'boolean': true,
'null': null,
'number': 123,
'object': {'a': 'b', 'c': 'd'},
'string': 'Hello World'
};
var editor = new JSONEditor(container, options, json);
2017-05-16 14:20:30 +08:00
</script>
</body>
</html>