Skip to content

Commit

Permalink
Windows XP patch (FF 52 ESR, GC 59).
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Apr 28, 2023
1 parent f0e93e8 commit 4b2ba91
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dist/basic.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bridge.mjs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/cambiare.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions sh/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ rm -rv dist/*.map
#esbuild --bundle src/index.js --target=es6 --outfile=dist/index.es6.js --minify --sourcemap
ls -1 src | while IFS= read -r dir ; do
if [ -e "src/${dir}/index.js" ] ; then
shx live $dir --minify > /dev/null
shx live $dir --minify $1 > /dev/null
fi
if [ -e "src/${dir}/index.mjs" ] ; then
shx live $dir --minify > /dev/null
shx live $dir --minify $1 > /dev/null
fi
done
#rm -rv proxy/*.map
Expand Down
2 changes: 1 addition & 1 deletion sh/live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ if [ -e "src/${1:-default}/index.mjs" ] ; then
format="esm"
ext="mjs"
fi
esbuild --bundle src/${1:-default}/index.${ext} $prepend $append $inject --format=$format --charset=utf8 --outfile=dist/${1:-default}.${ext} ${2:---minify-whitespace --minify-syntax --sourcemap --watch}
esbuild --bundle src/${1:-default}/index.${ext} $prepend $append $inject --format=$format --charset=utf8 --outfile=dist/${1:-default}.${ext} ${2:---minify-whitespace --minify-syntax --sourcemap --watch} $3
#cat proxy/${1:-default}.js
exit
36 changes: 36 additions & 0 deletions src/basic/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,42 @@ import {
TimedEvents
} from "../../libs/lightfelt@ltgcgo/ext/timedEvents.js";

// Compatibility for Firefox 52 ESR
{
let fileReadAs = function (blob, target) {
let reader = new FileReader();
return new Promise((success, failure) => {
reader.addEventListener("abort", () => {
failure(new Error("Blob read aborted"));
});
reader.addEventListener("error", (ev) => {
failure(reader.error || ev.data || new Error("Blob read error"));
});
reader.addEventListener("load", () => {
success(reader.result);
});
switch (target.toLowerCase()) {
case "arraybuffer":
case "buffer": {
reader.readAsArrayBuffer(blob);
break;
};
case "string":
case "text": {
reader.readAsText(blob);
break;
};
default: {
failure(new Error(`Unknown target ${target}`));
};
};
});
};
Blob.prototype.arrayBuffer = function () {
return fileReadAs(this, "arrayBuffer");
};
};

let rawToPool = function (midiJson) {
//console.debug(midiJson);
let list = new TimedEvents();
Expand Down

0 comments on commit 4b2ba91

Please sign in to comment.