! Copyright (c) 2007 Chris Double.\r
! See http://factorcode.org/license.txt for BSD license.\r
USING: accessors quotations assocs kernel splitting\r
-base64 html.elements io combinators http.server\r
-furnace.auth.providers furnace.auth.login\r
-http sequences ;\r
+base64 html.elements io combinators sequences\r
+http http.server.filters http.server.responses http.server\r
+furnace.auth.providers furnace.auth.login ;\r
IN: furnace.auth.basic\r
\r
TUPLE: basic-auth < filter-responder realm provider ;\r
IN: html.components.tests
USING: tools.test kernel io.streams.string
io.streams.null accessors inspector html.streams
-html.components namespaces ;
+html.elements html.components namespaces ;
[ ] [ blank-values ] unit-test
USING: assocs html.parser kernel math sequences strings ascii
arrays shuffle unicode.case namespaces splitting http
-sequences.lib accessors io combinators http.client ;
+sequences.lib accessors io combinators http.client urls ;
IN: html.parser.analyzer
TUPLE: link attributes clickable ;
USING: html.templates html.templates.chloe
tools.test io.streams.string kernel sequences ascii boxes
namespaces xml html.components
-splitting unicode.categories ;
+splitting unicode.categories furnace ;
IN: html.templates.chloe.tests
[ f ] [ f parse-query-attr ] unit-test
[
[
"test2" test-template call-template
- ] [ "test3" test-template ] with-boilerplate
+ ] "test3" test-template with-boilerplate
] run-template
] unit-test
[ "<table><tr><td>RBaxter</td><td>Unknown</td></tr><tr><td>Doug</td><td>Coleman</td></tr></table>" ] [
[
- "test9" test-template call-template
+ "test8" test-template call-template
] run-template [ blank? not ] filter
] unit-test
[ "<a name=\"1\">Hello</a>" ] [
[
- "test10" test-template call-template
+ "test9" test-template call-template
] run-template
] unit-test
! See http://factorcode.org/license.txt for BSD license.\r
USING: namespaces kernel assocs io.files io.streams.duplex\r
combinators arrays io.launcher io http.server.static http.server\r
-http accessors sequences strings math.parser fry ;\r
+http accessors sequences strings math.parser fry urls ;\r
IN: http.server.cgi\r
\r
: post? request get method>> "POST" = ;\r
"" "REMOTE_IDENT" set\r
\r
request get method>> "REQUEST_METHOD" set\r
- request get query>> assoc>query "QUERY_STRING" set\r
+ request get url>> query>> assoc>query "QUERY_STRING" set\r
request get "cookie" header "HTTP_COOKIE" set \r
\r
request get "user-agent" header "HTTP_USER_AGENT" set\r
url>> path>> split-path main-responder get call-responder ;
: do-request ( request -- response )
- [
+ '[
+ ,
[ init-request ]
[ log-request ]
[ dispatch-request ] tri
USING: math kernel accessors http.server http.server.dispatchers
-furnace.actions furnace.sessions
+furnace furnace.actions furnace.sessions
html.components html.templates.chloe
fry urls ;
IN: webapps.counter
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
- <t:bind t:name="old">
- <t:title>Diff: <t:label t:name="title" /></t:title>
- </t:bind>
+ <t:title>Diff: <t:label t:name="title" /></t:title>
<table>
<tr>
<t:comparison t:name="diff" />
- <div class="navbar">
- <t:a t:href="$wiki/view" t:query="title">Latest</t:a>
- | <t:a t:href="$wiki/revisions" t:query="title">Revisions</t:a>
- | <t:a t:href="$wiki/edit" t:query="title">Edit</t:a>
- | <t:button t:action="$wiki/delete" t:for="title" class="link-button link">Delete</t:button>
- </div>
-
</t:chloe>
</t:form>
- <div class="navbar">
- <t:a t:href="$wiki/view" t:query="title">Latest</t:a>
- | <t:a t:href="$wiki/revisions" t:query="title">Revisions</t:a>
- | <t:a t:href="$wiki/edit" t:query="title">Edit</t:a>
- | <t:button t:action="$wiki/delete" t:for="title" class="link-button link">Delete</t:button>
- </div>
</t:chloe>
--- /dev/null
+<?xml version='1.0' ?>
+
+<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
+
+ <t:call-next-template />
+
+ <div class="navbar">
+ <t:a t:href="$wiki/view" t:query="title">Latest</t:a>
+ | <t:a t:href="$wiki/revisions" t:query="title">Revisions</t:a>
+ | <t:a t:href="$wiki/edit" t:query="title">Edit</t:a>
+ | <t:button t:action="$wiki/delete" t:for="title" class="link-button link">Delete</t:button>
+ </div>
+
+</t:chloe>
<input type="submit" value="View" />
</form>
- <br/>
-
- <div class="navbar">
- <t:a t:href="$wiki/view" t:query="title">Latest</t:a>
- | <t:a t:href="$wiki/revisions" t:query="title">Revisions</t:a>
- | <t:a t:href="$wiki/edit" t:query="title">Edit</t:a>
- | <t:button t:action="$wiki/delete" t:for="title" class="link-button link">Delete</t:button>
- </div>
-
</t:chloe>
<p><em>This revision created on <t:label t:name="date" /> by <t:a t:href="user-edits" t:query="author"><t:label t:name="author" /></t:a>.</em></p>
- <div class="navbar">
- <t:a t:href="$wiki/view" t:query="title">Latest</t:a>
- | <t:a t:href="$wiki/revisions" t:query="title">Revisions</t:a>
- | <t:a t:href="$wiki/edit" t:query="title">Edit</t:a>
- | <t:button t:action="$wiki/delete" t:for="title" class="link-button link">Delete</t:button>
- </div>
-
</t:chloe>
: <wiki> ( -- dispatcher )
wiki new-dispatcher
- <main-article-action> "" add-responder
- <view-article-action> "view" add-responder
- <view-revision-action> "revision" add-responder
- <list-revisions-action> "revisions" add-responder
+ <dispatcher>
+ <main-article-action> "" add-responder
+ <view-article-action> "view" add-responder
+ <view-revision-action> "revision" add-responder
+ <list-revisions-action> "revisions" add-responder
+ <diff-action> "diff" add-responder
+ <edit-article-action> { } <protected> "edit" add-responder
+ <boilerplate>
+ { wiki "page-common" } >>template
+ >>default
<rollback-action> "rollback" add-responder
<user-edits-action> "user-edits" add-responder
- <diff-action> "diff" add-responder
<list-articles-action> "articles" add-responder
<list-changes-action> "changes" add-responder
- <edit-article-action> { } <protected> "edit" add-responder
<delete-action> { } <protected> "delete" add-responder
<boilerplate>
{ wiki "wiki-common" } >>template ;
! Copyright (C) 2007, 2008 Slava Pestov.\r
! See http://factorcode.org/license.txt for BSD license.\r
USING: io io.files io.encodings.utf8 namespaces http.server\r
-http.server.static http xmode.code2html kernel sequences\r
-accessors fry ;\r
+http.server.responses http.server.static http xmode.code2html\r
+kernel sequences accessors fry ;\r
IN: xmode.code2html.responder\r
\r
: <sources> ( root -- responder )\r
! Copyright (C) 2006 Daniel Ehrenberg, Walton Chan
! See http://factorcode.org/license.txt for BSD license.
USING: http.client xml xml.utilities kernel sequences
-namespaces http math.parser help math.order locals accessors ;
+namespaces http math.parser help math.order locals
+urls accessors ;
IN: yahoo
TUPLE: result title url summary ;