Skip to content

Commit 8f75982

Browse files
author
IOHK
committed
Update gh-pages for f104621
1 parent 333673f commit 8f75982

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+612
-180
lines changed

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">Haskell.nix</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>

architecture.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">Haskell.nix</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>
@@ -272,6 +281,7 @@ <h2 id="stackagenix"><a class="header" href="#stackagenix"><a href="https://gith
272281
<!-- Custom JS scripts -->
273282

274283

284+
275285
</div>
276286
</body>
277287
</html>

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);

changelog.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">Haskell.nix</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>
@@ -615,6 +624,7 @@ <h2 id="mar-15-2019"><a class="header" href="#mar-15-2019">Mar 15, 2019</a></h2>
615624
<!-- Custom JS scripts -->
616625

617626

627+
618628
</div>
619629
</body>
620630
</html>

css/chrome.css

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,34 @@ mark.fade-out {
344344
max-width: var(--content-max-width);
345345
}
346346

347+
#searchbar-outer.searching #searchbar {
348+
padding-right: 30px;
349+
}
350+
#searchbar-outer .spinner-wrapper {
351+
display: none;
352+
}
353+
#searchbar-outer.searching .spinner-wrapper {
354+
display: block;
355+
}
356+
357+
.search-wrapper {
358+
position: relative;
359+
}
360+
361+
.spinner-wrapper {
362+
--spinner-margin: 2px;
363+
position: absolute;
364+
margin-block-start: calc(var(--searchbar-margin-block-start) + var(--spinner-margin));
365+
right: var(--spinner-margin);
366+
top: 0;
367+
bottom: var(--spinner-margin);
368+
padding: 6px;
369+
background-color: var(--bg);
370+
}
371+
347372
#searchbar {
348373
width: 100%;
349-
margin-block-start: 5px;
374+
margin-block-start: var(--searchbar-margin-block-start);
350375
margin-block-end: 0;
351376
margin-inline-start: auto;
352377
margin-inline-end: auto;
@@ -505,7 +530,6 @@ html:not(.sidebar-resizing) .sidebar {
505530
/* sidebar-hidden */
506531
#sidebar-toggle-anchor:not(:checked) ~ .sidebar {
507532
transform: translateX(calc(0px - var(--sidebar-width) - var(--sidebar-resize-indicator-width)));
508-
z-index: -1;
509533
}
510534
[dir=rtl] #sidebar-toggle-anchor:not(:checked) ~ .sidebar {
511535
transform: translateX(calc(var(--sidebar-width) + var(--sidebar-resize-indicator-width)));

css/general.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ h6:target::before {
8686
box-sizing: border-box;
8787
background-color: var(--bg);
8888
}
89-
.no-js .page-wrapper,
89+
html:not(.js) .page-wrapper,
9090
.js:not(.sidebar-resizing) .page-wrapper {
9191
transition: margin-left 0.3s ease, transform 0.3s ease; /* Animation: slide away */
9292
}
93-
[dir=rtl] .js:not(.sidebar-resizing) .page-wrapper {
93+
[dir=rtl]:not(.js) .page-wrapper,
94+
[dir=rtl].js:not(.sidebar-resizing) .page-wrapper {
9495
transition: margin-right 0.3s ease, transform 0.3s ease; /* Animation: slide away */
9596
}
9697

css/variables.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
--menu-bar-height: 50px;
1212
--mono-font: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
1313
--code-font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */
14+
--searchbar-margin-block-start: 5px;
1415
}
1516

1617
/* Themes */

dev/adding-new-ghc.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">Haskell.nix</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>
@@ -237,6 +246,7 @@ <h2 id="add-the-materialized-files"><a class="header" href="#add-the-materialize
237246
<!-- Custom JS scripts -->
238247

239248

249+
240250
</div>
241251
</body>
242252
</html>

0 commit comments

Comments
 (0)