sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.35k stars 642 forks source link

Feature: arbitrary web link (not just dropbox) #565

Closed fordsfords closed 3 years ago

fordsfords commented 3 years ago

Hi. One (easy?) way to import from any web hosting service (e.g. GitHub) would be to just allow any arbitrary URL that is a text file. (For example, GitHub's "gh-pages" feature can be used to make text files available as directly delivered via user.github.io, rather than decorated by GitHub's UI. But really, any web hosting service can make text files available.).

pfalstad commented 3 years ago

Well there's no UI for it, but you can load any arbitrary file by specifying it in the URL when loading the page:

http://www.falstad.com/circuit/circuitjs.html?startCircuitLink=http://www.falstad.com/circuit/circuitjs50/circuits/ladder.txt

The file must be on a server that supports CORS access, and it seems that GitHub pages does.

fordsfords commented 3 years ago

Perfect! No need for a UI.

I tried it with one of my pages and it worked:

http://www.falstad.com/circuit/circuitjs.html?startCircuitLink=https://www.geeky-boy.com/test.circuitjs.txt

(That "geeky-boy.com" page is hosted on GitHub.)

Anyway, I'm good with closing this. Thanks!