From ce8553c8190f4afc0f1f013e8235d72c92043fbc Mon Sep 17 00:00:00 2001 From: Anar Date: Wed, 19 Aug 2026 14:19:35 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20pptx=20=D1=81=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BA=D0=BE=D0=B9=20=D0=B7=D0=B0=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=B7=D0=BA=D0=B8=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 3376ac5..824f7f7 100644 --- a/index.html +++ b/index.html @@ -167,11 +167,14 @@ document.addEventListener("keydown", function (e) { if (e.key === "ArrowLeft") go(-1); }); function downloadPptx() { - // Динамически загружаем библиотеку - var script = document.createElement('script'); - script.src = 'https://cdn.jsdelivr.net/npm/pptxgenjs@3.12.0/dist/pptxgen.min.js'; - script.onload = function() { - var p = new PptxGenJS(); + if (typeof PptxGenJS === 'undefined') { + alert('Загрузка библиотеки... Повторите нажатие через 3 секунды'); + var script = document.createElement('script'); + script.src = 'https://cdn.jsdelivr.net/npm/pptxgenjs@3.12.0/dist/pptxgen.min.js'; + document.head.appendChild(script); + return; + } + var p = new PptxGenJS(); p.defineLayout({ name: "W", width: 13.33, height: 7.5 }); p.layout = "W"; SLIDES.forEach(function (s) { @@ -181,9 +184,7 @@ function downloadPptx() { sl.addText(s.bullets.map(function (b) { return { text: b, options: { bullet: true, breakLine: true } }; }), { x: 0.9, y: 1.8, w: 11.5, h: 5.2, fontSize: 16, color: "E4E4E7", lineSpacingMultiple: 1.3 }); }); - p.writeFile({ fileName: "Juniper_RE_Complete_Guide.pptx" }); - }; - document.head.appendChild(script); + p.writeFile({ fileName: "Juniper_RE_Complete_Guide.pptx" }); } render();