<html>
-<head>
-</head>
-
-<body>
-<script language="JavaScript">
-var locked;
-var unlocked;
-var workarea;
-var scriptcell;
-var goalcell;
-var goals;
-var goalview;
-var filename;
-var status;
-
-function initialize()
-{
- locked = document.getElementById("locked");
- unlocked = document.getElementById("unlocked");
- workarea = document.getElementById("workarea");
- scriptcell = document.getElementById("scriptcell");
- goalcell = document.getElementById("goalcell");
- goals = document.getElementById("goals");
- goalview = document.getElementById("goalview");
- filename = document.getElementById("filename");
- status = document.getElementById("status");
-}
-
-function debug(txt)
-{
- var status = document.getElementById("status");
- status.innerHTML = txt + "\n" + status.innerHTML;
-}
-
-function listhd(l)
-{
- ar = l.split("#");
- debug("hd of '" + l + "' = '" + ar[0] + "'");
- return (ar[0]);
-}
-
-function listtl(l)
-{
- i = l.indexOf("#");
- tl = l.substr(i+1);
- debug("tl of '" + l + "' = '" + tl + "'");
- return (tl);
-}
-
-function listcons(x,l)
-{
- debug("cons '" + x + "' on '" + l + "'");
- return (x + "#" + l);
-}
-
-function listnil()
-{
- return ("");
-}
-
-function is_nil(l)
-{
- return (l == "");
-}
-
-function fold_left (f,acc,l)
-{
- if (is_nil(l))
- { debug("'" + l + "' is fold end");
- return (acc); }
- else
- { debug("'" + l + "' is fold cons");
- return(fold_left (f,f(acc,(listhd(l))),listtl(l))); }
-}
-
-function listiter (f,l)
-{
- if (is_nil(l))
- { debug("'" + l + "' is nil");
- return;
- }
- else
- {
- debug("'" + l + "' is not nil");
- f(listhd(l));
- listiter(f,listtl(l));
- }
-}
-
-function listmap (f,l)
-{
- debug("listmap on " + l);
- if (is_nil(l))
- { debug("returning listnil");
- return(listnil());
- }
- else
- { debug("cons f(hd) map(f,tl)");
- return(f(listhd(l)) + "#" + listmap(f,listtl(l)));
- }
-}
-
-var statements = listnil();
-
-var goalarray;
-var metalist = listnil();
-
-function pairmap (f,p)
-{
- debug("pairmap of '" + p + "'");
- ar = p.split("|");
- return (f(ar[0],ar[1]));
-}
-
-function tripletmap (f,p)
-{
- debug("tripletmap of '" + p + "'");
- ar = p.split("|");
- return (f(ar[0],ar[1],ar[2]));
-}
-
-function fst (p)
-{
- debug("fst");
- return (pairmap (function (a,b) { return (a); }, p));
-}
-
-function p13 (p)
-{
- debug("p13");
- return (tripletmap (function (a,b,c) { return (a); }, p));
-}
-
-function p23 (p)
-{
- debug("p23");
- return (tripletmap (function (a,b,c) { return (b); }, p));
-}
-
-function p33 (p)
-{
- debug("f33");
- return (tripletmap (function (a,b,c) { return (c); }, p));
-}
-
-function populate_goalarray(txt)
-{
- debug("populate with '" + txt + "'");
- goalarray = new Array();
- metalist = listnil();
- var tmp_goallist = "";
- listiter (function(item)
- {
- debug ("item is '" + item + "'");
- tripletmap (function(a,ahtml,b) {
- debug ("found meta n. " + a);
- debug ("found goal\nBEGIN" + unescape(b) + "\nEND");
- goalarray[a] = unescape(b);
- tmp_goallist = " <A href=\"javascript:switch_goal(" + a + ")\">" + unescape(ahtml) + "</A>" + tmp_goallist;
- metalist = listcons(a,metalist);
- debug ("goalarray[\"" + a + "\"] = " + goalarray[a]);
- },item);
- }, txt);
- // metalist = listmap (p13,txt);
- document.getElementById("goals").innerHTML = tmp_goallist;
- debug("new metalist is '" + metalist + "'");
- if (is_nil(metalist)) {
- switch_goal();
- }
- else {
- switch_goal(listhd(metalist));
- }
-}
-function switch_goal(meta)
-{
- goalview = document.getElementById("goalview");
- if (typeof meta == "undefined") {
- goalview.innerHTML = "";
- }
- else {
- debug("switch_goal " + meta + "\n" + goalarray[meta]);
- goalview.innerHTML = "<B>Goal ?" + meta + ":</B>\n\n" + goalarray[meta];
- }
-}
-
-String.prototype.unescapeHTML = function()
-{
- var patt1 = /<br(\/|)>/gi;
- var patt2 = /</gi;
- var patt3 = />/gi;
- var result = this;
- result = result.replace(patt1,"\n");
- result = result.replace(patt2,"<");
- result = result.replace(patt3,">");
- return (unescape(result));
-}
-
-function pause()
-{
- var advanceButton = document.getElementById("advance");
- var retractButton = document.getElementById("retract");
- advanceButton.disabled = true;
- retractButton.disabled = true;
-}
-
-function resume()
-{
- var advanceButton = document.getElementById("advance");
- var retractButton = document.getElementById("retract");
- advanceButton.disabled = false;
- retractButton.disabled = false;
-}
-
-function advanceForm1()
-{
- var req = null;
- unlocked = document.getElementById("unlocked");
- locked = document.getElementById("locked");
- goalview = document.getElementById("goalview");
- pause();
- if (window.XMLHttpRequest)
- {
- req = new XMLHttpRequest();
- }
- else if (window.ActiveXObject)
- {
- try {
- req = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e)
- {
- try {
- req = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {}
- }
- }
- req.onreadystatechange = function()
- {
-
- rs = req.readyState;
- stat = req.status;
- stxt = req.statusText;
-
- if(rs == 4)
- {
- if(stat == 200)
- {
- debug("advance: received response\nBEGIN\n" + req.responseText + "\nEND");
- response = req.responseText.split("@");
- len = parseInt(response[0]);
- len0 = unlocked.innerHTML.length;
- unescaped = unlocked.innerHTML.unescapeHTML();
- parsedtxt = unescaped.substr(0,len);
- unparsedtxt = unescaped.substr(len);
- locked.innerHTML = locked.innerHTML + parsedtxt;
- unlocked.innerHTML = unparsedtxt;
- len1 = unlocked.innerHTML.length;
- len = len0 - len1;
- populate_goalarray(response[1]);
- statements = listcons(len,statements);
- unlocked.scrollIntoView(true);
- }
- else
- {
- debug("advance error: returned status code " + req.status + " " + req.statusText + "\n" +
- req.responseText);
- }
- resume();
- }
- };
- req.open("POST", "advance"); // + escape(document.getElementById("unlocked").innerHTML), true);
- req.send(unlocked.innerHTML.unescapeHTML());
-
-}
-
-function retract()
-{
- var req = null;
- unlocked = document.getElementById("unlocked");
- locked = document.getElementById("locked");
- goalview = document.getElementById("goalview");
- if (window.XMLHttpRequest)
- {
- req = new XMLHttpRequest();
- }
- else if (window.ActiveXObject)
- {
- try {
- req = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e)
- {
- try {
- req = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {}
- }
- }
- req.onreadystatechange = function()
- {
-
- rs = req.readyState;
- stat = req.status;
- stxt = req.statusText;
-
- if(rs == 4)
- {
- if(stat == 200)
- {
- debug("retract: received response\nBEGIN\n" + req.responseText + "\nEND");
- response = req.responseText;
- statementlen = parseInt(listhd(statements));
- statements = listtl(statements);
- lockedlen = locked.innerHTML.length - statementlen;
- statement = locked.innerHTML.substr(lockedlen, statementlen);
- locked.innerHTML = locked.innerHTML.substr(0,lockedlen);
- unlocked.innerHTML = statement + unlocked.innerHTML;
- populate_goalarray(response);
- unlocked.scrollIntoView(true);
- }
- else
- {
- debug("retract error: returned status code " + req.status + " " + req.statusText + "\n" +
- req.responseText);
- }
- resume();
- }
- };
- req.open("GET", "retract"); // + escape(document.getElementById("unlocked").innerHTML), true);
- req.send();
-
-}
-
-function openFile()
-{
- unlocked = document.getElementById("unlocked");
- locked = document.getElementById("locked");
- var req = null;
- if (window.XMLHttpRequest)
- {
- req = new XMLHttpRequest();
- }
- else if (window.ActiveXObject)
- {
- try {
- req = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e)
- {
- try {
- req = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {}
- }
- }
- req.onreadystatechange = function()
- {
-
- rs = req.readyState;
- stat = req.status;
- stxt = req.statusText;
-
- if(rs == 4)
- {
- if(stat == 200)
- {
- locked.innerHTML = "";
- unlocked.innerHTML = req.responseText;
- }
- else
- {
- debug("open error: returned status code " + req.status + " " + req.statusText + "\n" +
- req.responseText);
- }
- }
- };
- req.open("GET", "open?file=" + escape(document.getElementById("filename").value), true);
- req.send();
-}
-
-var goalcell;
+<head>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="jquery.tooltip.min.js"></script>
+<script type="text/javascript" src="utf8MacroTable.js"></script>
+<script type="text/javascript" src="matitaweb.js"></script>
+<script type="text/javascript" src="layout.js"></script>
+<link rel="stylesheet" type="text/css" href="matitaweb.css"/>
+<link rel="stylesheet" type="text/css" href="jquery.tooltip.css"/>
-function hideSequent() {
- goalcell = document.getElementById("goalcell");
- goalcell.parentNode.removeChild(goalcell);
- document.getElementById("scriptcell").setAttribute("colspan","2");
-}
+<link href="treeview/xmlTree.css" type="text/css" rel="stylesheet"/>
+<script src="treeview/xmlTree.js" type="text/javascript"></script>
-function showSequent() {
- document.getElementById("scriptcell").setAttribute("colspan","1");
- document.getElementById("workarea").appendChild(goalcell);
-}
+</head>
-function removeElement(id) {
- var element = document.getElementById(id);
- element.parentNode.removeChild(element);
-}
+<body onLoad="initialize();">
+<textarea id="unescape" style="display:none;"></textarea>
+<div id="sandbox" style="display:none;"></div>
+
+<div class="matitaapparea" id="matitaapparea">
+
+<div class="titlebar" id="titlebar">
+ <div class="mainTitle"><H2 id="matitaTitle">Matita - <<Filename>></H2></div>
+ <div class="mainRight" id="matitaLogout"><A id="hlogout" href="/logout.html">Log out</A></div>
+</div>
+
+
+<div class="toparea" id="toparea">
+<div class="navibar">
+ <A href="javascript:advanceForm1()"><IMG class="topimg" src="icons/advance.png"
+ id="advance" alt="Advance"
+ title="Execute one step of the script."></A>
+ <A href="javascript:retract()"><IMG class="topimg" src="icons/retract.png"
+ id="retract" alt="Retract"
+ title="Undo execution of one step of the script."></A>
+ <A href="javascript:gotoTop()"><IMG class="topimg" src="icons/top.png"
+ id="top" alt="Top" title="Undo execution of the whole script."></A>
+ <A href="javascript:gotoPos()"><IMG class="topimg" src="icons/position.png"
+ id="cursor" alt="Play"
+ title="Execute the script until the current position of the cursor."></A>
+ <A href="javascript:gotoBottom()"><IMG class="topimg" src="icons/bottom.png"
+ id="bottom" alt="Bottom" title="Execute the whole script."></A>
+</div>
+<div class="toolbar">
+ <table>
+ <tr>
+ <td>
+ <INPUT type="BUTTON" value="New" id="newbutton" ONCLICK="newDialog()">
+ <INPUT type="BUTTON" value="Open" id="showdialog" ONCLICK="openDialog()">
+ <INPUT type="BUTTON" value="Save" id="savebutton" ONCLICK="saveFile()">
+ <INPUT type="BUTTON" value="Save as" id="saveasbutton" ONCLICK="saveDialog()">
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <INPUT type="BUTTON" value="Upload" id="uploadbutton" ONCLICK="uploadDialog()">
+ <INPUT type="BUTTON" value="Commit" id="commitbutton" ONCLICK="commitAll()">
+ <INPUT type="BUTTON" value="Update" id="updatebutton" ONCLICK="updateAll()">
+ <INPUT type="BUTTON" value="Log" id="logbutton" ONCLICK="showLog()">
+ <INPUT type="BUTTON" value="Del hrefs" id="delintbutton" ONCLICK="strip_interpr()">
+<!-- <INPUT type="BUTTON" value="show sequent" id="showseq" ONCLICK="showSequent()">
+ <INPUT type="BUTTON" value="hide sequent" id="hideseq" ONCLICK="hideSequent()">
+ <INPUT type="BUTTON" value="selection test" id="hideseq" ONCLICK="test()"> -->
+ </td>
+ </tr>
+ </table>
-</script>
+</div>
+<div class="caption"><p><img align="bottom" class="topimg" src="icons/matita-text.png"></p></div>
+</div>
-<table style="table-layout: fixed; width:100%; height:100%; border-spacing: 0px; border-style: none;">
-<tr>
-<td style="padding: 0px; width:67%; border-style: none;">
- <textarea id="unescape" style="display:none;"></textarea>
- <p><INPUT type="BUTTON" value="advance" id="advance" ONCLICK="advanceForm1()">
- <INPUT type="BUTTON" value="go back" id="retract" ONCLICK="retract()">
- <INPUT type="TEXT" id="filename" value=""><INPUT type="BUTTON" value="Open" ONCLICK="openFile()"></p>
- <INPUT type="BUTTON" value="show sequent" id="showseq" ONCLICK="showSequent()">
- <INPUT type="BUTTON" value="hide sequent" id="hideseq" ONCLICK="hideSequent()">
-</td>
-<td style="width:33%;"></td>
-</tr>
-<tr id="workarea" style="height:80%;">
-<td id="scriptcell" style="padding: 0px; border-style: none; padding: 0px;">
+<div class="workarea" id="workarea">
+<div class="scriptarea" id="scriptcell">
<!-- the script -->
<!--
The two DIVs "locked" and "unlocked" MUST be on the same line (since they are
inside a PRE tag, a CR will be reflected in the document presentation)
-->
<div style="width:100%; height:100%; overflow:auto;">
- <pre>
- <div contentEditable="false" id="locked" style="background-color:#bfbfff; display:inline;"></div><div contentEditable="true" id="unlocked" style="display:inline">(* script lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo *)</div></pre></div>
+ <pre><div contentEditable="false" id="locked" style="background-color:#bfbfff; display:inline;"></div><div contentEditable="true" id="unlocked" style="display:inline">(* script *)</div></pre></div>
<!-- the script (end) -->
-</td>
-<td id="goalcell" style="padding: 0px; width:33%; border-style: none;">
+</div>
+<div class="sidearea" id="sidearea">
+ <div class="framed" id="disambcell"></div>
+ <div class="framed" id="goalcell">
<div id="goals"></div>
- <div contentEditable="true" style="border-style:solid; height:100%; width:100%; overflow:auto;">
- <pre id="goalview">lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo lungo </pre>
+ <div class="context">
+ <pre id="goalview"></pre>
</div>
-</td>
+ </div>
+</div>
+</div>
+
+<!-- <div class="bottomarea">
+ <textarea id="logarea" style="width:100%; height:100%"></textarea>
+</div> -->
+
+</div>
+
+<div class="dialog" id="dialogBox" style="display: none;">
+ <div class="diaTitle" id="dialogTitle"></div>
+ <div class="diaClose" id="dialogClose"><H2><A class="butClose" href="javascript:abortDialog('dialogBox')">X</A></H2></div>
+ <INPUT type="button" id="dialogNewdir" value="Create dir..." ONCLICK="createDir()" style="width:150px"><br/>
+ <div class="scroll" id="dialogContent"></div>
+ <INPUT class="diaFile" type="text" id="dialogFilename">
+ <INPUT type="button" id="dialogSelect" value="OK" ONCLICK="dialogOK()" style="width:70px">
+</div>
+
+<div class="upload" id="uploadBox" style="display: none;">
+ <div class="dialogTitle" id="uploadTitle"></div>
+ <div class="diaClose" id="uploadClose"><H2><A class="butClose" href="javascript:abortDialog('uploadBox')">X</A></H2></div>
+ <INPUT class="diaFile" type="file" id="uploadFilename">
+ <INPUT type="button" id="uploadSelect" value="OK" ONCLICK="uploadOK()" style="width:70px">
+</div>
+
+<!-- Mask to cover the whole screen -->
+ <div id="mask"></div>
+
+<!-- Mask to cover the toolbar -->
+ <div id="whitemask"></div>
-<tr style="height:15%">
-<td colspan="2" style="padding: 0px; border-style: none;">
- <textarea id="status" style="width:100%; height:100%"></textarea>
-</td>
-</tr>
-</table>
</body>
- </html>
+</html>