点击详情页面文本格式调整

This commit is contained in:
Tim 2016-02-02 11:23:17 +08:00
parent 619144224e
commit 105393548b
9 changed files with 891 additions and 846 deletions

View File

@ -211,8 +211,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @article.id %>").html();
$("#message_description_<%= @article.id %> p,#message_description_<%= @article.id %> span,#message_description_<%= @article.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @article.id %>").html(postContent);
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);
});
});
</script>

View File

@ -217,8 +217,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @article.id %>").html();
$("#message_description_<%= @article.id %> p,#message_description_<%= @article.id %> span,#message_description_<%= @article.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @article.id %>").html(postContent);
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);
});
});
</script>

View File

@ -139,8 +139,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @memo.id %>").html();
$("#message_description_<%= @memo.id %> p,#message_description_<%= @memo.id %> span,#message_description_<%= @memo.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @memo.id %>").html(postContent);
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);
});
});
</script>

View File

@ -171,8 +171,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
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);
});
});
</script>

View File

@ -201,8 +201,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
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);
});
});
</script>

View File

@ -227,8 +227,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @topic.id %>").html();
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @topic.id %>").html(postContent);
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);
});
});
</script>

View File

@ -184,8 +184,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
$("#message_description_<%= @news.id %> p,#message_description_<%= @news.id %> span,#message_description_<%= @news.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
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);
});
});
</script>

View File

@ -174,8 +174,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
$("#message_description_<%= @news.id %> p,#message_description_<%= @news.id %> span,#message_description_<%= @news.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
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);
});
});
</script>

View File

@ -184,8 +184,13 @@
</div>
<script type="text/javascript">
$(function(){
var postContent = $("#message_description_<%= @news.id %>").html();
$("#message_description_<%= @news.id %> p,#message_description_<%= @news.id %> span,#message_description_<%= @news.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#message_description_<%= @news.id %>").html(postContent);
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);
});
});
</script>