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
|
|
|
{
|
|
|
|
$("#page-wrapper").off();
|
|
|
|
$(containerId).on("click", function() {
|
|
|
|
$("#page-wrapper").load("/content/"+fileName+".html");
|
2016-09-04 16:27:48 +02:00
|
|
|
});
|
2016-09-03 15:54:33 +02:00
|
|
|
if (loadNow)
|
|
|
|
{
|
|
|
|
$("#page-wrapper").load("/content/"+fileName+".html");
|
|
|
|
}
|
|
|
|
}
|
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 "";
|
|
|
|
}
|