Skip to content

Commit

Permalink
add loading message for challenges so that learners aren't left wonde…
Browse files Browse the repository at this point in the history
…ring what's going on
  • Loading branch information
zardus authored and mudongliang committed Mar 19, 2024
1 parent d770f9b commit bd2f467
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dojo_theme/static/js/dojo/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ function startChallenge(event) {
"practice": practice,
};

var result_notification = item.find('#result-notification');
var result_message = item.find('#result-message');
result_notification.addClass('alert alert-warning alert-dismissable text-center');
result_message.html("Loading.");
result_notification.slideDown();
setTimeout(function loadmsg() {
if (result_message.html().startsWith("Loading")) {
result_message.append(".");
setTimeout(loadmsg, 500);
}
}, 500);

CTFd.fetch('/pwncollege_api/v1/docker', {
method: 'POST',
credentials: 'same-origin',
Expand Down

0 comments on commit bd2f467

Please sign in to comment.