diff options
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/buttons.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/buttons.js b/src/client/buttons.js index a7b12ffc..cb7f70b1 100644 --- a/src/client/buttons.js +++ b/src/client/buttons.js @@ -14,9 +14,13 @@ $('.save a').click(function(){ }); $('#btn_export').click(function() { - var json = rz_core.main_graph.save_to_json(); - var filename = 'graph.json'; - var blob = new Blob([json], {type: 'application/json'}); + var json = rz_core.main_graph.save_to_json(), + blob = new Blob([json], {type: 'application/json'}), + now = new Date(), + date_string = ('' + now.getYear() + now.getMonth() + now.getDay() + '-' + + now.getHours() + now.getMinutes() + now.getSeconds()), + filename = rz_config.rzdoc_cur__name + '-' + date_string + '.json'; + console.log('saving ' + json.length + ' bytes to ' + filename); saveAs(blob, filename); }); |
