Merge branch 'master' of git://factorcode.org/git/factor

db4
Joe Groff 2009-02-11 14:07:00 -06:00
commit a2e261e2a8
19 changed files with 77 additions and 8 deletions

View File

@ -0,0 +1,6 @@
IN: html
USING: help.markup help.syntax strings ;
HELP: simple-page
{ $values { "title" string } { "head" "XML data" } { "body" "XML data" } }
{ $description "Constructs a simple XHTML page with a " { $snippet "head" } " and " { $snippet "body" } " tag. The given XML data is spliced into the two child tags, and a title is also added to the head tag." } ;

View File

@ -15,7 +15,7 @@ IN: html
</head> </head>
<body><-></body> <body><-></body>
</html> </html>
XML> ; inline XML> ;
: render-error ( message -- xml ) : render-error ( message -- xml )
[XML <span class="error"><-></span> XML] ; [XML <span class="error"><-></span> XML] ;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Doug Coleman. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel grouping fry sequences combinators USING: accessors kernel grouping fry sequences combinators
images.bitmap math ; math ;
IN: images.backend IN: images.backend
SINGLETONS: BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR ; SINGLETONS: BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR ;

View File

@ -1,10 +1,9 @@
! Copyright (C) 2009 Doug Coleman. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators io io.encodings.binary io.files USING: accessors combinators io io.encodings.binary io.files kernel
kernel pack endian constructors sequences arrays pack endian constructors sequences arrays math.order math.parser
sorting.slots math.order math.parser prettyprint classes prettyprint classes io.binary assocs math math.bitwise byte-arrays
io.binary assocs math math.bitwise byte-arrays grouping grouping images.backend ;
images.backend ;
IN: images.tiff IN: images.tiff
TUPLE: tiff-image < image ; TUPLE: tiff-image < image ;

View File

@ -7,6 +7,9 @@ ARTICLE: "quotations" "Quotations"
$nl $nl
"Concretely, a quotation is an immutable sequence of objects, some of which may be words, together with a block of machine code which may be executed to achieve the effect of evaluating the quotation. The machine code is generated by a fast non-optimizing quotation compiler which is always running and is transparent to the developer." "Concretely, a quotation is an immutable sequence of objects, some of which may be words, together with a block of machine code which may be executed to achieve the effect of evaluating the quotation. The machine code is generated by a fast non-optimizing quotation compiler which is always running and is transparent to the developer."
$nl $nl
"Quotations form a class of objects, however in most cases, methods should dispatch on " { $link callable } " instead, so that " { $link curry } " and " { $link compose } " values can participate."
{ $subsection quotation }
{ $subsection quotation? }
"Quotations evaluate sequentially from beginning to end. Literals are pushed on the stack and words are executed. Details can be found in " { $link "evaluator" } "." "Quotations evaluate sequentially from beginning to end. Literals are pushed on the stack and words are executed. Details can be found in " { $link "evaluator" } "."
$nl $nl
"Quotation literal syntax is documented in " { $link "syntax-quots" } "." "Quotation literal syntax is documented in " { $link "syntax-quots" } "."

View File

@ -106,7 +106,8 @@ todo "TODO"
: <todo-list> ( -- responder ) : <todo-list> ( -- responder )
todo-list new-dispatcher todo-list new-dispatcher
<list-action> "" add-responder <list-action> "list" add-responder
URL" /list" <redirect-responder> "" add-responder
<view-action> "view" add-responder <view-action> "view" add-responder
<new-action> "new" add-responder <new-action> "new" add-responder
<edit-action> "edit" add-responder <edit-action> "edit" add-responder
@ -115,3 +116,52 @@ todo "TODO"
{ todo-list "todo" } >>template { todo-list "todo" } >>template
<protected> <protected>
"view your todo list" >>description ; "view your todo list" >>description ;
USING: furnace.auth.features.registration
furnace.auth.features.edit-profile
furnace.auth.features.deactivate-user
db.sqlite
furnace.alloy
io.servers.connection
io.sockets.secure ;
: <login-config> ( responder -- responder' )
"Todo list" <login-realm>
"Todo list" >>name
allow-registration
allow-edit-profile
allow-deactivation ;
: todo-db ( -- db ) "resource:todo.db" <sqlite-db> ;
: init-todo-db ( -- )
todo-db [
init-furnace-tables
todo ensure-table
] with-db ;
: <todo-secure-config> ( -- config )
! This is only suitable for testing!
<secure-config>
"resource:basis/openssl/test/dh1024.pem" >>dh-file
"resource:basis/openssl/test/server.pem" >>key-file
"password" >>password ;
: <todo-app> ( -- responder )
init-todo-db
<todo-list>
<login-config>
todo-db <alloy> ;
: <todo-website-server> ( -- threaded-server )
<http-server>
<todo-secure-config> >>secure-config
8080 >>insecure
8431 >>secure ;
: run-todo ( -- )
<todo-app> main-responder set-global
todo-db start-expiring
<todo-website-server> start-server ;
MAIN: run-todo

View File

@ -2,7 +2,14 @@
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0"> <t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
<html>
<t:style t:include="resource:extra/webapps/todo/todo.css" /> <t:style t:include="resource:extra/webapps/todo/todo.css" />
<t:style t:include="resource:extra/websites/concatenative/page.css" />
<head><t:write-title/><t:write-style/></head>
<body>
<div class="navbar"> <div class="navbar">
<t:a t:href="$todo-list/list">List Items</t:a> <t:a t:href="$todo-list/list">List Items</t:a>
@ -19,4 +26,8 @@
<t:call-next-template /> <t:call-next-template />
</body>
</html>
</t:chloe> </t:chloe>