Puase and unpause working - tweaked sorting

This commit is contained in:
Simon Pamies committed 2011-06-13 22:43:59 +02:00
1 parent c7e8fb9032
commit 1770fa8896
4 files changed
+29 -4

No files matched your search

@@ -6,6 +6,8 @@ var global_competitors = '1:20';
var loader_image = "<img style='margin: 3px 0px 3px 3px' src='/static/images/ajax-loader-greybg.gif'/>";
var listener_paused = false;
/*
* Loads leaderboard data. Parameters:
*
@@ -19,11 +21,33 @@ function loadLeaderboard(races, sortby, competitors, direction) {
{races:races, sortby:sortby, competitors:competitors, direction:direction},
function(data) {
displayLeaderboard(data);
global_race = races;
global_sortkey = sortby;
global_competitors = competitors;
global_direction = direction;
hideLoader();
}
);
}
function liveRefresh() {
if (listener_paused == false)
loadLeaderboard(global_race, global_sortkey, global_competitors, global_direction);
}
function toggleListener() {
$('#refresh-button').toggleClass('refresh');
if ($('#refresh-button').hasClass('refresh')) {
$('#refresh-button').css('background-image', 'url(/moderator-static/refresh-icon.png)');
listener_paused = true;
} else {
listener_paused = false;
$('#refresh-button').css('background-image', 'url(/moderator-static/pause_button.png)');
}
}
function showLoader() {
$('.refresh-btn').html(loader_image);
}
@@ -125,5 +149,6 @@ $(document).ready(function() {
$.ajaxSetup({cache:false});
loadLeaderboard();
loadLeaderboard(global_race, global_sortkey, global_competitors, global_direction);
window.setInterval('liveRefresh()', 5000);
});
Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

@@ -122,7 +122,7 @@ body {
padding: 10px 0 10px 30px;
border-top: 1px solid #e1e1e1; }
#header ul.systeminfo li.active {
background: url(/moderator-static/refresh-icon.png) no-repeat left center; }
background: url(/moderator-static/pause_button.png) no-repeat left center; }
#header ul.systeminfo li.message-0 {
border: none; }
#header ul.systeminfo:after {
@@ -221,7 +221,7 @@ span.race-count {
#main-interface .blue-table .refresh-btn {
display: block;
height: 39px;
background: url(/moderator-static/refresh-icon.png) right center no-repeat #484848; }
background: url(/moderator-static/pause_button.png) right center no-repeat #484848; }
#main-interface .blue-table .sort-rank {
display: block;
height: 39px; }
@@ -35,7 +35,7 @@
<!-- / MAIN INTERFACE -->
<div id='main-interface'>
<div class='blue-table'>
<a class='refresh-btn' href='javascript:;' onclick=''><img src='/static/images/ajax-loader-greybg.gif'/></a>
<a id="refresh-button" class='refresh-btn' href='javascript:;' onclick='toggleListener($(this));'><img src='/static/images/ajax-loader-greybg.gif'/></a>
<a class='sort-rank sort-asc' href='javascript:;' onclick='sortBy("total", $(this))'></a>
<table id='overall-clipping'>
<tbody>