From 38d86c5f8ab312813defdb34d8e25fb4c0153126 Mon Sep 17 00:00:00 2001 From: luc lebosse Date: Wed, 29 Mar 2017 13:31:04 +0200 Subject: [PATCH] Fix javascript compatibility issue on send command --- esp3d/data/printer.tpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esp3d/data/printer.tpl b/esp3d/data/printer.tpl index e3a745e1..b7ea3b90 100644 --- a/esp3d/data/printer.tpl +++ b/esp3d/data/printer.tpl @@ -385,7 +385,8 @@ var XYfeedrate=$XY_FEEDRATE$; var Zfeedrate=$Z_FEEDRATE$; var Efeedrate=$E_FEEDRATE$; -function Sendcommand(commandtxt, showresult=false){ +function Sendcommand(commandtxt, showresult){ +if (typeof showresult === 'undefined')showresult=false var xmlhttp = new XMLHttpRequest(); var url = "/command?plain="+encodeURIComponent(commandtxt); if (!showresult)url = "/command_silent?plain="+encodeURIComponent(commandtxt); @@ -407,7 +408,8 @@ ms += new Date().getTime(); while (new Date() < ms){} } -function SendJogcommand( cmd, feedrate, extra=""){ +function SendJogcommand( cmd, feedrate, extra){ +if (typeof extra === 'undefined')extra="" if (extra != ""){ Sendcommand(extra); delay(100);