my ($pct,$str);
if (!m/\S/) {
- $str= '';
+ return ('[no losses]', undef);
} elsif (m/^(\d{1,2}(?:\.\d{0,5})?)\%$/) {
$pct= $1 * 1.0;
$str= sprintf("%g%%", $1);
expected_error("Cannot understand loss per league ".escerrq($_).".");
}
-return ("$str per league", $pct);
+return ("$str [per league]", $pct);
</%perl>
</%method>
register_onload(<%$p%>Needed);
</&script>
-% if (!printable($m)) {
-<input type="text" <% $boxopts %>
- id="<% $thingstring %>" name="<% $thingstring %>"
- onchange="<%$p%>Needed();" onkeyup="<%$p%>Later();"
- value="<% $stringval |h %>"
- ><% defined($helpref) ? "<a href=\"docs#$helpref\">[?]</a>" : '' %><%
- $m->content %>
-<br>
-<div id="<%$p%>results"> </div><br>
-% } else {
-<kbd><strong><% $stringval |h %></strong></kbd>
-<br>
-<br>
-% }
-
<%perl>
+my ($canonstring);
+
if ($significant_nonempty || length $thingstring) {
- my ($emsg,$canonstring,@results)= $m->comp('qtextstringcheck',
+ my ($emsg,@results);
+ ($emsg,$canonstring,@results)= $m->comp('qtextstringcheck',
what => $checkkind,
ocean => $qa->{Ocean},
string => $stringval,
$onresults->(@results);
}
</%perl>
+
+% if (!printable($m)) {
+<input type="text" <% $boxopts %>
+ id="<% $thingstring %>" name="<% $thingstring %>"
+ onchange="<%$p%>Needed();" onkeyup="<%$p%>Later();"
+ value="<% $stringval |h %>"
+ ><% defined($helpref) ? "<a href=\"docs#$helpref\">[?]</a>" : '' %><%
+ $m->content %>
+<br>
+<div id="<%$p%>results"> </div><br>
+% } else {
+<kbd><strong><% $canonstring |h %></strong></kbd>
+<br>
+<br>
+% }