Skip to content

Commit

Permalink
[UPD] download all warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Jul 29, 2024
1 parent 1bbffc6 commit 8925da2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ ul {
#loading span {
display: block;
}
#loading button {
font-size: 0.5em;
margin: 2em 0.5em 0;
padding: .5em 1em;
}

#header > *,
#footer > *,
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ function save(opt) {
case 'all': {
var tab = Object.keys(glyphs)
const dload = document.getElementById('loading')
dload.querySelector('span').innerHTML = '<i>It may take sometimes...</i><br/><button>download '+tab.length+' svg file...</button><button class="cancel">cancel</button>';
dload.querySelector('button').addEventListener('click', saveAll)
dload.querySelector('button.cancel').addEventListener('click', function() { dload.close(); });
dload.showModal();
function saveAll() {
var g = tab.pop();
Expand All @@ -133,14 +136,13 @@ function save(opt) {
rep = rep.replace(/fill:#([^;|\"]*)/g, 'fill:' + $('#icon i').css('color'));
var blob = new Blob([rep], {type: "text/plain;charset=utf-8"});
saveAs(blob, glyph.name + '.svg');
saveAll()
setTimeout(saveAll, 300);
}
})
} else {
dload.close()
}
}
saveAll();
break;
}
case 'svg': {
Expand Down

0 comments on commit 8925da2

Please sign in to comment.