]> iEval git - gruntmaster-page.git/blame - js/95-login.js
Use window.innerWidth instead of document.body.clientWidth
[gruntmaster-page.git] / js / 95-login.js
CommitLineData
462db4aa
MG
1(function(){
2 'use strict';
3
4 $( document ).ready(function(){
bdaa8919 5 $('<a role="button">Log in').prependTo($('#sidebar')).wrap('<div id="login">').on('click', function(e) {
2beb67b4
MG
6 var xhr = new XMLHttpRequest();
7 xhr.open('GET', '/login');
8 xhr.onload = function () {
9 if(this.status != 200)
10 return;
11 var username = this.responseText;
12 sessionStorage.setItem('login_username', username);
13 start_tracking(username);
14 $('#login').html('Probably logged in as ' + username);
15 }
16 xhr.send();
17 return false;
18 });
462db4aa 19
2beb67b4 20 var username = sessionStorage.getItem('login_username');
462db4aa 21 if(username)
627ed44e 22 $('#login').html('Probably logged in as ' + username);
462db4aa
MG
23 });
24})();
This page took 0.031772 seconds and 4 git commands to generate.