sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature request] ability to add user's own circuits to menu

mpictor opened this issue · comments

commented

I'd like to be able to add my own circuits to the menu, so that I can more easily go back and look at them.

My thought is to allow the user to specify a url; circuitjs loads the file at the url and turns the content into menu items. The url is stored in a cookie so the user doesn't need to re-enter it.

As far as the format for the data at the url, my thought is markdown, though with circuitjs only parsing markdown links (i.e [text](http://link)) and ignoring the rest of the file.
The text of the link would be used as the name in the menu, while the url would be data. The data could be in two forms:

  • a "circuit link", where the circuit is encoded in the url (same format as that used by File|Export as Link...)
    • detect this form by looking for circuitjs.html?ctz= within the url
  • a save file, where the link points to another file (same format as File|Save as...)

I'm a little unclear on how CSRF protections (or other security protections, for that matter) would interact with this feature. For example, would I be able to use a file directly from github as the markdown or data file? If not, my hope is that github user pages would allow it.