diff --git a/jsoneditor/js/jsoneditor.js b/jsoneditor/js/jsoneditor.js index ec4e407..5cd2966 100644 --- a/jsoneditor/js/jsoneditor.js +++ b/jsoneditor/js/jsoneditor.js @@ -5,15 +5,23 @@ * {String} mode Editor mode. Available values: * 'tree' (default), 'view', * 'form', 'text', and 'code'. - * {Boolean} search Enable search box. - * True by default - * {Boolean} history Enable history (undo/redo). - * True by default * {function} change Callback method, triggered * on change of contents + * {Boolean} search Enable search box. + * True by default + * Only applicable for modes + * 'tree', 'view', and 'form' + * {Boolean} history Enable history (undo/redo). + * True by default + * Only applicable for modes + * 'tree', 'view', and 'form' * {String} name Field name for the root node. + * Only applicable for modes + * 'tree', 'view', and 'form' * {Number} indentation Number of indentation * spaces. 4 by default. + * Only applicable for + * modes 'text' and 'code' * @param {Object | undefined} json JSON object */ function JSONEditor (container, options, json) { @@ -117,8 +125,10 @@ JSONEditor.prototype.getName = function () { }; /** - * Change the mode of the editor - * @param {String} mode + * Change the mode of the editor. + * JSONEditor will be extended with all methods needed for the chosen mode. + * @param {String} mode Available modes: 'tree' (default), 'view', 'form', + * 'text', and 'code'. */ JSONEditor.prototype.setMode = function (mode) { var container = this.container, diff --git a/jsoneditor/js/treeeditor.js b/jsoneditor/js/treeeditor.js index e1f4dfe..16a4248 100644 --- a/jsoneditor/js/treeeditor.js +++ b/jsoneditor/js/treeeditor.js @@ -131,6 +131,9 @@ TreeEditor.focusNode = undefined; TreeEditor.prototype.set = function (json, name) { // adjust field name for root node if (name) { + // TODO: deprecated since version 2.2.0. Cleanup some day. + console.log('Warning: second parameter "name" is deprecated. ' + + 'Use setName(name) instead.'); this.options.name = name; }