This commit is contained in:
yutao 2015-05-26 17:01:25 +08:00
parent 8d82ecc89c
commit 49c5f3879b
4 changed files with 23 additions and 5 deletions

View File

@ -12,6 +12,7 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form_project', <%= render :partial => 'form_project',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white" ><%= l(:button_submit)%></a> <a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white" ><%= l(:button_submit)%></a>
<%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %> <%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
@ -31,6 +32,7 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form_course', <%= render :partial => 'form_course',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" nhname='cancelbtn' class="blue_btn grey_btn fr c_white ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white"><%= l(:button_submit)%></a> <a href="javascript:void(0)" nhname='submitbtn' class="blue_btn fr c_white"><%= l(:button_submit)%></a>

View File

@ -52,7 +52,7 @@
<label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label> <label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none',:nhname=>"quote_input" %> <%= text_area :quote,:quote,:style => 'display:none',:nhname=>"quote_input" %>
<div class="content"> <div class="content ml55">
<% if replying%> <% if replying%>
<%= f.text_area :content, <%= f.text_area :content,

View File

@ -2,6 +2,7 @@
<%= render :partial => 'form_project', :locals => {:f => f, :topic => @message} %> <%= render :partial => 'form_project', :locals => {:f => f, :topic => @message} %>
<li> <li>
<div class="ml55 fl" nhname="toolbar_container"></div>
<a href="javascript:void(0)" nhname="cancelbtn" class="grey_btn fr ml10"><%= l(:button_cancel) %></a> <a href="javascript:void(0)" nhname="cancelbtn" class="grey_btn fr ml10"><%= l(:button_cancel) %></a>
<a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a> <a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>

View File

@ -52,6 +52,9 @@
<% 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 %>
<script>
$(function(){if($("#contentmessage<%=topic.id %>").height()>182){$("#project_show_<%= topic.id%>").show();}});
</script>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="project_board_content break_word" id="content_<%=topic.id%>"> <div class="project_board_content break_word" id="content_<%=topic.id%>">
@ -59,7 +62,7 @@
<%= 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%>" style="color: #0781b4;" href="javascript:void(0)" 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%>" style="color: #0781b4;" href="javascript:void(0)" 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" />
@ -87,6 +90,7 @@
<%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'},
:html => {:nhname=>"form",:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %> :html => {:nhname=>"form",:multipart => true, :id => 'message_form' + topic.id.to_s, :name=>'message-form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
<div class="fl" nhname="toolbar_container"></div>
<div style="padding-top:5px;" class="fr"> <div style="padding-top:5px;" class="fr">
<a href="javascript:void(0)" nhname="cancelbtn" class="blue_btn fr ml10" style=""><%= l(:button_cancel)%></a> <a href="javascript:void(0)" nhname="cancelbtn" class="blue_btn fr ml10" style=""><%= l(:button_cancel)%></a>
<a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a> <a href="javascript:void(0)" nhname="submitbtn" class="blue_btn fr " style=""><%= l(:label_memo_create)%></a>
@ -161,6 +165,9 @@
</div> </div>
<div style="display:none;"><a href="#" id="nhjump"></a></div> <div style="display:none;"><a href="#" id="nhjump"></a></div>
<style>
.ke-toolbar{display:none;width:400px;border:none;background:none;}
</style>
<script type="text/javascript"> <script type="text/javascript">
function nh_check_field(params){ function nh_check_field(params){
var result=true; var result=true;
@ -206,13 +213,18 @@
allowImageUpload : false, allowImageUpload : false,
minWidth:"1px", minWidth:"1px",
width:"565px", width:"565px",
items : [], items : ['emoticons'],
afterChange:function(){//按键事件 afterChange:function(){//按键事件
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.about_talk);
params.toolbar_container.append(toolbar);
} }
}); });
//主题输入框按键事件 //主题输入框按键事件
params.inputsubject.keydown(function(){ params.inputsubject.keyup(function(){
nh_check_field({subject:params.inputsubject,subjectmsg:params.subjectmsg}); nh_check_field({subject:params.inputsubject,subjectmsg:params.subjectmsg});
}) })
//表单提交 //表单提交
@ -300,7 +312,7 @@
$("div[nhname='container_board']").each(function(){ $("div[nhname='container_board']").each(function(){
var container = $(this); var container = $(this);
var about_talk = $("div[nhname='about_talk']",container); var about_talk = $("div[nhname='about_talk']",container);
nh_init_board({ var params = ({
kindutil:K, kindutil:K,
showbtn:$("a[nhname='showbtn']",container), showbtn:$("a[nhname='showbtn']",container),
about_talk:about_talk, about_talk:about_talk,
@ -311,8 +323,10 @@
submitbtn:$("a[nhname='submitbtn']",about_talk), submitbtn:$("a[nhname='submitbtn']",about_talk),
cancelbtn:$("a[nhname='cancelbtn']",about_talk), cancelbtn:$("a[nhname='cancelbtn']",about_talk),
form:$("form[nhname='form']",about_talk), form:$("form[nhname='form']",about_talk),
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
init_content_val:$("input[nhname='init_content_val']",about_talk) init_content_val:$("input[nhname='init_content_val']",about_talk)
}); });
nh_init_board(params);
}); });
$("div[mhname='container_board_reply']").each(function(){ $("div[mhname='container_board_reply']").each(function(){
var container = $(this); var container = $(this);
@ -332,6 +346,7 @@
form:$("form[nhname='form']",about_talk), form:$("form[nhname='form']",about_talk),
quote_show:$("div[nhname='quote_show']",about_talk), quote_show:$("div[nhname='quote_show']",about_talk),
quote_input:$("textarea[nhname='quote_input']",about_talk), quote_input:$("textarea[nhname='quote_input']",about_talk),
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
jumphref:$("#nhjump") jumphref:$("#nhjump")
}; };
params.get_ref_str_call=function(btn){ params.get_ref_str_call=function(btn){