diff --git a/src/js/macros.js b/src/js/macros.js index 398e38c..06b8d7c 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -66,7 +66,7 @@ module.exports = { alert(`Unsupported file type: ${extension}`); return; } - + console.log("file: ",file); SvelteComponents.showDialog("Upload", { file, onComplete: () => { @@ -87,6 +87,7 @@ module.exports = { console.log(macrosColor, macrosName); this.config.macros[this.tab - 1].name = macrosName; + console.log(this.config.macros[this.tab-1]); this.config.macros[this.tab - 1].color = macrosColor; this.config.macros[this.tab - 1].gcode_file_name = this.state.selected; this.config.macros[this.tab - 1].gcode_file_time = diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index cbbbb4c..b9c70aa 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -75,7 +75,7 @@ script#macros-template(type="text/x-template") accept=".nc,.ngc,.gcode,.gc") br .gcodeContainer - textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode' @input="updateNewGcode") + textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode") gcode-viewer(v-if="state.selected !== 'default'") button.submit-macros(title="Save Macros",@click="confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save @@ -135,7 +135,7 @@ script#macros-template(type="text/x-template") accept=".nc,.ngc,.gcode,.gc") br .gcodeContainer - textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode' @input="updateNewGcode") + textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode") gcode-viewer(v-if="state.selected !== 'default'") button.submit-macros(title="Save Macros",@click="confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save @@ -165,7 +165,7 @@ script#macros-template(type="text/x-template") accept=".nc,.ngc,.gcode,.gc") br .gcodeContainer - textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode' @input="updateNewGcode") + textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode") gcode-viewer(v-if="state.selected !== 'default'") button.submit-macros(title="Save Macros",@click="confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save @@ -195,7 +195,7 @@ script#macros-template(type="text/x-template") accept=".nc,.ngc,.gcode,.gc") br .gcodeContainer - textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode' @input="updateNewGcode") + textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode") gcode-viewer(v-if="state.selected !== 'default'") button.submit-macros(title="Save Macros",@click="confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save @@ -225,7 +225,7 @@ script#macros-template(type="text/x-template") accept=".nc,.ngc,.gcode,.gc") br .gcodeContainer - textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode' @input="updateNewGcode") + textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode") gcode-viewer(v-if="state.selected !== 'default'") button.submit-macros(title="Save Macros",@click="confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save @@ -255,7 +255,7 @@ script#macros-template(type="text/x-template") accept=".nc,.ngc,.gcode,.gc") br .gcodeContainer - textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode' @input="updateNewGcode") + textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode") gcode-viewer(v-if="state.selected !== 'default'") button.submit-macros(title="Save Macros",@click="confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save @@ -285,7 +285,7 @@ script#macros-template(type="text/x-template") accept=".nc,.ngc,.gcode,.gc") br .gcodeContainer - textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode' @input="updateNewGcode") + textarea.new-gcode( v-if="state.selected=='default'",:value='newGcode[tab-1]' @input="updateNewGcode") gcode-viewer(v-if="state.selected !== 'default'") button.submit-macros(title="Save Macros",@click="confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save