|
24 | 24 | <meta content="#000000" name="msapplication-TileColor">
|
25 | 25 | <meta content="https://assets.openshift.net/content/subdomain/touch-icon-precomposed.png" name="msapplication-TileImage">
|
26 | 26 | <%= render("_templates/_analytics.html.erb", :distro_key => distro_key) %>
|
| 27 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.9.3/html2pdf.bundle.min.js"></script> |
| 28 | + |
| 29 | + <link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined" |
| 30 | + rel="stylesheet"> |
| 31 | + <script> |
| 32 | + |
| 33 | + function getPDF() { |
| 34 | + var element = document.getElementsByClassName('main'); |
| 35 | + <% |
| 36 | + filepath = repo_path[0...-5] |
| 37 | + %> |
| 38 | + var opt = { |
| 39 | + margin: 10, |
| 40 | + filename: '<%= "#{filepath}.pdf" %>', |
| 41 | + html2canvas: { windowWidth: 650 }, |
| 42 | + image: { type: 'jpeg', quality: 0.98 } |
| 43 | + }; |
| 44 | + html2pdf().set(opt).from(element[0]).save(); |
| 45 | + } |
| 46 | + </script> |
| 47 | + |
27 | 48 | </head>
|
28 | 49 |
|
29 | 50 | <body onload="selectVersion('<%= version %>');">
|
|
102 | 123 | </li>
|
103 | 124 | <% if (distro_key != "openshift-origin" && distro_key != "openshift-aro") %>
|
104 | 125 | <span text-align="right" style="float: right !important">
|
105 |
| - <a href="https://github.com/openshift/openshift-docs/commits/<%= (distro_key == "openshift-enterprise") ? "enterprise-#{version}" : "dedicated-4" %>/<%= repo_path %>">Page history</a> |
| 126 | + <a href="https://github.com/openshift/openshift-docs/commits/<%= (distro_key == "openshift-enterprise") ? "enterprise-#{version}" : "dedicated-4" %>/<%= repo_path %>"><span class="material-icons-outlined">history</span></a> |
106 | 127 | <%
|
107 | 128 | unless (unsupported_versions.include? version)
|
108 | 129 | %>
|
109 |
| - / |
110 | 130 | <a href="https://github.com/openshift/openshift-docs/issues/new?title=<%= (distro_key == "openshift-enterprise") ? "[enterprise-#{version}] Issue in file #{repo_path}" : ((distro_key=="openshift-dedicated" ) ? "[dedicated] Issue in file #{repo_path}" : "[online] Issue in file #{repo_path}" ) %>">
|
111 |
| - Open an issue |
| 131 | + <span class="material-icons-outlined">bug_report</span> |
112 | 132 | </a>
|
| 133 | + <a href="javascript: void(0);" onclick="getPDF();"><span class="material-icons-outlined">picture_as_pdf</span></a> |
113 | 134 | <% if (version == "4.5") %>
|
114 | 135 | /
|
115 | 136 | <select onchange="selectLang(this);">
|
|
341 | 362 | <script type="text/javascript">
|
342 | 363 | window.addEventListener('DOMContentLoaded', () => {
|
343 | 364 | window.addEventListener("wheel", () => {
|
344 |
| - |
| 365 | + |
345 | 366 | const ioConfiguration = {
|
346 | 367 | "rootMargin": "-120px 0px -400px 0px",
|
347 | 368 | "threshold": 0
|
|
370 | 391 | document.querySelector(`#toc li a[href="#${i.target.id}"]`).classList.add('toc-active')
|
371 | 392 | }
|
372 | 393 | })
|
373 |
| - } |
| 394 | + } |
374 | 395 | };
|
375 | 396 |
|
376 | 397 | //make clicked toc item active and stop IntersectionObserver
|
|
435 | 456 | };
|
436 | 457 | };
|
437 | 458 | if(document.documentElement.scrollHeight != window.pageYOffset + window.innerHeight) {
|
438 |
| - sidebar.style.marginBottom = "0px"; |
| 459 | + sidebar.style.marginBottom = "0px"; |
439 | 460 | toc.style.bottom = "0px";
|
440 | 461 | }
|
441 | 462 | }
|
|
454 | 475 | document.querySelector('#support-alert').style.position = "fixed";
|
455 | 476 | document.querySelector('#support-alert').style.bottom = "0px";
|
456 | 477 | document.querySelector('#support-alert').style.margin = "5px";
|
457 |
| - document.querySelector('#support-alert').style.zIndex = "9999999"; |
458 |
| - } |
| 478 | + document.querySelector('#support-alert').style.zIndex = "9999999"; |
| 479 | + } |
459 | 480 | }
|
460 | 481 | }
|
461 | 482 | });
|
|
465 | 486 | document.querySelector('#support-alert').style.removeProperty('position');
|
466 | 487 | document.querySelector('#support-alert').style.removeProperty('bottom');
|
467 | 488 | document.querySelector('#support-alert').style.removeProperty('margin');
|
468 |
| - document.querySelector('#support-alert').style.removeProperty('zIndex'); |
| 489 | + document.querySelector('#support-alert').style.removeProperty('zIndex'); |
469 | 490 | }
|
470 | 491 | }
|
471 | 492 | })
|
|
0 commit comments