socialforge/app/views/words/create_reply.js.erb

33 lines
2.0 KiB
Plaintext
Raw Normal View History

2013-12-25 22:21:16 +08:00
<% if @save_succ %>
2015-09-25 16:29:47 +08:00
<% if @user_activity_id %>
2017-01-11 10:16:25 +08:00
<% if @activity.jour_type == 'Principal' || @activity.jour_type == 'Course' || @activity.jour_type == 'Contest' %>
2016-11-25 09:59:03 +08:00
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
2015-10-14 11:38:16 +08:00
<% end %>
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
2016-01-29 16:55:07 +08:00
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
2015-09-24 16:30:14 +08:00
<% else %>
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>
$("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>");
div_1 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='div_form']");
div_1.hide();
div_2 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='sub_div_form']");
div_2.hide();
<% else %>
var pre_append = $('<%= j(
render :partial => "words/journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name}
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea.val('');
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea1.val('');
$('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
setMaxLengthItem(pre_append.find('textarea')[0]);
<% end %>
<% end %>
2013-12-25 22:21:16 +08:00
<% else %>
2015-09-24 16:30:14 +08:00
alert("<%= l(:label_feedback_fail) %>");
2013-12-25 22:21:16 +08:00
<% end %>