diff --git a/CloudSupport.js b/CloudSupport.js index 4a0f3edea..7fea049cf 100644 --- a/CloudSupport.js +++ b/CloudSupport.js @@ -7,6 +7,15 @@ When running at the clode on NodeJS some things work diffently that at the brows */ +function runBot() { + + let root = newRoot(); + + root.initialize(); + root.start(); + +} + function webRequire(pModulePath) { diff --git a/Panels/TimeControlPanel.js b/Panels/TimeControlPanel.js index a80248771..5c913bcb3 100644 --- a/Panels/TimeControlPanel.js +++ b/Panels/TimeControlPanel.js @@ -214,7 +214,8 @@ function newTimeControlPanel() { case "Play Forward": - pressPlayForward(); + runBot(); + //pressPlayForward(); break; case "Fast Forward": diff --git a/Server/CloudScripts.js b/Server/CloudScripts.js index b7f86697c..ef3a4b266 100644 --- a/Server/CloudScripts.js +++ b/Server/CloudScripts.js @@ -263,11 +263,14 @@ let result = pData.substring(pData.indexOf('=') + 2); - result = result.replace("require", "webRequire"); - result = result.replace("global", "window"); + result = replaceAll(result, "require", "webRequire"); + result = replaceAll(result, "global", "window"); return result; + function replaceAll(text, search, replacement) { + return text.replace(new RegExp(search, 'g'), replacement); + } } function createHTML(callBackfunction) {