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
283ee6b3
Commit
283ee6b3
authored
Feb 24, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added
parent
e601b7b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
dev.php
dist/dev.php
+1
-0
saveto.js
src/adapter/saveto.js
+18
-0
No files found.
dist/dev.php
View file @
283ee6b3
...
...
@@ -67,6 +67,7 @@ $dependency = Array(
,
'src/protocal/plain.js'
,
'src/protocal/json.js'
,
'src/protocal/png.js'
,
'src/protocal/svg.js'
);
$content
=
""
;
...
...
src/adapter/saveto.js
View file @
283ee6b3
...
...
@@ -89,6 +89,24 @@ KM.registerToolbarUI( 'saveto', function ( name ) {
};
img
.
src
=
url
;
return
"png"
;
}
else
if
(
res
.
value
===
"svg"
)
{
var
svghtml
=
$
(
"#kityminder .kmui-editor-body"
).
html
();
// var svg = new Blob( [ svghtml ], {
// type: "image/svg+xml;charset=utf-8"
// } );
var
saveFile
=
function
(
data
,
filename
)
{
var
save_link
=
document
.
createElementNS
(
'http://www.w3.org/1999/xhtml'
,
'a'
);
//save_link.href = data;
save_link
.
href
=
'data:image/svg+xml; utf-8,'
+
svghtml
;
save_link
.
download
=
filename
;
var
event
=
document
.
createEvent
(
'MouseEvents'
);
event
.
initMouseEvent
(
'click'
,
true
,
false
,
window
,
0
,
0
,
0
,
0
,
0
,
false
,
false
,
false
,
false
,
0
,
null
);
save_link
.
dispatchEvent
(
event
);
};
var
filename
=
'kityminder_'
+
(
new
Date
()
).
getTime
()
+
'.svg'
;
saveFile
(
svg
,
filename
);
return
"svg"
;
}
var
data
=
me
.
exportData
(
res
.
value
);
var
p
=
KityMinder
.
findProtocal
(
res
.
value
);
...
...
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