aboutsummaryrefslogtreecommitdiff
path: root/script.it/state.ml
diff options
context:
space:
mode:
Diffstat (limited to 'script.it/state.ml')
-rwxr-xr-xscript.it/state.ml18
1 files changed, 4 insertions, 14 deletions
diff --git a/script.it/state.ml b/script.it/state.ml
index ad7abb3..cb5d9ff 100755
--- a/script.it/state.ml
+++ b/script.it/state.ml
@@ -357,20 +357,10 @@ let do_action
)) in
let content = El.prop Elements.Prop.outerHTML svg in
-
- let btoa = Jv.get Jv.global "btoa" in
- let base64data = Jv.apply btoa
- [| Jv.of_jstr content |] in
-
- (* Create the link to download the the element, and simulate a click on it *)
- let a = El.a
- ~at:At.[
- href Jstr.( (v "data:image/svg+xml;base64,") + (Jv.Id.of_jv base64data))
- ; v (Jstr.v "download") (Jstr.v "out.svg")
- ]
- [] in
- El.click a
- );
+ Elements.Transfert.send
+ ~mime_type:(Jstr.v "image/svg+xml")
+ ~filename:(Jstr.v "out.svg")
+ content);
state
| `Angle value , _ ->