implement a function for easy json editor creation (#264)

* implement a function for easy json editor creation

* grabber and kodi moved to new editor func

* webui: implement conf editors

* add missing files and remove debug code
This commit is contained in:
redPanther
2016-10-09 10:23:04 +02:00
committed by GitHub
parent b42f3453b4
commit 0a142b0e7d
16 changed files with 249 additions and 273 deletions

View File

@@ -54,11 +54,34 @@ function showErrorDialog(header,message)
$('#error_dialog').modal('show');
}
function isJsonString(str) {
try {
function isJsonString(str)
{
try
{
JSON.parse(str);
} catch (e) {
}
catch (e)
{
return e;
}
return "";
}
function createJsonEditor(container,schema)
{
$('#'+container).off();
$('#'+container).html("");
return new JSONEditor(document.getElementById(container),
{
theme: 'bootstrap3',
iconlib: "fontawesome4",
disable_collapse: 'true',
form_name_root: 'sa',
disable_edit_json: 'true',
disable_properties: 'true',
no_additional_properties: 'true',
schema: schema
});
}