chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New onload arrangments; make tabsort take script argument
[ypp-sc-tools.db-test.git]
/
yarrg
/
web
/
query_commod
diff --git
a/yarrg/web/query_commod
b/yarrg/web/query_commod
index ee4c9f3177aad6eb311bcb11ecb7e2b5234ca173..3c2049ca3a509af276a9c28b9c59dbdf463667f5 100644
(file)
--- a/
yarrg/web/query_commod
+++ b/
yarrg/web/query_commod
@@
-89,8
+89,6
@@
$someresults->();
#---------- actually compute the results and print them ----------
#---------- actually compute the results and print them ----------
-my $onloads= "";
-
foreach my $bs (split /_/, $ARGS{BuySell}) {
$bs =~ m/^(buy|sell)$/ or die;
$bs= $1;
foreach my $bs (split /_/, $ARGS{BuySell}) {
$bs =~ m/^(buy|sell)$/ or die;
$bs= $1;
@@
-137,6
+135,7
@@
foreach my $bs (split /_/, $ARGS{BuySell}) {
% $islands->execute($commodid);
% my $island;
% my %ts_sortkeys;
% $islands->execute($commodid);
% my $island;
% my %ts_sortkeys;
+% my $rowix= 0;
% while ($island= $islands->fetchrow_hashref) {
% my $islandid= $island->{'islandid'};
% $offers->execute($commodid, $islandid);
% while ($island= $islands->fetchrow_hashref) {
% my $islandid= $island->{'islandid'};
% $offers->execute($commodid, $islandid);
@@
-179,7
+178,7
@@
foreach my $bs (split /_/, $ARGS{BuySell}) {
% }
%
% $cqty == $tqty or die "$bs $cqty $tqty $commodid $islandid ";
% }
%
% $cqty == $tqty or die "$bs $cqty $tqty $commodid $islandid ";
-<tr id=<% $rowid %> >
+<tr id=<% $rowid %>
class="<% 'datarow'.($rowix & 1) %>"
>
<td><% $s->[0]= $island->{'archipelago'} |h %>
<td><% $s->[1]= $island->{'islandname'} |h %>
<td><% $stallname |h %>
<td><% $s->[0]= $island->{'archipelago'} |h %>
<td><% $s->[1]= $island->{'islandname'} |h %>
<td><% $stallname |h %>
@@
-192,11
+191,12
@@
foreach my $bs (split /_/, $ARGS{BuySell}) {
% for my $cix (0..$#$s) {
% $ts_sortkeys{$cix}{$rowid}= $s->[$cix];
% }
% for my $cix (0..$#$s) {
% $ts_sortkeys{$cix}{$rowid}= $s->[$cix];
% }
+% $rowix++;
% }
</table>
% }
</table>
-<&
tabsort,
table => "${bs}_table", sortkeys => "${bs}_sortkeys",
- throw => "${bs}_table_thr", cols => [
+<&
| tabsort,
table => "${bs}_table", sortkeys => "${bs}_sortkeys",
+ throw => "${bs}_table_thr",
rowclass => 'datarow',
cols => [
{}, {},
{ DoReverse => 1 },
{ DoReverse => 1, Numeric => 1, MapFn => "ts_Pricemap_${bs}" },
{}, {},
{ DoReverse => 1 },
{ DoReverse => 1, Numeric => 1, MapFn => "ts_Pricemap_${bs}" },
@@
-205,22
+205,13
@@
foreach my $bs (split /_/, $ARGS{BuySell}) {
{ DoReverse => 1, Numeric => 1 },
{ DoReverse => 1, Numeric => 1 },
] &>
{ DoReverse => 1, Numeric => 1 },
{ DoReverse => 1, Numeric => 1 },
] &>
-<&| script &>
<% $bs %>_sortkeys= <% to_json_protecttags(\%ts_sortkeys) %>;
function ts_Pricemap_<% $bs %>(price) {
if (price=='-') { return <% $bs eq 'buy' ? '-1' : '99999999' %>; }
return price;
}
<% $bs %>_sortkeys= <% to_json_protecttags(\%ts_sortkeys) %>;
function ts_Pricemap_<% $bs %>(price) {
if (price=='-') { return <% $bs eq 'buy' ? '-1' : '99999999' %>; }
return price;
}
-</&>
-% $onloads .= " ts_onload__${bs}_table();\n";
+</&tabsort>
<%perl>
}
</%perl>
<%perl>
}
</%perl>
-
-<&| script &>
- function all_onload() {
-<% $onloads %>
- }
- window.onload= all_onload;
-</&>