[pLog-svn] r4327 - plog/branches/lifetype-1.1.3/js/ui

oscar at devel.lifetype.net oscar at devel.lifetype.net
Thu Nov 23 22:37:02 GMT 2006


Author: oscar
Date: 2006-11-23 22:37:00 +0000 (Thu, 23 Nov 2006)
New Revision: 4327

Modified:
   plog/branches/lifetype-1.1.3/js/ui/common.js
Log:
fixed issue http://bugs.lifetype.net/view.php?id=1127, "save draft" button not working as of LT 1.1.2 (aka Oscar broke the save draft thingie in revision 4145)


Modified: plog/branches/lifetype-1.1.3/js/ui/common.js
===================================================================
--- plog/branches/lifetype-1.1.3/js/ui/common.js	2006-11-22 13:07:05 UTC (rev 4326)
+++ plog/branches/lifetype-1.1.3/js/ui/common.js	2006-11-23 22:37:00 UTC (rev 4327)
@@ -303,3 +303,52 @@
     eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
     if (restore) selObj.selectedIndex=0; 
 }
+
+function getPostEditFormElements( formId )
+{
+	var formData = '';
+	
+	form = document.getElementById( formId );
+	
+	for(i = 0; i < form.elements.length; i++ ) {
+		itemName = form.elements[i].name;
+		itemValue = form.elements[i].value;
+		
+		if( itemName != "op" ) {
+			// we don't want to send more than one "op" parameter... do we?
+			if( itemName == "postCategories[]" ) {
+				// we need to have a special case for this one because it's a list that
+				// allows multiple selection... only using the "value" attribute will
+				// return one of the items and we would like to have them all
+				for (var j = 0; j < form.elements[i].options.length; j++) {
+					if (form.elements[i].options[j].selected) 
+						formData = formData + itemName + "=" + form.elements[i].options[j].value + "&";
+				}
+			}
+			else if( itemName == "postText" && htmlAreaEnabled ) {
+			    if ( blogLocale == "UTF-8" ) {
+				    formData = formData + itemName + "=" + encodeURIComponent(tinyMCE.getContent('postText')) + "&";
+				} else {
+				    formData = formData + itemName + "=" + escape(tinyMCE.getContent('postText')) + "&";
+				}
+			}
+			else if( itemName == "postExtendedText" && htmlAreaEnabled ) {
+				if ( blogLocale == "UTF-8" ) {
+				    formData = formData + itemName + "=" + encodeURIComponent(tinyMCE.getContent('postExtendedText')) + "&";
+			    } else {
+				    formData = formData + itemName + "=" + escape(tinyMCE.getContent('postExtendedText')) + "&";
+                }
+			}
+			else {
+				// for all other elements, normal handling
+				if ( blogLocale == "UTF-8" ) {
+				    formData = formData + itemName + "=" + encodeURIComponent(itemValue) + "&";
+				} else {
+				    formData = formData + itemName + "=" + escape(itemValue) + "&";
+			    }
+			}
+		}
+    }	
+    
+    return formData;
+}



More information about the pLog-svn mailing list