pwqgen.rb 0.0.1 → 0.0.2.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -0
- data/ChangeLog +5 -0
- data/Gemfile +1 -2
- data/README.md +35 -0
- data/Rakefile +9 -0
- data/bin/pwqgen.rb +4 -3
- data/doc/ChangeLog.html +89 -0
- data/doc/Gemfile.html +89 -0
- data/doc/Pwqgen.html +217 -0
- data/doc/Pwqgen/Generator.html +225 -0
- data/doc/created.rid +8 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +82 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +68 -0
- data/lib/pwqgen.rb +0 -2
- data/lib/pwqgen/pwqgen.rb +31 -17
- data/lib/pwqgen/version.rb +1 -1
- data/lib/pwqgen/wordlist.rb +1 -1
- data/pwqgen.rb.gemspec +9 -4
- data/spec/lib/pwqgen_spec.rb +27 -0
- data/spec/spec_helper.rb +1 -0
- metadata +83 -6
@@ -0,0 +1,225 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class Pwqgen::Generator - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "../";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="../index.html">Home</a>
|
28
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>lib/pwqgen/pwqgen.rb
|
51
|
+
<li>lib/pwqgen/wordlist.rb
|
52
|
+
</ul>
|
53
|
+
</nav>
|
54
|
+
|
55
|
+
|
56
|
+
</div>
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
<nav id="parent-class-section" class="section">
|
61
|
+
<h3 class="section-header">Parent</h3>
|
62
|
+
|
63
|
+
<p class="link">Object
|
64
|
+
|
65
|
+
</nav>
|
66
|
+
|
67
|
+
|
68
|
+
<!-- Method Quickref -->
|
69
|
+
<nav id="method-list-section" class="section">
|
70
|
+
<h3 class="section-header">Methods</h3>
|
71
|
+
|
72
|
+
<ul class="link-list">
|
73
|
+
|
74
|
+
<li><a href="#method-c-new">::new</a>
|
75
|
+
|
76
|
+
<li><a href="#method-i-generate">#generate</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
<div id="project-metadata">
|
84
|
+
<nav id="fileindex-section" class="section project-section">
|
85
|
+
<h3 class="section-header">Pages</h3>
|
86
|
+
|
87
|
+
<ul>
|
88
|
+
|
89
|
+
<li class="file"><a href="../ChangeLog.html">ChangeLog</a>
|
90
|
+
|
91
|
+
<li class="file"><a href="../Gemfile.html">Gemfile</a>
|
92
|
+
|
93
|
+
</ul>
|
94
|
+
</nav>
|
95
|
+
|
96
|
+
<nav id="classindex-section" class="section project-section">
|
97
|
+
<h3 class="section-header">Class and Module Index</h3>
|
98
|
+
|
99
|
+
<ul class="link-list">
|
100
|
+
|
101
|
+
<li><a href="../Pwqgen.html">Pwqgen</a>
|
102
|
+
|
103
|
+
<li><a href="../Pwqgen/Generator.html">Pwqgen::Generator</a>
|
104
|
+
|
105
|
+
</ul>
|
106
|
+
</nav>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</nav>
|
110
|
+
|
111
|
+
<div id="documentation">
|
112
|
+
<h1 class="class">class Pwqgen::Generator</h1>
|
113
|
+
|
114
|
+
<div id="description" class="description">
|
115
|
+
|
116
|
+
</div><!-- description -->
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<!-- Methods -->
|
131
|
+
|
132
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
133
|
+
<h3 class="section-header">Public Class Methods</h3>
|
134
|
+
|
135
|
+
|
136
|
+
<div id="method-c-new" class="method-detail ">
|
137
|
+
|
138
|
+
<div class="method-heading">
|
139
|
+
<span class="method-name">new</span><span
|
140
|
+
class="method-args">()</span>
|
141
|
+
<span class="method-click-advice">click to toggle source</span>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
<div class="method-source-code" id="new-source">
|
152
|
+
<pre><span class="ruby-comment"># File lib/pwqgen/pwqgen.rb, line 17</span>
|
153
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
|
154
|
+
<span class="ruby-identifier">@@wordlist_size</span> = <span class="ruby-identifier">@@wordlist</span>.<span class="ruby-identifier">length</span>
|
155
|
+
<span class="ruby-identifier">@@separators</span> = <span class="ruby-string">"-_!$&*+=23456789"</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r/</span>)
|
156
|
+
<span class="ruby-identifier">@@separators_size</span> = <span class="ruby-identifier">@@separators</span>.<span class="ruby-identifier">length</span>
|
157
|
+
<span class="ruby-ivar">@length</span> = <span class="ruby-value">3</span>
|
158
|
+
<span class="ruby-ivar">@rand</span> = <span class="ruby-constant">Random</span>.<span class="ruby-identifier">new</span>
|
159
|
+
<span class="ruby-keyword">end</span></pre>
|
160
|
+
</div><!-- new-source -->
|
161
|
+
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</div><!-- new-method -->
|
168
|
+
|
169
|
+
|
170
|
+
</section><!-- public-class-method-details -->
|
171
|
+
|
172
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
173
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
174
|
+
|
175
|
+
|
176
|
+
<div id="method-i-generate" class="method-detail ">
|
177
|
+
|
178
|
+
<div class="method-heading">
|
179
|
+
<span class="method-name">generate</span><span
|
180
|
+
class="method-args">(length = @length)</span>
|
181
|
+
<span class="method-click-advice">click to toggle source</span>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
|
185
|
+
<div class="method-description">
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
<div class="method-source-code" id="generate-source">
|
192
|
+
<pre><span class="ruby-comment"># File lib/pwqgen/pwqgen.rb, line 25</span>
|
193
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">generate</span>(<span class="ruby-identifier">length</span> = <span class="ruby-ivar">@length</span>)
|
194
|
+
<span class="ruby-identifier">output</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
|
195
|
+
<span class="ruby-keyword">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword">in</span> <span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">length</span>
|
196
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">@@wordlist</span>[<span class="ruby-ivar">@rand</span>.<span class="ruby-identifier">rand</span>(<span class="ruby-identifier">@@wordlist_size</span>)]
|
197
|
+
<span class="ruby-identifier">output</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>] = <span class="ruby-identifier">output</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>].<span class="ruby-identifier">capitalize</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@rand</span>.<span class="ruby-identifier">rand</span>(<span class="ruby-value">2</span>)
|
198
|
+
|
199
|
+
<span class="ruby-identifier">output</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">@@separators</span>[<span class="ruby-ivar">@rand</span>.<span class="ruby-identifier">rand</span>(<span class="ruby-identifier">@@separators_size</span>)] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">length</span>
|
200
|
+
<span class="ruby-keyword">end</span>
|
201
|
+
<span class="ruby-identifier">output</span>.<span class="ruby-identifier">join</span>
|
202
|
+
<span class="ruby-keyword">end</span></pre>
|
203
|
+
</div><!-- generate-source -->
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
</div><!-- generate-method -->
|
211
|
+
|
212
|
+
|
213
|
+
</section><!-- public-instance-method-details -->
|
214
|
+
|
215
|
+
</section><!-- 5Buntitled-5D -->
|
216
|
+
|
217
|
+
</div><!-- documentation -->
|
218
|
+
|
219
|
+
|
220
|
+
<footer id="validator-badges">
|
221
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
222
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
223
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
224
|
+
</footer>
|
225
|
+
|
data/doc/created.rid
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
Thu, 28 Jun 2012 23:04:43 +0800
|
2
|
+
./bin/pwqgen.rb Thu, 28 Jun 2012 22:39:33 +0800
|
3
|
+
./lib/pwqgen.rb Thu, 28 Jun 2012 21:25:16 +0800
|
4
|
+
./lib/pwqgen/pwqgen.rb Thu, 28 Jun 2012 23:03:41 +0800
|
5
|
+
./lib/pwqgen/wordlist.rb Thu, 28 Jun 2012 23:04:40 +0800
|
6
|
+
./lib/pwqgen/version.rb Thu, 28 Jun 2012 22:42:06 +0800
|
7
|
+
./Gemfile Thu, 28 Jun 2012 22:19:30 +0800
|
8
|
+
./ChangeLog Thu, 28 Jun 2012 22:44:41 +0800
|
data/doc/images/add.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/doc/images/bug.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/date.png
ADDED
Binary file
|
Binary file
|
data/doc/images/find.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/ruby.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/doc/images/zoom.png
ADDED
Binary file
|
data/doc/index.html
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="project-metadata">
|
47
|
+
<nav id="fileindex-section" class="section project-section">
|
48
|
+
<h3 class="section-header">Pages</h3>
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li class="file"><a href="./ChangeLog.html">ChangeLog</a>
|
53
|
+
|
54
|
+
<li class="file"><a href="./Gemfile.html">Gemfile</a>
|
55
|
+
|
56
|
+
</ul>
|
57
|
+
</nav>
|
58
|
+
|
59
|
+
<nav id="classindex-section" class="section project-section">
|
60
|
+
<h3 class="section-header">Class and Module Index</h3>
|
61
|
+
|
62
|
+
<ul class="link-list">
|
63
|
+
|
64
|
+
<li><a href="./Pwqgen.html">Pwqgen</a>
|
65
|
+
|
66
|
+
<li><a href="./Pwqgen/Generator.html">Pwqgen::Generator</a>
|
67
|
+
|
68
|
+
</ul>
|
69
|
+
</nav>
|
70
|
+
|
71
|
+
</div>
|
72
|
+
</nav>
|
73
|
+
|
74
|
+
<p>This is the API documentation for RDoc Documentation.
|
75
|
+
|
76
|
+
|
77
|
+
<footer id="validator-badges">
|
78
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
79
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
80
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
81
|
+
</footer>
|
82
|
+
|
data/doc/js/darkfish.js
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* Darkfish Page Functions
|
4
|
+
* $Id: darkfish.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=" + anchor + "]").each( function() {
|
113
|
+
if ( !$(this).parent().parent().hasClass('target-section') ) {
|
114
|
+
console.debug( "Wrapping the target-section" );
|
115
|
+
$('div.method-detail').unwrap( 'div.target-section' );
|
116
|
+
$(this).parent().wrap( '<div class="target-section"></div>' );
|
117
|
+
} else {
|
118
|
+
console.debug( "Already wrapped." );
|
119
|
+
}
|
120
|
+
});
|
121
|
+
};
|
122
|
+
|
123
|
+
function highlightLocationTarget() {
|
124
|
+
console.debug( "Location hash: %s", window.location.hash );
|
125
|
+
if ( ! window.location.hash || window.location.hash.length == 0 ) return;
|
126
|
+
|
127
|
+
var anchor = window.location.hash.substring(1);
|
128
|
+
console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
|
129
|
+
|
130
|
+
highlightTarget( anchor );
|
131
|
+
};
|
132
|
+
|
133
|
+
function highlightClickTarget( event ) {
|
134
|
+
console.debug( "Highlighting click target for event %o", event.target );
|
135
|
+
try {
|
136
|
+
var anchor = $(event.target).attr( 'href' ).substring(1);
|
137
|
+
console.debug( "Found target anchor: %s", anchor );
|
138
|
+
highlightTarget( anchor );
|
139
|
+
} catch ( err ) {
|
140
|
+
console.error( "Exception while highlighting: %o", err );
|
141
|
+
};
|
142
|
+
};
|
143
|
+
|
144
|
+
|
145
|
+
$(document).ready( function() {
|
146
|
+
hookSourceViews();
|
147
|
+
hookDebuggingToggle();
|
148
|
+
hookSearch();
|
149
|
+
highlightLocationTarget();
|
150
|
+
hookTableOfContentsToggle();
|
151
|
+
|
152
|
+
$('ul.link-list a').bind( "click", highlightClickTarget );
|
153
|
+
});
|