Skip to content

Commit

Permalink
Updating .NET online documentation to new presentation style and upda…
Browse files Browse the repository at this point in the history
…ting tools for documentation generation
  • Loading branch information
jimevans committed Jan 18, 2013
1 parent 2e46b1b commit 5647d8f
Show file tree
Hide file tree
Showing 2,404 changed files with 57,549 additions and 41,620 deletions.
3 changes: 3 additions & 0 deletions copyiedriver.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
copy /y build\cpp\Win32\Release\IEDriverServer.exe cpp\prebuilt\Win32\Release
copy /y build\cpp\x64\Release\IEDriverServer.exe cpp\prebuilt\x64\Release
52 changes: 52 additions & 0 deletions docs/api/dotnet/FillNode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?
// 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>
<?
}
}
?>
14 changes: 9 additions & 5 deletions docs/api/dotnet/Index.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<head runat="server">
<title>WebDriver - Table of Content</title>
<link rel="stylesheet" href="TOC.css">
<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();" onresize="javascript: ResizeTree();">
<body onload="javascript: Initialize('.aspx');" onresize="javascript: ResizeTree();">
<form id="IndexForm" runat="server">

<div id="TOCDiv" class="TOCDiv">
Expand Down Expand Up @@ -42,6 +42,9 @@ Keyword Index
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;"
Expand Down Expand Up @@ -75,8 +78,8 @@ This page uses an IFRAME but your browser does not support it.
// System : Sandcastle Help File Builder
// File : Index.aspx
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 04/10/2008
// Note : Copyright 2007-2008, Eric Woodruff, All rights reserved
// Updated : 02/18/2012
// Note : Copyright 2007-2012, Eric Woodruff, All rights reserved
// Compiler: Microsoft C#
//
// This file contains the code used to display the index page for a website
Expand All @@ -93,6 +96,7 @@ This page uses an IFRAME but your browser does not support it.
// Version Date Who Comments
// ============================================================================
// 1.5.0.0 06/21/2007 EFW Created the code
// 1.9.4.0 02/18/2012 EFW Merged code from tom103 to show direct link
//=============================================================================
protected void Page_Load(object sender, EventArgs e)
Expand Down
5,782 changes: 530 additions & 5,252 deletions docs/api/dotnet/LastBuild.log

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions docs/api/dotnet/LoadIndexKeywords.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?
// 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>
<?
}
?>
78 changes: 36 additions & 42 deletions docs/api/dotnet/SearchHelp.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// System : Sandcastle Help File Builder
// File : SearchHelp.aspx
// Author : Eric Woodruff (Eric@EWoodruff.us)
// Updated : 07/03/2007
// Note : Copyright 2007, Eric Woodruff, All rights reserved
// Updated : 04/27/2012
// Note : Copyright 2007-2012, Eric Woodruff, All rights reserved
// Compiler: Microsoft C#
//
// This file contains the code used to search for keywords within the help
Expand All @@ -21,33 +21,36 @@
// Version Date Who Comments
// ============================================================================
// 1.5.0.0 06/24/2007 EFW Created the code
// 1.9.4.0 02/17/2012 EFW Switched to JSON serialization to support websites
// that use something other than ASP.NET such as PHP.
//=============================================================================
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)
{
FileStream fs = null;
BinaryFormatter bf;
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"];
Expand All @@ -67,43 +70,35 @@ protected override void Render(HtmlTextWriter writer)
Dictionary<string, List<long>> ftiWords, wordDictionary =
new Dictionary<string,List<long>>();
try
// Load the file index
using(StreamReader sr = new StreamReader(Server.MapPath("fti/FTI_Files.json")))
{
// Load the file index
fs = new FileStream(Server.MapPath("fti/FTI_Files.bin"), FileMode.Open,
FileAccess.Read);
bf = new BinaryFormatter();
fileList = (List<string>)bf.Deserialize(fs);
fs.Close();
// Load the required word index files
foreach(string word in keywords)
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))
{
letter = word[0];
if(!letters.Contains(letter))
{
letters.Add(letter);
ftiFile = Server.MapPath(String.Format(
CultureInfo.InvariantCulture, "fti/FTI_{0}.bin", (int)letter));
letters.Add(letter);
ftiFile = Server.MapPath(String.Format(CultureInfo.InvariantCulture,
"fti/FTI_{0}.json", (int)letter));
if(File.Exists(ftiFile))
if(File.Exists(ftiFile))
{
using(StreamReader sr = new StreamReader(ftiFile))
{
fs = new FileStream(ftiFile, FileMode.Open, FileAccess.Read);
ftiWords = (Dictionary<string, List<long>>)bf.Deserialize(fs);
fs.Close();
foreach(string ftiWord in ftiWords.Keys)
wordDictionary.Add(ftiWord, ftiWords[ftiWord]);
ftiWords = jss.Deserialize<Dictionary<string, List<long>>>(sr.ReadToEnd());
}
foreach(string ftiWord in ftiWords.Keys)
wordDictionary.Add(ftiWord, ftiWords[ftiWord]);
}
}
}
finally
{
if(fs != null && fs.CanRead)
fs.Close();
}
// Perform the search and return the results as a block of HTML
writer.Write(this.Search(keywords, fileList, wordDictionary, sortByTitle));
Expand Down Expand Up @@ -216,14 +211,13 @@ private string Search(List<string> keywords, List<string> fileInfo,
}
// 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;
rankings.Sort(delegate (Ranking x, Ranking y)
{
if(!sortByTitle)
return y.Rank - x.Rank;
return x.PageTitle.CompareTo(y.PageTitle);
});
return x.PageTitle.CompareTo(y.PageTitle);
});
// Format the file list and return the results
foreach(Ranking r in rankings)
Expand Down
Loading

0 comments on commit 5647d8f

Please sign in to comment.