fix exporting larger srts

This commit is contained in:
j 2015-12-25 19:17:47 +05:30
parent 4c7afc7428
commit 328b3752fc

View file

@ -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) {