[Jifty-commit] r4665 - in jifty/trunk: share/web/static/js

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Dec 12 23:20:01 EST 2007


Author: sartak
Date: Wed Dec 12 23:20:00 2007
New Revision: 4665

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/share/web/static/js/prototype.js

Log:
 r48932 at onn:  sartak | 2007-12-12 23:19:51 -0500
 Fix a validation bug where we'd get a lot of
 "extend=function (object) { return Object.extend.apply(this, [this, object]); }"
 arguments. This is because prototype.js overcomplicates form element serialization.


Modified: jifty/trunk/share/web/static/js/prototype.js
==============================================================================
--- jifty/trunk/share/web/static/js/prototype.js	(original)
+++ jifty/trunk/share/web/static/js/prototype.js	Wed Dec 12 23:20:00 2007
@@ -3480,9 +3480,16 @@
     if (!element.disabled && element.name) {
       var value = element.getValue();
       if (value != undefined) {
-        var pair = { };
-        pair[element.name] = value;
-        return Object.toQueryString(pair);
+        // XXX: Jifty: this used to be:
+        //     var pair = { };
+        //     pair[element.name] = value
+        //     return Object.toQueryString(pair)
+        // but that included the pair.extend function, which occurred
+        // a lot whenever we validated an action. since we're only encoding
+        // the key (element.name) and value, do what we actually mean
+        return encodeURIComponent(element.name)
+             + '='
+             + encodeURIComponent(value);
       }
     }
     return '';


More information about the Jifty-commit mailing list