@@ -69,7 +31,7 @@
作品名称 :
- <%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexName();" %>
+ <%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexHomeworkCommonName();" %>
@@ -79,7 +41,7 @@
作品描述 :
- <%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%>
+ <%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexHomeworkCommonDescription();"%>
diff --git a/app/views/homework_common/_homework_detail_programing_form.html.erb b/app/views/homework_common/_homework_detail_programing_form.html.erb
index 806768954..e27fb5b9e 100644
--- a/app/views/homework_common/_homework_detail_programing_form.html.erb
+++ b/app/views/homework_common/_homework_detail_programing_form.html.erb
@@ -57,7 +57,7 @@
@@ -89,11 +89,11 @@
\ No newline at end of file
diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb
index 94f40064c..92e15ab93 100644
--- a/app/views/words/destroy.js.erb
+++ b/app/views/words/destroy.js.erb
@@ -1,26 +1,26 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
- <% if @user && @jours_count%>
+ <% if @is_user%>
$("#nh_jours_<%= @journal_destroyed.id %>",$("div[nhname='container']",$("#nh_messages"))).remove();
var params = init_list_more_div_params($("#nh_messages"));
change_status_4_list_more_div(params);
<% else %>
-
- <% if @bid && @jours_count %>
- $('#jours_count').html("<%= @jours_count %>");
- <% elsif @course && @jours_count%>
- $('#course_jour_count').html("(<%= @jours_count %>)");
- <% elsif @user && @jours_count%>
- $('#jour_count').html("<%= @jours_count %>");
- <% end %>
- var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
- destroyedItem.fadeOut(600,function(){
- destroyedItem.remove();
- });
+ <% if @bid && @jours_count %>
+ $('#jours_count').html("<%= @jours_count %>");
+ <% elsif @course && @jours_count%>
+ $('#course_jour_count').html("(<%= @jours_count %>)");
+ <% elsif @user && @jours_count%>
+ $('#jour_count').html("<%= @jours_count %>");
+ <% end %>
+ var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
+ destroyedItem.fadeOut(600,function(){
+ destroyedItem.remove();
+ });
<% end %>
<% else %>
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
$('#new_form_reference_user_id').val("");
<% end %>
+
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 7c165a4c6..b2736993b 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -506,14 +506,51 @@ function submit_homework(id)
}
}
+function regexHomeworkCommonName()
+{
+ var name = $.trim($("#homework_attach_name").val());
+
+ if(name=="")
+ {
+ $("#homework_attach_name_span").text("作品名称不能为空");
+ $("#homework_attach_name_span").css('color','#ff0000');
+ return false;
+ }
+ else
+ {
+ $("#homework_attach_name_span").text("填写正确");
+ $("#homework_attach_name_span").css('color','#008000');
+ return true;
+ }
+}
+function regexHomeworkCommonDescription()
+{
+ var name = $.trim($("#homework_attach_description").val());
+
+ if(name=="")
+ {
+ $("#homework_attach_description_span").text("作品描述不能为空");
+ $("#homework_attach_description_span").css('color','#ff0000');
+ return false;
+ }
+ else
+ {
+ $("#homework_attach_description_span").text("填写正确");
+ $("#homework_attach_description_span").css('color','#008000');
+ return true;
+ }
+}
+
+function submit_homework_form(){if(regexHomeworkCommonName()&®exHomeworkCommonDescription()){$('#new_homework_attach').submit();}}
+
//增加测试结果
function add_programing_test(obj) {
var now = new Date().getTime();
- obj.after("
");
}
//删除测试结果
function remove_programing_test(obj) {
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index abeec52d3..5a7bb001a 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -609,6 +609,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.w547{ width:544px;}
.w196{ width:196px;}
.w186{ width:186px;}
+.w200{width: 200px;}
.w459{ width:459px;}
.hwork_new_set{border:1px dashed #CCC; background:#f5f5f5; text-align:center; padding:10px 0; margin-bottom:10px;}
.hwork_new_grey{background:#dbdbdb; width:610px; padding:10px 20px; margin:0 auto; text-align:left; margin-bottom:5px;}