fix: загрузка pptxgenjs при старте

This commit is contained in:
Anar 2026-08-19 14:22:19 +00:00
parent 91ef13bc5b
commit 316894059c

View File

@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Routing Engine Juniper — Полное руководство</title> <title>Routing Engine Juniper — Полное руководство</title>
<script src="https://cdn.jsdelivr.net/npm/pptxgenjs@3.12.0/dist/pptxgen.min.js"></script>
<style> <style>
* { margin: 0; box-sizing: border-box; } * { margin: 0; box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #0f1218; color: #f4f4f5; } body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #0f1218; color: #f4f4f5; }
@ -167,18 +168,6 @@ document.addEventListener("keydown", function (e) {
if (e.key === "ArrowLeft") go(-1); if (e.key === "ArrowLeft") go(-1);
}); });
function downloadPptx() { function downloadPptx() {
if (typeof PptxGenJS !== 'undefined') {
createPptx();
return;
}
var script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/pptxgenjs@3.12.0/dist/pptxgen.min.js';
script.onload = function() {
createPptx();
};
document.head.appendChild(script);
}
function createPptx() {
var p = new PptxGenJS(); var p = new PptxGenJS();
p.defineLayout({ name: "W", width: 13.33, height: 7.5 }); p.defineLayout({ name: "W", width: 13.33, height: 7.5 });
p.layout = "W"; p.layout = "W";