文本框格式问题

This commit is contained in:
Tim 2016-02-02 10:08:04 +08:00
parent d092891b2a
commit 619144224e
3 changed files with 24 additions and 9 deletions

View File

@ -150,9 +150,14 @@
<script type="text/javascript">
$(function(){
/*var postContent = $("#intro_content_<%#= @document.id%>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#intro_content_<%#= @document.id%>").html(postContent);*/
$("#intro_content_<%= @document.id%> p,#intro_content_<%= @document.id%> span,#intro_content_<%= @document.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);
});
});
function expand_reply(container, btnid) {
var target = $(container);

View File

@ -50,9 +50,14 @@
</div>
<script type="text/javascript">
/*var postContent = $("#intro_content_<%#= document.id%>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#intro_content_<%#= document.id%>").html(postContent);*/
$("#intro_content_<%= @document.id%> p,#intro_content_<%= @document.id%> span,#intro_content_<%= @document.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);
});
function expand_reply(container, btnid) {
var target = $(container);
var btn = $(btnid);

View File

@ -5,9 +5,14 @@
</div>
<script type="text/javascript">
$(function(){
/*var postContent = $("#intro_content_<%#= user_activity_id%>").html();
postContent = postContent.replace(/&nbsp;/g," ");
$("#intro_content_<%#= user_activity_id%>").html(postContent);*/
$("#intro_content_<%= user_activity_id%> p,#intro_content_<%= user_activity_id%> span,#intro_content_<%= user_activity_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(<%=user_activity_id %>);
});
</script>