Commit a4d04072 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-08 16:02:38 by cvscast] - added "Clear" and "Revert changes" buttons

- remember submitted CDuce code even when no errors are found

Original author: cvscast
Date: 2003-05-08 16:02:38+00:00
parent d903c25a
......@@ -26,7 +26,8 @@ let fatal_error title s =
(* Configuration *)
let session_dirs = [ "/home/beppe/sessions"; "/home/frisch/sessions"; "/users/formel/cduce/sessions"]
let session_dirs = [ "/home/beppe/sessions"; "/home/frisch/sessions";
"/users/formel/cduce/sessions"; "/home/zack/cduce/sessions" ]
let session_dir =
try List.find Sys.file_exists session_dirs
with Not_found -> fatal_error "Internal error"
......@@ -99,8 +100,8 @@ let html_form p content =
p "
<div class=\"box\">
<h2>Input</h2>
<form method=\"post\" action=\"/cgi-bin/cduce\">
<p><input type=\"submit\" name=\"exec\" value=\"Submit to CDuce\"/> ";
<form name=\"main\" method=\"post\" action=\"/~zack/webiface.cgi\">
<p><input type=\"submit\" name=\"exec\" value=\"Submit to CDuce\"/>" ;
if !persistant then
p ||| "
<input type=\"submit\" name=\"dump\" value=\"Show current environment\"/>
......@@ -109,9 +110,13 @@ let html_form p content =
||| "\"/>" ||= ()
else
p "<input type=\"submit\" name=\"open\" value=\"Initiate session\"/>
<small>
The session mode remembers CDuce definitions across requests.
</small>
<small>
(The session mode remembers CDuce definitions across requests)
</small>";
p
"<br />
<input type=\"button\" value=\"Clear\" onClick=\"main.prog.value=''\"/>
<input type=\"reset\" value=\"Revert changes\"/>
";
p ||| "</p><p><textarea name=\"prog\" cols=\"80\" rows=\"25\">"
......@@ -258,7 +263,8 @@ let main (cgi : Netcgi.std_activation) =
let res = Format.flush_str_formatter () in
p "<div class=\"box\"><h2>Results</h2><pre>";
cut (cgi # output # output_char) 80 res; p "</pre></div>";
if ok then (dialog ""; store_state ()) else dialog src;
dialog src;
if ok then store_state ()
in
let dump src =
......
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