fix: скачивание pptx с авто-загрузкой
This commit is contained in:
parent
ce8553c819
commit
91ef13bc5b
15
index.html
15
index.html
@ -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";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user