yard 0.9.36 → 0.9.38
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 +4 -4
- data/CHANGELOG.md +32 -0
- data/README.md +17 -10
- data/docs/Templates.md +5 -4
- data/lib/yard/autoload.rb +1 -0
- data/lib/yard/code_objects/base.rb +1 -1
- data/lib/yard/code_objects/extra_file_object.rb +1 -0
- data/lib/yard/code_objects/macro_object.rb +0 -1
- data/lib/yard/docstring_parser.rb +0 -1
- data/lib/yard/handlers/base.rb +23 -1
- data/lib/yard/handlers/processor.rb +0 -1
- data/lib/yard/handlers/ruby/constant_handler.rb +23 -6
- data/lib/yard/handlers/ruby/legacy/visibility_handler.rb +2 -1
- data/lib/yard/handlers/ruby/visibility_handler.rb +14 -1
- data/lib/yard/logging.rb +116 -61
- data/lib/yard/open_struct.rb +67 -0
- data/lib/yard/parser/ruby/ast_node.rb +5 -4
- data/lib/yard/parser/ruby/legacy/ruby_lex.rb +20 -5
- data/lib/yard/parser/ruby/ruby_parser.rb +54 -21
- data/lib/yard/parser/source_parser.rb +2 -2
- data/lib/yard/tags/default_factory.rb +1 -0
- data/lib/yard/tags/directives.rb +0 -1
- data/lib/yard/tags/overload_tag.rb +2 -1
- data/lib/yard/tags/tag.rb +2 -1
- data/lib/yard/tags/types_explainer.rb +3 -3
- data/lib/yard/templates/engine.rb +0 -1
- data/lib/yard/templates/helpers/html_helper.rb +5 -1
- data/lib/yard/templates/helpers/markup/rdoc_markup.rb +2 -0
- data/lib/yard/templates/template_options.rb +0 -1
- data/lib/yard/version.rb +1 -1
- data/templates/default/fulldoc/html/css/full_list.css +3 -3
- data/templates/default/fulldoc/html/css/style.css +8 -15
- data/templates/default/fulldoc/html/full_list.erb +5 -2
- data/templates/default/fulldoc/html/js/app.js +348 -267
- data/templates/default/fulldoc/html/js/full_list.js +52 -24
- data/templates/default/fulldoc/html/setup.rb +10 -2
- data/templates/default/onefile/html/headers.erb +2 -0
- data/templates/default/tags/html/example.erb +2 -2
- metadata +7 -6
|
@@ -1,314 +1,395 @@
|
|
|
1
|
-
|
|
1
|
+
window.__app = function () {
|
|
2
|
+
var localStorage = {},
|
|
3
|
+
sessionStorage = {};
|
|
4
|
+
try {
|
|
5
|
+
localStorage = window.localStorage;
|
|
6
|
+
} catch (e) {}
|
|
7
|
+
try {
|
|
8
|
+
sessionStorage = window.sessionStorage;
|
|
9
|
+
} catch (e) {}
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function() {
|
|
15
|
-
$(this).parent().nextAll('.source_code').slideUp(100);
|
|
11
|
+
function createSourceLinks() {
|
|
12
|
+
$(".method_details_list .source_code").before(
|
|
13
|
+
"<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>"
|
|
14
|
+
);
|
|
15
|
+
$(".toggleSource").toggle(
|
|
16
|
+
function () {
|
|
17
|
+
$(this).parent().nextAll(".source_code").slideDown(100);
|
|
18
|
+
$(this).text("Hide source");
|
|
19
|
+
},
|
|
20
|
+
function () {
|
|
21
|
+
$(this).parent().nextAll(".source_code").slideUp(100);
|
|
16
22
|
$(this).text("View source");
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
19
26
|
|
|
20
|
-
function createDefineLinks() {
|
|
27
|
+
function createDefineLinks() {
|
|
21
28
|
var tHeight = 0;
|
|
22
|
-
$(
|
|
23
|
-
$(
|
|
29
|
+
$(".defines").after(" <a href='#' class='toggleDefines'>more...</a>");
|
|
30
|
+
$(".toggleDefines").toggle(
|
|
31
|
+
function () {
|
|
24
32
|
tHeight = $(this).parent().prev().height();
|
|
25
|
-
$(this).prev().css(
|
|
33
|
+
$(this).prev().css("display", "inline");
|
|
26
34
|
$(this).parent().prev().height($(this).parent().height());
|
|
27
35
|
$(this).text("(less)");
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
},
|
|
37
|
+
function () {
|
|
30
38
|
$(this).prev().hide();
|
|
31
39
|
$(this).parent().prev().height(tHeight);
|
|
32
40
|
$(this).text("more...");
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
35
44
|
|
|
36
|
-
function createFullTreeLinks() {
|
|
45
|
+
function createFullTreeLinks() {
|
|
37
46
|
var tHeight = 0;
|
|
38
|
-
$(
|
|
47
|
+
$(".inheritanceTree").toggle(
|
|
48
|
+
function () {
|
|
39
49
|
tHeight = $(this).parent().prev().height();
|
|
40
|
-
$(this).parent().toggleClass(
|
|
50
|
+
$(this).parent().toggleClass("showAll");
|
|
41
51
|
$(this).text("(hide)");
|
|
42
52
|
$(this).parent().prev().height($(this).parent().height());
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
$(this).parent().toggleClass(
|
|
53
|
+
},
|
|
54
|
+
function () {
|
|
55
|
+
$(this).parent().toggleClass("showAll");
|
|
46
56
|
$(this).parent().prev().height(tHeight);
|
|
47
57
|
$(this).text("show all");
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function searchFrameButtons() {
|
|
63
|
+
$(".full_list_link").click(function () {
|
|
64
|
+
toggleSearchFrame(this, $(this).attr("href"));
|
|
65
|
+
return false;
|
|
66
|
+
});
|
|
67
|
+
window.addEventListener("message", function (e) {
|
|
68
|
+
if (e.data === "navEscape") {
|
|
69
|
+
$("#nav").slideUp(100);
|
|
70
|
+
$("#search a").removeClass("active inactive");
|
|
71
|
+
$(window).focus();
|
|
72
|
+
}
|
|
48
73
|
});
|
|
49
|
-
}
|
|
50
74
|
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
$('#search a').removeClass('active inactive');
|
|
60
|
-
$(window).focus();
|
|
61
|
-
}
|
|
62
|
-
});
|
|
75
|
+
$(window).resize(function () {
|
|
76
|
+
if ($("#search:visible").length === 0) {
|
|
77
|
+
$("#nav").removeAttr("style");
|
|
78
|
+
$("#search a").removeClass("active inactive");
|
|
79
|
+
$(window).focus();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
63
83
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
function toggleSearchFrame(id, link) {
|
|
85
|
+
var frame = $("#nav");
|
|
86
|
+
$("#search a").removeClass("active").addClass("inactive");
|
|
87
|
+
if (frame.attr("src") === link && frame.css("display") !== "none") {
|
|
88
|
+
frame.slideUp(100);
|
|
89
|
+
$("#search a").removeClass("active inactive");
|
|
90
|
+
} else {
|
|
91
|
+
$(id).addClass("active").removeClass("inactive");
|
|
92
|
+
if (frame.attr("src") !== link) frame.attr("src", link);
|
|
93
|
+
frame.slideDown(100);
|
|
69
94
|
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function toggleSearchFrame(id, link) {
|
|
74
|
-
var frame = $('#nav');
|
|
75
|
-
$('#search a').removeClass('active').addClass('inactive');
|
|
76
|
-
if (frame.attr('src') === link && frame.css('display') !== "none") {
|
|
77
|
-
frame.slideUp(100);
|
|
78
|
-
$('#search a').removeClass('active inactive');
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
$(id).addClass('active').removeClass('inactive');
|
|
82
|
-
if (frame.attr('src') !== link) frame.attr('src', link);
|
|
83
|
-
frame.slideDown(100);
|
|
84
95
|
}
|
|
85
|
-
}
|
|
86
96
|
|
|
87
|
-
function linkSummaries() {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
97
|
+
function linkSummaries() {
|
|
98
|
+
$(".summary_signature").click(function () {
|
|
99
|
+
document.location = $(this).find("a").attr("href");
|
|
100
|
+
});
|
|
101
|
+
}
|
|
92
102
|
|
|
93
|
-
function summaryToggle() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
103
|
+
function summaryToggle() {
|
|
104
|
+
$(".summary_toggle").click(function (e) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
localStorage.summaryCollapsed = $(this).text();
|
|
107
|
+
$(".summary_toggle").each(function () {
|
|
108
|
+
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
|
109
|
+
var next = $(this).parent().parent().nextAll("ul.summary").first();
|
|
110
|
+
if (next.hasClass("compact")) {
|
|
111
|
+
next.toggle();
|
|
112
|
+
next.nextAll("ul.summary").first().toggle();
|
|
113
|
+
} else if (next.hasClass("summary")) {
|
|
114
|
+
var list = $('<ul class="summary compact" />');
|
|
115
|
+
list.html(next.html());
|
|
116
|
+
list.find(".summary_desc, .note").remove();
|
|
117
|
+
list.find("a").each(function () {
|
|
118
|
+
$(this).html($(this).find("strong").html());
|
|
119
|
+
$(this).parent().html($(this)[0].outerHTML);
|
|
120
|
+
});
|
|
121
|
+
next.before(list);
|
|
122
|
+
next.toggle();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return false;
|
|
115
126
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
127
|
+
if (localStorage.summaryCollapsed == "collapse") {
|
|
128
|
+
$(".summary_toggle").first().click();
|
|
129
|
+
} else {
|
|
130
|
+
localStorage.summaryCollapsed = "expand";
|
|
131
|
+
}
|
|
132
|
+
}
|
|
122
133
|
|
|
123
|
-
function constantSummaryToggle() {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
134
|
+
function constantSummaryToggle() {
|
|
135
|
+
$(".constants_summary_toggle").click(function (e) {
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
localStorage.summaryCollapsed = $(this).text();
|
|
138
|
+
$(".constants_summary_toggle").each(function () {
|
|
139
|
+
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
|
140
|
+
var next = $(this).parent().parent().nextAll("dl.constants").first();
|
|
141
|
+
if (next.hasClass("compact")) {
|
|
142
|
+
next.toggle();
|
|
143
|
+
next.nextAll("dl.constants").first().toggle();
|
|
144
|
+
} else if (next.hasClass("constants")) {
|
|
145
|
+
var list = $('<dl class="constants compact" />');
|
|
146
|
+
list.html(next.html());
|
|
147
|
+
list.find("dt").each(function () {
|
|
148
|
+
$(this).addClass("summary_signature");
|
|
149
|
+
$(this).text($(this).text().split("=")[0]);
|
|
150
|
+
if ($(this).has(".deprecated").length) {
|
|
151
|
+
$(this).addClass("deprecated");
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
// Add the value of the constant as "Tooltip" to the summary object
|
|
155
|
+
list.find("pre.code").each(function () {
|
|
156
|
+
var dt_element = $(this).parent().prev();
|
|
157
|
+
var tooltip = $(this).text();
|
|
158
|
+
if (dt_element.hasClass("deprecated")) {
|
|
159
|
+
tooltip = "Deprecated. " + tooltip;
|
|
160
|
+
}
|
|
161
|
+
dt_element.attr("title", tooltip);
|
|
162
|
+
});
|
|
163
|
+
list.find(".docstring, .tags, dd").remove();
|
|
164
|
+
next.before(list);
|
|
165
|
+
next.toggle();
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
return false;
|
|
158
169
|
});
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
170
|
+
if (localStorage.summaryCollapsed == "collapse") {
|
|
171
|
+
$(".constants_summary_toggle").first().click();
|
|
172
|
+
} else {
|
|
173
|
+
localStorage.summaryCollapsed = "expand";
|
|
174
|
+
}
|
|
175
|
+
}
|
|
165
176
|
|
|
166
|
-
function generateTOC() {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
$(tags.join(', ')).each(function() {
|
|
179
|
-
if ($(this).parents('.method_details .docstring').length != 0) return;
|
|
180
|
-
if (this.id == "filecontents") return;
|
|
181
|
-
show = true;
|
|
182
|
-
var thisTag = parseInt(this.tagName[1], 10);
|
|
183
|
-
if (this.id.length === 0) {
|
|
184
|
-
var proposedId = $(this).attr('toc-id');
|
|
185
|
-
if (typeof(proposedId) != "undefined") this.id = proposedId;
|
|
186
|
-
else {
|
|
187
|
-
var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
|
|
188
|
-
if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
|
|
189
|
-
this.id = proposedId;
|
|
190
|
-
}
|
|
177
|
+
function generateTOC() {
|
|
178
|
+
if ($("#filecontents").length === 0) return;
|
|
179
|
+
var _toc = $('<ol class="top"></ol>');
|
|
180
|
+
var show = false;
|
|
181
|
+
var toc = _toc;
|
|
182
|
+
var counter = 0;
|
|
183
|
+
var tags = ["h2", "h3", "h4", "h5", "h6"];
|
|
184
|
+
var i;
|
|
185
|
+
var curli;
|
|
186
|
+
if ($("#filecontents h1").length > 1) tags.unshift("h1");
|
|
187
|
+
for (i = 0; i < tags.length; i++) {
|
|
188
|
+
tags[i] = "#filecontents " + tags[i];
|
|
191
189
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
var lastTag = parseInt(tags[0][1], 10);
|
|
191
|
+
$(tags.join(", ")).each(function () {
|
|
192
|
+
if ($(this).parents(".method_details .docstring").length != 0) return;
|
|
193
|
+
if (this.id == "filecontents") return;
|
|
194
|
+
show = true;
|
|
195
|
+
var thisTag = parseInt(this.tagName[1], 10);
|
|
196
|
+
if (this.id.length === 0) {
|
|
197
|
+
var proposedId = $(this).attr("toc-id");
|
|
198
|
+
if (typeof proposedId != "undefined") this.id = proposedId;
|
|
199
|
+
else {
|
|
200
|
+
var proposedId = $(this)
|
|
201
|
+
.text()
|
|
202
|
+
.replace(/[^a-z0-9-]/gi, "_");
|
|
203
|
+
if ($("#" + proposedId).length > 0) {
|
|
204
|
+
proposedId += counter;
|
|
205
|
+
counter++;
|
|
206
|
+
}
|
|
207
|
+
this.id = proposedId;
|
|
197
208
|
}
|
|
198
|
-
toc = $('<ol/>');
|
|
199
|
-
curli.append(toc);
|
|
200
|
-
curli = undefined;
|
|
201
209
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
210
|
+
if (thisTag > lastTag) {
|
|
211
|
+
for (i = 0; i < thisTag - lastTag; i++) {
|
|
212
|
+
if (typeof curli == "undefined") {
|
|
213
|
+
curli = $("<li/>");
|
|
214
|
+
toc.append(curli);
|
|
215
|
+
}
|
|
216
|
+
toc = $("<ol/>");
|
|
217
|
+
curli.append(toc);
|
|
218
|
+
curli = undefined;
|
|
219
|
+
}
|
|
207
220
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
$(
|
|
225
|
-
$(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
221
|
+
if (thisTag < lastTag) {
|
|
222
|
+
for (i = 0; i < lastTag - thisTag; i++) {
|
|
223
|
+
toc = toc.parent();
|
|
224
|
+
toc = toc.parent();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
var title = $(this).attr("toc-title");
|
|
228
|
+
if (typeof title == "undefined") title = $(this).text();
|
|
229
|
+
curli = $('<li><a href="#' + this.id + '">' + title + "</a></li>");
|
|
230
|
+
toc.append(curli);
|
|
231
|
+
lastTag = thisTag;
|
|
232
|
+
});
|
|
233
|
+
if (!show) return;
|
|
234
|
+
html =
|
|
235
|
+
'<div id="toc"><p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p></div>';
|
|
236
|
+
$("#content").prepend(html);
|
|
237
|
+
$("#toc").append(_toc);
|
|
238
|
+
$("#toc .hide_toc").toggle(
|
|
239
|
+
function () {
|
|
240
|
+
$("#toc .top").slideUp("fast");
|
|
241
|
+
$("#toc").toggleClass("hidden");
|
|
242
|
+
$("#toc .title small").toggle();
|
|
243
|
+
},
|
|
244
|
+
function () {
|
|
245
|
+
$("#toc .top").slideDown("fast");
|
|
246
|
+
$("#toc").toggleClass("hidden");
|
|
247
|
+
$("#toc .title small").toggle();
|
|
248
|
+
}
|
|
249
|
+
);
|
|
234
250
|
}
|
|
235
251
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
252
|
+
function navResizer() {
|
|
253
|
+
const resizer = document.getElementById("resizer");
|
|
254
|
+
resizer.addEventListener(
|
|
255
|
+
"pointerdown",
|
|
256
|
+
function (e) {
|
|
257
|
+
resizer.setPointerCapture(e.pointerId);
|
|
258
|
+
e.preventDefault();
|
|
259
|
+
e.stopPropagation();
|
|
260
|
+
},
|
|
261
|
+
false
|
|
262
|
+
);
|
|
263
|
+
resizer.addEventListener(
|
|
264
|
+
"pointerup",
|
|
265
|
+
function (e) {
|
|
266
|
+
resizer.releasePointerCapture(e.pointerId);
|
|
267
|
+
e.preventDefault();
|
|
268
|
+
e.stopPropagation();
|
|
269
|
+
},
|
|
270
|
+
false
|
|
271
|
+
);
|
|
272
|
+
resizer.addEventListener(
|
|
273
|
+
"pointermove",
|
|
274
|
+
function (e) {
|
|
275
|
+
if ((e.buttons & 1) === 0) {
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
240
278
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
279
|
+
sessionStorage.navWidth = e.pageX.toString();
|
|
280
|
+
$(".nav_wrap").css("width", Math.max(200, e.pageX));
|
|
281
|
+
e.preventDefault();
|
|
282
|
+
e.stopPropagation();
|
|
283
|
+
},
|
|
284
|
+
false
|
|
285
|
+
);
|
|
245
286
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
287
|
+
if (sessionStorage.navWidth) {
|
|
288
|
+
$(".nav_wrap").css(
|
|
289
|
+
"width",
|
|
290
|
+
Math.max(200, parseInt(sessionStorage.navWidth, 10))
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
250
294
|
|
|
251
|
-
function
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
295
|
+
function navExpander() {
|
|
296
|
+
if (typeof pathId === "undefined") return;
|
|
297
|
+
var done = false,
|
|
298
|
+
timer = setTimeout(postMessage, 500);
|
|
299
|
+
function postMessage() {
|
|
300
|
+
if (done) return;
|
|
301
|
+
clearTimeout(timer);
|
|
302
|
+
var opts = { action: "expand", path: pathId };
|
|
303
|
+
document.getElementById("nav").contentWindow.postMessage(opts, "*");
|
|
304
|
+
done = true;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function mainFocus() {
|
|
309
|
+
var hash = window.location.hash;
|
|
310
|
+
if (hash !== "" && $(hash)[0]) {
|
|
311
|
+
$(hash)[0].scrollIntoView();
|
|
312
|
+
}
|
|
258
313
|
|
|
259
|
-
|
|
260
|
-
|
|
314
|
+
setTimeout(function () {
|
|
315
|
+
$("#main").focus();
|
|
316
|
+
}, 10);
|
|
261
317
|
}
|
|
262
|
-
}
|
|
263
318
|
|
|
264
|
-
function
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
319
|
+
function navigationChange() {
|
|
320
|
+
// This works around the broken anchor navigation with the YARD template.
|
|
321
|
+
window.onpopstate = function () {
|
|
322
|
+
var hash = window.location.hash;
|
|
323
|
+
if (hash !== "" && $(hash)[0]) {
|
|
324
|
+
$(hash)[0].scrollIntoView();
|
|
325
|
+
}
|
|
326
|
+
};
|
|
272
327
|
}
|
|
273
328
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
329
|
+
$(document).ready(function () {
|
|
330
|
+
navResizer();
|
|
331
|
+
navExpander();
|
|
332
|
+
createSourceLinks();
|
|
333
|
+
createDefineLinks();
|
|
334
|
+
createFullTreeLinks();
|
|
335
|
+
searchFrameButtons();
|
|
336
|
+
linkSummaries();
|
|
337
|
+
summaryToggle();
|
|
338
|
+
constantSummaryToggle();
|
|
339
|
+
generateTOC();
|
|
340
|
+
mainFocus();
|
|
341
|
+
navigationChange();
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
window.__app();
|
|
279
345
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
346
|
+
window.addEventListener(
|
|
347
|
+
"message",
|
|
348
|
+
async (e) => {
|
|
349
|
+
if (e.data.action === "navigate") {
|
|
350
|
+
const response = await fetch(e.data.url);
|
|
351
|
+
const text = await response.text();
|
|
352
|
+
const parser = new DOMParser();
|
|
353
|
+
const doc = parser.parseFromString(text, "text/html");
|
|
285
354
|
|
|
286
|
-
|
|
287
|
-
|
|
355
|
+
const classListLink =
|
|
356
|
+
document.getElementById("class_list_link").classList;
|
|
288
357
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
358
|
+
const content = doc.querySelector("#main").innerHTML;
|
|
359
|
+
document.querySelector("#main").innerHTML = content;
|
|
360
|
+
document.title = doc.head.querySelector("title").innerText;
|
|
361
|
+
document.head.querySelectorAll("script").forEach((script) => {
|
|
362
|
+
if (
|
|
363
|
+
!script.type ||
|
|
364
|
+
(script.type.includes("text/javascript") && !script.src)
|
|
365
|
+
) {
|
|
366
|
+
script.remove();
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
doc.head.querySelectorAll("script").forEach((script) => {
|
|
371
|
+
if (
|
|
372
|
+
!script.type ||
|
|
373
|
+
(script.type.includes("text/javascript") && !script.src)
|
|
374
|
+
) {
|
|
375
|
+
const newScript = document.createElement("script");
|
|
376
|
+
newScript.type = "text/javascript";
|
|
377
|
+
newScript.textContent = script.textContent;
|
|
378
|
+
document.head.appendChild(newScript);
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
window.__app();
|
|
298
383
|
|
|
299
|
-
|
|
300
|
-
navResizer();
|
|
301
|
-
navExpander();
|
|
302
|
-
createSourceLinks();
|
|
303
|
-
createDefineLinks();
|
|
304
|
-
createFullTreeLinks();
|
|
305
|
-
searchFrameButtons();
|
|
306
|
-
linkSummaries();
|
|
307
|
-
summaryToggle();
|
|
308
|
-
constantSummaryToggle();
|
|
309
|
-
generateTOC();
|
|
310
|
-
mainFocus();
|
|
311
|
-
navigationChange();
|
|
312
|
-
});
|
|
384
|
+
document.getElementById("class_list_link").classList = classListLink;
|
|
313
385
|
|
|
314
|
-
|
|
386
|
+
const url = new URL(e.data.url, "https://localhost");
|
|
387
|
+
const hash = decodeURIComponent(url.hash ?? "");
|
|
388
|
+
if (hash) {
|
|
389
|
+
document.getElementById(hash.substring(1)).scrollIntoView();
|
|
390
|
+
}
|
|
391
|
+
history.pushState({}, document.title, e.data.url);
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
false
|
|
395
|
+
);
|