From: Wilmer Ricciotti Date: Wed, 22 Jun 2011 09:33:23 +0000 (+0000) Subject: Matitaweb viewlib, part II. X-Git-Tag: make_still_working~2417 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=b51d9a90c74c4c96c3335bb81b5b300c310916ba;p=helm.git Matitaweb viewlib, part II. --- diff --git a/matitaB/matita/matitaFilesystem.ml b/matitaB/matita/matitaFilesystem.ml index 0170030a5..a92c87a80 100644 --- a/matitaB/matita/matitaFilesystem.ml +++ b/matitaB/matita/matitaFilesystem.ml @@ -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 diff --git a/matitaB/matita/matitadaemon.ml b/matitaB/matita/matitadaemon.ml index b9aed4be8..72211bf5f 100644 --- a/matitaB/matita/matitadaemon.ml +++ b/matitaB/matita/matitadaemon.ml @@ -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 ^ ""); + ("\n" ^ + "XML Tree Control\n" ^ + "\n" ^ + "\n" ^ + "\n" ^ html ^ "\n"); cgi#out_channel#commit_work() ;; diff --git a/matitaB/matita/treeview/closed.gif b/matitaB/matita/treeview/closed.gif new file mode 100644 index 000000000..7d451c3bc 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 index 000000000..4aca545f8 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 index 000000000..0ab3c81b9 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 index 000000000..9fee00e0c --- /dev/null +++ b/matitaB/matita/treeview/xmlTree.css @@ -0,0 +1,19 @@ +body{ + font: 10pt Verdana,sans-serif; + color: navy; +} +.trigger{ + cursor: pointer; + cursor: hand; + display: block; +} +.branch{ + display: none; + margin-left: 16px; +} +a{ + text-decoration: none; +} +a:hover{ + text-decoration: underline; +} diff --git a/matitaB/matita/treeview/xmlTree.js b/matitaB/matita/treeview/xmlTree.js new file mode 100644 index 000000000..c5f75b9f8 --- /dev/null +++ b/matitaB/matita/treeview/xmlTree.js @@ -0,0 +1,21 @@ +var openImg = new Image(); +openImg.src = "open.gif"; +var closedImg = new Image(); +closedImg.src = "closed.gif"; + +function showBranch(branch){ + var objBranch = document.getElementById(branch).style; + if(objBranch.display=="block") + objBranch.display="none"; + else + objBranch.display="block"; + swapFolder('I' + branch); +} + +function swapFolder(img){ + objImg = document.getElementById(img); + if(objImg.src.indexOf('closed.gif')>-1) + objImg.src = openImg.src; + else + objImg.src = closedImg.src; +}