Update WebUI (#295)

* update

* lang

* show dialog on delete action

* proper regexp if effect name contains ":"

[skip ci]
This commit is contained in:
brindosch
2016-11-21 22:16:57 +01:00
committed by redPanther
parent 7cb6517c01
commit 98cb922c74
5 changed files with 97 additions and 65 deletions

View File

@@ -61,9 +61,23 @@
}
}
}
}
var oldEffects = [];
function updateEffectlist(event){
var newEffects = event.response.info.effects;
if (newEffects.length != oldEffects.length)
{
effects_html = '<option value="__none__"></option>';
for(i = 0; i < newEffects.length; i++) {
effectName = newEffects[i].name;
effects_html += '<option value="'+effectName+'">'+effectName+'</option>';
}
$('#effect_select').html(effects_html);
oldEffects = newEffects;
}
}
$(document).ready(function() {
// color
@@ -93,7 +107,6 @@ $(document).ready(function() {
},
}
});
$('#cp2').colorpicker().on('changeColor', function(e) {
color = e.color.toRGB();
$("#effect_select").val("__none__");
@@ -113,18 +126,10 @@ $(document).ready(function() {
});
}
});
// effects
effects_html = '<option value="__none__"></option>';
for(i = 0; i < parsedServerInfoJSON.info.effects.length; i++) {
//console.log(parsedServerInfoJSON.info.effects[i].name);
effectName = parsedServerInfoJSON.info.effects[i].name;
effects_html += '<option value="'+effectName+'">'+effectName+'</option>';
}
$('#effect_select').html(effects_html);
// components
// components
$(hyperion).on("cmd-serverinfo",updateComponents);
// effects
$(hyperion).on("cmd-serverinfo",updateEffectlist);
});