diff options
| author | Simon Tatham <anakin@pobox.com> | 2017-09-05 20:10:16 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2017-09-05 20:56:55 +0100 |
| commit | 1bf591a5735068d1853be13c5a4255962835d5fe (patch) | |
| tree | 9b7ee6b9396ccc38ef70ca6ba377e5b25fd0df66 /html/jspage.pl | |
| parent | b31ea221673a8f49a383a4a119d6edaabd39642d (diff) | |
| download | puzzles-1bf591a5735068d1853be13c5a4255962835d5fe.zip puzzles-1bf591a5735068d1853be13c5a4255962835d5fe.tar.gz puzzles-1bf591a5735068d1853be13c5a4255962835d5fe.tar.bz2 puzzles-1bf591a5735068d1853be13c5a4255962835d5fe.tar.xz | |
Support for saving games in Javascript puzzles.
This is done by getting midend_serialise to produce the complete
saved-game file as an in-memory string buffer, and then encoding that
into a data: URI which we provide to the user as a hyperlink in a
dialog box. The hyperlink has the 'download' attribute, which means
clicking on it should automatically offer to save the file, and also
lets me specify a not-too-silly default file name.
Diffstat (limited to 'html/jspage.pl')
| -rwxr-xr-x | html/jspage.pl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/html/jspage.pl b/html/jspage.pl index f828ffe..20e2a78 100755 --- a/html/jspage.pl +++ b/html/jspage.pl @@ -209,6 +209,7 @@ ${unfinishedpara} ><li id="new">New game</li ><li id="specific">Enter game ID</li ><li id="random">Enter random seed</li +><li id="save">Download save file</li ></ul></li ><li>Type...<ul id="gametype"></ul></li ><li class="separator"></li |