fix: загрузка pptxgenjs только при скачивании
This commit is contained in:
parent
755b9fc478
commit
64aa96775a
11
index.html
11
index.html
@ -4,7 +4,6 @@
|
|||||||
<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.bundle.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; }
|
||||||
@ -168,7 +167,11 @@ document.addEventListener("keydown", function (e) {
|
|||||||
if (e.key === "ArrowLeft") go(-1);
|
if (e.key === "ArrowLeft") go(-1);
|
||||||
});
|
});
|
||||||
function downloadPptx() {
|
function downloadPptx() {
|
||||||
var p = new PptxGenJS();
|
// Динамически загружаем библиотеку
|
||||||
|
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();
|
||||||
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";
|
||||||
SLIDES.forEach(function (s) {
|
SLIDES.forEach(function (s) {
|
||||||
@ -178,7 +181,9 @@ function downloadPptx() {
|
|||||||
sl.addText(s.bullets.map(function (b) { return { text: b, options: { bullet: true, breakLine: true } }; }),
|
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 });
|
{ 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" });
|
p.writeFile({ fileName: "Juniper_RE_Complete_Guide.pptx" });
|
||||||
|
};
|
||||||
|
document.head.appendChild(script);
|
||||||
}
|
}
|
||||||
render();
|
render();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user