mirror of
https://github.com/nextcloud/passman.git
synced 2025-11-08 05:04:04 +08:00
Merge branch 'fix-docx-file-handling'
This commit is contained in:
commit
1cfb9bc8b6
1 changed files with 4 additions and 4 deletions
8
js/vendor/download.js
vendored
8
js/vendor/download.js
vendored
|
|
@ -61,7 +61,7 @@
|
|||
|
||||
|
||||
//go ahead and download dataURLs right away
|
||||
if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(payload)){
|
||||
if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)){
|
||||
|
||||
if(payload.length > (1024*1024*1.999) && myBlob !== toString ){
|
||||
payload=dataUrlToBlob(payload);
|
||||
|
|
@ -112,7 +112,7 @@
|
|||
|
||||
// handle non-a[download] safari as best we can:
|
||||
if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)) {
|
||||
url=url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
|
||||
url=url.replace(/^data:([\w\/\-\+\.]+)/, defaultMime);
|
||||
if(!window.open(url)){ // popup blocked, offer direct download:
|
||||
if(confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")){ location.href=url; }
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
document.body.appendChild(f);
|
||||
|
||||
if(!winMode){ // force a mime that will download:
|
||||
url="data:"+url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
|
||||
url="data:"+url.replace(/^data:([\w\/\-\+\.]+)/, defaultMime);
|
||||
}
|
||||
f.src=url;
|
||||
setTimeout(function(){ document.body.removeChild(f); }, 333);
|
||||
|
|
@ -159,4 +159,4 @@
|
|||
}
|
||||
return true;
|
||||
}; /* end download()*/
|
||||
}));
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue