<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>trunk/as2api/output/html</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">default_css.rb</a></tt></td><td align="right" id="added">+63</td><td></td><td nowrap="nowrap" align="center">254 -> 255</td></tr>
<tr class="alt"><td><tt><a href="#file2">driver.rb</a></tt></td><td align="right" id="added">+6</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">254 -> 255</td></tr>
<tr><td><tt><a href="#file3">html_framework.rb</a></tt></td><td align="right" id="added">+7</td><td align="right" id="removed">-2</td><td nowrap="nowrap" align="center">254 -> 255</td></tr>
<tr class="alt"><td><tt><a href="#file4">index.rb</a></tt></td><td align="right" id="added">+55</td><td align="right" id="removed">-22</td><td nowrap="nowrap" align="center">254 -> 255</td></tr>
<tr><td><tt><a href="#file5"><span id="added">quicknav.rb</span></a></tt></td><td align="right" id="added">+152</td><td></td><td nowrap="nowrap" align="right">added 255</td></tr>
<tr><td></td><td align="right" id="added">+283</td><td align="right" id="removed">-25</td><td></td></tr>
</table>
<small id="info">1 added + 4 modified, total 5 files</small><br />
<pre class="comment">
DHTML search gewgaw. Breaks the browser back button, unfortunately.
Must see if XMLHttpRequest can work localy, or find another alternative to
the <iframe> (document.load()?).
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">trunk/as2api/output/html</span><br />
<div class="fileheader"><big><b>default_css.rb</b></big> <small id="info">254 -> 255</small></div>
<pre class="diff"><small id="info">--- trunk/as2api/output/html/default_css.rb        2005-11-07 12:29:45 UTC (rev 254)
+++ trunk/as2api/output/html/default_css.rb        2005-11-07 19:44:09 UTC (rev 255)
@@ -7,6 +7,36 @@
</small></pre><pre class="diff" id="context">
write_file(output_dir, name) do |out|
out.print <<-HERE
</pre><pre class="diff" id="added">+.quicknav > span {
+        float: right;
+}
+
+#quicknav_menu {
+        border: 1px solid black;
+        position: absolute;
+        font-size: normal;
+        padding: 0;
+        background-color: white;
+        overflow: hidden;
+}
+.quicknav label {
+        font-size: smaller;
+        font-weight: normal;
+        font-family: sans-serif;
+}
+#quicknav_input {
+        color: black;
+}
+#quicknav_menu li {
+        display: block;
+        font-size: smaller;
+        font-weight: normal;
+        font-family: sans-serif;
+        white-space: nowrap;
+        padding: 0.1em 0;
+        color: black;
+}
+
</pre><pre class="diff" id="context"> h2 {
        background-color: #ccccff;
        padding-left: .2em;
</pre><pre class="diff"><small id="info">@@ -161,6 +191,39 @@
</small></pre><pre class="diff" id="context"> write_file(output_dir, name) do |out|
out.print <<-HERE
/* apologies to the authors of NaturalDocs */
</pre><pre class="diff" id="added">+.quicknav > span {
+        float: right;
+}
+
+#quicknav_menu {
+        border: 1px solid black;
+        position: absolute;
+        font-size: normal;
+        padding: 0;
+        background-color: white;
+        overflow: hidden;
+}
+.quicknav label {
+        font-size: smaller;
+        font-weight: normal;
+        font-family: sans-serif;
+}
+.quicknav #quicknav_input {
+        color: black;
+}
+.quicknav #quicknav_menu li {
+        display: block;
+        font-size: smaller;
+        font-weight: normal;
+        font-family: sans-serif;
+        white-space: nowrap;
+        padding: 0.1em 0;
+        color: black;
+}
+.quicknav #quicknav_menu a {
+        color: blue;
+}
+
</pre><pre class="diff" id="context"> body {
        font-family: sans-serif;
}
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname">trunk/as2api/output/html</span><br />
<div class="fileheader"><big><b>driver.rb</b></big> <small id="info">254 -> 255</small></div>
<pre class="diff"><small id="info">--- trunk/as2api/output/html/driver.rb        2005-11-07 12:29:45 UTC (rev 254)
+++ trunk/as2api/output/html/driver.rb        2005-11-07 19:44:09 UTC (rev 255)
@@ -4,6 +4,7 @@
</small></pre><pre class="diff" id="context"> require 'output/html/index'
require 'output/html/sources'
require 'output/html/default_frameset'
</pre><pre class="diff" id="added">+require 'output/html/quicknav'
</pre><pre class="diff" id="context"> require 'output/html/default_css'
</pre><pre class="diff"><small id="info">@@ -89,7 +90,10 @@
</small></pre><pre class="diff" id="context"> end
def build_all_index_pages(list)
</pre><pre class="diff" id="removed">- list << IndexPage.new(@conf, @type_agregator)
</pre><pre class="diff" id="added">+ indexer = Indexer.new
+ indexer.create_index(@type_agregator)
+ list << IndexPage.new(@conf, indexer)
+ list << QuicknavData.new(@conf, indexer)
</pre><pre class="diff" id="context"> end
def build_navigation_template
</pre><pre class="diff"><small id="info">@@ -108,6 +112,7 @@
</small></pre><pre class="diff" id="context"> list = PageListBuilder.new(conf, type_agregator).build_page_list
create_all_pages(conf, list)
package_list(conf.output_dir, type_agregator)
</pre><pre class="diff" id="added">+ quicknav_script(conf.output_dir)
</pre><pre class="diff" id="context"> stylesheet(conf.output_dir)
alternate_stylesheet(conf.output_dir)
end
</pre></div>
<hr /><a name="file3" /><div class="file">
<span class="pathname">trunk/as2api/output/html</span><br />
<div class="fileheader"><big><b>html_framework.rb</b></big> <small id="info">254 -> 255</small></div>
<pre class="diff"><small id="info">--- trunk/as2api/output/html/html_framework.rb        2005-11-07 12:29:45 UTC (rev 254)
+++ trunk/as2api/output/html/html_framework.rb        2005-11-07 19:44:09 UTC (rev 255)
@@ -34,6 +34,7 @@
</small></pre><pre class="diff" id="context"> @doctype_id = :strict
@title = nil
@title_extra = nil
</pre><pre class="diff" id="added">+ @type = nil
</pre><pre class="diff" id="context"> @io = nil # to be set during the lifetime of generate() call
end
</pre><pre class="diff"><small id="info">@@ -104,6 +105,11 @@
</small></pre><pre class="diff" id="context"> end
def generate_links
</pre><pre class="diff" id="added">+ html_script("type"=>"text/javascript",
+         "src"=>base_path("quicknav.js")) { }
+ html_script do
+ comment("\ndocument.quicknavBasePath=\"#{base_path('index-files')}\";\n//")
+ end
</pre><pre class="diff" id="context"> html_link("rel"=>"stylesheet",
"type"=>"text/css",
         "href"=>base_path("style.css"),
</pre><pre class="diff"><small id="info">@@ -293,7 +299,6 @@
</small></pre><pre class="diff" id="context"> def initialize(conf, base_name, path_name=nil)
super(base_name, path_name)
@conf = conf
</pre><pre class="diff" id="removed">- @type = nil
</pre><pre class="diff" id="context"> @package = nil
@navigation = nil
end
</pre><pre class="diff"><small id="info">@@ -391,7 +396,7 @@
</small></pre><pre class="diff" id="context"> end
def generate_navigation
</pre><pre class="diff" id="removed">- html_ul("class"=>"main_nav") do
</pre><pre class="diff" id="added">+ html_ul("class"=>"main_nav"<span id="addedchars">, "id"=>"main_nav"</span>) do
</pre><pre class="diff" id="context"> @navigation.each do |nav|
        link = nav.build_for_page(self)
        html_li do
</pre></div>
<hr /><a name="file4" /><div class="file">
<span class="pathname">trunk/as2api/output/html</span><br />
<div class="fileheader"><big><b>index.rb</b></big> <small id="info">254 -> 255</small></div>
<pre class="diff"><small id="info">--- trunk/as2api/output/html/index.rb        2005-11-07 12:29:45 UTC (rev 254)
+++ trunk/as2api/output/html/index.rb        2005-11-07 19:44:09 UTC (rev 255)
@@ -64,26 +64,12 @@
</small></pre><pre class="diff" id="context"> def title_on(page); "Alpabetical index of types and members"; end
end
</pre><pre class="diff" id="removed">-
-class IndexPage < BasicPage
- def initialize(conf, type_agregator)
- super(conf, "index", "index-files")
- @type_agregator = type_agregator
- @title = "Alphabetical Index"
- end
-
- def extra_metadata
- # no point in search engines indexing our index,
- {
- "robots" => "noindex"
- }
- end
-
- def create_index()
</pre><pre class="diff" id="added">+class Indexer
+ def create_index(type_agregator)
</pre><pre class="diff" id="context"> index = []
initials = Set.new
# TODO: include packages
</pre><pre class="diff" id="removed">- <span id="removedchars">@</span>type_agregator.each_type do |astype|
</pre><pre class="diff" id="added">+ type_agregator.each_type do |astype|
</pre><pre class="diff" id="context"> if astype.document?
        index << TypeIndexTerm.new(astype)
        initials << astype.unqualified_name.upcase[0]
</pre><pre class="diff"><small id="info">@@ -104,14 +90,37 @@
</small></pre><pre class="diff" id="context"> end
end
</pre><pre class="diff" id="removed">- [index.sort!, initials]
</pre><pre class="diff" id="added">+ @index = index.sort!
+ @initials = initials
</pre><pre class="diff" id="context"> end
</pre><pre class="diff" id="added">+ attr_reader :index, :initials
+
+ private
+
+ def document_member?(member)
+ !member.access.private?
+ end
+end
+
+class IndexPage < BasicPage
+ def initialize(conf, indexer)
+ super(conf, "index", "index-files")
+ @indexer = indexer
+ @title = "Alphabetical Index"
+ end
+
+ def extra_metadata
+ # no point in search engines indexing our index,
+ {
+ "robots" => "noindex"
+ }
+ end
+
+
</pre><pre class="diff" id="context"> def generate_body_content
</pre><pre class="diff" id="removed">- index, initials = create_index()
-
</pre><pre class="diff" id="context"> html_p do
</pre><pre class="diff" id="removed">- initials.to_a.sort.each do |initial|
</pre><pre class="diff" id="added">+ <span id="addedchars">@indexer.</span>initials.to_a.sort.each do |initial|
</pre><pre class="diff" id="context">         i = initial.chr
        html_a(i, {"href"=>"##{i}"})
        pcdata(" ")
</pre><pre class="diff"><small id="info">@@ -119,7 +128,7 @@
</small></pre><pre class="diff" id="context"> end
last_initial = nil
</pre><pre class="diff" id="removed">- index.each do |element|
</pre><pre class="diff" id="added">+ <span id="addedchars">@indexer.</span>index.each do |element|
</pre><pre class="diff" id="context"> initial = element.term.upcase[0]
if initial != last_initial
        html_h2 do
</pre><pre class="diff"><small id="info">@@ -139,5 +148,29 @@
</small></pre><pre class="diff" id="context"> end
end
</pre><pre class="diff" id="added">+class QuicknavData < Page
+ def initialize(conf, indexer)
+ super("quicknav", "index-files")
+ @indexer = indexer
+ @title = "Alphabetical Index"
+ end
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="added">+ def generate_content
+ html_ul do
+ @indexer.index.each do |element|
+        html_li do
+         element.link(self)
+        end
+ end
+ end
+ end
+
+ def extra_metadata
+ # no point in search engines indexing our index,
+ {
+ "robots" => "noindex"
+ }
+ end
+end
+
</pre><pre class="diff" id="context"> # vim:softtabstop=2:shiftwidth=2
</pre></div>
<hr /><a name="file5" /><div class="file">
<span class="pathname" id="added">trunk/as2api/output/html</span><br />
<div class="fileheader" id="added"><big><b>quicknav.rb</b></big> <small id="info">added at 255</small></div>
<pre class="diff"><small id="info">--- trunk/as2api/output/html/quicknav.rb        2005-11-07 12:29:45 UTC (rev 254)
+++ trunk/as2api/output/html/quicknav.rb        2005-11-07 19:44:09 UTC (rev 255)
@@ -0,0 +1,152 @@
</small></pre><pre class="diff" id="added">+
+def quicknav_script(output_dir)
+ name = "quicknav.js"
+
+ # avoid overwriting a (possibly modified) existing stylesheet
+ return if FileTest.exist?(File.join(output_dir, name))
+
+ write_file(output_dir, name) do |out|
+ out.print <<-HERE
+function attachQuicknav() {
+        var main_nav = document.getElementById("main_nav");
+        var li = document.createElement("li");
+        var span = document.createElement("span");
+        li.className = "quicknav";
+        main_nav.insertBefore(li, main_nav.firstChild);
+        li.appendChild(span);
+        // setup quicknav input box,
+        var label = document.createElement("label");
+        label.setAttribute("for", "quicknav_input");
+        label.appendChild(document.createTextNode("Quicknav "));
+        span.appendChild(label);
+        var input = document.createElement("input");
+        input.id = "quicknav_input"
+        input.setAttribute("autocomplete", "off");
+        input.setAttribute("onfocus", "quicknavFocus();");
+        input.setAttribute("onkeyup", "quicknavKeyup();");
+        input.setAttribute("onblur", "quicknavBlur();");
+        span.appendChild(input);
+        var menu = document.createElement("ul");
+        menu.id = "quicknav_menu";
+        menu.style.visibility = "hidden";
+        menu.appendChild(document.createTextNode("Loading..."));
+        
+        span.appendChild(menu);
+        // setup frame to load search data,
+        var dataFrame = document.createElement("iframe");
+        dataFrame.style.width = "0";
+        dataFrame.style.height = "0";
+        dataFrame.style.visibility = "hidden";
+        dataFrame.src = adjustHref("quicknav.html");
+        dataFrame.id = "data_frame"
+        span.appendChild(dataFrame);
+}
+
+function quicknavFocus() {
+        showQuicknavMenu();
+        quicknavSearch();
+}
+
+function quicknavKeyup() {
+        quicknavSearch();
+}
+function quicknavSearch() {
+         var input = document.getElementById("quicknav_input");
+        var dataFrame = document.getElementById("data_frame");
+        var search = input.value.toLowerCase();
+        var items = dataFrame.contentDocument.getElementsByTagName("li");
+        var menu = document.getElementById("quicknav_menu");
+        clearQuicknavMenu(menu);
+        var count = 0;
+        for (var i=0; i < items.length; i++) {
+                var item = items[i];
+                var match = item.firstChild.text;
+                if (match.substr(0, search.length).toLowerCase() == search) {
+                        var clone = item.cloneNode(true);
+                        var href = clone.firstChild.getAttribute("href");
+                        href = adjustHref(href);
+                        clone.firstChild.setAttribute("href", href);
+                        menu.appendChild(clone);
+                        count++;
+                }
+                if (count >= 8) {
+                        break;
+                }
+        }
+}
+
+function adjustHref(href) {
+        return document.quicknavBasePath + "/" + href;
+}
+
+function clearQuicknavMenu(menu) {
+        for (var i = menu.childNodes.length -1; i >= 0 ; i--) {
+                menu.removeChild(menu.childNodes[i]);
+        }
+}
+
+function quicknavBlur() {
+        // give the user a chance to click on one of the menu items,
+        setTimeout("hideQuicknavMenu()", 200);
+}
+
+function showQuicknavMenu() {
+         var input = document.getElementById("quicknav_input");
+        var menu = document.getElementById("quicknav_menu");
+        menu.style.left = getElementX(input) + "px";
+        menu.style.top = getElementY(input) + input.offsetHeight + 2 + "px";
+        var width = getWidth(input);
+        if (width > 0) {
+                menu.style.width = width + "px";
+        }
+        menu.style.visibility = "visible";
+}
+
+function hideQuicknavMenu() {
+        var menu = document.getElementById("quicknav_menu");
+        menu.style.visibility = "hidden";
+}
+
+function getElementX(element){
+ var targetLeft = 0;
+ while (element) {
+ if (element.offsetParent) {
+ targetLeft += element.offsetLeft;
+ } else if (element.x) {
+ targetLeft += element.x;
+ }
+ element = element.offsetParent;
+ }
+ return targetLeft;
+}
+
+
+function getElementY(element){
+ var targetTop = 0;
+ while (element) {
+ if (element.offsetParent) {
+ targetTop += element.offsetTop;
+ } else if (element.y) {
+ targetTop += element.y;
+ }
+ element = element.offsetParent;
+ }
+ return targetTop;
+}
+
+function getWidth(element) {
+ if (element.clientWidth && element.offsetWidth && element.clientWidth <element.offsetWidth) {
+ return element.clientWidth; /* some mozillas (like 1.4.1) return bogus clientWidth so ensure it's in range */
+ } else if (element.offsetWidth) {
+ return element.offsetWidth;
+ } else if (element.width) {
+ return element.width;
+ } else {
+ return 0;
+ }
+}
+
+window.onload = attachQuicknav;
+ HERE
+ end
+end
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.11</small></center>
</body></html>