fix: скачивание pptx с авто-загрузкой

This commit is contained in:
Anar 2026-08-19 14:21:09 +00:00
parent ce8553c819
commit 91ef13bc5b

View File

@ -167,13 +167,18 @@ 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') { if (typeof PptxGenJS !== 'undefined') {
alert('Загрузка библиотеки... Повторите нажатие через 3 секунды'); createPptx();
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; 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";