mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Json write (#313)
* always output latest version of config file to webui * fix permissions after default config export * tune code * set permissions for exported effects * use qt setperm instead of chmod update effects code style a bit * add fallback when config is not readable * ui: when sending config, convert to utf8 to save size and avoid jumbo frames (todo: minify it) jsonclient: add some constants for websocket frames (taken from https://github.com/zaphoyd/websocketpp/blob/master/websocketpp/frame.hpp) * webui: refactory of websocket connector sended json data is always convert to utf8
This commit is contained in:
@@ -120,30 +120,41 @@ function createJsonEditor(container,schema,setconfig)
|
||||
return editor;
|
||||
}
|
||||
|
||||
function createSelGroup(group){
|
||||
function createSelGroup(group)
|
||||
{
|
||||
var el = document.createElement('optgroup');
|
||||
el.setAttribute('label', group);
|
||||
return el
|
||||
return el;
|
||||
}
|
||||
|
||||
function createSelOpt(opt){
|
||||
function createSelOpt(opt)
|
||||
{
|
||||
var el = document.createElement('option');
|
||||
el.setAttribute('value', opt);
|
||||
el.innerHTML = opt;
|
||||
return el
|
||||
return el;
|
||||
}
|
||||
|
||||
function createSel(array, group){
|
||||
if (array.length != "0"){
|
||||
var el = createSelGroup(group);
|
||||
for(var i=0; i<array.length; i++){
|
||||
function createSel(array, group)
|
||||
{
|
||||
if (array.length != "0")
|
||||
{
|
||||
var el = createSelGroup(group);
|
||||
for(var i=0; i<array.length; i++)
|
||||
{
|
||||
var opt = createSelOpt(array[i])
|
||||
el.appendChild(opt);
|
||||
}
|
||||
return el;
|
||||
return el;
|
||||
}
|
||||
}
|
||||
|
||||
function performTranslation(){
|
||||
function performTranslation()
|
||||
{
|
||||
$('#wrapper').i18n();
|
||||
}
|
||||
|
||||
function encode_utf8(s)
|
||||
{
|
||||
return unescape(encodeURIComponent(s));
|
||||
}
|
||||
|
Reference in New Issue
Block a user