X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yarrg%2Fweb%2Fqtextstring;h=e046c56c3d4f90c7fe4b3034836015ca64e73879;hp=c958915ae33fdfa012c0e9ab639db0636d84b95e;hb=3ce667a2d3fd7c36f60da86bb59071264790e375;hpb=872e647cac241531e4599c8b8b330d8772020253 diff --git a/yarrg/web/qtextstring b/yarrg/web/qtextstring index c958915..e046c56 100644 --- a/yarrg/web/qtextstring +++ b/yarrg/web/qtextstring @@ -49,6 +49,9 @@ my $stringval= $qa->{$thingstring}; $stringval='' if !defined $stringval; my $p= $prefix.'_'; +my $checker= $m->fetch_comp("check_${thingstring}"); +my $significant_nonempty= $checker->attr_exists('significant_nonempty'); + <&| script &> @@ -58,7 +61,7 @@ my $p= $prefix.'_'; <%$p%>timeout=false; <%$p%>request=false; -<%$p%>done=''; +<%$p%>done=<% $significant_nonempty ? "null" : "''" %>; <%$p%>needed=''; function <%$p%>Later(){ window.clearTimeout(<%$p%>timeout); @@ -94,6 +97,7 @@ function <%$p%>Ready() { register_onload(<%$p%>Needed); +% if (!printable($m)) { content %> id="<% $thingstring %>" name="<% $thingstring %>" onchange="<%$p%>Needed();" onkeyup="<%$p%>Later();" @@ -101,9 +105,14 @@ register_onload(<%$p%>Needed); ><% defined($helpref) ? "[?]" : '' %>
 

+% } else { +<% $stringval |h %> +
+
+% } <%perl> -if (length $thingstring) { +if ($significant_nonempty || length $thingstring) { my ($emsg,$canonstring,@results)= $m->comp('qtextstringcheck', what => $thingstring, ocean => $qa->{Ocean},