From 82883794823a2e5d170f66cde2334334f32fab20 Mon Sep 17 00:00:00 2001 From: lxsang Date: Tue, 7 May 2019 14:34:26 +0200 Subject: [PATCH] add start/stop buttons --- LuaPlayground/assets/scheme.html | 2 ++ LuaPlayground/build/debug/main.js | 8 ++++++++ LuaPlayground/build/debug/scheme.html | 2 ++ LuaPlayground/coffees/main.coffee | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/LuaPlayground/assets/scheme.html b/LuaPlayground/assets/scheme.html index 224902c..9f037a1 100644 --- a/LuaPlayground/assets/scheme.html +++ b/LuaPlayground/assets/scheme.html @@ -5,6 +5,8 @@ + +
diff --git a/LuaPlayground/build/debug/main.js b/LuaPlayground/build/debug/main.js index 56ef7ff..e77eb75 100644 --- a/LuaPlayground/build/debug/main.js +++ b/LuaPlayground/build/debug/main.js @@ -223,6 +223,14 @@ (this.find("log-clear")).set("onbtclick", function(e) { return me.log("clean"); }); + (this.find("code-run")).set("onbtclick", function(e) { + return me.run(); + }); + (this.find("code-stop")).set("onbtclick", function(e) { + if (me.socket) { + return me.socket.close(); + } + }); this.socket = null; return this.bindKey("CTRL-R", function() { return me.run(); diff --git a/LuaPlayground/build/debug/scheme.html b/LuaPlayground/build/debug/scheme.html index 224902c..9f037a1 100644 --- a/LuaPlayground/build/debug/scheme.html +++ b/LuaPlayground/build/debug/scheme.html @@ -5,6 +5,8 @@ + +
diff --git a/LuaPlayground/coffees/main.coffee b/LuaPlayground/coffees/main.coffee index 2595932..ebcb7f1 100644 --- a/LuaPlayground/coffees/main.coffee +++ b/LuaPlayground/coffees/main.coffee @@ -163,6 +163,12 @@ class LuaPlayground extends this.OS.GUI.BaseApplication me.editor.resize() (@find "log-clear").set "onbtclick", (e) -> me.log "clean" + (@find "code-run").set "onbtclick", (e) -> + me.run() + + (@find "code-stop").set "onbtclick", (e) -> + me.socket.close() if me.socket + @socket = null @bindKey "CTRL-R", () -> me.run() menu: () ->