From: Thierry Parmentelat Date: Thu, 21 Mar 2013 07:30:26 +0000 (+0100) Subject: cosmetic X-Git-Tag: myslice-django-0.1-2~41 X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=commitdiff_plain;h=a0c7080d9eb960318465386d23b8da2b9f92d978 cosmetic --- diff --git a/manifold/js/manifold-query.js b/manifold/js/manifold-query.js index 7578c0ae..7d885ae7 100644 --- a/manifold/js/manifold-query.js +++ b/manifold/js/manifold-query.js @@ -29,15 +29,15 @@ DELETE FROM subject WHERE filter INSERT INTO subject VALUES(field=value) -------------------------------------------------------------*/ - this.__repr = function (q) { + this.__repr = function () { res = "ManyfoldQuery "; - res += " id=" + q.query_uuid; - res += " a=" + q.action; - res += " s=" + q.subject; - res += " ts=" + q.timestamp; - res += " flts=" + q.filters; - res += " flds=" + q.fields; - res += " prms=" + q.params; + res += " id=" + this.query_uuid; + res += " a=" + this.action; + res += " s=" + this.subject; + res += " ts=" + this.timestamp; + res += " flts=" + this.filters; + res += " flds=" + this.fields; + res += " prms=" + this.params; return res; } @@ -61,7 +61,8 @@ INSERT INTO subject VALUES(field=value) } this.filters.push(new Array(key, op, value)); } - this.remove_filter = function (key,op,value){ + + this.remove_filter = function (key,op,value) { // if operator is null then remove all occurences of this key if(!op){ this.filters = jQuery.grep(this.filters, function(val, i) { @@ -71,9 +72,9 @@ INSERT INTO subject VALUES(field=value) this.filters = jQuery.grep(this.filters, function(val, i) {return (val[0] != key || val[1] != op);}); } } + // FIXME These functions computing diff's between queries are meant to be shared - this.diff_fields = function (otherQuery) - { + this.diff_fields = function (otherQuery) { var f1 = this.fields; var f2 = otherQuery.fields; @@ -83,10 +84,10 @@ INSERT INTO subject VALUES(field=value) var removed = jQuery.grep(f1, function (x) { return jQuery.inArray(x, f2) == -1 }); return {'added':added, 'removed':removed}; - } + } + // FIXME Modify filter to filters - this.diff_filter = function (otherQuery) - { + this.diff_filter = function (otherQuery) { var f1 = this.filters; var f2 = otherQuery.filters; diff --git a/manifold/js/manifold.js b/manifold/js/manifold.js index 0ac331b8..5765195a 100644 --- a/manifold/js/manifold.js +++ b/manifold/js/manifold.js @@ -5,7 +5,7 @@ function debug_dict_keys (msg, o) { console.log ("debug_dict_keys: " + msg + " keys= " + keys); } function debug_dict (msg, o) { - for (var k in o) console.log ("debug_dict_keys: " + msg + " [" + k + "]=" + o[k]); + for (var k in o) console.log ("debug_dict: " + msg + " [" + k + "]=" + o[k]); } function debug_value (msg, value) { console.log ("debug_value: " + msg + " " + value);