Commit 37dd3b15 authored by Pietro Abate's avatar 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 cd3a0d46
......@@ -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);
......
......@@ -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>
......
......@@ -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 ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment