From acdd317ea96884ef61e833b9c33a62210f046914 Mon Sep 17 00:00:00 2001 From: Darren Date: Tue, 25 Nov 2014 10:55:51 +0000 Subject: [PATCH] Added pre-defined 'events' object into user scripts --- client/src/applets/scripteditor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/applets/scripteditor.js b/client/src/applets/scripteditor.js index 9c0afe1..e427fb3 100644 --- a/client/src/applets/scripteditor.js +++ b/client/src/applets/scripteditor.js @@ -39,10 +39,11 @@ // Build the user script up with some pre-defined components script_content = 'var network = kiwi.components.Network();\n'; script_content += 'var input = kiwi.components.ControlInput();\n'; + script_content += 'var events = kiwi.components.Events();\n'; script_content += this.editor.getValue() + '\n'; // Add a dispose method to the user script for cleaning up - script_content += 'this._dispose = function(){ network.off(); input.off(); if(this.dispose) this.dispose(); }'; + script_content += 'this._dispose = function(){ network.off(); input.off(); events.dispose(); if(this.dispose) this.dispose(); }'; // Try to compile the user script try { -- 2.25.1