jfish 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.document +3 -0
- data/Gemfile +4 -0
- data/LICENSE +26 -0
- data/README.md +57 -0
- data/README.rdoc +19 -0
- data/Rakefile +11 -0
- data/VERSION +1 -0
- data/jfish.gemspec +38 -0
- data/lib/jfish.rb +720 -0
- data/lib/template/jfish/_footer.rhtml +5 -0
- data/lib/template/jfish/_head.rhtml +16 -0
- data/lib/template/jfish/_sidebar_VCS_info.rhtml +18 -0
- data/lib/template/jfish/_sidebar_classes.rhtml +9 -0
- data/lib/template/jfish/_sidebar_extends.rhtml +16 -0
- data/lib/template/jfish/_sidebar_in_files.rhtml +8 -0
- data/lib/template/jfish/_sidebar_includes.rhtml +16 -0
- data/lib/template/jfish/_sidebar_installed.rhtml +14 -0
- data/lib/template/jfish/_sidebar_methods.rhtml +12 -0
- data/lib/template/jfish/_sidebar_navigation.rhtml +10 -0
- data/lib/template/jfish/_sidebar_pages.rhtml +12 -0
- data/lib/template/jfish/_sidebar_parent.rhtml +10 -0
- data/lib/template/jfish/_sidebar_search.rhtml +10 -0
- data/lib/template/jfish/_sidebar_sections.rhtml +10 -0
- data/lib/template/jfish/_sidebar_table_of_contents.rhtml +19 -0
- data/lib/template/jfish/class.rhtml +179 -0
- data/lib/template/jfish/images/add.png +0 -0
- data/lib/template/jfish/images/arrow_up.png +0 -0
- data/lib/template/jfish/images/brick.png +0 -0
- data/lib/template/jfish/images/brick_link.png +0 -0
- data/lib/template/jfish/images/bug.png +0 -0
- data/lib/template/jfish/images/bullet_black.png +0 -0
- data/lib/template/jfish/images/bullet_toggle_minus.png +0 -0
- data/lib/template/jfish/images/bullet_toggle_plus.png +0 -0
- data/lib/template/jfish/images/date.png +0 -0
- data/lib/template/jfish/images/delete.png +0 -0
- data/lib/template/jfish/images/find.png +0 -0
- data/lib/template/jfish/images/loadingAnimation.gif +0 -0
- data/lib/template/jfish/images/logo.png +0 -0
- data/lib/template/jfish/images/macFFBgHack.png +0 -0
- data/lib/template/jfish/images/package.png +0 -0
- data/lib/template/jfish/images/page_green.png +0 -0
- data/lib/template/jfish/images/page_white_text.png +0 -0
- data/lib/template/jfish/images/page_white_width.png +0 -0
- data/lib/template/jfish/images/plugin.png +0 -0
- data/lib/template/jfish/images/ruby.png +0 -0
- data/lib/template/jfish/images/tag_blue.png +0 -0
- data/lib/template/jfish/images/tag_green.png +0 -0
- data/lib/template/jfish/images/transparent.png +0 -0
- data/lib/template/jfish/images/wrench.png +0 -0
- data/lib/template/jfish/images/wrench_orange.png +0 -0
- data/lib/template/jfish/images/zoom.png +0 -0
- data/lib/template/jfish/index.rhtml +19 -0
- data/lib/template/jfish/js/darkfish.js +155 -0
- data/lib/template/jfish/js/jquery.js +18 -0
- data/lib/template/jfish/js/search.js +94 -0
- data/lib/template/jfish/page.rhtml +18 -0
- data/lib/template/jfish/rdoc.css +557 -0
- data/lib/template/jfish/servlet_not_found.rhtml +18 -0
- data/lib/template/jfish/servlet_root.rhtml +37 -0
- data/lib/template/jfish/table_of_contents.rhtml +55 -0
- metadata +135 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
<meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type">
|
2
|
+
|
3
|
+
<title><%= h @title %></title>
|
4
|
+
|
5
|
+
<link type="text/css" media="screen" href="<%= asset_rel_prefix %>/rdoc.css" rel="stylesheet">
|
6
|
+
|
7
|
+
<script type="text/javascript">
|
8
|
+
var rdoc_rel_prefix = "<%= rel_prefix %>/";
|
9
|
+
</script>
|
10
|
+
|
11
|
+
<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/jquery.js"></script>
|
12
|
+
<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/navigation.js"></script>
|
13
|
+
<script type="text/javascript" charset="utf-8" src="<%= search_index_rel_prefix %>/js/search_index.js"></script>
|
14
|
+
<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/search.js"></script>
|
15
|
+
<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/searcher.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="<%= asset_rel_prefix %>/js/jfish.js"></script>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if !svninfo.empty? then %>
|
2
|
+
<nav id="file-svninfo-section" class="section">
|
3
|
+
<h3 class="section-header">VCS Info</h3>
|
4
|
+
<div class="section-body">
|
5
|
+
<dl class="svninfo">
|
6
|
+
<dt>Rev
|
7
|
+
<dd><%= svninfo[:rev] %>
|
8
|
+
|
9
|
+
<dt>Last Checked In
|
10
|
+
<dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
|
11
|
+
(<%= svninfo[:commitdelta] %> ago)
|
12
|
+
|
13
|
+
<dt>Checked in by
|
14
|
+
<dd><%= svninfo[:committer] %>
|
15
|
+
</dl>
|
16
|
+
</div>
|
17
|
+
</nav>
|
18
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<nav id="classindex-section" class="section project-section">
|
2
|
+
<h3 class="section-header">Class and Module Index</h3>
|
3
|
+
|
4
|
+
<ul class="link-list">
|
5
|
+
<% @modsort.each do |index_klass| %>
|
6
|
+
<li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a>
|
7
|
+
<% end %>
|
8
|
+
</ul>
|
9
|
+
</nav>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% unless klass.extends.empty? then %>
|
2
|
+
<!-- Extension Modules -->
|
3
|
+
<nav id="extends-section" class="section">
|
4
|
+
<h3 class="section-header">Extended With Modules</h3>
|
5
|
+
|
6
|
+
<ul class="link-list">
|
7
|
+
<% klass.each_extend do |ext| %>
|
8
|
+
<% unless String === ext.module then %>
|
9
|
+
<li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
|
10
|
+
<% else %>
|
11
|
+
<li><span class="extend"><%= ext.name %></span>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
</ul>
|
15
|
+
</nav>
|
16
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% unless klass.includes.empty? then %>
|
2
|
+
<!-- Included Modules -->
|
3
|
+
<nav id="includes-section" class="section">
|
4
|
+
<h3 class="section-header">Included Modules</h3>
|
5
|
+
|
6
|
+
<ul class="link-list">
|
7
|
+
<% klass.each_include do |inc| %>
|
8
|
+
<% unless String === inc.module then %>
|
9
|
+
<li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
|
10
|
+
<% else %>
|
11
|
+
<li><span class="include"><%= inc.name %></span>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
</ul>
|
15
|
+
</nav>
|
16
|
+
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<nav id="home-section" class="section">
|
2
|
+
<h3 class="section-header">Documentation</h3>
|
3
|
+
|
4
|
+
<ul>
|
5
|
+
<% installed.each do |name, href, exists| %>
|
6
|
+
<li class="folder">
|
7
|
+
<% if exists then %>
|
8
|
+
<a href="<%= href %>"><%= h name %></a>
|
9
|
+
<% else %>
|
10
|
+
<%= h name %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
14
|
+
</nav>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% unless klass.method_list.empty? then %>
|
2
|
+
<!-- Method Quickref -->
|
3
|
+
<nav id="method-list-section" class="section">
|
4
|
+
<h3 class="section-header">Methods</h3>
|
5
|
+
|
6
|
+
<ul class="link-list">
|
7
|
+
<% klass.each_method do |meth| %>
|
8
|
+
<li <% if meth.calls_super %>class="calls-super" <% end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name %></a>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</nav>
|
12
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div id="logo">
|
2
|
+
<a href="<%= rel_prefix %>/"><img alt="<%= h @title %>" src="<%= rel_prefix %>/images/logo.png"/></a>
|
3
|
+
</div>
|
4
|
+
<nav id="home-section" class="section">
|
5
|
+
<h3 class="section-header">
|
6
|
+
<a href="<%= rel_prefix %>/index.html">Home</a>
|
7
|
+
<a href="<%= rel_prefix %>/table_of_contents.html#classes">Classes</a>
|
8
|
+
<a href="<%= rel_prefix %>/table_of_contents.html#methods">Methods</a>
|
9
|
+
</h3>
|
10
|
+
</nav>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<% simple_files = @files.select { |f| f.text? } %>
|
2
|
+
<% unless simple_files.empty? then %>
|
3
|
+
<nav id="fileindex-section" class="section project-section">
|
4
|
+
<h3 class="section-header">Pages</h3>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% simple_files.each do |f| %>
|
8
|
+
<li class="file"><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</nav>
|
12
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% if klass.type == 'class' then %>
|
2
|
+
<nav id="parent-class-section" class="section">
|
3
|
+
<h3 class="section-header">Parent</h3>
|
4
|
+
<% if klass.superclass and not String === klass.superclass then %>
|
5
|
+
<p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a>
|
6
|
+
<% else %>
|
7
|
+
<p class="link"><%= klass.superclass %>
|
8
|
+
<% end %>
|
9
|
+
</nav>
|
10
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
2
|
+
<form action="#" method="get" accept-charset="utf-8">
|
3
|
+
<h3 class="section-header">
|
4
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
5
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
6
|
+
</h3>
|
7
|
+
</form>
|
8
|
+
|
9
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
10
|
+
</nav>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% unless klass.sections.length == 1 then %>
|
2
|
+
<nav id="sections-section" class="section">
|
3
|
+
<h3 class="section-header">Sections</h3>
|
4
|
+
<ul class="link-list">
|
5
|
+
<% klass.sort_sections.each do |section| %>
|
6
|
+
<li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
|
7
|
+
<% end %>
|
8
|
+
</ul>
|
9
|
+
</nav>
|
10
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% comment = if current.respond_to? :comment_location then
|
2
|
+
current.comment_location
|
3
|
+
else
|
4
|
+
current.comment
|
5
|
+
end
|
6
|
+
table = current.parse(comment).table_of_contents
|
7
|
+
|
8
|
+
if table.length > 1 then %>
|
9
|
+
<div id="table-of-contents">
|
10
|
+
<nav class="section">
|
11
|
+
<h3 class="section-header">Table of Contents</h3>
|
12
|
+
<ul>
|
13
|
+
<% table.each do |heading| %>
|
14
|
+
<li><a href="#<%= heading.aref %>"><%= heading.plain_html %></a>
|
15
|
+
<% end %>
|
16
|
+
</ul>
|
17
|
+
</nav>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
@@ -0,0 +1,179 @@
|
|
1
|
+
<body id="top" class="<%= klass.type %>">
|
2
|
+
<nav id="metadata">
|
3
|
+
<%= render '_sidebar_navigation.rhtml' %>
|
4
|
+
|
5
|
+
<%= render '_sidebar_search.rhtml' %>
|
6
|
+
|
7
|
+
<%= render '_sidebar_table_of_contents.rhtml' %>
|
8
|
+
|
9
|
+
<div id="file-metadata">
|
10
|
+
<%= render '_sidebar_in_files.rhtml' %>
|
11
|
+
<%= render '_sidebar_VCS_info.rhtml' %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div id="class-metadata">
|
15
|
+
<%= render '_sidebar_sections.rhtml' %>
|
16
|
+
<%= render '_sidebar_parent.rhtml' %>
|
17
|
+
<%= render '_sidebar_includes.rhtml' %>
|
18
|
+
<%= render '_sidebar_extends.rhtml' %>
|
19
|
+
<%= render '_sidebar_methods.rhtml' %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div id="project-metadata">
|
23
|
+
<%= render '_sidebar_pages.rhtml' %>
|
24
|
+
<%= render '_sidebar_classes.rhtml' %>
|
25
|
+
</div>
|
26
|
+
</nav>
|
27
|
+
|
28
|
+
<div id="documentation">
|
29
|
+
<h1 class="<%= klass.type %>"><%= klass.type %> <%= klass.full_name %></h1>
|
30
|
+
|
31
|
+
<div id="description" class="description">
|
32
|
+
<%= klass.description %>
|
33
|
+
</div><!-- description -->
|
34
|
+
|
35
|
+
<% klass.each_section do |section, constants, attributes| %>
|
36
|
+
<% constants = constants.select { |const| const.display? } %>
|
37
|
+
<% attributes = attributes.select { |attr| attr.display? } %>
|
38
|
+
<section id="<%= section.aref %>" class="documentation-section">
|
39
|
+
<% if section.title then %>
|
40
|
+
<div class="documentation-section-title">
|
41
|
+
<h2 class="section-header">
|
42
|
+
<%= section.title %>
|
43
|
+
</h2>
|
44
|
+
<span class="section-click-top">
|
45
|
+
<a href="#top">↑ top</a>
|
46
|
+
</span>
|
47
|
+
</div>
|
48
|
+
<% end %>
|
49
|
+
|
50
|
+
<% if section.comment then %>
|
51
|
+
<div class="description">
|
52
|
+
<%= section.description %>
|
53
|
+
</div>
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<% unless constants.empty? then %>
|
57
|
+
<!-- Constants -->
|
58
|
+
<section id="constants-list" class="section">
|
59
|
+
<h3 class="section-header">Constants</h3>
|
60
|
+
<dl>
|
61
|
+
<% constants.each do |const| %>
|
62
|
+
<dt id="<%= const.name %>"><%= const.name %>
|
63
|
+
<% if const.comment then %>
|
64
|
+
<dd class="description"><%= const.description.strip %>
|
65
|
+
<% else %>
|
66
|
+
<dd class="description missing-docs">(Not documented)
|
67
|
+
<% end %>
|
68
|
+
<% end %>
|
69
|
+
</dl>
|
70
|
+
</section>
|
71
|
+
<% end %>
|
72
|
+
|
73
|
+
<% unless attributes.empty? then %>
|
74
|
+
<!-- Attributes -->
|
75
|
+
<section id="attribute-method-details" class="method-section section">
|
76
|
+
<h3 class="section-header">Attributes</h3>
|
77
|
+
|
78
|
+
<% attributes.each do |attrib| %>
|
79
|
+
<div id="<%= attrib.aref %>" class="method-detail">
|
80
|
+
<div class="method-heading attribute-method-heading">
|
81
|
+
<span class="method-name"><%= h attrib.name %></span><span
|
82
|
+
class="attribute-access-type">[<%= attrib.rw %>]</span>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div class="method-description">
|
86
|
+
<% if attrib.comment then %>
|
87
|
+
<%= attrib.description.strip %>
|
88
|
+
<% else %>
|
89
|
+
<p class="missing-docs">(Not documented)
|
90
|
+
<% end %>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
<% end %>
|
94
|
+
</section><!-- attribute-method-details -->
|
95
|
+
<% end %>
|
96
|
+
|
97
|
+
<!-- Methods -->
|
98
|
+
<% klass.methods_by_type(section).each do |type, visibilities|
|
99
|
+
next if visibilities.empty?
|
100
|
+
visibilities.each do |visibility, methods|
|
101
|
+
next if methods.empty? %>
|
102
|
+
<section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section section">
|
103
|
+
<h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
|
104
|
+
|
105
|
+
<% methods.each do |method| %>
|
106
|
+
<div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
|
107
|
+
<% if method.call_seq then %>
|
108
|
+
<% method.call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
|
109
|
+
<div class="method-heading">
|
110
|
+
<span class="method-callseq">
|
111
|
+
<%= h(call_seq.strip.
|
112
|
+
gsub( /^\w+\./m, '')).
|
113
|
+
gsub(/(.*)[-=]>/, '\1→') %>
|
114
|
+
</span>
|
115
|
+
<% if i == 0 and method.token_stream then %>
|
116
|
+
<span class="method-click-advice">click to toggle source</span>
|
117
|
+
<% end %>
|
118
|
+
</div>
|
119
|
+
<% end %>
|
120
|
+
<% else %>
|
121
|
+
<div class="method-heading">
|
122
|
+
<span class="method-name"><%= h method.name %></span><span
|
123
|
+
class="method-args"><%= method.param_seq %></span>
|
124
|
+
<% if method.token_stream then %>
|
125
|
+
<span class="method-click-advice">click to toggle source</span>
|
126
|
+
<% end %>
|
127
|
+
</div>
|
128
|
+
<% end %>
|
129
|
+
|
130
|
+
<div class="method-description">
|
131
|
+
<% if method.comment then %>
|
132
|
+
<%= method.description.strip %>
|
133
|
+
<% else %>
|
134
|
+
<p class="missing-docs">(Not documented)
|
135
|
+
<% end %>
|
136
|
+
<% if method.calls_super then %>
|
137
|
+
<div class="method-calls-super">
|
138
|
+
Calls superclass method
|
139
|
+
<%=
|
140
|
+
method.superclass_method ?
|
141
|
+
method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
|
142
|
+
%>
|
143
|
+
</div>
|
144
|
+
<% end %>
|
145
|
+
|
146
|
+
<% if method.token_stream then %>
|
147
|
+
<div class="method-source-code" id="<%= method.html_name %>-source">
|
148
|
+
<pre><%= method.markup_code %></pre>
|
149
|
+
</div><!-- <%= method.html_name %>-source -->
|
150
|
+
<% end %>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<% unless method.aliases.empty? then %>
|
154
|
+
<div class="aliases">
|
155
|
+
Also aliased as: <%= method.aliases.map do |aka|
|
156
|
+
if aka.parent then # HACK lib/rexml/encodings
|
157
|
+
%{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
|
158
|
+
else
|
159
|
+
h aka.name
|
160
|
+
end
|
161
|
+
end.join ", " %>
|
162
|
+
</div>
|
163
|
+
<% end %>
|
164
|
+
|
165
|
+
<% if method.is_alias_for then %>
|
166
|
+
<div class="aliases">
|
167
|
+
Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
|
168
|
+
</div>
|
169
|
+
<% end %>
|
170
|
+
</div><!-- <%= method.html_name %>-method -->
|
171
|
+
|
172
|
+
<% end %>
|
173
|
+
</section><!-- <%= visibility %>-<%= type %>-method-details -->
|
174
|
+
<% end
|
175
|
+
end %>
|
176
|
+
</section><!-- <%= section.aref %> -->
|
177
|
+
<% end %>
|
178
|
+
|
179
|
+
</div><!-- documentation -->
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<body>
|
2
|
+
<nav id="metadata">
|
3
|
+
<%= render '_sidebar_navigation.rhtml' %>
|
4
|
+
|
5
|
+
<%= render '_sidebar_search.rhtml' %>
|
6
|
+
|
7
|
+
<div id="project-metadata">
|
8
|
+
<%= render '_sidebar_pages.rhtml' %>
|
9
|
+
<%= render '_sidebar_classes.rhtml' %>
|
10
|
+
</div>
|
11
|
+
</nav>
|
12
|
+
|
13
|
+
<div id="documentation" class="description">
|
14
|
+
<% if @options.main_page && main_page = @files.find { |f| f.full_name == @options.main_page } then %>
|
15
|
+
<%= main_page.description %>
|
16
|
+
<% else %>
|
17
|
+
<p>This is the API documentation for <%= @title %>.
|
18
|
+
<% end %>
|
19
|
+
</div>
|
@@ -0,0 +1,155 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* JFish Page Functions
|
4
|
+
* $Id: jfish.js 53 2009-01-07 02:52:03Z deveiant $
|
5
|
+
*
|
6
|
+
* Author: Michael Granger <mgranger@laika.com>
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
/* Provide console simulation for firebug-less environments */
|
11
|
+
if (!("console" in window) || !("firebug" in console)) {
|
12
|
+
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
|
13
|
+
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
|
14
|
+
|
15
|
+
window.console = {};
|
16
|
+
for (var i = 0; i < names.length; ++i)
|
17
|
+
window.console[names[i]] = function() {};
|
18
|
+
};
|
19
|
+
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Unwrap the first element that matches the given @expr@ from the targets and return them.
|
23
|
+
*/
|
24
|
+
$.fn.unwrap = function( expr ) {
|
25
|
+
return this.each( function() {
|
26
|
+
$(this).parents( expr ).eq( 0 ).after( this ).remove();
|
27
|
+
});
|
28
|
+
};
|
29
|
+
|
30
|
+
|
31
|
+
function showSource( e ) {
|
32
|
+
var target = e.target;
|
33
|
+
var codeSections = $(target).
|
34
|
+
parents('.method-detail').
|
35
|
+
find('.method-source-code');
|
36
|
+
|
37
|
+
$(target).
|
38
|
+
parents('.method-detail').
|
39
|
+
find('.method-source-code').
|
40
|
+
slideToggle();
|
41
|
+
};
|
42
|
+
|
43
|
+
function hookSourceViews() {
|
44
|
+
$('.method-heading').click( showSource );
|
45
|
+
};
|
46
|
+
|
47
|
+
function toggleDebuggingSection() {
|
48
|
+
$('.debugging-section').slideToggle();
|
49
|
+
};
|
50
|
+
|
51
|
+
function hookDebuggingToggle() {
|
52
|
+
$('#debugging-toggle img').click( toggleDebuggingSection );
|
53
|
+
};
|
54
|
+
|
55
|
+
function hookTableOfContentsToggle() {
|
56
|
+
$('.indexpage li .toc-toggle').each( function() {
|
57
|
+
$(this).click( function() {
|
58
|
+
$(this).toggleClass('open');
|
59
|
+
});
|
60
|
+
|
61
|
+
var section = $(this).next();
|
62
|
+
|
63
|
+
$(this).click( function() {
|
64
|
+
section.slideToggle();
|
65
|
+
});
|
66
|
+
});
|
67
|
+
}
|
68
|
+
|
69
|
+
function hookSearch() {
|
70
|
+
var input = $('#search-field').eq(0);
|
71
|
+
var result = $('#search-results').eq(0);
|
72
|
+
$(result).show();
|
73
|
+
|
74
|
+
var search_section = $('#search-section').get(0);
|
75
|
+
$(search_section).show();
|
76
|
+
|
77
|
+
var search = new Search(search_data, input, result);
|
78
|
+
|
79
|
+
search.renderItem = function(result) {
|
80
|
+
var li = document.createElement('li');
|
81
|
+
var html = '';
|
82
|
+
|
83
|
+
// TODO add relative path to <script> per-page
|
84
|
+
html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
|
85
|
+
if (result.params)
|
86
|
+
html += '<span class="params">' + result.params + '</span>';
|
87
|
+
html += '</a>';
|
88
|
+
|
89
|
+
|
90
|
+
if (result.namespace)
|
91
|
+
html += '<p class="search-namespace">' + this.hlt(result.namespace);
|
92
|
+
|
93
|
+
if (result.snippet)
|
94
|
+
html += '<div class="search-snippet">' + result.snippet + '</div>';
|
95
|
+
|
96
|
+
li.innerHTML = html;
|
97
|
+
|
98
|
+
return li;
|
99
|
+
}
|
100
|
+
|
101
|
+
search.select = function(result) {
|
102
|
+
var result_element = result.get(0);
|
103
|
+
window.location.href = result_element.firstChild.firstChild.href;
|
104
|
+
}
|
105
|
+
|
106
|
+
search.scrollIntoView = search.scrollInWindow;
|
107
|
+
};
|
108
|
+
|
109
|
+
function highlightTarget( anchor ) {
|
110
|
+
console.debug( "Highlighting target '%s'.", anchor );
|
111
|
+
|
112
|
+
$("a[name]").each( function() {
|
113
|
+
if ( $(this).attr("name") == anchor ) {
|
114
|
+
if ( !$(this).parent().parent().hasClass('target-section') ) {
|
115
|
+
console.debug( "Wrapping the target-section" );
|
116
|
+
$('div.method-detail').unwrap( 'div.target-section' );
|
117
|
+
$(this).parent().wrap( '<div class="target-section"></div>' );
|
118
|
+
} else {
|
119
|
+
console.debug( "Already wrapped." );
|
120
|
+
}
|
121
|
+
}
|
122
|
+
});
|
123
|
+
};
|
124
|
+
|
125
|
+
function highlightLocationTarget() {
|
126
|
+
console.debug( "Location hash: %s", window.location.hash );
|
127
|
+
if ( ! window.location.hash || window.location.hash.length == 0 ) return;
|
128
|
+
|
129
|
+
var anchor = window.location.hash.substring(1);
|
130
|
+
console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
|
131
|
+
|
132
|
+
highlightTarget( anchor );
|
133
|
+
};
|
134
|
+
|
135
|
+
function highlightClickTarget( event ) {
|
136
|
+
console.debug( "Highlighting click target for event %o", event.target );
|
137
|
+
try {
|
138
|
+
var anchor = $(event.target).attr( 'href' ).substring(1);
|
139
|
+
console.debug( "Found target anchor: %s", anchor );
|
140
|
+
highlightTarget( anchor );
|
141
|
+
} catch ( err ) {
|
142
|
+
console.error( "Exception while highlighting: %o", err );
|
143
|
+
};
|
144
|
+
};
|
145
|
+
|
146
|
+
|
147
|
+
$(document).ready( function() {
|
148
|
+
hookSourceViews();
|
149
|
+
hookDebuggingToggle();
|
150
|
+
hookSearch();
|
151
|
+
highlightLocationTarget();
|
152
|
+
hookTableOfContentsToggle();
|
153
|
+
|
154
|
+
$('ul.link-list a').bind( "click", highlightClickTarget );
|
155
|
+
});
|