parent
83dfcdcc02
commit
c68349803e
|
@ -1,43 +1,3 @@
|
|||
<script type="text/javascript">
|
||||
function regexSubject()
|
||||
{
|
||||
var content = $.trim($("#message_subject").val());
|
||||
if(content.length ==0)
|
||||
{
|
||||
$("#subject_span").text("<%= l(:label_subject_empty) %>");
|
||||
$("#subject_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#subject_span").text("<%= l(:label_field_correct) %>");
|
||||
$("#subject_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function regexContent()
|
||||
{
|
||||
var content = $.trim($("#message_content").val());
|
||||
if(content.length ==0)
|
||||
{
|
||||
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
|
||||
$("#message_content_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#message_content_span").text("<%= l(:label_field_correct) %>");
|
||||
$("#message_content_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function submitCoursesBoard()
|
||||
{
|
||||
if(regexSubject()&®exContent()){$("#message-form").submit();}
|
||||
}
|
||||
</script>
|
||||
<%= error_messages_for 'message' %>
|
||||
<% replying ||= false %>
|
||||
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
||||
|
@ -49,7 +9,7 @@
|
|||
<% else %>
|
||||
<%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
|
||||
<% end %>
|
||||
<span id="subject_span"></span>
|
||||
<span id="subject_span" class="ml55"></span>
|
||||
</li>
|
||||
<li class="ml60 mb5">
|
||||
<% unless replying %>
|
||||
|
@ -70,7 +30,7 @@
|
|||
<%= text_area :quote,:quote,:style => 'display:none' %>
|
||||
<%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
|
||||
<div class="cl"></div>
|
||||
<span id="message_content_span"></span>
|
||||
<span id="message_content_span" class="ml55"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
|
|
|
@ -1,69 +1,12 @@
|
|||
<script type="text/javascript">
|
||||
function regexTitle()
|
||||
{
|
||||
var name = $("#news_title").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#title_notice_span").text("标题不能为空");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else if(name.length <= 60)
|
||||
{
|
||||
$("#title_notice_span").text("填写正确");
|
||||
$("#title_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#title_notice_span").text("标题超过60个字符");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function regexDescription()
|
||||
{
|
||||
var name = $("#news_description").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#description_notice_span").text("描述不能为空");
|
||||
$("#description_notice_span").css('color','#ff0000');
|
||||
$("#description_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#description_notice_span").text("填写正确");
|
||||
$("#description_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitNews()
|
||||
{
|
||||
if(regexTitle() && regexDescription())
|
||||
{
|
||||
$("#news-form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function submitFocus(obj)
|
||||
{
|
||||
$(obj).focus();
|
||||
}
|
||||
</script>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
||||
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
||||
<span id="title_notice_span"></span>
|
||||
<span id="title_notice_span" class="ml55"></span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||
<textarea id="news_description" name="news[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl" onkeyup="regexDescription();"><%= is_new ? '' : @news.description %></textarea>
|
||||
<span id="description_notice_span"></span>
|
||||
<span id="description_notice_span" class="ml55"></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
|
|
|
@ -99,7 +99,104 @@ function submit_edit_course(id)
|
|||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////课程讨论区
|
||||
function regexSubject()
|
||||
{
|
||||
var content = $.trim($("#message_subject").val());
|
||||
if(content.length ==0)
|
||||
{
|
||||
$("#subject_span").text("主题不能为空");
|
||||
$("#subject_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#subject_span").text("填写正确");
|
||||
$("#subject_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function regexContent()
|
||||
{
|
||||
var content = $.trim($("#message_content").val());
|
||||
if(content.length ==0)
|
||||
{
|
||||
$("#message_content_span").text("描述不能为空");
|
||||
$("#message_content_span").css('color','#ff0000');
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#message_content_span").text("填写正确");
|
||||
$("#message_content_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function submitCoursesBoard()
|
||||
{
|
||||
if(regexSubject()&®exContent()){$("#message-form").submit();}
|
||||
}
|
||||
///////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////// 课程通知
|
||||
function regexTitle()
|
||||
{
|
||||
var name = $("#news_title").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#title_notice_span").text("标题不能为空");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else if(name.length <= 60)
|
||||
{
|
||||
$("#title_notice_span").text("填写正确");
|
||||
$("#title_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#title_notice_span").text("标题超过60个字符");
|
||||
$("#title_notice_span").css('color','#ff0000');
|
||||
$("#title_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function regexDescription()
|
||||
{
|
||||
var name = $("#news_description").val();
|
||||
if(name.length ==0)
|
||||
{
|
||||
$("#description_notice_span").text("描述不能为空");
|
||||
$("#description_notice_span").css('color','#ff0000');
|
||||
$("#description_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#description_notice_span").text("填写正确");
|
||||
$("#description_notice_span").css('color','#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function submitNews()
|
||||
{
|
||||
if(regexTitle() && regexDescription())
|
||||
{
|
||||
$("#news-form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function submitFocus(obj)
|
||||
{
|
||||
$(obj).focus();
|
||||
}
|
||||
///////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////
|
||||
//验证搜索时输入名字
|
||||
function regexName(content)
|
||||
{
|
||||
|
|
|
@ -22,6 +22,7 @@ a:hover,a:active{color:#000;}
|
|||
.ml15{ margin-left:15px;}
|
||||
.ml20{ margin-left:20px;}
|
||||
.ml45{ margin-left:45px;}
|
||||
.ml55{ margin-left:55px;}
|
||||
.ml30{ margin-left:30px;}
|
||||
.ml60{ margin-left:60px;}
|
||||
.ml80{ margin-left:80px;}
|
||||
|
|
Loading…
Reference in New Issue