]> iEval git - gruntmaster-page.git/blob - js/95-login.js
81e4533f0b3df969599c0724b399108153a955ca
[gruntmaster-page.git] / js / 95-login.js
1 (function(){
2 'use strict';
3
4 $( document ).ready(function(){
5 $('#login').detach().prependTo($('#sidebar'));
6
7 document.cookie = "cookietest=1";
8 var cookie = document.cookie.indexOf("cookietest=") != -1;
9 document.cookie = "cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
10
11 if(!cookie) return;
12 var username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*\=\s*([^;]*).*$)|^.*$/, "$1");
13 if(username) {
14 sessionStorage.setItem('login_username', username);
15 document.cookie = "username=; expires=Thu, 01-Jan-1970 00:00:01 GMT";
16 start_tracking(username);
17 }
18 username = sessionStorage.getItem('login_username');
19 if(username)
20 $('#login').html('Probably logged in as ' + username);
21 });
22 })();
This page took 0.046462 seconds and 3 git commands to generate.