Skip to content

Commit bf063ae

Browse files
committed
Fix filename generation for Output Settings
1 parent 3e65412 commit bf063ae

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

js/createform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ var endGcode = /*html*/ `<h4>Additional end gcode</h4>
460460
var preview = /*html*/ `<p>It is advised to preview the generated gcode through your slicer or <a href="http://zupfe.velor.ca" target="_blank">Zupfe GCode Viewer</a> before printing.`;
461461

462462
var downloadGcodeHtml = /*html*/ `<h4>Download</h4>
463-
<p><label>Filename: <input type="text" name="{formName}_filename" value="{formName}.gcode"></label></p>
463+
<p><label>Filename: <input type="text" name="{formName}_filename" value="{formName}"></label></p>
464464
<p><input type="button" onclick="downloadGcode(form, form['{formName}_filename'].value)" value="Download Gcode"></p>
465465
<p><input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters">
466466
<input type="button" onclick="downloadSettings(form, form['{formName}_filename'].value)" value="Output Settings Summary"></p>

js/gcodeprocessing.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,9 @@ function downloadGcode(form, fileName) {
715715

716716
// process finished gcode file
717717
if (!fileName) {
718-
fileName = form.description.value + ".gcode";
718+
fileName = form.description.value;
719719
}
720+
fileName += ".gcode";
720721

721722
var output = "";
722723
// prefix each line with ; to indicate comment
@@ -729,7 +730,8 @@ function downloadSettings(form, fileName) {
729730
var settings = outputSettings(form);
730731

731732
if (!fileName) {
732-
fileName = form.description.value + "settings.txt";
733+
fileName = form.description.value;
733734
}
735+
fileName += "settings.txt";
734736
downloadFile(fileName, settings);
735737
}

0 commit comments

Comments
 (0)