add options to load_url for grouping and file name

This commit is contained in:
Stewart Allen 2021-09-05 11:07:15 -04:00
commit 9e89eef250
2 changed files with 4 additions and 4 deletions

View file

@ -9,7 +9,7 @@
function load(url, options = {}) {
return new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest();
let file = (((url.split('?')[0]).split('#')[0]).split('/')).pop();
let file = options.file || options.filename || (((url.split('?')[0]).split('#')[0]).split('/')).pop();
let ext = file.split('.').pop().toLowerCase();
let deftype = ext === "obj" ? "text" : "arraybuffer";
let datatype = options.datatype || deftype;