browser: search browser platform
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 7 Dec 2010 22:37:28 +0000 (23:37 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 15 Dec 2010 21:40:44 +0000 (22:40 +0100)
browser.plp
searchlocal.js

index 8b08b86..f6de595 100644 (file)
@@ -119,7 +119,7 @@ my $header = join('',
                sprintf('<th colspan="%d" class="%s" title="%s">%s',
                        scalar @{ $versions{$_} },
                        join(' ', map {"b-a-$_"} grep {$_}
-                               $_, $caniuse->{agents}->{$_}->{prefix},
+                               $_, @{ $caniuse->{agents}->{$_} }{'prefix', 'type'},
                        ),
                        join(' ',
                                sprintf('%.1f%%', sum(values %{ $canihas->{$_} })),
index 8c33f8d..752a3ee 100644 (file)
@@ -29,20 +29,16 @@ function filtercell(el, set, action) {
 }
 
 function filtercols(table, match, action) {
-       var matchloc;
+       var matchloc = [];
        for (var y = 0; y < table.rows.length; y++) {
                var loc = 0;
                for (var x = 0; x < table.rows[y].cells.length; x++) {
                        var cell = table.rows[y].cells[x];
-                       if (y == 0) {
-                               if (match(cell)) {
-                                       if (!matchloc) matchloc = [loc];
-                                       matchloc[1] = loc + cell.colSpan;
-                                       filtercell(table.children.item(x), true, action); // colgroup
-                               }
+                       if (y == 0 && match(cell)) {
+                               for (var i = loc; i < loc + cell.colSpan; i++) matchloc[i] = true;
+                               filtercell(table.children.item(x), true, action); // colgroup
                        }
-                       var keep = matchloc && loc >= matchloc[0] && loc < matchloc[1];
-                       filtercell(cell, keep, action);
+                       filtercell(cell, matchloc[loc], action);
                        loc += cell.colSpan;
                }
        }