[pLog-svn] r1390 - plog/trunk/js/ui

mark at devel.plogworld.net mark at devel.plogworld.net
Wed Mar 9 17:02:03 GMT 2005


Author: mark
Date: 2005-03-09 17:02:02 +0000 (Wed, 09 Mar 2005)
New Revision: 1390

Modified:
   plog/trunk/js/ui/common.js
Log:
Fixed bug http://bugs.plogworld.net/view.php?id=320. Add a globel variable blogLocale. And now getPostEditFormElements will check the variable. If charset = UTF-8, it will use encodeURIComponent to encode the URI. If charset = Others (ISO-8859-1/-2,Others), it will use escape to encode the URI.

Modified: plog/trunk/js/ui/common.js
===================================================================
--- plog/trunk/js/ui/common.js	2005-03-09 16:59:30 UTC (rev 1389)
+++ plog/trunk/js/ui/common.js	2005-03-09 17:02:02 UTC (rev 1390)
@@ -234,14 +234,26 @@
 				}
 			}
 			else if( itemName == "postText" && htmlAreaEnabled ) {
-				formData = formData + itemName + "=" + encodeURIComponent(postTextEditor.getHTML()) + "&";
+			    if ( blogLocale == "UTF-8" ) {
+				    formData = formData + itemName + "=" + encodeURIComponent(postTextEditor.getHTML()) + "&";
+				} else {
+				    formData = formData + itemName + "=" + escape(postTextEditor.getHTML()) + "&";
+				}
 			}
 			else if( itemName == "postExtendedText" && htmlAreaEnabled ) {
-				formData = formData + itemName + "=" + encodeURIComponent(postExtendedTextEditor.getHTML()) + "&";
+				if ( blogLocale == "UTF-8" ) {
+				    formData = formData + itemName + "=" + encodeURIComponent(postExtendedTextEditor.getHTML()) + "&";
+			    } else {
+				    formData = formData + itemName + "=" + escape(postExtendedTextEditor.getHTML()) + "&";
+                }
 			}
 			else {
 				// for all other elements, normal handling
-				formData = formData + itemName + "=" + encodeURIComponent(itemValue) + "&";		
+				if ( blogLocale == "UTF-8" ) {
+				    formData = formData + itemName + "=" + encodeURIComponent(itemValue) + "&";
+				} else {
+				    formData = formData + itemName + "=" + escape(itemValue) + "&";
+			    }
 			}
 		}
     }	




More information about the pLog-svn mailing list