|
1027 | 1027 | return (targetSec === 'index' ? './' : targetSec + '.html') + hash;
|
1028 | 1028 | }
|
1029 | 1029 |
|
| 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 | +
|
1030 | 1061 | document.addEventListener('DOMContentLoaded', () => {
|
1031 | 1062 | Toolbox.init();
|
1032 | 1063 | referencePane.init();
|
|
1064 | 1095 | });
|
1065 | 1096 |
|
1066 | 1097 | 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 & 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 & Software License","number":"A","referencingIds":[],"key":"Copyright & Software License"}]}`); |
| 1099 | +;let usesMultipage = false</script><style>body { |
1068 | 1100 | display: flex;
|
1069 | 1101 | font-size: 18px;
|
1070 | 1102 | line-height: 1.5;
|
|
2208 | 2240 | .normative-optional-tag a {
|
2209 | 2241 | color: #884400;
|
2210 | 2242 | }
|
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 & Software License"><span class="secnum">A</span> Copyright & 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 & Software License"><span class="secnum">A</span> Copyright & 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> |
2212 | 2244 |
|
2213 | 2245 | <emu-clause id="sec-demo-clause">
|
2214 | 2246 | <h1><span class="secnum">1</span> This is an emu-clause</h1>
|
|
0 commit comments