Commit e171d5c1 authored by Jennie Yoder's avatar Jennie Yoder

Merge branch 'development'

Conflicts:
	blockly/core/xml.js
	blockscad/blockscad.js

fixed merge conflicts
parents 59be452f 0f669a58
...@@ -264,11 +264,13 @@ Blockly.Xml.domToWorkspace = function(workspace, xml) { ...@@ -264,11 +264,13 @@ Blockly.Xml.domToWorkspace = function(workspace, xml) {
// read in default color information. // read in default color information.
if (xmlChild.nodeName.toLowerCase() == 'color') { if (xmlChild.nodeName.toLowerCase() == 'color') {
var col = xmlChild.getAttribute('rgba'); var col = xmlChild.getAttribute('rgba');
var colA = col.split(','); if (col == "undefined") {
if (colA.length == 3) // set color to default
if (colA[0] >= 0 && colA[0] < 255) found_color = true;
if (colA[1] >= 0 && colA[1] < 255) Blockscad.setColor(255, 128, 255);
if (colA[2] >= 0 && colA[2] < 255) { }
else {
var colA = col.split(',');
Blockscad.setColor(colA[0],colA[1],colA[2]); Blockscad.setColor(colA[0],colA[1],colA[2]);
found_color = true; found_color = true;
} }
......
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
"CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL": "Führe die Anweisung solange aus wie die Bedingung falsch (false) ist.", "CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL": "Führe die Anweisung solange aus wie die Bedingung falsch (false) ist.",
"CONTROLS_FOR_HELPURL": "https://de.wikipedia.org/wiki/For-Schleif", "CONTROLS_FOR_HELPURL": "https://de.wikipedia.org/wiki/For-Schleif",
"CONTROLS_FOR_TOOLTIP": "Zähle die Variable \"%1\" von einem Startwert bis zu einem Zielwert und führe für jeden Wert eine Anweisung aus.", "CONTROLS_FOR_TOOLTIP": "Zähle die Variable \"%1\" von einem Startwert bis zu einem Zielwert und führe für jeden Wert eine Anweisung aus.",
"CONTROLS_FOR_INPUT_WITH": "Zähle", "CONTROLS_FOR_INPUT_WITH": "zähle",
"CONTROLS_FOR_INPUT_FROM_TO_BY": "von %1 bis %2 mit %3", "CONTROLS_FOR_INPUT_FROM_TO_BY": "von %1 bis %2 schritt %3",
"CONTROLS_FOREACH_HELPURL": "https://de.wikipedia.org/wiki/For-Schleife", "CONTROLS_FOREACH_HELPURL": "https://de.wikipedia.org/wiki/For-Schleife",
"CONTROLS_FOREACH_INPUT_ITEM": "Für Wert", "CONTROLS_FOREACH_INPUT_ITEM": "Für Wert",
"CONTROLS_FOREACH_INPUT_INLIST": "aus der Liste", "CONTROLS_FOREACH_INPUT_INLIST": "aus der Liste",
......
...@@ -633,7 +633,7 @@ Blockscad.readStlFile = function(evt) { ...@@ -633,7 +633,7 @@ Blockscad.readStlFile = function(evt) {
}; };
// Load Blockly's (and Blockscad's) language strings. // Load Blockly's (and Blockscad's) language strings.
console.log("trying to include message strings"); // console.log("trying to include message strings");
document.write('<script src="blockly/msg/js/' + BSUtils.LANG + '.js"></script>\n'); document.write('<script src="blockly/msg/js/' + BSUtils.LANG + '.js"></script>\n');
document.write('<script src="blockscad/msg/js/' + BSUtils.LANG + '.js"></script>\n'); document.write('<script src="blockscad/msg/js/' + BSUtils.LANG + '.js"></script>\n');
...@@ -1817,7 +1817,7 @@ Blockscad.initLanguage = function() { ...@@ -1817,7 +1817,7 @@ Blockscad.initLanguage = function() {
document.head.parentElement.setAttribute('dir', rtl ? 'rtl' : 'ltr'); document.head.parentElement.setAttribute('dir', rtl ? 'rtl' : 'ltr');
document.head.parentElement.setAttribute('lang', BSUtils.LANG); document.head.parentElement.setAttribute('lang', BSUtils.LANG);
console.log("lang is:",BSUtils.LANG); // console.log("lang is:",BSUtils.LANG);
// Sort languages alphabetically. // Sort languages alphabetically.
var languages = []; var languages = [];
......
This diff is collapsed.
This diff is collapsed.
...@@ -16,7 +16,7 @@ Blockly.Xml = Blockly.Xml || {}; ...@@ -16,7 +16,7 @@ Blockly.Xml = Blockly.Xml || {};
* @private * @private
*/ */
BlocklyStorage.backupBlocks_ = function() { BlocklyStorage.backupBlocks_ = function() {
console.log("in backupBlocks"); // console.log("in backupBlocks");
if ('localStorage' in window) { if ('localStorage' in window) {
// clear out old stuff from localStorage // clear out old stuff from localStorage
localStorage.clear(); localStorage.clear();
...@@ -71,7 +71,7 @@ BlocklyStorage.backupOnUnload = function() { ...@@ -71,7 +71,7 @@ BlocklyStorage.backupOnUnload = function() {
BlocklyStorage.restoreBlocks = function() { BlocklyStorage.restoreBlocks = function() {
var url = window.location.href.split('#')[0]; var url = window.location.href.split('#')[0];
url = url.split('?lang')[0]; url = url.split('?lang')[0];
console.log("url for restoring blocks is:",url); // console.log("url for restoring blocks is:",url);
var url2 = url + "proj_name"; var url2 = url + "proj_name";
var url3 = url + "current_project"; var url3 = url + "current_project";
var url4 = url + "current_project_key"; var url4 = url + "current_project_key";
......
...@@ -1332,8 +1332,9 @@ Blockscad.Processor.prototype = { ...@@ -1332,8 +1332,9 @@ Blockscad.Processor.prototype = {
var blob; var blob;
if(format == "stla") { if(format == "stla") {
blob = this.currentObject.toStlString(); 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") { else if(format == "stlb") {
blob = this.currentObject.toStlBinary({webBlob: true}); blob = this.currentObject.toStlBinary({webBlob: true});
...@@ -1346,13 +1347,15 @@ Blockscad.Processor.prototype = { ...@@ -1346,13 +1347,15 @@ Blockscad.Processor.prototype = {
producer: "BlocksCAD "+Blockscad.version, producer: "BlocksCAD "+Blockscad.version,
date: new Date() 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") { else if(format == "x3d") {
blob = this.currentObject.toX3D(); blob = this.currentObject.toX3D();
blob = new Blob([blob],{ type: "text/plain; charset=utf-8"});
} }
else if(format == "dxf") { else if(format == "dxf") {
blob = this.currentObject.toDxf(); blob = this.currentObject.toDxf();
blob = new Blob([blob],{ type: "text/plain; charset=utf-8"});
} }
else { else {
throw new Error("Not supported"); throw new Error("Not supported");
...@@ -1362,6 +1365,9 @@ Blockscad.Processor.prototype = { ...@@ -1362,6 +1365,9 @@ Blockscad.Processor.prototype = {
supportedFormatsForCurrentObject: function() { supportedFormatsForCurrentObject: function() {
if (this.currentObject instanceof CSG) { 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"]; return ["stlb", "stla", "amf", "x3d"];
} else if (this.currentObject instanceof CAG) { } else if (this.currentObject instanceof CAG) {
return ["dxf"]; return ["dxf"];
...@@ -1400,7 +1406,7 @@ Blockscad.Processor.prototype = { ...@@ -1400,7 +1406,7 @@ Blockscad.Processor.prototype = {
}[format]; }[format];
}, },
generateAndSaveRenderedFile: function() { generateAndSvaeRenderedFile: function() {
var blob = this.currentObjectToBlob(); var blob = this.currentObjectToBlob();
var ext = this.selectedFormatInfo().extension; var ext = this.selectedFormatInfo().extension;
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="173.33546mm" width="182.92386mm"
height="74.702179mm" height="74.427254mm"
viewBox="0 0 614.18078 264.69276" viewBox="0 0 648.15541 263.71862"
id="svg4208" id="svg4208"
version="1.1" version="1.1"
inkscape:version="0.91 r13725" inkscape:version="0.91 r13725"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="0.71402898" inkscape:zoom="0.71402898"
inkscape:cx="489.58952" inkscape:cx="489.58952"
inkscape:cy="-2.4141017" inkscape:cy="-2.4141171"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer1" inkscape:current-layer="layer1"
showgrid="false" showgrid="false"
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
inkscape:snap-global="false" inkscape:snap-global="false"
inkscape:object-nodes="true" inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true" inkscape:snap-smooth-nodes="true"
inkscape:window-width="1858" inkscape:window-width="1304"
inkscape:window-height="1178" inkscape:window-height="746"
inkscape:window-x="54" inkscape:window-x="54"
inkscape:window-y="-8" inkscape:window-y="-8"
inkscape:window-maximized="1" inkscape:window-maximized="1"
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:type <dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title /> <dc:title></dc:title>
</cc:Work> </cc:Work>
</rdf:RDF> </rdf:RDF>
</metadata> </metadata>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
inkscape:label="Layer 1" inkscape:label="Layer 1"
inkscape:groupmode="layer" inkscape:groupmode="layer"
id="layer1" id="layer1"
transform="translate(-116.87792,-294.77042)"> transform="translate(-116.87792,-295.74454)">
<path <path
style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" style="opacity:1;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 329.38909,434.73022 30.72177,0" d="m 329.38909,434.73022 30.72177,0"
...@@ -256,6 +256,6 @@ ...@@ -256,6 +256,6 @@
sodipodi:role="line" sodipodi:role="line"
id="tspan4772-9" id="tspan4772-9"
x="641.79846" x="641.79846"
y="455.7511">faces</tspan></text> y="455.7511">flächen</tspan></text>
</g> </g>
</svg> </svg>
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