修改《编辑器还原》《提示信息的添加》

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-05-22 13:57:07 +08:00
parent c18d1d9585
commit 1c9b9dff79
9 changed files with 209 additions and 205 deletions

View File

@ -3,7 +3,7 @@
<%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %> <%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="javascript:;" name="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="javascript:(0);" name="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

View File

@ -10,19 +10,17 @@
<% end %> <% end %>
</h2> </h2>
<% if User.current.logged? %> <a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
<a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<!-- 发布新帖部分 --> <!-- 发布新帖部分 -->
<div class="cl"></div> <div class="cl"></div>
<div class=" talklist_box" > <div class=" talklist_box" >
<div class="talk_new ml15 mb10" name="container_board" id="about_newtalk" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;" > <div class="talk_new ml15 mb10" name="container_board" id="about_newtalk" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;" >
<ul> <ul>
<%= render :partial => 'course_new' %> <%= render :partial => 'course_new' %>
</ul> </ul>
</div><!--talknew end--> </div><!--talknew end-->
<% if !User.current.logged?%> <% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;"> <div style="font-size: 14px;margin:20px;">
@ -31,186 +29,166 @@
<hr/> <hr/>
</div> </div>
<% end %> <% end %>
<p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p> <p class="c_dark mb5">讨论区共有<span class="c_orange"><%= @topic_count %></span>个帖子</p>
<% if @topics.any? %> <% if @topics.any? %>
<% @topics.each do |topic| %> <% @topics.each do |topic| %>
<div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>"> <div class="talkmain_box" style="border:none; margin-bottom:0; border-bottom: 1px dashed #d9d9d9;" id="topic<%= topic.id %>">
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %> <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
<div class="talkmain_txt fl mt5"> <div class="talkmain_txt fl mt5">
<% author = topic.author.to_s + "" %> <% author = topic.author.to_s + "" %>
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %> <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p> <p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.course_editable_by?(User.current) %> <% if topic.course_editable_by?(User.current) %>
<a href="javascript:" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right; <a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-right: 10px;"><%= l(:button_edit) %></a> margin-right: 10px;"><%= l(:button_edit) %></a>
<% end %> <% end %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),
{:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'},
:method => :post, :method => :post,
:data => {:confirm => l(:text_are_you_sure)}, :data => {:confirm => l(:text_are_you_sure)},
:class => 'talk_edit fr', :class => 'talk_edit fr',
:style => ' margin-right: 10px;' :style => ' margin-right: 10px;'
) if topic.destroyable_by?(User.current) %> ) if topic.destroyable_by?(User.current) %>
<% if topic.sticky? %> <% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a> <a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<script> <script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}}); $(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}});
</script> </script>
<div class="project_board_content break_word" id="content_<%=topic.id%>"> <div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img"> <div id="contentmessage<%=topic.id %>" class="upload_img">
<%= topic.content.html_safe %> <%= topic.content.html_safe %>
</div>
</div> </div>
</div>
<p style="display: none" id="project_show_<%= topic.id%>"> <p style="display: none" id="project_show_<%= topic.id%>">
<a id="expend_more_information<%= topic.id%>" href="javascript:void(0)" style="color: #0781b4;" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</a> <a id="expend_more_information<%= topic.id%>" href="javascript:void(0)" style="color: #0781b4;" onclick="show_more_reply('#content_<%=topic.id%>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</a>
<span class="g-arr-down"> <span class="g-arr-down">
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" /> <img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span> </span>
</p> </p>
<%= link_to_attachments_course topic, :author => false %> <%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %> <%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
</div>
<% if User.current.logged? %>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => "about_newtalk#{topic.id}",:class => ' c_dblue fr' %>
<% end %>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display: none">
<ul>
<%= render :partial => 'edit',locals: {:topic => topic} %>
</ul>
</div> </div>
<div class="talkWrapBox"> <%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
<% reply = Message.new(:subject => "RE: #{@message.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %>
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>" name="container_board">
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %> <div class="cl"></div>
<%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
<a href="javascript:void(0)" name="submitbtn" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<% replies_all = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").offset(2).
all %>
<% replies_show = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").limit(2).
all %>
<% unless replies_show.empty? %>
<% reply_count = 0 %>
<div class="talkWrapMsg">
<ul>
<% replies_show.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/> </div><!--讨论主类容 end-->
<span class=" c_grey fl"><%= format_time(message.created_on) %></span> <div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display: none">
<%= link_to( <ul>
<%= render :partial => 'edit',locals: {:topic => topic} %>
</ul>
</div>
<div class="talkWrapBox">
<% reply = Message.new(:subject => "RE: #{@message.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %>
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="display: none" id="reply<%= topic.id %>" name="container_board">
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
l(:button_delete), <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'}, <%= toggle_link l(:button_cancel), "reply" + topic.id.to_s, :focus => 'message_content',:class => 'grey_btn fr ml10' %>
:method => :post, <a href="javascript:void(0)" name="submitbtn" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
<%= link_to(
l(:button_reply),
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:remote => true,
:method => 'get',
:focus => "about_newtalk#{topic.id}",
:class => ' c_dblue fr',
:style => 'margin-right: 10px;',
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<div class="talkWrapMsg" id="talkWrapMsg<%= topic.id %>" style="display: none">
<ul>
<% replies_all.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
<%= link_to(
l(:button_reply),
{:controller => 'messages', :action => 'quote', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:remote => true,
:method => 'get',
:focus => "about_newtalk#{topic.id}",
:class => ' c_dblue fr',
:style => 'margin-right: 10px;',
:title => l(:button_quote)) if !topic.locked? && authorize_for('messages', 'reply') %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<%if replies_all.first %>
<div class="talkWrapMsg"><a class=" ml258" href="javascript:" id="showgithelp<%= topic.id%>" style="color: #0781b4;" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23">展开回复(<%= topic.replies_count.to_s%>)</a></div>
<% end %> <% end %>
<% end %> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
<% else %> <% replies_all = topic.children.
<p class="nodata"><%= l(:label_no_data) %></p> includes(:author, :attachments, {:board => :project}).
<% end %> reorder("#{Message.table_name}.created_on DESC").offset(2).
all %>
<% replies_show = topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").limit(2).
all %>
<% unless replies_show.empty? %>
<% reply_count = 0 %>
<div class="talkWrapMsg">
<ul>
<% replies_show.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<div class="talkWrapMsg" id="talkWrapMsg<%= topic.id %>" style="display: none">
<ul>
<% replies_all.each do |message| %>
<li>
<%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
<div class="Msg_txt">
<%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
<br/>
<p class="fl"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to(
l(:button_delete),
{:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete),
:class => ' c_dblue fr'
) if message.course_destroyable_by?(User.current) %>
</div>
<div class="cl"></div>
</li><!---留言内容-->
<% end %>
</ul>
</div>
<%if replies_all.first %>
<div class="talkWrapMsg"><a class=" ml258" href="javascript:void(0)" id="showgithelp<%= topic.id%>" value="show_help" onclick ="showhelpAndScrollToMessage('talkWrapMsg<%= topic.id %>','#showgithelp<%= topic.id%>','<%=topic.replies_count%>'); " class="c_dblue lh23" style="color: #0781b4;" >展开回复(<%= topic.replies_count.to_s%>)</a></div>
<% end %>
<% end %>
</div>
<% end %>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<ul class="wlist"> <ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul> </ul>
<%# other_formats_links do |f| %> <%# other_formats_links do |f| %>
<%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <%#= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
<%# end %> <%# end %>
<% html_title @board.name %> <% html_title @board.name %>
@ -224,49 +202,52 @@
KindEditor.ready(function(K){ KindEditor.ready(function(K){
$("div[name='container_board']").each(function(){ $("div[name='container_board']").each(function(){
var container=$(this); var container=$(this);
var messege = $("p[aa='message_show']",container);
var subject = $("input[aa='subject']",container);
var textarea= $("textarea[aa='content']",container); var textarea= $("textarea[aa='content']",container);
var message = $("p[aa='message_show']", container); var form = $("form",container);
var editor = K.create(textarea, { var editor = K.create(textarea, {
resizeType : 1, resizeType : 1,
allowPreviewEmoticons : false, allowPreviewEmoticons : false,
allowImageUpload : false, allowImageUpload : false,
width:"89%", width:"89%",
items : ['emoticons'] items : []
}); });
// form.submit(function(){
// alert(textarea.html());
// });
// $("a[name='submitbtn']",container).click(function(){
// form.submit();
// });
$("a[name='submitbtn']",container).click(function(){ $("a[name='submitbtn']",container).click(function(){
textarea[0].value = editor.html(); textarea[0].value = editor.html() ;
var id = textarea[0].id.toString().substr(15); var id = textarea[0].id.toString().substr(15);
var subject = document.getElementById("message_subject");
if(subject.value == "RE: ") {
if (textarea[0].value.length == 0) {
message[0].text("描述不能为空"); if(subject.val() == "RE: ") {
message[0].css('color', '#ff0000');
if (editor.html() == "") {
messege.html("回复内容不能为空") ;
messege.css('color', '#ff0000');
messege.show();
} }
else { else {
messege.html("填写正确");
message[0].text("填写正确"); messege.css('color', '#008000');
message[0].css('color', '#008000'); messege.show();
this.parentNode.submit(); this.parentNode.submit();
} }
} }
else { else {
if (regexContent(id) && regexSubject(id)) { if(regexContent(id) && regexSubject(id)) {
if (this.parentNode.name.toString() == 'message-form') { if (this.parentNode.name == 'message-form') {
this.parentNode.submit(); this.parentNode.submit();
} }
else { else
this.parentNode.parentNode.submit(); this.parentNode.parentNode.submit();
}
} }
} }
});
});
}); });
}); });

View File

@ -5,17 +5,17 @@
<li style="display: none"> <li style="display: none">
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585", :aa=>"subject" }.merge(extra_option) %>
<p id="subject_span<%= topic.id%>" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>
<% else %> <% else %>
<li> <li >
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585", :aa=>"subject" }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>

View File

@ -18,7 +18,7 @@
<li style="display: none"> <li style="display: none">
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585", :aa=>'subject' }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
@ -28,7 +28,7 @@
<label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label>
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %> <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585", :aa=>'subject' }.merge(extra_option) %>
<p id="subject_span<%= f.object.id%>" class="ml55"></p> <p id="subject_span<%= f.object.id%>" class="ml55"></p>
</li> </li>

View File

@ -4,7 +4,7 @@
<li> <li>
<a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" onclick="show_newtalk();" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="javascript:;" name="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="javascript:void(0)" name="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<% end %> <% end %>

View File

@ -8,7 +8,7 @@
</h2> </h2>
<% if User.current.logged? %> <% if User.current.logged? %>
<a href="javascript:void" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a> <a href="javascript:void(0)" class="green_btn fr newtalk " onclick="show_newtalk();"><%= l(:label_message_new) %></a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
@ -174,7 +174,7 @@
<br/> <br/>
<p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p> <p class="fl break_word"><%= textAreailizable message,:content,:attachments => message.attachments %></p>
<br/> <br/>
<span class=" c_grey fl"><%= format_time(message.created_on) %></span> <span class=" c_grey fl"><%= format_time(message.created_on) %></span>
<%= link_to( <%= link_to(
@ -246,28 +246,32 @@
KindEditor.ready(function(K){ KindEditor.ready(function(K){
$("div[name='container_board']").each(function(){ $("div[name='container_board']").each(function(){
var container=$(this); var container=$(this);
var form =$("form", container);
var messege = $("p[aa='message_show']",container);
var textarea= $("textarea[aa='content']",container); var textarea= $("textarea[aa='content']",container);
var editor = K.create(textarea, { var editor = K.create(textarea, {
resizeType : 1, resizeType : 1,
allowPreviewEmoticons : false, allowPreviewEmoticons : false,
allowImageUpload : false, allowImageUpload : false,
width:"89%", width:"89%",
items : ['emoticons'] items : []
}); });
$("a[name='submitbtn']",container).click(function(){ $("a[name='submitbtn']",container).click(function(){
textarea[0].value = editor.html(); textarea[0].value = editor.html();
var id = textarea[0].id.toString().substr(15);
if(regexContent(id) && regexSubject(id)) {
if (this.parentNode.name.toString() == 'message-form') {
this.parentNode.submit();
}
else {
this.parentNode.parentNode.submit();
} if (editor.html() == "") {
messege.html("回复内容不能为空") ;
messege.css('color', '#ff0000');
messege.show();
}
else {
messege.html("填写正确");
messege.css('color', '#008000');
messege.show();
form.submit();
} }
}); });

View File

@ -77,7 +77,24 @@ function show_more_reply(contentid, id2, id3) {
information.attr("style", "color:#0781b4;"); information.attr("style", "color:#0781b4;");
} }
} }
function show_more_reply1(contentid, id2, id3) {
$(contentid).toggleClass("course_description_none");
var information = $(id2);
var arrow = $(id3);
var val = information.attr("value");
if (val == "show_more") {
$(id2).text("[收起]");
information.attr("value", "hide_more");
information.attr("style", "color:#3ca5c6");
arrow.attr("src", "/images/jiantouup.jpg")
}
else {
$(id2).text("[展开]");
information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg")
information.attr("style", "color:#0781b4;");
}
}
//项目版本库git帮助文档显示 //项目版本库git帮助文档显示
function showhelpAndScrollTo(id) { function showhelpAndScrollTo(id) {
$('#' + id).toggle(); $('#' + id).toggle();

View File

@ -46,6 +46,7 @@ a:hover.subnav_green{ background:#14ad5a;}
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;} .project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;} .course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 182px;word-break: break-all;word-wrap: break-word;} .project_board_content{overflow: hidden;max-height: 182px;word-break: break-all;word-wrap: break-word;}
.project_board_content1{overflow: hidden;max-height: 72px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;} .course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}

View File

@ -50,6 +50,7 @@ a:hover.subnav_green{ background:#14ad5a;}
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;} .project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;} .course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 182px;word-break: break-all;word-wrap: break-word;} .project_board_content{overflow: hidden;max-height: 182px;word-break: break-all;word-wrap: break-word;}
.project_board_content1{overflow: hidden;max-height: 72px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;} .course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;} .lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;} .lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}