Merge branch 'master' of git://factorcode.org/git/factor
commit
a2e261e2a8
|
@ -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." } ;
|
|
@ -15,7 +15,7 @@ IN: html
|
|||
</head>
|
||||
<body><-></body>
|
||||
</html>
|
||||
XML> ; inline
|
||||
XML> ;
|
||||
|
||||
: render-error ( message -- xml )
|
||||
[XML <span class="error"><-></span> XML] ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors kernel grouping fry sequences combinators
|
||||
images.bitmap math ;
|
||||
math ;
|
||||
IN: images.backend
|
||||
|
||||
SINGLETONS: BGR RGB BGRA RGBA ABGR ARGB RGBX XRGB BGRX XBGR ;
|
|
@ -1,10 +1,9 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors combinators io io.encodings.binary io.files
|
||||
kernel pack endian constructors sequences arrays
|
||||
sorting.slots math.order math.parser prettyprint classes
|
||||
io.binary assocs math math.bitwise byte-arrays grouping
|
||||
images.backend ;
|
||||
USING: accessors combinators io io.encodings.binary io.files kernel
|
||||
pack endian constructors sequences arrays math.order math.parser
|
||||
prettyprint classes io.binary assocs math math.bitwise byte-arrays
|
||||
grouping images.backend ;
|
||||
IN: images.tiff
|
||||
|
||||
TUPLE: tiff-image < image ;
|
|
@ -7,6 +7,9 @@ ARTICLE: "quotations" "Quotations"
|
|||
$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."
|
||||
$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" } "."
|
||||
$nl
|
||||
"Quotation literal syntax is documented in " { $link "syntax-quots" } "."
|
||||
|
|
|
@ -106,7 +106,8 @@ todo "TODO"
|
|||
|
||||
: <todo-list> ( -- responder )
|
||||
todo-list new-dispatcher
|
||||
<list-action> "" add-responder
|
||||
<list-action> "list" add-responder
|
||||
URL" /list" <redirect-responder> "" add-responder
|
||||
<view-action> "view" add-responder
|
||||
<new-action> "new" add-responder
|
||||
<edit-action> "edit" add-responder
|
||||
|
@ -115,3 +116,52 @@ todo "TODO"
|
|||
{ todo-list "todo" } >>template
|
||||
<protected>
|
||||
"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
|
||||
|
|
|
@ -2,7 +2,14 @@
|
|||
|
||||
<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/websites/concatenative/page.css" />
|
||||
|
||||
<head><t:write-title/><t:write-style/></head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar">
|
||||
<t:a t:href="$todo-list/list">List Items</t:a>
|
||||
|
@ -19,4 +26,8 @@
|
|||
|
||||
<t:call-next-template />
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
</t:chloe>
|
||||
|
|
Loading…
Reference in New Issue