2016-08-11 10:28:36 +00:00
|
|
|
/**
|
|
|
|
* Created by Norbi on 2016-07-27.
|
|
|
|
*/
|
|
|
|
function getFormData($form) {
|
|
|
|
var unindexed_array = $form.serializeArray();
|
|
|
|
var indexed_array = {};
|
|
|
|
|
|
|
|
$.map(unindexed_array, function (n, i) {
|
|
|
|
indexed_array[n['name']] = n['value'];
|
|
|
|
});
|
|
|
|
|
|
|
|
return indexed_array;
|
|
|
|
}
|
|
|
|
|
2016-08-16 21:11:42 +00:00
|
|
|
var errorcleartimer = null;
|
2016-08-11 10:28:36 +00:00
|
|
|
function showError(message) {
|
2016-08-16 21:11:42 +00:00
|
|
|
if (errorcleartimer != null)
|
|
|
|
clearInterval(errorcleartimer);
|
2016-08-11 10:28:36 +00:00
|
|
|
var errormsg = document.getElementById("errormsg");
|
2016-08-15 10:37:51 +00:00
|
|
|
errormsg.innerHTML = message;
|
2016-08-11 10:28:36 +00:00
|
|
|
errormsg.style = "display: block";
|
2016-08-16 21:11:42 +00:00
|
|
|
errorcleartimer = setTimeout(function () { errormsg.style.display = "none"; }, 2000);
|
|
|
|
}
|
|
|
|
|
|
|
|
function isLoggedIn() {
|
|
|
|
return document.getElementById("usercontent") != null;
|
2016-08-16 10:51:06 +00:00
|
|
|
}
|