diff options
Diffstat (limited to 'webdoc')
-rw-r--r-- | webdoc/Changelog | 86 | ||||
-rw-r--r-- | webdoc/edit.aspx | 62 | ||||
-rw-r--r-- | webdoc/fullsearch.js | 48 | ||||
-rw-r--r-- | webdoc/header.html | 65 | ||||
-rw-r--r-- | webdoc/index.html | 10 | ||||
-rw-r--r-- | webdoc/login.aspx | 68 | ||||
-rw-r--r-- | webdoc/logout.aspx | 12 | ||||
-rw-r--r-- | webdoc/main.css | 165 | ||||
-rwxr-xr-x | webdoc/monodoc.asmx | 210 | ||||
-rwxr-xr-x | webdoc/oldposts.xml | 3 | ||||
-rwxr-xr-x | webdoc/ptree/tree.css | 67 | ||||
-rwxr-xr-x | webdoc/ptree/tree.js | 466 | ||||
-rw-r--r-- | webdoc/search.css | 43 | ||||
-rw-r--r-- | webdoc/search.html | 16 | ||||
-rw-r--r-- | webdoc/search.js | 138 | ||||
-rw-r--r-- | webdoc/server.asmx | 1 | ||||
-rw-r--r-- | webdoc/server.cs | 366 | ||||
-rw-r--r-- | webdoc/sidebar.css | 134 | ||||
-rw-r--r-- | webdoc/sidebar.js | 28 | ||||
-rw-r--r-- | webdoc/tables.sql | 21 | ||||
-rw-r--r-- | webdoc/wiki2ecmahelper.xsl | 70 | ||||
-rw-r--r-- | webdoc/xtree/xloadtree.js | 276 | ||||
-rw-r--r-- | webdoc/xtree/xmlextras.js | 147 | ||||
-rw-r--r-- | webdoc/xtree/xtree.css | 54 | ||||
-rw-r--r-- | webdoc/xtree/xtree.js | 541 |
25 files changed, 0 insertions, 3097 deletions
diff --git a/webdoc/Changelog b/webdoc/Changelog deleted file mode 100644 index f9e0a4b2..00000000 --- a/webdoc/Changelog +++ /dev/null @@ -1,86 +0,0 @@ -2009-09-25 Jonathan Pryor <jpryor@novell.com> - - * Global.asax: Move the monodoc.ashx RootTree configuration here. - * monodoc.ashx: Remove MonodocHandler.help_tree and use - Global.help_tree instead. This is necessary because of an ordering - issue: after starting the server, whether you get CSS or not depends - on the *first* URL you get. If you visit monodoc.ashx first, you'll - get CSS support (which is the case if you just hit - http://localhost:8080 w/ xsp and navigate normally). If you instead - visit a URL directly, e.g. - http://localhost:8080/index.aspx?link=T:Mono.Options.OptionSet/* - then you'll invoke index.aspx first, and since index.aspx was using - Global.help_tree (which didn't enable CSS output), you'd get !CSS - pages generated. - - The perils of avoiding SPOT. - -2009-09-25 Jonathan Pryor <jpryor@novell.com> - - * monodoc.ashx: Remove tlink support (because tlinks keep potentially - changing every time we restart mod-mono-server), and instead rely on - just the existing link support, and use node.PublicUrl instead of - node.URL. (Relying on n.tree.HelpSource.SourceID is a broken design.) - -2009-06-12 Gonzalo Paniagua Javier <gonzalo@novell.com> - - * web.config: disable batch compilation to allow the application to - work even if edits are not possible. - -2009-06-08 Jonathan Pryor <jpryor@novell.com> - - * Makefile.am (dist-hook): Copy everything in $(web_DATA) to - $(distdir) (otherwise we'll miss some files). - -2008-10-29 Jonathan Pryor <jpryor@novell.com> - - * monodoc.ashx: Set HelpSource.UseWebdocCache=true so that we use the - 'mdoc export-html-webdoc' pre-rendered HTML cache (if present). - Greatly speeds some pages up. - -2008-10-29 Jonathan Pryor <jpryor@novell.com> - - * Makefile.am: Get `make dist`, `make install` working... We install - to $prefix/lib/monodoc/web, which is where Debian's monodoc-http - package places things... - -2008-10-28 Jonathan Pryor <jpryor@novell.com> - - * . (svn:ignore): Ignore generated files. - * common.css: Fix the .code class, lest it make the C# Language Spec - examples unreadable. (Really, *really*, unreadable.) - * Makefile.am: Deal with change to mono-tools/webdoc directory... - * monodoc.ashx: Grab CSS & JavaScript code from the node's - HelpSource, thus allowing the HelpSource to customize output. - -2006-11-19 Miguel de Icaza <miguel@novell.com> - - * monodoc.ashx: Do not rewrite target urls that start with '#' - as those are links inside the current page. - -2005-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * monodoc.ashx: fixed nullrefs for the 'Various' node. - -2003-11-16 Gonzalo Paniagua Javier <gonzalo@ximian.com> - - * ptree/tree.js: make mouse selection lose the focus when ENTER is - pressed. - -2003-10-14 John Luke <jluke@cfl.rr.com> - - * ptree/tree.css: change a.hover to look like ndoc - -2003-08-22 Piers Haken <piersh@friskit.com> - - * monodoc.ash: PTree cleanup, keyboard support - -2003-08-21 Piers Haken <piersh@friskit.com> - - * monodoc.ash: add PTree support - -2003-08-14 John Luke <jluke@cfl.rr.com> - - * monodoc.ashx: do not close the XmlTextWriter in 'void - HandleTree (HttpContext context, string tree)' (allows the - tree to work on IE and moz>=1.4) diff --git a/webdoc/edit.aspx b/webdoc/edit.aspx deleted file mode 100644 index f2ad4dee..00000000 --- a/webdoc/edit.aspx +++ /dev/null @@ -1,62 +0,0 @@ -<%@ Assembly name="monodoc" %> -<%@ Import Namespace="Monodoc" %> -<%@ Import Namespace="System.Xml" %> -<%@ Import Namespace="System.IO" %> -<html> -<head> - <script language="C#" runat=server> - static RootTree help_tree = RootTree.LoadTree (); - - void Page_Load (object sender, EventArgs ea) - { - HttpWorkerRequest r = (HttpWorkerRequest) ((IServiceProvider)Context).GetService (typeof (HttpWorkerRequest)); - // - // We need the untouched QueryString, as internally the editor uses the `@' symbol as a separator. - // - string q = Request ["link"]; - Console.WriteLine ("QueryString: " + q); - try { - XmlNode edit_node = EditingUtils.GetNodeFromUrl ("edit:" + q, help_tree); - Monodoc2Wiki m2w = new Monodoc2Wiki (); - Console.WriteLine ("XML TO TEXT: " + edit_node.InnerText); - EditBuffer.Text = m2w.ProcessNode ((XmlElement) edit_node); - } catch (Exception e){ - EditBuffer.Text = Request.QueryString.ToString () + e.ToString (); - } - } - - void Save (object o, EventArgs a) - { - - } - - void Preview (object o, EventArgs a) - { - WikiStyleDocConverter p = new WikiStyleDocConverter (EditBuffer.Text); - XmlNode result = p.ParseEntireDoc (); - - StringWriter sw = new StringWriter (); - sw.Write ("YOOHO:" + result.InnerText); - XmlTextWriter xw = new XmlTextWriter (sw); - xw.Formatting = Formatting.Indented; - result.WriteTo (xw); - xw.Close (); - - TextPreview.Text = "Preview<BR>" + sw.ToString (); - } - </script> -</head> - -<body> - <form runat=server> - <asp:Label id="TextPreview" runat=server/> - <asp:TextBox id="EditBuffer" Text="multiline" TextMode="MultiLine" runat="server" rows=15 cols=80 /> - <p> - <asp:Button Text="Save Page" OnClick="Save" runat=server/> - <asp:Button Text="Show Preview" OnClick="Preview" runat=server/> - <asp:LinkButton Text="Markup Help" runat=server/> - <asp:LinkButton Text="Cancel" runat=server/> - </form> -</body> - -</html>
\ No newline at end of file diff --git a/webdoc/fullsearch.js b/webdoc/fullsearch.js deleted file mode 100644 index 4d32be54..00000000 --- a/webdoc/fullsearch.js +++ /dev/null @@ -1,48 +0,0 @@ -var spinner = $('#s_spinner'); - -function process_hash () { - var query = window.location.hash; - if (query == null || query.length < 2) - return; - - var ul = $('#s_results ul'); - ul.empty (); - - var currentNumber = 0; - var count = 0; - - // Remove hash '#' symbol - query = query.substring(1); - $('#s_term').text (query); - - var fetch_and_add_results = function (url) { - spinner.toggleClass ('hidden'); - $.getJSON (url, function (data) { - spinner.toggleClass ('hidden'); - count = data.count; - currentNumber += data.result.length; - - if (data.result.length == 0) { - $('<div/>', { 'class': 's_message' }).text('No more results').replaceAll($('#s_morebtn')).fadeOut(4000, function () { $(this).remove(); }); - } else { - var lis = $.map (data.result, function (element) { - return '<li><a href="/monodoc.ashx?link=' + element.url + '"><span class="name">' - + element.name + '</span> ' - + (element.fulltitle.length > 0 ? '<span class="fulltitle">(' + element.fulltitle + ')</span>' : '') + '</a></li>'; - }); - ul.append (lis.join ('')); - } - }); - }; - - fetch_and_add_results ('/monodoc.ashx?search=' + query); - - $('#s_morebtn input').click (function () { - fetch_and_add_results ('/monodoc.ashx?search=' + query + '&start=' + currentNumber + '&count=' + count); - }); -} - -process_hash (); - -window.addEventListener("hashchange", process_hash, false); - diff --git a/webdoc/header.html b/webdoc/header.html deleted file mode 100644 index 73f8d720..00000000 --- a/webdoc/header.html +++ /dev/null @@ -1,65 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> - <title>MonoDoc Header</title> - <meta name="description" content="Mono Documentation header"> - <link rel="stylesheet" type="text/css" href="common.css" media="all" - title='Default Style'/> - <style> -img.toolbarsep { - border: 0px; - margin-bottom: 1px; - margin-top: 1px; - padding-top: 3px; - padding-bottom: 3px; - vertical-align: middle; -} - -img.toolbar { - border: 0px; - margin: 1px; - padding: 3px; - vertical-align: middle; -} - -img.toolbar:hover { - border-left: 1px solid white; - border-right: 1px solid #B1A598; - border-top: 1px solid white; - border-bottom: 1px solid #B1A598; - margin: 0px; -} - -img.toolbar:active { - border-right: 1px solid white; - border-left: 1px solid #B1A598; - border-bottom: 1px solid white; - border-top: 1px solid #B1A598; -} - - -#rightSide { - position: fixed; - bottom: 0px; - right: 0px; - float: right; - padding: 5px; -} - </style> -</head> - -<body -style="color: rgb(255, 255, 255); background-color: #c0dda2;" -link="#ffffff" alink="#ffffff" vlink="#ffffff"> - -<a href="index.aspx" class="headerlink" target="_top"><img - src="images/mono-logo.png" alt="Mono" - style="border: 0px solid ; height:75;" /></a> - -<div id="rightSide"> - <a href="javascript:parent.content.print();"><img class="toolbar" src="images/print.png" alt="Print" title="Print this document"/></a> - <a target="_top" id="pageLink" href="/"><img class="toolbar" src="images/link.png" alt="Link to this document" title="Link to this document"/></a> -</div> -</body> -</html> diff --git a/webdoc/index.html b/webdoc/index.html deleted file mode 100644 index ea7d7ef6..00000000 --- a/webdoc/index.html +++ /dev/null @@ -1,10 +0,0 @@ -<html> - <head> - <title>Mono Documentation</title> - </head> - - <frameset cols="20%,80%"> - <frame src="monodoc.ashx?tree=boot"> - <frame src="monodoc.ashx?link=root:" name="content"> - </frameset> -</html>
\ No newline at end of file diff --git a/webdoc/login.aspx b/webdoc/login.aspx deleted file mode 100644 index c6762214..00000000 --- a/webdoc/login.aspx +++ /dev/null @@ -1,68 +0,0 @@ -<%@ Import Namespace="System.Web.Security" %> -<html> -<script language="C#" runat=server> - - void Allow () - { - FormsAuthentication.RedirectFromLoginPage (UserEmail.Value, false); - // PersistCookie.Checked); - } - - void Login_Click (object sender, EventArgs e) - { - FormsAuthenticationTicket trust = null; - HttpCookie c; - - switch (UserEmail.Value){ - case "miguel": - trust = new FormsAuthenticationTicket ("high", false, 1); - c = new HttpCookie ("level", FormsAuthentication.Encrypt (trust)); - Response.AppendCookie (c); - Allow (); - break; - case "guest": - trust = new FormsAuthenticationTicket ("low", false, 1); - c = new HttpCookie ("level", FormsAuthentication.Encrypt (trust)); - Response.AppendCookie (c); - Allow (); - break; - default: - Msg.Text = "Invalid Credentials: Please try again"; - break; - } - } - - void Page_Load () - { - Msg.Text = ">>> " + Request.QueryString ["ReturnUrl"] + "<<<"; - } -</script> -<body> -<form runat=server> - - <h3><font face="Verdana">Login Page</font></h3> - <table> - <tr> - <td>Email:</td> - <td><input id="UserEmail" type="text" runat=server/></td> - <td><ASP:RequiredFieldValidator ControlToValidate="UserEmail" - Display="Static" ErrorMessage="*" runat=server/></td> - </tr> - <tr> - <td>Password:</td> - <td><input id="UserPass" type=password runat=server/></td> - <td><ASP:RequiredFieldValidator ControlToValidate="UserPass" - Display="Static" ErrorMessage="*" runat=server/></td> - </tr> - <tr> - <td>Persistent Cookie:</td> - <td><ASP:CheckBox id=PersistCookie runat="server" /> </td> - <td></td> - </tr> - </table> - <asp:button text="Login" OnClick="Login_Click" runat=server/> - <p> - <asp:Label id="Msg" ForeColor="red" Font-Name="Verdana" Font-Size="10" runat=server /> -</form> -</body> -</html> diff --git a/webdoc/logout.aspx b/webdoc/logout.aspx deleted file mode 100644 index af3621be..00000000 --- a/webdoc/logout.aspx +++ /dev/null @@ -1,12 +0,0 @@ -<%@ Import Namespace="System.Web.Security" %> -<html> -<script language="C#" runat=server> - void Page_Load (object sender, EventArgs e) - { - FormsAuthentication.SignOut (); - Response.Redirect ("index.aspx"); - } -</script> -<body> -</body> -</html> diff --git a/webdoc/main.css b/webdoc/main.css deleted file mode 100644 index d22a9dc3..00000000 --- a/webdoc/main.css +++ /dev/null @@ -1,165 +0,0 @@ -#fsearch_window { - display: none; - opacity: 0; - position: absolute; - z-index: 60; - text-align: left; - width: 25em; - right: 80px; - top: 40px; - border: 1px solid black; - background: white; - padding: 5px; - overflow: hidden; - -webkit-transition: opacity 200ms linear 0; - -moz-transition: opacity 200ms linear 0; - -o-transition: opacity 200ms linear 0; -} - -#fsearch_window a { - color: blue; - text-decoration: none; - font-family: monospace; -} - -#fsearch_window .threedots { - color: #333; - font-size: x-small; - font-family: sans-serif; -} - -#fsearch_window .selected { - background-color: 679ef1; - color: white; -} - -#fsearch_companion { - display:none; - position: absolute; - z-index: 60; - top: 40px; - right:410px; - color: grey; - background-color: white; -} - -iframe { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -body,div { - margin: 0; - padding: 0; -} - -img.toolbarsep { - border: 0px; - margin-bottom: 1px; - margin-top: 1px; - padding-top: 3px; - padding-bottom: 3px; - vertical-align: middle; -} - -img.toolbar { - border: 0px; - margin: 1px; - padding: 3px; - vertical-align: middle; -} - -img.toolbar:hover { - border-left: 1px solid white; - border-right: 1px solid #B1A598; - border-top: 1px solid white; - border-bottom: 1px solid #B1A598; - margin: 0px; -} - -img.toolbar:active { - border-right: 1px solid white; - border-left: 1px solid #B1A598; - border-bottom: 1px solid white; - border-top: 1px solid #B1A598; -} - - -#login { - position: fixed; - top: 0px; - right: 0px; - float: right; - padding: 5px; -} - -#rightSide { - position: relative; - top: 2px; - right: 0px; - float: right; - padding: 5px; -} - -#banner { - background: #679EF1 url(mdocimages/headerbg.png) no-repeat 100% 50%; - background-color: #679EF1; - background-position: 100% 50%; - background-repeat: no-repeat; - border-bottom: 1px dotted #3363BD; -} - -#header { - color: black; - height: 40px; - margin-bottom: 0px; - padding: 0px 0px 0px 15px; - position: relative; - width: 50%; -} -#header h1 { - color: white; - font-family: arial, helvetica, verdana, sans-serif; - font-size: 22px; - font-weight: bold; - line-height: 1.8em; - margin: 0; -} -body,div { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -html,body { - height: 100%; -} - -#side { - width:20%; - height: 93%; - float: left; - border-right: 1px solid black; - overflow-x: auto; - overflow-y: auto; -} - -#content_frame { - width:79.9%; - height: 94%; -} - -#content_frame_wrapper { - height: 100%; -} - -#main_part { - height: 94%; -} diff --git a/webdoc/monodoc.asmx b/webdoc/monodoc.asmx deleted file mode 100755 index d8e5fd64..00000000 --- a/webdoc/monodoc.asmx +++ /dev/null @@ -1,210 +0,0 @@ -<%@ WebService language="C#" class="Editing" %> - -// MonoDoc Editing WebService -// -// (C) 2003 by Johannes Roith -// Author: Johannes Roith - -// Client API: -// -// Editing edit = new Editing(); -// Response response = edit.Submit("Johannes Roith", "johannes@jroith.de", -// "This is a change through monodoc editing.", xml); - -// response contains: -// a server status message (response.Message) -// a statuscode (response.Status) - -// Statuscodes: -// -// 1 - everything went right -// 2 - the xml is not well-formed. -// 3 - some data is missing (email, name, etc.). -// 4 - the data was already posted -// 5 - Some internal Server error - - -using System; -using System.Web.Services; -using System.Xml.Serialization; -using System.Xml; -using System.Text; -using System.Security.Cryptography; - -[WebService(Namespace="http://www.go-mono.org/monodoc")] -public class Editing { - - [WebMethod] - public Response Submit(string author, string email, string personalmessage, string xmldata) { - - Response response; - string newsum = GetMd5Sum(xmldata); - XmlElement dataroot; - XmlDocument oldposts; - string today = Convert.ToString(DateTime.Now.DayOfYear); - - try { - - - oldposts = new XmlDocument(); - oldposts.Load("oldposts.xml"); - - dataroot = oldposts.DocumentElement; - - // Eventually only block in certain time frame? - // XmlNodeList datanodes = dataroot.SelectNodes("/oldposts/post[@date='" + today + "']"); - - XmlNodeList datanodes = dataroot.SelectNodes("/oldposts/post"); - - foreach(XmlNode datanode in datanodes) { - if (datanode.Attributes["md5"].Value == newsum) { - - response = new Response(); - response.Status = 4; - response.Message = "This was already posted."; - - return response; - } - } - - if (xmldata == "") - { - - response = new Response(); - response.Status = 2; - response.Message = "Xml not well-formed. No data was posted."; - - return response; - } - - XmlDocument doc = new XmlDocument(); - doc.LoadXml(xmldata); - - XmlElement root = doc.DocumentElement; - XmlNodeList nodes = root.SelectNodes("/GlobalChangeset/DocSetChangeset"); - - // IMO it's best to generate different Mails for - // different DocSets, so the correct people can get their hands on it. - // e.g one mail for Gtk#, one for ecma docs. - - foreach (XmlNode node in nodes) { - - string datastring = ""; - - XmlNodeList filenodes = node.SelectNodes("FileChangeset"); - - - foreach (XmlNode filenode in filenodes) { - datastring += RenderFileSet(filenode); - } - - string target = node.Attributes["DocSet"].Value; - - string header = "---------------------\n" - + "MonoDoc Change\n" - + "---------------------\n\n" - + "This mail was generated by monodoc.\n\n" - + "--------------------------------------------------\n" - + "Author: " + author + "\n" - + "EMail: " + email + "\n" - + "personal Message: " + personalmessage + "\n\n" - + "--------------------------------------------------\n\n" - + "Changes are listed below:\n\n" - + "*************************************\n\n"; - - string footer = "\n\n---------------------------------------\n" - + "Monodoc Editing WebService"; - - SendMail("Monodoc: " + target, header + datastring + footer); - } - - } - - catch { - - response = new Response(); - response.Status = 5; - response.Message = "An unknown error occured."; - - return response; - - } - - - XmlNode rootnode = dataroot.SelectSingleNode("/oldposts"); - - XmlElement newentry = oldposts.CreateElement("post"); - newentry.SetAttribute("md5", newsum); - newentry.SetAttribute("date", today); - rootnode.AppendChild(newentry); - oldposts.Save("oldposts.xml"); - - response = new Response(); - response.Status = 1; - response.Message = "Your changes were sent to Mono Docs List.\n" - + "They will be reviewed as soon as possible."; - - return response; - - } - - string RenderFileSet(XmlNode filenode) { - - // Rendering should be improved eventually, - // so no xml remains. - - return "FILE: " + filenode.Attributes["RealFile"] + "\n\n" - + filenode.InnerXml - + "\n\n*************************************\n\n"; - } - - public class Response { - - public int Status; - public string Message; - } - - public void SendMail(string subject, string body) { - - System.Web.Mail.MailMessage mailMessage = new System.Web.Mail.MailMessage(); - - // NOTE: I have made this "groith@tcrz.net", - // so it won't be blocked. - // Should be changed later. - - mailMessage.From = "groith@tcrz.net"; - mailMessage.To = "mono-docs-list@ximian.com"; - mailMessage.Subject = subject; - mailMessage.Body = body; - mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text; - - System.Web.Mail.SmtpMail.SmtpServer = "post.tcrz.net"; - System.Web.Mail.SmtpMail.Send(mailMessage); - - - } - - // from http://weblog.stevex.org/radio/stories/2002/12/08/ - // cCodeSnippetCreatingAnMd5HashString.html - - public string GetMd5Sum(string str) - { - Encoder enc = System.Text.Encoding.Unicode.GetEncoder(); - - byte[] unicodeText = new byte[str.Length * 2]; - enc.GetBytes(str.ToCharArray(), 0, str.Length, unicodeText, 0, true); - - MD5 md5 = new MD5CryptoServiceProvider(); - byte[] result = md5.ComputeHash(unicodeText); - - StringBuilder sb = new StringBuilder(); - for (int i=0;i<result.Length;i++) - { - sb.Append(result[i].ToString("X2")); - } - - return sb.ToString(); -} - - -} diff --git a/webdoc/oldposts.xml b/webdoc/oldposts.xml deleted file mode 100755 index df6f4bb0..00000000 --- a/webdoc/oldposts.xml +++ /dev/null @@ -1,3 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<oldposts> -</oldposts>
\ No newline at end of file diff --git a/webdoc/ptree/tree.css b/webdoc/ptree/tree.css deleted file mode 100755 index fed1384f..00000000 --- a/webdoc/ptree/tree.css +++ /dev/null @@ -1,67 +0,0 @@ -body { - font-family: verdana; - font-size: 70.5%; - font-weight: normal; - background-color: #fff; - color: Black; - margin: 0px 0px 0px 0px; - padding: 0px 0px 0px 0px; - vertical-align: middle; -} - -.tree-node, -.tree-node-collapsed -{ - margin: 0px; - padding: 0px; - border: 0px; - white-space: nowrap; -} - -.tree-label -.tree-label-selected -{ - margin: 0px; - padding: 0px; - border: 0px; - white-space: nowrap; -} - -.tree-node-collapsed .tree-node, -.tree-node-collapsed .tree-node-collapsed -{ - display: none; -} - -.tree-label-selected a, -.tree-label-selected a:hover -{ - text-decoration: none; - background: highlight; - color: highlighttext; -} - -.tree-label a -{ - text-decoration: none; - background: #fff; - color: black; -} - -.tree-label a:hover -{ - background-image: url('../images/searching.gif'); - text-decoration: none; - background: #dfdfdf; - color: black; - border: 1px solid; - border-color: grey; - padding: 1px; -} - -.tree-node img -{ - vertical-align: middle; - border: 0px; -} - diff --git a/webdoc/ptree/tree.js b/webdoc/ptree/tree.js deleted file mode 100755 index 200c45be..00000000 --- a/webdoc/ptree/tree.js +++ /dev/null @@ -1,466 +0,0 @@ -// -// PTree - A dynamically loaded TOC tree -// -// Author: -// Piers Haken (piersh@friskit.com) -// -// (C) 2003 Piers Haken -// - -// TODO: -// work out how to cancel scrolling keyboard events on Mozilla -// better support for multiple trees in a single body - -function PTree () -{ - this.strActionBase = ""; - this.strSrcBase = ""; - this.strTargetDefault = ""; - this.strImagesBase = "images/"; - this.strImageExt = ".png"; - this.eltSelected = null; - this.nImageWidth = 18; - this.nImageHeight = 18; - this.onClickCallback = null; - - this.CreateItemFromXML = function (oNode, fLast, eltParent) - { - var strText = oNode.getAttribute ("text"); - var strAction = oNode.getAttribute ("action"); - var strSrc = oNode.getAttribute ("src"); - var strTarget = oNode.getAttribute ("target"); - return this.CreateItem (eltParent, strText, strAction, strSrc, fLast, strTarget, fLast, eltParent); - } - - this.CreateItem = function (eltParent, strText, strAction, strSrc, fLast, strTarget) - { - var _this = this; - - var eltDiv = document.createElement ("DIV"); - if (eltParent == null) - eltDiv.tree_fRoot = true; - - if (fLast) - eltDiv.tree_fLast = true; - - if (strAction) - eltDiv.tree_action = strAction; - - if (strSrc != null) - eltDiv.tree_src = strSrc; - - var eltSpan = document.createElement ("SPAN"); - eltSpan.className = "tree-label"; - - if (eltParent) - { - eltDiv.className = "tree-node-collapsed"; - - // this node's tree icon - var eltIcon = new Image (); - eltIcon.width = this.nImageWidth; - eltIcon.height = this.nImageHeight; - if (strSrc) - eltIcon.onclick = function () { _this.LoadNode (this); } - eltIcon.src = this.GetIconSrc (eltDiv, true); - eltSpan.appendChild (eltIcon); - - // parent's tree icons - var eltIconLast = eltIcon; - var eltParentDiv = eltParent; - while (!this.IsRootDiv (eltParentDiv)) - { - var eltIcon = new Image (); - eltIcon.width = this.nImageWidth; - eltIcon.height = this.nImageHeight; - if (this.IsLastDiv (eltParentDiv)) - eltIcon.src = this.strImagesBase + "blank" + this.strImageExt; - else - eltIcon.src = this.strImagesBase + "I" + this.strImageExt; - - eltSpan.insertBefore (eltIcon, eltIconLast); - eltIconLast = eltIcon; - eltParentDiv = this.GetParentDiv (eltParentDiv); - } - } - else - { - eltDiv.className = "tree-node"; - //document.body.onkeydown = function () { return _this.onKeyDown (); } - } - - // description - var eltText = document.createTextNode (strText); - var eltDescription; - - if (strAction) - { - eltDescription = document.createElement ("a"); - if (strAction.indexOf ('http://') === 0) - eltDescription.href = strAction; - else - eltDescription.href = this.strActionBase + strAction; - eltDescription.title = strText; - if (strTarget) - eltDescription.target = strTarget; - else if (this.strTargetDefault) - eltDescription.target = this.strTargetDefault; - eltDescription.appendChild (eltText); - var parent = this; - eltDescription.onclick = function (e) { - if (!e) - e = window.event; - if (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || e.modifiers > 0) - return; - _this.SelectNode (eltDiv); - if (parent.onClickCallback) { - e.cancelBubble = true; - e.returnValue = false; - if (e.stopPropagation) { - e.stopPropagation (); - e.preventDefault (); - } - parent.onClickCallback(strAction); - } - } - eltDescription.onmouseover = function () { this.blur (); } - eltDescription.onmouseup = function () { this.blur (); } - } - else - { - eltDescription = document.createElement ("span"); - eltDescription.className = "tree-label"; - eltDescription.innerHTML = strText; - } - - eltSpan.appendChild (eltDescription); - eltDiv.appendChild (eltSpan); - - // append this node to its parent - if (eltParent) - eltParent.appendChild (eltDiv); - else - this.SelectNode (eltDiv); - - return eltDiv; - } - - this.SelectNode = function (eltDiv) - { - if (this.eltSelected != eltDiv) - { - if (eltDiv) - { - var eltLabel = this.GetSpan (eltDiv); - eltLabel.className = "tree-label-selected"; - } - if (this.eltSelected) - { - var eltLabel = this.GetSpan (this.eltSelected); - eltLabel.className = "tree-label"; - } - this.eltSelected = eltDiv; - } - } - - this.LoadNode = function (eltIcon) - { - var eltDiv = this.GetDivFromIcon (eltIcon); - eltIcon.onclick = null; - - var eltLoading = this.CreateItem (eltDiv, "<img src=\"../images/searching.gif\"/>Loading...", null, null, true); - eltLoading.className = ''; - - var xmlHttp = XmlHttp.create(); - xmlHttp.open ("GET", this.strSrcBase + eltDiv.tree_src, true); // async - var _this = this; - xmlHttp.onreadystatechange = function () { _this.onReadyStateChange (xmlHttp, eltIcon, eltLoading); } - setTimeout (function () { xmlHttp.send (null); }, 10); - } - - this.onReadyStateChange = function (xmlHttp, eltIcon, eltLoading) - { - if (xmlHttp.readyState != 4) - return; - // XML loaded - var eltDiv = this.GetDivFromIcon (eltIcon); - - try - { - var doc = xmlHttp.responseXML; - var root = doc.documentElement; - - var nodes = root.childNodes; - var cNodes = nodes.length; - - for (var iNode = 0; iNode < cNodes; iNode ++) - this.CreateItemFromXML (nodes [iNode], iNode == cNodes-1, eltDiv); - - eltDiv.removeChild (eltLoading); - - if (this.eltSelected == eltLoading) - this.SelectNode (this.GetFirstChild (eltDiv)); - - eltIcon.src = this.GetIconSrc (eltDiv, false); - } - catch (e) - { - this.SetText (eltLoading, "Failed to load topic"); - } - eltDiv.className = "tree-node"; - var _this = this; - eltIcon.onclick = function () { _this.onClickMinus (this); } - } - - this.ExpandFromPath = function (path) - { - var root = $('.tree-node').first (); - var elements = path.split('@'); - - var thisSave = this; - var finish = function (node, i, opened) { - node = $(node); - if (!opened) { - node.attr('class', 'tree-node'); - var icon = node.children('span').children('img:nth-child(' + (i + 1) + ')'); - icon[0].onclick = function () { thisSave.onClickMinus (this); }; - icon.attr('src', thisSave.GetIconSrc (node[0], false)); - } - root = node; - if (i == elements.length - 1) { - thisSave.SelectNode (node[0]); - var container = $('#contents').parent (); - container.scrollTop (node[0].offsetTop - 100); - } - }; - var recurse = function (i) { - if (i >= elements.length) - return; - var node = root.children ('div')[elements[i]]; - // Tree already loaded - if ($(node).find ('div').first ().length == 0) { - var url = thisSave.strSrcBase + elements.slice(0, i + 1).join('@'); - $.get (url, function (data) { - var doc = data.documentElement; - - var children = doc.childNodes; - var cChildren = children.length; - - for (var iNode = 0; iNode < cChildren; iNode ++) - thisSave.CreateItemFromXML (children[iNode], iNode == cChildren - 1, node) - - // We finish node creation by opening up its tree like clicking would normally do - finish (node, i, false); - recurse (i + 1); - }); - } else { - finish (node, i, true); - recurse (i + 1); - } - }; - recurse (0); - } - - this.onClickPlus = function (eltIcon) - { - var eltDiv = this.GetDivFromIcon (eltIcon); - eltDiv.className = "tree-node"; - eltIcon.src = this.GetIconSrc (eltDiv, false); - var _this = this; - eltIcon.onclick = function () { _this.onClickMinus (this); } - } - - this.onClickMinus = function (eltIcon) - { - var eltDiv = this.GetDivFromIcon (eltIcon); - eltDiv.className = "tree-node-collapsed"; - eltIcon.src = this.GetIconSrc (eltDiv, true); - var _this = this; - eltIcon.onclick = function () { _this.onClickPlus (this); } - } - - this.onKeyDown = function (event) - { - var eltSelect = this.eltSelected; - var fLast = this.IsLastDiv (eltSelect); - var fRoot = this.IsRootDiv (eltSelect); - - switch (event.keyCode) - { - case 13: // return - var eltLink = eltSelect.firstChild.lastChild; - if (eltSelect.tree_action) - window.open (eltLink.href, eltLink.target); - this.SelectNode (eltSelect); - return false; // don't EnsureVisible - - case 38: // up - if (!fRoot) - { - if (this.IsFirstChild (eltSelect)) - eltSelect = this.GetParentDiv (eltSelect); - else - { - eltSelect = eltSelect.previousSibling; - while (this.IsExpanded (eltSelect)) - eltSelect = eltSelect.lastChild; - } - } - break; - - case 40: // down - if (this.IsExpanded (eltSelect)) - eltSelect = this.GetFirstChild (eltSelect); - else if (!fLast) - eltSelect = eltSelect.nextSibling; - else - { - while (!this.IsRootDiv (eltSelect) && this.IsLastDiv (eltSelect)) - eltSelect = this.GetParentDiv (eltSelect); - - if (this.IsRootDiv (eltSelect)) - return false; - - eltSelect = eltSelect.nextSibling; - } - break; - - case 37: // left - if (!fRoot) - { - if (this.IsExpanded (eltSelect)) - this.onClickMinus (this.GetIconFromDiv (eltSelect)); - else - eltSelect = this.GetParentDiv (eltSelect); - } - break; - - case 39: // right - if (this.HasChildren (eltSelect)) - { - var eltChild = this.GetFirstChild (eltSelect); - if (this.IsExpanded (eltSelect)) - eltSelect = eltChild; - else if (eltChild != null) - this.onClickPlus (this.GetIconFromDiv (eltSelect)); - else - this.LoadNode (this.GetIconFromDiv (eltSelect)); - } - break; - - default: - return true; - } - - this.SelectNode (eltSelect); - this.EnsureVisible (this.GetLabel (eltSelect)); - - return false; - } - - this.SetText = function (eltDiv, strText) - { - var eltText = eltDiv.lastChild; - eltText.nodeValue = strText; - } - - this.GetIconSrc = function (eltDiv, fPlus) - { - var strIconSrc = this.IsLastDiv (eltDiv) ? "L" : "T"; - if (eltDiv.tree_src != null) - strIconSrc += fPlus ? "plus" : "minus"; - return this.strImagesBase + strIconSrc + this.strImageExt; - } - - this.GetDivFromIcon = function (eltIcon) - { - return eltIcon.parentNode.parentNode; - } - - this.GetIconFromDiv = function (eltDiv) - { - return eltDiv.firstChild.lastChild.previousSibling; - } - - this.GetFirstChild = function (eltDiv) - { - return eltDiv.firstChild.nextSibling; - } - - this.GetSpan = function (eltDiv) - { - return eltDiv.firstChild; - } - - this.GetLabel = function (eltDiv) - { - return eltDiv.firstChild.lastChild; - } - - this.GetParentDiv = function (eltDiv) - { - if (this.IsRootDiv (eltDiv)) - return null; - return eltDiv.parentNode; - } - - this.HasChildren = function (eltDiv) - { - return eltDiv.tree_src || this.IsRootDiv (eltDiv); - } - - this.IsLastDiv = function (eltDiv) - { - return eltDiv.tree_fLast; - } - - this.IsRootDiv = function (eltDiv) - { - return Boolean (eltDiv.tree_fRoot); - } - - this.IsExpanded = function (eltDiv) - { - return eltDiv.className != "tree-node-collapsed"; - } - - this.IsFirstChild = function (eltDiv) - { - var fFirst = - eltDiv.previousSibling && - eltDiv.previousSibling.tagName != "DIV"; - return fFirst; - } - - this.EnsureVisible = function (elt) - { - var x = 0; - var y = 0; - var parent = elt; - while (parent != null) - { - x += parent.offsetLeft; - y += parent.offsetTop; - parent = parent.offsetParent; - } - - var yView = window.frameElement.scrollTop + document.body.scrollTop; - var dyView = document.body.clientHeight; - var dy = 0; - if (y + elt.offsetHeight > yView + dyView) - dy = (y + elt.offsetHeight) - (yView + dyView); - if (y < yView + dy) - dy = y - yView; - - var xView = window.frameElement.scrollLeft + document.body.scrollLeft; - var dxView = document.body.clientWidth; - var dx = 0; - if (x + elt.offsetWidth > xView + dxView) - dx = (x + elt.offsetWidth) - (xView + dxView); - if (x < xView + dx) - dx = x - xView; - - if (dx != 0 || dy != 0) - window.scrollBy (dx, dy); - } -} diff --git a/webdoc/search.css b/webdoc/search.css deleted file mode 100644 index 6e398696..00000000 --- a/webdoc/search.css +++ /dev/null @@ -1,43 +0,0 @@ -#s_spinner, #s_header, #s_morebtn, .s_message { - text-align: center; -} - -#s_header { - margin-bottom: 1em; -} - -div.hidden { - display: none; - visibility: hidden; -} - -#s_results a { - color: #777; -} - -#s_results a:hover { - color: black; -} - -#s_results span.fulltitle { - font-style: italic; - font-size: 80%; -} - -#s_results li { - margin-bottom: 0.5em; -} - -#s_morebtn input { - font-size: x-large; - padding: 5px 14px 6px; -} - -#s_morebtn { - margin-bottom: 1em; -} - -.s_message { - font-size: xx-large; -} - diff --git a/webdoc/search.html b/webdoc/search.html deleted file mode 100644 index 4754118f..00000000 --- a/webdoc/search.html +++ /dev/null @@ -1,16 +0,0 @@ -<html> - <head> - <title></title> - <link rel="stylesheet" type="text/css" href="search.css" /> - </head> - <body> - <div id="search_wrapper"> - <div id="s_header"><h1>Search result(s) for '<span id="s_term"></span>'</h1></div> - <div id="s_results"><ul></ul></div> - <div id="s_morebtn"><input type="button" value="Show more results"></div> - <div id="s_spinner" class="hidden"><img src="/images/spinner.gif" alt="spinner" /></div> - </div> - <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> - <script type="text/javascript" src="fullsearch.js"></script> - </body> -</html> diff --git a/webdoc/search.js b/webdoc/search.js deleted file mode 100644 index 47172199..00000000 --- a/webdoc/search.js +++ /dev/null @@ -1,138 +0,0 @@ -var search_input = $('#fsearch'); -var search_window = $('#fsearch_window'); -var content_frame = $('#content_frame'); -var page_link = $('#pageLink'); -var lis = null; -var page_top_offset = $('#main_part').offset().top; - -change_page = function (pagename) { - content_frame.attr ('src', 'monodoc.ashx?link=' + pagename); - page_link.attr ('href', '?link=' + pagename); - if (window.history && window.history.pushState) - window.history.pushState (null, '', '/?link=' + pagename); -}; -page_link.attr ('href', document.location.search); - -var is_shown = false; -var hide = function () { - if (!is_shown) - return; - search_window.css ({'display' : 'none', 'opacity' : 0}); - is_shown = false; -}; -var show = function () { - if (is_shown) - return; - search_window.css ({'display' : 'block', 'height' : 'auto', 'opacity' : 1.0, 'width': search_input.width() + 'px', 'top': page_top_offset + 'px' }); - is_shown = true; -}; - -search_input.blur (function () { - window.setTimeout (hide, 200); - if (search_input.val ().length == 0) - search_input.css ('width', '19em'); -}); -search_input.focus (function () { - search_input.css ('width', '29em'); - if (search_window.text().length > 0 && search_input.val().length > 0) - show (); - window.setTimeout (function () { - search_input[0].select (); - }, 10); -}); - -search_input.keyup (function (event) { - if ($(this).val () == "") - hide(); - - // Only process if we receive an alnum or backspace or del - if (event.which != 8 && event.which != 46 - && (event.which < 'A'.charCodeAt(0) || event.which > 'Z'.charCodeAt(0)) - && (event.which < '0'.charCodeAt(0) || event.which > '9'.charCodeAt(0))) - return; - - var callback = function (data) { - if (data == null || data.length == 0) - return; - - var items = []; - - $.each (data, function(key, val) { - var item = val.name; - var url = val.url.replace (/[<>]/g, function (c) { return c == '<' ? '{' : '}'; }); - items.push('<li><a href="#" onclick="change_page(\''+url+'\')" title="'+(val.fulltitle == '' ? val.name : val.fulltitle)+'">' + item + '</a></li>'); - }); - - var uls = $('<ul/>', { html: items.join (''), 'style': 'list-style-type:none; margin: 0; padding:0' }); - lis = uls.children ('li'); - var companion = $('#fsearch_companion'); - lis.hover (function () { - var childA = $(this).children('a'); - var offset = childA.offset (); - companion.css ({ 'top': offset.top + 'px', 'right': $('html').outerWidth () - offset.left + 10, 'display': 'block'}); - companion.text(childA.attr ('title')); - }, function () { - companion.css ('display', 'none'); - }); - search_window.empty(); - uls.appendTo ('#fsearch_window'); - show (); - }; - $.getJSON ('monodoc.ashx?fsearch=' + $(this).val (), callback); -}); - -document.getElementById ('fsearch').onsearch = function () { - if (search_input.val () == "") { - hide (); - search_input.blur (); - } -}; - -search_input.keydown (function (event) { - if (lis == null) - return; - var selected = lis.filter('.selected'); - var newSelection = null; - $('#fsearch_companion').css ('display', 'none'); - - switch (event.which) - { - case 13: // return - if (selected.length != 0) { - selected.children ('a').click (); - } else { - // Show full search page - content_frame.attr('src', 'search.html#' + encodeURI(search_input.val ())); - } - hide (); - search_input.blur (); - return false; - case 38: // up - if (selected.length != 0) { - var prev = selected.prev (); - newSelection = prev; - } else { - newSelection = lis.last (); - } - break; - case 40: // down - if (selected.length != 0) { - var next = selected.next (); - if (next.length != 0) - newSelection = next; - } else { - newSelection = lis.first (); - } - break; - } - - if (newSelection != null) { - newSelection.addClass ('selected'); - if (selected != null) { - selected.removeClass ('selected'); - selected.mouseleave(); - } - newSelection.mouseenter(); - selected = newSelection; - } -}); diff --git a/webdoc/server.asmx b/webdoc/server.asmx deleted file mode 100644 index 1967a4ba..00000000 --- a/webdoc/server.asmx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebService Language="c#" Codebehind="server.cs" Class="Monodoc.Contributions" %> diff --git a/webdoc/server.cs b/webdoc/server.cs deleted file mode 100644 index d026cb22..00000000 --- a/webdoc/server.cs +++ /dev/null @@ -1,366 +0,0 @@ -// -// Monodoc server -// -// Author: -// Miguel de Icaza (miguel@ximian.com) -// - -using System; -using System.Collections; -using System.IO; -using System.Web.Mail; -using System.Web.Services; -using System.Web.Services.Protocols; -using System.Data; -using ByteFX.Data.MySqlClient; -using System.Xml; - -namespace Monodoc { - [WebServiceAttribute (Description="Web service for the MonoDoc contribution system")] - public class Contributions : System.Web.Services.WebService - { - const string basedir = "/home/contributions/"; - //const string basedir = "/tmp/contributions/"; - static string connection_string; - - static Contributions () - { - using (StreamReader sr = new StreamReader (File.OpenRead ("connection.string"))){ - connection_string = sr.ReadLine (); - Console.WriteLine ("Connection: " + connection_string); - } - } - - private IDbConnection GetConnection() - { - return new MySqlConnection(connection_string); - } - - private MySqlParameter CreateParameter(string name, object value) - { - return new MySqlParameter (name, value); - } - - static void mail (string recipient, string body) - { - MailMessage m = new MailMessage (); - m.From = "mono-docs-list@ximian.com"; - m.To = recipient; - m.Subject = "Your Monodoc passkey"; - m.Body = String.Format ("\n\nWelcome to the Mono Documentation Effort,\n\n" + - "This is your passkey for contributing to the Mono Documentation effort:\n " + - " {0}\n\n" + - "The Mono Documentation Team (mono-docs-list@ximian.com)", body); - - SmtpMail.SmtpServer = "localhost"; - SmtpMail.Send (m); - } - - // - // 0 => OK to send contributions. - // -1 => Invalid version - // - [WebMethod(Description="Check the client/server version; 0 means that the server can consume your data")] - public int CheckVersion (int version) - { - if (version == 1) - return 0; - return -1; - } - - // - // Return codes: - // -3 invalid characters in login - // -2 Login already registered, password resent. - // -1 Generic error - // 0 password mailed - // - [WebMethod(Description="Requests a registration for a login")] - public int Register (string login) - { - if (login.IndexOf ("'") != -1) - return -3; - - IDbConnection conn = GetConnection(); - conn.Open(); - try - { - IDbCommand cmd = conn.CreateCommand(); - cmd.CommandText = "select password from person where name=@login"; - cmd.Parameters.Add( CreateParameter("@login", login)); - IDataReader reader = cmd.ExecuteReader (); - - if (reader.Read ()){ - string password = (string) reader ["password"]; - mail (login, password); - reader.Close (); - return -2; - } - reader.Close (); - Random rnd = new Random (); - int pass = rnd.Next (); - cmd.CommandText = "INSERT INTO person (name, password, last_serial) VALUES " + - "(@name, @password, 0)"; - cmd.Parameters.Add( CreateParameter("@name",login)); - cmd.Parameters.Add( CreateParameter("@password",pass)); - - cmd.ExecuteNonQuery (); - mail (login, pass.ToString ()); - - return 0; - } catch (Exception e) { - Console.Error.WriteLine (e); - } finally { - conn.Close (); - } - return -1; - } - - [WebMethod (Description="Returns the latest serial number used for a change on the server")] - public int GetSerial (string login, string password) - { - IDbConnection conn = GetConnection(); - conn.Open(); - try - { - IDbCommand cmd = conn.CreateCommand(); - cmd.CommandText = "select last_serial from person where name=@login and password=@password"; - cmd.Parameters.Add( CreateParameter("@login", login)); - cmd.Parameters.Add( CreateParameter("@password", password)); - - object r = cmd.ExecuteScalar(); - if (r != null){ - Console.Error.WriteLine (r); - return (int) r; - } - return -1; - } catch (Exception e){ - Console.Error.WriteLine ("Exception" + e); - } finally { - conn.Close(); - } - return -1; - } - - // -1 Generic error. - // -2 Erroneous XML - int a=1; - [WebMethod (Description="Submits a GlobalChangeSet as a contribution")] - public int Submit (string login, string password, XmlNode node) - { - IDbConnection conn = GetConnection(); - conn.Open(); - try { - IDbCommand cmd = conn.CreateCommand(); - cmd.CommandText = "select * from person where name=@login and password=@password"; - cmd.Parameters.Add( CreateParameter("@login", login)); - cmd.Parameters.Add( CreateParameter("@password", password)); - - IDataReader reader = cmd.ExecuteReader (); - - int ret_val = -1; - - if (reader.Read()){ - int id = (int)reader["person_id"]; - int serial = (int)reader["last_serial"]; - reader.Close (); - - // - // Validate the XML - // - XmlDocument d = new XmlDocument (); - d.AppendChild (d.ImportNode (node, true)); - XmlNodeReader r = new XmlNodeReader (d); - try { - object rr = GlobalChangeset.serializer.Deserialize (r); - } catch { - return -2; - } - - string dudebase = basedir + id; - Directory.CreateDirectory (dudebase); - - d.Save (dudebase + "/" + serial + ".xml"); - IDbTransaction txn = conn.BeginTransaction(); - try { - cmd.CommandText = "UPDATE person SET last_serial=@last_serial WHERE name=@name AND password=@pwd"; - cmd.Parameters.Add( CreateParameter("@last_serial", serial+1)); - cmd.Parameters.Add( CreateParameter("@name", login)); - cmd.Parameters.Add( CreateParameter("@pwd", password)); - cmd.ExecuteNonQuery (); - - - cmd.CommandText = "INSERT INTO status (person_id, serial, status) VALUES (@id, @serial, 0)"; - cmd.Parameters.Add( CreateParameter("@id",id)); - cmd.Parameters.Add( CreateParameter("@serial",serial)); - cmd.ExecuteNonQuery (); - - txn.Commit(); - } catch (Exception e) { - Console.Error.WriteLine ("E: " + e); - } - - ret_val = serial+1; - return ret_val; - } - Console.Error.WriteLine ("Error, going: 4"); - return -4; - } catch (Exception e) { - Console.Error.WriteLine ("Failure in Submit: " + e); - return -3; - } finally { - conn.Close (); - } - } - - bool IsAdmin (IDbConnection conn, string login, string password) - { - IDbCommand cmd = conn.CreateCommand(); - cmd.CommandText = "select person_id,is_admin from person where name=@name and password=@pass"; - cmd.Parameters.Add( CreateParameter("@name",login)); - cmd.Parameters.Add( CreateParameter("@pass",password)); - - int person_id = -1; - bool is_admin = false; - using (IDataReader reader = cmd.ExecuteReader ()){ - if (reader.Read ()){ - person_id = (int) reader ["person_id"]; - is_admin = ((int) reader ["is_admin"]) == 1; - } else - return false; - } - if (person_id == -1 || is_admin == false) - return false; - - return true; - } - - [WebMethod (Description="Obtains the list of pending contributions")] - public PendingChange [] GetPendingChanges (string login, string password) - { - IDbConnection conn = GetConnection(); - conn.Open (); - - try { - if (!IsAdmin (conn, login, password)){ - return new PendingChange [0]; - } - - IDbCommand cmd = conn.CreateCommand(); - ArrayList results = new ArrayList (); - cmd.CommandText = "select status.person_id, serial, person.name from status, person where status=0 and person.person_id = status.person_id"; - using (IDataReader reader = cmd.ExecuteReader ()){ - while (reader.Read ()){ - results.Add (new PendingChange ((string) reader ["name"], (int) reader ["person_id"], (int) reader ["serial"])); - } - } - - PendingChange [] ret = new PendingChange [results.Count]; - results.CopyTo (ret); - return ret; - } catch (Exception e){ - Console.Error.WriteLine (e); - return null; - } finally { - conn.Close (); - } - } - - [WebMethod (Description="Obtains a change set for a user")] - public XmlNode FetchContribution (string login, string password, int person_id, int serial) - { - IDbConnection conn = GetConnection (); - conn.Open (); - try { - if (!IsAdmin (conn, login, password)) - return null; - - XmlDocument d = new XmlDocument (); - string fname = basedir + person_id + "/" + serial + ".xml"; - d.Load (fname); - return d.FirstChild; - } finally { - conn.Close (); - } - } - - [WebMethod (Description="ADMIN: Obtains the number of pending commits")] - public Status GetStatus (string login, string password) - { - IDbConnection conn = GetConnection (); - conn.Open (); - try { - IDbCommand cmd = conn.CreateCommand(); - cmd.CommandText = "select * from person where name=@name and password=@pass"; - cmd.Parameters.Add( CreateParameter("@name",login)); - cmd.Parameters.Add( CreateParameter("@pass",password)); - - IDataReader reader = cmd.ExecuteReader (); - int id = -1; - - if (reader.Read()) - id = (int)reader["person_id"]; - reader.Close (); - if (id == -1) - return null; - - Status s = new Status (); - - cmd.CommandText = String.Format ("select count(*) from status where person_id='{0}'", id); - s.Contributions = (int) cmd.ExecuteScalar (); - cmd.CommandText = String.Format ("select count(*) from status where person_id='{0}' and status='0'", id); - s.Pending = (int) cmd.ExecuteScalar (); - cmd.CommandText = String.Format ("select count(*) from status where person_id='{0}' and status='1'", id); - s.Commited = (int) cmd.ExecuteScalar (); - - return s; - } finally { - conn.Close (); - } - } - - [WebMethod (Description="ADMIN: Updates the status of a contribution")] - public void UpdateStatus (string login, string password, int person_id, int contrib_id, int status) - { - IDbConnection conn = GetConnection(); - conn.Open (); - - try { - if (!IsAdmin (conn, login, password)) - return; - - IDbCommand cmd = conn.CreateCommand(); - cmd.CommandText = "update status set status=@status WHERE person_id=@PID AND serial=@ser"; - cmd.Parameters.Add (CreateParameter ("@status", status)); - cmd.Parameters.Add (CreateParameter ("@PID", person_id)); - cmd.Parameters.Add (CreateParameter ("@ser", contrib_id)); - cmd.ExecuteNonQuery (); - } finally { - conn.Close (); - } - } - } - - public class Status { - public int Contributions; - public int Commited; - public int Pending; - } - - public class PendingChange { - public string Login; - public int ID; - public int Serial; - - public PendingChange (string login, int person_id, int serial) - { - Login = login; - ID = person_id; - Serial = serial; - } - - public PendingChange () - { - } - } -} diff --git a/webdoc/sidebar.css b/webdoc/sidebar.css deleted file mode 100644 index 46106254..00000000 --- a/webdoc/sidebar.css +++ /dev/null @@ -1,134 +0,0 @@ -body { - font-family: Verdana; - margin: 0px !important; - padding: 0px !important; - font-size: 8pt; - background-color: white; - white-space: nowrap; -} - -.tab { - display: none !important; -} - -.activeTab { - padding-top: 15px; - padding-left: 10px; - padding-right: 10px; - display: block !important; -} - -input[type=text] { - border: 1px solid #B1A598; - padding: 2px; -} - -input[type=text]:focus { -} - -.error { - color: red; - font-weight: bold; -} - -ul#indexList { - padding: 0px; - margin-left: 0px; - margin-right: 0px; - margin-bottom: 0px; - margin-top: 10px; -} - -ul#indexList li { - list-style: none; - padding-left: 13px; - padding-top: 2px; - padding-bottom: 2px; - background: url('/images/treenodedot.gif') no-repeat center left; -} - -#contentsList ul { - padding: 0px; - margin-left: 0px; - margin-top: 0px; -} - -#contentsList ul ul{ - padding-left: 15px; - margin: 0px !important; -} - -#contentsList ul li { - list-style: none; - padding-bottom: 3px; -} - -#contentsList ul li a { - text-decoration: none; - color: black; -} - -#contentsList ul li img { - border: 0px; - vertical-align: middle; -} - -#tabs { - position: fixed; - top: 0; - left: 0; - right: 0; -} - -#tabs ul { - margin-left: 0px; - padding-left: 5px; - border-bottom: 1px solid #B1A598; - padding-bottom: 3px; - background-color: #EFEBE7; - padding-top: 10px; - margin-top: 0px !important; - margin-bottom: 0px !important; -} -#tabs { - border-bottom: 2px solid white; -} - - -#tabs ul li { - display: inline; - border-top: 1px solid #B1A598; - border-left: 1px solid #B1A598; - border-right: 1px solid #B1A598; - padding-top: 3px; - padding-bottom: 3px; - padding-left: 5px; - padding-right: 5px; -} - -#tabs ul li.selected, ul#tabs li:hover { - background-color: white; -} -#tabs ul li.selected { - border-bottom: 1px solid white; -} -#tabs ul li a { - color: black; - text-decoration: none; -} - -a.selected { - /*font-weight: bold;*/ - background: #eee; - border: 1px solid #ccc; - padding: 1px; -} - -#errorText { - margin-top: 10px; -} - -#contentList > div.tree-node:first-child > span { - font-size: 130%; - line-height: 200%; -} diff --git a/webdoc/sidebar.js b/webdoc/sidebar.js deleted file mode 100644 index f62b1770..00000000 --- a/webdoc/sidebar.js +++ /dev/null @@ -1,28 +0,0 @@ -function SetSelection(b,v) -{ - if (v){ - t = "activeTab"; - tab = "selected"; - } else { - t = "tab"; - tab = ""; - } - - document.getElementById (b).className = t; - document.getElementById (b + "Tab").className = tab; -} - -function ShowContents () -{ - SetSelection ("contents", true); - SetSelection ("index", false); -} - -function ShowIndex () -{ - SetSelection ("contents", false); - SetSelection ("index", true); - document.getElementById ('indexInput').focus (); -} - - diff --git a/webdoc/tables.sql b/webdoc/tables.sql deleted file mode 100644 index 2e951946..00000000 --- a/webdoc/tables.sql +++ /dev/null @@ -1,21 +0,0 @@ -use monodoc; -drop table person; -drop table status; -create table person ( - name varchar (80) not null, - password varchar (20) not null, - person_id int not null primary key auto_increment, - last_serial int not null, - last_update int not null, - is_admin int not null -); - -create table status ( - person_id int not null, - serial int not null, - status int not null -); - -insert into person (name, password, last_serial, is_admin) values ('miguel@ximian.com', 'login1', 0, 1); -insert into person (name, password, last_serial) values ('nat@nat.org', 'login2', 0); - diff --git a/webdoc/wiki2ecmahelper.xsl b/webdoc/wiki2ecmahelper.xsl deleted file mode 100644 index 4039cd9e..00000000 --- a/webdoc/wiki2ecmahelper.xsl +++ /dev/null @@ -1,70 +0,0 @@ -<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - - <!-- default rule --> - <xsl:template match="*"> - <xsl:copy> - <xsl:copy-of select="@*" /> - <xsl:apply-templates /> - </xsl:copy> - </xsl:template> - - <xsl:template match="code"> - <xsl:element name="c"><xsl:apply-templates /></xsl:element> - </xsl:template> - - <xsl:template match="div"> - <xsl:choose> - <xsl:when test="@class = 'example'"> - <example><xsl:apply-templates /></example> - </xsl:when> - <xsl:when test="@class = 'behavior'"> - <block type="behavior"><xsl:apply-templates /></block> - </xsl:when> - <xsl:when test="@class = 'default'"> - <block type="default"><xsl:apply-templates /></block> - </xsl:when> - <xsl:when test="@class = 'example-block'"> - <block type="example"><xsl:apply-templates /></block> - </xsl:when> - <xsl:when test="@class = 'overrides'"> - <block type="overrides"><xsl:apply-templates /></block> - </xsl:when> - <xsl:when test="@class = 'usage'"> - <block type="usage"><xsl:apply-templates /></block> - </xsl:when> - <xsl:otherwise> - <xsl:copy-of select="." /> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template match="table"> - <list type="table"> - <xsl:if test="tr[1]/th"> - <listheader><item> - <term> - <xsl:apply-templates select="tr[1]/th[1]" /> - </term> - <xsl:for-each select="tr[1]/th[position() > 1]"> - <description> - <xsl:apply-templates /> - </description> - </xsl:for-each> - </item></listheader> - </xsl:if> - <xsl:for-each select="tr"> - <item> - <term> - <xsl:apply-templates select="td[1]" /> - </term> - <xsl:for-each select="td[position() > 1]"> - <description> - <xsl:apply-templates /> - </description> - </xsl:for-each> - </item> - </xsl:for-each> - </list> - </xsl:template> - -</xsl:transform> diff --git a/webdoc/xtree/xloadtree.js b/webdoc/xtree/xloadtree.js deleted file mode 100644 index 24ad21b9..00000000 --- a/webdoc/xtree/xloadtree.js +++ /dev/null @@ -1,276 +0,0 @@ -/*----------------------------------------------------------------------------\ -| XLoadTree 1.11 | -|-----------------------------------------------------------------------------| -| Created by Erik Arvidsson | -| (http://webfx.eae.net/contact.html#erik) | -| For WebFX (http://webfx.eae.net/) | -|-----------------------------------------------------------------------------| -| An extension to xTree that allows sub trees to be loaded at runtime by | -| reading XML files from the server. Works with IE5+ and Mozilla 1.0+ | -|-----------------------------------------------------------------------------| -| Copyright (c) 1999 - 2002 Erik Arvidsson | -|-----------------------------------------------------------------------------| -| This software is provided "as is", without warranty of any kind, express or | -| implied, including but not limited to the warranties of merchantability, | -| fitness for a particular purpose and noninfringement. In no event shall the | -| authors or copyright holders be liable for any claim, damages or other | -| liability, whether in an action of contract, tort or otherwise, arising | -| from, out of or in connection with the software or the use or other | -| dealings in the software. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| This software is available under the three different licenses mentioned | -| below. To use this software you must chose, and qualify, for one of those. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| The WebFX Non-Commercial License http://webfx.eae.net/license.html | -| Permits anyone the right to use the software in a non-commercial context | -| free of charge. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| The WebFX Commercial license http://webfx.eae.net/commercial.html | -| Permits the license holder the right to use the software in a commercial | -| context. Such license must be specifically obtained, however it's valid for | -| any number of implementations of the licensed software. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| GPL - The GNU General Public License http://www.gnu.org/licenses/gpl.txt | -| Permits anyone the right to use and modify the software without limitations | -| as long as proper credits are given and the original and modified source | -| code are included. Requires that the final product, software derivate from | -| the original source or any software utilizing a GPL component, such as | -| this, is also licensed under the GPL license. | -|-----------------------------------------------------------------------------| -| 2001-09-27 | Original Version Posted. | -| 2002-01-19 | Added some simple error handling and string templates for | -| | reporting the errors. | -| 2002-01-28 | Fixed loading issues in IE50 and IE55 that made the tree load | -| | twice. | -| 2002-10-10 | (1.1) Added reload method that reloads the XML file from the | -| | server. | -/ 2003-05-06 | Added support for target attribute | -|-----------------------------------------------------------------------------| -| Dependencies: xtree.js - original xtree library | -| xtree.css - simple css styling of xtree | -| xmlextras.js - provides xml http objects and xml document | -| objects | -|-----------------------------------------------------------------------------| -| Created 2001-09-27 | All changes are in the log above. | Updated 2003-05-06 | -\----------------------------------------------------------------------------*/ - - -webFXTreeConfig.loadingText = "Loading..."; -webFXTreeConfig.loadErrorTextTemplate = "Error loading \"%1%\""; -webFXTreeConfig.emptyErrorTextTemplate = "Error \"%1%\" does not contain any tree items"; - -/* - * WebFXLoadTree class - */ - -function WebFXLoadTree(sText, sXmlSrc, sAction, sBehavior, sIcon, sOpenIcon) { - // call super - this.WebFXTree = WebFXTree; - this.WebFXTree(sText, sAction, sBehavior, sIcon, sOpenIcon); - - // setup default property values - this.src = sXmlSrc; - this.loading = false; - this.loaded = false; - this.errorText = ""; - - // check start state and load if open - if (this.open) - _startLoadXmlTree(this.src, this); - else { - // and create loading item if not - this._loadingItem = new WebFXTreeItem(webFXTreeConfig.loadingText); - this.add(this._loadingItem); - } -} - -WebFXLoadTree.prototype = new WebFXTree; - -// override the expand method to load the xml file -WebFXLoadTree.prototype._webfxtree_expand = WebFXTree.prototype.expand; -WebFXLoadTree.prototype.expand = function() { - if (!this.loaded && !this.loading) { - // load - _startLoadXmlTree(this.src, this); - } - this._webfxtree_expand(); -}; - -/* - * WebFXLoadTreeItem class - */ - -function WebFXLoadTreeItem(sText, sXmlSrc, sAction, eParent, sIcon, sOpenIcon) { - // call super - this.WebFXTreeItem = WebFXTreeItem; - this.WebFXTreeItem(sText, sAction, eParent, sIcon, sOpenIcon); - - // setup default property values - this.src = sXmlSrc; - this.loading = false; - this.loaded = false; - this.errorText = ""; - - // check start state and load if open - if (this.open) - _startLoadXmlTree(this.src, this); - else { - // and create loading item if not - this._loadingItem = new WebFXTreeItem(webFXTreeConfig.loadingText); - this.add(this._loadingItem); - } -} - -WebFXLoadTreeItem.prototype = new WebFXTreeItem; - -// override the expand method to load the xml file -WebFXLoadTreeItem.prototype._webfxtreeitem_expand = WebFXTreeItem.prototype.expand; -WebFXLoadTreeItem.prototype.expand = function() { - if (!this.loaded && !this.loading) { - // load - _startLoadXmlTree(this.src, this); - } - this._webfxtreeitem_expand(); -}; - -// reloads the src file if already loaded -WebFXLoadTree.prototype.reload = -WebFXLoadTreeItem.prototype.reload = function () { - // if loading do nothing - if (this.loaded) { - var open = this.open; - // remove - while (this.childNodes.length > 0) - this.childNodes[this.childNodes.length - 1].remove(); - - this.loaded = false; - - this._loadingItem = new WebFXTreeItem(webFXTreeConfig.loadingText); - this.add(this._loadingItem); - - if (open) - this.expand(); - } - else if (this.open && !this.loading) - _startLoadXmlTree(this.src, this); -}; - -/* - * Helper functions - */ - -// creates the xmlhttp object and starts the load of the xml document -function _startLoadXmlTree(sSrc, jsNode) { - if (jsNode.loading || jsNode.loaded) - return; - jsNode.loading = true; - var xmlHttp = XmlHttp.create(); - xmlHttp.open("GET", sSrc, true); // async - xmlHttp.onreadystatechange = function () { - if (xmlHttp.readyState == 4) { - _xmlFileLoaded(xmlHttp.responseXML, jsNode); - } - }; - // call in new thread to allow ui to update - window.setTimeout(function () { - xmlHttp.send(null); - }, 10); -} - - -// Converts an xml tree to a js tree. See article about xml tree format -function _xmlTreeToJsTree(oNode) { - // retreive attributes - var text = oNode.getAttribute("text"); - var action = oNode.getAttribute("action"); - var parent = null; - var icon = oNode.getAttribute("icon"); - var openIcon = oNode.getAttribute("openIcon"); - var src = oNode.getAttribute("src"); - var target = oNode.getAttribute("target"); - // create jsNode - var jsNode; - if (src != null && src != "") - jsNode = new WebFXLoadTreeItem(text, src, action, parent, icon, openIcon); - else - jsNode = new WebFXTreeItem(text, action, parent, icon, openIcon); - - if (target != "") - jsNode.target = target; - - // go through childNOdes - var cs = oNode.childNodes; - var l = cs.length; - for (var i = 0; i < l; i++) { - if (cs[i].tagName == "tree") - jsNode.add( _xmlTreeToJsTree(cs[i]), true ); - } - - return jsNode; -} - -// Inserts an xml document as a subtree to the provided node -function _xmlFileLoaded(oXmlDoc, jsParentNode) { - if (jsParentNode.loaded) - return; - - var bIndent = false; - var bAnyChildren = false; - jsParentNode.loaded = true; - jsParentNode.loading = false; - - // check that the load of the xml file went well - if( oXmlDoc == null || oXmlDoc.documentElement == null) { - alert(oXmlDoc.xml); - jsParentNode.errorText = parseTemplateString(webFXTreeConfig.loadErrorTextTemplate, - jsParentNode.src); - } - else { - // there is one extra level of tree elements - var root = oXmlDoc.documentElement; - - // loop through all tree children - var cs = root.childNodes; - var l = cs.length; - for (var i = 0; i < l; i++) { - if (cs[i].tagName == "tree") { - bAnyChildren = true; - bIndent = true; - jsParentNode.add( _xmlTreeToJsTree(cs[i]), true); - } - } - - // if no children we got an error - if (!bAnyChildren) - jsParentNode.errorText = parseTemplateString(webFXTreeConfig.emptyErrorTextTemplate, - jsParentNode.src); - } - - // remove dummy - if (jsParentNode._loadingItem != null) { - jsParentNode._loadingItem.remove(); - bIndent = true; - } - - if (bIndent) { - // indent now that all items are added - jsParentNode.indent(); - } - - // show error in status bar - if (jsParentNode.errorText != "") - window.status = jsParentNode.errorText; -} - -// parses a string and replaces %n% with argument nr n -function parseTemplateString(sTemplate) { - var args = arguments; - var s = sTemplate; - - s = s.replace(/\%\%/g, "%"); - - for (var i = 1; i < args.length; i++) - s = s.replace( new RegExp("\%" + i + "\%", "g"), args[i] ) - - return s; -}
\ No newline at end of file diff --git a/webdoc/xtree/xmlextras.js b/webdoc/xtree/xmlextras.js deleted file mode 100644 index 70806c28..00000000 --- a/webdoc/xtree/xmlextras.js +++ /dev/null @@ -1,147 +0,0 @@ -//<script> -////////////////// -// Helper Stuff // -////////////////// - -// used to find the Automation server name -function getDomDocumentPrefix() { - if (getDomDocumentPrefix.prefix) - return getDomDocumentPrefix.prefix; - - var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; - var o; - for (var i = 0; i < prefixes.length; i++) { - try { - // try to create the objects - o = new ActiveXObject(prefixes[i] + ".DomDocument"); - return getDomDocumentPrefix.prefix = prefixes[i]; - } - catch (ex) {}; - } - - throw new Error("Could not find an installed XML parser"); -} - -function getXmlHttpPrefix() { - if (getXmlHttpPrefix.prefix) - return getXmlHttpPrefix.prefix; - - var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; - var o; - for (var i = 0; i < prefixes.length; i++) { - try { - // try to create the objects - o = new ActiveXObject(prefixes[i] + ".XmlHttp"); - return getXmlHttpPrefix.prefix = prefixes[i]; - } - catch (ex) {}; - } - - throw new Error("Could not find an installed XML parser"); -} - -////////////////////////// -// Start the Real stuff // -////////////////////////// - - -// XmlHttp factory -function XmlHttp() {} - -XmlHttp.create = function () { - try { - if (window.XMLHttpRequest) { - var req = new XMLHttpRequest(); - - // some versions of Moz do not support the readyState property - // and the onreadystate event so we patch it! - if (req.readyState == null) { - req.readyState = 1; - req.addEventListener("load", function () { - req.readyState = 4; - if (typeof req.onreadystatechange == "function") - req.onreadystatechange(); - }, false); - } - - return req; - } - if (window.ActiveXObject) { - return new ActiveXObject(getXmlHttpPrefix() + ".XmlHttp"); - } - } - catch (ex) {} - // fell through - throw new Error("Your browser does not support XmlHttp objects"); -}; - -// XmlDocument factory -function XmlDocument() {} - -XmlDocument.create = function () { - try { - // DOM2 - if (document.implementation && document.implementation.createDocument) { - var doc = document.implementation.createDocument("", "", null); - - // some versions of Moz do not support the readyState property - // and the onreadystate event so we patch it! - if (doc.readyState == null) { - doc.readyState = 1; - doc.addEventListener("load", function () { - doc.readyState = 4; - if (typeof doc.onreadystatechange == "function") - doc.onreadystatechange(); - }, false); - } - - return doc; - } - if (window.ActiveXObject) - return new ActiveXObject(getDomDocumentPrefix() + ".DomDocument"); - } - catch (ex) {} - throw new Error("Your browser does not support XmlDocument objects"); -}; - -// Create the loadXML method and xml getter for Mozilla -if (window.DOMParser && - window.XMLSerializer && - window.Node && Node.prototype && Node.prototype.__defineGetter__) { - - // XMLDocument did not extend the Document interface in some versions - // of Mozilla. Extend both! - XMLDocument.prototype.loadXML = - Document.prototype.loadXML = function (s) { - - // parse the string to a new doc - var doc2 = (new DOMParser()).parseFromString(s, "text/xml"); - - // remove all initial children - while (this.hasChildNodes()) - this.removeChild(this.lastChild); - - // insert and import nodes - for (var i = 0; i < doc2.childNodes.length; i++) { - this.appendChild(this.importNode(doc2.childNodes[i], true)); - } - }; - - - /* - * xml getter - * - * This serializes the DOM tree to an XML String - * - * Usage: var sXml = oNode.xml - * - */ - // XMLDocument did not extend the Document interface in some versions - // of Mozilla. Extend both! - XMLDocument.prototype.__defineGetter__("xml", function () { - return (new XMLSerializer()).serializeToString(this); - }); - Document.prototype.__defineGetter__("xml", function () { - return (new XMLSerializer()).serializeToString(this); - }); -}
\ No newline at end of file diff --git a/webdoc/xtree/xtree.css b/webdoc/xtree/xtree.css deleted file mode 100644 index 3630da97..00000000 --- a/webdoc/xtree/xtree.css +++ /dev/null @@ -1,54 +0,0 @@ -body { - font-family: verdana; - font-size: 70.5%; - font-weight: normal; - background-color: #f1f1f1; - color: Black; - margin: 0px 0px 0px 0px; - padding: 0px 0px 0px 0px; -} - -.webfx-tree-container { - margin: 0px; - padding: 0px; - white-space: nowrap; -} - -.webfx-tree-item { - padding: 0px; - margin: 0px; - color: WindowText; - white-space: nowrap; - height: 16px; -} - -.webfx-tree-item a, .webfx-tree-item a:active, .webfx-tree-item a:hover { - margin-left: 3px; - padding: 0px 2px 1px 2px; -} - -.webfx-tree-item a { - color: black; - text-decoration: none; -} - -.webfx-tree-item a:hover { - color: blue; - text-decoration: underline; -} - -.webfx-tree-item a:active { - background: highlight; - color: highlighttext; - text-decoration: none; -} - -.webfx-tree-item img { - vertical-align: middle; - border: 0px; -} - -.webfx-tree-icon { - width:0px; - visibility: hidden; -}
\ No newline at end of file diff --git a/webdoc/xtree/xtree.js b/webdoc/xtree/xtree.js deleted file mode 100644 index 19362e10..00000000 --- a/webdoc/xtree/xtree.js +++ /dev/null @@ -1,541 +0,0 @@ -/*----------------------------------------------------------------------------\ -| Cross Browser Tree Widget 1.17 | -|-----------------------------------------------------------------------------| -| Created by Emil A Eklund | -| (http://webfx.eae.net/contact.html#emil) | -| For WebFX (http://webfx.eae.net/) | -|-----------------------------------------------------------------------------| -| An object based tree widget, emulating the one found in microsoft windows, | -| with persistence using cookies. Works in IE 5+, Mozilla and konqueror 3. | -|-----------------------------------------------------------------------------| -| Copyright (c) 1999 - 2002 Emil A Eklund | -|-----------------------------------------------------------------------------| -| This software is provided "as is", without warranty of any kind, express or | -| implied, including but not limited to the warranties of merchantability, | -| fitness for a particular purpose and noninfringement. In no event shall the | -| authors or copyright holders be liable for any claim, damages or other | -| liability, whether in an action of contract, tort or otherwise, arising | -| from, out of or in connection with the software or the use or other | -| dealings in the software. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| This software is available under the three different licenses mentioned | -| below. To use this software you must chose, and qualify, for one of those. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| The WebFX Non-Commercial License http://webfx.eae.net/license.html | -| Permits anyone the right to use the software in a non-commercial context | -| free of charge. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| The WebFX Commercial license http://webfx.eae.net/commercial.html | -| Permits the license holder the right to use the software in a commercial | -| context. Such license must be specifically obtained, however it's valid for | -| any number of implementations of the licensed software. | -| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | -| GPL - The GNU General Public License http://www.gnu.org/licenses/gpl.txt | -| Permits anyone the right to use and modify the software without limitations | -| as long as proper credits are given and the original and modified source | -| code are included. Requires that the final product, software derivate from | -| the original source or any software utilizing a GPL component, such as | -| this, is also licensed under the GPL license. | -|-----------------------------------------------------------------------------| -| Dependencies: xtree.css (To set up the CSS of the tree classes) | -|-----------------------------------------------------------------------------| -| 2001-01-10 | Original Version Posted. | -| 2001-03-18 | Added getSelected and get/setBehavior that can make it behave | -| | more like windows explorer, check usage for more information. | -| 2001-09-23 | Version 1.1 - New features included keyboard navigation (ie) | -| | and the ability to add and remove nodes dynamically and some | -| | other small tweaks and fixes. | -| 2002-01-27 | Version 1.11 - Bug fixes and improved mozilla support. | -| 2002-06-11 | Version 1.12 - Fixed a bug that prevented the indentation line | -| | from updating correctly under some circumstances. This bug | -| | happened when removing the last item in a subtree and items in | -| | siblings to the remove subtree where not correctly updated. | -| 2002-06-13 | Fixed a few minor bugs cased by the 1.12 bug-fix. | -| 2002-08-20 | Added usePersistence flag to allow disable of cookies. | -| 2002-10-23 | (1.14) Fixed a plus icon issue | -| 2002-10-29 | (1.15) Last changes broke more than they fixed. This version | -| | is based on 1.13 and fixes the bugs 1.14 fixed withou breaking | -| | lots of other things. | -| 2003-02-15 | The selected node can now be made visible even when the tree | -| | control loses focus. It uses a new class declaration in the | -| | css file '.webfx-tree-item a.selected-inactive', by default it | -| | puts a light-gray rectangle around the selected node. | -| 2003-03-16 | Adding target support after lots of lobbying... | -|-----------------------------------------------------------------------------| -| Created 2000-12-11 | All changes are in the log above. | Updated 2003-03-16 | -\----------------------------------------------------------------------------*/ - -var webFXTreeConfig = { - rootIcon : 'xtree/images/foldericon.png', - openRootIcon : 'xtree/images/openfoldericon.png', - folderIcon : 'xtree/images/foldericon.png', - openFolderIcon : 'xtree/images/openfoldericon.png', - fileIcon : 'xtree/images/file.png', - iIcon : 'xtree/images/I.png', - lIcon : 'xtree/images/L.png', - lMinusIcon : 'xtree/images/Lminus.png', - lPlusIcon : 'xtree/images/Lplus.png', - tIcon : 'xtree/images/T.png', - tMinusIcon : 'xtree/images/Tminus.png', - tPlusIcon : 'xtree/images/Tplus.png', - blankIcon : 'xtree/images/blank.png', - defaultText : 'Tree Item', - defaultAction : 'javascript:void(0);', - defaultBehavior : 'classic', - usePersistence : true -}; - -var webFXTreeHandler = { - idCounter : 0, - idPrefix : "webfx-tree-object-", - all : {}, - behavior : null, - selected : null, - onSelect : null, /* should be part of tree, not handler */ - getId : function() { return this.idPrefix + this.idCounter++; }, - toggle : function (oItem) { this.all[oItem.id.replace('-plus','')].toggle(); }, - select : function (oItem) { this.all[oItem.id.replace('-icon','')].select(); }, - focus : function (oItem) { this.all[oItem.id.replace('-anchor','')].focus(); }, - blur : function (oItem) { this.all[oItem.id.replace('-anchor','')].blur(); }, - keydown : function (oItem, e) { return this.all[oItem.id].keydown(e.keyCode); }, - cookies : new WebFXCookie(), - insertHTMLBeforeEnd : function (oElement, sHTML) { - if (oElement.insertAdjacentHTML != null) { - oElement.insertAdjacentHTML("BeforeEnd", sHTML) - return; - } - var df; // DocumentFragment - var r = oElement.ownerDocument.createRange(); - r.selectNodeContents(oElement); - r.collapse(false); - df = r.createContextualFragment(sHTML); - oElement.appendChild(df); - } -}; - -/* - * WebFXCookie class - */ - -function WebFXCookie() { - if (document.cookie.length) { this.cookies = ' ' + document.cookie; } -} - -WebFXCookie.prototype.setCookie = function (key, value) { - document.cookie = key + "=" + escape(value); -} - -WebFXCookie.prototype.getCookie = function (key) { - if (this.cookies) { - var start = this.cookies.indexOf(' ' + key + '='); - if (start == -1) { return null; } - var end = this.cookies.indexOf(";", start); - if (end == -1) { end = this.cookies.length; } - end -= start; - var cookie = this.cookies.substr(start,end); - return unescape(cookie.substr(cookie.indexOf('=') + 1, cookie.length - cookie.indexOf('=') + 1)); - } - else { return null; } -} - -/* - * WebFXTreeAbstractNode class - */ - -function WebFXTreeAbstractNode(sText, sAction) { - this.childNodes = []; - this.id = webFXTreeHandler.getId(); - this.text = sText || webFXTreeConfig.defaultText; - this.action = sAction || webFXTreeConfig.defaultAction; - this._last = false; - webFXTreeHandler.all[this.id] = this; -} - -/* - * To speed thing up if you're adding multiple nodes at once (after load) - * use the bNoIdent parameter to prevent automatic re-indentation and call - * the obj.ident() method manually once all nodes has been added. - */ - -WebFXTreeAbstractNode.prototype.add = function (node, bNoIdent) { - node.parentNode = this; - this.childNodes[this.childNodes.length] = node; - var root = this; - if (this.childNodes.length >= 2) { - this.childNodes[this.childNodes.length - 2]._last = false; - } - while (root.parentNode) { root = root.parentNode; } - if (root.rendered) { - if (this.childNodes.length >= 2) { - document.getElementById(this.childNodes[this.childNodes.length - 2].id + '-plus').src = ((this.childNodes[this.childNodes.length -2].folder)?((this.childNodes[this.childNodes.length -2].open)?webFXTreeConfig.tMinusIcon:webFXTreeConfig.tPlusIcon):webFXTreeConfig.tIcon); - this.childNodes[this.childNodes.length - 2].plusIcon = webFXTreeConfig.tPlusIcon; - this.childNodes[this.childNodes.length - 2].minusIcon = webFXTreeConfig.tMinusIcon; - this.childNodes[this.childNodes.length - 2]._last = false; - } - this._last = true; - var foo = this; - while (foo.parentNode) { - for (var i = 0; i < foo.parentNode.childNodes.length; i++) { - if (foo.id == foo.parentNode.childNodes[i].id) { break; } - } - if (i == foo.parentNode.childNodes.length - 1) { foo.parentNode._last = true; } - else { foo.parentNode._last = false; } - foo = foo.parentNode; - } - webFXTreeHandler.insertHTMLBeforeEnd(document.getElementById(this.id + '-cont'), node.toString()); - if ((!this.folder) && (!this.openIcon)) { - this.icon = webFXTreeConfig.folderIcon; - this.openIcon = webFXTreeConfig.openFolderIcon; - } - if (!this.folder) { this.folder = true; this.collapse(true); } - if (!bNoIdent) { this.indent(); } - } - return node; -} - -WebFXTreeAbstractNode.prototype.toggle = function() { - if (this.folder) { - if (this.open) { this.collapse(); } - else { this.expand(); } -} } - -WebFXTreeAbstractNode.prototype.select = function() { - document.getElementById(this.id + '-anchor').focus(); -} - -WebFXTreeAbstractNode.prototype.deSelect = function() { - document.getElementById(this.id + '-anchor').className = ''; - webFXTreeHandler.selected = null; -} - -WebFXTreeAbstractNode.prototype.focus = function() { - if ((webFXTreeHandler.selected) && (webFXTreeHandler.selected != this)) { webFXTreeHandler.selected.deSelect(); } - webFXTreeHandler.selected = this; - if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.openIcon; } - document.getElementById(this.id + '-anchor').className = 'selected'; - document.getElementById(this.id + '-anchor').focus(); - if (webFXTreeHandler.onSelect) { webFXTreeHandler.onSelect(this); } -} - -WebFXTreeAbstractNode.prototype.blur = function() { - if ((this.openIcon) && (webFXTreeHandler.behavior != 'classic')) { document.getElementById(this.id + '-icon').src = this.icon; } - document.getElementById(this.id + '-anchor').className = 'selected-inactive'; -} - -WebFXTreeAbstractNode.prototype.doExpand = function() { - if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.openIcon; } - if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'block'; } - this.open = true; - if (webFXTreeConfig.usePersistence) { - webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '1'); -} } - -WebFXTreeAbstractNode.prototype.doCollapse = function() { - if (webFXTreeHandler.behavior == 'classic') { document.getElementById(this.id + '-icon').src = this.icon; } - if (this.childNodes.length) { document.getElementById(this.id + '-cont').style.display = 'none'; } - this.open = false; - if (webFXTreeConfig.usePersistence) { - webFXTreeHandler.cookies.setCookie(this.id.substr(18,this.id.length - 18), '0'); -} } - -WebFXTreeAbstractNode.prototype.expandAll = function() { - this.expandChildren(); - if ((this.folder) && (!this.open)) { this.expand(); } -} - -WebFXTreeAbstractNode.prototype.expandChildren = function() { - for (var i = 0; i < this.childNodes.length; i++) { - this.childNodes[i].expandAll(); -} } - -WebFXTreeAbstractNode.prototype.collapseAll = function() { - this.collapseChildren(); - if ((this.folder) && (this.open)) { this.collapse(true); } -} - -WebFXTreeAbstractNode.prototype.collapseChildren = function() { - for (var i = 0; i < this.childNodes.length; i++) { - this.childNodes[i].collapseAll(); -} } - -WebFXTreeAbstractNode.prototype.indent = function(lvl, del, last, level, nodesLeft) { - /* - * Since we only want to modify items one level below ourself, - * and since the rightmost indentation position is occupied by - * the plus icon we set this to -2 - */ - if (lvl == null) { lvl = -2; } - var state = 0; - for (var i = this.childNodes.length - 1; i >= 0 ; i--) { - state = this.childNodes[i].indent(lvl + 1, del, last, level); - if (state) { return; } - } - if (del) { - if ((level >= this._level) && (document.getElementById(this.id + '-plus'))) { - if (this.folder) { - document.getElementById(this.id + '-plus').src = (this.open)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.lPlusIcon; - this.plusIcon = webFXTreeConfig.lPlusIcon; - this.minusIcon = webFXTreeConfig.lMinusIcon; - } - else if (nodesLeft) { document.getElementById(this.id + '-plus').src = webFXTreeConfig.lIcon; } - return 1; - } } - var foo = document.getElementById(this.id + '-indent-' + lvl); - if (foo) { - if ((foo._last) || ((del) && (last))) { foo.src = webFXTreeConfig.blankIcon; } - else { foo.src = webFXTreeConfig.iIcon; } - } - return 0; -} - -/* - * WebFXTree class - */ - -function WebFXTree(sText, sAction, sBehavior, sIcon, sOpenIcon) { - this.base = WebFXTreeAbstractNode; - this.base(sText, sAction); - this.icon = sIcon || webFXTreeConfig.rootIcon; - this.openIcon = sOpenIcon || webFXTreeConfig.openRootIcon; - /* Defaults to open */ - if (webFXTreeConfig.usePersistence) { - this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '0')?false:true; - } else { this.open = true; } - this.folder = true; - this.rendered = false; - this.onSelect = null; - if (!webFXTreeHandler.behavior) { webFXTreeHandler.behavior = sBehavior || webFXTreeConfig.defaultBehavior; } -} - -WebFXTree.prototype = new WebFXTreeAbstractNode; - -WebFXTree.prototype.setBehavior = function (sBehavior) { - webFXTreeHandler.behavior = sBehavior; -}; - -WebFXTree.prototype.getBehavior = function (sBehavior) { - return webFXTreeHandler.behavior; -}; - -WebFXTree.prototype.getSelected = function() { - if (webFXTreeHandler.selected) { return webFXTreeHandler.selected; } - else { return null; } -} - -WebFXTree.prototype.remove = function() { } - -WebFXTree.prototype.expand = function() { - this.doExpand(); -} - -WebFXTree.prototype.collapse = function(b) { - if (!b) { this.focus(); } - this.doCollapse(); -} - -WebFXTree.prototype.getFirst = function() { - return null; -} - -WebFXTree.prototype.getLast = function() { - return null; -} - -WebFXTree.prototype.getNextSibling = function() { - return null; -} - -WebFXTree.prototype.getPreviousSibling = function() { - return null; -} - -WebFXTree.prototype.keydown = function(key) { - if (key == 39) { - if (!this.open) { this.expand(); } - else if (this.childNodes.length) { this.childNodes[0].select(); } - return false; - } - if (key == 37) { this.collapse(); return false; } - if ((key == 40) && (this.open) && (this.childNodes.length)) { this.childNodes[0].select(); return false; } - return true; -} - -WebFXTree.prototype.toString = function() { - var str = "<div id=\"" + this.id + "\" ondblclick=\"webFXTreeHandler.toggle(this);\" class=\"webfx-tree-item\" onkeydown=\"return webFXTreeHandler.keydown(this, event)\">" + - "<img id=\"" + this.id + "-icon\" class=\"webfx-tree-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\">" + - "<a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + - (this.target ? " target=\"" + this.target + "\"" : "") + - ">" + this.text + "</a></div>" + - "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">"; - var sb = []; - for (var i = 0; i < this.childNodes.length; i++) { - sb[i] = this.childNodes[i].toString(i, this.childNodes.length); - } - this.rendered = true; - return str + sb.join("") + "</div>"; -}; - -/* - * WebFXTreeItem class - */ - -function WebFXTreeItem(sText, sAction, eParent, sIcon, sOpenIcon) { - this.base = WebFXTreeAbstractNode; - this.base(sText, sAction); - /* Defaults to close */ - if (webFXTreeConfig.usePersistence) { - this.open = (webFXTreeHandler.cookies.getCookie(this.id.substr(18,this.id.length - 18)) == '1')?true:false; - } else { this.open = false; } - if (sIcon) { this.icon = sIcon; } - if (sOpenIcon) { this.openIcon = sOpenIcon; } - if (eParent) { eParent.add(this); } -} - -WebFXTreeItem.prototype = new WebFXTreeAbstractNode; - -WebFXTreeItem.prototype.remove = function() { - var iconSrc = document.getElementById(this.id + '-plus').src; - var parentNode = this.parentNode; - var prevSibling = this.getPreviousSibling(true); - var nextSibling = this.getNextSibling(true); - var folder = this.parentNode.folder; - var last = ((nextSibling) && (nextSibling.parentNode) && (nextSibling.parentNode.id == parentNode.id))?false:true; - this.getPreviousSibling().focus(); - this._remove(); - if (parentNode.childNodes.length == 0) { - document.getElementById(parentNode.id + '-cont').style.display = 'none'; - parentNode.doCollapse(); - parentNode.folder = false; - parentNode.open = false; - } - if (!nextSibling || last) { parentNode.indent(null, true, last, this._level, parentNode.childNodes.length); } - if ((prevSibling == parentNode) && !(parentNode.childNodes.length)) { - prevSibling.folder = false; - prevSibling.open = false; - iconSrc = document.getElementById(prevSibling.id + '-plus').src; - iconSrc = iconSrc.replace('minus', '').replace('plus', ''); - document.getElementById(prevSibling.id + '-plus').src = iconSrc; - document.getElementById(prevSibling.id + '-icon').src = webFXTreeConfig.fileIcon; - } - if (document.getElementById(prevSibling.id + '-plus')) { - if (parentNode == prevSibling.parentNode) { - iconSrc = iconSrc.replace('minus', '').replace('plus', ''); - document.getElementById(prevSibling.id + '-plus').src = iconSrc; -} } } - -WebFXTreeItem.prototype._remove = function() { - for (var i = this.childNodes.length - 1; i >= 0; i--) { - this.childNodes[i]._remove(); - } - for (var i = 0; i < this.parentNode.childNodes.length; i++) { - if (this == this.parentNode.childNodes[i]) { - for (var j = i; j < this.parentNode.childNodes.length; j++) { - this.parentNode.childNodes[j] = this.parentNode.childNodes[j+1]; - } - this.parentNode.childNodes.length -= 1; - if (i + 1 == this.parentNode.childNodes.length) { this.parentNode._last = true; } - break; - } } - webFXTreeHandler.all[this.id] = null; - var tmp = document.getElementById(this.id); - if (tmp) { tmp.parentNode.removeChild(tmp); } - tmp = document.getElementById(this.id + '-cont'); - if (tmp) { tmp.parentNode.removeChild(tmp); } -} - -WebFXTreeItem.prototype.expand = function() { - this.doExpand(); - document.getElementById(this.id + '-plus').src = this.minusIcon; -} - -WebFXTreeItem.prototype.collapse = function(b) { - if (!b) { this.focus(); } - this.doCollapse(); - document.getElementById(this.id + '-plus').src = this.plusIcon; -} - -WebFXTreeItem.prototype.getFirst = function() { - return this.childNodes[0]; -} - -WebFXTreeItem.prototype.getLast = function() { - if (this.childNodes[this.childNodes.length - 1].open) { return this.childNodes[this.childNodes.length - 1].getLast(); } - else { return this.childNodes[this.childNodes.length - 1]; } -} - -WebFXTreeItem.prototype.getNextSibling = function() { - for (var i = 0; i < this.parentNode.childNodes.length; i++) { - if (this == this.parentNode.childNodes[i]) { break; } - } - if (++i == this.parentNode.childNodes.length) { return this.parentNode.getNextSibling(); } - else { return this.parentNode.childNodes[i]; } -} - -WebFXTreeItem.prototype.getPreviousSibling = function(b) { - for (var i = 0; i < this.parentNode.childNodes.length; i++) { - if (this == this.parentNode.childNodes[i]) { break; } - } - if (i == 0) { return this.parentNode; } - else { - if ((this.parentNode.childNodes[--i].open) || (b && this.parentNode.childNodes[i].folder)) { return this.parentNode.childNodes[i].getLast(); } - else { return this.parentNode.childNodes[i]; } -} } - -WebFXTreeItem.prototype.keydown = function(key) { - if ((key == 39) && (this.folder)) { - if (!this.open) { this.expand(); } - else { this.getFirst().select(); } - return false; - } - else if (key == 37) { - if (this.open) { this.collapse(); } - else { this.parentNode.select(); } - return false; - } - else if (key == 40) { - if (this.open) { this.getFirst().select(); } - else { - var sib = this.getNextSibling(); - if (sib) { sib.select(); } - } - return false; - } - else if (key == 38) { this.getPreviousSibling().select(); return false; } - return true; -} - -WebFXTreeItem.prototype.toString = function (nItem, nItemCount) { - var foo = this.parentNode; - var indent = ''; - if (nItem + 1 == nItemCount) { this.parentNode._last = true; } - var i = 0; - while (foo.parentNode) { - foo = foo.parentNode; - indent = "<img id=\"" + this.id + "-indent-" + i + "\" src=\"" + ((foo._last)?webFXTreeConfig.blankIcon:webFXTreeConfig.iIcon) + "\">" + indent; - i++; - } - this._level = i; - if (this.childNodes.length) { this.folder = 1; } - else { this.open = false; } - if ((this.folder) || (webFXTreeHandler.behavior != 'classic')) { - if (!this.icon) { this.icon = webFXTreeConfig.folderIcon; } - if (!this.openIcon) { this.openIcon = webFXTreeConfig.openFolderIcon; } - } - else if (!this.icon) { this.icon = webFXTreeConfig.fileIcon; } - var label = this.text.replace(/</g, '<').replace(/>/g, '>'); - var str = "<div id=\"" + this.id + "\" ondblclick=\"webFXTreeHandler.toggle(this);\" class=\"webfx-tree-item\" onkeydown=\"return webFXTreeHandler.keydown(this, event)\">" + - indent + - "<img id=\"" + this.id + "-plus\" src=\"" + ((this.folder)?((this.open)?((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon):((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon)):((this.parentNode._last)?webFXTreeConfig.lIcon:webFXTreeConfig.tIcon)) + "\" onclick=\"webFXTreeHandler.toggle(this);\">" + - "<img id=\"" + this.id + "-icon\" class=\"webfx-tree-icon\" src=\"" + ((webFXTreeHandler.behavior == 'classic' && this.open)?this.openIcon:this.icon) + "\" onclick=\"webFXTreeHandler.select(this);\">" + - "<a href=\"" + this.action + "\" id=\"" + this.id + "-anchor\" onfocus=\"webFXTreeHandler.focus(this);\" onblur=\"webFXTreeHandler.blur(this);\"" + - (this.target ? " target=\"" + this.target + "\"" : "") + - ">" + label + "</a></div>" + - "<div id=\"" + this.id + "-cont\" class=\"webfx-tree-container\" style=\"display: " + ((this.open)?'block':'none') + ";\">"; - var sb = []; - for (var i = 0; i < this.childNodes.length; i++) { - sb[i] = this.childNodes[i].toString(i,this.childNodes.length); - } - this.plusIcon = ((this.parentNode._last)?webFXTreeConfig.lPlusIcon:webFXTreeConfig.tPlusIcon); - this.minusIcon = ((this.parentNode._last)?webFXTreeConfig.lMinusIcon:webFXTreeConfig.tMinusIcon); - return str + sb.join("") + "</div>"; -}
\ No newline at end of file |