quixe
quixe copied to clipboard
gi_load.js interacts with the DOM
The intent of Quixe is that it should work as a module, delegating all DOM manipulation to glkote.js.
However, there are places in gi_load.js where this breaks down.
- The absolutize() function relies on a DOM trick.
- unpack_blorb() uses jQuery to decode HTML text data (the metadata chunk) into a dict.
- unpack_blorb() uses jQuery in various ways to get JS code loaded.
All of these should have alternatives when running, e.g., as a Node module.
The URL api will help with the first, it's a global in both browsers and Node. Actually also for making URLs for images - using blobs should make it basically as efficient as external files.
I've actually wondered if the blorb/image stuff could be moved to the GlkOte repo. Any GlkOte+RemGlk type setup will need it, but it won't need the load code.
Used the URL api for absolutize(), as noted.