修改KE贴吧回复添加视频图片不能显示的BUG

This commit is contained in:
yuanke 2016-03-14 18:19:23 +08:00
parent 465a236049
commit 27a2aad3d6
2 changed files with 16 additions and 2 deletions

View File

@ -95,8 +95,21 @@
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher mt-4"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent"><%= reply.content.html_safe%></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= reply.content.html_safe%></div>
</div>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description__<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
description_show_hide(<%= reply.id %>);
});
</script>
<div class="cl"></div>
</div>
<% end %>

View File

@ -1170,7 +1170,8 @@ function getRootPath(){
//获取主机地址,如: http://localhost:8083
var localhostPaht=curWwwPath.substring(0,pos);
//获取带"/"的项目名,如:/uimcardprj
var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
// var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
var projectName="";
return(localhostPaht+projectName);
}