incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r962464 - /incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
Date Fri, 09 Jul 2010 09:31:54 GMT
Author: rhirsch
Date: Fri Jul  9 09:31:53 2010
New Revision: 962464

URL: http://svn.apache.org/viewvc?rev=962464&view=rev
Log:
[ESME-234] Reply doesn't work when message contains chars that must be encoded
Problem was links in message

Modified:
    incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Modified: incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=962464&r1=962463&r2=962464&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Fri Jul  9
09:31:53 2010
@@ -48,8 +48,15 @@ String.prototype.replaceAll = function( 
 	// Return the updated string with ALL the target strings
 	// replaced out with the new substring.
 	return( strText );
-}
+} 
+
 
+function strip(html)
+{
+   var tmp = document.createElement("DIV");
+   tmp.innerHTML = html;
+   return tmp.textContent||tmp.innerText;
+}
 
 function displayMessages(msgArray, elementId)
 {
@@ -150,12 +157,14 @@ function displayMessages(msgArray, eleme
                                      'clearResend("resend_' + id + '")');
       }
 
-      var tempStr = msgBody.replaceAll ("'", "ZZZ$%$");
+
+      var tempStr = strip(msgBody).replaceAll ("'", "ZZZ$%$");
+      
+      var myReplyMsg = tempStr.replaceAll ("ZZZ$%$", "\\'");   
       
-      var myReplyMsg = tempStr.replaceAll ("ZZZ$%$", "\\'");
           
       newMsg.find('#reply').attr('href',
-        "javascript:setReplyTo(" + id + ", '"+ escape(myReplyMsg) + "'," + msgPoolId + ",
'" + msgAuthor.nickname + "')");
+        "javascript:setReplyTo(" + id + ", '"+ myReplyMsg + "'," + msgPoolId + ", '" + msgAuthor.nickname
+ "')");
       var conversation = newMsg.find('#conversation');
       if (msgConversation != 0) {
         conversation.attr('href', 



Mime
View raw message