Fixed sending of command again. Also now make g and m codes appear in uppercase automatically.

This commit is contained in:
Gina Häußge 2013-11-25 11:46:24 +01:00
parent 1dd0aba8f5
commit 677d33e448

View file

@ -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",