mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
impl options explanation, uiLock (#343)
* update schemas * update * killed upstream change * min prio is now 100 * reset watchdog regularly * update * fix * update
This commit is contained in:
@@ -82,6 +82,10 @@ function showInfoDialog(type,header,message,btnid)
|
||||
$('#modal_dialog .modal-footer-button').html('<button type="button" id="'+btnid+'" class="btn btn-success" data-dismiss="modal">'+$.i18n('general_btn_save')+'</button>');
|
||||
$('#modal_dialog .modal-footer-button').append('<button type="button" class="btn btn-danger" data-dismiss="modal">'+$.i18n('general_btn_abort')+'</button>');
|
||||
}
|
||||
else if (type == "uilock"){
|
||||
$('#modal_dialog .modal-bodyicon').html('<img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#modal_dialog .modal-footer-button').html('<b>'+$.i18n('InfoDialog_nowrite_foottext')+'</b>');
|
||||
}
|
||||
|
||||
$("#modal_dialog").modal({
|
||||
backdrop : "static",
|
||||
@@ -104,11 +108,11 @@ function isJsonString(str)
|
||||
}
|
||||
|
||||
|
||||
function createJsonEditor(container,schema,setconfig)
|
||||
function createJsonEditor(container,schema,setconfig,usePanel)
|
||||
{
|
||||
$('#'+container).off();
|
||||
$('#'+container).html("");
|
||||
|
||||
|
||||
var editor = new JSONEditor(document.getElementById(container),
|
||||
{
|
||||
theme: 'bootstrap3',
|
||||
@@ -124,12 +128,13 @@ function createJsonEditor(container,schema,setconfig)
|
||||
properties: schema
|
||||
}
|
||||
});
|
||||
|
||||
$('#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();
|
||||
|
||||
if(usePanel)
|
||||
{
|
||||
$('#'+container+' .well').first().removeClass('well well-sm');
|
||||
$('#'+container+' h3').remove();
|
||||
$('#'+container+' .well').first().removeClass('well well-sm');
|
||||
}
|
||||
|
||||
if (setconfig)
|
||||
{
|
||||
@@ -142,6 +147,80 @@ function createJsonEditor(container,schema,setconfig)
|
||||
return editor;
|
||||
}
|
||||
|
||||
function createTableTh(th1, th2){
|
||||
var elth1 = document.createElement('th');
|
||||
var elth2 = document.createElement('th');
|
||||
var tr = document.createElement('tr');
|
||||
|
||||
elth1.innerHTML = th1;
|
||||
elth2.innerHTML = th2;
|
||||
tr.appendChild(elth1);
|
||||
tr.appendChild(elth2);
|
||||
|
||||
return tr;
|
||||
}
|
||||
|
||||
function createTableTd(td1, td2){
|
||||
var eltd1 = document.createElement('td');
|
||||
var eltd2 = document.createElement('td');
|
||||
var tr = document.createElement('tr');
|
||||
|
||||
eltd1.innerHTML = td1;
|
||||
eltd2.innerHTML = td2;
|
||||
tr.appendChild(eltd1);
|
||||
tr.appendChild(eltd2);
|
||||
|
||||
return tr;
|
||||
}
|
||||
|
||||
function createHelpTable(list, phead){
|
||||
var table = document.createElement('table');
|
||||
var thead = document.createElement('thead');
|
||||
var tbody = document.createElement('tbody');
|
||||
|
||||
table.className = 'table table-hover borderless';
|
||||
|
||||
thead.appendChild(createTableTh($.i18n('conf_helptable_option'), $.i18n('conf_helptable_expl')));
|
||||
for (key in list){
|
||||
text = list[key].title.replace('title', 'expl');
|
||||
tbody.appendChild(createTableTd($.i18n(list[key].title), $.i18n(text)));
|
||||
}
|
||||
table.appendChild(thead);
|
||||
table.appendChild(tbody);
|
||||
|
||||
return createPanel(phead, table);
|
||||
}
|
||||
|
||||
function createPanel(head, body, footer, type){
|
||||
var p = document.createElement('div');
|
||||
var phead = document.createElement('div');
|
||||
var pbody = document.createElement('div');
|
||||
var pfooter = document.createElement('div');
|
||||
|
||||
if(typeof type == 'undefined')
|
||||
type = 'panel-default';
|
||||
|
||||
p.className = 'panel '+type;
|
||||
phead.className = 'panel-heading';
|
||||
pbody.className = 'panel-body';
|
||||
pfooter.className = 'panel-footer';
|
||||
|
||||
phead.innerHTML = head;
|
||||
|
||||
if(typeof body != 'undefined')
|
||||
pbody.appendChild(body);
|
||||
|
||||
pfooter.innerHTML = footer;
|
||||
|
||||
p.appendChild(phead);
|
||||
p.appendChild(pbody);
|
||||
|
||||
if(typeof footer != 'undefined')
|
||||
p.appendChild(pfooter);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
function createSelGroup(group)
|
||||
{
|
||||
var el = document.createElement('optgroup');
|
||||
@@ -176,7 +255,7 @@ function createSel(array, group)
|
||||
|
||||
function performTranslation()
|
||||
{
|
||||
$('#wrapper').i18n();
|
||||
$('[data-i18n]').i18n();
|
||||
}
|
||||
|
||||
function encode_utf8(s)
|
||||
|
Reference in New Issue
Block a user