Merge branch 'master' into new_ui
commit
a998925994
|
@ -1,7 +1,8 @@
|
||||||
USING: html.templates html.templates.chloe
|
USING: html.templates html.templates.chloe
|
||||||
tools.test io.streams.string kernel sequences ascii boxes
|
tools.test io.streams.string kernel sequences ascii boxes
|
||||||
namespaces xml html.components html.forms
|
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
|
IN: html.templates.chloe.tests
|
||||||
|
|
||||||
: run-template
|
: run-template
|
||||||
|
@ -163,3 +164,9 @@ TUPLE: person first-name last-name ;
|
||||||
"test12" test-template call-template
|
"test12" test-template call-template
|
||||||
] run-template
|
] run-template
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"test13" test-template call-template
|
||||||
|
] run-template
|
||||||
|
] [ error>> T{ unknown-chloe-tag f "this-tag-does-not-exist" } = ] must-fail-with
|
||||||
|
|
|
@ -76,10 +76,13 @@ DEFER: compile-element
|
||||||
[ drop tag-stack get pop* ]
|
[ drop tag-stack get pop* ]
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
|
ERROR: unknown-chloe-tag tag ;
|
||||||
|
|
||||||
: compile-chloe-tag ( tag -- )
|
: compile-chloe-tag ( tag -- )
|
||||||
! "Unknown chloe tag: " prepend throw
|
|
||||||
dup main>> dup tags get at
|
dup main>> dup tags get at
|
||||||
[ curry assert-depth ] [ 2drop ] ?if ;
|
[ curry assert-depth ]
|
||||||
|
[ unknown-chloe-tag ]
|
||||||
|
?if ;
|
||||||
|
|
||||||
: compile-element ( element -- )
|
: compile-element ( element -- )
|
||||||
{
|
{
|
||||||
|
|
|
@ -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>
|
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! 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
|
http.server.dispatchers html.forms validators urls accessors
|
||||||
math ;
|
math ;
|
||||||
IN: webapps.calculator
|
IN: webapps.calculator
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
|
<html>
|
||||||
<head> <title>Calculator</title> </head>
|
<head> <title>Calculator</title> </head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -24,5 +25,6 @@
|
||||||
|
|
||||||
</t:form>
|
</t:form>
|
||||||
</body>
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
</t:chloe>
|
</t:chloe>
|
||||||
|
|
|
@ -2,12 +2,13 @@
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<h1><t:label t:name="counter" /></h1>
|
<h1><t:label t:name="counter" /></h1>
|
||||||
|
|
||||||
<t:button t:action="$counter-app/inc">++</t:button>
|
<t:button t:action="$counter-app/inc">++</t:button>
|
||||||
<t:button t:action="$counter-app/dec">--</t:button>
|
<t:button t:action="$counter-app/dec">--</t:button>
|
||||||
</body>
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
</t:chloe>
|
</t:chloe>
|
||||||
|
|
Loading…
Reference in New Issue