1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel accessors http.server.dispatchers
4 http.server.static furnace.actions furnace.redirection urls
5 validators locals io.files html.forms help.html ;
8 TUPLE: help-webapp < dispatcher ;
10 :: <search-action> ( help-dir -- action )
12 { help-webapp "search" } >>template
16 { "search" [ 1 v-min-length 50 v-max-length v-one-line ] }
20 "search" value article-apropos "articles" set-value
21 "search" value word-apropos "words" set-value
22 "search" value vocab-apropos "vocabs" set-value
25 { help-webapp "search" } <chloe-content>
28 : <main-action> ( -- action )
30 { help-webapp "help" } >>template ;
32 : <help-webapp> ( help-dir -- webapp )
33 help-webapp new-dispatcher
34 <main-action> "" add-responder
35 over <search-action> "search" add-responder
36 swap <static> "content" add-responder ;