帖子、博客、通知、文章详情页面的单词折行

This commit is contained in:
cxt 2016-01-22 18:33:43 +08:00
parent 0b2184c3d9
commit 6ae7da99be
11 changed files with 82 additions and 23 deletions

View File

@ -94,7 +94,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
<div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @article.content.html_safe%>
</div>
<div class="cl"></div>
@ -209,3 +209,10 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @article.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @article.id %>").html(postContent);
});
</script>

View File

@ -94,7 +94,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
<div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @article.content.html_safe%>
</div>
<div class="cl"></div>
@ -215,3 +215,10 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @article.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @article.id %>").html(postContent);
});
</script>

View File

@ -74,7 +74,7 @@
<%= link_to @memo.author.name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div>
<div class="memo-content" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content" id="message_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%>
</div>
<div class="cl"></div>
@ -137,3 +137,10 @@
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @memo.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @memo.id %>").html(postContent);
});
</script>

View File

@ -80,7 +80,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div>
<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;" >
<div class="homepagePostIntro 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%>
</div>
<div class="cl"></div>
@ -169,3 +169,10 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>

View File

@ -109,7 +109,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div>
<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;" >
<div class="homepagePostIntro 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%>
</div>
<div class="cl"></div>
@ -198,3 +198,10 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>

View File

@ -135,7 +135,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
<div class="cl"></div>
<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;" >
<div class="homepagePostIntro 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%>
</div>
<div class="cl"></div>
@ -225,3 +225,10 @@
</div>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
});
</script>

View File

@ -85,7 +85,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%>
</div>
<div class="cl"></div>
@ -182,3 +182,10 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
});
</script>

View File

@ -75,7 +75,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%>
</div>
<div class="cl"></div>
@ -172,3 +172,10 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
});
</script>

View File

@ -85,7 +85,7 @@
</div>
<div class="postDetailDate mb5"><%= format_time( @news.created_on)%></div>
<div class="cl"></div>
<div class="memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @news.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @news.description.html_safe%>
</div>
<div class="cl"></div>
@ -182,3 +182,10 @@
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
});
</script>

View File

@ -20,10 +20,12 @@
</div>
<div class="cl"></div>
<% unless document.content.blank? %>
<div class="homepagePostIntro" style="width:640px;" id="intro_content_<%= document.id%>">
<%= document.content.html_safe %>
</div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>document.id, :content=>document.content} %>
<% end %>
<div class="cl"></div>
<div id="intro_content_show_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= document.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => document} %>
</div>
@ -133,9 +135,6 @@
<script type="text/javascript">
function expand_reply(container, btnid) {
var postContent = $("#intro_content_<%= document.id%>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#intro_content_<%= document.id%>").html(postContent);
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {

View File

@ -129,6 +129,3 @@
</div>
</div>
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>