- 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');
- });
- }
+ if(location.pathname.match(/^\/st\//) || location.pathname == '/us/')
+ $('table tbody tr').each(function(el) {
+ if(el.querySelector('.user a').getAttribute('href') == '/us/' + user){
+ el.classList.add('info');
+ el.classList.add('tracker-info');
+ }
+ });
+}
+
+function start_tracking(user){
+ localStorage.setItem('tracker_username', user);
+ $('#tracker_userlink')[0].setAttribute('href', '/us/' + user);
+ $('#tracker_userlink')[0].innerHTML = user;
+ tracker.classList.remove('hidden');
+ update_tracker();
+ var lastfetch = localStorage.getItem('tracker_lastfetch');
+ if(Date.now() - lastfetch > 60 * 10 * 1000)
+ refresh_tracker();
+}