-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (36 loc) · 1.07 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Android Vector Drawable to SVG Converter</title>
</head>
<body>
<form>
<textarea id="vdIn" rows="20" cols="120"></textarea>
<button id="vdSubmit">Submit</button>
</form>
<textarea id="svgOut" rows="20" cols="120"></textarea>
<div id="svgImage"></div>
<script type="text/javascript" src="converter.js"></script>
<script type="text/javascript">
document.getElementById("vdSubmit")
.addEventListener("click", function(event) {
event.preventDefault();
var svgEl = document.getElementById("svgImage");
var svgTextarea = document.getElementById("svgOut");
var vdIn = document.getElementById("vdIn").value;
var svgOut = null;
try {
svgOut = Converter.convertVD2SVG(vdIn);
console.log(svgOut);
} catch(error) {
svgTextarea.value = error;
return;
}
var svgSerialized = new XMLSerializer().serializeToString(svgOut);
svgTextarea.value = svgSerialized;
svgEl.innerHTML = svgSerialized;
});
</script>
</body>
</html>