Switched everything to 2-space indentation
This commit is contained in:
parent
8ddc6f3946
commit
8e07ebb711
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
<!-- TODO: info, links, faq -->
|
<!-- TODO: info, links, faq -->
|
||||||
<!--
|
<!--
|
||||||
<div class="info" style="display:none;">
|
<div class="info" style="display:none;">
|
||||||
JSON, or JavaScript Object Notation, is a lightweight text-based open standard
|
JSON, or JavaScript Object Notation, is a lightweight text-based open standard
|
||||||
designed for human-readable data interchange. It is derived from the JavaScript
|
designed for human-readable data interchange. It is derived from the JavaScript
|
||||||
scripting language for representing simple data structures and associative arrays,
|
scripting language for representing simple data structures and associative arrays,
|
||||||
|
@ -111,14 +111,14 @@
|
||||||
and web application, serving as an alternative to XML.
|
and web application, serving as an alternative to XML.
|
||||||
<br><br>
|
<br><br>
|
||||||
From <a target="_blank" href="http://en.wikipedia.org/wiki/Json">Wikipedia</a>
|
From <a target="_blank" href="http://en.wikipedia.org/wiki/Json">Wikipedia</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="links" style="display:none;">
|
<div class="links" style="display:none;">
|
||||||
<a target="_blank" href="http://json.org/">http://json.org/</a><br>
|
<a target="_blank" href="http://json.org/">http://json.org/</a><br>
|
||||||
<a target="_blank" href="http://en.wikipedia.org/wiki/Json">http://en.wikipedia.org/wiki/Json</a><br>
|
<a target="_blank" href="http://en.wikipedia.org/wiki/Json">http://en.wikipedia.org/wiki/Json</a><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="faq" style="display:none;"></div>
|
<div class="faq" style="display:none;"></div>
|
||||||
-->
|
-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
|
|
||||||
<!-- TODO: info, links, faq -->
|
<!-- TODO: info, links, faq -->
|
||||||
<!--
|
<!--
|
||||||
<div class="info" style="display:none;">
|
<div class="info" style="display:none;">
|
||||||
JSON, or JavaScript Object Notation, is a lightweight text-based open standard
|
JSON, or JavaScript Object Notation, is a lightweight text-based open standard
|
||||||
designed for human-readable data interchange. It is derived from the JavaScript
|
designed for human-readable data interchange. It is derived from the JavaScript
|
||||||
scripting language for representing simple data structures and associative arrays,
|
scripting language for representing simple data structures and associative arrays,
|
||||||
|
@ -144,14 +144,14 @@
|
||||||
and web application, serving as an alternative to XML.
|
and web application, serving as an alternative to XML.
|
||||||
<br><br>
|
<br><br>
|
||||||
From <a target="_blank" href="http://en.wikipedia.org/wiki/Json">Wikipedia</a>
|
From <a target="_blank" href="http://en.wikipedia.org/wiki/Json">Wikipedia</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="links" style="display:none;">
|
<div class="links" style="display:none;">
|
||||||
<a target="_blank" href="http://json.org/">http://json.org/</a><br>
|
<a target="_blank" href="http://json.org/">http://json.org/</a><br>
|
||||||
<a target="_blank" href="http://en.wikipedia.org/wiki/Json">http://en.wikipedia.org/wiki/Json</a><br>
|
<a target="_blank" href="http://en.wikipedia.org/wiki/Json">http://en.wikipedia.org/wiki/Json</a><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="faq" style="display:none;"></div>
|
<div class="faq" style="display:none;"></div>
|
||||||
-->
|
-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ Constructs a new JSONEditor.
|
||||||
True by default.
|
True by default.
|
||||||
Only applicable when `mode` is 'tree', 'view', or 'form'.
|
Only applicable when `mode` is 'tree', 'view', or 'form'.
|
||||||
- `{Number} indentation`.
|
- `{Number} indentation`.
|
||||||
Number of indentation spaces. 4 by default.
|
Number of indentation spaces. 2 by default.
|
||||||
Only applicable when `mode` is 'code' or 'text'.
|
Only applicable when `mode` is 'code' or 'text'.
|
||||||
|
|
||||||
- `{JSON} json`
|
- `{JSON} json`
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
<button id="setJSON">Set JSON</button>
|
<button id="setJSON">Set JSON</button>
|
||||||
<button id="getJSON">Get JSON</button>
|
<button id="getJSON">Get JSON</button>
|
||||||
</p>
|
</p>
|
||||||
<div id="jsoneditor"></div>
|
<div id="jsoneditor"></div>
|
||||||
|
|
||||||
<script type="text/javascript" >
|
<script type="text/javascript" >
|
||||||
// create the editor
|
// create the editor
|
||||||
var container = document.getElementById('jsoneditor');
|
var container = document.getElementById('jsoneditor');
|
||||||
var editor = new jsoneditor.JSONEditor(container);
|
var editor = new jsoneditor.JSONEditor(container);
|
||||||
|
@ -40,6 +40,6 @@
|
||||||
var json = editor.get();
|
var json = editor.get();
|
||||||
alert(JSON.stringify(json, null, 2));
|
alert(JSON.stringify(json, null, 2));
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
This editor is read-only (mode='viewer').
|
This editor is read-only (mode='viewer').
|
||||||
</p>
|
</p>
|
||||||
<div id="jsoneditor"></div>
|
<div id="jsoneditor"></div>
|
||||||
|
|
||||||
<script type="text/javascript" >
|
<script type="text/javascript" >
|
||||||
var container = document.getElementById('jsoneditor');
|
var container = document.getElementById('jsoneditor');
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
|
@ -35,6 +35,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
var editor = new jsoneditor.JSONEditor(container, options, json);
|
var editor = new jsoneditor.JSONEditor(container, options, json);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
<script data-main="scripts/main" src="scripts/require.js"></script>
|
<script data-main="scripts/main" src="scripts/require.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
<button id="setJSON">Set JSON</button>
|
<button id="setJSON">Set JSON</button>
|
||||||
<button id="getJSON">Get JSON</button>
|
<button id="getJSON">Get JSON</button>
|
||||||
</p>
|
</p>
|
||||||
<div id="jsoneditor"></div>
|
<div id="jsoneditor"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1039,7 +1039,7 @@ TextEditor.prototype._create = function (container, options, json) {
|
||||||
this.indentation = Number(options.indentation);
|
this.indentation = Number(options.indentation);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.indentation = 4; // number of spaces
|
this.indentation = 2; // number of spaces
|
||||||
}
|
}
|
||||||
this.mode = (options.mode == 'code') ? 'code' : 'text';
|
this.mode = (options.mode == 'code') ? 'code' : 'text';
|
||||||
if (this.mode == 'code') {
|
if (this.mode == 'code') {
|
||||||
|
|
|
@ -36,7 +36,7 @@ TextEditor.prototype._create = function (container, options, json) {
|
||||||
this.indentation = Number(options.indentation);
|
this.indentation = Number(options.indentation);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.indentation = 4; // number of spaces
|
this.indentation = 2; // number of spaces
|
||||||
}
|
}
|
||||||
this.mode = (options.mode == 'code') ? 'code' : 'text';
|
this.mode = (options.mode == 'code') ? 'code' : 'text';
|
||||||
if (this.mode == 'code') {
|
if (this.mode == 'code') {
|
||||||
|
|
Loading…
Reference in New Issue