+ _addFilter: function(key, op, value)
+ {
+ console.log("add "+value);
+ var self = this;
+ values = Array();
+ // get the previous list of values for this key, ex: [ple,nitos]
+ // remove the previous filter
+ network_filter = $.grep(this.filters, function(x) {
+ return x[0] == "network_hrn";
+ });
+ if(network_filter.length > 0){
+ $.each(network_filter, function(i,f){
+ values = f[2];
+ manifold.raise_event(self.options.query_uuid, FILTER_REMOVED, [key, op, values]);
+ });
+ }
+ // Add the new value to list of values, ex: wilab
+ values.push(value);
+
+ // Update the filter with the new list of values, ex: [ple,nitos,wilab]
+ manifold.raise_event(this.options.query_uuid, FILTER_ADDED, [key, op, values]);
+ },
+ _removeFilter: function(key, op, value)
+ {
+ console.log("remove "+value);
+ var self = this;
+ values = Array();
+ // get the previous list of values for this key, ex: [ple,nitos,wilab]
+ // remove the previous filter
+ network_filter = $.grep(this.filters, function(x) {
+ return x[0] == "network_hrn";
+ });
+ if(network_filter.length > 0){
+ $.each(network_filter, function(i,f){
+ values = f[2];
+ manifold.raise_event(self.options.query_uuid, FILTER_REMOVED, [key, op, values]);
+ });
+ }
+
+ // remove the value from the list of values, ex: wilab
+ values = $.grep(values, function(x) {
+ return x != value;
+ });
+ if(values.length>0){
+ // Update the filter with the new list of values, ex: [ple,nitos]
+ manifold.raise_event(this.options.query_uuid, FILTER_ADDED, [key, op, values]);
+ }
+ }