pull/1/head
Jordan Wages 8 months ago
parent ecb8e2b899
commit 7abc5eb6fa
  1. 5
      .gitignore
  2. 1
      easy-mail-discussion/easy-mail-discussion-cli/easy-mail-discussion-cli.csproj
  3. 1
      easy-mail-discussion/easy-mail-discussion-common/easy-mail-discussion-common.csproj
  4. 4
      easy-mail-discussion/easy-mail-discussion-web/Controllers/BaseController.cs
  5. 1
      easy-mail-discussion/easy-mail-discussion-web/easy-mail-discussion-web.csproj
  6. BIN
      sandcastle-documentation-project/Help/CloseSearch.png
  7. BIN
      sandcastle-documentation-project/Help/CollapseAll.png
  8. BIN
      sandcastle-documentation-project/Help/Collapsed.gif
  9. BIN
      sandcastle-documentation-project/Help/Expanded.gif
  10. 156
      sandcastle-documentation-project/Help/FillNode.aspx
  11. 52
      sandcastle-documentation-project/Help/FillNode.php
  12. 152
      sandcastle-documentation-project/Help/Index.aspx
  13. BIN
      sandcastle-documentation-project/Help/Index.gif
  14. BIN
      sandcastle-documentation-project/Help/Item.gif
  15. 100
      sandcastle-documentation-project/Help/LoadIndexKeywords.aspx
  16. 68
      sandcastle-documentation-project/Help/LoadIndexKeywords.php
  17. BIN
      sandcastle-documentation-project/Help/Search.gif
  18. 235
      sandcastle-documentation-project/Help/SearchHelp.aspx
  19. 169
      sandcastle-documentation-project/Help/SearchHelp.inc.php
  20. 58
      sandcastle-documentation-project/Help/SearchHelp.php
  21. BIN
      sandcastle-documentation-project/Help/Splitter.gif
  22. BIN
      sandcastle-documentation-project/Help/SyncTOC.gif
  23. 141
      sandcastle-documentation-project/Help/TOC.css
  24. 906
      sandcastle-documentation-project/Help/TOC.js
  25. 34
      sandcastle-documentation-project/Help/Web.Config
  26. 704
      sandcastle-documentation-project/Help/WebKI.xml
  27. 440
      sandcastle-documentation-project/Help/WebTOC.xml
  28. 12
      sandcastle-documentation-project/Help/Working/AspNet.xml
  29. 30592
      sandcastle-documentation-project/Help/Working/BouncyCastle.Crypto.xml
  30. 39
      sandcastle-documentation-project/Help/Working/BuildTopics.proj
  31. 19
      sandcastle-documentation-project/Help/Working/CSharp.xml
  32. 3201
      sandcastle-documentation-project/Help/Working/CommandLine.xml
  33. 51
      sandcastle-documentation-project/Help/Working/ExtractHtmlInfo.proj
  34. 23
      sandcastle-documentation-project/Help/Working/FSharp.xml
  35. 63
      sandcastle-documentation-project/Help/Working/GenerateInheritedDocs.config
  36. 36
      sandcastle-documentation-project/Help/Working/GenerateInheritedDocs.proj
  37. 192
      sandcastle-documentation-project/Help/Working/GenerateRefInfo-cd48504d-3ff1-4911-9185-8f1308d53417.proj
  38. 3223
      sandcastle-documentation-project/Help/Working/HtmlAgilityPack.xml
  39. 32
      sandcastle-documentation-project/Help/Working/JScript.xml
  40. 20
      sandcastle-documentation-project/Help/Working/JSharp.xml
  41. 23
      sandcastle-documentation-project/Help/Working/JavaScript.xml
  42. 217
      sandcastle-documentation-project/Help/Working/MRefBuilder.config
  43. 60732
      sandcastle-documentation-project/Help/Working/MailKit.xml
  44. 24
      sandcastle-documentation-project/Help/Working/ManagedCPlusPlus.xml
  45. 3459
      sandcastle-documentation-project/Help/Working/Microsoft.Data.Sqlite.xml
  46. 8
      sandcastle-documentation-project/Help/Working/Microsoft.DotNet.PlatformAbstractions.xml
  47. 413
      sandcastle-documentation-project/Help/Working/Microsoft.EntityFrameworkCore.Abstractions.xml
  48. 38132
      sandcastle-documentation-project/Help/Working/Microsoft.EntityFrameworkCore.Relational.xml
  49. 2530
      sandcastle-documentation-project/Help/Working/Microsoft.EntityFrameworkCore.Sqlite.xml
  50. 69433
      sandcastle-documentation-project/Help/Working/Microsoft.EntityFrameworkCore.xml
  51. 442
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.Caching.Abstractions.xml
  52. 144
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.Caching.Memory.xml
  53. 173
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.Configuration.Abstractions.xml
  54. 752
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.DependencyInjection.Abstractions.xml
  55. 140
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.DependencyInjection.xml
  56. 419
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.DependencyModel.xml
  57. 657
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.Logging.Abstractions.xml
  58. 287
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.Logging.xml
  59. 1254
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.Options.xml
  60. 756
      sandcastle-documentation-project/Help/Working/Microsoft.Extensions.Primitives.xml
  61. 52153
      sandcastle-documentation-project/Help/Working/MimeKit.xml
  62. 27691
      sandcastle-documentation-project/Help/Working/NLog.xml
  63. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/CloseSearch.png
  64. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/CollapseAll.png
  65. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/Collapsed.gif
  66. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/Expanded.gif
  67. 156
      sandcastle-documentation-project/Help/Working/Output/Website/FillNode.aspx
  68. 52
      sandcastle-documentation-project/Help/Working/Output/Website/FillNode.php
  69. 152
      sandcastle-documentation-project/Help/Working/Output/Website/Index.aspx
  70. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/Index.gif
  71. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/Item.gif
  72. 100
      sandcastle-documentation-project/Help/Working/Output/Website/LoadIndexKeywords.aspx
  73. 68
      sandcastle-documentation-project/Help/Working/Output/Website/LoadIndexKeywords.php
  74. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/Search.gif
  75. 235
      sandcastle-documentation-project/Help/Working/Output/Website/SearchHelp.aspx
  76. 169
      sandcastle-documentation-project/Help/Working/Output/Website/SearchHelp.inc.php
  77. 58
      sandcastle-documentation-project/Help/Working/Output/Website/SearchHelp.php
  78. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/Splitter.gif
  79. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/SyncTOC.gif
  80. 141
      sandcastle-documentation-project/Help/Working/Output/Website/TOC.css
  81. 906
      sandcastle-documentation-project/Help/Working/Output/Website/TOC.js
  82. 34
      sandcastle-documentation-project/Help/Working/Output/Website/Web.Config
  83. BIN
      sandcastle-documentation-project/Help/Working/Output/Website/favicon.ico
  84. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_100.json
  85. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_101.json
  86. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_102.json
  87. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_103.json
  88. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_104.json
  89. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_105.json
  90. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_107.json
  91. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_108.json
  92. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_109.json
  93. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_110.json
  94. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_111.json
  95. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_112.json
  96. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_113.json
  97. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_114.json
  98. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_115.json
  99. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_116.json
  100. 1
      sandcastle-documentation-project/Help/Working/Output/Website/fti/FTI_117.json
  101. Some files were not shown because too many files have changed in this diff Show More

5
.gitignore vendored

@ -389,4 +389,7 @@ FodyWeavers.xsd
*.sln.iml
# Generated database file when debugging with Docker
database.db*
database.db*
#Sandcastle output
sandcastle-documentation-project/Help*

@ -4,6 +4,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyMailDiscussion.Cli</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>

@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyMailDiscussion.Common</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>

@ -6,7 +6,9 @@ using System;
namespace EasyMailDiscussion.Web.Controllers
{
/// <summary> A controller used as a base class in the <see cref="EasyMailDiscussion.Web"/> project.. </summary>
/// <summary>
/// A controller used as a base class in the <see cref="EasyMailDiscussion.Web"/> project.
/// </summary>
public class BaseController : Controller
{
#region Members

@ -5,6 +5,7 @@
<RootNamespace>EasyMailDiscussion.Web</RootNamespace>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileTag>easy-mail-discussion</DockerfileTag>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

@ -1,156 +0,0 @@
<%@ Page Language="C#" EnableViewState="False" %>
<script runat="server">
//===============================================================================================================
// System : Sandcastle Help File Builder
// File : FillNode.aspx
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 04/09/2014
// Note : Copyright 2007-2014, Eric Woodruff, All rights reserved
//
// This file contains the code used to dynamically load a parent node with its child table of content nodes when
// first expanded.
//
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
// distributed with the code and can be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
// and source files.
//
// Date Who Comments
// ==============================================================================================================
// 06/21/2007 EFW Created the code
// 07/17/2013 EFW Merged code contributed by Procomp Solutions Oy that improves performance for large TOCs by
// using XML serialization and caching.
//===============================================================================================================
private static readonly TocNode[] NoChildNodes = new TocNode[0];
private static readonly object TocLoadSyncObject = new object();
// This is used to contain the serialized table of contents
[XmlRoot("HelpTOC")]
public sealed class TableOfContents
{
[XmlElement("HelpTOCNode")]
public TocNode[] ChildNodes;
[XmlIgnore]
public IDictionary<string, TocNode> NodesById;
internal void IndexNodes()
{
this.NodesById = new Dictionary<string, TocNode>();
AddToIndex(this.NodesById, this.ChildNodes);
}
private static void AddToIndex(IDictionary<string, TocNode> nodesById, TocNode[] nodes)
{
foreach(TocNode node in nodes)
if(!String.IsNullOrEmpty(node.Id))
{
nodesById.Add(node.Id, node);
AddToIndex(nodesById, node.ChildNodes);
}
}
}
// This represents a single node in the table of contents
public sealed class TocNode
{
[XmlAttribute("Id")]
public string Id;
[XmlAttribute("Title")]
public string Title;
[XmlAttribute("Url")]
public string Url;
[XmlElement("HelpTOCNode")]
public TocNode[] ChildNodes;
}
// Load the TOC info and store it in the cache on first use
private TableOfContents GetToc()
{
string tocPath = Server.MapPath("WebTOC.xml");
string tocCacheKey = tocPath;
lock(TocLoadSyncObject)
{
TableOfContents toc = this.Cache[tocCacheKey] as TableOfContents;
if(toc == null)
{
CacheDependency cacheDependency = new CacheDependency(tocPath);
using(XmlReader reader = XmlReader.Create(tocPath, new XmlReaderSettings()))
{
toc = (TableOfContents)new XmlSerializer(typeof(TableOfContents)).Deserialize(reader);
toc.IndexNodes();
}
this.Cache.Insert(tocCacheKey, toc, cacheDependency);
}
return toc;
}
}
// Load the requested node with its children
protected override void Render(HtmlTextWriter writer)
{
StringBuilder sb = new StringBuilder(10240);
TableOfContents toc = this.GetToc();
// The ID to use should be passed in the query string
string expandedId = this.Request.QueryString["Id"];
TocNode expandedNode;
if(toc.NodesById.TryGetValue(expandedId, out expandedNode))
{
foreach(TocNode childNode in expandedNode.ChildNodes ?? NoChildNodes)
{
if(childNode.ChildNodes != null && childNode.ChildNodes.Length != 0)
{
// Write out a parent TOC entry
string childUrl = childNode.Url;
string childTarget;
if(!String.IsNullOrEmpty(childUrl))
childTarget = " target=\"TopicContent\"";
else
{
childUrl = "#";
childTarget = String.Empty;
}
sb.AppendFormat("<div class=\"TreeNode\">\r\n" +
"<img class=\"TreeNodeImg\" onclick=\"javascript: Toggle(this);\" src=\"Collapsed.gif\"/>" +
"<a class=\"UnselectedNode\" onclick=\"javascript: return Expand(this);\" " +
"href=\"{0}\"{1}>{2}</a>\r\n" +
"<div id=\"{3}\" class=\"Hidden\"></div>\r\n" +
"</div>\r\n", HttpUtility.HtmlEncode(childUrl), childTarget, HttpUtility.HtmlEncode(childNode.Title),
childNode.Id);
}
else
{
string childUrl = childNode.Url;
if(String.IsNullOrEmpty(childUrl))
childUrl = "about:blank";
// Write out a TOC entry that has no children
sb.AppendFormat("<div class=\"TreeItem\">\r\n" +
"<img src=\"Item.gif\"/><a class=\"UnselectedNode\" " +
"onclick=\"javascript: return SelectNode(this);\" href=\"{0}\" " +
"target=\"TopicContent\">{1}</a>\r\n" +
"</div>\r\n", HttpUtility.HtmlEncode(childUrl), HttpUtility.HtmlEncode(childNode.Title));
}
}
writer.Write(sb.ToString());
}
else
writer.Write("<b>TOC node not found!</b>");
}
</script>

@ -1,52 +0,0 @@
<?
// Contributed to the Sandcastle Help File Builder project by Thomas Levesque
header("Content-Type: text/html; charset=utf-8");
$toc = new DOMDocument();
$toc->load('WebTOC.xml');
$xpath = new DOMXPath($toc);
$id = $_GET["Id"];
$nodes = $xpath->query("//HelpTOCNode[@Id='$id']/*");
if ($nodes->length == 0)
{
?>
<b>TOC node not found!</b>
<?
die();
}
foreach($nodes as $node)
{
$id = $node->getAttribute("Id");
$url = $node->getAttribute("Url");
$title = $node->getAttribute("Title");
if (empty($url))
{
$url = "#";
$target = "";
}
else
{
$target = " target=\"TopicContent\"";
}
if ($node->hasChildNodes())
{
?>
<div class="TreeNode">
<img class="TreeNodeImg" onclick="javascript: Toggle(this);" src="Collapsed.gif"/>
<a class="UnselectedNode" onclick="javascript: Expand(this);" href="<?= $url ?>"<?= $target ?>><?= $title ?></a>
<div id="<?= $id ?>" class="Hidden"></div>
</div>
<?
}
else
{
?>
<div class="TreeItem">
<img src="Item.gif"/>
<a class="UnselectedNode" onclick="javascript: SelectNode(this);" href="<?= $url ?>"<?= $target ?>><?= $title ?></a>
</div>
<?
}
}
?>

@ -1,152 +0,0 @@
<%@ Page Language="C#" EnableViewState="False" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head runat="server">
<title>A Sandcastle Documented Class Library - Table of Content</title>
<link rel="stylesheet" href="TOC.css" />
<link rel="shortcut icon" href="favicon.ico"/>
<script type="text/javascript" src="TOC.js"></script>
</head>
<body onload="javascript: Initialize('.aspx');" onresize="javascript: ResizeTree();">
<form id="IndexForm" runat="server">
<div id="TOCDiv" class="TOCDiv">
<div id="divSearchOpts" class="SearchOpts" style="height: 100px; display: none;">
<img class="TOCLink" onclick="javascript: ShowHideSearch(false);"
src="CloseSearch.png" height="17" width="17" alt="Hide search" style="float: right;"/>
Keyword(s) for which to search:
<input id="txtSearchText" type="text" style="width: 100%;"
onkeypress="javascript: return OnSearchTextKeyPress(event);" /><br />
<input id="chkSortByTitle" type="checkbox" /><label for="chkSortByTitle">&nbsp;Sort results by title</label><br />
<input type="button" value="Search" onclick="javascript: return PerformSearch();" />
</div>
<div id="divIndexOpts" class="IndexOpts" style="height: 25px; display: none;">
<img class="TOCLink" onclick="javascript: ShowHideIndex(false);"
src="CloseSearch.png" height="17" width="17" alt="Hide index" style="float: right;"/>
Keyword Index
</div>
<div id="divNavOpts" class="NavOpts" style="height: 20px;">
<img class="TOCLink" onclick="javascript: SyncTOC();" src="SyncTOC.gif"
height="16" width="16" alt="Sync to TOC"/>
<img class="TOCLink" onclick="javascript: ExpandOrCollapseAll(false);"
src="CollapseAll.png" height="16" width="16" alt="Collapse all" />
<img class="TOCLink" onclick="javascript: ShowHideIndex(true);"
src="Index.gif" height="16" width="16" alt="Index" />
<img class="TOCLink" onclick="javascript: ShowHideSearch(true);"
src="Search.gif" height="16" width="16" alt="Search" />
<a href="#" title="Click to obtain a direct link to the displayed topic"
style="margin-left: 10px; vertical-align: top;"
onclick="javascript: ShowDirectLink();">Direct Link</a>
</div>
<div class="Tree" id="divSearchResults" style="display: none;"
onselectstart="javascript: return false;">
</div>
<div class="Tree" id="divIndexResults" style="display: none;"
onselectstart="javascript: return false;">
</div>
<div class="Tree" id="divTree" onselectstart="javascript: return false;">
<asp:Literal ID="lcTOC" runat="server" />
</div>
</div>
<div id="TOCSizer" class="TOCSizer" onmousedown="OnMouseDown(event)" onselectstart="javascript: return false;"></div>
<iframe id="TopicContent" name="TopicContent" class="TopicContent" src="html/R_Project_Documentation.htm">
This page uses an IFRAME but your browser does not support it.
</iframe>
</form>
</body>
</html>
<script runat="server">
//===============================================================================================================
// System : Sandcastle Help File Builder
// File : Index.aspx
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 04/09/2014
// Note : Copyright 2007-2014, Eric Woodruff, All rights reserved
//
// This file contains the code used to display the index page for a website produced by the help file builder.
// The root nodes are loaded for the table of content. Child nodes are loaded dynamically when first expanded
// using an Ajax call.
//
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
// distributed with the code and can be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
// and source files.
//
// Date Who Comments
// ==============================================================================================================
// 06/21/2007 EFW Created the code
// 02/18/2012 EFW Merged code from tom103 to show direct link
//===============================================================================================================
protected void Page_Load(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder(10240);
string id, url, target, title;
XPathDocument toc = new XPathDocument(Server.MapPath("WebTOC.xml"));
XPathNavigator navToc = toc.CreateNavigator();
XPathNodeIterator root = navToc.Select("HelpTOC/*");
foreach(XPathNavigator node in root)
{
if(node.HasChildren)
{
// Write out a parent TOC entry
id = node.GetAttribute("Id", String.Empty);
title = node.GetAttribute("Title", String.Empty);
url = node.GetAttribute("Url", String.Empty);
if(!String.IsNullOrEmpty(url))
target = " target=\"TopicContent\"";
else
{
url = "#";
target = String.Empty;
}
sb.AppendFormat("<div class=\"TreeNode\">\r\n" +
"<img class=\"TreeNodeImg\" " +
"onclick=\"javascript: Toggle(this);\" " +
"src=\"Collapsed.gif\"/><a class=\"UnselectedNode\" " +
"onclick=\"javascript: return Expand(this);\" " +
"href=\"{0}\"{1}>{2}</a>\r\n" +
"<div id=\"{3}\" class=\"Hidden\"></div>\r\n</div>\r\n",
HttpUtility.HtmlEncode(url), target, HttpUtility.HtmlEncode(title), id);
}
else
{
title = node.GetAttribute("Title", String.Empty);
url = node.GetAttribute("Url", String.Empty);
if(String.IsNullOrEmpty(url))
url = "about:blank";
// Write out a TOC entry that has no children
sb.AppendFormat("<div class=\"TreeItem\">\r\n" +
"<img src=\"Item.gif\"/>" +
"<a class=\"UnselectedNode\" " +
"onclick=\"javascript: return SelectNode(this);\" " +
"href=\"{0}\" target=\"TopicContent\">{1}</a>\r\n" +
"</div>\r\n", HttpUtility.HtmlEncode(url), HttpUtility.HtmlEncode(title));
}
}
lcTOC.Text = sb.ToString();
}
</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

@ -1,100 +0,0 @@
<%@ Page Language="C#" EnableViewState="False" %>
<script runat="server">
//===============================================================================================================
// System : Sandcastle Help File Builder
// File : LoadIndexKeywords.aspx
// Author : Eric Woodruff (Eric@EWoodruff.us) from code by Ferdinand Prantl
// Updated : 04/09/2014
// Note : Copyright 2008-2014, Eric Woodruff, All rights reserved
//
// This file contains the code used to search for keywords within the help topics using the full-text index
// files created by the help file builder.
//
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
// distributed with the code and can be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
// and source files.
//
// Date Who Comments
// ==============================================================================================================
// 04/01/2008 EFW Created the code
//===============================================================================================================
/// <summary>
/// Render the keyword index
/// </summary>
/// <param name="writer">The writer to which the results are written</param>
protected override void Render(HtmlTextWriter writer)
{
XmlDocument ki;
XmlNode root, node;
StringBuilder sb = new StringBuilder(10240);
int startIndex = 0, endIndex;
string url, target;
ki = new XmlDocument();
ki.Load(Server.MapPath("WebKI.xml"));
root = ki.SelectSingleNode("HelpKI");
if(Request.QueryString["StartIndex"] != null)
startIndex = Convert.ToInt32(Request.QueryString["StartIndex"]) * 128;
endIndex = startIndex + 128;
if(endIndex > root.ChildNodes.Count)
endIndex = root.ChildNodes.Count;
if(startIndex > 0)
{
sb.Append("<div class=\"IndexItem\">\r\n" +
"<span>&nbsp;</span><a class=\"UnselectedNode\" " +
"onclick=\"javascript: return ChangeIndexPage(-1);\" " +
"href=\"#\"><b><< Previous page</b></a>\r\n</div>\r\n");
}
while(startIndex < endIndex)
{
node = root.ChildNodes[startIndex];
if(node.Attributes["Url"] == null)
{
url = "#";
target = String.Empty;
}
else
{
url = node.Attributes["Url"].Value;
target = " target=\"TopicContent\"";
}
sb.AppendFormat("<div class=\"IndexItem\">\r\n" +
"<span>&nbsp;</span><a class=\"UnselectedNode\" " +
"onclick=\"javascript: return SelectIndexNode(this);\" " +
"href=\"{0}\"{1}>{2}</a>\r\n", HttpUtility.HtmlEncode(url), target,
HttpUtility.HtmlEncode(node.Attributes["Title"].Value));
if(node.ChildNodes.Count != 0)
foreach(XmlNode subNode in node.ChildNodes)
sb.AppendFormat("<div class=\"IndexSubItem\">\r\n" +
"<img src=\"Item.gif\"/><a class=\"UnselectedNode\" " +
"onclick=\"javascript: return SelectIndexNode(this);\" " +
"href=\"{0}\" target=\"TopicContent\">{1}</a>\r\n</div>\r\n",
HttpUtility.HtmlEncode(subNode.Attributes["Url"].Value),
HttpUtility.HtmlEncode(subNode.Attributes["Title"].Value));
sb.Append("</div>\r\n");
startIndex++;
}
if(startIndex < root.ChildNodes.Count)
sb.Append("<div class=\"IndexItem\">\r\n" +
"<span>&nbsp;</span><a class=\"UnselectedNode\" " +
"onclick=\"javascript: return ChangeIndexPage(1);\" " +
"href=\"#\"><b>Next page >></b></a>\r\n</div>\r\n");
writer.Write(sb.ToString());
}
</script>

@ -1,68 +0,0 @@
<?
// Contributed to the Sandcastle Help File Builder project by Thomas Levesque
$ki = new DOMDocument();
$ki->load("WebKI.xml");
$xpath = new DOMXPath($ki);
$nodes = $xpath->query("/HelpKI/*");
$startIndexParam = $_GET["StartIndex"];
$startIndex = 0;
if (!empty($startIndexParam))
$startIndex = intval($startIndexParam) * 128;
$endIndex = $startIndex + 128;
if ($endIndex > $nodes->length)
$endIndex = $nodes->length;
if($startIndex > 0)
{
?>
<div class="IndexItem">
<span>&nbsp;</span><a class="UnselectedNode" onclick="javascript: return ChangeIndexPage(-1);" href="#"><b><< Previous page</b></a>
</div>
<?
}
while($startIndex < $endIndex)
{
$node = $nodes->item($startIndex);
$url = $node->getAttribute("Url");
$title = $node->getAttribute("Title");
$target = " target=\"TopicContent\"";
if (empty($url))
{
$url = "#";
$target = "";
}
?>
<div class="IndexItem">
<span>&nbsp;</span><a class="UnselectedNode" onclick="javascript: return SelectIndexNode(this);" href="<?= $url ?>"<?= $target ?>><?= $title ?></a>
<?
$subNodes = $xpath->query("./HelpKINode", $node);
foreach($subNodes as $subNode)
{
$subUrl = $subNode->getAttribute("Url");
$subTitle = $subNode->getAttribute("Title");
?>
<div class="IndexSubItem">
<img src="Item.gif"/><a class="UnselectedNode" onclick="javascript: return SelectIndexNode(this);" href="<?= $subUrl ?>" target="TopicContent"><?= $subTitle ?></a>
</div>
<?
}
?>
</div>
<?
$startIndex++;
}
if($startIndex < $nodes->length)
{
?>
<div class="IndexItem">
<span>&nbsp;</span><a class="UnselectedNode" onclick="javascript: return ChangeIndexPage(1);" href="#"><b>Next page >></b></a>
</div>
<?
}
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 971 B

@ -1,235 +0,0 @@
<%@ Page Language="C#" EnableViewState="False" %>
<script runat="server">
//===============================================================================================================
// System : Sandcastle Help File Builder
// File : SearchHelp.aspx
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 04/09/2014
// Note : Copyright 2007-2014, Eric Woodruff, All rights reserved
//
// This file contains the code used to search for keywords within the help topics using the full-text index
// files created by the help file builder.
//
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
// distributed with the code and can be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
// and source files.
//
// Date Who Comments
// ==============================================================================================================
// 06/24/2007 EFW Created the code
// 02/17/2012 EFW Switched to JSON serialization to support websites that use something other than ASP.NET
// such as PHP.
//===============================================================================================================
/// <summary>
/// This class is used to track the results and their rankings
/// </summary>
private class Ranking
{
public string Filename, PageTitle;
public int Rank;
public Ranking(string file, string title, int rank)
{
Filename = file;
PageTitle = title;
Rank = rank;
}
}
/// <summary>
/// Render the search results
/// </summary>
/// <param name="writer">The writer to which the results are written</param>
protected override void Render(HtmlTextWriter writer)
{
JavaScriptSerializer jss = new JavaScriptSerializer();
string searchText, ftiFile;
char letter;
bool sortByTitle = false;
jss.MaxJsonLength = Int32.MaxValue;
// The keywords for which to search should be passed in the query string
searchText = this.Request.QueryString["Keywords"];
if(String.IsNullOrEmpty(searchText))
{
writer.Write("<b class=\"PaddedText\">Nothing found</b>");
return;
}
// An optional SortByTitle option can also be specified
if(this.Request.QueryString["SortByTitle"] != null)
sortByTitle = Convert.ToBoolean(this.Request.QueryString["SortByTitle"]);
List<string> keywords = this.ParseKeywords(searchText);
List<char> letters = new List<char>();
List<string> fileList;
Dictionary<string, List<long>> ftiWords, wordDictionary =
new Dictionary<string,List<long>>();
// Load the file index
using(StreamReader sr = new StreamReader(Server.MapPath("fti/FTI_Files.json")))
{
fileList = jss.Deserialize<List<string>>(sr.ReadToEnd());
}
// Load the required word index files
foreach(string word in keywords)
{
letter = word[0];
if(!letters.Contains(letter))
{
letters.Add(letter);
ftiFile = Server.MapPath(String.Format(CultureInfo.InvariantCulture,
"fti/FTI_{0}.json", (int)letter));
if(File.Exists(ftiFile))
{
using(StreamReader sr = new StreamReader(ftiFile))
{
ftiWords = jss.Deserialize<Dictionary<string, List<long>>>(sr.ReadToEnd());
}
foreach(string ftiWord in ftiWords.Keys)
wordDictionary.Add(ftiWord, ftiWords[ftiWord]);
}
}
}
// Perform the search and return the results as a block of HTML
writer.Write(this.Search(keywords, fileList, wordDictionary, sortByTitle));
}
/// <summary>
/// Split the search text up into keywords
/// </summary>
/// <param name="keywords">The keywords to parse</param>
/// <returns>A list containing the words for which to search</returns>
private List<string> ParseKeywords(string keywords)
{
List<string> keywordList = new List<string>();
string checkWord;
string[] words = Regex.Split(keywords, @"\W+");
foreach(string word in words)
{
checkWord = word.ToLower(CultureInfo.InvariantCulture);
if(checkWord.Length > 2 && !Char.IsDigit(checkWord[0]) &&
!keywordList.Contains(checkWord))
keywordList.Add(checkWord);
}
return keywordList;
}
/// <summary>
/// Search for the specified keywords and return the results as a block of
/// HTML.
/// </summary>
/// <param name="keywords">The keywords for which to search</param>
/// <param name="fileInfo">The file list</param>
/// <param name="wordDictionary">The dictionary used to find the words</param>
/// <param name="sortByTitle">True to sort by title, false to sort by
/// ranking</param>
/// <returns>A block of HTML representing the search results.</returns>
private string Search(List<string> keywords, List<string> fileInfo,
Dictionary<string, List<long>> wordDictionary, bool sortByTitle)
{
StringBuilder sb = new StringBuilder(10240);
Dictionary<string, List<long>> matches = new Dictionary<string, List<long>>();
List<long> occurrences;
List<int> matchingFileIndices = new List<int>(),
occurrenceIndices = new List<int>();
List<Ranking> rankings = new List<Ranking>();
string filename, title;
string[] fileIndex;
bool isFirst = true;
int idx, wordCount, matchCount;
foreach(string word in keywords)
{
if(!wordDictionary.TryGetValue(word, out occurrences))
return "<b class=\"PaddedText\">Nothing found</b>";
matches.Add(word, occurrences);
occurrenceIndices.Clear();
// Get a list of the file indices for this match
foreach(long entry in occurrences)
occurrenceIndices.Add((int)(entry >> 16));
if(isFirst)
{
isFirst = false;
matchingFileIndices.AddRange(occurrenceIndices);
}
else
{
// After the first match, remove files that do not appear for
// all found keywords.
for(idx = 0; idx < matchingFileIndices.Count; idx++)
if(!occurrenceIndices.Contains(matchingFileIndices[idx]))
{
matchingFileIndices.RemoveAt(idx);
idx--;
}
}
}
if(matchingFileIndices.Count == 0)
return "<b class=\"PaddedText\">Nothing found</b>";
// Rank the files based on the number of times the words occurs
foreach(int index in matchingFileIndices)
{
// Split out the title, filename, and word count
fileIndex = fileInfo[index].Split('\x0');
title = fileIndex[0];
filename = fileIndex[1];
wordCount = Convert.ToInt32(fileIndex[2]);
matchCount = 0;
foreach(string word in keywords)
{
occurrences = matches[word];
foreach(long entry in occurrences)
if((int)(entry >> 16) == index)
matchCount += (int)(entry & 0xFFFF);
}
rankings.Add(new Ranking(filename, title, matchCount * 1000 / wordCount));
}
// Sort by rank in descending order or by page title in ascending order
rankings.Sort(delegate (Ranking x, Ranking y)
{
if(!sortByTitle)
return y.Rank - x.Rank;
return x.PageTitle.CompareTo(y.PageTitle);
});
// Format the file list and return the results
foreach(Ranking r in rankings)
sb.AppendFormat("<div class=\"TreeItem\">\r\n<img src=\"Item.gif\"/>" +
"<a class=\"UnselectedNode\" target=\"TopicContent\" " +
"href=\"{0}\" onclick=\"javascript: SelectSearchNode(this);\">" +
"{1}</a>\r\n</div>\r\n", r.Filename, r.PageTitle);
// Return the keywords used as well in a hidden span
sb.AppendFormat("<span id=\"SearchKeywords\" style=\"display: none\">{0}</span>",
String.Join(" ", keywords.ToArray()));
return sb.ToString();
}
</script>

@ -1,169 +0,0 @@
<?
// Contributed to the Sandcastle Help File Builder project by Thomas Levesque
class Ranking
{
public $filename;
public $pageTitle;
public $rank;
function __construct($file, $title, $rank)
{
$this->filename = $file;
$this->pageTitle = $title;
$this->rank = $rank;
}
}
/// <summary>
/// Split the search text up into keywords
/// </summary>
/// <param name="keywords">The keywords to parse</param>
/// <returns>A list containing the words for which to search</returns>
function ParseKeywords($keywords)
{
$keywordList = array();
$words = preg_split("/[^\w]+/", $keywords);
foreach($words as $word)
{
$checkWord = strtolower($word);
$first = substr($checkWord, 0, 1);
if(strlen($checkWord) > 2 && !ctype_digit($first) && !in_array($checkWord, $keywordList))
{
array_push($keywordList, $checkWord);
}
}
return $keywordList;
}
/// <summary>
/// Search for the specified keywords and return the results as a block of
/// HTML.
/// </summary>
/// <param name="keywords">The keywords for which to search</param>
/// <param name="fileInfo">The file list</param>
/// <param name="wordDictionary">The dictionary used to find the words</param>
/// <param name="sortByTitle">True to sort by title, false to sort by
/// ranking</param>
/// <returns>A block of HTML representing the search results.</returns>
function Search($keywords, $fileInfo, $wordDictionary, $sortByTitle)
{
$sb = "";
$matches = array();
$matchingFileIndices = array();
$rankings = array();
$isFirst = true;
foreach($keywords as $word)
{
if (!array_key_exists($word, $wordDictionary))
{
return "<b class=\"PaddedText\">Nothing found</b>";
}
$occurrences = $wordDictionary[$word];
$matches[$word] = $occurrences;
$occurrenceIndices = array();
// Get a list of the file indices for this match
foreach($occurrences as $entry)
array_push($occurrenceIndices, ($entry >> 16));
if($isFirst)
{
$isFirst = false;
foreach($occurrenceIndices as $i)
{
array_push($matchingFileIndices, $i);
}
}
else
{
// After the first match, remove files that do not appear for
// all found keywords.
for($idx = 0; $idx < count($matchingFileIndices); $idx++)
{
if (!in_array($matchingFileIndices[$idx], $occurrenceIndices))
{
array_splice($matchingFileIndices, $idx, 1);
$idx--;
}
}
}
}
if(count($matchingFileIndices) == 0)
{
return "<b class=\"PaddedText\">Nothing found</b>";
}
// Rank the files based on the number of times the words occurs
foreach($matchingFileIndices as $index)
{
// Split out the title, filename, and word count
$fileIndex = explode("\x00", $fileInfo[$index]);
$title = $fileIndex[0];
$filename = $fileIndex[1];
$wordCount = intval($fileIndex[2]);
$matchCount = 0;
foreach($keywords as $words)
{
$occurrences = $matches[$word];
foreach($occurrences as $entry)
{
if(($entry >> 16) == $index)
$matchCount += $entry & 0xFFFF;
}
}
$r = new Ranking($filename, $title, $matchCount * 1000 / $wordCount);
array_push($rankings, $r);
}
// Sort by rank in descending order or by page title in ascending order
if($sortByTitle)
{
usort($rankings, "cmprankbytitle");
}
else
{
usort($rankings, "cmprank");
}
// Format the file list and return the results
foreach($rankings as $r)
{
$f = $r->filename;
$t = $r->pageTitle;
$sb .= "<div class=\"TreeItem\">\r\n<img src=\"Item.gif\"/>" .
"<a class=\"UnselectedNode\" target=\"TopicContent\" " .
"href=\"$f\" onclick=\"javascript: SelectSearchNode(this);\">" .
"$t</a>\r\n</div>\r\n";
}
// Return the keywords used as well in a hidden span
$k = implode(" ", $keywords);
$sb .= "<span id=\"SearchKeywords\" style=\"display: none\">$k</span>";
return $sb;
}
function cmprank($x, $y)
{
return $y->rank - $x->rank;
}
function cmprankbytitle($x, $y)
{
return strcmp($x->pageTitle, $y->pageTitle);
}
?>

@ -1,58 +0,0 @@
<?
// Contributed to the Sandcastle Help File Builder project by Thomas Levesque
include("SearchHelp.inc.php");
$sortByTitle = false;
// The keywords for which to search should be passed in the query string
$searchText = $_GET["Keywords"];
if(empty($searchText))
{
?>
<b class=\"PaddedText\">Nothing found</b>
<?
return;
}
// An optional SortByTitle option can also be specified
if($_GET["SortByTitle"] == "true")
$sortByTitle = true;
$keywords = ParseKeywords($searchText);
$letters = array();
$wordDictionary = array();
// Load the file index
$json = file_get_contents("fti/FTI_Files.json");
$fileList = json_decode($json);
// Load the required word index files
foreach($keywords as $word)
{
$letter = substr($word, 0, 1);
if(!in_array($letter, $letters))
{
array_push($letters, $letter);
$ascii = ord($letter);
$ftiFile = "fti/FTI_$ascii.json";
if(file_exists($ftiFile))
{
$json = file_get_contents($ftiFile);
$ftiWords = json_decode($json, true);
foreach($ftiWords as $ftiWord => $val)
{
$wordDictionary[$ftiWord] = $val;
}
}
}
}
// Perform the search and return the results as a block of HTML
$results = Search($keywords, $fileList, $wordDictionary, $sortByTitle);
echo $results;
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

@ -1,141 +0,0 @@
/* File : TOC.css
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 01/26/2014
//
// Style sheet for the table of contents
*/
* {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
body {
font-family: Verdana, Arial, sans-serif;
font-size: 9pt;
background-color: #6699CC;
color: White;
overflow: hidden;
}
input {
font-size: 8.5pt;
}
img {
border: 0;
margin-left: 5px;
margin-right: 2px;
}
img.TreeNodeImg {
cursor: pointer;
}
img.TOCLink {
cursor: pointer;
margin-left: 0;
margin-right: 0;
}
a.SelectedNode, a.UnselectedNode {
color: black;
text-decoration: none;
padding: 1px 3px 1px 3px;
white-space: nowrap;
}
a.SelectedNode {
background-color: #ffffff;
border: solid 1px #999999;
padding: 0px 2px 0px 2px;
}
a.UnselectedNode:hover, a.SelectedNode:hover {
background-color: #cccccc;
border: solid 1px #999999;
padding: 0px 2px 0px 2px;
}
.Visible {
display: block;
margin-left: 14px;
}
.Hidden {
display: none;
}
.Tree {
background-color: #ffffff;
color: Black;
width: 300px;
overflow: auto;
}
.TreeNode, .TreeItem {
white-space: nowrap;
margin: 2px 2px 2px 2px;
}
.TOCDiv {
position: relative;
float: left;
width: 300px;
height: 100%;
}
.TOCSizer {
clear: none;
float: left;
width: 10px;
height: 100%;
background-color: #6699CC;
background-image: url("Splitter.gif");
background-position: center center;
background-repeat: no-repeat;
position: relative;
cursor: w-resize;
}
.TopicContent {
position: relative;
float: right;
background-color: white;
height: 100%;
}
.SearchOpts {
padding: 5px 5px 0px 5px;
background-color: #d3d3d3;
color: black;
width: 300px;
}
.NavOpts {
padding: 5px 5px 0px 5px;
background-color: #d3d3d3;
color: black;
width: 300px;
}
.IndexOpts {
padding: 5px 5px 0px 5px;
background-color: #d3d3d3;
color: black;
width: 300px;
}
.IndexItem {
white-space: nowrap;
margin: 2px 2px 2px 2px;
}
.IndexSubItem {
white-space: nowrap;
margin: 2px 2px 2px 12px;
}
.PaddedText {
margin: 10px 10px 10px 10px;
}

@ -1,906 +0,0 @@
//===============================================================================================================
// System : Sandcastle Help File Builder
// File : TOC.js
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 03/26/2014
// Note : Copyright 2006-2014, Eric Woodruff, All rights reserved
//
// This file contains the methods necessary to implement a simple tree view for the table of content with a
// resizable splitter and Ajax support to load tree nodes on demand. It also contains the script necessary to do
// full-text searches.
//
// This code is published under the Microsoft Public License (Ms-PL). A copy of the license should be
// distributed with the code and can be found at the project website: https://GitHub.com/EWSoftware/SHFB. This
// notice, the author's name, and all copyright notices must remain intact in all applications, documentation,
// and source files.
//
// Version Date Who Comments
// ==============================================================================================================
// 1.3.0.0 09/12/2006 EFW Created the code
// 1.4.0.2 06/15/2007 EFW Reworked to get rid of frame set and to add support for Ajax to load tree nodes on
// demand.
// 1.5.0.0 06/24/2007 EFW Added full-text search capabilities
// 1.6.0.7 04/01/2008 EFW Merged changes from Ferdinand Prantl to add a website keyword index. Added support
// for "topic" query string option.
// 1.9.4.0 02/21/2012 EFW Merged code from Thomas Levesque to show direct link and support other page types
// like PHP.
// 1.9.5.0 07/25/2012 EFW Made changes to support IE 10.
// 1.9.8.0 07/26/2013 EFW Merged changes from Dave Dansey to sync to TOC when the topic URL parameter is used
//===============================================================================================================
// IE and Chrome flags
var isIE = (navigator.userAgent.indexOf("MSIE") >= 0);
var isIE10OrLater = /MSIE 1\d\./.test(navigator.userAgent);
var isChrome = (navigator.userAgent.indexOf("Chrome") >= 0);
// Page extension
var pageExtension = ".aspx";
// Minimum width of the TOC div
var minWidth = 100;
// Elements and sizing info
var divTOC, divSizer, topicContent, divNavOpts, divSearchOpts, divSearchResults, divIndexOpts, divIndexResults,
divTree, docBody, maxWidth, offset, txtSearchText, chkSortByTitle;
// Last node selected
var lastNode, lastSearchNode, lastIndexNode;
// Last page with keyword index
var currentIndexPage = 0;
// XML Doc of the TOC
var xmlTOCDoc
//============================================================================
// Initialize the tree view and resize the content. Pass it the page extension to use (i.e. ".aspx")
// for loading TOC element, index keywords, searching, etc.
function Initialize(extension)
{
docBody = document.getElementsByTagName("body")[0];
divTOC = document.getElementById("TOCDiv");
divSizer = document.getElementById("TOCSizer");
topicContent = document.getElementById("TopicContent");
divNavOpts = document.getElementById("divNavOpts");
divSearchOpts = document.getElementById("divSearchOpts");
divSearchResults = document.getElementById("divSearchResults");
divIndexOpts = document.getElementById("divIndexOpts");
divIndexResults = document.getElementById("divIndexResults");
divTree = document.getElementById("divTree");
txtSearchText = document.getElementById("txtSearchText");
chkSortByTitle = document.getElementById("chkSortByTitle");
// Set the page extension if specified
if(typeof(extension) != "undefined" && extension != "")
pageExtension = extension;
// The sizes are bit off in FireFox
if(!isIE)
divNavOpts.style.width = divSearchOpts.style.width = divIndexOpts.style.width = 292;
ResizeTree();
SyncTOC();
topicContent.onload = SyncTOC;
// Use an alternate default page if a topic is specified in the query string
var queryString = document.location.search;
if(queryString != "")
{
var idx, options = queryString.split(/[\?\=\&]/);
for(idx = 0; idx < options.length; idx++)
if(options[idx] == "topic" && idx + 1 < options.length)
{
// Don't allow javascript, or references outside the current site
if(options[idx + 1].match(/^\w[\w\/.-]*$/))
topicContent.src = options[idx + 1];
break;
}
}
}
//============================================================================
// Navigation and expand/collapse code
// Synchronize the table of content with the selected page if possible
function SyncTOC()
{
var idx, anchor, base, href, url, anchors, treeNode, saveNode;
base = window.location.href;
base = base.substr(0, base.lastIndexOf("/") + 1);
if(base.substr(0, 5) == "file:" && base.substr(0, 8) != "file:///")
base = base.replace("file://", "file:///");
url = GetCurrentUrl();
if(url == "")
return false;
if(url.substr(0, 5) == "file:" && url.substr(0, 8) != "file:///")
url = url.replace("file://", "file:///");
while(true)
{
anchors = divTree.getElementsByTagName("A");
anchor = null;
for(idx = 0; idx < anchors.length; idx++)
{
href = anchors[idx].href;
if(href.substring(0, 7) != 'http://' && href.substring(0, 8) != 'https://' &&
href.substring(0, 7) != 'file://')
href = base + href;
if(href == url)
{
anchor = anchors[idx];
break;
}
}
if(anchor == null)
{
// If it contains a "#", strip anything after that and try again
if(url.indexOf("#") != -1)
{
url = url.substr(0, url.indexOf("#"));
continue;
}
LoadTOC(url);
return;
}
break;
}
// If found, select it and find the parent tree node
SelectNode(anchor);
saveNode = anchor;
lastNode = null;
while(anchor != null)
{
if(anchor.className == "TreeNode")
{
treeNode = anchor;
break;
}
anchor = anchor.parentNode;
}
// Expand it and all of its parents
while(anchor != null)
{
Expand(anchor);
anchor = anchor.parentNode;
while(anchor != null)
{
if(anchor.className == "TreeNode")
break;
anchor = anchor.parentNode;
}
}
lastNode = saveNode;
// Scroll the node into view
var windowTop = lastNode.offsetTop - divTree.offsetTop - divTree.scrollTop;
var windowBottom = divTree.clientHeight - windowTop - lastNode.offsetHeight;
if(windowTop < 0)
divTree.scrollTop += windowTop - 30;
else
if(windowBottom < 0)
divTree.scrollTop -= windowBottom - 30;
}
// Search an array to see if it contains the given object
function Contains(a, obj)
{
for(var i = 0; i < a.length; i++)
if(a[i] === obj)
return true;