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:
42
assets/webconfig/js/content_effects.js
Normal file
42
assets/webconfig/js/content_effects.js
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
$(hyperion).one("cmd-config-getschema", function(event) {
|
||||
parsedConfSchemaJSON = event.response.result;
|
||||
|
||||
schema = parsedConfSchemaJSON.properties;
|
||||
var general_conf_editor = createJsonEditor('editor_container',
|
||||
{
|
||||
title:'',
|
||||
properties: {
|
||||
effects : schema.effects,
|
||||
initialEffect : schema.initialEffect
|
||||
}
|
||||
});
|
||||
|
||||
$('#editor_container .well').css("background-color","white");
|
||||
// $('#editor_container .well').css("border","none");
|
||||
// $('#editor_container .well').css("box-shadow","none");
|
||||
$('#editor_container .btn').addClass("btn-primary");
|
||||
$('#editor_container h3').first().remove();
|
||||
|
||||
//Called everytime a Input Field is changed = No need for save button
|
||||
// general_conf_editor.off().on('change',function() {
|
||||
// console.log(JSON.stringify(general_conf_editor.getValue()));
|
||||
// requestWriteConfig(general_conf_editor.getValue());
|
||||
// });
|
||||
|
||||
//Alternative Function with submit button to get Values
|
||||
$('#btn_submit').off().on('click',function() {
|
||||
console.log(general_conf_editor.getValue());
|
||||
});
|
||||
|
||||
$(hyperion).on("cmd-config-setconfig",function(event){
|
||||
parsedServerInfoJSON = event.response;
|
||||
console.log(parsedServerInfoJSON);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).ready( function() {
|
||||
requestServerConfigSchema();
|
||||
//$("[type='checkbox']").bootstrapSwitch();
|
||||
});
|
Reference in New Issue
Block a user