Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
566bd6d7
Commit
566bd6d7
authored
Apr 15, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
dcebf9b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
saveto.js
src/adapter/saveto.js
+9
-6
No files found.
src/adapter/saveto.js
View file @
566bd6d7
...
@@ -34,12 +34,6 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
...
@@ -34,12 +34,6 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
var
a
=
document
.
createElement
(
'a'
);
var
a
=
document
.
createElement
(
'a'
);
a
.
setAttribute
(
'download'
,
filename
);
a
.
setAttribute
(
'download'
,
filename
);
a
.
setAttribute
(
'href'
,
url
);
a
.
setAttribute
(
'href'
,
url
);
a
.
innerText
=
'我是一个下载链接'
;
a
.
style
.
position
=
'absolute'
;
a
.
style
.
zIndex
=
99999999
;
a
.
style
.
left
=
0
;
a
.
style
.
top
=
0
;
document
.
body
.
appendChild
(
a
);
var
evt
;
var
evt
;
try
{
try
{
evt
=
new
MouseEvent
(
'click'
);
evt
=
new
MouseEvent
(
'click'
);
...
@@ -57,6 +51,15 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
...
@@ -57,6 +51,15 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
if
(
typeof
(
data
)
==
'string'
)
{
if
(
typeof
(
data
)
==
'string'
)
{
var
url
=
'data:text/plain; utf-8,'
+
encodeURIComponent
(
data
);
var
url
=
'data:text/plain; utf-8,'
+
encodeURIComponent
(
data
);
doDownload
(
url
,
filename
);
doDownload
(
url
,
filename
);
if
(
navigator
.
userAgent
.
indexOf
(
"MSIE"
)
>
0
)
{
var
iframe
=
document
.
createElement
(
'iframe'
);
//iframe.style.display = 'none';
document
.
appendChild
(
iframe
);
iframe
.
src
=
filename
;
iframe
.
contentDocument
.
body
.
innerHTML
=
data
;
document
.
execCommand
(
"SaveAs"
);
document
.
removeChild
(
iframe
);
}
}
else
if
(
data
&&
data
.
then
)
{
}
else
if
(
data
&&
data
.
then
)
{
data
.
then
(
function
(
url
)
{
data
.
then
(
function
(
url
)
{
doDownload
(
url
,
filename
);
doDownload
(
url
,
filename
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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