]> matita.cs.unibo.it Git - helm.git/commitdiff
Show library test 1.
authorWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 22 Jun 2011 13:19:44 +0000 (13:19 +0000)
committerWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 22 Jun 2011 13:19:44 +0000 (13:19 +0000)
matitaB/matita/index.html
matitaB/matita/matitadaemon.ml
matitaB/matita/matitaweb.js

index ea4d549510360faf39a22f73923639e79bab74e7..f75482a6e595d1928088226c8acc6483fc359629 100644 (file)
@@ -3,6 +3,10 @@
 <head>
 <script type="text/javascript" src="matitaweb.js"></script>
 <link rel="stylesheet" type="text/css" href="matitaweb.css"/>
+
+<link href="treeview/xmlTree.css" type="text/css" rel="stylesheet"/>
+<script src="treeview/xmlTree.js" type="text/javascript"></script>
+
 </head>
 
 <body onLoad="initialize();">
@@ -23,7 +27,7 @@
           <A href="javascript:gotoBottom()"><IMG src="icons/bottom.png" 
                                                   id="bottom" alt="Bottom" title="Execute the whole script."></A>
        <INPUT type="TEXT" id="filename" value=""><INPUT type="BUTTON" value="Open" ONCLICK="openFile()"></p>
-          <INPUT type="BUTTON" value="show dialog" id="showdialog" ONCLICK="showDialog('Dialog Test')">
+          <INPUT type="BUTTON" value="show dialog" id="showdialog" ONCLICK="showLibrary()">
 <!--      <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()"> -->
@@ -58,7 +62,7 @@
 
 <div class="dialog" id="dialogBox" style="display: none;">
   <div class="diaTitle" id="dialogTitle">Title</div>
-  <div class="scroll"></div>
+  <div class="scroll" id="dialogContent"></div>
 </div>
  </body>
  </html> 
index 72211bf5fcf29d5e5a12432a3b4520545dee5b36..cd7d71dc94033e42ef3cb255213143c4c7102531 100644 (file)
@@ -417,11 +417,13 @@ let viewLib (cgi : Netcgi1_compat.Netcgi_types.cgi_activation) =
     
     let html = MatitaFilesystem.html_of_library uid in
     cgi#out_channel#output_string
-      ("<html><head>\n" ^
+      ((*
+       "<html><head>\n" ^
        "<title>XML Tree Control</title>\n" ^
        "<link href=\"treeview/xmlTree.css\" type=\"text/css\" rel=\"stylesheet\">\n" ^
        "<script src=\"treeview/xmlTree.js\" type=\"text/javascript\"></script>\n" ^
-       "<body>\n" ^ html ^ "\n</body></html>");
+       "<body>\n" ^ *)
+       html (* ^ "\n</body></html>" *) );
   cgi#out_channel#commit_work()
   
 ;;
index 21478e4634c69e13b8ac42fb8f728e943cd8f5ad..a5bf84adcd4610afdd532a35767654ec81434671 100644 (file)
@@ -13,6 +13,7 @@ var cursorButton;
 var bottomButton;
 var dialogBox;
 var dialogTitle;
+var dialogContent;
 var metasenv = "";
 
 function initialize()
@@ -35,6 +36,7 @@ function initialize()
     bottomButton = document.getElementById("bottom");
     dialogBox = document.getElementById("dialogBox");
     dialogTitle = document.getElementById("dialogTitle");
+    dialogContent = document.getElementById("dialogContent");
   
     // hide sequent view at start
     hideSequent();
@@ -445,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("Library",req.responseText);
+                       } 
+               } 
+       };
+       req.open("POST", "viewlib"); // + escape(unlocked.innerHTML), true);
+        req.setRequestHeader("Content-type","application/x-www-form-urlencoded");      
+       req.send();
+  
+}
+
 var goalcell;
 
 function hideSequent() {
@@ -457,10 +500,11 @@ function showSequent() {
   workarea.appendChild(goalcell);
 }
 
-function showDialog(title) {
+function showDialog(title,content) {
 
+  dialogTitle.innerHTML = title;
+  dialogContent.innerHTML = content;
   dialogBox.style.display = "block";
-  dialogTitle.innerHTML = title; 
 }
 
 function removeElement(id) {