Skip to content

Commit 7445343

Browse files
committed
fixup: [spec] npm run build
1 parent 8536e07 commit 7445343

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

index.html

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,37 @@
10271027
return (targetSec === 'index' ? './' : targetSec + '.html') + hash;
10281028
}
10291029
1030+
function doShortcut(e) {
1031+
if (!(e.target instanceof HTMLElement)) {
1032+
return;
1033+
}
1034+
let target = e.target;
1035+
let name = target.nodeName.toLowerCase();
1036+
if (name === 'textarea' || name === 'input' || name === 'select' || target.isContentEditable) {
1037+
return;
1038+
}
1039+
if (e.key === 'm' && !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey && usesMultipage) {
1040+
let pathParts = location.pathname.split('/');
1041+
let hash = location.hash;
1042+
if (pathParts[pathParts.length - 2] === 'multipage') {
1043+
if (hash === '') {
1044+
let sectionName = pathParts[pathParts.length - 1];
1045+
if (sectionName.endsWith('.html')) {
1046+
sectionName = sectionName.slice(0, -5);
1047+
}
1048+
if (idToSection['sec-' + sectionName] !== undefined) {
1049+
hash = '#sec-' + sectionName;
1050+
}
1051+
}
1052+
location = pathParts.slice(0, -2).join('/') + '/' + hash;
1053+
} else {
1054+
location = 'multipage/' + hash;
1055+
}
1056+
}
1057+
}
1058+
1059+
document.addEventListener('keypress', doShortcut);
1060+
10301061
document.addEventListener('DOMContentLoaded', () => {
10311062
Toolbox.init();
10321063
referencePane.init();
@@ -1064,7 +1095,8 @@
10641095
});
10651096
10661097
let sdoMap = JSON.parse(`{}`);
1067-
let biblio = JSON.parse(`{"refsByClause":{"sec-demo-clause":["_ref_0"]},"entries":[{"type":"clause","id":"sec-demo-clause","aoid":null,"titleHTML":"This is an emu-clause","number":"1","referencingIds":[],"key":"This is an emu-clause"},{"type":"clause","id":"sec-copyright-and-software-license","aoid":null,"titleHTML":"Copyright &amp; Software License","number":"A","referencingIds":[],"key":"Copyright & Software License"}]}`);</script><style>body {
1098+
let biblio = JSON.parse(`{"refsByClause":{"sec-demo-clause":["_ref_0"]},"entries":[{"type":"clause","id":"sec-demo-clause","aoid":null,"titleHTML":"This is an emu-clause","number":"1","referencingIds":[],"key":"This is an emu-clause"},{"type":"clause","id":"sec-copyright-and-software-license","aoid":null,"titleHTML":"Copyright &amp; Software License","number":"A","referencingIds":[],"key":"Copyright & Software License"}]}`);
1099+
;let usesMultipage = false</script><style>body {
10681100
display: flex;
10691101
font-size: 18px;
10701102
line-height: 1.5;
@@ -2208,7 +2240,7 @@
22082240
.normative-optional-tag a {
22092241
color: #884400;
22102242
}
2211-
</style></head><body><div id="menu-toggle">☰</div><div id="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-demo-clause" title="This is an emu-clause"><span class="secnum">1</span> This is an emu-clause</a></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage -1 Draft / March 29, 2021</h1><h1 class="title">Proposal Title Goes Here</h1>
2243+
</style></head><body><div id="menu-toggle">☰</div><div id="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-demo-clause" title="This is an emu-clause"><span class="secnum">1</span> This is an emu-clause</a></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version">Stage -1 Draft / August 18, 2021</h1><h1 class="title">Proposal Title Goes Here</h1>
22122244

22132245
<emu-clause id="sec-demo-clause">
22142246
<h1><span class="secnum">1</span> This is an emu-clause</h1>

0 commit comments

Comments
 (0)