From 12be22b95950e916eaf4335a144f53823b968d2f Mon Sep 17 00:00:00 2001 From: Ian White Date: Sun, 8 Feb 2009 11:24:26 +0000 Subject: [PATCH] Updated API docs --- doc/classes/InheritViews.html | 403 +++++++++--- doc/classes/InheritViews/ActMethod.html | 439 ++++++++++--- doc/classes/InheritViews/ActionView.html | 486 ++++++++++---- doc/classes/InheritViews/PathSet.html | 536 +++++++++++----- doc/classes/InheritViews/PathsContainer.html | 627 +++++++++++++------ doc/created.rid | 2 +- doc/files/History_txt.html | 391 +++++++++--- doc/files/License_txt.html | 391 +++++++++--- doc/files/README_rdoc.html | 391 +++++++++--- doc/files/lib/inherit_views_rb.html | 391 +++++++++--- doc/fr_class_index.html | 35 +- doc/fr_file_index.html | 33 +- doc/fr_method_index.html | 45 +- doc/index.html | 25 +- doc/rdoc-style.css | 416 +++++++----- 15 files changed, 3384 insertions(+), 1227 deletions(-) diff --git a/doc/classes/InheritViews.html b/doc/classes/InheritViews.html index 1c47610..797a9a8 100644 --- a/doc/classes/InheritViews.html +++ b/doc/classes/InheritViews.html @@ -1,79 +1,337 @@ - - - - - - Module: InheritViews - - - - - - - +function ajaxGet(url) { + url = (href_base + url).replace('/./', '/') + var req = false; + + if (window.ActiveXObject) { + try { + // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object + // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die. + req = new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (e) { + try { + /* IE 6 and maybe 5, don't know, don't care */ + req = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (e) { + req = false; + } + } + } + } + + /* real browsers */ + if (!req && window.XMLHttpRequest) { + try { + req = new XMLHttpRequest(); + } catch (e) { + req = false; + } + } + + if (req) { + req.open('GET', url, false); + req.send(null); + return req.responseText; + } else { + return "Ajax error"; + } +} + + +function addEvent(elm, evType, fn, useCapture) { + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } else { + elm['on' + evType] = fn; + } +} + +function insertIndices() { + pages = ["class", "file", "method"] + for (x in pages) { + $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base); + } + /* mouseoverify method links */ + links = $('method').getElementsByTagName('a'); + for (var x = 0; x < links.length; x++) { + if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) { + links[x].innerHTML = m[1] + '
'; + links[x].title = m[2]; + } + } + /* this is stupid */ + $('class').style.display = "block"; + $('file').style.display = "block"; + + /* has to be here because IE7 does not guarantee the onLoad callback order */ + abbreviateIndicesInner(["class", "file"], 25, "a"); + /* same, linkTitle() depends on the class link list */ + linkTitle(); +} + +function abbreviateIndices() { + var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"]; + abbreviateIndicesInner(ids, 25, 'a'); + abbreviateIndicesInner(ids, 25, 'span'); +} + +function abbreviateIndicesInner(indices, amount, tag) { + for (var x = 0; x < indices.length; x++) { + var the_index = $(indices[x]); + if (the_index) { + links = the_index.getElementsByTagName(tag); + for (var y = 0; y < links.length; y++) { + var link = links[y]; + if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) { + // avoid nesting + link.innerHTML = link.innerHTML.replace(/
|\n/gi, ''); + link.title = link.innerHTML; + link.innerHTML = abbreviate(link.innerHTML, amount) + '
'; + } + } + } + } +} +function linkTitle() { + + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +</p><span><h1 id="title"> +Module: InheritViews +</h1></span> +</div><div class="clear"></div><div id="left"> - <div id="classHeader"> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Module</strong></td> - <td class="class-name-in-header">InheritViews</td> - </tr> - <tr class="top-aligned-row"> - <td><strong>In:</strong></td> - <td> - <a href="../files/lib/inherit_views_rb.html"> - lib/inherit_views.rb - </a> - <br /> - </td> - </tr> +<div class="navigation darker top" id="defined_in"><h3>Defined in</h3> - </table> - </div> - <!-- banner header --> +<a href="../files/lib/inherit_views_rb.html">lib/inherit_views.rb</a> - <div id="bodyContent"> +</div> - <div id="contextContent"> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">Module: InheritViews</h1> - <div id="description"> - <p> +<div id="description"><p> Allow your controllers to inherit their views from parent controllers, or from specified view paths. </p> @@ -127,45 +385,22 @@ <h3>Example</h3> # (not 'far' or 'faz' from FooController) end </pre> - - </div> - - - </div> - - - </div> +</div> - <!-- if includes --> - <div id="section"> - <div id="class-list"> - <h3 class="section-bar">Classes and Modules</h3> +<p></p> - Module <a href="InheritViews/ActMethod.html" class="link">InheritViews::ActMethod</a><br /> +<h1>Child modules and classes</h1><p>Module <a href="InheritViews/ActMethod.html" class="link">InheritViews::ActMethod</a><br /> Module <a href="InheritViews/ActionView.html" class="link">InheritViews::ActionView</a><br /> Module <a href="InheritViews/PathsContainer.html" class="link">InheritViews::PathsContainer</a><br /> Class <a href="InheritViews/PathSet.html" class="link">InheritViews::PathSet</a><br /> +</p> - </div> - - - - - - - - <!-- if method_list --> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/classes/InheritViews/ActMethod.html b/doc/classes/InheritViews/ActMethod.html index bbb2bb4..52d7e66 100644 --- a/doc/classes/InheritViews/ActMethod.html +++ b/doc/classes/InheritViews/ActMethod.html @@ -1,156 +1,393 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Module: InheritViews::ActMethod - - - - + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} - - +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +
+ -
- - - - - - - - - -
ModuleInheritViews::ActMethod
In: - - lib/inherit_views.rb - -
-
-
- -
+ -
-

Methods

-
- inherit_views   -
-
-
+

- -
+

Public Instance Methods

- +
+

+ - -

+

Specify this to have your controller or mailer inherit its views from the specified path or the current controller/mailer‘s default path if no argument is given

-

[Source]

-
-
-    # File lib/inherit_views.rb, line 49
+
+
    # File lib/inherit_views.rb, line 49
 49:     def inherit_views(*paths)
 50:       class_eval do
 51:         extend PathsContainer unless respond_to?(:inherit_views_paths)
 52:         self.inherit_views = true
 53:         self.inherit_view_paths = paths if paths.any?
 54:       end
-55:     end
-
-
-
-
- - -
+55: end
+
- -
-

[Validate]

-
- - \ No newline at end of file + \ No newline at end of file diff --git a/doc/classes/InheritViews/ActionView.html b/doc/classes/InheritViews/ActionView.html index 5185a7e..96bd35d 100644 --- a/doc/classes/InheritViews/ActionView.html +++ b/doc/classes/InheritViews/ActionView.html @@ -1,129 +1,383 @@ - - - - - - Module: InheritViews::ActionView - - - - + if (req) { + req.open('GET', url, false); + req.send(null); + return req.responseText; + } else { + return "Ajax error"; + } +} + + +function addEvent(elm, evType, fn, useCapture) { + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } else { + elm['on' + evType] = fn; + } +} + +function insertIndices() { + pages = ["class", "file", "method"] + for (x in pages) { + $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base); + } + /* mouseoverify method links */ + links = $('method').getElementsByTagName('a'); + for (var x = 0; x < links.length; x++) { + if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) { + links[x].innerHTML = m[1] + '
'; + links[x].title = m[2]; + } + } + /* this is stupid */ + $('class').style.display = "block"; + $('file').style.display = "block"; + + /* has to be here because IE7 does not guarantee the onLoad callback order */ + abbreviateIndicesInner(["class", "file"], 25, "a"); + /* same, linkTitle() depends on the class link list */ + linkTitle(); +} + +function abbreviateIndices() { + var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"]; + abbreviateIndicesInner(ids, 25, 'a'); + abbreviateIndicesInner(ids, 25, 'span'); +} + +function abbreviateIndicesInner(indices, amount, tag) { + for (var x = 0; x < indices.length; x++) { + var the_index = $(indices[x]); + if (the_index) { + links = the_index.getElementsByTagName(tag); + for (var y = 0; y < links.length; y++) { + var link = links[y]; + if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) { + // avoid nesting + link.innerHTML = link.innerHTML.replace(/
|\n/gi, ''); + link.title = link.innerHTML; + link.innerHTML = abbreviate(link.innerHTML, amount) + '
'; + } + } + } + } +} + +function linkTitle() { + + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} + +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +</p><span><h1 id="title"> +Module: InheritViews::ActionView +</h1></span> +</div><div class="clear"></div><div id="left"> + +<div class="navigation darker top" id="defined_in"><h3>Defined in</h3> + +<a href="../../files/lib/inherit_views_rb.html">lib/inherit_views.rb</a> + +</div> + -</head> -<body> +<div class="navigation top" id="methods"><h3>Methods</h3> - <div id="classHeader"> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Module</strong></td> - <td class="class-name-in-header">InheritViews::ActionView</td> - </tr> - <tr class="top-aligned-row"> - <td><strong>In:</strong></td> - <td> - <a href="../../files/lib/inherit_views_rb.html"> - lib/inherit_views.rb - </a> - <br /> - </td> - </tr> +<a href='#M000006'> +included<br/> +</a> - </table> - </div> - <!-- banner header --> - <div id="bodyContent"> +<a href='#M000007'> +view_paths=<br/> +</a> - <div id="contextContent"> - <div id="description"> - <p> +</div> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">Module: InheritViews::ActionView</h1> + +<div id="description"><p> Mixin for ActionView::Base to enable inherit views functionality </p> - - </div> +</div> - </div> - <div id="method-list"> - <h3 class="section-bar">Methods</h3> - <div class="name-list"> - <a href="#M000006">included</a>   - <a href="#M000007">view_paths=</a>   - </div> - </div> +<p></p> - </div> - <!-- if includes --> - <div id="section"> +<h1>Public Class Methods</h1> +<a class="small" name="M000006"><br/></a> +<div class="method_block"><h3> +<a href='#M000006'> - +included - <!-- if method_list --> - <div id="methods"> - <h3 class="section-bar">Public Class methods</h3> +(base) - <div id="method-M000006" class="method-detail"> - <a name="M000006"></a> +</a> +</h3> - <div class="method-heading"> - <a href="#M000006" class="method-signature"> - <span class="method-name">included</span><span class="method-args">(base)</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000006-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000006-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 128</span> +<p class="source_link" id="M000006-show-link"><a onclick="toggle('M000006-source'); toggleText('M000006-link'); return false;" href="#" id="M000006-link">Show source...</a></p><div class="source" id="M000006-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 128</span> 128: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>) 129: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span> 130: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">view_paths=</span>(<span class="ruby-identifier">value</span>) @@ -132,49 +386,35 @@ <h3 class="section-bar">Public Class methods</h3> 133: <span class="ruby-ivar">@view_paths</span>.<span class="ruby-identifier">inherit_view_paths</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">inherit_view_paths</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">controller</span>.<span class="ruby-identifier">inherit_views?</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">false</span>) 134: <span class="ruby-keyword kw">end</span> 135: <span class="ruby-keyword kw">end</span> -136: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <h3 class="section-bar">Public Instance methods</h3> - - <div id="method-M000007" class="method-detail"> - <a name="M000007"></a> - - <div class="method-heading"> - <a href="#M000007" class="method-signature"> - <span class="method-name">view_paths=</span><span class="method-args">(value)</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000007-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000007-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 130</span> +136: <span class="ruby-keyword kw">end</span></pre></div> +</div> + + +<h1>Public Instance Methods</h1> + + +<a class="small" name="M000007"><br/></a> +<div class="method_block"><h3> +<a href='#M000007'> + + +view_paths= + +(value) + +</a> +</h3> + +<p class="source_link" id="M000007-show-link"><a onclick="toggle('M000007-source'); toggleText('M000007-link'); return false;" href="#" id="M000007-link">Show source...</a></p><div class="source" id="M000007-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 130</span> 130: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">view_paths=</span>(<span class="ruby-identifier">value</span>) 131: <span class="ruby-ivar">@view_paths</span> = <span class="ruby-constant">InheritViews</span><span class="ruby-operator">::</span><span class="ruby-constant">PathSet</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>) 132: <span class="ruby-keyword kw">ensure</span> 133: <span class="ruby-ivar">@view_paths</span>.<span class="ruby-identifier">inherit_view_paths</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">inherit_view_paths</span> <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">controller</span>.<span class="ruby-identifier">inherit_views?</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">false</span>) -134: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - - </div> +134: <span class="ruby-keyword kw">end</span></pre></div> +</div> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/classes/InheritViews/PathSet.html b/doc/classes/InheritViews/PathSet.html index 4cef814..e3f15ab 100644 --- a/doc/classes/InheritViews/PathSet.html +++ b/doc/classes/InheritViews/PathSet.html @@ -1,190 +1,433 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Class: InheritViews::PathSet - - - - + if (req) { + req.open('GET', url, false); + req.send(null); + return req.responseText; + } else { + return "Ajax error"; + } +} + + +function addEvent(elm, evType, fn, useCapture) { + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } else { + elm['on' + evType] = fn; + } +} + +function insertIndices() { + pages = ["class", "file", "method"] + for (x in pages) { + $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base); + } + /* mouseoverify method links */ + links = $('method').getElementsByTagName('a'); + for (var x = 0; x < links.length; x++) { + if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) { + links[x].innerHTML = m[1] + '
'; + links[x].title = m[2]; + } + } + /* this is stupid */ + $('class').style.display = "block"; + $('file').style.display = "block"; + + /* has to be here because IE7 does not guarantee the onLoad callback order */ + abbreviateIndicesInner(["class", "file"], 25, "a"); + /* same, linkTitle() depends on the class link list */ + linkTitle(); +} + +function abbreviateIndices() { + var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"]; + abbreviateIndicesInner(ids, 25, 'a'); + abbreviateIndicesInner(ids, 25, 'span'); +} + +function abbreviateIndicesInner(indices, amount, tag) { + for (var x = 0; x < indices.length; x++) { + var the_index = $(indices[x]); + if (the_index) { + links = the_index.getElementsByTagName(tag); + for (var y = 0; y < links.length; y++) { + var link = links[y]; + if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) { + // avoid nesting + link.innerHTML = link.innerHTML.replace(/
|\n/gi, ''); + link.title = link.innerHTML; + link.innerHTML = abbreviate(link.innerHTML, amount) + '
'; + } + } + } + } +} - - +function linkTitle() { + + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +</p><span><h1 id="title"> +Class: InheritViews::PathSet +</h1></span> +</div><div class="clear"></div><div id="left"> +<div class="navigation darker top" id="child_of"><h3>Child of</h3><span> +::ActionView::PathSet +</span></div> - <div id="classHeader"> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Class</strong></td> - <td class="class-name-in-header">InheritViews::PathSet</td> - </tr> - <tr class="top-aligned-row"> - <td><strong>In:</strong></td> - <td> - <a href="../../files/lib/inherit_views_rb.html"> - lib/inherit_views.rb - </a> - <br /> - </td> - </tr> +<div class="navigation darker top" id="defined_in"><h3>Defined in</h3> - <tr class="top-aligned-row"> - <td><strong>Parent:</strong></td> - <td> - ::ActionView::PathSet - </td> - </tr> - </table> - </div> - <!-- banner header --> +<a href="../../files/lib/inherit_views_rb.html">lib/inherit_views.rb</a> + +</div> + + + +<div class="navigation top" id="methods"><h3>Methods</h3> - <div id="bodyContent"> +<a href='#M000009'> +find_template<br/> +</a> - <div id="contextContent"> - <div id="description"> - <p> + +<a href='#M000010'> +find_template_from_inherit_view_paths<br/> +</a> + + +</div> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">Class: InheritViews::PathSet</h1> + +<div id="description"><p> just like a normal path set, but can have an optional array of inherit_view_paths which will be used to look for a matching template if the original template is missing </p> +</div> + + + + +<p></p> - </div> - </div> +<h1>Aliases</h1><p><table><tr><th>Old name</th><th>New name</th></tr> +<tr> - <div id="method-list"> - <h3 class="section-bar">Methods</h3> - <div class="name-list"> - <a href="#M000009">find_template</a>   - <a href="#M000010">find_template_from_inherit_view_paths</a>   - </div> - </div> +<td class="highlight">find_template</td> - </div> +<td class="normal">orig_find_template</td> +</tr> +</table></p> - <!-- if includes --> +<h1>Attributes</h1><p><table><tr><th>Name</th><th>Read/write?</th></tr> +<tr> +<td class="highlight">inherit_view_paths</td> - <div id="section"> - <div id="aliases-list"> - <h3 class="section-bar">External Aliases</h3> +<td class="normal">RW</td> +</tr> +</table></p> - <div class="name-list"> - <table summary="aliases"> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">find_template</td> - <td>-></td> - <td class="context-item-value">orig_find_template</td> - </tr> - </table> - </div> - </div> +<h1>Public Instance Methods</h1> - <div id="attribute-list"> - <h3 class="section-bar">Attributes</h3> - <div class="name-list"> - <table> - <tr class="top-aligned-row context-row"> - <td class="context-item-name">inherit_view_paths</td> - <td class="context-item-value"> [RW] </td> - <td class="context-item-desc"></td> - </tr> - </table> - </div> - </div> - +<a class="small" name="M000009"><br/></a> +<div class="method_block"><h3> +<a href='#M000009'> - <!-- if method_list --> - <div id="methods"> - <h3 class="section-bar">Public Instance methods</h3> +find_template - <div id="method-M000009" class="method-detail"> - <a name="M000009"></a> +(original_template_path, format = nil) - <div class="method-heading"> - <a href="#M000009" class="method-signature"> - <span class="method-name">find_template</span><span class="method-args">(original_template_path, format = nil)</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000009-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000009-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 101</span> +</a> +</h3> + +<p class="source_link" id="M000009-show-link"><a onclick="toggle('M000009-source'); toggleText('M000009-link'); return false;" href="#" id="M000009-link">Show source...</a></p><div class="source" id="M000009-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 101</span> 101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_template</span>(<span class="ruby-identifier">original_template_path</span>, <span class="ruby-identifier">format</span> = <span class="ruby-keyword kw">nil</span>) 102: <span class="ruby-keyword kw">super</span> 103: <span class="ruby-keyword kw">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">ActionView</span><span class="ruby-operator">::</span><span class="ruby-constant">MissingTemplate</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> 104: (<span class="ruby-identifier">inherit_view_paths</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">find_template_from_inherit_view_paths</span>(<span class="ruby-identifier">original_template_path</span>, <span class="ruby-identifier">format</span>)) <span class="ruby-operator">||</span> <span class="ruby-identifier">raise</span>(<span class="ruby-identifier">e</span>) -105: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <h3 class="section-bar">Protected Instance methods</h3> - - <div id="method-M000010" class="method-detail"> - <a name="M000010"></a> - - <div class="method-heading"> - <a href="#M000010" class="method-signature"> - <span class="method-name">find_template_from_inherit_view_paths</span><span class="method-args">(template_path, format)</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000010-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000010-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 108</span> +105: <span class="ruby-keyword kw">end</span></pre></div> +</div> + + +<h1>Protected Instance Methods</h1> + + +<a class="small" name="M000010"><br/></a> +<div class="method_block"><h3> +<a href='#M000010'> + + +find_template_from_inherit_view_paths + +(template_path, format) + +</a> +</h3> + +<p class="source_link" id="M000010-show-link"><a onclick="toggle('M000010-source'); toggleText('M000010-link'); return false;" href="#" id="M000010-link">Show source...</a></p><div class="source" id="M000010-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 108</span> 108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_template_from_inherit_view_paths</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">format</span>) 109: <span class="ruby-comment cmt"># first, we grab the inherit view paths that are 'above' the given template_path</span> 110: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">starting_path</span> = <span class="ruby-identifier">inherit_view_paths</span>.<span class="ruby-identifier">detect</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span> <span class="ruby-identifier">template_path</span>.<span class="ruby-identifier">starts_with?</span>(<span class="ruby-node">"#{path}/"</span>)} @@ -199,22 +442,11 @@ <h3 class="section-bar">Protected Instance methods</h3> 119: <span class="ruby-keyword kw">end</span> 120: <span class="ruby-keyword kw">end</span> 121: <span class="ruby-keyword kw">nil</span> -122: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - - </div> +122: <span class="ruby-keyword kw">end</span></pre></div> +</div> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/classes/InheritViews/PathsContainer.html b/doc/classes/InheritViews/PathsContainer.html index 2cda044..ca7b435 100644 --- a/doc/classes/InheritViews/PathsContainer.html +++ b/doc/classes/InheritViews/PathsContainer.html @@ -1,79 +1,374 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Module: InheritViews::PathsContainer - - - - + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} + +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +</p><span><h1 id="title"> +Module: InheritViews::PathsContainer +</h1></span> +</div><div class="clear"></div><div id="left"> + +<div class="navigation darker top" id="defined_in"><h3>Defined in</h3> + +<a href="../../files/lib/inherit_views_rb.html">lib/inherit_views.rb</a> + +</div> -</head> -<body> +<div class="navigation top" id="methods"><h3>Methods</h3> - <div id="classHeader"> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Module</strong></td> - <td class="class-name-in-header">InheritViews::PathsContainer</td> - </tr> - <tr class="top-aligned-row"> - <td><strong>In:</strong></td> - <td> - <a href="../../files/lib/inherit_views_rb.html"> - lib/inherit_views.rb - </a> - <br /> - </td> - </tr> - </table> - </div> - <!-- banner header --> +<a href='#M000001'> +extended<br/> +</a> - <div id="bodyContent"> - <div id="contextContent"> +<a href='#M000004'> +inherit_view_paths<br/> +</a> - <div id="description"> - <p> + + + +<a href='#M000005'> +inherit_view_paths=<br/> +</a> + + + + +<a href='#M000003'> +inherit_views=<br/> +</a> + + + + +<a href='#M000002'> +inherit_views?<br/> +</a> + + +</div> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">Module: InheritViews::PathsContainer</h1> + +<div id="description"><p> class extension that enables <a href="PathsContainer.html#M000004">inherit_view_paths</a> to be calculated/set @@ -82,189 +377,137 @@ requires a class method called ‘controller_path’ (ActionController::Base & ActionMailer::Base have this) </p> - - </div> +</div> - </div> - <div id="method-list"> - <h3 class="section-bar">Methods</h3> - <div class="name-list"> - <a href="#M000001">extended</a>   - <a href="#M000004">inherit_view_paths</a>   - <a href="#M000005">inherit_view_paths=</a>   - <a href="#M000003">inherit_views=</a>   - <a href="#M000002">inherit_views?</a>   - </div> - </div> +<p></p> - </div> - <!-- if includes --> - <div id="section"> +<h1>Public Class Methods</h1> +<a class="small" name="M000001"><br/></a> +<div class="method_block"><h3> +<a href='#M000001'> - +extended - <!-- if method_list --> - <div id="methods"> - <h3 class="section-bar">Public Class methods</h3> +(base) - <div id="method-M000001" class="method-detail"> - <a name="M000001"></a> +</a> +</h3> - <div class="method-heading"> - <a href="#M000001" class="method-signature"> - <span class="method-name">extended</span><span class="method-args">(base)</span> - </a> - </div> - - <div class="method-description"> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000001-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000001-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 62</span> +<p class="source_link" id="M000001-show-link"><a onclick="toggle('M000001-source'); toggleText('M000001-link'); return false;" href="#" id="M000001-link">Show source...</a></p><div class="source" id="M000001-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 62</span> 62: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extended</span>(<span class="ruby-identifier">base</span>) 63: <span class="ruby-identifier">base</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span> 64: <span class="ruby-identifier">delegate</span> <span class="ruby-identifier">:inherit_views?</span>, <span class="ruby-identifier">:inherit_view_paths</span>, <span class="ruby-identifier">:to</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'self.class'</span> 65: <span class="ruby-keyword kw">end</span> -66: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <h3 class="section-bar">Public Instance methods</h3> - - <div id="method-M000004" class="method-detail"> - <a name="M000004"></a> - - <div class="method-heading"> - <a href="#M000004" class="method-signature"> - <span class="method-name">inherit_view_paths</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> +66: <span class="ruby-keyword kw">end</span></pre></div> +</div> + + +<h1>Public Instance Methods</h1> + + +<a class="small" name="M000004"><br/></a> +<div class="method_block"><h3> +<a href='#M000004'> + + +inherit_view_paths + +() + +</a> +</h3> +<p> Return the inherit view paths, in order of self to ancestor. Takes <a href="PathsContainer.html#M000004">inherit_view_paths</a> from the superclass when first read, and prepends the current controller_path </p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000004-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000004-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 80</span> + +<p class="source_link" id="M000004-show-link"><a onclick="toggle('M000004-source'); toggleText('M000004-link'); return false;" href="#" id="M000004-link">Show source...</a></p><div class="source" id="M000004-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 80</span> 80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inherit_view_paths</span> 81: <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value str">'@inherit_view_paths'</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value str">'@inherit_view_paths'</span>, [<span class="ruby-identifier">controller_path</span>] <span class="ruby-operator">+</span> (<span class="ruby-identifier">superclass</span>.<span class="ruby-identifier">inherit_view_paths</span> <span class="ruby-keyword kw">rescue</span> [])) -82: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000005" class="method-detail"> - <a name="M000005"></a> - - <div class="method-heading"> - <a href="#M000005" class="method-signature"> - <span class="method-name">inherit_view_paths=</span><span class="method-args">(new_paths)</span> - </a> - </div> - - <div class="method-description"> - <p> +82: <span class="ruby-keyword kw">end</span></pre></div> +</div> + +<a class="small" name="M000005"><br/></a> +<div class="method_block"><h3> +<a href='#M000005'> + + +inherit_view_paths= + +(new_paths) + +</a> +</h3> +<p> Set the inherit view paths, in order of self to ancestor. The controller_path for self is always prepended to the front, no matter what the arguments. </p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000005-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000005-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 86</span> + +<p class="source_link" id="M000005-show-link"><a onclick="toggle('M000005-source'); toggleText('M000005-link'); return false;" href="#" id="M000005-link">Show source...</a></p><div class="source" id="M000005-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 86</span> 86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inherit_view_paths=</span>(<span class="ruby-identifier">new_paths</span>) 87: <span class="ruby-identifier">new_paths</span> <span class="ruby-operator">-=</span> [<span class="ruby-identifier">controller_path</span>] 88: <span class="ruby-identifier">old_paths</span> = <span class="ruby-identifier">inherit_view_paths</span> <span class="ruby-operator">-</span> [<span class="ruby-identifier">controller_path</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">new_paths</span> 89: <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value str">'@inherit_view_paths'</span>, [<span class="ruby-identifier">controller_path</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">new_paths</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">old_paths</span>) -90: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000003" class="method-detail"> - <a name="M000003"></a> - - <div class="method-heading"> - <a href="#M000003" class="method-signature"> - <span class="method-name">inherit_views=</span><span class="method-args">(bool)</span> - </a> - </div> - - <div class="method-description"> - <p> +90: <span class="ruby-keyword kw">end</span></pre></div> +</div> + +<a class="small" name="M000003"><br/></a> +<div class="method_block"><h3> +<a href='#M000003'> + + +inherit_views= + +(bool) + +</a> +</h3> +<p> Instruct the class that it is, or is not, inheriting views </p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000003-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000003-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 74</span> + +<p class="source_link" id="M000003-show-link"><a onclick="toggle('M000003-source'); toggleText('M000003-link'); return false;" href="#" id="M000003-link">Show source...</a></p><div class="source" id="M000003-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 74</span> 74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inherit_views=</span>(<span class="ruby-identifier">bool</span>) 75: <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-value str">'inherit_views'</span>, <span class="ruby-identifier">bool</span>) -76: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - <div id="method-M000002" class="method-detail"> - <a name="M000002"></a> - - <div class="method-heading"> - <a href="#M000002" class="method-signature"> - <span class="method-name">inherit_views?</span><span class="method-args">()</span> - </a> - </div> - - <div class="method-description"> - <p> +76: <span class="ruby-keyword kw">end</span></pre></div> +</div> + +<a class="small" name="M000002"><br/></a> +<div class="method_block"><h3> +<a href='#M000002'> + + +inherit_views? + +() + +</a> +</h3> +<p> Return true if the class is inheriting views </p> - <p><a class="source-toggle" href="#" - onclick="toggleCode('M000002-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000002-source"> -<pre> - <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 69</span> + +<p class="source_link" id="M000002-show-link"><a onclick="toggle('M000002-source'); toggleText('M000002-link'); return false;" href="#" id="M000002-link">Show source...</a></p><div class="source" id="M000002-source"><pre> <span class="ruby-comment cmt"># File lib/inherit_views.rb, line 69</span> 69: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inherit_views?</span> 70: <span class="ruby-identifier">read_inheritable_attribute</span>(<span class="ruby-value str">'inherit_views'</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span> -71: <span class="ruby-keyword kw">end</span> -</pre> - </div> - </div> - </div> - - - </div> +71: <span class="ruby-keyword kw">end</span></pre></div> +</div> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/created.rid b/doc/created.rid index 18ea53a..3e567f5 100644 --- a/doc/created.rid +++ b/doc/created.rid @@ -1 +1 @@ -Sun, 08 Feb 2009 10:14:12 +0000 +Sun, 08 Feb 2009 11:23:27 +0000 diff --git a/doc/files/History_txt.html b/doc/files/History_txt.html index 0e12786..e9f0b50 100644 --- a/doc/files/History_txt.html +++ b/doc/files/History_txt.html @@ -1,75 +1,333 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>File: History.txt - - - - - - - - +function ajaxGet(url) { + url = (href_base + url).replace('/./', '/') + var req = false; + + if (window.ActiveXObject) { + try { + // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object + // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die. + req = new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (e) { + try { + /* IE 6 and maybe 5, don't know, don't care */ + req = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (e) { + req = false; + } + } + } + } + + /* real browsers */ + if (!req && window.XMLHttpRequest) { + try { + req = new XMLHttpRequest(); + } catch (e) { + req = false; + } + } + + if (req) { + req.open('GET', url, false); + req.send(null); + return req.responseText; + } else { + return "Ajax error"; + } +} + + +function addEvent(elm, evType, fn, useCapture) { + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } else { + elm['on' + evType] = fn; + } +} + +function insertIndices() { + pages = ["class", "file", "method"] + for (x in pages) { + $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base); + } + /* mouseoverify method links */ + links = $('method').getElementsByTagName('a'); + for (var x = 0; x < links.length; x++) { + if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) { + links[x].innerHTML = m[1] + '
'; + links[x].title = m[2]; + } + } + /* this is stupid */ + $('class').style.display = "block"; + $('file').style.display = "block"; + + /* has to be here because IE7 does not guarantee the onLoad callback order */ + abbreviateIndicesInner(["class", "file"], 25, "a"); + /* same, linkTitle() depends on the class link list */ + linkTitle(); +} + +function abbreviateIndices() { + var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"]; + abbreviateIndicesInner(ids, 25, 'a'); + abbreviateIndicesInner(ids, 25, 'span'); +} + +function abbreviateIndicesInner(indices, amount, tag) { + for (var x = 0; x < indices.length; x++) { + var the_index = $(indices[x]); + if (the_index) { + links = the_index.getElementsByTagName(tag); + for (var y = 0; y < links.length; y++) { + var link = links[y]; + if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) { + // avoid nesting + link.innerHTML = link.innerHTML.replace(/
|\n/gi, ''); + link.title = link.innerHTML; + link.innerHTML = abbreviate(link.innerHTML, amount) + '
'; + } + } + } + } +} +function linkTitle() { + + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} - <div id="fileHeader"> - <h1>History.txt</h1> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Path:</strong></td> - <td>History.txt - </td> - </tr> - <tr class="top-aligned-row"> - <td><strong>Last Update:</strong></td> - <td>Sat Feb 07 19:46:56 +0000 2009</td> - </tr> - </table> - </div> - <!-- banner header --> +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +History.txt +</p><span><h1 id="title"> +File: History.txt +</h1></span> +</div><div class="clear"></div><div id="left"> - <div id="bodyContent"> - <div id="contextContent"> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">File: History.txt</h1> - <div id="description"> - <ul> +<div id="description"><ul> <li>Added ActionMailer support </li> @@ -112,36 +370,17 @@ <h1>History.txt</h1> </li> </ul> - - </div> - - - </div> - - - </div> - - - <!-- if includes --> - - <div id="section"> - +</div> - +<p></p> - <!-- if method_list --> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/files/License_txt.html b/doc/files/License_txt.html index 54e11ef..f2b63c8 100644 --- a/doc/files/License_txt.html +++ b/doc/files/License_txt.html @@ -1,75 +1,333 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>File: License.txt - - - - - - - - +function ajaxGet(url) { + url = (href_base + url).replace('/./', '/') + var req = false; + + if (window.ActiveXObject) { + try { + // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object + // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die. + req = new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (e) { + try { + /* IE 6 and maybe 5, don't know, don't care */ + req = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (e) { + req = false; + } + } + } + } + + /* real browsers */ + if (!req && window.XMLHttpRequest) { + try { + req = new XMLHttpRequest(); + } catch (e) { + req = false; + } + } + + if (req) { + req.open('GET', url, false); + req.send(null); + return req.responseText; + } else { + return "Ajax error"; + } +} + + +function addEvent(elm, evType, fn, useCapture) { + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } else { + elm['on' + evType] = fn; + } +} + +function insertIndices() { + pages = ["class", "file", "method"] + for (x in pages) { + $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base); + } + /* mouseoverify method links */ + links = $('method').getElementsByTagName('a'); + for (var x = 0; x < links.length; x++) { + if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) { + links[x].innerHTML = m[1] + '
'; + links[x].title = m[2]; + } + } + /* this is stupid */ + $('class').style.display = "block"; + $('file').style.display = "block"; + + /* has to be here because IE7 does not guarantee the onLoad callback order */ + abbreviateIndicesInner(["class", "file"], 25, "a"); + /* same, linkTitle() depends on the class link list */ + linkTitle(); +} + +function abbreviateIndices() { + var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"]; + abbreviateIndicesInner(ids, 25, 'a'); + abbreviateIndicesInner(ids, 25, 'span'); +} + +function abbreviateIndicesInner(indices, amount, tag) { + for (var x = 0; x < indices.length; x++) { + var the_index = $(indices[x]); + if (the_index) { + links = the_index.getElementsByTagName(tag); + for (var y = 0; y < links.length; y++) { + var link = links[y]; + if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) { + // avoid nesting + link.innerHTML = link.innerHTML.replace(/
|\n/gi, ''); + link.title = link.innerHTML; + link.innerHTML = abbreviate(link.innerHTML, amount) + '
'; + } + } + } + } +} +function linkTitle() { + + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} - <div id="fileHeader"> - <h1>License.txt</h1> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Path:</strong></td> - <td>License.txt - </td> - </tr> - <tr class="top-aligned-row"> - <td><strong>Last Update:</strong></td> - <td>Sat Feb 07 19:46:56 +0000 2009</td> - </tr> - </table> - </div> - <!-- banner header --> +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +License.txt +</p><span><h1 id="title"> +File: License.txt +</h1></span> +</div><div class="clear"></div><div id="left"> - <div id="bodyContent"> - <div id="contextContent"> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">File: License.txt</h1> - <div id="description"> - <p> +<div id="description"><p> Copyright (c) 2008-2009 Ian White - ian.w.white@gmail.com </p> <p> @@ -94,36 +352,17 @@ <h1>License.txt</h1> OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </p> - - </div> - - - </div> - - - </div> - - - <!-- if includes --> - - <div id="section"> - +</div> - +<p></p> - <!-- if method_list --> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/files/README_rdoc.html b/doc/files/README_rdoc.html index dd0a533..9fc7f9a 100644 --- a/doc/files/README_rdoc.html +++ b/doc/files/README_rdoc.html @@ -1,75 +1,333 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>File: README.rdoc - - - - - - - - +function ajaxGet(url) { + url = (href_base + url).replace('/./', '/') + var req = false; + + if (window.ActiveXObject) { + try { + // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object + // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die. + req = new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (e) { + try { + /* IE 6 and maybe 5, don't know, don't care */ + req = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (e) { + req = false; + } + } + } + } + + /* real browsers */ + if (!req && window.XMLHttpRequest) { + try { + req = new XMLHttpRequest(); + } catch (e) { + req = false; + } + } + + if (req) { + req.open('GET', url, false); + req.send(null); + return req.responseText; + } else { + return "Ajax error"; + } +} + + +function addEvent(elm, evType, fn, useCapture) { + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } else { + elm['on' + evType] = fn; + } +} + +function insertIndices() { + pages = ["class", "file", "method"] + for (x in pages) { + $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base); + } + /* mouseoverify method links */ + links = $('method').getElementsByTagName('a'); + for (var x = 0; x < links.length; x++) { + if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) { + links[x].innerHTML = m[1] + '
'; + links[x].title = m[2]; + } + } + /* this is stupid */ + $('class').style.display = "block"; + $('file').style.display = "block"; + + /* has to be here because IE7 does not guarantee the onLoad callback order */ + abbreviateIndicesInner(["class", "file"], 25, "a"); + /* same, linkTitle() depends on the class link list */ + linkTitle(); +} + +function abbreviateIndices() { + var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"]; + abbreviateIndicesInner(ids, 25, 'a'); + abbreviateIndicesInner(ids, 25, 'span'); +} + +function abbreviateIndicesInner(indices, amount, tag) { + for (var x = 0; x < indices.length; x++) { + var the_index = $(indices[x]); + if (the_index) { + links = the_index.getElementsByTagName(tag); + for (var y = 0; y < links.length; y++) { + var link = links[y]; + if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) { + // avoid nesting + link.innerHTML = link.innerHTML.replace(/
|\n/gi, ''); + link.title = link.innerHTML; + link.innerHTML = abbreviate(link.innerHTML, amount) + '
'; + } + } + } + } +} +function linkTitle() { + + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} - <div id="fileHeader"> - <h1>README.rdoc</h1> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Path:</strong></td> - <td>README.rdoc - </td> - </tr> - <tr class="top-aligned-row"> - <td><strong>Last Update:</strong></td> - <td>Sat Feb 07 19:46:56 +0000 2009</td> - </tr> - </table> - </div> - <!-- banner header --> +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +README.rdoc +</p><span><h1 id="title"> +File: README.rdoc +</h1></span> +</div><div class="clear"></div><div id="left"> - <div id="bodyContent"> - <div id="contextContent"> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">File: README.rdoc</h1> - <div id="description"> - <h1><a href="http://github.com/ianwhite">ianwhite</a> / <a href="http://github.com/ianwhite/inherit_views">inherit_views</a> >><a href="http://ianwhite.github.com/inherit_views">info</a> >><a href="http://ianwhite.github.com/inherit_views/doc">api</a></h1> +<div id="description"><h1><a href="http://github.com/ianwhite">ianwhite</a> / <a href="http://github.com/ianwhite/inherit_views">inherit_views</a> >><a href="http://ianwhite.github.com/inherit_views">info</a> >><a href="http://ianwhite.github.com/inherit_views/doc">api</a></h1> <h2>Status</h2> <p> inherit_views works with rails 2.x @@ -152,36 +410,17 @@ <h2>Contributors</h2> </li> </ul> - - </div> - - - </div> - - - </div> - - - <!-- if includes --> - - <div id="section"> - +</div> - +<p></p> - <!-- if method_list --> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/files/lib/inherit_views_rb.html b/doc/files/lib/inherit_views_rb.html index d891a59..3c31528 100644 --- a/doc/files/lib/inherit_views_rb.html +++ b/doc/files/lib/inherit_views_rb.html @@ -1,75 +1,333 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>File: inherit_views.rb - - - - - - - - +function ajaxGet(url) { + url = (href_base + url).replace('/./', '/') + var req = false; + + if (window.ActiveXObject) { + try { + // stupid hack because IE7 disables local Ajax with the native xmlhttprequest object + // for security purposes. Yet ActiveX still works. Thanks, Microsoft. I hate you. Die. + req = new ActiveXObject("MSXML2.XMLHTTP.3.0"); + } catch (e) { + try { + /* IE 6 and maybe 5, don't know, don't care */ + req = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (e) { + req = false; + } + } + } + } + + /* real browsers */ + if (!req && window.XMLHttpRequest) { + try { + req = new XMLHttpRequest(); + } catch (e) { + req = false; + } + } + + if (req) { + req.open('GET', url, false); + req.send(null); + return req.responseText; + } else { + return "Ajax error"; + } +} + + +function addEvent(elm, evType, fn, useCapture) { + if (elm.addEventListener) { + elm.addEventListener(evType, fn, useCapture); + return true; + } else if (elm.attachEvent) { + var r = elm.attachEvent('on' + evType, fn); + return r; + } else { + elm['on' + evType] = fn; + } +} + +function insertIndices() { + pages = ["class", "file", "method"] + for (x in pages) { + $(pages[x]).innerHTML += ajaxGet('fr_' + pages[x] + '_index.html').replace(/(href=")/g, '$1' + href_base); + } + /* mouseoverify method links */ + links = $('method').getElementsByTagName('a'); + for (var x = 0; x < links.length; x++) { + if (m = links[x].innerHTML.match(/(.*)\s\((.*)\)/)) { + links[x].innerHTML = m[1] + '
'; + links[x].title = m[2]; + } + } + /* this is stupid */ + $('class').style.display = "block"; + $('file').style.display = "block"; + + /* has to be here because IE7 does not guarantee the onLoad callback order */ + abbreviateIndicesInner(["class", "file"], 25, "a"); + /* same, linkTitle() depends on the class link list */ + linkTitle(); +} + +function abbreviateIndices() { + var ids = ["defined_in", "child_of", "includes", "requires", "method", "methods"]; + abbreviateIndicesInner(ids, 25, 'a'); + abbreviateIndicesInner(ids, 25, 'span'); +} + +function abbreviateIndicesInner(indices, amount, tag) { + for (var x = 0; x < indices.length; x++) { + var the_index = $(indices[x]); + if (the_index) { + links = the_index.getElementsByTagName(tag); + for (var y = 0; y < links.length; y++) { + var link = links[y]; + if (link.getElementsByTagName('span').length == 0 && link.getElementsByTagName('a').length == 0) { + // avoid nesting + link.innerHTML = link.innerHTML.replace(/
|\n/gi, ''); + link.title = link.innerHTML; + link.innerHTML = abbreviate(link.innerHTML, amount) + '
'; + } + } + } + } +} +function linkTitle() { + + /* grab the correct title element from the index */ + var index_page = ajaxGet('index.html'); + title_text = index_page.match(/(.*)<\/title>/m)[1]; + document.title = title_text + " - " + document.title; + var p = $('header').getElementsByTagName('p')[0] + if (p.innerHTML.match(/^\s*$/)) { + p.innerHTML = title_text; + } else { + p.innerHTML = title_text + ": " + p.innerHTML; + } + + /* set the link properly */ + title_link = index_page.match(/<a\s+href="(.*?)"/)[1]; + var element = $('title'); + var item_type = ""; + var item_name = ""; + if (m = element.innerHTML.match(/(Class:|Module:|File:)\s*(.*)/)) { + item_type = m[1]; + item_name = m[2]; + } else { + item_name = element.innerHTML; + } + element.innerHTML = '<a href="' + href_base + title_link + '">' + item_type + " " + abbreviate(item_name, 45) + '</a>'; + element.getElementsByTagName('a')[0].title = item_name + + /* breadcrumb navigation */ + items = item_name.split("::"); + items_new = item_name.split("::"); + file_links = $('class').getElementsByTagName('a'); + for (var x = 0; x < items.length - 1; x++ ){ + var item = items[x]; + link = ("/classes/" + items.slice(0,x).join("/") + "/" + item + ".html").replace('//', '/'); + regex = new RegExp(RegExp.escape(link) + '$'); + for (var y = 0; y < file_links.length; y++) { + if (file_links[y].href.match(regex)) { + items_new[x] = '<a href="' + href_base + link + '">' + item + '</a>'; + break; + } + } + } + $('item_name').innerHTML = item_type + ' ' + items_new.join(" :: "); +} + +function abbreviate(s, size) { + while (s.length > size) { + var old_s = s; + s = s.replace(/\s|\n/mg, ''); + s = s.replace(/([A-Z])[a-z]+/m, '$1'); + if (!s || old_s == s) { + return "..." + s.substring(s.length - size, s.length); + } + } + return s; +} + +function disableSubmit(event) { + var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; + if (keyCode == 13) { + return false; + } else { + return true; + } +} + +function filterList(id, s, event) { + + /* some weak escaping */ + s = s.replace(/[^\w\d\.\_\-\/\:\=\[\]\?\!]/g, ''); + s = RegExp.escape(s); + + var show_all = false; + if (s.match(/^\s*$/)) { + show_all = true; + } + + links = $(id).getElementsByTagName('a') + regex = new RegExp(s, 'i'); + + for (var x = 0; x < links.length; x++) { + var link = links[x]; + if (show_all) { + link.style.display = 'inline'; + } else { + if (link.innerHTML.match(regex)) { + link.style.display = 'inline'; + } else { + link.style.display = 'none'; + } + } + } + return true; +} + +RegExp.escape = function(text) { + if (!arguments.callee.sRE) { + var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\']; + arguments.callee.sRE = new RegExp( + '(\\' + specials.join('|\\') + ')', 'g' + ); + } + return text.replace(arguments.callee.sRE, '\\$1'); +} + +function hacks() { + // show the spacer if necessary, + divs = document.getElementsByTagName('div'); + for(var x = 0; x < divs.length; x++) { + if (divs[x].className && divs[x].className.match(/top/)) { + document.getElementById('spacer').style.display = 'block'; + } + } + // remove extra colons from tables + tds = document.getElementsByTagName('td'); + for(var x = 0; x < tds.length; x++) { + str = tds[x].innerHTML + if (str.charAt(str.length - 1) == ":") { + tds[x].innerHTML = str.slice(0, str.length - 1) + } + } +} - <div id="fileHeader"> - <h1>inherit_views.rb</h1> - <table class="header-table"> - <tr class="top-aligned-row"> - <td><strong>Path:</strong></td> - <td>lib/inherit_views.rb - </td> - </tr> - <tr class="top-aligned-row"> - <td><strong>Last Update:</strong></td> - <td>Sat Feb 07 19:46:56 +0000 2009</td> - </tr> - </table> - </div> - <!-- banner header --> +addEvent(window, 'load', insertIndices, false); +addEvent(window, 'load', abbreviateIndices, false); +addEvent(window, 'load', stripe, false); +addEvent(window, 'load', highlightSymbols, false); +addEvent(window, 'load', hacks, false); +</script></head><body><div id="container"><div class="curve" id="preheader_curve_0"></div><div class="curve" id="preheader_curve_1"></div><div class="curve" id="preheader_curve_2"></div><div class="curve" id="preheader_curve_3"></div><div class="curve" id="preheader_curve_4"></div><div class="curve" id="preheader_curve_5"></div><div id="header"><p> +lib/inherit_views.rb +</p><span><h1 id="title"> +File: inherit_views.rb +</h1></span> +</div><div class="clear"></div><div id="left"> - <div id="bodyContent"> - <div id="contextContent"> +<div id="spacer"></div><div class="navigation darker index" id="class_wrapper"><div class="list_header"><h3>All classes</h3></div><div class="list_header_link"><a onclick="toggle('class'); toggleText('class_link'); return false;" href="#" id="class_link">Hide...</a></div><div class="clear"></div><div id="class"><form><label for="filter_class">Filter:  </label><input type="text" onKeyUp="return filterList('class', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_class"></input></form></div></div><div class="navigation darker index" id="file_wrapper"><div class="list_header"><h3>All files</h3></div><div class="list_header_link"><a onclick="toggle('file'); toggleText('file_link'); return false;" href="#" id="file_link">Hide...</a></div><div class="clear"></div><div id="file"><form><label for="filter_file">Filter:  </label><input type="text" onKeyUp="return filterList('file', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_file"></input></form></div></div><div class="navigation darker index" id="method_wrapper"><div class="list_header"><h3>All methods</h3></div><div class="list_header_link"><a onclick="toggle('method'); toggleText('method_link'); return false;" href="#" id="method_link">Show...</a></div><div class="clear"></div><div id="method"><form><label for="filter_method">Filter:  </label><input type="text" onKeyUp="return filterList('method', this.value, event);" onKeyPress="return disableSubmit(event);" id="filter_method"></input></form></div></div></div><div id="content"> +<h1 id="item_name">File: inherit_views.rb</h1> - <div id="description"> - <p> +<div id="description"><p> Allow your controllers to inherit their views from parent controllers, or from specified view paths. </p> @@ -123,36 +381,17 @@ <h3>Example</h3> # (not 'far' or 'faz' from FooController) end </pre> - - </div> - - - </div> - - - </div> - - - <!-- if includes --> - - <div id="section"> - +</div> - +<p></p> - <!-- if method_list --> - </div> -<div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> -</div> -</body> -</html> \ No newline at end of file +</div><div class="clear" id="footer">Generated on Jan 21, 2008 / Allison 2 © 2007 <a href="http://cloudbur.st">Cloudburst, LLC</a></div></div></body></html> \ No newline at end of file diff --git a/doc/fr_class_index.html b/doc/fr_class_index.html index f08d10b..2c8460f 100644 --- a/doc/fr_class_index.html +++ b/doc/fr_class_index.html @@ -1,31 +1,6 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<!-- - - Classes - - --> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <title>Classes - - - - - -
-

Classes

- -
- - \ No newline at end of file +InheritViews
+InheritViews::ActMethod
+InheritViews::ActionView
+InheritViews::PathSet
+InheritViews::PathsContainer
\ No newline at end of file diff --git a/doc/fr_file_index.html b/doc/fr_file_index.html index bda96ef..68c8ba2 100644 --- a/doc/fr_file_index.html +++ b/doc/fr_file_index.html @@ -1,30 +1,5 @@ - - - - - - - Files - - - - - -
-

Files

- -
- - \ No newline at end of file +History.txt
+License.txt
+README.rdoc
+lib/inherit_views.rb
\ No newline at end of file diff --git a/doc/fr_method_index.html b/doc/fr_method_index.html index 93bcae2..468b1b2 100644 --- a/doc/fr_method_index.html +++ b/doc/fr_method_index.html @@ -1,36 +1,11 @@ - - - - - - - Methods - - - - - -
-

Methods

- -
- - \ No newline at end of file +extended (InheritViews::PathsContainer)
+find_template (InheritViews::PathSet)
+find_template_from_inherit_view_paths (InheritViews::PathSet)
+included (InheritViews::ActionView)
+inherit_view_paths (InheritViews::PathsContainer)
+inherit_view_paths= (InheritViews::PathsContainer)
+inherit_views (InheritViews::ActMethod)
+inherit_views= (InheritViews::PathsContainer)
+inherit_views? (InheritViews::PathsContainer)
+view_paths= (InheritViews::ActionView)
\ No newline at end of file diff --git a/doc/index.html b/doc/index.html index 1cc13db..8e9ea1b 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,24 +1 @@ - - - - - - - inherit_views - - - - - - - - - - - \ No newline at end of file +inherit_views
\ No newline at end of file diff --git a/doc/rdoc-style.css b/doc/rdoc-style.css index 44c7b3d..4a650b2 100644 --- a/doc/rdoc-style.css +++ b/doc/rdoc-style.css @@ -1,208 +1,320 @@ -body { - font-family: Verdana,Arial,Helvetica,sans-serif; - font-size: 90%; - margin: 0; - margin-left: 40px; - padding: 0; - background: white; -} - -h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; } -h1 { font-size: 150%; } -h2,h3,h4 { margin-top: 1em; } +/*; +Allison 2 template; +Copyright 2007, 2008 Cloudburst, LLC. Licensed under the AFL 3. See the included LICENSE file.; +*/; -a { background: #eef; color: #039; text-decoration: none; } -a:hover { background: #039; color: #eef; } +/* default styles */ -/* Override the base stylesheet's Anchor inside a table cell */ -td > a { - background: transparent; - color: #039; - text-decoration: none; +* { +margin: 0; +padding: 0; +border: none; } -/* and inside a section title */ -.section-title > a { - background: transparent; - color: #eee; - text-decoration: none; -} -/* === Structural elements =================================== */ -div#index { - margin: 0; - margin-left: -40px; - padding: 0; - font-size: 90%; -} -div#index a { - margin-left: 0.7em; -} -div#index .section-bar { - margin-left: 0px; - padding-left: 0.7em; - background: #ccc; - font-size: small; -} -div#classHeader, div#fileHeader { - width: auto; - color: white; - padding: 0.5em 1.5em 0.5em 1.5em; - margin: 0; - margin-left: -40px; - border-bottom: 3px solid #006; -} -div#classHeader a, div#fileHeader a { - background: inherit; - color: white; -} -div#classHeader td, div#fileHeader td { - background: inherit; - color: white; +.clear { +clear: both; } +a { +color: #304878; +font-weight: bold; +text-decoration: none; +} -div#fileHeader { - background: #057; +a:hover { +text-decoration: underline; } -div#classHeader { - background: #048; +html, body { +color: #000; +font-size: 13px; +font-family: helvetica, verdana, sans; +background-color: #fff; +text-align: center; +margin: 0; +padding: 0; } +p, ul, ol { +line-height: 16px; +} li { +margin: 3px; +_margin-left: 40px; +} p, pre, table, ol, ul { +margin: 16px; +} #item_name { +margin-top: -8px; +} -.class-name-in-header { - font-size: 180%; - font-weight: bold; +h1 { +font-size: 22px; +margin-top: 16px; +} h2, h3 { +font-size: 18px; +margin: 6px; +margin-right: 0; +padding-top: 12px; } +/* center everything */ -div#bodyContent { - padding: 0 1.5em 0 1.5em; +#container { +margin: 20px auto 0 auto; +width: 900px; +text-align: left; } -div#description { - padding: 0.5em 1.5em; - background: #efefef; - border: 1px dotted #999; +/* header stuff */ + +#header { +padding: 6px; +padding-top: 3px; +width: 888px; +height: 52px; +_height: 58px; +margin-bottom: 12px; +vertical-align: baseline; +background-color: #181848; +overflow: hidden; +} .curve { +background-color: #181848; +margin: 0; +padding: 0; +height: 1px; +overflow: hidden /* again, ie problem */; } -div#description h1,h2,h3,h4,h5,h6 { - color: #125;; - background: transparent; -} -div#validator-badges { - text-align: center; -} -div#validator-badges img { border: 0; } -div#copyright { - color: #333; - background: #efefef; - font: 0.75em sans-serif; - margin-top: 5em; - margin-bottom: 0; - padding: 0.5em 2em; -} -/* === Classes =================================== */ +#preheader_curve_5{border-left: 1px solid #fff; border-right: 1px solid #fff; width: 898px; _width: 888px; } +#preheader_curve_4{border-left: 1px solid #fff; border-right: 1px solid #fff; width: 898px; _width: 888px; } +#preheader_curve_3{border-left: 2px solid #fff; border-right: 2px solid #fff; width: 896px; _width: 888px; } +#preheader_curve_2{border-left: 3px solid #fff; border-right: 3px solid #fff; width: 894px; _width: 888px; } +#preheader_curve_1{border-left: 4px solid #fff; border-right: 4px solid #fff; width: 892px; _width: 888px; } +#preheader_curve_0{border-left: 6px solid #fff; border-right: 6px solid #fff; width: 888px; _width: 888px; } -table.header-table { - color: white; - font-size: small; +#header h1 { +color: #fff; +font-size: 30px; +margin: 4px 0 0 0; +} #header p { +margin: 0; +padding: 0; +padding-left: 3px; +font-size: 16px; +color: #fff; +} #header a { +color: #fff; +text-decoration: none; +font-weight: bold; } -.type-note { - font-size: small; - color: #DEDEDE; -} +/* basic layout and navigation bars */ -.xxsection-bar { - background: #eee; - color: #333; - padding: 3px; +#left { +background-color: #181848; +width: 220px; +float: left; +_width: 208px; +margin-bottom: 24px; +} #left a { +line-height: 14px; } -.section-bar { - color: #333; - border-bottom: 1px solid #999; - margin-left: -20px; +/* navigation bar colors and text styles */ + +.navigation { +width: 196px; +margin: 6px; +padding: 6px; +text-align: left; +background-color: #fff; +overflow: hidden; +} .navigation h3 { +font-weight: bold; +margin-bottom: 5px; +} .navigation span, .navigation a { +margin-left: 6px; +} #includes .navigation span, #includes .navigation a { +margin-left: 0; +} .darker { +background-color: #e4ebed; +} #spacer { +background-color: #fff; +height: 18px; +display: none; } +/* content area */ + +#content { +padding: 20px; +width: 640px; +float: left; +min-height: 450px; +margin: 0; +margin-bottom: -4px; +} #content img { +padding-top: 6px; +padding-bottom: 12px; +} -.section-title { - background: #79a; - color: #eee; - padding: 3px; - margin-top: 2em; - margin-left: -30px; - border: 1px solid #999; +#content h1, h2 { +border-top: 1px solid #e4ebed; +} #content h1 { +padding-top: 18px; +} #content #item_name { /* why does this need to be fully qualified? */ +padding-top: 0; +border: none; } -.top-aligned-row { vertical-align: top } -.bottom-aligned-row { vertical-align: bottom } +/* footer */ + +#footer { +text-align: center; +background-color: #fff; +padding: 18px; +border-top: 1px solid #e4ebed; +color: #ccd5dc; +} #footer a { +font-weight: normal; +color: #ccd5dc; +} -/* --- Context section classes ----------------------- */ +/* for that dumb redirect index page I can't avoid */ -.context-row { } -.context-item-name { font-family: monospace; font-weight: bold; color: black; } -.context-item-value { font-size: small; color: #448; } -.context-item-desc { color: #333; padding-left: 2em; } +#redirect { +text-align: center; +} #redirect a { +color: #181848; +} -/* --- Method classes -------------------------- */ -.method-detail { - background: #efefef; - padding: 0; - margin-top: 0.5em; - margin-bottom: 1em; - border: 1px dotted #ccc; +/* tables */ + +table { +width: 585px; +margin-right: 0; +border-collapse: collapse; +border: 1px solid #e4ebed; +} td, th { +background-color: #fff; +text-align: left; +padding: 6px; +line-height: 14px; +font-size: 13px; +} td.normal { +font-family: Courier, Courier New, monospace; +font-size: 12px; +} td.highlight { +color: #304878; } -.method-heading { - color: black; - background: #ccc; - border-bottom: 1px solid #666; - padding: 0.2em 0.5em 0 0.5em; + +/* method_block details */ + +div.method_block { +border-bottom: 1px solid #e4ebed; +margin-left: 20px; +margin-bottom: -17px; +margin-top: 17px; +} div.method_block h3 { +color: #181848; +margin-left: 0; +padding: 0; +} #content div.method_block h1, #content #description h1 { +margin-left: 6px; +color: #ccd5dc; +} div.method_block a.small { /* where is this used? */ +font-size: 3px; +line-height: 3px; } -.method-signature { color: black; background: inherit; } -.method-name { font-weight: bold; } -.method-args { font-style: italic; } -.method-description { padding: 0 0.5em 0 0.5em; } -/* --- Source code sections -------------------- */ +/* index includes on the navigation bar */ + +div.index a { +font-size: 13px; +} #method { +display: none; +} #file, #class { +display: block; +} div.list_header { +float: left; +} div.list_header_link { +float: right; +padding-top: 3px; +} div.list_header_link a { +font-weight: normal; +} div.navigation h3, .list_header_link { +margin: 0; +margin-top: 6px; +margin-bottom: 6px; +padding: 0; +} -a.source-toggle { font-size: 90%; } -div.method-source-code { - background: #262626; - color: #ffdead; - margin: 1em; - padding: 0.5em; - border: 1px dashed #999; - overflow: hidden; +.index label { +font-size: 13px; +} .index form input { +width: 136px; +} .index form { +margin-bottom: 6px; } -div.method-source-code pre { color: #ffdead; overflow: hidden; } +ol, ul { +margin-left: 6px; +} -/* --- Ruby keyword styles --------------------- */ +p.source_link a { +text-align: right; +font-weight: normal; +} div.source { +display: none; +} pre, tt { +color: #181848; +font-weight: normal; +font-family: Courier, Courier New, monospace; +font-size: 12px; +} pre { +line-height: 14px; +margin-left: 12px; +overflow: auto; +/* next 4 lines because IE sucks */ +_position: relative; +_width: 587px; +_overflow-x:scroll; +_overflow-y:visible; +} b tt, tt b { +font-weight: bold; +} div.source g { +margin-left: 0; +} p.source_link { +text-align: center; +} -.standalone-code { background: #221111; color: #ffdead; overflow: hidden; } +/* source code highlighting */ -.ruby-constant { color: #7fffd4; background: transparent; } -.ruby-keyword { color: #00ffff; background: transparent; } -.ruby-ivar { color: #eedd82; background: transparent; } -.ruby-operator { color: #00ffee; background: transparent; } -.ruby-identifier { color: #ffdead; background: transparent; } -.ruby-node { color: #ffa07a; background: transparent; } -.ruby-comment { color: #b22222; font-weight: bold; background: transparent; } -.ruby-regexp { color: #ffa07a; background: transparent; } -.ruby-value { color: #7fffd4; background: transparent; } \ No newline at end of file +.source pre { +color: black; +} +pre .ruby-value, pre .ruby-symbol { +color: #1104bb; +} pre .ruby-value.str, pre .ruby-node { +color: #181848; +} pre .ruby-ivar, pre .ruby-cvar { +} pre .ruby-comment { +color: #009500; +} pre .ruby-constant { +color: #cd8802; +} pre .ruby-keyword { +color: #8d04aa; +} \ No newline at end of file