physh_roller 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +7 -0
- data/README +1 -0
- data/bin/dice +42 -0
- data/doc/Object.html +204 -0
- data/doc/Output.html +226 -0
- data/doc/PhyshRoller.html +140 -0
- data/doc/PhyshRoller/DiceRoll.html +498 -0
- data/doc/PhyshRoller/Die.html +266 -0
- data/doc/created.rid +14 -0
- data/doc/doc/created_rid.html +97 -0
- data/doc/features/physh_roller/parse_dice_roll_string_feature.html +117 -0
- data/doc/features/physh_roller/roll_dice_feature.html +119 -0
- data/doc/features/physh_roller/roll_die_feature.html +117 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.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 +94 -0
- data/doc/js/darkfish.js +155 -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 +595 -0
- data/doc/table_of_contents.html +98 -0
- data/features/physh_roller/parse_dice_roll_string.feature +19 -0
- data/features/physh_roller/roll_dice.feature +22 -0
- data/features/physh_roller/roll_die.feature +19 -0
- data/features/step_definitions/physh_roller/physh_roller_steps.rb +79 -0
- data/features/support/env.rb +3 -0
- data/lib/physh_roller.rb +2 -0
- data/lib/physh_roller/dice_roll.rb +62 -0
- data/lib/physh_roller/die.rb +14 -0
- data/spec/physh_roller/dice_roll_spec.rb +145 -0
- data/spec/physh_roller/die_spec.rb +44 -0
- data/spec/spec_helper.rb +3 -0
- metadata +133 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>roll_dice.feature - 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 class="file">
|
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
|
+
|
47
|
+
|
48
|
+
<div id="project-metadata">
|
49
|
+
<nav id="fileindex-section" class="section project-section">
|
50
|
+
<h3 class="section-header">Pages</h3>
|
51
|
+
|
52
|
+
<ul>
|
53
|
+
|
54
|
+
<li class="file"><a href="../../doc/created_rid.html">created.rid</a>
|
55
|
+
|
56
|
+
<li class="file"><a href="../../features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
|
57
|
+
|
58
|
+
<li class="file"><a href="../../features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
|
59
|
+
|
60
|
+
<li class="file"><a href="../../features/physh_roller/roll_die_feature.html">roll_die.feature</a>
|
61
|
+
|
62
|
+
</ul>
|
63
|
+
</nav>
|
64
|
+
|
65
|
+
<nav id="classindex-section" class="section project-section">
|
66
|
+
<h3 class="section-header">Class and Module Index</h3>
|
67
|
+
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
<li><a href="../../Object.html">Object</a>
|
71
|
+
|
72
|
+
<li><a href="../../Output.html">Output</a>
|
73
|
+
|
74
|
+
<li><a href="../../PhyshRoller.html">PhyshRoller</a>
|
75
|
+
|
76
|
+
<li><a href="../../PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
|
77
|
+
|
78
|
+
<li><a href="../../PhyshRoller/Die.html">PhyshRoller::Die</a>
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
</nav>
|
85
|
+
|
86
|
+
<div id="documentation" class="description">
|
87
|
+
|
88
|
+
<p>Feature: Roll dice</p>
|
89
|
+
|
90
|
+
<pre>As a user
|
91
|
+
I want to roll a set of dice
|
92
|
+
To get a set of rolls and a total
|
93
|
+
|
94
|
+
Scenario Outline: getting the result of rolling some dice
|
95
|
+
Given I have a dice roll string described by "<dice_roll_string>"
|
96
|
+
When I roll the set of dice
|
97
|
+
Then the result should have "<number_of_dice>"
|
98
|
+
And each die roll should be equal to or greater than "<lower_limit>"
|
99
|
+
And each die roll should be equal to or less than "<upper_limit>"
|
100
|
+
And the total should be equal to or greater than "<lowest_total>"
|
101
|
+
And the total should be equal to or less than "<upper_total>"
|
102
|
+
|
103
|
+
Scenarios: different dice strings
|
104
|
+
| dice_roll_string | lower_limit | upper_limit | lowest_total | upper_total | number_of_dice |
|
105
|
+
| 1d6 | 1 | 6 | 1 | 6 | 1 |
|
106
|
+
| 3d4 | 1 | 4 | 3 | 12 | 3 |
|
107
|
+
| 1d6+1 | 1 | 6 | 2 | 7 | 1 |
|
108
|
+
| 3d4-2 | 1 | 4 | 1 | 10 | 3 |</pre>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
<footer id="validator-badges">
|
115
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
116
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
117
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
118
|
+
</footer>
|
119
|
+
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>roll_die.feature - 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 class="file">
|
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
|
+
|
47
|
+
|
48
|
+
<div id="project-metadata">
|
49
|
+
<nav id="fileindex-section" class="section project-section">
|
50
|
+
<h3 class="section-header">Pages</h3>
|
51
|
+
|
52
|
+
<ul>
|
53
|
+
|
54
|
+
<li class="file"><a href="../../doc/created_rid.html">created.rid</a>
|
55
|
+
|
56
|
+
<li class="file"><a href="../../features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
|
57
|
+
|
58
|
+
<li class="file"><a href="../../features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
|
59
|
+
|
60
|
+
<li class="file"><a href="../../features/physh_roller/roll_die_feature.html">roll_die.feature</a>
|
61
|
+
|
62
|
+
</ul>
|
63
|
+
</nav>
|
64
|
+
|
65
|
+
<nav id="classindex-section" class="section project-section">
|
66
|
+
<h3 class="section-header">Class and Module Index</h3>
|
67
|
+
|
68
|
+
<ul class="link-list">
|
69
|
+
|
70
|
+
<li><a href="../../Object.html">Object</a>
|
71
|
+
|
72
|
+
<li><a href="../../Output.html">Output</a>
|
73
|
+
|
74
|
+
<li><a href="../../PhyshRoller.html">PhyshRoller</a>
|
75
|
+
|
76
|
+
<li><a href="../../PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
|
77
|
+
|
78
|
+
<li><a href="../../PhyshRoller/Die.html">PhyshRoller::Die</a>
|
79
|
+
|
80
|
+
</ul>
|
81
|
+
</nav>
|
82
|
+
|
83
|
+
</div>
|
84
|
+
</nav>
|
85
|
+
|
86
|
+
<div id="documentation" class="description">
|
87
|
+
|
88
|
+
<p>Feature: Simple Die Roll</p>
|
89
|
+
|
90
|
+
<pre>As a user
|
91
|
+
I want to roll a die
|
92
|
+
To generate a random number between 1 and the number of sides on the die
|
93
|
+
|
94
|
+
Scenario Outline: Roll a die
|
95
|
+
Given I want to roll a die with "<sides_on_die>" sides
|
96
|
+
When I roll the die
|
97
|
+
Then the result should be between "1" and "<sides_on_die>"
|
98
|
+
|
99
|
+
Scenarios: different sides on die
|
100
|
+
| sides_on_die |
|
101
|
+
| 2 |
|
102
|
+
| 6 |
|
103
|
+
| 12 |
|
104
|
+
| 100 |
|
105
|
+
| 1000 |
|
106
|
+
| 3 |</pre>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<footer id="validator-badges">
|
113
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
114
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
115
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
116
|
+
</footer>
|
117
|
+
|
data/doc/images/add.png
ADDED
Binary file
|
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,94 @@
|
|
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="./doc/created_rid.html">created.rid</a>
|
53
|
+
|
54
|
+
<li class="file"><a href="./features/physh_roller/parse_dice_roll_string_feature.html">parse_dice_roll_string.feature</a>
|
55
|
+
|
56
|
+
<li class="file"><a href="./features/physh_roller/roll_dice_feature.html">roll_dice.feature</a>
|
57
|
+
|
58
|
+
<li class="file"><a href="./features/physh_roller/roll_die_feature.html">roll_die.feature</a>
|
59
|
+
|
60
|
+
</ul>
|
61
|
+
</nav>
|
62
|
+
|
63
|
+
<nav id="classindex-section" class="section project-section">
|
64
|
+
<h3 class="section-header">Class and Module Index</h3>
|
65
|
+
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
<li><a href="./Object.html">Object</a>
|
69
|
+
|
70
|
+
<li><a href="./Output.html">Output</a>
|
71
|
+
|
72
|
+
<li><a href="./PhyshRoller.html">PhyshRoller</a>
|
73
|
+
|
74
|
+
<li><a href="./PhyshRoller/DiceRoll.html">PhyshRoller::DiceRoll</a>
|
75
|
+
|
76
|
+
<li><a href="./PhyshRoller/Die.html">PhyshRoller::Die</a>
|
77
|
+
|
78
|
+
</ul>
|
79
|
+
</nav>
|
80
|
+
|
81
|
+
</div>
|
82
|
+
</nav>
|
83
|
+
|
84
|
+
<div id="documentation" class="description">
|
85
|
+
<p>This is the API documentation for RDoc Documentation.
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
<footer id="validator-badges">
|
90
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
91
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
92
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
93
|
+
</footer>
|
94
|
+
|
data/doc/js/darkfish.js
ADDED
@@ -0,0 +1,155 @@
|
|
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]").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
|
+
});
|