Skip to content

Commit 86b5c24

Browse files
committed
Fix filename generation for Output Settings
1 parent 697194d commit 86b5c24

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
@@ -327,7 +327,7 @@ var endGcode = /*html*/ `<h4>Additional end gcode</h4>
327327
var preview = /*html*/ `<p>It is advised to preview the generated gcode through your slicer or <a href="http://gcode.ws/" target="_blank">Gcode.ws</a> before printing.`;
328328

329329
var downloadGcodeHtml = /*html*/ `<h4>Download</h4>
330-
<p><label>Filename: <input type="text" name="{formName}_filename" value="{formName}.gcode"></label></p>
330+
<p><label>Filename: <input type="text" name="{formName}_filename" value="{formName}"></label></p>
331331
<p><input type="button" onclick="downloadGcode(form, form['{formName}_filename'].value)" value="Download Gcode"></p>
332332
<p><input type="button" onclick="resetFormToDefaults(form)" value="Reset parameters">
333333
<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
@@ -641,8 +641,9 @@ function downloadGcode(form, fileName) {
641641

642642
// process finished gcode file
643643
if (!fileName) {
644-
fileName = form.description.value + ".gcode";
644+
fileName = form.description.value;
645645
}
646+
fileName += ".gcode";
646647

647648
var output = "";
648649
// prefix each line with ; to indicate comment
@@ -655,7 +656,8 @@ function downloadSettings(form, fileName) {
655656
var settings = outputSettings(form);
656657

657658
if (!fileName) {
658-
fileName = form.description.value + "settings.txt";
659+
fileName = form.description.value;
659660
}
661+
fileName += "settings.txt";
660662
downloadFile(fileName, settings);
661663
}

0 commit comments

Comments
 (0)