77 lines
3.6 KiB
Plaintext
77 lines
3.6 KiB
Plaintext
<%= javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/edit/matchbrackets.js", "/codemirror/mode/clike/clike" %>
|
|
<%= stylesheet_link_tag "/codemirror/lib/codemirror" %>
|
|
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
|
|
<%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js',
|
|
'/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%>
|
|
<div class="page--body -margin-t-64 -flex">
|
|
<div class="page--over undis" id="all_task_show">
|
|
<%= render :partial => "games_list" %>
|
|
</div>
|
|
<div class="-layout -stretch -fit" id="game_show_content">
|
|
<%= render :partial => 'games/game_show' %>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
var control = 0; // 版本库控制 0表示点击放大 1表示点击缩小
|
|
var control_1 = 0; // 测评控制 0表示点击放大 1表示点击缩小
|
|
var nGameRes = $("#games_repository_contents"); // 版本库区域
|
|
var nGameEva = $("#games_valuation_contents"); // 评测区域
|
|
var nRIcon = $("#extend_and_zoom").children("i"); // 版本库放大缩小按钮
|
|
var nCode = $("#file_entry_content").find(".CodeMirror-scroll"); // 版本库代码区域
|
|
var nVIcon = $("#valuation_extend_and_zoom").children("i"); // 评测放大缩小
|
|
|
|
/* --------------------------------版本库的放大与缩小---------------------------------------------*/
|
|
function repository_extend_and_zoom(){
|
|
if(control == 0){
|
|
nGameRes.addClass("-flex-basic100");
|
|
nGameEva.addClass("-flex-basic0");
|
|
nRIcon.addClass("fa-compress");
|
|
nRIcon.removeClass("fa-arrows-alt");
|
|
control = 1;
|
|
}else if(control == 1){
|
|
nGameRes.removeClass("-flex-basic100");
|
|
nGameEva.removeClass("-flex-basic0");
|
|
nRIcon.removeClass("fa-compress");
|
|
nRIcon.addClass("fa-arrows-alt");
|
|
control = 0;
|
|
}
|
|
editor_CodeMirror.setSize("auto", "auto");
|
|
var h = nGameRes.height() - $("#top_repository").height() - 10;
|
|
nCode.css("min-height", h);
|
|
}
|
|
|
|
/* --------------------------------测评的扩大与缩小---------------------------------------------*/
|
|
function valuation_extend_and_zoom(){
|
|
if(control_1 == 0){
|
|
nGameRes.addClass("-flex-basic0");
|
|
nGameEva.addClass("-flex-basic100");
|
|
nVIcon.removeClass("fa-expand");
|
|
nVIcon.addClass("fa-compress");
|
|
control_1 = 1;
|
|
}else if(control_1 == 1){
|
|
nGameRes.removeClass("-flex-basic0");
|
|
nGameEva.removeClass("-flex-basic100");
|
|
nVIcon.addClass("fa-expand");
|
|
nVIcon.removeClass("fa-compress");
|
|
control_1 = 0;
|
|
}
|
|
}
|
|
|
|
/* --------------------------------点击全部任务向右侧展开-----------------------------------------*/
|
|
$("#all_task_show").on("click", function(e){
|
|
c = 0;
|
|
$("#all_task_tab").removeClass('leftnav-active');
|
|
$("#all_task_show").css("background","rgba(0,0,0,0)");
|
|
$("#all_task_index").css("left", 0).stop().animate({
|
|
left: "-505px"
|
|
}, 400, function(){
|
|
$("#all_task_show").hide();
|
|
fadein = 0;
|
|
});
|
|
});
|
|
// 列表区域阻止事件冒泡
|
|
$("#all_task_index").on("click", function(e){
|
|
e.stopPropagation();
|
|
});
|
|
|
|
</script> |