diff options
| author | Ray <[email protected]> | 2018-11-30 01:59:14 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-11-30 01:59:14 +0100 |
| commit | 3e98497003ff2ebcc6c03a3841d25f9677ec5212 (patch) | |
| tree | 900cfccb5a3809c0c9a56f06927b343d1cc6268b /games/money.html | |
| parent | 5c8e72685cb7a26381deb032dd1b9486e2ce2921 (diff) | |
| download | raylib.com-3e98497003ff2ebcc6c03a3841d25f9677ec5212.tar.gz raylib.com-3e98497003ff2ebcc6c03a3841d25f9677ec5212.zip | |
Updated game
Diffstat (limited to 'games/money.html')
| -rw-r--r-- | games/money.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/games/money.html b/games/money.html index 4e6aa1b..efc0242 100644 --- a/games/money.html +++ b/games/money.html @@ -159,6 +159,24 @@ <textarea id="output" rows="8"></textarea> + <script type='text/javascript' src="https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js/dist/FileSaver.min.js"> </script> + <script type='text/javascript'> + function SaveFileFromMEMFSToDisk(memoryFSname, localFSname) // This can be called by C/C++ code + { + var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + var data = FS.readFile(memoryFSname); + var blob; + + if (isSafari) blob = new Blob([data.buffer], {type: "application/octet-stream"}); + else blob = new Blob([data.buffer], {type: "application/octet-binary"}); + + // NOTE: SaveAs Dialog is a browser setting. For example, in Google Chrome, + // in Settings/Advanced/Downloads section you have a setting: + // 'Ask where to save each file before downloading' - which you can set true/false. + // If you enable this setting it would always ask you and bring the SaveAs Dialog + saveAs(blob, localFSname); + } + </script> <script type='text/javascript'> var statusElement = document.getElementById('status'); var progressElement = document.getElementById('progress'); |
