mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
a6d12611a8
* split content and js tune leds config * implement connection lost page * split js/html in huebridge * add js action for connection lost
65 lines
1.0 KiB
JavaScript
65 lines
1.0 KiB
JavaScript
|
|
function bindNavToContent(containerId, fileName, loadNow)
|
|
{
|
|
$("#page-wrapper").off();
|
|
$(containerId).on("click", function() {
|
|
$("#page-wrapper").load("/content/"+fileName+".html");
|
|
});
|
|
if (loadNow)
|
|
{
|
|
$("#page-wrapper").load("/content/"+fileName+".html");
|
|
}
|
|
}
|
|
|
|
function loadContentTo(containerId, fileName)
|
|
{
|
|
$(containerId).load("/content/"+fileName+".html");
|
|
}
|
|
|
|
|
|
|
|
function toggleClass(obj,class1,class2)
|
|
{
|
|
if ( $(obj).hasClass(class1))
|
|
{
|
|
$(obj).removeClass(class1);
|
|
$(obj).addClass(class2);
|
|
}
|
|
else
|
|
{
|
|
$(obj).removeClass(class2);
|
|
$(obj).addClass(class1);
|
|
}
|
|
}
|
|
|
|
|
|
function setClassByBool(obj,enable,class1,class2)
|
|
{
|
|
if (enable)
|
|
{
|
|
$(obj).removeClass(class1);
|
|
$(obj).addClass(class2);
|
|
}
|
|
else
|
|
{
|
|
$(obj).removeClass(class2);
|
|
$(obj).addClass(class1);
|
|
}
|
|
}
|
|
|
|
function showErrorDialog(header,message)
|
|
{
|
|
$('#error_dialog .modal-title').html(header);
|
|
$('#error_dialog .modal-body').html(message);
|
|
$('#error_dialog').modal('show');
|
|
}
|
|
|
|
function isJsonString(str) {
|
|
try {
|
|
JSON.parse(str);
|
|
} catch (e) {
|
|
return e;
|
|
}
|
|
return "";
|
|
}
|