Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
924c68f8
Commit
924c68f8
authored
10 years ago
by
XhmikosR
Committed by
XhmikosR
10 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Update FileSaver.js v2014-08-29.
parent
7ded2d18
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Gruntfile.js
+1
-1
Gruntfile.js
docs/assets/js/vendor/FileSaver.js
+14
-5
docs/assets/js/vendor/FileSaver.js
with
15 additions
and
6 deletions
+15
-6
Gruntfile.js
+
1
-
1
View file @
924c68f8
...
...
@@ -129,7 +129,7 @@ module.exports = function (grunt) {
'
docs/assets/js/vendor/jszip.min.js
'
,
'
docs/assets/js/vendor/uglify.min.js
'
,
'
docs/assets/js/vendor/Blob.js
'
,
'
docs/assets/js/vendor/
f
ile
s
aver.js
'
,
'
docs/assets/js/vendor/
F
ile
S
aver.js
'
,
'
docs/assets/js/raw-files.min.js
'
,
'
docs/assets/js/src/customizer.js
'
],
...
...
This diff is collapsed.
Click to expand it.
docs/assets/js/vendor/
f
ile
s
aver.js
→
docs/assets/js/vendor/
F
ile
S
aver.js
+
14
-
5
View file @
924c68f8
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 2014-0
7
-2
1
* 2014-0
8
-2
9
*
* By Eli Grey, http://eligrey.com
* License: X11/MIT
...
...
@@ -31,7 +31,7 @@ var saveAs = saveAs
return
view
.
URL
||
view
.
webkitURL
||
view
;
}
,
save_link
=
doc
.
createElementNS
(
"
http://www.w3.org/1999/xhtml
"
,
"
a
"
)
,
can_use_save_link
=
!
view
.
externalHost
&&
"
download
"
in
save_link
,
can_use_save_link
=
"
download
"
in
save_link
,
click
=
function
(
node
)
{
var
event
=
doc
.
createEvent
(
"
MouseEvents
"
);
event
.
initMouseEvent
(
...
...
@@ -53,13 +53,18 @@ var saveAs = saveAs
// the reasoning behind the timeout and revocation flow
,
arbitrary_revoke_timeout
=
10
,
revoke
=
function
(
file
)
{
setTimeout
(
function
()
{
var
revoker
=
function
()
{
if
(
typeof
file
===
"
string
"
)
{
// file is an object URL
get_URL
().
revokeObjectURL
(
file
);
}
else
{
// file is a File
file
.
remove
();
}
},
arbitrary_revoke_timeout
);
};
if
(
view
.
chrome
)
{
revoker
();
}
else
{
setTimeout
(
revoker
,
arbitrary_revoke_timeout
);
}
}
,
dispatch
=
function
(
filesaver
,
event_types
,
event
)
{
event_types
=
[].
concat
(
event_types
);
...
...
@@ -95,7 +100,11 @@ var saveAs = saveAs
if
(
target_view
)
{
target_view
.
location
.
href
=
object_url
;
}
else
{
view
.
open
(
object_url
,
"
_blank
"
);
var
new_tab
=
view
.
open
(
object_url
,
"
_blank
"
);
if
(
new_tab
==
undefined
&&
typeof
safari
!==
"
undefined
"
)
{
//Apple do not allow window.open, see http://bit.ly/1kZffRI
view
.
location
.
href
=
object_url
}
}
filesaver
.
readyState
=
filesaver
.
DONE
;
dispatch_all
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment