]> matita.cs.unibo.it Git - helm.git/commitdiff
Matitaweb viewlib, part II.
authorWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 22 Jun 2011 09:33:23 +0000 (09:33 +0000)
committerWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 22 Jun 2011 09:33:23 +0000 (09:33 +0000)
matitaB/matita/matitaFilesystem.ml
matitaB/matita/matitadaemon.ml
matitaB/matita/treeview/closed.gif [new file with mode: 0644]
matitaB/matita/treeview/doc.gif [new file with mode: 0644]
matitaB/matita/treeview/open.gif [new file with mode: 0644]
matitaB/matita/treeview/xmlTree.css [new file with mode: 0644]
matitaB/matita/treeview/xmlTree.js [new file with mode: 0644]

index 0170030a5e75be4829d2e83a5825eb8898f0fe19..a92c87a8096a9c50ccc160027b28b716027acb66 100644 (file)
@@ -93,7 +93,7 @@ let html_of_library uid =
     branch (Filename.basename path) (subdirtags ^ "\n" ^ scripttags)
   in
 
-  let basedir = (Helm_registry.get "matita.rt_base_dir") ^ "/users/" ^ uid ^ "/" in
+  let basedir = (Helm_registry.get "matita.rt_base_dir") ^ "/users/" ^ uid in
   let res = aux basedir in
   prerr_endline "BEGIN TREE";prerr_endline res;prerr_endline "END TREE";
   res
index b9aed4be8666891b006324c680760485b47feb91..72211bf5fcf29d5e5a12432a3b4520545dee5b36 100644 (file)
@@ -411,13 +411,17 @@ let viewLib (cgi : Netcgi1_compat.Netcgi_types.cgi_activation) =
     let sid = HExtlib.unopt sid in
     cgi # set_header 
       ~cache:`No_cache 
-      ~content_type:"text/xml; charset=\"utf-8\""
+      ~content_type:"text/html; charset=\"utf-8\""
       ();
     let uid = MatitaAuthentication.user_of_session sid in
     
     let html = MatitaFilesystem.html_of_library uid in
     cgi#out_channel#output_string
-      ("<html><head></head><body>" ^ html ^ "</body></html>");
+      ("<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>");
   cgi#out_channel#commit_work()
   
 ;;
diff --git a/matitaB/matita/treeview/closed.gif b/matitaB/matita/treeview/closed.gif
new file mode 100644 (file)
index 0000000..7d451c3
Binary files /dev/null and b/matitaB/matita/treeview/closed.gif differ
diff --git a/matitaB/matita/treeview/doc.gif b/matitaB/matita/treeview/doc.gif
new file mode 100644 (file)
index 0000000..4aca545
Binary files /dev/null and b/matitaB/matita/treeview/doc.gif differ
diff --git a/matitaB/matita/treeview/open.gif b/matitaB/matita/treeview/open.gif
new file mode 100644 (file)
index 0000000..0ab3c81
Binary files /dev/null and b/matitaB/matita/treeview/open.gif differ
diff --git a/matitaB/matita/treeview/xmlTree.css b/matitaB/matita/treeview/xmlTree.css
new file mode 100644 (file)
index 0000000..9fee00e
--- /dev/null
@@ -0,0 +1,19 @@
+body{\r
+       font: 10pt Verdana,sans-serif;\r
+       color: navy;\r
+}\r
+.trigger{\r
+       cursor: pointer;\r
+       cursor: hand;\r
+       display: block;\r
+}\r
+.branch{\r
+       display: none;\r
+       margin-left: 16px;\r
+}\r
+a{\r
+       text-decoration: none;\r
+}\r
+a:hover{\r
+       text-decoration: underline;\r
+}\r
diff --git a/matitaB/matita/treeview/xmlTree.js b/matitaB/matita/treeview/xmlTree.js
new file mode 100644 (file)
index 0000000..c5f75b9
--- /dev/null
@@ -0,0 +1,21 @@
+var openImg = new Image();\r
+openImg.src = "open.gif";\r
+var closedImg = new Image();\r
+closedImg.src = "closed.gif";\r
+\r
+function showBranch(branch){\r
+       var objBranch = document.getElementById(branch).style;\r
+       if(objBranch.display=="block")\r
+               objBranch.display="none";\r
+       else\r
+               objBranch.display="block";\r
+       swapFolder('I' + branch);\r
+}\r
+\r
+function swapFolder(img){\r
+       objImg = document.getElementById(img);\r
+       if(objImg.src.indexOf('closed.gif')>-1)\r
+               objImg.src = openImg.src;\r
+       else\r
+               objImg.src = closedImg.src;\r
+}\r