2016-09-03 15:54:33 +02:00
|
|
|
|
2016-09-04 16:27:48 +02:00
|
|
|
function bindNavToContent(containerId, fileName, loadNow)
|
2016-09-03 15:54:33 +02:00
|
|
|
{
|
2016-09-14 13:51:28 +02:00
|
|
|
$("#page-content").off();
|
2016-09-03 15:54:33 +02:00
|
|
|
$(containerId).on("click", function() {
|
2016-09-14 13:51:28 +02:00
|
|
|
$("#page-content").load("/content/"+fileName+".html");
|
2016-09-04 16:27:48 +02:00
|
|
|
});
|
2016-09-03 15:54:33 +02:00
|
|
|
if (loadNow)
|
|
|
|
{
|
2016-09-15 20:42:58 +02:00
|
|
|
$(containerId).trigger("click");
|
2016-09-03 15:54:33 +02:00
|
|
|
}
|
|
|
|
}
|
2016-09-05 17:26:29 +02:00
|
|
|
|
2016-09-06 10:14:54 +02:00
|
|
|
function loadContentTo(containerId, fileName)
|
|
|
|
{
|
|
|
|
$(containerId).load("/content/"+fileName+".html");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-05 17:26:29 +02:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-06 10:14:54 +02:00
|
|
|
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 "";
|
|
|
|
}
|