chiark / gitweb /
Add [?] links to help for advanced strings
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 10 Sep 2009 17:10:48 +0000 (18:10 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 10 Sep 2009 17:10:48 +0000 (18:10 +0100)
yarrg/web/docs
yarrg/web/qtextstring
yarrg/web/query_route

index 6ed64d1e223f0cb2c7300160eacac3c7c989ee8f..6f754bff46e258472de8c5d413723ab7fa8eb117 100755 (executable)
@@ -101,7 +101,7 @@ After getting the results, you can untick various trades individually,
 and select `Update' to get a new plan.  The unticked trades will be
 excluded from the voyage plan (if any) and also from the totals.
 
-<h3>Vessel capacity</h3>
+<h3><a name="capacity">Vessel capacity</a></h3>
 
 If you don't specify a vessel or a vessel capacity, the trading plan
 will not take into account the fact that your voyage will be on a ship
@@ -139,7 +139,7 @@ all the preceding terms.  The first term may be a ship name or
 abbrevation instead.  If the first term specifies only one of mass or
 volume, all the subsequent terms may only adjust that same value.
 
-<h3>Expected losses</h3>
+<h3><a name="losses">Expected losses</a></h3>
 
 In theory if you were guaranteed to have a trouble-free voyage it
 would be worth trading goods at very low margins.  However, in
index 639e9abf25bc3a3db06a091f776138e856c32092..d57f863490fda37637957afd0e988be1e1c4f14d 100644 (file)
@@ -42,6 +42,7 @@ $thingstring
 $emsgstore
 $perresult
 $prefix => 'ts';
+$helpref => undef;
 </%args>
 <%perl>
 my $stringval= $qa->{$thingstring};
@@ -97,7 +98,7 @@ register_onload(<%$p%>Needed);
  id="<% $thingstring %>" name="<% $thingstring %>"
  onchange="<%$p%>Needed();" onkeyup="<%$p%>Later();"
  value="<% $stringval |h %>"
- >
+ ><% defined($helpref) ? "<a href=\"docs#$helpref\">[?]</a>" : '' %>
 <br>
 <div id="<%$p%>results">&nbsp;</div><br>
 
index ed9fa4406c70ba1fd7aaaaad7dab4fe02f89a50e..9a6ca0829114c622552209991c1fb6e1901094f4 100644 (file)
@@ -97,6 +97,7 @@ Enter route (islands, or archipelagoes, separated by |s or commas;
 Vessel or capacity:
 <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'cs',
     thingstring => 'capacitystring', emsgstore => \$emsg,
+    helpref => 'capacity',
     perresult => sub {
         ($max_mass,$max_volume) = @_;
     }
@@ -113,9 +114,10 @@ Expected losses:
 
 <&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'll',
     thingstring => 'lossperleague', emsgstore => \$emsg,
+    helpref => 'losses',
     perresult => sub { ($lossperleaguepct)= @_; }
  &>
- size=10
+ size=9
 </&>
 
 </table>