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:
redPanther
2016-12-05 11:10:44 +01:00
committed by GitHub
parent 8d55154164
commit 9428586195
4 changed files with 149 additions and 48 deletions

View File

@@ -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));
}