misuzu/assets/misuzu.js/ext/eeprom.js

38 lines
1 KiB
JavaScript
Raw Normal View History

2024-01-24 21:53:26 +00:00
#include utility.js
const MszEEPROM = (() => {
let eepromScript;
return {
init: () => {
return new Promise((resolve, reject) => {
if(eepromScript !== undefined) {
resolve(false);
return;
}
if(typeof peepPath !== 'string') {
reject();
return;
}
const scriptElem = $e({
tag: 'script',
attrs: {
2024-02-02 21:42:40 +00:00
src: `${peepPath}/scripts/eepromv1a.js`,
2024-01-24 21:53:26 +00:00
charset: 'utf-8',
type: 'text/javascript',
onerror: () => reject(),
onload: () => {
eepromScript = scriptElem;
resolve(true);
},
},
});
document.body.appendChild(scriptElem);
});
},
};
})();