Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
260c7cd0
Commit
260c7cd0
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-12-28 01:42:06 by afrisch] Demo
Original author: afrisch Date: 2004-12-28 01:45:05+00:00
parent
114d4ec2
Changes
3
Hide whitespace changes
Inline
Side-by-side
web/demo.js
View file @
260c7cd0
...
...
@@ -4,6 +4,13 @@ function clearreq(pr)
function
show_result
(
pr
,
res
)
{
document
.
getElementById
(
pr
+
"
res
"
).
innerHTML
=
res
;
}
function
clearres
(
pr
)
{
show_result
(
pr
,
""
);
}
function
defreq
(
pr
)
{
document
.
getElementById
(
pr
+
"
req
"
).
value
=
document
.
getElementById
(
pr
+
"
def
"
).
value
;
}
function
submit
(
pr
)
{
var
xmlhttp
=
new
XMLHttpRequest
();
xmlhttp
.
open
(
"
POST
"
,
"
/cgi-bin/evaluator
"
,
true
);
...
...
web/demo.xml
View file @
260c7cd0
...
...
@@ -3,9 +3,15 @@
<title>
CDuce demo
</title>
<box
title=
"Integers"
link=
"ints"
>
<p>
Let's begin with integers, arithmetic, and, obviously, the
factorial function.
</p>
<demo>
let x = 2;;
let a = x * 10;;
<include-verbatim
file=
"examples/integers.cd"
/>
</demo>
</box>
...
...
web/site.cd
View file @
260c7cd0
...
...
@@ -261,10 +261,12 @@ let demo(no : Int)(txt : String) : H:Flow =
<
tr
>
[
<
td
style
=
"
width:50%
"
>
[
(
button
"
Evaluate
"
(
"
submit('
"
@
n
@
"
');
"
))
(
button
"
Clear
"
(
"
clearreq('
"
@
n
@
"
';)
"
))
(
button
"
Clear
"
(
"
clearreq('
"
@
n
@
"
');
"
))
(
button
"
Default
"
(
"
defreq('
"
@
n
@
"
');
"
))
]
<
td
style
=
"
width:50%
"
>
[
(
button
"
Clear
"
(
"
show_result('
"
@
n
@
"
','');
"
))
<
input
id
=
(
n
@
"
def
"
)
type
=
"
hidden
"
value
=
txt
>
[]
(
button
"
Clear
"
(
"
clearres('
"
@
n
@
"
');
"
))
]
]
<
tr
>
[
<
td
>
[
<
textarea
id
=
(
n
@
"
req
"
)
cols
=
"
60
"
rows
=
"
25
"
>
txt
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment