From b51d9a90c74c4c96c3335bb81b5b300c310916ba Mon Sep 17 00:00:00 2001 From: Wilmer Ricciotti Date: Wed, 22 Jun 2011 09:33:23 +0000 Subject: [PATCH] Matitaweb viewlib, part II. --- matitaB/matita/matitaFilesystem.ml | 2 +- matitaB/matita/matitadaemon.ml | 8 ++++++-- matitaB/matita/treeview/closed.gif | Bin 0 -> 87 bytes matitaB/matita/treeview/doc.gif | Bin 0 -> 90 bytes matitaB/matita/treeview/open.gif | Bin 0 -> 112 bytes matitaB/matita/treeview/xmlTree.css | 19 +++++++++++++++++++ matitaB/matita/treeview/xmlTree.js | 21 +++++++++++++++++++++ 7 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 matitaB/matita/treeview/closed.gif create mode 100644 matitaB/matita/treeview/doc.gif create mode 100644 matitaB/matita/treeview/open.gif create mode 100644 matitaB/matita/treeview/xmlTree.css create mode 100644 matitaB/matita/treeview/xmlTree.js 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 0000000000000000000000000000000000000000..7d451c3bc8eeddeae3d004009910d3cc73291606 GIT binary patch literal 87 zcmZ?wbhEHb6krfwn8?iV|NsAge~lOzKn%s7EQ|~c%nUj}E>Kp0fq_Y5PXEf&Z}lEY oD>Vpg7IV9k-zp#8nC3B0OLJSot6ghu9s1&tTV?juhmpY=00-h9(f|Me literal 0 HcmV?d00001 diff --git a/matitaB/matita/treeview/doc.gif b/matitaB/matita/treeview/doc.gif new file mode 100644 index 0000000000000000000000000000000000000000..4aca545f8e7ee59116be58ede451f47e7a8754a3 GIT binary patch literal 90 zcmZ?wbhEHb6krfwnE0RJz<~q*|NmzI1I3>#j39;%hyckmFlo2+R~|Z>+YZ#MJ>2Ahit4rX0KOoKxB7 z7PfZsqYhd276XnL&)yXpWnMFu>2ORhSt8`P?)CMK_q%yHCAR$OU<~V>mT4u=$zTlt Du5u*g literal 0 HcmV?d00001 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; +} -- 2.39.2