localStorage.setItem('tracker_username', user);
$('#tracker_userlink').attr('href', '/us/' + user).html(user);
$('#tracker_tracking').removeClass('hidden');
- $('#tracker_form').addClass('hidden');
update_tracker();
var lastfetch = localStorage.getItem('tracker_lastfetch');
if(Date.now() - lastfetch > 60 * 10 * 1000)
localStorage.removeItem('tracker_data');
localStorage.removeItem('tracker_lastfetch');
$('#tracker_tracking').addClass('hidden');
- $('#tracker_form').removeClass('hidden');
}
$( document ).ready(function(){
$('#tracker').detach().prependTo($('#sidebar'));
- $('#tracker_button').on('click', function() { start_tracking($('#tracker_username').val()) });
$('#tracker_stop').on('click', stop_tracking);
$('#track_user').on('click', function() { stop_tracking(); start_tracking($(this).data('user')) });
$('#submitform').on('submit', function() { localStorage.removeItem('tracker_lastfetch') });
</div>
<div id="tracker" class="reqjs">
-<h3>Track user</h3>
-<div id="tracker_form">
-<div class="form-group">
-<label for="tracker_username">Username</label>
-<input type="text" id="tracker_username" class="form-control">
-</div>
-<button id="tracker_button" class="btn btn-default">Start tracking</button>
-</div>
-
<div id="tracker_tracking" class="hidden">
+<br>
Tracking <a href="#" id="tracker_userlink"></a>.<br>
<a href="#" id="tracker_stop">Stop tracking</a><br>
<a href="#" id="tracker_log">Job log</a>