cocoto / glpk-online

Html interface for GLPK.js solver
https://cocoto.github.io/glpk-online/
GNU General Public License v2.0
12 stars 6 forks source link

Feature request: pre-fill model field with content from URL, store model in URL #6

Closed ojdo closed 5 years ago

ojdo commented 5 years ago

And now the obligatory feature request: as most models which one would like to solve in the browser happen to be rather short (<2 kB), one could store them in the page's URL. That way, one can store (bookmark) and share (send a long URL) models easily.

https://cocoto.github.io/glpk-online/?m=minimize%20obj:...#

Sketch: a button encodes the current content of the text field URL-safe and sets the current URL with a parameter. On initial page load, if m=... is set, pre-fill the editor with the decoded string.

Would you be fine with a MR that adds this behaviour?

cocoto commented 5 years ago

Yes of course, every proposal features are welcome ! There is already an autobackup of the model in LocalStorage, why not use the encode function for the two systems

cocoto commented 5 years ago

Added with m #7