fix exporting larger srts
This commit is contained in:
parent
4c7afc7428
commit
328b3752fc
1 changed files with 8 additions and 6 deletions
14
js/app.js
14
js/app.js
|
@ -266,17 +266,19 @@ function saveTxt() {
|
|||
}
|
||||
|
||||
function saveContent(content, type, path) {
|
||||
var uriContent = 'data:'+type+';base64,' + btoa(content);
|
||||
var pom = document.createElement('a');
|
||||
pom.setAttribute('href', content);
|
||||
pom.setAttribute('download', path);
|
||||
var blob = new Blob([content], {type: type});
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = path;
|
||||
if (document.createEvent) {
|
||||
var event = document.createEvent('MouseEvents');
|
||||
event.initEvent('click', true, true);
|
||||
pom.dispatchEvent(event);
|
||||
a.dispatchEvent(event);
|
||||
} else {
|
||||
pom.click();
|
||||
a.click();
|
||||
}
|
||||
window.URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
function stDialog(titleTxt, text) {
|
||||
|
|
Loading…
Reference in a new issue