quixe icon indicating copy to clipboard operation
quixe copied to clipboard

gi_load.js interacts with the DOM

Open erkyrath opened this issue 5 years ago • 2 comments

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.

erkyrath avatar Sep 10 '20 15:09 erkyrath

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.

curiousdannii avatar Sep 10 '20 23:09 curiousdannii

Used the URL api for absolutize(), as noted.

erkyrath avatar Dec 09 '20 20:12 erkyrath