]>
iEval git - gruntmaster-page.git/blob - js/95-login.js
3173895e5d03ff386e1cfe1d5bad4393cdb86100
2 var sidebar
= $('#sidebar')[0];
3 var login
= document
.createElement('div');
4 login
.innerHTML
= '<a role="button" id="login" class="show">Log in</a>';
5 sidebar
.insertBefore(login
, sidebar
.firstChild
);
6 $('#login').on('click', function(e
) {
7 var xhr
= new XMLHttpRequest();
8 xhr
.open('GET', '/login');
9 xhr
.onload = function () {
10 if(this.status
!= 200)
12 var username
= this.responseText
;
13 sessionStorage
.setItem('login_username', username
);
14 start_tracking(username
);
15 login
.innerHTML
= 'Probably logged in as ' + username
;
21 var username
= sessionStorage
.getItem('login_username');
23 login
.innerHTML
= 'Probably logged in as ' + username
;
This page took 0.041846 seconds and 3 git commands to generate.