Merge branch 'master' into new_ui

db4
Slava Pestov 2009-01-12 16:18:23 -06:00
commit a998925994
6 changed files with 26 additions and 6 deletions

View File

@ -1,7 +1,8 @@
USING: html.templates html.templates.chloe
tools.test io.streams.string kernel sequences ascii boxes
namespaces xml html.components html.forms
splitting unicode.categories furnace accessors ;
splitting unicode.categories furnace accessors
html.templates.chloe.compiler ;
IN: html.templates.chloe.tests
: run-template
@ -163,3 +164,9 @@ TUPLE: person first-name last-name ;
"test12" test-template call-template
] run-template
] unit-test
[
[
"test13" test-template call-template
] run-template
] [ error>> T{ unknown-chloe-tag f "this-tag-does-not-exist" } = ] must-fail-with

View File

@ -76,10 +76,13 @@ DEFER: compile-element
[ drop tag-stack get pop* ]
} cleave ;
ERROR: unknown-chloe-tag tag ;
: compile-chloe-tag ( tag -- )
! "Unknown chloe tag: " prepend throw
dup main>> dup tags get at
[ curry assert-depth ] [ 2drop ] ?if ;
[ curry assert-depth ]
[ unknown-chloe-tag ]
?if ;
: compile-element ( element -- )
{

View File

@ -0,0 +1,7 @@
<?xml version='1.0' ?>
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
<t:this-tag-does-not-exist />
</t:chloe>

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Slava Pestov.
! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: furnace.actions furnace.redirection
USING: furnace furnace.actions furnace.redirection
http.server.dispatchers html.forms validators urls accessors
math ;
IN: webapps.calculator

View File

@ -2,6 +2,7 @@
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
<html>
<head> <title>Calculator</title> </head>
<body>
@ -24,5 +25,6 @@
</t:form>
</body>
</html>
</t:chloe>

View File

@ -2,12 +2,13 @@
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
<html>
<body>
<h1><t:label t:name="counter" /></h1>
<t:button t:action="$counter-app/inc">++</t:button>
<t:button t:action="$counter-app/dec">--</t:button>
</body>
</html>
</t:chloe>