Index: Tools/GardeningServer/scripts/base.js |
diff --git a/Tools/GardeningServer/scripts/base.js b/Tools/GardeningServer/scripts/base.js |
index 9ae9ec71b1fec5ba8341e5b91dfb2fb35996beae..ec0391333649668b18a460f1c0cb30ed4745fc44 100644 |
--- a/Tools/GardeningServer/scripts/base.js |
+++ b/Tools/GardeningServer/scripts/base.js |
@@ -62,7 +62,7 @@ base.uniquifyArray = function(array) |
{ |
var seen = {}; |
var result = []; |
- $.each(array, function(index, value) { |
+ array.forEach(function(value) { |
if (seen[value]) |
return; |
seen[value] = true; |
@@ -261,4 +261,16 @@ base.underscoredBuilderName = function(builderName) |
return builderName.replace(/[ .()]/g, '_'); |
} |
+base.queryParam = function(params) |
+{ |
+ var result = [] |
+ Object.keys(params, function(key, value) { |
+ result.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); |
+ }); |
+ // FIXME: Remove the conversion of space to plus. This is just here |
+ // to remain compatible with jQuery.param, but there's no reason to |
+ // deviate from the built-in encodeURIComponent behavior. |
+ return result.join('&').replace(/%20/g, '+'); |
+} |
+ |
})(); |