diff options
Diffstat (limited to 'modules/core/module-simplegui.js')
| -rw-r--r-- | modules/core/module-simplegui.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/core/module-simplegui.js b/modules/core/module-simplegui.js index 78fa9b5..09d172a 100644 --- a/modules/core/module-simplegui.js +++ b/modules/core/module-simplegui.js @@ -29,8 +29,9 @@ } const label = args[0], command = args.slice(1).join(' '); const id = 'gui-btn-' + Date.now(); + const safeCmd = command.replace(/'/g, "\\'"); this.terminal.printHTML(`<div style="margin: 5px 0;"> - <button class="qa-btn" onclick="${command}" id="${id}">${label}</button> + <button class="qa-btn" onclick="(window.webx11||window).executeCommand('${safeCmd}')" id="${id}">${label}</button> </div>`); this.guiElements[id] = { type: 'button', label, command }; this.terminal.print(`Button '${label}' created`, "success"); |