X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fqtextstring;h=84564df55205125a2bbad3deac5611b256167582;hb=59bee7afb77216585b904bd20f17e71005e9778c;hp=6efe368e650dfc396b020f5fa58f5679d3c86426;hpb=c5b3ac45babf8012719dfb7eafd0cfa9d9eddff0;p=ypp-sc-tools.db-test.git diff --git a/yarrg/web/qtextstring b/yarrg/web/qtextstring index 6efe368..84564df 100644 --- a/yarrg/web/qtextstring +++ b/yarrg/web/qtextstring @@ -29,24 +29,27 @@ sponsored by Three Rings. - This Mason component handles `live' analysis of text string entries. + This Mason component handles analysis of text string entries, including + both the AJAX calls from web page javascript and the entry validation + and processing calls from other components. <%args> -$thingstring $qa => $m->caller_args(1)->{'qa'} +$dbh +$thingstring +$emsgstore +$perresult <%perl> my $stringval= $qa->{$thingstring}; $stringval='' if !defined $stringval; -Enter route (islands, or archipelagoes, separated by |s or commas; - abbreviations are OK):
- <&| script &> -ts_uri= "check_<% $thingstring %>?format=json&type=text/xml" +ts_uri= "qtextstringcheck?format=application/json&ctype=text/xml" + + "&what=<% $thingstring %>" + "&ocean=<% uri_escape($qa->{Ocean}) %>"; ts_timeout=false; @@ -84,7 +87,7 @@ function ts_Ready() { ts_request= false; ts_Request(); } -window.onload= ts_Needed; +register_onload(ts_Needed); content %> @@ -94,3 +97,19 @@ window.onload= ts_Needed; >
 

+ +<%perl> +if (length $thingstring) { + my ($emsg,$canonstring,$results)= $m->comp('qtextstringcheck', + what => $thingstring, + ocean => $qa->{Ocean}, + string => $stringval, + format => 'return' + ); + $$emsgstore= $emsg; + + foreach my $entry (@$results) { + $perresult->(@$entry); + } +} +