Commit 70bb15dc authored by Einsteins Workshop's avatar Einsteins Workshop

making saving stl, amf, x3d "work" with safari. It puts the text file in...

making saving stl, amf, x3d "work" with safari.  It puts the text file in another safari window, which can be saved using ctrl-S.  What a pain!
parent 3571771e
......@@ -1333,7 +1333,8 @@ Blockscad.Processor.prototype = {
var blob;
if(format == "stla") {
blob = this.currentObject.toStlString();
blob = new Blob([blob],{ type: this.formatInfo(format).mimetype });
// console.log("this format mimetype is:", this.formatInfo(format).mimetype);
blob = new Blob([blob],{ type: "text/plain; charset=utf-8"});
}
else if(format == "stlb") {
blob = this.currentObject.toStlBinary({webBlob: true});
......@@ -1346,13 +1347,15 @@ Blockscad.Processor.prototype = {
producer: "BlocksCAD "+Blockscad.version,
date: new Date()
});
blob = new Blob([blob],{ type: this.formatInfo(format).mimetype });
blob = new Blob([blob],{ type: "text/plain; charset=utf-8"});
}
else if(format == "x3d") {
blob = this.currentObject.toX3D();
blob = new Blob([blob],{ type: "text/plain; charset=utf-8"});
}
else if(format == "dxf") {
blob = this.currentObject.toDxf();
blob = new Blob([blob],{ type: "text/plain; charset=utf-8"});
}
else {
throw new Error("Not supported");
......@@ -1362,6 +1365,9 @@ Blockscad.Processor.prototype = {
supportedFormatsForCurrentObject: function() {
if (this.currentObject instanceof CSG) {
// if safari, don't let them save stlb
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1)
return ["stla", "amf", "x3d"];
return ["stlb", "stla", "amf", "x3d"];
} else if (this.currentObject instanceof CAG) {
return ["dxf"];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment