mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Effects Configurator (#281)
* update translation * add css * Update JsonClientConnection.cpp * add effectscreator * remove udp * fix title c/p issue for sparks [skip ci] * update schemas [skip ci] * typo [skpi ci]
This commit is contained in:
53
assets/webconfig/js/content_effectsconfigurator.js
Normal file
53
assets/webconfig/js/content_effectsconfigurator.js
Normal file
@@ -0,0 +1,53 @@
|
||||
$(hyperion).one("cmd-config-getschema", function(event) {
|
||||
effects = parsedConfSchemaJSON.properties.effectSchemas.internal
|
||||
EffectsHtml = "";
|
||||
for(var idx=0; idx<effects.length; idx++)
|
||||
{
|
||||
EffectsHtml += '<option value="'+effects[idx].schemaContent.script+'">'+effects[idx].schemaContent.title+'</option>';
|
||||
}
|
||||
$("#effectslist").html(EffectsHtml);
|
||||
$("#effectslist").trigger("change");
|
||||
});
|
||||
|
||||
effects_editor = null;
|
||||
effectPy = "";
|
||||
|
||||
$("#effectslist").off().on("change", function(event) {
|
||||
for(var idx=0; idx<effects.length; idx++){
|
||||
if (effects[idx].schemaContent.script == this.value){
|
||||
effects_editor = createJsonEditor('editor_container', {
|
||||
args : effects[idx].schemaContent,
|
||||
},false);
|
||||
effectPy = ':';
|
||||
effectPy += effects[idx].schemaContent.script;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#btn_write').off().on('click',function() {
|
||||
|
||||
effectName = $('#name-input').val();
|
||||
if (effectName == "")
|
||||
{
|
||||
showInfoDialog('error','INVALID NAME FIELD','Effect name is empty! Please fill in a name and try again.')
|
||||
}
|
||||
else
|
||||
{
|
||||
var errors = effects_editor.validate();
|
||||
if(errors.length)
|
||||
{
|
||||
showInfoDialog('error','INVALID VALUES','Please check for red marked inputs and try again.')
|
||||
}
|
||||
else
|
||||
{
|
||||
requestWriteEffect(effectName,effectPy,JSON.stringify(effects_editor.getValue()));
|
||||
showInfoDialog('success','SUCCESS!','Your effect has been created successfully!')
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).ready( function() {
|
||||
requestServerConfigSchema();
|
||||
});
|
Reference in New Issue
Block a user