Fixed sending of command again. Also now make g and m codes appear in uppercase automatically.
This commit is contained in:
parent
1dd0aba8f5
commit
677d33e448
1 changed files with 8 additions and 9 deletions
|
|
@ -89,18 +89,17 @@ function TerminalViewModel(loginStateViewModel, settingsViewModel) {
|
|||
}
|
||||
|
||||
self.sendCommand = function() {
|
||||
/*
|
||||
var re = /^([gm][0-9]+)(\s.*)?/;
|
||||
var commandMatch = command.match(re);
|
||||
if (commandMatch != null) {
|
||||
command = commandMatch[1].toUpperCase() + ((commandMatch[2] !== undefined) ? commandMatch[2] : "");
|
||||
}
|
||||
*/
|
||||
|
||||
var command = self.command();
|
||||
|
||||
var re = /^([gm][0-9]+)(\s.*)?/;
|
||||
var commandMatch = command.match(re);
|
||||
if (commandMatch != null) {
|
||||
command = commandMatch[1].toUpperCase() + ((commandMatch[2] !== undefined) ? commandMatch[2] : "");
|
||||
}
|
||||
|
||||
if (command) {
|
||||
$.ajax({
|
||||
url: AJAX_BASEURL + "control/command",
|
||||
url: AJAX_BASEURL + "control/printer/command",
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
contentType: "application/json; charset=UTF-8",
|
||||
|
|
|
|||
Loading…
Reference in a new issue