|
275 | 275 | } |
276 | 276 | </style> |
277 | 277 | <script> |
| 278 | + // functions related to foldable algorithm parts |
| 279 | + |
278 | 280 | (function() { |
279 | 281 | function beforePrint() { |
280 | 282 | console.debug("opening details before printing"); |
|
316 | 318 | // using events |
317 | 319 | window.addEventListener('beforeprint', beforePrint); |
318 | 320 | window.addEventListener('afterprint', afterPrint); |
| 321 | + window.addEventListener('load', function() { |
| 322 | + console.debug("coucou"); |
| 323 | + document.getElementById('fold-all-algorithms').addEventListener('click', function() { |
| 324 | + var algoDetails = document.querySelectorAll('.algorithm details'); |
| 325 | + for (var dt of algoDetails) { |
| 326 | + dt.open = false; |
| 327 | + } |
| 328 | + console.debug("fold"); |
| 329 | + }); |
| 330 | + document.getElementById('unfold-all-algorithms').addEventListener('click', function() { |
| 331 | + var algoDetails = document.querySelectorAll('.algorithm details'); |
| 332 | + for (var dt of algoDetails) { |
| 333 | + dt.open = true; |
| 334 | + } |
| 335 | + console.debug("unfold"); |
| 336 | + }); |
| 337 | + console.debug("coucou"); |
| 338 | + }); |
319 | 339 | })(); |
320 | 340 | </script> |
321 | 341 | </head> |
@@ -396,6 +416,20 @@ <h2>Contributing</h2> |
396 | 416 | <section class="informative"> |
397 | 417 | <h2>Typographical conventions</h2> |
398 | 418 | <div data-include="common/typographical-conventions.html"></div> |
| 419 | + |
| 420 | + <section> |
| 421 | + <h3>Summarized algorithm sections</h3> |
| 422 | + <p>In order to make the algorithms easier to read, |
| 423 | + some parts of them are initially hidden and replaced by a short summary. |
| 424 | + Clicking on that summary will toggle between detailed and summarised view. |
| 425 | + Using the buttons below, you can display or hide the details in all algorithms at once. |
| 426 | + Note that, when printing, all details are always shown. |
| 427 | + </p> |
| 428 | + <p> |
| 429 | + <button id="unfold-all-algorithms">Show all details in all algorithms</button> |
| 430 | + <button id="fold-all-algorithms">Hide all details in all algorithms</button> |
| 431 | + </p> |
| 432 | + </section> |
399 | 433 | </section> |
400 | 434 |
|
401 | 435 | <section class="normative"> |
|
0 commit comments