Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
jos 2015-04-17 10:23:39 +02:00
commit 999a253803
3 changed files with 8 additions and 10 deletions

View File

@ -3,15 +3,10 @@
https://github.com/josdejong/jsoneditor
## 2015-03-17, version 4.1.3
## not yet released, version 4.2.0
- Fixed broken bundling with browserify: the `jsonlint` package was requiring
missing dependencies.
## 2015-03-15, version 4.1.2
- Fixed broken bower package 4.1.1.
- Implemented option `theme`, allowing to set a custom theme for the Ace
editor. Thanks @nfvs.
## 2015-03-15, version 4.1.1
@ -372,4 +367,4 @@ https://github.com/josdejong/jsoneditor
## 2011-11-28, version 0.9.6
- First fully usable version of the JSON editor
- First fully usable version of the JSON editor

View File

@ -34,6 +34,8 @@ Constructs a new JSONEditor.
Enables a search box in the upper right corner of the JSONEditor. True by default. Only applicable when `mode` is 'tree', 'view', or 'form'.
- `{Number} indentation`
Number of indentation spaces. 2 by default. Only applicable when `mode` is 'code' or 'text'.
- `{String} theme`
Set the Ace editor theme, uses included 'ace/theme/jsoneditor' by default. Please note that only the default theme is included with jsoneditor, so if you specify another one you need to make sure it is loaded.
- `{JSON} json`
Initial JSON data to be loaded into the JSONEditor. Alternatively, the method `JSONEditor.set(json)` can be used to load JSON data into the editor.

View File

@ -44,6 +44,7 @@ textmode.create = function (container, options) {
'Falling back to plain text editor');
}
}
this.theme = options.theme || 'ace/theme/jsoneditor';
var me = this;
this.container = container;
@ -117,7 +118,7 @@ textmode.create = function (container, options) {
this.content.appendChild(this.editorDom);
var editor = ace.edit(this.editorDom);
editor.setTheme('ace/theme/jsoneditor');
editor.setTheme(this.theme);
editor.setShowPrintMargin(false);
editor.setFontSize(13);
editor.getSession().setMode('ace/mode/json');