Commit 2acbda88 by Csók Tamás

dashboard.js: save cookie, an input handler, plus a function for ClientChecking…

dashboard.js: save cookie, an input handler, plus a function for ClientChecking page that uses the previous two function
parent b93837c3
...@@ -583,6 +583,17 @@ function addModalConfirmation(func, data) { ...@@ -583,6 +583,17 @@ function addModalConfirmation(func, data) {
}); });
} }
function addOnClickToInput(id, func, param) {
$('input,select').not('textarea').keypress(function(event) {if (event.keyCode == 13) {event.preventDefault();}})
$('#' + id).click(function(){func(param); return false;})
}
function clientInstalledAction(location) {
setCookie('downloaded_client', true, 365 * 24 * 60 * 60);
window.location.href = location;
$('#confirmation-modal').modal("hide");
}
// for AJAX calls // for AJAX calls
/** /**
* Getter for user cookies * Getter for user cookies
...@@ -605,6 +616,14 @@ function getCookie(name) { ...@@ -605,6 +616,14 @@ function getCookie(name) {
return cookieValue; return cookieValue;
} }
function setCookie(name,value,seconds) {
if (seconds!=null) {
var today = new Date();
var expire = new Date();
expire.setTime(today.getTime() + seconds);
}
document.cookie = name+"="+escape(value)+";expires="+expire.toUTCString();
}
/* no js compatibility */ /* no js compatibility */
function noJS() { function noJS() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment