讨论区帖子图片可点击
This commit is contained in:
parent
9a0c9ecc77
commit
a16dc09afa
|
@ -71,7 +71,9 @@
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
||||||
var description_images=$("div#activity_description_<%= topic.id %>").find("img");
|
showNormalImage('activity_description_<%= topic.id %>');
|
||||||
|
//showNormalImage('reply_content_<%#= topic.id %>');
|
||||||
|
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
|
||||||
if (description_images.length>0) {
|
if (description_images.length>0) {
|
||||||
for (var i=0; i<description_images.length; i++){
|
for (var i=0; i<description_images.length; i++){
|
||||||
var image=$(description_images[i]);
|
var image=$(description_images[i]);
|
||||||
|
@ -79,9 +81,9 @@
|
||||||
image.wrap(element);
|
image.wrap(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#activity_description_<%= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
|
$('#activity_description_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
|
||||||
|
|
||||||
var reply_images=$("div#reply_content_<%= topic.id %>").find("img");
|
var reply_images=$("div#reply_content_<%#= topic.id %>").find("img");
|
||||||
if (reply_images.length>0) {
|
if (reply_images.length>0) {
|
||||||
for (var i=0; i<reply_images.length; i++){
|
for (var i=0; i<reply_images.length; i++){
|
||||||
var image=$(reply_images[i]);
|
var image=$(reply_images[i]);
|
||||||
|
@ -89,7 +91,7 @@
|
||||||
image.wrap(element);
|
image.wrap(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#reply_content_<%= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
|
$('#reply_content_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});*/
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% if topic %>
|
<% if topic %>
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
}
|
}
|
||||||
$(function() {
|
$(function() {
|
||||||
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%");
|
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%");
|
||||||
|
/*showNormalImage('activity_description_<%#= topic.id %>');
|
||||||
|
showNormalImage('reply_content_<%#= topic.id %>');*/
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
||||||
|
@ -73,7 +75,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="memo-content upload_img break_word" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
|
<div class="memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
|
||||||
<%= @topic.content.html_safe%>
|
<%= @topic.content.html_safe%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -97,6 +99,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="" id="reply_div_<%= @topic.id %>">
|
<div class="" id="reply_div_<%= @topic.id %>">
|
||||||
<% @replies.each_with_index do |reply,i| %>
|
<% @replies.each_with_index do |reply,i| %>
|
||||||
|
|
||||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||||
<div class="homepagePostReplyPortrait">
|
<div class="homepagePostReplyPortrait">
|
||||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||||
|
@ -109,7 +112,9 @@
|
||||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyContent upload_img break_word"><%= reply.content.html_safe%></div>
|
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
||||||
|
<%= reply.content.html_safe%>
|
||||||
|
</div>
|
||||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||||
<%= format_time(reply.created_on) %>
|
<%= format_time(reply.created_on) %>
|
||||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||||
|
|
|
@ -952,3 +952,16 @@ $(document).ready(function () {
|
||||||
$("pre").addClass("break_word");
|
$("pre").addClass("break_word");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//点击图片即显示大图
|
||||||
|
function showNormalImage(id) {
|
||||||
|
var description_images=$('div#'+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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#'+id+' a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue