function tick() { return $('<span class="tick tracker-mark">✔</span>') }
function xmark() { return $('<span class="x tracker-mark">✘</span>') }
+ function clean_tracker(){
+ $('.tracker-mark').detach();
+ $('.tracker-info').removeClass('tracker-info info');
+ }
+
function update_tracker(){
var data = localStorage.getItem('tracker_data');
var user = localStorage.getItem('tracker_username');
contests[e.contest] = 1;
});
+ clean_tracker();
$('#tracker_userlink').html(data.name);
$('#tracker_solved').html(solvednr);
$('#tracker_attempted').html(attemptednr);
$('#tracker_contests').html(data.contests.length);
- $('.tracker-mark').detach();
if(location.pathname == '/pb/')
$('table').find('.name').find('a').each(function() {
var id = $(this).attr('href').split('?', 2)[0];
if(location.pathname == '/log/')
$('table').find('tbody').find('tr').each(function() {
- if($(this).find('.owner').find('a').attr('href') != "/us/" + user)
+ if($(this).find('.owner').find('a').attr('href') != '/us/' + user)
return;
$(this).find('.id').append($(this).find('.r0').size() ? tick() : xmark());
});
+
+ if(location.pathname.match(/^\/st\//) || location.pathname == '/us/')
+ $('table').find('tbody').find('tr').each(function() {
+ if($(this).find('.user').find('a').attr('href') == '/us/' + user)
+ $(this).addClass('info tracker-info');
+ });
}
function start_tracking(user){
}
function stop_tracking(){
- $('.tracker-mark').detach();
+ clean_tracker();
localStorage.removeItem('tracker_username');
localStorage.removeItem('tracker_data');
$('#tracker_tracking').addClass('hidden');