socialforge/app/views/boards/_course_show.html.erb

83 lines
3.7 KiB
Plaintext
Raw Normal View History

2015-10-09 14:39:40 +08:00
<%= 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>
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#Container").css("width","1000px");
});
</script>
2015-05-11 17:23:53 +08:00
<% if topics%>
<% topics.each do |topic| %>
2015-10-09 14:39:40 +08:00
<script>
function expand_reply(container, btnid) {
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {
btn.data('init', 1);
btn.html('收起回复');
2015-10-09 14:39:40 +08:00
target.show();
} else {
btn.data('init', 0);
btn.html('展开更多');
2015-10-09 14:39:40 +08:00
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
2015-10-09 14:39:40 +08:00
}
}
function expand_reply_input(id) {
$(id).toggle();
}
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
var description_images=$("div#activity_description_<%= topic.id %>").find("img");
if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
var reply_images=$("div#reply_content_<%= topic.id %>").find("img");
if (reply_images.length>0) {
for (var i=0; i<reply_images.length; i++){
var image=$(reply_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
2015-10-09 14:39:40 +08:00
$('#reply_content_<%= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
});
2015-10-09 14:39:40 +08:00
</script>
<% if topic %>
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %>
<% end %>
<% end %>
<% if topics.count == 10 %>
<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>
<% end %>
<% end%>
2015-10-09 14:39:40 +08:00
<script type="text/javascript">
$("#show_more_course_topic").mouseover(function () {
$("#more_topic_link").click();
2015-10-09 14:39:40 +08:00
});
</script>