New pp2filter implementation that uses visitTargets.
authorMike Taylor <mike@indexdata.com>
Wed, 23 Apr 2014 16:39:50 +0000 (17:39 +0100)
committerMike Taylor <mike@indexdata.com>
Wed, 23 Apr 2014 16:39:50 +0000 (17:39 +0100)
src/mkws-filter.js

index 353fce5..02ce422 100644 (file)
@@ -84,7 +84,19 @@ function filterSet(team) {
     };
 
     that.NEW_pp2filter = function() {
-       return that.OLD_pp2filter();
+       var res = "";
+
+       that.visitTargets(function(id, name) {
+           if (res) res += ",";
+           if (id.match(/^[a-z:]+[=~]/)) {
+               m_team.log("filter '" + id + "' already begins with SETTING OP");
+           } else {
+               id = 'pz:id=' + id;
+           }
+           res += id;
+       });
+
+       return res;
     };
 
     that.pp2limit = function(initial) {