Skip to content

Commit d5968a5

Browse files
Update gh-pages
Store path: /nix/store/1yh7s0j3ir4q1b1zk8vyvhi8hkdrv43h-website
1 parent 4d7ccf2 commit d5968a5

32 files changed

+278
-91
lines changed

404.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@
4242
<script src="toc.js"></script>
4343
</head>
4444
<body>
45+
<div id="mdbook-help-container">
46+
<div id="mdbook-help-popup">
47+
<h2 class="mdbook-help-title">Keyboard shortcuts</h2>
48+
<div>
49+
<p>Press <kbd></kbd> or <kbd></kbd> to navigate between chapters</p>
50+
<p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
51+
<p>Press <kbd>?</kbd> to show this help</p>
52+
<p>Press <kbd>Esc</kbd> to hide this help</p>
53+
</div>
54+
</div>
55+
</div>
4556
<div id="body-container">
4657
<!-- Work around some values being stored in localStorage wrapped in quotes -->
4758
<script>
@@ -119,7 +130,7 @@
119130
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
120131
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
121132
</ul>
122-
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
133+
<button id="search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="searchbar">
123134
<i class="fa fa-search"></i>
124135
</button>
125136
</div>

book.js

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ aria-label="Show hidden lines"></button>';
557557
sidebarToggleAnchor.addEventListener('change', function sidebarToggle() {
558558
if (sidebarToggleAnchor.checked) {
559559
const current_width = parseInt(
560-
document.documentElement.style.getPropertyValue('--sidebar-width'), 10);
560+
document.documentElement.style.getPropertyValue('--sidebar-target-width'), 10);
561561
if (current_width < 150) {
562-
document.documentElement.style.setProperty('--sidebar-width', '150px');
562+
document.documentElement.style.setProperty('--sidebar-target-width', '150px');
563563
}
564564
showSidebar();
565565
} else {
@@ -583,7 +583,7 @@ aria-label="Show hidden lines"></button>';
583583
showSidebar();
584584
}
585585
pos = Math.min(pos, window.innerWidth - 100);
586-
document.documentElement.style.setProperty('--sidebar-width', pos + 'px');
586+
document.documentElement.style.setProperty('--sidebar-target-width', pos + 'px');
587587
}
588588
}
589589
//on mouseup remove windows functions mousemove & mouseup
@@ -623,7 +623,7 @@ aria-label="Show hidden lines"></button>';
623623

624624
(function chapterNavigation() {
625625
document.addEventListener('keydown', function(e) {
626-
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
626+
if (e.altKey || e.ctrlKey || e.metaKey) {
627627
return;
628628
}
629629
if (window.search && window.search.hasFocus()) {
@@ -643,6 +643,55 @@ aria-label="Show hidden lines"></button>';
643643
window.location.href = previousButton.href;
644644
}
645645
}
646+
function showHelp() {
647+
const container = document.getElementById('mdbook-help-container');
648+
const overlay = document.getElementById('mdbook-help-popup');
649+
container.style.display = 'flex';
650+
651+
// Clicking outside the popup will dismiss it.
652+
const mouseHandler = event => {
653+
if (overlay.contains(event.target)) {
654+
return;
655+
}
656+
if (event.button !== 0) {
657+
return;
658+
}
659+
event.preventDefault();
660+
event.stopPropagation();
661+
document.removeEventListener('mousedown', mouseHandler);
662+
hideHelp();
663+
};
664+
665+
// Pressing esc will dismiss the popup.
666+
const escapeKeyHandler = event => {
667+
if (event.key === 'Escape') {
668+
event.preventDefault();
669+
event.stopPropagation();
670+
document.removeEventListener('keydown', escapeKeyHandler, true);
671+
hideHelp();
672+
}
673+
};
674+
document.addEventListener('keydown', escapeKeyHandler, true);
675+
document.getElementById('mdbook-help-container')
676+
.addEventListener('mousedown', mouseHandler);
677+
}
678+
function hideHelp() {
679+
document.getElementById('mdbook-help-container').style.display = 'none';
680+
}
681+
682+
// Usually needs the Shift key to be pressed
683+
switch (e.key) {
684+
case '?':
685+
e.preventDefault();
686+
showHelp();
687+
break;
688+
}
689+
690+
// Rest of the keys are only active when the Shift key is not pressed
691+
if (e.shiftKey) {
692+
return;
693+
}
694+
646695
switch (e.key) {
647696
case 'ArrowRight':
648697
e.preventDefault();

budget_buy_one.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Language,CPU,Memory
22
Plutarch,13525181,32227
33
Aiken,13389768,28583
4-
PlutusTx,334948111,1379416
4+
PlutusTx,324804111,1316016

budget_buy_one.png

-18 Bytes
Loading

budget_cancel_one.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Language,CPU,Memory
22
Plutarch,8216257,24229
33
Aiken,7142519,22591
4-
PlutusTx,138764847,579120
4+
PlutusTx,134380847,551720

budget_cancel_one.png

-9 Bytes
Loading

budget_deposit.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Language,CPU,Memory
2-
Plutarch,102846505,230681
2+
Plutarch,102798505,230381
33
Aiken,81975434,241842
4-
PlutusTx,328569786,1521400
4+
PlutusTx,318441786,1458100

budget_deposit.png

7 Bytes
Loading

budget_lp_mint_one_nft.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Language,CPU,Memory
22
Plutarch,17797661,47962
33
Aiken,17366314,56974
4-
PlutusTx,65739767,276544
4+
PlutusTx,62411767,255744

budget_lp_mint_one_nft.png

11 Bytes
Loading

0 commit comments

Comments
 (0)