From a89e4b49526fcdd86bcc377f79057528368e434c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 21 May 2018 18:54:27 +0200 Subject: [PATCH] Global for Windows --- CloudSupport.js | 9 +++++++++ Panels/TimeControlPanel.js | 3 ++- Server/CloudScripts.js | 7 +++++-- 3 files changed, 16 insertions(+), 3 deletions(-) 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) {