点击开启评测 无感知
This commit is contained in:
parent
93e67e5dbc
commit
10dc5a9668
|
@ -95,34 +95,33 @@
|
|||
var html = bt('t:exec_results',{status: <%= @game.status %>, output:"<%= @latest_output %>", results: <%= @results %>, had_done: "<%= @had_done %>"});
|
||||
$("#code_results").html(html);
|
||||
});
|
||||
|
||||
function training_task_submmit(){
|
||||
$("#ajax-indicator").show();
|
||||
$("#game_commit").html("<a class='task-btn mb10'>评测中..</a>");
|
||||
$.ajax({
|
||||
url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
|
||||
success: function (){
|
||||
|
||||
//循环等1分钟
|
||||
//移除载入
|
||||
var temp = $("#ajax-indicator");
|
||||
$("#ajax-indicator").remove();
|
||||
var intId = setInterval(function(){
|
||||
$.ajax({
|
||||
url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
|
||||
data:'test',
|
||||
success:function(data){
|
||||
//如果查到了,就退出
|
||||
console.log(html);
|
||||
if(data.status == 2 || data.status == 0){
|
||||
alert("进来了");
|
||||
clearInterval(intId);
|
||||
$("#ajax-position").html(temp);
|
||||
$("#ajax-indicator").hide();
|
||||
var html = bt('t:exec_results',{status: data.status, output: data.output, results: data.results, had_done: data.had_done});
|
||||
console.log(html);
|
||||
$("#code_results").html(html);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
function extend_window(){
|
||||
var web_h = window.innerHeight;
|
||||
|
|
|
@ -48,9 +48,11 @@
|
|||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ajax-position">
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
</body>
|
||||
<!-- MathJax的配置 -->
|
||||
|
|
Loading…
Reference in New Issue