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.
118 lines
5.5 KiB
118 lines
5.5 KiB
<script type="text/javascript">
|
|
$(function(){
|
|
$("#RSide").removeAttr("id");
|
|
$("#Container").css("width","1000px");
|
|
});
|
|
function reset_topic(){
|
|
$("#message_subject").val("");
|
|
$("#subjectmsg").text("");
|
|
document.getElementById("message_sticky").checked=false;
|
|
document.getElementById("message_locked").checked=false;
|
|
$("#topic_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => Message.new, :isReply => @isReply})%>");
|
|
message_content_editor.html("");
|
|
$("#topic_editor").toggle();
|
|
}
|
|
<% if @is_new%>
|
|
$(function(){
|
|
$("#message_subject").focus();
|
|
});
|
|
<%end%>
|
|
</script>
|
|
|
|
<div class="homepageRight mt0 ml10">
|
|
<div class="homepageRightBanner">
|
|
<div class="NewsBannerName">
|
|
项目讨论区
|
|
</div>
|
|
</div>
|
|
<% if User.current.logged? %>
|
|
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
|
|
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
|
<%#= render :partial => 'project_new_topic', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
|
|
<%= render :partial => 'project_new_topic', :locals => {:f => f, :topic => @message, :edit_mode => false, :project => @board.project} %>
|
|
<% end %>
|
|
<% end %>
|
|
<%= render :partial=> 'project_show_detail',:locals =>{:topics => @topics, :page => 0} %>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$(".talkmain_box").each(function(){
|
|
var target = $("li[nhname='reply_rec']",$(this));
|
|
var btn = $("a[nhname='reply_ex_btn']",$(this));
|
|
var jumpobj = $("div[nhname='nh_reply_div']",$(this));
|
|
btn.click(function(){
|
|
if($(this).data('init')=='0'){
|
|
$(this).data('init',1);
|
|
$(this).html('收起回复');
|
|
target.show();
|
|
}else{
|
|
$(this).data('init',0);
|
|
$(this).html('展开回复'+$(this).data('count')+')');
|
|
target.hide();
|
|
target.eq(0).show();
|
|
target.eq(1).show();
|
|
$("#nhjump").attr('href','#'+jumpobj.attr('id'));
|
|
$("#nhjump")[0].click();
|
|
}
|
|
});
|
|
});
|
|
KindEditor.ready(function(K){
|
|
$("div[nhname='container_board']").each(function(){
|
|
var container = $(this);
|
|
var about_talk = $("div[nhname='about_talk']",container);
|
|
var params = ({
|
|
kindutil:K,
|
|
showbtn:$("a[nhname='showbtn']",container),
|
|
about_talk:about_talk,
|
|
inputsubject:$("input[nhname='inputsubject']",about_talk),
|
|
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
|
|
textarea:$("textarea[nhname='textarea']",about_talk),
|
|
contentmsg:$("p[nhname='contentmsg']",about_talk),
|
|
submitbtn:$("a[nhname='submitbtn']",about_talk),
|
|
cancelbtn:$("a[nhname='cancelbtn']",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)
|
|
});
|
|
nh_init_board(params);
|
|
});
|
|
$("div[mhname='container_board_reply']").each(function(){
|
|
var container = $(this);
|
|
var about_talk = $("div[nhname='about_talk_reply']",container);
|
|
var params = {
|
|
type:'reply',
|
|
kindutil:K,
|
|
showbtn:$("a[nhname='showbtn_reply']",container),
|
|
showbtn_child:$("a[nhname='showbtn_child_reply']",container),
|
|
about_talk:about_talk,
|
|
inputsubject:$("input[nhname='inputsubject']",about_talk),
|
|
subjectmsg:$("p[nhname='subjectmsg']",about_talk),
|
|
textarea:$("textarea[nhname='textarea']",about_talk),
|
|
contentmsg:$("p[nhname='contentmsg']",about_talk),
|
|
submitbtn:$("a[nhname='submitbtn']",about_talk),
|
|
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
|
|
form:$("form[nhname='form']",about_talk),
|
|
quote_show:$("div[nhname='quote_show']",about_talk),
|
|
quote_input:$("textarea[nhname='quote_input']",about_talk),
|
|
toolbar_container:$("div[nhname='toolbar_container']",about_talk),
|
|
jumphref:$("#nhjump")
|
|
};
|
|
params.get_ref_str_call=function(btn){
|
|
var div = btn.parent('div');
|
|
var str = '<blockquote>'+$('a',div).filter(':first').html()+' 写到: <br/>'+$("input[nhname='nh_content_val']",div).val()+'<div class="cl"></div></blockquote>';
|
|
return str;
|
|
}
|
|
nh_init_board(params);
|
|
});
|
|
<% if(!@flag.nil? && @flag=='true') %>
|
|
if($("#new_topic_btn")!=undefined)$("#new_topic_btn").click();
|
|
<% end %>
|
|
});
|
|
});
|
|
</script> |