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
653d3005
Commit
653d3005
authored
Apr 15, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
8f752790
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
saveto.js
src/adapter/saveto.js
+13
-9
No files found.
src/adapter/saveto.js
View file @
653d3005
...
@@ -54,6 +54,13 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
...
@@ -54,6 +54,13 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
if
(
trident
&&
rv
!=
-
1
)
iev
=
11
;
if
(
trident
&&
rv
!=
-
1
)
iev
=
11
;
return
iev
;
return
iev
;
};
};
var
doSave
=
function
(
d
,
filename
)
{
var
winname
=
window
.
open
(
''
,
'_blank'
,
'height=1,width=1,top=200,left=300'
);
winname
.
document
.
open
(
'text/html'
,
'replace'
);
winname
.
document
.
writeln
(
d
);
winname
.
document
.
execCommand
(
'saveas'
,
''
,
filename
);
winname
.
close
();
};
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
comboboxWidget
.
on
(
'comboboxselect'
,
function
(
evt
,
res
)
{
var
data
=
me
.
exportData
(
res
.
value
);
var
data
=
me
.
exportData
(
res
.
value
);
var
p
=
KityMinder
.
findProtocal
(
res
.
value
);
var
p
=
KityMinder
.
findProtocal
(
res
.
value
);
...
@@ -61,20 +68,17 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
...
@@ -61,20 +68,17 @@ 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
);
if
(
ie_ver
()
>
0
)
{
if
(
ie_ver
()
>
0
)
{
console
.
log
(
"IE"
);
doSave
(
data
,
filename
);
var
iframe
=
document
.
createElement
(
'iframe'
);
//iframe.style.display = 'none';
document
.
appendChild
(
iframe
);
iframe
.
src
=
filename
;
iframe
.
contentDocument
.
body
.
innerHTML
=
data
;
iframe
.
contentDocument
.
execCommand
(
"SaveAs"
);
//document.removeChild( iframe );
}
else
{
}
else
{
doDownload
(
url
,
filename
);
doDownload
(
url
,
filename
);
}
}
}
else
if
(
data
&&
data
.
then
)
{
}
else
if
(
data
&&
data
.
then
)
{
data
.
then
(
function
(
url
)
{
data
.
then
(
function
(
url
)
{
if
(
ie_ver
()
>
0
)
{
doSave
(
data
,
filename
);
}
else
{
doDownload
(
url
,
filename
);
doDownload
(
url
,
filename
);
}
}
);
}
);
}
}
}
).
on
(
"beforeshow"
,
function
()
{
}
).
on
(
"beforeshow"
,
function
()
{
...
...
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