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.
160 lines
4.2 KiB
160 lines
4.2 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 show_bid_dead_line(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("<form name='formnow' class='fr'>"
|
|
+ "<input class='c_orange' type='text' style='border:0;' size='1' value='"+day1+"' > 天"
|
|
+ "<input class='c_orange' type='text' style='border:0;' size='1' value='"+hour+"' > 小时"
|
|
+ "<input class='c_orange' type='text' style='border:0;' size='1' value='"+minute+"' > 分"
|
|
+ "<input class='c_orange' type='text' style='border:0;' size='1' value='"+second+"' > 秒"
|
|
+ "</form>"
|
|
+ "<p class='fr'>作业提交还剩:</p>");
|
|
}
|
|
//验证新建作业的名字
|
|
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(id)
|
|
{
|
|
if(regex_bid_name()&®ex_evaluation_num())
|
|
{
|
|
$("#"+id).submit();
|
|
}
|
|
}
|
|
|
|
function show_window (id1,id2,top,left) {
|
|
$('#'+ id1).css('top',top);
|
|
$('#'+ id1).css('left',left);
|
|
$('#'+ id1).css('display','block');
|
|
$('#' + id2).css('display','block');
|
|
}
|
|
|
|
function close_window(id1,id2){
|
|
$('#' + id1).css('display','none');
|
|
$('#' + id2).css('display','none');
|
|
}
|
|
|
|
//隐藏提示狂
|
|
function hidden_atert_form(cur_page,cur_type)
|
|
{
|
|
hideModal($("#popbox"));
|
|
}
|
|
|
|
$(function(){
|
|
if($("#course_description_content").height()>112)
|
|
{
|
|
$("#lg-foot").show();
|
|
}
|
|
}); |