X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=auth%2Fjs%2Flogout.js;h=1e140a9007aabaa27723c9c372821cdd5639d06c;hb=5e1a278283582937b13f5f757d88dd50b37e52ed;hp=63bc197bf2a3451034decb52399afcb5feea5a19;hpb=96a59721af48d73df6e504807378c52fa1750743;p=myslice.git diff --git a/auth/js/logout.js b/auth/js/logout.js index 63bc197b..1e140a90 100644 --- 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 + " ?"; + /* redirect to /logout, see urls.py */ if (confirm(msg)) window.location="/logout/"; } +/* attach this function to the logout button */ $(document).ready(function() { $('#logout').click(logout); })