yard 0.9.41 → 0.9.42
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 +10 -0
- data/docs/Parser.md +17 -42
- data/lib/yard/server/commands/base.rb +1 -1
- data/lib/yard/server/templates/default/fulldoc/html/css/custom.css +168 -88
- data/lib/yard/server/templates/default/fulldoc/html/js/autocomplete.js +202 -207
- data/lib/yard/version.rb +1 -1
- data/templates/default/fulldoc/html/css/common.css +1 -1
- data/templates/default/fulldoc/html/css/full_list.css +201 -53
- data/templates/default/fulldoc/html/css/style.css +980 -412
- data/templates/default/fulldoc/html/js/app.js +800 -639
- data/templates/default/fulldoc/html/js/full_list.js +333 -371
- data/templates/default/layout/html/layout.erb +2 -1
- data/templates/guide/fulldoc/html/css/style.css +347 -97
- data/templates/guide/fulldoc/html/js/app.js +61 -64
- data/templates/guide/layout/html/layout.erb +67 -68
- metadata +2 -2
|
@@ -1,640 +1,801 @@
|
|
|
1
|
-
(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
1
|
+
(() => {
|
|
2
|
+
window.__yardAppState = window.__yardAppState || {
|
|
3
|
+
navigationListenerBound: false,
|
|
4
|
+
navigationChangeBound: false,
|
|
5
|
+
navResizerBound: false,
|
|
6
|
+
searchFrameGlobalsBound: false,
|
|
7
|
+
latestNavigationId: 0,
|
|
8
|
+
loadingIndicatorTimer: null,
|
|
9
|
+
loadingProgressTimer: null,
|
|
10
|
+
loadingProgressHideTimer: null,
|
|
11
|
+
navExpanderTimer: null,
|
|
12
|
+
navExpanderToken: 0,
|
|
13
|
+
currentUrl: window.location.href,
|
|
14
|
+
};
|
|
15
|
+
const appState = window.__yardAppState;
|
|
16
|
+
let safeLocalStorage = {};
|
|
17
|
+
let safeSessionStorage = {};
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
safeLocalStorage = window.localStorage;
|
|
21
|
+
} catch (_error) {}
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
safeSessionStorage = window.sessionStorage;
|
|
25
|
+
} catch (_error) {}
|
|
26
|
+
|
|
27
|
+
function query(selector, root) {
|
|
28
|
+
return (root || document).querySelector(selector);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function queryAll(selector, root) {
|
|
32
|
+
return Array.prototype.slice.call(
|
|
33
|
+
(root || document).querySelectorAll(selector),
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isVisible(element) {
|
|
38
|
+
if (!element) return false;
|
|
39
|
+
return window.getComputedStyle(element).display !== "none";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function toggleDisplay(element, visible, displayValue) {
|
|
43
|
+
if (!element) return;
|
|
44
|
+
element.style.display = visible ? displayValue || "" : "none";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function setMainLoading(loading) {
|
|
48
|
+
const body = document.body;
|
|
49
|
+
const main = query("#main");
|
|
50
|
+
|
|
51
|
+
if (body) body.classList.toggle("loading", !!loading);
|
|
52
|
+
if (!main) return;
|
|
53
|
+
main.classList.toggle("loading", !!loading);
|
|
54
|
+
main.setAttribute("aria-busy", loading ? "true" : "false");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function setLoadingProgress(progress) {
|
|
58
|
+
const indicator = query("#main_progress");
|
|
59
|
+
|
|
60
|
+
if (!indicator) return;
|
|
61
|
+
indicator.style.setProperty(
|
|
62
|
+
"--yard-progress",
|
|
63
|
+
`${Math.max(0, Math.min(100, progress))}%`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function clearLoadingProgressTimers() {
|
|
68
|
+
clearTimeout(appState.loadingProgressTimer);
|
|
69
|
+
clearTimeout(appState.loadingProgressHideTimer);
|
|
70
|
+
appState.loadingProgressTimer = null;
|
|
71
|
+
appState.loadingProgressHideTimer = null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function startLoadingProgress() {
|
|
75
|
+
const startedAt = Date.now();
|
|
76
|
+
|
|
77
|
+
clearLoadingProgressTimers();
|
|
78
|
+
setLoadingProgress(0);
|
|
79
|
+
setMainLoading(true);
|
|
80
|
+
|
|
81
|
+
function tick() {
|
|
82
|
+
const elapsed = Date.now() - startedAt;
|
|
83
|
+
let progress;
|
|
84
|
+
|
|
85
|
+
if (elapsed <= 1000) {
|
|
86
|
+
progress = (elapsed / 1000) * 99;
|
|
87
|
+
} else {
|
|
88
|
+
progress = 99 + Math.min(1, (elapsed - 1000) / 10000);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
setLoadingProgress(progress);
|
|
92
|
+
|
|
93
|
+
if (progress < 100) {
|
|
94
|
+
appState.loadingProgressTimer = setTimeout(tick, 50);
|
|
95
|
+
} else {
|
|
96
|
+
appState.loadingProgressTimer = null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
tick();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function scheduleMainLoading(navigationId) {
|
|
104
|
+
clearTimeout(appState.loadingIndicatorTimer);
|
|
105
|
+
clearTimeout(appState.loadingProgressHideTimer);
|
|
106
|
+
appState.loadingProgressHideTimer = null;
|
|
107
|
+
appState.loadingIndicatorTimer = setTimeout(() => {
|
|
108
|
+
if (navigationId === appState.latestNavigationId) {
|
|
109
|
+
startLoadingProgress();
|
|
110
|
+
}
|
|
111
|
+
appState.loadingIndicatorTimer = null;
|
|
112
|
+
}, 400);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function cancelMainLoading() {
|
|
116
|
+
clearTimeout(appState.loadingIndicatorTimer);
|
|
117
|
+
appState.loadingIndicatorTimer = null;
|
|
118
|
+
clearTimeout(appState.loadingProgressTimer);
|
|
119
|
+
appState.loadingProgressTimer = null;
|
|
120
|
+
setLoadingProgress(100);
|
|
121
|
+
appState.loadingProgressHideTimer = setTimeout(() => {
|
|
122
|
+
setMainLoading(false);
|
|
123
|
+
setLoadingProgress(0);
|
|
124
|
+
appState.loadingProgressHideTimer = null;
|
|
125
|
+
}, 120);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function firstNextMatchingSibling(element, selector) {
|
|
129
|
+
let current = element;
|
|
130
|
+
while (current) {
|
|
131
|
+
current = current.nextElementSibling;
|
|
132
|
+
if (current?.matches(selector)) return current;
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function ready(callback) {
|
|
138
|
+
if (document.readyState === "loading") {
|
|
139
|
+
document.addEventListener("DOMContentLoaded", callback, { once: true });
|
|
140
|
+
} else {
|
|
141
|
+
callback();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function createSourceLinks() {
|
|
146
|
+
queryAll(".method_details_list .source_code").forEach((sourceCode) => {
|
|
147
|
+
const toggleWrapper = document.createElement("span");
|
|
148
|
+
const link = document.createElement("a");
|
|
149
|
+
|
|
150
|
+
toggleWrapper.className = "showSource";
|
|
151
|
+
toggleWrapper.appendChild(document.createTextNode("["));
|
|
152
|
+
toggleWrapper.appendChild(link);
|
|
153
|
+
toggleWrapper.appendChild(document.createTextNode("]"));
|
|
154
|
+
|
|
155
|
+
link.href = "#";
|
|
156
|
+
link.className = "toggleSource";
|
|
157
|
+
link.textContent = "View source";
|
|
158
|
+
|
|
159
|
+
link.addEventListener("click", (event) => {
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
const expanded = isVisible(sourceCode);
|
|
162
|
+
toggleDisplay(sourceCode, !expanded, "table");
|
|
163
|
+
link.textContent = expanded ? "View source" : "Hide source";
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
sourceCode.parentNode.insertBefore(toggleWrapper, sourceCode);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function createDefineLinks() {
|
|
171
|
+
queryAll(".defines").forEach((defines) => {
|
|
172
|
+
const toggleLink = document.createElement("a");
|
|
173
|
+
const summary = defines.parentElement.previousElementSibling;
|
|
174
|
+
|
|
175
|
+
toggleLink.href = "#";
|
|
176
|
+
toggleLink.className = "toggleDefines";
|
|
177
|
+
toggleLink.textContent = "more...";
|
|
178
|
+
defines.insertAdjacentText("afterend", " ");
|
|
179
|
+
defines.insertAdjacentElement("afterend", toggleLink);
|
|
180
|
+
|
|
181
|
+
toggleLink.addEventListener("click", (event) => {
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
const expanded = toggleLink.dataset.expanded === "true";
|
|
184
|
+
|
|
185
|
+
if (!expanded) {
|
|
186
|
+
toggleLink.dataset.height = String(summary.offsetHeight);
|
|
187
|
+
defines.style.display = "inline";
|
|
188
|
+
summary.style.height = `${toggleLink.parentElement.offsetHeight}px`;
|
|
189
|
+
toggleLink.textContent = "(less)";
|
|
190
|
+
toggleLink.dataset.expanded = "true";
|
|
191
|
+
} else {
|
|
192
|
+
defines.style.display = "none";
|
|
193
|
+
if (toggleLink.dataset.height) {
|
|
194
|
+
summary.style.height = `${toggleLink.dataset.height}px`;
|
|
195
|
+
}
|
|
196
|
+
toggleLink.textContent = "more...";
|
|
197
|
+
toggleLink.dataset.expanded = "false";
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function createFullTreeLinks() {
|
|
204
|
+
queryAll(".inheritanceTree").forEach((toggleLink) => {
|
|
205
|
+
const container = toggleLink.parentElement;
|
|
206
|
+
const tree = container.previousElementSibling;
|
|
207
|
+
|
|
208
|
+
toggleLink.addEventListener("click", (event) => {
|
|
209
|
+
event.preventDefault();
|
|
210
|
+
const expanded = toggleLink.dataset.expanded === "true";
|
|
211
|
+
|
|
212
|
+
if (!expanded) {
|
|
213
|
+
toggleLink.dataset.height = String(tree.offsetHeight);
|
|
214
|
+
container.classList.add("showAll");
|
|
215
|
+
toggleLink.textContent = "(hide)";
|
|
216
|
+
tree.style.height = `${container.offsetHeight}px`;
|
|
217
|
+
toggleLink.dataset.expanded = "true";
|
|
218
|
+
} else {
|
|
219
|
+
container.classList.remove("showAll");
|
|
220
|
+
if (toggleLink.dataset.height) {
|
|
221
|
+
tree.style.height = `${toggleLink.dataset.height}px`;
|
|
222
|
+
}
|
|
223
|
+
toggleLink.textContent = "show all";
|
|
224
|
+
toggleLink.dataset.expanded = "false";
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function resetSearchFrame() {
|
|
231
|
+
const frame = query("#nav");
|
|
232
|
+
|
|
233
|
+
if (frame) frame.removeAttribute("style");
|
|
234
|
+
queryAll("#search a").forEach((link) => {
|
|
235
|
+
link.classList.remove("active");
|
|
236
|
+
link.classList.remove("inactive");
|
|
237
|
+
});
|
|
238
|
+
window.focus();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function toggleSearchFrame(linkElement, link) {
|
|
242
|
+
const frame = query("#nav");
|
|
243
|
+
|
|
244
|
+
if (!frame) return;
|
|
245
|
+
|
|
246
|
+
queryAll("#search a").forEach((searchLink) => {
|
|
247
|
+
searchLink.classList.remove("active");
|
|
248
|
+
searchLink.classList.add("inactive");
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
if (frame.getAttribute("src") === link && isVisible(frame)) {
|
|
252
|
+
frame.style.display = "none";
|
|
253
|
+
queryAll("#search a").forEach((searchLink) => {
|
|
254
|
+
searchLink.classList.remove("active");
|
|
255
|
+
searchLink.classList.remove("inactive");
|
|
256
|
+
});
|
|
257
|
+
} else {
|
|
258
|
+
linkElement.classList.add("active");
|
|
259
|
+
linkElement.classList.remove("inactive");
|
|
260
|
+
if (frame.getAttribute("src") !== link) frame.setAttribute("src", link);
|
|
261
|
+
frame.style.display = "block";
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function searchFrameButtons() {
|
|
266
|
+
queryAll(".full_list_link").forEach((link) => {
|
|
267
|
+
if (link.dataset.yardSearchFrameBound === "true") return;
|
|
268
|
+
|
|
269
|
+
link.addEventListener("click", (event) => {
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
toggleSearchFrame(link, link.getAttribute("href"));
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
link.dataset.yardSearchFrameBound = "true";
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
if (appState.searchFrameGlobalsBound) return;
|
|
278
|
+
|
|
279
|
+
window.addEventListener("message", (event) => {
|
|
280
|
+
if (event.data === "navEscape") resetSearchFrame();
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
window.addEventListener("resize", () => {
|
|
284
|
+
if (!isVisible(query("#search"))) resetSearchFrame();
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
appState.searchFrameGlobalsBound = true;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function linkSummaries() {
|
|
291
|
+
queryAll(".summary_signature").forEach((signature) => {
|
|
292
|
+
signature.addEventListener("click", (event) => {
|
|
293
|
+
if (event.target.closest("a")) return;
|
|
294
|
+
const link = signature.querySelector("a");
|
|
295
|
+
if (link) document.location = link.getAttribute("href");
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function toggleSummaryCollection(toggleSelector, listSelector, cloneBuilder) {
|
|
301
|
+
queryAll(toggleSelector).forEach((toggleLink) => {
|
|
302
|
+
toggleLink.addEventListener("click", (event) => {
|
|
303
|
+
event.preventDefault();
|
|
304
|
+
safeLocalStorage.summaryCollapsed = toggleLink.textContent;
|
|
305
|
+
|
|
306
|
+
queryAll(toggleSelector).forEach((link) => {
|
|
307
|
+
link.textContent =
|
|
308
|
+
link.textContent === "collapse" ? "expand" : "collapse";
|
|
309
|
+
|
|
310
|
+
const container = link.parentElement.parentElement;
|
|
311
|
+
const next = firstNextMatchingSibling(container, listSelector);
|
|
312
|
+
|
|
313
|
+
if (!next) return;
|
|
314
|
+
|
|
315
|
+
if (next.classList.contains("compact")) {
|
|
316
|
+
const fullList = firstNextMatchingSibling(next, listSelector);
|
|
317
|
+
toggleDisplay(next, !isVisible(next));
|
|
318
|
+
toggleDisplay(fullList, !isVisible(fullList));
|
|
319
|
+
} else {
|
|
320
|
+
const compactList = cloneBuilder(next.cloneNode(true));
|
|
321
|
+
next.parentNode.insertBefore(compactList, next);
|
|
322
|
+
toggleDisplay(next, false);
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function buildCompactSummary(list) {
|
|
330
|
+
list.className = "summary compact";
|
|
331
|
+
|
|
332
|
+
queryAll(".summary_desc, .note", list).forEach((node) => {
|
|
333
|
+
node.remove();
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
queryAll("a", list).forEach((link) => {
|
|
337
|
+
const strong = link.querySelector("strong");
|
|
338
|
+
if (strong) link.innerHTML = strong.innerHTML;
|
|
339
|
+
if (link.parentElement) link.parentElement.outerHTML = link.outerHTML;
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
return list;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function buildCompactConstants(list) {
|
|
346
|
+
list.className = "constants compact";
|
|
347
|
+
|
|
348
|
+
queryAll("dt", list).forEach((node) => {
|
|
349
|
+
const deprecated = !!node.querySelector(".deprecated");
|
|
350
|
+
node.classList.add("summary_signature");
|
|
351
|
+
node.textContent = node.textContent.split("=")[0];
|
|
352
|
+
if (deprecated) node.classList.add("deprecated");
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
queryAll("pre.code", list).forEach((pre) => {
|
|
356
|
+
const dtElement = pre.parentElement.previousElementSibling;
|
|
357
|
+
let tooltip = pre.textContent;
|
|
358
|
+
if (dtElement.classList.contains("deprecated")) {
|
|
359
|
+
tooltip = `Deprecated. ${tooltip}`;
|
|
360
|
+
}
|
|
361
|
+
dtElement.setAttribute("title", tooltip);
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
queryAll(".docstring, .tags, dd", list).forEach((node) => {
|
|
365
|
+
node.remove();
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
return list;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function summaryToggle() {
|
|
372
|
+
toggleSummaryCollection(
|
|
373
|
+
".summary_toggle",
|
|
374
|
+
"ul.summary",
|
|
375
|
+
buildCompactSummary,
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
if (safeLocalStorage.summaryCollapsed === "collapse") {
|
|
379
|
+
const toggle = query(".summary_toggle");
|
|
380
|
+
if (toggle) toggle.click();
|
|
381
|
+
} else {
|
|
382
|
+
safeLocalStorage.summaryCollapsed = "expand";
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
function constantSummaryToggle() {
|
|
387
|
+
toggleSummaryCollection(
|
|
388
|
+
".constants_summary_toggle",
|
|
389
|
+
"dl.constants",
|
|
390
|
+
buildCompactConstants,
|
|
391
|
+
);
|
|
392
|
+
|
|
393
|
+
if (safeLocalStorage.summaryCollapsed === "collapse") {
|
|
394
|
+
const toggle = query(".constants_summary_toggle");
|
|
395
|
+
if (toggle) toggle.click();
|
|
396
|
+
} else {
|
|
397
|
+
safeLocalStorage.summaryCollapsed = "expand";
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function generateTOC() {
|
|
402
|
+
const fileContents = query("#filecontents");
|
|
403
|
+
const content = query("#content");
|
|
404
|
+
|
|
405
|
+
if (!fileContents || !content) return;
|
|
406
|
+
if (query("#toc", content)) return;
|
|
407
|
+
|
|
408
|
+
const topLevel = document.createElement("ol");
|
|
409
|
+
let currentList = topLevel;
|
|
410
|
+
let currentItem;
|
|
411
|
+
let counter = 0;
|
|
412
|
+
const headings = ["h2", "h3", "h4", "h5", "h6"];
|
|
413
|
+
let hasEntries = false;
|
|
414
|
+
|
|
415
|
+
topLevel.className = "top";
|
|
416
|
+
|
|
417
|
+
if (queryAll("#filecontents h1").length > 1) headings.unshift("h1");
|
|
418
|
+
|
|
419
|
+
const selectors = headings.map((tagName) => `#filecontents ${tagName}`);
|
|
420
|
+
|
|
421
|
+
let lastLevel = parseInt(headings[0].substring(1), 10);
|
|
422
|
+
|
|
423
|
+
queryAll(selectors.join(", ")).forEach((heading) => {
|
|
424
|
+
let level;
|
|
425
|
+
|
|
426
|
+
if (heading.closest(".method_details .docstring")) return;
|
|
427
|
+
if (heading.id === "filecontents") return;
|
|
428
|
+
|
|
429
|
+
hasEntries = true;
|
|
430
|
+
level = parseInt(heading.tagName.substring(1), 10);
|
|
431
|
+
|
|
432
|
+
if (!heading.id) {
|
|
433
|
+
let proposedId = heading.getAttribute("toc-id");
|
|
434
|
+
if (!proposedId) {
|
|
435
|
+
proposedId = heading.textContent.replace(/[^a-z0-9-]/gi, "_");
|
|
436
|
+
if (query(`#${proposedId}`)) {
|
|
437
|
+
proposedId += counter;
|
|
438
|
+
counter += 1;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
heading.id = proposedId;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (level > lastLevel) {
|
|
445
|
+
while (level > lastLevel) {
|
|
446
|
+
if (!currentItem) {
|
|
447
|
+
currentItem = document.createElement("li");
|
|
448
|
+
currentList.appendChild(currentItem);
|
|
449
|
+
}
|
|
450
|
+
const nestedList = document.createElement("ol");
|
|
451
|
+
currentItem.appendChild(nestedList);
|
|
452
|
+
currentList = nestedList;
|
|
453
|
+
currentItem = null;
|
|
454
|
+
lastLevel += 1;
|
|
455
|
+
}
|
|
456
|
+
} else if (level < lastLevel) {
|
|
457
|
+
while (level < lastLevel && currentList.parentElement) {
|
|
458
|
+
currentList = currentList.parentElement.parentElement;
|
|
459
|
+
lastLevel -= 1;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const title = heading.getAttribute("toc-title") || heading.textContent;
|
|
464
|
+
const item = document.createElement("li");
|
|
465
|
+
item.innerHTML = `<a href="#${heading.id}">${title}</a>`;
|
|
466
|
+
currentList.appendChild(item);
|
|
467
|
+
currentItem = item;
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
if (!hasEntries) return;
|
|
471
|
+
|
|
472
|
+
const toc = document.createElement("div");
|
|
473
|
+
toc.id = "toc";
|
|
474
|
+
toc.innerHTML =
|
|
475
|
+
'<p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p>';
|
|
476
|
+
content.insertBefore(toc, content.firstChild);
|
|
477
|
+
toc.appendChild(topLevel);
|
|
478
|
+
|
|
479
|
+
const hideLink = query("#toc .hide_toc");
|
|
480
|
+
if (hideLink) {
|
|
481
|
+
hideLink.addEventListener("click", (event) => {
|
|
482
|
+
event.preventDefault();
|
|
483
|
+
const list = query("#toc .top");
|
|
484
|
+
const hidden = query("#toc").classList.toggle("hidden");
|
|
485
|
+
toggleDisplay(list, !hidden);
|
|
486
|
+
queryAll("#toc .title small").forEach((node) => {
|
|
487
|
+
toggleDisplay(node, hidden);
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
function navResizer() {
|
|
494
|
+
const resizer = document.getElementById("resizer");
|
|
495
|
+
|
|
496
|
+
if (!resizer) return;
|
|
497
|
+
|
|
498
|
+
if (!appState.navResizerBound) {
|
|
499
|
+
resizer.addEventListener(
|
|
500
|
+
"pointerdown",
|
|
501
|
+
(event) => {
|
|
502
|
+
resizer.setPointerCapture(event.pointerId);
|
|
503
|
+
event.preventDefault();
|
|
504
|
+
event.stopPropagation();
|
|
505
|
+
},
|
|
506
|
+
false,
|
|
507
|
+
);
|
|
508
|
+
resizer.addEventListener(
|
|
509
|
+
"pointerup",
|
|
510
|
+
(event) => {
|
|
511
|
+
resizer.releasePointerCapture(event.pointerId);
|
|
512
|
+
event.preventDefault();
|
|
513
|
+
event.stopPropagation();
|
|
514
|
+
},
|
|
515
|
+
false,
|
|
516
|
+
);
|
|
517
|
+
resizer.addEventListener(
|
|
518
|
+
"pointermove",
|
|
519
|
+
(event) => {
|
|
520
|
+
if ((event.buttons & 1) === 0) return;
|
|
521
|
+
|
|
522
|
+
safeSessionStorage.navWidth = String(event.pageX);
|
|
523
|
+
queryAll(".nav_wrap").forEach((node) => {
|
|
524
|
+
node.style.width = `${Math.max(200, event.pageX)}px`;
|
|
525
|
+
});
|
|
526
|
+
event.preventDefault();
|
|
527
|
+
event.stopPropagation();
|
|
528
|
+
},
|
|
529
|
+
false,
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
appState.navResizerBound = true;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
if (safeSessionStorage.navWidth) {
|
|
536
|
+
queryAll(".nav_wrap").forEach((node) => {
|
|
537
|
+
node.style.width = `${Math.max(200, parseInt(safeSessionStorage.navWidth, 10))}px`;
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
function navExpander(enabled) {
|
|
543
|
+
if (enabled === false) return;
|
|
544
|
+
if (typeof pathId === "undefined") return;
|
|
545
|
+
|
|
546
|
+
const frame = document.getElementById("nav");
|
|
547
|
+
const token = ++appState.navExpanderToken;
|
|
548
|
+
|
|
549
|
+
function postMessage() {
|
|
550
|
+
if (token !== appState.navExpanderToken) return;
|
|
551
|
+
expandNavPath(pathId);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
clearTimeout(appState.navExpanderTimer);
|
|
555
|
+
if (frame) frame.addEventListener("load", postMessage, { once: true });
|
|
556
|
+
appState.navExpanderTimer = setTimeout(postMessage, 50);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function expandNavPath(path) {
|
|
560
|
+
const frame = document.getElementById("nav");
|
|
561
|
+
|
|
562
|
+
if (path == null || !frame || !frame.contentWindow) return;
|
|
563
|
+
frame.contentWindow.postMessage({ action: "expand", path: path }, "*");
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
function focusHashTarget(hashOverride) {
|
|
567
|
+
const hash =
|
|
568
|
+
typeof hashOverride === "string" ? hashOverride : window.location.hash;
|
|
569
|
+
if (!hash) return false;
|
|
570
|
+
|
|
571
|
+
const targetId = hash.slice(1);
|
|
572
|
+
let decodedTargetId = targetId;
|
|
573
|
+
|
|
574
|
+
try {
|
|
575
|
+
decodedTargetId = decodeURIComponent(targetId);
|
|
576
|
+
} catch (_error) {}
|
|
577
|
+
|
|
578
|
+
const target =
|
|
579
|
+
document.getElementById(decodedTargetId) ||
|
|
580
|
+
document.getElementById(targetId);
|
|
581
|
+
|
|
582
|
+
if (!target) return false;
|
|
583
|
+
|
|
584
|
+
target.scrollIntoView();
|
|
585
|
+
return true;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function resetMainScroll() {
|
|
589
|
+
const main = query("#main");
|
|
590
|
+
|
|
591
|
+
if (main) {
|
|
592
|
+
main.scrollTop = 0;
|
|
593
|
+
main.scrollLeft = 0;
|
|
594
|
+
}
|
|
595
|
+
window.scrollTo(0, 0);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
function mainFocus() {
|
|
599
|
+
if (!focusHashTarget()) {
|
|
600
|
+
resetMainScroll();
|
|
601
|
+
}
|
|
602
|
+
setTimeout(() => {
|
|
603
|
+
const main = query("#main");
|
|
604
|
+
if (main) main.focus();
|
|
605
|
+
}, 10);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
function navigationChange() {
|
|
609
|
+
if (appState.navigationChangeBound) return;
|
|
610
|
+
|
|
611
|
+
window.addEventListener("popstate", () => {
|
|
612
|
+
navigateTo(window.location.href, {
|
|
613
|
+
pushHistory: false,
|
|
614
|
+
syncNav: true,
|
|
615
|
+
});
|
|
616
|
+
});
|
|
617
|
+
appState.navigationChangeBound = true;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function sameDocumentUrl(left, right) {
|
|
621
|
+
const leftUrl = new URL(left, window.location.href);
|
|
622
|
+
const rightUrl = new URL(right, window.location.href);
|
|
623
|
+
|
|
624
|
+
return (
|
|
625
|
+
leftUrl.origin === rightUrl.origin &&
|
|
626
|
+
leftUrl.pathname === rightUrl.pathname &&
|
|
627
|
+
leftUrl.search === rightUrl.search
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
function contentPageUrl(url) {
|
|
632
|
+
const pageUrl = new URL(url, window.location.href);
|
|
633
|
+
|
|
634
|
+
pageUrl.hash = "";
|
|
635
|
+
return pageUrl.href;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function updatePageState(doc, pageWindow) {
|
|
639
|
+
const nextMain = doc.querySelector("#main");
|
|
640
|
+
const currentMain = query("#main");
|
|
641
|
+
const currentClassListLink = query("#class_list_link");
|
|
642
|
+
const currentClassListClassName = currentClassListLink
|
|
643
|
+
? currentClassListLink.className
|
|
644
|
+
: null;
|
|
645
|
+
|
|
646
|
+
if (!nextMain || !currentMain) return false;
|
|
647
|
+
|
|
648
|
+
currentMain.innerHTML = nextMain.innerHTML;
|
|
649
|
+
document.title = doc.title;
|
|
650
|
+
|
|
651
|
+
if (currentClassListClassName && query("#class_list_link")) {
|
|
652
|
+
query("#class_list_link").className = currentClassListClassName;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
if (pageWindow && typeof pageWindow.pathId !== "undefined") {
|
|
656
|
+
pathId = pageWindow.pathId;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
if (pageWindow && typeof pageWindow.relpath !== "undefined") {
|
|
660
|
+
relpath = pageWindow.relpath;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
return true;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function pageLoaderFrame() {
|
|
667
|
+
let frame = query("#page_loader");
|
|
668
|
+
|
|
669
|
+
if (frame) return frame;
|
|
670
|
+
|
|
671
|
+
frame = document.createElement("iframe");
|
|
672
|
+
frame.id = "page_loader";
|
|
673
|
+
frame.setAttribute("aria-hidden", "true");
|
|
674
|
+
frame.setAttribute("tabindex", "-1");
|
|
675
|
+
frame.style.display = "none";
|
|
676
|
+
document.body.appendChild(frame);
|
|
677
|
+
return frame;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
function completeNavigation(url, options, pageWindow, pageDocument) {
|
|
681
|
+
const targetUrl = new URL(url, window.location.href);
|
|
682
|
+
|
|
683
|
+
if (!updatePageState(pageDocument, pageWindow)) return false;
|
|
684
|
+
|
|
685
|
+
window.__app({ rehydrateNav: false });
|
|
686
|
+
|
|
687
|
+
if (options.syncNav && typeof pathId !== "undefined") {
|
|
688
|
+
expandNavPath(pathId);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (targetUrl.hash) {
|
|
692
|
+
focusHashTarget(targetUrl.hash);
|
|
693
|
+
} else {
|
|
694
|
+
resetMainScroll();
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
if (options.pushHistory) {
|
|
698
|
+
history.pushState({}, document.title, targetUrl.href);
|
|
699
|
+
}
|
|
700
|
+
appState.currentUrl = targetUrl.href;
|
|
701
|
+
|
|
702
|
+
return true;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
function navigateTo(url, options) {
|
|
706
|
+
const navigationOptions = Object.assign(
|
|
707
|
+
{ pushHistory: true, syncNav: false },
|
|
708
|
+
options || {},
|
|
709
|
+
);
|
|
710
|
+
const navigationId = ++appState.latestNavigationId;
|
|
711
|
+
const loader = pageLoaderFrame();
|
|
712
|
+
const resolvedUrl = new URL(url, window.location.href).href;
|
|
713
|
+
const loaderUrl = contentPageUrl(resolvedUrl);
|
|
714
|
+
|
|
715
|
+
if (sameDocumentUrl(appState.currentUrl, resolvedUrl)) {
|
|
716
|
+
const resolvedTargetUrl = new URL(resolvedUrl);
|
|
717
|
+
|
|
718
|
+
if (navigationOptions.pushHistory) {
|
|
719
|
+
history.pushState({}, document.title, resolvedUrl);
|
|
720
|
+
}
|
|
721
|
+
appState.currentUrl = resolvedUrl;
|
|
722
|
+
if (resolvedTargetUrl.hash) {
|
|
723
|
+
focusHashTarget(resolvedTargetUrl.hash);
|
|
724
|
+
} else {
|
|
725
|
+
resetMainScroll();
|
|
726
|
+
}
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
scheduleMainLoading(navigationId);
|
|
731
|
+
|
|
732
|
+
loader.onload = () => {
|
|
733
|
+
let pageWindow;
|
|
734
|
+
let pageDocument;
|
|
735
|
+
let completed = false;
|
|
736
|
+
|
|
737
|
+
if (navigationId !== appState.latestNavigationId) return;
|
|
738
|
+
|
|
739
|
+
try {
|
|
740
|
+
pageWindow = loader.contentWindow;
|
|
741
|
+
pageDocument = loader.contentDocument || pageWindow.document;
|
|
742
|
+
completed = completeNavigation(
|
|
743
|
+
resolvedUrl,
|
|
744
|
+
navigationOptions,
|
|
745
|
+
pageWindow,
|
|
746
|
+
pageDocument,
|
|
747
|
+
);
|
|
748
|
+
} catch (_error) {
|
|
749
|
+
window.location.href = resolvedUrl;
|
|
750
|
+
return;
|
|
751
|
+
} finally {
|
|
752
|
+
if (navigationId === appState.latestNavigationId) {
|
|
753
|
+
cancelMainLoading();
|
|
754
|
+
}
|
|
755
|
+
if (completed) {
|
|
756
|
+
loader.onload = null;
|
|
757
|
+
loader.removeAttribute("src");
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
loader.src = loaderUrl;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
window.__app = (options) => {
|
|
766
|
+
const appOptions = options || {};
|
|
767
|
+
ready(() => {
|
|
768
|
+
navResizer();
|
|
769
|
+
navExpander(appOptions.rehydrateNav !== false);
|
|
770
|
+
createSourceLinks();
|
|
771
|
+
createDefineLinks();
|
|
772
|
+
createFullTreeLinks();
|
|
773
|
+
searchFrameButtons();
|
|
774
|
+
linkSummaries();
|
|
775
|
+
summaryToggle();
|
|
776
|
+
constantSummaryToggle();
|
|
777
|
+
generateTOC();
|
|
778
|
+
mainFocus();
|
|
779
|
+
navigationChange();
|
|
780
|
+
});
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
window.__app();
|
|
784
|
+
|
|
785
|
+
if (!appState.navigationListenerBound) {
|
|
786
|
+
window.addEventListener(
|
|
787
|
+
"message",
|
|
788
|
+
(event) => {
|
|
789
|
+
if (!event.data || event.data.action !== "navigate") return;
|
|
790
|
+
|
|
791
|
+
navigateTo(event.data.url, {
|
|
792
|
+
pushHistory: true,
|
|
793
|
+
syncNav: false,
|
|
794
|
+
});
|
|
795
|
+
},
|
|
796
|
+
false,
|
|
797
|
+
);
|
|
798
|
+
|
|
799
|
+
appState.navigationListenerBound = true;
|
|
800
|
+
}
|
|
640
801
|
})();
|