git://git.onelab.eu
/
myslice.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
omments on logging out
[myslice.git]
/
auth
/
js
/
logout.js
diff --git
a/auth/js/logout.js
b/auth/js/logout.js
index
63bc197
..
1e140a9
100644
(file)
--- a/
auth/js/logout.js
+++ b/
auth/js/logout.js
@@
-1,6
+1,10
@@
+/* retrieve username from the button that is clicked, the one named 'logout'
+ and that is expected to have the 'username' attribute */
function logout () {
var username=$(this).attr('username');
var msg="Are you sure you want to logout as " + username + " ?";
function logout () {
var username=$(this).attr('username');
var msg="Are you sure you want to logout as " + username + " ?";
+ /* redirect to /logout, see urls.py */
if (confirm(msg)) window.location="/logout/";
}
if (confirm(msg)) window.location="/logout/";
}
+/* attach this function to the logout button */
$(document).ready(function() { $('#logout').click(logout); })
$(document).ready(function() { $('#logout').click(logout); })