Board Thread:The Last Sovereign Discussion/@comment-29984007-20180410151643/@comment-35006067-20180726111942

First, https://github.com/Rachnera/calculator-save-plugin. It will make further discussions easier.

DukeLeto7 wrote: Oh, it does seem to be version independent, and that's a BIG plus.

It was the main selling point of a file-based approach (as opposed to a localStorage approach).

DukeLeto7 wrote: It works on Chrome, Firefox and Edge but not IE.

I didn't bother with IE as it appears the Calcultator itself isn't working properly on IE. I may go the extra mile if that original problem is fixed (for up-to-date IE only though, I'm not that much of a masochist).

DukeLeto7 wrote: It does deposit the save file to the Downloads folder and have the load button open a completely different folder

To be precise, the load button probably opens the last folder from which you've uploaded a file. That's the default behavior of most browsers.

There's no way to work around that limitation from within a browser. For security reasons, the browser will never allow the Javascript code to know about the user's file structure. The best JS can do is ask "give me a file from somewhere" and "save this file somewhere".

Technically, it would be possible to get the intended behavior if we were to wrap the code in our own mini-browser (with Electron for example), and therefore would be able to configure the folders as we see fit, but that may be slightly overkill.

A help button with some explanations on where the files are sounds like a more lightweight approach. Not a fan of the .lnk as this is a very windowsy approach.

DukeLeto7 wrote: I would suggest that my half finished interface linked to above would be a bit preferable if someone wants to try and unify that with Arakhne's code base.

I'm too lazy right now to dig in your code to extract the relevant HTML and CSS, but if anyone feels like improving this aspect, please do so. The code I used to generate the HTML and the CSS is there. It's quite ugly right now since I'm generating on the fly HTML tags, but at least it should be straightforward (create tags, append them, add CSS).