Support for scripts on web pages

This commit is contained in:
Jeff Parsons 2017-01-25 09:44:06 -08:00 committed by Jeff Parsons
commit c37cb26800
4 changed files with 28 additions and 17 deletions

View file

@ -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("script(" + 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;
}
}
}