Skip to content

Commit

Permalink
add loading message for scoreboard as well
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus authored and mudongliang committed Mar 19, 2024
1 parent bd2f467 commit 37364be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dojo_theme/static/js/dojo/scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ function loadScoreboard(duration, page) {
const scoreboard = $("#scoreboard");

const endpoint = `/pwncollege_api/v1/scoreboard/${dojo}/${module}/${duration}/${page}`;
scoreboard.empty();
message = "Loading."
scoreboard.html(`<td colspan=6>${message}</td>`);
setTimeout(function loadmsg() {
if (scoreboard.html().includes(message)) {
message += "."
scoreboard.html(`<td colspan=6>${message}</td>`);
setTimeout(loadmsg, 1000);
}
}, 500);

CTFd.fetch(endpoint, {
method: "GET",
Expand Down

0 comments on commit 37364be

Please sign in to comment.