From 0f896688999244816849bbfa72c3659778407a9e Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Thu, 11 Jan 2024 23:31:28 +0530 Subject: [PATCH] logging upload and v-on:click --- src/js/macros.js | 3 +++ src/pug/templates/macros.pug | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index bad3973..f17a1b1 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -51,13 +51,16 @@ module.exports = { this.newGCode[this.tab-1] = ""; }, upload: function (e) { + console.log('54'); const files = e.target.files || e.dataTransfer.files; if (!files.length) { return; } const file = files[0]; + console.log(file); const extension = file.name.split(".").pop(); + console.log(extension); switch (extension.toLowerCase()) { case "nc": case "ngc": diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index 9f3d81c..5080634 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -77,7 +77,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=0; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=0;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel @@ -107,7 +107,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=1; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=1;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel @@ -137,7 +137,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=2; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=2;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel @@ -167,7 +167,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=3; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=3;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel @@ -197,7 +197,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=4; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=4;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel @@ -227,7 +227,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=5; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=5;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel @@ -257,7 +257,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=6; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=6;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel @@ -287,7 +287,7 @@ script#macros-template(type="text/x-template") .gcodeContainer 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="currentTab=7; confirmSave=true", + button.submit-macros(title="Save Macros",v-on:click="currentTab=7;confirmSave=true", style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border:0;margin-top:30px") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros", style="height:50px;width:140px;font-weight:normal;margin-left:5px;background-color:#f6f6f6;color:#000;border:0;margin-top:30px") Cancel