Added support in the Node web server for scripts on web pages, too
This commit is contained in:
parent
aa4cdca89e
commit
25af103509
10 changed files with 88 additions and 45 deletions
|
|
@ -112,15 +112,19 @@ function commandMachine(idMachine, sComponent, sCommand, sValue)
|
|||
if (window.findMachineComponent) {
|
||||
var component = window.findMachineComponent(idMachine, sComponent);
|
||||
if (component) {
|
||||
var exports = component['exports'];
|
||||
if (exports) {
|
||||
var fnCommand = exports[sCommand];
|
||||
if (fnCommand) {
|
||||
//noinspection JSUnresolvedFunction
|
||||
if (!fnCommand.call(component, sValue)) {
|
||||
window.alert("Error calling " + idMachine + "." + sComponent + "." + sCommand + "(" + sValue + ")");
|
||||
if (sCommand == "script") {
|
||||
window.alert("commandScript('" + sValue + "')");
|
||||
} else {
|
||||
var exports = component['exports'];
|
||||
if (exports) {
|
||||
var fnCommand = exports[sCommand];
|
||||
if (fnCommand) {
|
||||
//noinspection JSUnresolvedFunction
|
||||
if (!fnCommand.call(component, sValue)) {
|
||||
window.alert("Error calling " + idMachine + "." + sComponent + "." + sCommand + "(" + sValue + ")");
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue