Skip to content

Commit a1d48d0

Browse files
save file
1 parent 03aef70 commit a1d48d0

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

utils/misc/zip/zip.html

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367

368368
var list = read();
369369
console.json(list);
370+
log.green('output to console');
370371

371372
}//test
372373

@@ -687,11 +688,20 @@
687688

688689
save.source = async function(){
689690
console.log('save.source');
691+
if(!filenav.cur){
692+
log.red('no file selected');
693+
return;
694+
}
690695
console.log(filenav.cur,zip);
691696
var path = filenav.cur.path+filenav.cur.name;
692697
path = path.slice(1);
693698
console.log(path);
694-
var blob = await zip.file(path).async('blob');
699+
var zf = zip.file(path);
700+
if(!zf){
701+
log.red(path+' not found');
702+
return;
703+
}
704+
var blob = await zf.async('blob');
695705
console.log(blob);
696706
return blob;
697707

@@ -710,8 +720,10 @@
710720

711721

712722
save.complete.save = function(file,confirm=true){
713-
console.log('save.complete.save');
714-
console.log('save.complete',arguments);
723+
console.log('save.complete.save',arguments);
724+
if(confirm){
725+
log.green(file.name+' saved');
726+
}
715727

716728
}//save
717729

0 commit comments

Comments
 (0)