Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1739)

Unified Diff: Tools/GardeningServer/scripts/base.js

Issue 359283003: Remove usages of jquery and add sugar.js from garden-o-matic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove jquery script from ct-sheriff-o-matic Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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, '+');
+}
+
})();

Powered by Google App Engine
This is Rietveld 408576698