X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matitaB%2Fmatita%2Fmatitaweb.js;h=81995bb803ed42d8579f05d07d773ca252844b62;hb=bb9c48af6f729b0616a0fc5f1fd9037d4c3f2c89;hp=d4dbe63e80c6f07616177aa3e046c4969452fb29;hpb=12991316d484b80d149891d2a150e5703282c60c;p=helm.git diff --git a/matitaB/matita/matitaweb.js b/matitaB/matita/matitaweb.js index d4dbe63e8..81995bb80 100644 --- a/matitaB/matita/matitaweb.js +++ b/matitaB/matita/matitaweb.js @@ -11,31 +11,42 @@ var advanceButton; var retractButton; var cursorButton; var bottomButton; +var dialogBox; +var dialogTitle; +var dialogContent; var metasenv = ""; 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"); - logarea = document.getElementById("logarea"); - advanceButton = document.getElementById("advance"); - retractButton = document.getElementById("retract"); - cursorButton = document.getElementById("cursor"); - bottomButton = document.getElementById("bottom"); - - // hide sequent view at start - hideSequent(); + if (readCookie("session") == null) { + window.location = "/login.html" + } else { + 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"); + logarea = document.getElementById("logarea"); + advanceButton = document.getElementById("advance"); + retractButton = document.getElementById("retract"); + cursorButton = document.getElementById("cursor"); + bottomButton = document.getElementById("bottom"); + dialogBox = document.getElementById("dialogBox"); + dialogTitle = document.getElementById("dialogTitle"); + dialogContent = document.getElementById("dialogContent"); + + // hide sequent view at start + hideSequent(); + } } function debug(txt) { - logarea.innerHTML = txt + "\n" + logarea.innerHTML; + // internet explorer (v.9) doesn't work with innerHTML + logarea.innerText = txt + "\n" + logarea.innerText; } function listhd(l) @@ -436,6 +447,47 @@ function openFile() callServer("open",processor,"file=" + escape(filename.value)); } +function showLibrary() +{ + var req = null; + // 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; + + if(rs == 4) + { + stat = req.status; + stxt = req.statusText; + if(stat == 200) + { + debug(req.responseText); + showDialog("