mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -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
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user