hrgdavor / jscadui

MIT License
30 stars 9 forks source link

feature-save-file #92

Closed hrgdavor closed 9 months ago

hrgdavor commented 9 months ago

demo: https://3d.hrg.hr/jscad/save/

like mentioned in https://github.com/hrgdavor/jscadui/issues/88#issuecomment-1906776094

feature to allow ctrl+s to save file from editors

basic flow is initally implemented for solo script in the editor,

more to do

not caused here

https://github.com/hrgdavor/jscadui/assets/2480762/31bc8ea9-180d-488f-8c57-694bc8588156

hrgdavor commented 9 months ago
  • Save a file from the browser, then edit the FILE locally. The code editor in the browser does not update.

ok, this is also fixed.

I am merging this as it seems to work ok.

currently file handling is done with mixed usage of old https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API and new https://developer.mozilla.org/en-US/docs/Web/API/File_System_API

I will open a new branch to refactor and see if drag drop and this save showSaveFilePicker can all be done using the new File_System_API