hyperion.ng/assets/webconfig/js/content_index.js
brindosch 81f5f51257 UI fixes/updates (#468)
* fix logging display

* hue wizard add usrname

* fix restartAction sometimes not executed

* remove configRevision

* remove v4l2 grabMode(2d/3d)

* remove latchTime from configs

not in main led device schema

* config comment: all grabbers can crop

* remove smoothing delay&pause for effects

* finalize disable effects ui

* fix empty effect selects

* remote page add 2D/3D videoMode

* add blackborder texts

* Update EffectEngine.cpp
2017-09-04 23:12:59 +02:00

109 lines
2.5 KiB
JavaScript

$(document).ready( function() {
var uiLock = false;
var prevSess = 0;
loadContentTo("#container_connection_lost","connection_lost");
loadContentTo("#container_restart","restart");
initWebSocket();
$(hyperion).on("cmd-serverinfo",function(event){
serverInfo = event.response.info;
$(hyperion).trigger("ready");
if (serverInfo.hyperion.config_modified)
$("#hyperion_reload_notify").fadeIn("fast");
else
$("#hyperion_reload_notify").fadeOut("fast");
if (serverInfo.hyperion.off)
$("#hyperion_disabled_notify").fadeIn("fast");
else
$("#hyperion_disabled_notify").fadeOut("fast");
if (!serverInfo.hyperion.config_writeable)
{
showInfoDialog('uilock',$.i18n('InfoDialog_nowrite_title'),$.i18n('InfoDialog_nowrite_text'));
$('#wrapper').toggle(false);
uiLock = true;
}
else if (uiLock)
{
$("#modal_dialog").modal('hide');
$('#wrapper').toggle(true);
uiLock = false;
}
var sess = serverInfo.hyperion.sessions;
if (sess.length != prevSess)
{
wSess = [];
prevSess = sess.length;
for(var i = 0; i<sess.length; i++)
{
if(sess[i].type == "_hyperiond-http._tcp.")
{
wSess.push(sess[i]);
}
}
if (wSess.length > 1)
$('#btn_instanceswitch').toggle(true);
else
$('#btn_instanceswitch').toggle(false);
}
}); // end cmd-serverinfo
$(hyperion).one("cmd-sysinfo", function(event) {
requestServerInfo();
sysInfo = event.response.info;
currentVersion = sysInfo.hyperion.version;
});
$(hyperion).one("cmd-config-getschema", function(event) {
serverSchema = event.response.result;
requestServerConfig();
schema = serverSchema.properties;
});
$(hyperion).one("cmd-config-getconfig", function(event) {
serverConfig = event.response.result;
requestSysInfo();
showOptHelp = serverConfig.general.showOptHelp;
});
$(hyperion).on("error",function(event){
showInfoDialog("error","Error", event.reason);
});
$(hyperion).on("open",function(event){
requestServerConfigSchema();
});
$(hyperion).one("ready", function(event) {
loadContent();
});
$("#btn_hyperion_reload").on("click", function(){
initRestart();
});
$(".mnava").bind('click.menu', function(e){
loadContent(e);
window.scrollTo(0, 0);
});
});
$(function(){
var sidebar = $('#side-menu'); // cache sidebar to a variable for performance
sidebar.delegate('a.inactive','click',function(){
sidebar.find('.active').toggleClass('active inactive');
$(this).toggleClass('active inactive');
});
});