Skip to content

Commit 5038b9b

Browse files
committed
Deploying to gh-pages from @ 2087b3f 🚀
1 parent 89535ea commit 5038b9b

22 files changed

+331
-99
lines changed

unstable/404.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
const path_to_root = "";
3838
const default_light_theme = "light";
3939
const default_dark_theme = "navy";
40+
window.path_to_searchindex_js = "searchindex.js";
4041
</script>
4142
<!-- Start loading toc.js asap -->
4243
<script src="toc.js"></script>
@@ -93,10 +94,13 @@ <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
9394
sidebar = sidebar || 'visible';
9495
} else {
9596
sidebar = 'hidden';
97+
sidebar_toggle.checked = false;
98+
}
99+
if (sidebar === 'visible') {
100+
sidebar_toggle.checked = true;
101+
} else {
102+
html.classList.remove('sidebar-visible');
96103
}
97-
sidebar_toggle.checked = sidebar === 'visible';
98-
html.classList.remove('sidebar-visible');
99-
html.classList.add("sidebar-" + sidebar);
100104
</script>
101105

102106
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
@@ -147,7 +151,12 @@ <h1 class="menu-title">Fernglas Manual</h1>
147151

148152
<div id="search-wrapper" class="hidden">
149153
<form id="searchbar-outer" class="searchbar-outer">
150-
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
154+
<div class="search-wrapper">
155+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
156+
<div class="spinner-wrapper">
157+
<i class="fa fa-spinner fa-spin"></i>
158+
</div>
159+
</div>
151160
</form>
152161
<div id="searchresults-outer" class="searchresults-outer hidden">
153162
<div id="searchresults-header" class="searchresults-header"></div>
@@ -206,6 +215,7 @@ <h1 id="document-not-found-404"><a class="header" href="#document-not-found-404"
206215
<!-- Custom JS scripts -->
207216

208217

218+
209219
</div>
210220
</body>
211221
</html>

unstable/appendix/index.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39+
window.path_to_searchindex_js = "../searchindex.js";
3940
</script>
4041
<!-- Start loading toc.js asap -->
4142
<script src="../toc.js"></script>
@@ -92,10 +93,13 @@ <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
9293
sidebar = sidebar || 'visible';
9394
} else {
9495
sidebar = 'hidden';
96+
sidebar_toggle.checked = false;
97+
}
98+
if (sidebar === 'visible') {
99+
sidebar_toggle.checked = true;
100+
} else {
101+
html.classList.remove('sidebar-visible');
95102
}
96-
sidebar_toggle.checked = sidebar === 'visible';
97-
html.classList.remove('sidebar-visible');
98-
html.classList.add("sidebar-" + sidebar);
99103
</script>
100104

101105
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
@@ -146,7 +150,12 @@ <h1 class="menu-title">Fernglas Manual</h1>
146150

147151
<div id="search-wrapper" class="hidden">
148152
<form id="searchbar-outer" class="searchbar-outer">
149-
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
153+
<div class="search-wrapper">
154+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
155+
<div class="spinner-wrapper">
156+
<i class="fa fa-spinner fa-spin"></i>
157+
</div>
158+
</div>
150159
</form>
151160
<div id="searchresults-outer" class="searchresults-outer hidden">
152161
<div id="searchresults-header" class="searchresults-header"></div>
@@ -216,6 +225,7 @@ <h1 id="appendix"><a class="header" href="#appendix">Appendix</a></h1>
216225
<!-- Custom JS scripts -->
217226

218227

228+
219229
</div>
220230
</body>
221231
</html>

unstable/appendix/nixos-specialArgs-pattern.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39+
window.path_to_searchindex_js = "../searchindex.js";
3940
</script>
4041
<!-- Start loading toc.js asap -->
4142
<script src="../toc.js"></script>
@@ -92,10 +93,13 @@ <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
9293
sidebar = sidebar || 'visible';
9394
} else {
9495
sidebar = 'hidden';
96+
sidebar_toggle.checked = false;
97+
}
98+
if (sidebar === 'visible') {
99+
sidebar_toggle.checked = true;
100+
} else {
101+
html.classList.remove('sidebar-visible');
95102
}
96-
sidebar_toggle.checked = sidebar === 'visible';
97-
html.classList.remove('sidebar-visible');
98-
html.classList.add("sidebar-" + sidebar);
99103
</script>
100104

101105
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
@@ -146,7 +150,12 @@ <h1 class="menu-title">Fernglas Manual</h1>
146150

147151
<div id="search-wrapper" class="hidden">
148152
<form id="searchbar-outer" class="searchbar-outer">
149-
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
153+
<div class="search-wrapper">
154+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
155+
<div class="spinner-wrapper">
156+
<i class="fa fa-spinner fa-spin"></i>
157+
</div>
158+
</div>
150159
</form>
151160
<div id="searchresults-outer" class="searchresults-outer hidden">
152161
<div id="searchresults-header" class="searchresults-header"></div>
@@ -290,6 +299,7 @@ <h3 id="borrowed-from-here"><a class="header" href="#borrowed-from-here">Borrowe
290299
<!-- Custom JS scripts -->
291300

292301

302+
293303
</div>
294304
</body>
295305
</html>

unstable/book.js

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -515,17 +515,39 @@ aria-label="Show hidden lines"></button>';
515515
})();
516516

517517
(function sidebar() {
518-
const body = document.querySelector('body');
519518
const sidebar = document.getElementById('sidebar');
520519
const sidebarLinks = document.querySelectorAll('#sidebar a');
521520
const sidebarToggleButton = document.getElementById('sidebar-toggle');
522-
const sidebarToggleAnchor = document.getElementById('sidebar-toggle-anchor');
523521
const sidebarResizeHandle = document.getElementById('sidebar-resize-handle');
522+
const sidebarCheckbox = document.getElementById('sidebar-toggle-anchor');
524523
let firstContact = null;
525524

525+
526+
/* Because we cannot change the `display` using only CSS after/before the transition, we
527+
need JS to do it. We change the display to prevent the browsers search to find text inside
528+
the collapsed sidebar. */
529+
if (!document.documentElement.classList.contains('sidebar-visible')) {
530+
sidebar.style.display = 'none';
531+
}
532+
sidebar.addEventListener('transitionend', () => {
533+
/* We only change the display to "none" if we're collapsing the sidebar. */
534+
if (!sidebarCheckbox.checked) {
535+
sidebar.style.display = 'none';
536+
}
537+
});
538+
sidebarToggleButton.addEventListener('click', () => {
539+
/* To allow the sidebar expansion animation, we first need to put back the display. */
540+
if (!sidebarCheckbox.checked) {
541+
sidebar.style.display = '';
542+
// Workaround for Safari skipping the animation when changing
543+
// `display` and a transform in the same event loop. This forces a
544+
// reflow after updating the display.
545+
sidebar.offsetHeight;
546+
}
547+
});
548+
526549
function showSidebar() {
527-
body.classList.remove('sidebar-hidden');
528-
body.classList.add('sidebar-visible');
550+
document.documentElement.classList.add('sidebar-visible');
529551
Array.from(sidebarLinks).forEach(function(link) {
530552
link.setAttribute('tabIndex', 0);
531553
});
@@ -539,8 +561,7 @@ aria-label="Show hidden lines"></button>';
539561
}
540562

541563
function hideSidebar() {
542-
body.classList.remove('sidebar-visible');
543-
body.classList.add('sidebar-hidden');
564+
document.documentElement.classList.remove('sidebar-visible');
544565
Array.from(sidebarLinks).forEach(function(link) {
545566
link.setAttribute('tabIndex', -1);
546567
});
@@ -554,8 +575,8 @@ aria-label="Show hidden lines"></button>';
554575
}
555576

556577
// Toggle sidebar
557-
sidebarToggleAnchor.addEventListener('change', function sidebarToggle() {
558-
if (sidebarToggleAnchor.checked) {
578+
sidebarCheckbox.addEventListener('change', function sidebarToggle() {
579+
if (sidebarCheckbox.checked) {
559580
const current_width = parseInt(
560581
document.documentElement.style.getPropertyValue('--sidebar-target-width'), 10);
561582
if (current_width < 150) {
@@ -572,14 +593,14 @@ aria-label="Show hidden lines"></button>';
572593
function initResize() {
573594
window.addEventListener('mousemove', resize, false);
574595
window.addEventListener('mouseup', stopResize, false);
575-
body.classList.add('sidebar-resizing');
596+
document.documentElement.classList.add('sidebar-resizing');
576597
}
577598
function resize(e) {
578599
let pos = e.clientX - sidebar.offsetLeft;
579600
if (pos < 20) {
580601
hideSidebar();
581602
} else {
582-
if (body.classList.contains('sidebar-hidden')) {
603+
if (!document.documentElement.classList.contains('sidebar-visible')) {
583604
showSidebar();
584605
}
585606
pos = Math.min(pos, window.innerWidth - 100);
@@ -588,7 +609,7 @@ aria-label="Show hidden lines"></button>';
588609
}
589610
//on mouseup remove windows functions mousemove & mouseup
590611
function stopResize() {
591-
body.classList.remove('sidebar-resizing');
612+
document.documentElement.classList.remove('sidebar-resizing');
592613
window.removeEventListener('mousemove', resize, false);
593614
window.removeEventListener('mouseup', stopResize, false);
594615
}
@@ -765,7 +786,7 @@ aria-label="Show hidden lines"></button>';
765786
let scrollTop = document.scrollingElement.scrollTop;
766787
let prevScrollTop = scrollTop;
767788
const minMenuY = -menu.clientHeight - 50;
768-
// When the script loads, the page can be at any scroll (e.g. if you reforesh it).
789+
// When the script loads, the page can be at any scroll (e.g. if you refresh it).
769790
menu.style.top = scrollTop + 'px';
770791
// Same as parseInt(menu.style.top.slice(0, -2), but faster
771792
let topCache = menu.style.top.slice(0, -2);

unstable/configuration/bgp-bird2.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39+
window.path_to_searchindex_js = "../searchindex.js";
3940
</script>
4041
<!-- Start loading toc.js asap -->
4142
<script src="../toc.js"></script>
@@ -92,10 +93,13 @@ <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
9293
sidebar = sidebar || 'visible';
9394
} else {
9495
sidebar = 'hidden';
96+
sidebar_toggle.checked = false;
97+
}
98+
if (sidebar === 'visible') {
99+
sidebar_toggle.checked = true;
100+
} else {
101+
html.classList.remove('sidebar-visible');
95102
}
96-
sidebar_toggle.checked = sidebar === 'visible';
97-
html.classList.remove('sidebar-visible');
98-
html.classList.add("sidebar-" + sidebar);
99103
</script>
100104

101105
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
@@ -146,7 +150,12 @@ <h1 class="menu-title">Fernglas Manual</h1>
146150

147151
<div id="search-wrapper" class="hidden">
148152
<form id="searchbar-outer" class="searchbar-outer">
149-
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
153+
<div class="search-wrapper">
154+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
155+
<div class="spinner-wrapper">
156+
<i class="fa fa-spinner fa-spin"></i>
157+
</div>
158+
</div>
150159
</form>
151160
<div id="searchresults-outer" class="searchresults-outer hidden">
152161
<div id="searchresults-header" class="searchresults-header"></div>
@@ -238,6 +247,7 @@ <h1 id="bird2-using-bgp"><a class="header" href="#bird2-using-bgp">bird2 using B
238247
<!-- Custom JS scripts -->
239248

240249

250+
241251
</div>
242252
</body>
243253
</html>

unstable/configuration/bmp-junos.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39+
window.path_to_searchindex_js = "../searchindex.js";
3940
</script>
4041
<!-- Start loading toc.js asap -->
4142
<script src="../toc.js"></script>
@@ -92,10 +93,13 @@ <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
9293
sidebar = sidebar || 'visible';
9394
} else {
9495
sidebar = 'hidden';
96+
sidebar_toggle.checked = false;
97+
}
98+
if (sidebar === 'visible') {
99+
sidebar_toggle.checked = true;
100+
} else {
101+
html.classList.remove('sidebar-visible');
95102
}
96-
sidebar_toggle.checked = sidebar === 'visible';
97-
html.classList.remove('sidebar-visible');
98-
html.classList.add("sidebar-" + sidebar);
99103
</script>
100104

101105
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
@@ -146,7 +150,12 @@ <h1 class="menu-title">Fernglas Manual</h1>
146150

147151
<div id="search-wrapper" class="hidden">
148152
<form id="searchbar-outer" class="searchbar-outer">
149-
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
153+
<div class="search-wrapper">
154+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
155+
<div class="spinner-wrapper">
156+
<i class="fa fa-spinner fa-spin"></i>
157+
</div>
158+
</div>
150159
</form>
151160
<div id="searchresults-outer" class="searchresults-outer hidden">
152161
<div id="searchresults-header" class="searchresults-header"></div>
@@ -239,6 +248,7 @@ <h1 id="junos-using-bmp"><a class="header" href="#junos-using-bmp">Junos using B
239248
<!-- Custom JS scripts -->
240249

241250

251+
242252
</div>
243253
</body>
244254
</html>

unstable/configuration/index.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39+
window.path_to_searchindex_js = "../searchindex.js";
3940
</script>
4041
<!-- Start loading toc.js asap -->
4142
<script src="../toc.js"></script>
@@ -92,10 +93,13 @@ <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
9293
sidebar = sidebar || 'visible';
9394
} else {
9495
sidebar = 'hidden';
96+
sidebar_toggle.checked = false;
97+
}
98+
if (sidebar === 'visible') {
99+
sidebar_toggle.checked = true;
100+
} else {
101+
html.classList.remove('sidebar-visible');
95102
}
96-
sidebar_toggle.checked = sidebar === 'visible';
97-
html.classList.remove('sidebar-visible');
98-
html.classList.add("sidebar-" + sidebar);
99103
</script>
100104

101105
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
@@ -146,7 +150,12 @@ <h1 class="menu-title">Fernglas Manual</h1>
146150

147151
<div id="search-wrapper" class="hidden">
148152
<form id="searchbar-outer" class="searchbar-outer">
149-
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
153+
<div class="search-wrapper">
154+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
155+
<div class="spinner-wrapper">
156+
<i class="fa fa-spinner fa-spin"></i>
157+
</div>
158+
</div>
150159
</form>
151160
<div id="searchresults-outer" class="searchresults-outer hidden">
152161
<div id="searchresults-header" class="searchresults-header"></div>
@@ -276,6 +285,7 @@ <h1 id="configuration"><a class="header" href="#configuration">Configuration</a>
276285
<!-- Custom JS scripts -->
277286

278287

288+
279289
</div>
280290
</body>
281291
</html>

0 commit comments

Comments
 (0)