parent
afb1a8f53f
commit
bb0db1e21d
@ -0,0 +1,108 @@
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar {
|
||||
display: none;
|
||||
width: 400px;
|
||||
border: none;
|
||||
background: none;
|
||||
padding: 0px 0px;
|
||||
}
|
||||
|
||||
span.ke-toolbar-icon {
|
||||
line-height: 26px;
|
||||
font-size: 14px;
|
||||
padding-left: 26px;
|
||||
}
|
||||
|
||||
span.ke-toolbar-icon-url {
|
||||
background-image: url(/images/public_icon.png)
|
||||
}
|
||||
|
||||
div.ke-toolbar .ke-outline {
|
||||
padding: 0px 0px;
|
||||
line-height: 26px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
span.ke-icon-emoticons {
|
||||
background-position: 0px -671px;
|
||||
width: 50px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
span.ke-icon-emoticons:hover {
|
||||
background-position: -79px -671px;
|
||||
width: 50px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
div.ke-toolbar .ke-outline {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.ke-inline-block {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.ke-container {
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
<% course_activities.each do |activity| if course_activities %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复(' + btn.data('count') + ')');
|
||||
target.show();
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多(' + btn.data('count') + ')');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function () {
|
||||
init_activity_KindEditor_data(<%= activity.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<% if activity %>
|
||||
<% act = activity.course_act %>
|
||||
<% case activity.course_act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% when 'Attachment' %>
|
||||
<%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% when 'Course' %>
|
||||
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if course_activities.count == 10 %>
|
||||
<div id="show_more_course_activities" class="loadMore mt10 f_grey">展开更多<%= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %></div>
|
||||
<% end %>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#show_more_course_activities").mouseover(function () {
|
||||
$("#more_course_activities_link").click();
|
||||
});
|
||||
</script>
|
@ -0,0 +1 @@
|
||||
$("#show_more_course_activities").replaceWith("<%= escape_javascript( render :partial => 'courses/course_activity',:locals => {:course_activities => @course_activities, :page => @page,:type => @type} )%>");
|
@ -1,27 +1,31 @@
|
||||
<% if @save_succ %>
|
||||
<% 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 %>
|
||||
|
||||
<% if params[:user_activity_id] %>
|
||||
<% @user_activity_id = params[:user_activity_id] %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => JournalsForMessage.find(@parent_id),:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
|
||||
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%");
|
||||
<% 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 %>
|
||||
<% else %>
|
||||
alert("<%= l(:label_feedback_fail) %>");
|
||||
alert("<%= l(:label_feedback_fail) %>");
|
||||
<% end %>
|
Loading…
Reference in new issue