FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Method-Draw/editor/embedapi.html at master · FEsource/Method-Draw · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
FEsource
/
Method-Draw
Public
forked from
methodofaction/Method-Draw
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Method-Draw
/
editor
/
embedapi.html
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (46 loc) · 1.9 KB
Breadcrumbs
Method-Draw
/
editor
/
embedapi.html
Copy path
File metadata and controls
56 lines (46 loc) · 1.9 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="
http://www.w3.org/1999/xhtml
"
>
<
head
>
<
title
>
</
title
>
</
head
>
<
body
>
<
script
type
="
text/javascript
"
src
="
embedapi.js
"
>
</
script
>
<
script
type
="
text/javascript
"
>
var
svgCanvas
=
null
;
function
init_embed
(
)
{
var
frame
=
document
.
getElementById
(
'svgedit'
)
;
svgCanvas
=
new
embedded_svg_edit
(
frame
)
;
// Hide main button, as we will be controlling new/load/save etc from the host document
var
doc
;
doc
=
frame
.
contentDocument
;
if
(
!
doc
)
{
doc
=
frame
.
contentWindow
.
document
;
}
var
mainButton
=
doc
.
getElementById
(
'main_button'
)
;
mainButton
.
style
.
display
=
'none'
;
}
function
handleSvgData
(
data
,
error
)
{
if
(
error
)
{
alert
(
'error '
+
error
)
;
}
else
{
alert
(
'Congratulations. Your SVG string is back in the host page, do with it what you will\n\n'
+
data
)
;
}
}
function
loadSvg
(
)
{
var
svgexample
=
'<svg width="640" height="480" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><g><title>Layer 1</title><rect stroke-width="5" stroke="#000000" fill="#FF0000" id="svg_1" height="35" width="51" y="35" x="32"/><ellipse ry="15" rx="24" stroke-width="5" stroke="#000000" fill="#0000ff" id="svg_2" cy="60" cx="66"/></g></svg>'
;
svgCanvas
.
setSvgString
(
svgexample
)
;
}
function
saveSvg
(
)
{
svgCanvas
.
getSvgString
(
)
(
handleSvgData
)
;
}
</
script
>
<
button
onclick
="
loadSvg();
"
>
Load example
</
button
>
<
button
onclick
="
saveSvg();
"
>
Save data
</
button
>
<
br
/>
<
iframe
src
="
index.html
"
width
="
900px
"
height
="
600px
"
id
="
svgedit
"
onload
="
init_embed()
"
>
</
iframe
>
</
body
>
</
html
>
Back
|
FazBrowse Home
|
New Git URL