|
@@ -31,12 +31,15 @@
|
31
|
31
|
var styleNode = document.createElement("style");
|
32
|
32
|
|
33
|
33
|
// Copy the stylesheets from the whiteboard to the exported SVG
|
34
|
|
- stylesheets = document.styleSheets;
|
35
|
|
- styleText = "";
|
36
|
|
- Array.from(stylesheets).forEach(stylesheet => {
|
37
|
|
- styleText += "\n" + Array.from(stylesheet.cssRules).map(x => x.cssText).join("\n");
|
38
|
|
- });
|
39
|
|
- styleNode.innerHTML = styleText;
|
|
34
|
+ styleNode.innerHTML = Array.from(document.styleSheets).map(
|
|
35
|
+ function (stylesheet) {
|
|
36
|
+ return Array.from(stylesheet.cssRules).map(
|
|
37
|
+ function (rule) {
|
|
38
|
+ return rule.cssText
|
|
39
|
+ }
|
|
40
|
+ )}
|
|
41
|
+ ).join("\n")
|
|
42
|
+
|
40
|
43
|
canvasCopy.appendChild(styleNode);
|
41
|
44
|
downloadContent('data:image/svg+xml;charset=utf-8,' + encodeURIComponent(canvasCopy.outerHTML), "svg")
|
42
|
45
|
}
|