summaryrefslogtreecommitdiff
path: root/app/views/tournaments/show.html.erb
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-23 13:07:25 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-23 13:07:25 -0400
commit1ea3366c70ad87f2c0d3fa3ae3a56f27b691f696 (patch)
tree5446ee7a134b0aab31d4a232008f96acd88a291a /app/views/tournaments/show.html.erb
parent395a12042bbe9c4eeca60e41c75004c3bdad4e87 (diff)
clean up the javascript everywhere
Diffstat (limited to 'app/views/tournaments/show.html.erb')
-rw-r--r--app/views/tournaments/show.html.erb31
1 files changed, 0 insertions, 31 deletions
diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb
index a4983f7..3f8552e 100644
--- a/app/views/tournaments/show.html.erb
+++ b/app/views/tournaments/show.html.erb
@@ -106,34 +106,3 @@
<%end %>
</div>
-
-<script>
-function donehandle( tournament ) {
- if ( console && console.log ) {
- var here = tournament["players"].length;
- var needed = (tournament["min_teams_per_match"] * tournament["min_players_per_team"]);
- var pct_complete = here / needed;
- $("#prog-bar").width( (pct_complete * 100) +"%");
- $("#players-needed").text(here + " " + (here==1?"player has":"players have") + " signed up. " + needed + " players needed. ");
- players = "";
-
- //creates the present user list
- for (var i = 0; i < tournament["players"].length; i++) {
- players = players+"<li><span class=\"black\">"+tournament["players"][i]["user_name"]+"</span></li>"
- }
-
- //updates the user list
- $("#tournament-users").html(players);
-
- //if there are enough players to start, enable the button, else disable it.
- $("input[value=\"Start Tournament\"]").prop('disabled', (pct_complete >= 1)? false : true);
-
- if (tournament["status"] == 1)
- window.location.reload(true);
- }
- setTimeout(function(){$.ajax({url: "<%= url_for @tournament %>.json"}).done(donehandle)}, 2000);
-}
-
-$.ajax({url: "<%= url_for @tournament %>.json"})
- .done(donehandle);
-</script>