diff -r e8235b2789fc -r d14bfd477c44 web/data/cubicweb.compat.js --- a/web/data/cubicweb.compat.js Thu Apr 08 13:38:36 2010 +0200 +++ b/web/data/cubicweb.compat.js Thu Apr 08 14:11:49 2010 +0200 @@ -6,22 +6,26 @@ } } +// XXX looks completely unused (candidate for removal) function getElementsByTagAndClassName(tag, klass, root) { root = root || document; // FIXME root is not used in this compat implementation return jQuery(tag + '.' + klass); } +/* jQUery flattens arrays returned by the mapping function: + >>> y = ['a:b:c', 'd:e'] + >>> jQuery.map(y, function(y) { return y.split(':');}) + ["a", "b", "c", "d", "e"] + // where one would expect: + [ ["a", "b", "c"], ["d", "e"] ] + XXX why not the same argument order as $.map and forEach ? +*/ function map(func, array) { - // XXX jQUery tends to simplify lists with only one element : - // >>> y = ['a:b:c'] - // >>> jQuery.map(y, function(y) { return y.split(':');}) - // ["a", "b", "c"] - // where I would expect : - // [ ["a", "b", "c"] ] - // return jQuery.map(array, func); var result = []; - for (var i=0,length=array.length;i