1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-05-12 08:00:12 +00:00

Added experimental support for gzip compressed code parameter

This commit is contained in:
boxgaming 2024-02-10 16:26:12 -06:00
parent 99b744c491
commit 0549294c7e

View file

@ -91,6 +91,13 @@ var IDE = new function() {
else if (pname == "code") {
qbcode = LZUTF8.decompress(pvalue, { inputEncoding: "Base64" });
}
else if (pname == "gzcode") {
var strData = atob(pvalue);
var charData = strData.split("").map(function(x){return x.charCodeAt(0);});
var binData = new Uint8Array(charData);
var data = pako.inflate(binData);
qbcode = String.fromCharCode.apply(null, new Uint16Array(data));
}
else if (pname == "mode") {
appMode = pvalue;
}