-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.js
25 lines (23 loc) · 804 Bytes
/
export.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function download(data, filename, type) {
var file = new Blob([data], {type: type});
if (window.navigator.msSaveOrOpenBlob) // IE10+
window.navigator.msSaveOrOpenBlob(file, filename);
else { // Others
var a = document.createElement("a"),
url = URL.createObjectURL(file);
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
setTimeout(function() {
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}, 0);
}
}
function export_(){
let type = "text/plain;charset=utf-8",
text = $storage.speicherZellen.map((o,i)=>(o.value||0)+((i%2==0)?" ":"\n")).join(""),
file = "assembler_export_"+Date.now();
download(text,file,type);
}