You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.6 KiB
129 lines
3.6 KiB
//验证搜索时输入名字
|
|
function regexName(content)
|
|
{
|
|
var name = $.trim($("#name").val());
|
|
if(name.length == 0)
|
|
{
|
|
$("#project_name_span").text(content);
|
|
$("#project_name_span").css('color','#ff0000');
|
|
$("#project_name_span").focus();
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
$("#project_name_span").text("");
|
|
return true;
|
|
}
|
|
}
|
|
//提交搜索
|
|
function submitSerch(content)
|
|
{
|
|
if(regexName(content)){$("#course_search_form").submit();}
|
|
}
|
|
//课程描述显示更多信息
|
|
function show_more_msg()
|
|
{
|
|
$("#course_description").toggleClass("course_description_none");
|
|
}
|
|
//作业描述显示更多信息
|
|
function news_show_more_des(id)
|
|
{
|
|
$('#news_description_' + id).toggleClass("news_description_none");
|
|
}
|
|
function bid_show_more_des(id)
|
|
{
|
|
$("#bid_description_" + id).toggleClass("news_description_none");
|
|
}
|
|
//将右侧的最小高度设置成左侧高度,美化界面
|
|
$(document).ready(function () {
|
|
$("#RSide").css("min-height",$("#LSide").height()-30);
|
|
});
|
|
//课程作业结束时间倒计时
|
|
function ShowCountDown(year,month,day,divname)
|
|
{
|
|
var now = new Date();
|
|
var endDate = new Date(year, month-1, day);
|
|
var leftTime=endDate.getTime()-now.getTime();
|
|
var leftsecond = parseInt(leftTime/1000);
|
|
var day1=Math.floor(leftsecond/(60*60*24));
|
|
var hour=Math.floor((leftsecond-day1*24*60*60)/3600);
|
|
var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60);
|
|
var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60);
|
|
$("#"+divname).html("<span style='color: #acaeb1;'>作业提交还剩 :</span> <span style='color: red;'>"
|
|
+day1+" </span><span style='color: #acaeb1;'>天</span><span style='color: red;'> "
|
|
+hour+" </span><span style='color: #acaeb1;'>时</span><span style='color: red;'> "
|
|
+minute+" </span><span style='color: #acaeb1;'>分</span><span style='color: red;'> "
|
|
+second+" </span><span style='color: #acaeb1;'>秒</span>");
|
|
}
|
|
//验证新建作业的名字
|
|
function regex_bid_name()
|
|
{
|
|
var name = $.trim($("#bid_name").val());
|
|
|
|
if(name=="")
|
|
{
|
|
$("#bid_name_span").text("名称不能为空");
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
$("#bid_name_span").text("");
|
|
return true;
|
|
}
|
|
}
|
|
function regex_evaluation_num()
|
|
{
|
|
var evaluation_num = $.trim($("#bid_evaluation_num").val());
|
|
var regex = /^\d+$/;
|
|
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
|
{
|
|
if(evaluation_num=="")
|
|
{
|
|
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
|
|
return false;
|
|
}
|
|
else if(regex.test(evaluation_num))
|
|
{
|
|
if(evaluation_num > 0)
|
|
{
|
|
$("#bid_evaluation_num_span").text("");
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
$(function(){
|
|
$("#bid_open_anonymous_evaluation").click(function(){
|
|
if($("#bid_open_anonymous_evaluation").attr("checked") == "checked")
|
|
{
|
|
$("#bid_evaluation_num").slideDown();
|
|
}
|
|
else
|
|
{
|
|
$("#bid_evaluation_num").slideUp();
|
|
}
|
|
});
|
|
});
|
|
|
|
function submit_new_bid()
|
|
{
|
|
if(regex_bid_name()&®ex_evaluation_num())
|
|
{
|
|
$("#new_bid").submit();
|
|
}
|
|
} |