chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WIP routesearch UI: entry done, now must compute results
[ypp-sc-tools.db-test.git]
/
yarrg
/
web
/
qtextstring
diff --git
a/yarrg/web/qtextstring
b/yarrg/web/qtextstring
index 639e9abf25bc3a3db06a091f776138e856c32092..93eb1249633499550bf763cb7c33ccd1c735115b 100644
(file)
--- a/
yarrg/web/qtextstring
+++ b/
yarrg/web/qtextstring
@@
-40,14
+40,18
@@
$qa => $m->caller_args(1)->{'qa'}
$dbh
$thingstring
$emsgstore
$dbh
$thingstring
$emsgstore
-$
perresult
+$
onresults
$prefix => 'ts';
$prefix => 'ts';
+$helpref => undef;
</%args>
<%perl>
my $stringval= $qa->{$thingstring};
$stringval='' if !defined $stringval;
my $p= $prefix.'_';
</%args>
<%perl>
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');
+
</%perl>
<&| script &>
</%perl>
<&| script &>
@@
-57,7
+61,7
@@
my $p= $prefix.'_';
<%$p%>timeout=false;
<%$p%>request=false;
<%$p%>timeout=false;
<%$p%>request=false;
-<%$p%>done=
''
;
+<%$p%>done=
<% $significant_nonempty ? "null" : "''" %>
;
<%$p%>needed='';
function <%$p%>Later(){
window.clearTimeout(<%$p%>timeout);
<%$p%>needed='';
function <%$p%>Later(){
window.clearTimeout(<%$p%>timeout);
@@
-97,13
+101,13
@@
register_onload(<%$p%>Needed);
id="<% $thingstring %>" name="<% $thingstring %>"
onchange="<%$p%>Needed();" onkeyup="<%$p%>Later();"
value="<% $stringval |h %>"
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"> </div><br>
<%perl>
<br>
<div id="<%$p%>results"> </div><br>
<%perl>
-if (length $thingstring) {
- my ($emsg,$canonstring,
$
results)= $m->comp('qtextstringcheck',
+if (
$significant_nonempty ||
length $thingstring) {
+ my ($emsg,$canonstring,
@
results)= $m->comp('qtextstringcheck',
what => $thingstring,
ocean => $qa->{Ocean},
string => $stringval,
what => $thingstring,
ocean => $qa->{Ocean},
string => $stringval,
@@
-113,10
+117,6
@@
if (length $thingstring) {
$$emsgstore='' unless defined $$emsgstore;
$$emsgstore .= $emsg. ' ';
}
$$emsgstore='' unless defined $$emsgstore;
$$emsgstore .= $emsg. ' ';
}
-
- foreach my $entry (@$results) {
-#print STDERR "qts entry perresult \`@$entry'\n";
- $perresult->(@$entry);
- }
+ $onresults->(@results);
}
</%perl>
}
</%perl>