furnace.recaptcha: cleanups

db4
Slava Pestov 2010-03-11 19:13:57 +13:00
parent 7744559a46
commit 1f593f6bbc
3 changed files with 16 additions and 16 deletions

View File

@ -9,7 +9,7 @@ IN: furnace.recaptcha.example
TUPLE: recaptcha-app < dispatcher recaptcha ; TUPLE: recaptcha-app < dispatcher recaptcha ;
: recaptcha-db ( -- obj ) "recaptcha-example" <sqlite-db> ; : recaptcha-db ( -- obj ) "resource:recaptcha-example" <sqlite-db> ;
: <recaptcha-challenge> ( -- obj ) : <recaptcha-challenge> ( -- obj )
<page-action> <page-action>

View File

@ -26,7 +26,7 @@ ARTICLE: "recaptcha-example" "Recaptcha example"
{ "Wrap the responder in a " { $link <recaptcha> } } { "Wrap the responder in a " { $link <recaptcha> } }
{ "Wrap the responder in a " { $link <conversations> } " if it is not already" } { "Wrap the responder in a " { $link <conversations> } " if it is not already" }
{ "Ensure that there is a database connected, with the " { $link <alloy> } " word" } { "Ensure that there is a database connected, with the " { $link <alloy> } " word" }
{ "Start a conversation to move values between requests" } { "Start a conversation with " { $link begin-conversation } " to move values between requests" }
{ "Add a handler calling " { $link validate-recaptcha } " in the " { $slot "submit" } " of the " { $link page-action } } { "Add a handler calling " { $link validate-recaptcha } " in the " { $slot "submit" } " of the " { $link page-action } }
{ "Pass the conversation from your submit action using " { $link <continue-conversation> } } { "Pass the conversation from your submit action using " { $link <continue-conversation> } }
{ "Put the chloe tag " { $snippet "<recaptcha/>" } " inside a form tag in the template for your " { $link page-action } } { "Put the chloe tag " { $snippet "<recaptcha/>" } " inside a form tag in the template for your " { $link page-action } }

View File

@ -23,7 +23,8 @@ M: recaptcha call-responder*
: (render-recaptcha) ( private-key -- xml ) : (render-recaptcha) ( private-key -- xml )
dup dup
[XML <script type="text/javascript" [XML
<script type="text/javascript"
src=<->> src=<->>
</script> </script>
@ -38,8 +39,7 @@ M: recaptcha call-responder*
XML] ; XML] ;
: recaptcha-url ( secure? -- ? ) : recaptcha-url ( secure? -- ? )
[ "https://api.recaptcha.net/challenge" ] "https://api.recaptcha.net/challenge" "http://api.recaptcha.net/challenge" ?
[ "http://api.recaptcha.net/challenge" ] if
recaptcha-error cget [ "?error=" glue ] when* >url ; recaptcha-error cget [ "?error=" glue ] when* >url ;
: render-recaptcha ( -- xml ) : render-recaptcha ( -- xml )