diff --git a/js/explorer.js b/js/explorer.js index 44ced0cff23c93263b1252500c092820a558d2af..53672881f7d5ebca1d5a850ad0015c25ce7501e3 100644 --- a/js/explorer.js +++ b/js/explorer.js @@ -134,12 +134,11 @@ function openXML(filename, handler) { } /* exploration */ - var planet = {} ; var center_map = null ; var storage_prefix = 'Explosurf:' - + document.getElementById('planet-name').innerHTML.toLowerCase() + + document.getElementById('planet-name').innerHTML.toLowerCase().replace(/\s+/mg, '') + ':explorer' ; diff --git a/js/notes.js b/js/notes.js index 15f199671f76dc0a4d2f810c6eedbd1ef227f30c..81ff8fb52fbb1cb000a84bab517525f713f26774 100644 --- a/js/notes.js +++ b/js/notes.js @@ -11,7 +11,7 @@ /* local storage prefix */ var storage_prefix = 'Explosurf:' - + document.getElementById('planet-name').innerHTML.toLowerCase() + + document.getElementById('planet-name').innerHTML.toLowerCase().replace(/\s+/mg, '') + ':notes' ; diff --git a/js/pgm_construction.js b/js/pgm_construction.js index ea87ab3f340b5582b578a9481deb5d28eab13f3c..6e91c93c9a4b65af649a8770191e44c425e8f8e5 100644 --- a/js/pgm_construction.js +++ b/js/pgm_construction.js @@ -60,7 +60,7 @@ var has_absolute_fixed_bug = (function() { /*prefix for local storage*/ var storage_prefix = 'Explosurf:' - + document.getElementById('planet-name').innerHTML.toLowerCase() + + document.getElementById('planet-name').innerHTML.toLowerCase().replace(/\s+/mg, '') + ':pgm' ; @@ -203,47 +203,13 @@ document.getElementById('pgm-load-local').addEventListener( } ) ; -/* pack the full Explosurf data in a blob */ -var file_blob = null ; - -function generate_blob() { - local_save() ; - var data = new Blob( - [JSON.stringify(localStorage)], - {type : 'application/json'} - ) ; - if(file_blob !== null) { - window.URL.revokeObjectURL(file_blob) ; - } - file_blob = window.URL.createObjectURL(data) ; - return file_blob ; -} - -/* propose the blob for download : save all data */ +/* save all data using filesaver.js */ function blob_download() { var blob = new Blob( [JSON.stringify(localStorage)], {type : 'application/json'} ) ; saveAs(blob, 'explosurf.json') ; - /* - var link = document.createElement('a') ; - link.setAttribute('download', 'explosurf.json') ; - link.href = generate_blob() ; - document.body.appendChild(link) ; - - setTimeout(function () { - var event ; - if(typeof MouseEvent !== 'function') { - event = document.createEvent("MouseEvent"); - event.initMouseEvent("click",true,false,window,0,0,0,0,0,false,false,false,false,0,null); - } else { - event = new MouseEvent('click'); - } - link.dispatchEvent(event); - document.body.removeChild(link); - }, 66); - */ } /* load the saved data */