1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-09-28 06:27:47 +00:00

Added pako.js library to support inflate and deflate.

This commit is contained in:
boxgaming 2024-01-13 07:18:01 -06:00
parent e4fbe9ed8b
commit 4567516347
5 changed files with 9 additions and 2 deletions

View file

@ -3,6 +3,7 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="qbjs.css"></link>
<script type="text/javascript" src="pako.2.1.0.min.js"></script>
</head>
<body onload="startProgram()" onresize="resizeScreen()">
<div id="gx-container"></div>

View file

@ -3,6 +3,7 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="qbjs.css"></link>
<script type="text/javascript" src="pako.2.1.0.min.js"></script>
</head>
<body onresize="resizeScreen()">
<div id="gx-container"><a href="#" onclick="return startProgram()" id="gx-load-screen"><span style="visibility:hidden">_</span></a></div>

View file

@ -16,6 +16,7 @@
<script type="text/javascript" src="util/jszip.min.js"></script>
<script type="text/javascript" src="util/lzutf8.js"></script>
<script type="text/javascript" src="util/shorty.min.js"></script>
<script type="text/javascript" src="util/pako.2.1.0.min.js"></script>
<script type="text/javascript" src="codemirror/dialog.js"></script>
<script type="text/javascript" src="codemirror/searchcursor.js"></script>

View file

@ -371,6 +371,8 @@ var IDE = new function() {
zip.file("qb.js", await getFile("qb.js", "text"));
zip.file("vfs.js", await getFile("vfs.js", "text"));
zip.file("pako.2.1.0.min.js", await getFile("util/pako.2.1.0.min.js"));
zip.file("gx/gx.js", await getFile("gx/gx.js", "text"));
zip.file("gx/__gx_font_default.png", await getFile("gx/__gx_font_default.png", "blob"));
zip.file("gx/__gx_font_default_black.png", await getFile("gx/__gx_font_default_black.png", "blob"));
@ -380,7 +382,7 @@ var IDE = new function() {
var node = vfs.getNode("/");
addVFSFiles(vfs, zip, node);
zip.generateAsync({type:"blob"}).then(function(content) {
zip.generateAsync({type:"blob", compression:"DEFLATE"}).then(function(content) {
const link = document.createElement("a");
link.href = URL.createObjectURL(content);
link.download = "program.zip";
@ -426,7 +428,7 @@ var IDE = new function() {
var node = vfs.getNode("/");
addVFSFiles(vfs, zip, node);
zip.generateAsync({type:"blob"}).then(function(content) {
zip.generateAsync({type:"blob",compression:"DEFLATE"}).then(function(content) {
QB.downloadFile(content, "project.zip");
});
}

2
util/pako.2.1.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long