X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Flookup;h=365ed58129407277626411e60f96b8bc8fe2ba1e;hb=3dbb2f33eae3a509123ffc99e48e35f858a8292a;hp=cfffd146af3548c87efcccde44ea0b2db3090c8a;hpb=3f99b04acd8cf6080069b542206f9f3de049f58a;p=ypp-sc-tools.db-test.git
diff --git a/yarrg/web/lookup b/yarrg/web/lookup
index cfffd14..365ed58 100755
--- a/yarrg/web/lookup
+++ b/yarrg/web/lookup
@@ -57,6 +57,8 @@ my %styles;
Before => 'Query: ',
Values => [ [ 'route', 'Trades for route' ],
[ 'commod', 'Prices for commodity' ],
+ [ 'offers', 'Offers at location' ],
+ [ 'routesearch', 'Find profitable route' ],
[ 'age', 'Data age' ] ]
}, { Name => 'BuySell',
Before => '',
@@ -74,10 +76,16 @@ my %styles;
QuerySpecific => 1,
}, { Name => 'ShowStalls',
Before => '',
- Values => [ [ 0, 'Show amount at each price' ],
+ Values => [ [ 0, 'Show total quantity at each price' ],
[ 1, 'Show individual stalls' ],
],
QuerySpecific => 1,
+ }, { Name => 'RouteSearchType',
+ Before => 'Type of routes to search for: ',
+ Values => [ [ 0, 'Open-ended' ],
+ [ 1, 'Circular' ],
+ ],
+ QuerySpecific => 1,
});
foreach my $var (@vars) {
@@ -118,13 +126,39 @@ $ours
% }
%method>
-
<% ucfirst $ahtml{Query} %> - YARRG
+<% ucfirst $ahtml{Query} %> - YARRG
+
+<&| script &>
+ function register_onload(f) {
+ var previous_onload= window.onload;
+ window.onload= function() {
+ if (previous_onload) previous_onload();
+ f();
+ };
+ }
+&script>
+
+% if (!printable($m)) {
+
YARRG -
Yet Another Revenue Research Gatherer
|
+
introduction
+|
documentation
+|
+
development
+% }
<%perl>
foreach my $var (@vars) {
@@ -135,7 +169,9 @@ foreach my $var (@vars) {
foreach my $var (keys %ARGS) {
next unless $var =~
- m/^(?: (?:route|commod)string |
+ m/^(?: (?:route|commod|capacity|capital|island)string |
+ lossperleague | distance |
+ commodid |
islandid \d |
archipelago \d |
debug |
@@ -154,6 +190,7 @@ my $quri= sub {
my $prselector_core= sub {
my ($var)= @_;
+ return if printable($m);
my $name= $var->{Name};
my $lname= lc $var->{Name};
my $delim= $var->{Before};
@@ -209,7 +246,9 @@ my $results_head_done=0;
my $someresults= sub {
return if $results_head_done;
$results_head_done=1;
- print "\n
Results
\n";
+ my ($h)= @_;
+ $h= 'Results' if !$h;
+ print "\n
$h
\n";
};
%perl>
@@ -217,10 +256,14 @@ my $someresults= sub {
$debug => 0
%args>
+% if (!printable($m)) {
+
+% }
<& "query_$styles{Query}", %baseqf, %queryqf, %styles,
quri => $quri, dbh => $dbh,
+ baseqf => \%baseqf, queryqf => \%queryqf, allargs => \%ARGS,
prselector => $prselector,
someresults => $someresults,
emsgokorprint => sub {
@@ -232,15 +275,14 @@ $debug => 0
}
&>
-
-
%#---------- debugging and epilogue ----------
% if ($debug) {
-
+
% }
<&| script &>