chiark / gitweb /
Minimum trade value feature
[ypp-sc-tools.db-test.git] / yarrg / web / qtextstring
index 93eb1249633499550bf763cb7c33ccd1c735115b..ebf344d0dc7d7eb47fd5b1859a726409ebd43568 100644 (file)
 $qa => $m->caller_args(1)->{'qa'}
 $dbh
 $thingstring
+$checkkind => undef
 $emsgstore
 $onresults
-$prefix => 'ts';
-$helpref => undef;
+$boxopts => 'size=10'
+$prefix => 'ts'
+$helpref => undef
 </%args>
 <%perl>
 my $stringval= $qa->{$thingstring};
 $stringval='' if !defined $stringval;
+$checkkind= $thingstring if !defined $checkkind;
 
 my $p= $prefix.'_';
-my $checker= $m->fetch_comp("check_${thingstring}");
+my $checker= $m->fetch_comp("check_${checkkind}");
 my $significant_nonempty= $checker->attr_exists('significant_nonempty');
 
 </%perl>
 
 <&| script &>
 <%$p%>uri= "qtextstringcheck?format=application/json&ctype=text/xml"
-               + "&what=<% $thingstring %>"
+               + "&what=<% $checkkind %>"
                + "&ocean=<% uri_escape($qa->{Ocean}) %>";
 
 <%$p%>timeout=false;
@@ -97,18 +100,25 @@ function <%$p%>Ready() {
 register_onload(<%$p%>Needed);
 </&script>
 
-<input type="text" <% $m->content %>
+% 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>" : '' %>
+ ><% defined($helpref) ? "<a href=\"docs#$helpref\">[?]</a>" : '' %><%
+     $m->content %>
 <br>
 <div id="<%$p%>results">&nbsp;</div><br>
+% } else {
+<kbd><strong><% $stringval |h %></strong></kbd>
+<br>
+<br>
+% }
 
 <%perl>
 if ($significant_nonempty || length $thingstring) {
        my ($emsg,$canonstring,@results)= $m->comp('qtextstringcheck',
-               what => $thingstring,
+               what => $checkkind,
                ocean => $qa->{Ocean},
                string => $stringval,
                format => 'return'