New implementation of pp2limit method based on visitFields.
authorMike Taylor <mike@indexdata.com>
Wed, 23 Apr 2014 16:44:20 +0000 (17:44 +0100)
committerMike Taylor <mike@indexdata.com>
Wed, 23 Apr 2014 16:44:20 +0000 (17:44 +0100)
src/mkws-filter.js

index 4d600cc..03e07e1 100644 (file)
@@ -95,7 +95,13 @@ function filterSet(team) {
     };
 
     that.NEW_pp2limit = function(initial) {
-       return that.OLD_pp2limit(initial);
+       var res = initial || "";
+
+       that.visitFields(function(field, value) {
+           if (res) res += ",";
+           res += field + "=" + value.replace(/[\\|,]/g, '\\$&');
+       });
+       return res;
     }
 
     return that;