diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e43b0f9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.DS_Store
diff --git a/LuaPlayground/README.md b/LuaPlayground/README.md
new file mode 100644
index 0000000..cb079f4
--- /dev/null
+++ b/LuaPlayground/README.md
@@ -0,0 +1,3 @@
+#LuaPlayground
+
+Application for serverside code testing and analytics tool
\ No newline at end of file
diff --git a/LuaPlayground/assets/scheme.html b/LuaPlayground/assets/scheme.html
new file mode 100644
index 0000000..c7e664d
--- /dev/null
+++ b/LuaPlayground/assets/scheme.html
@@ -0,0 +1,7 @@
+
")).attr("class", t.toLowerCase())[0];
+ $(p).html(`${t}: ${m.__()}`);
+ ($(this.output)).append(p);
+ return ($(this.output)).scrollTop(this.output.scrollHeight);
+ }
+
+ run() {
+ var me, proto, value;
+ me = this;
+ value = this.editor.getValue().trim();
+ if (!(value && value !== "")) {
+ return;
+ }
+ proto = window.location.protocol === "https:" ? "wss://" : "ws://";
+ this.socket = new WebSocket(proto + this._api.HOST + "/lua-api/os/apigateway?ws=1");
+ this.socket.onopen = function() {
+ //send data to server
+ return me.socket.send(JSON.stringify({
+ code: value
+ }));
+ };
+ this.socket.onmessage = function(e) {
+ if (e.data) {
+ return me.log("INFO", e.data);
+ }
+ };
+ return this.socket.onclose = function() {
+ me.socket = null;
+ return console.log("socket closed");
+ };
+ }
+
+ cleanup(e) {
+ if (this.socket) {
+ return this.socket.close();
+ }
+ }
+
+ };
+
+ this.OS.dependencies = ["ace/ace"];
+
+ this.OS.register("LuaPlayground", LuaPlayground);
+
+}).call(this);
diff --git a/LuaPlayground/build/debug/package.json b/LuaPlayground/build/debug/package.json
new file mode 100644
index 0000000..b52c9f3
--- /dev/null
+++ b/LuaPlayground/build/debug/package.json
@@ -0,0 +1,13 @@
+{
+ "app":"LuaPlayground",
+ "name":"LuaPlayground",
+ "description":"Module testing and analytics tool",
+ "info":{
+ "author": "Xuan Sang LEs",
+ "email": "xsang.le@gmail.com"
+ },
+ "version":"0.0.1-a",
+ "category":"System",
+ "iconclass":"fa fa-adn",
+ "mimes":["none"]
+}
\ No newline at end of file
diff --git a/LuaPlayground/build/debug/scheme.html b/LuaPlayground/build/debug/scheme.html
new file mode 100644
index 0000000..c7e664d
--- /dev/null
+++ b/LuaPlayground/build/debug/scheme.html
@@ -0,0 +1,7 @@
+
").attr("class", t.toLowerCase())[0] + $(p).html "#{t}: #{m.__()}" + ($ @output).append p + ($ @output).scrollTop @output.scrollHeight + + run: () -> + me = @ + value = @editor.getValue().trim() + return unless value and value isnt "" + proto = if window.location.protocol is "https:" then "wss://" else "ws://" + @socket = new WebSocket proto + @_api.HOST + "/lua-api/os/apigateway?ws=1" + @socket.onopen = () -> + #send data to server + me.socket.send( JSON.stringify { code: value } ) + + @socket.onmessage = (e) -> me.log "INFO", e.data if e.data + @socket.onclose = () -> + me.socket = null + console.log "socket closed" + + cleanup: (e)-> + @socket.close() if @socket + +this.OS.dependencies = ["ace/ace"] +this.OS.register "LuaPlayground", LuaPlayground diff --git a/LuaPlayground/css/main.css b/LuaPlayground/css/main.css new file mode 100644 index 0000000..9582186 --- /dev/null +++ b/LuaPlayground/css/main.css @@ -0,0 +1,18 @@ +afx-app-window[data-id="LuaPlayground"] div[data-id="output"] p{ + margin:0; + padding:0; + font-family: "HermitLight"; + text-align: left; +} +afx-app-window[data-id="LuaPlayground"] div[data-id="output"]{ + background-color: #2f3129; + padding: 10px; + padding-left: 40px; + color:white; + overflow: auto; +} +afx-app-window[data-id="LuaPlayground"] afx-resizer{ + border-top: 1px solid #a6a6a6; + background-color: #2f3129; + border-right: 0; +} diff --git a/LuaPlayground/package.json b/LuaPlayground/package.json new file mode 100644 index 0000000..b52c9f3 --- /dev/null +++ b/LuaPlayground/package.json @@ -0,0 +1,13 @@ +{ + "app":"LuaPlayground", + "name":"LuaPlayground", + "description":"Module testing and analytics tool", + "info":{ + "author": "Xuan Sang LEs", + "email": "xsang.le@gmail.com" + }, + "version":"0.0.1-a", + "category":"System", + "iconclass":"fa fa-adn", + "mimes":["none"] +} \ No newline at end of file diff --git a/LuaPlayground/project.apj b/LuaPlayground/project.apj new file mode 100644 index 0000000..61e0ed8 --- /dev/null +++ b/LuaPlayground/project.apj @@ -0,0 +1 @@ +{"name":"LuaPlayground","root":"home://antosdk-apps/LuaPlayground","css":["css/main.css"],"javascripts":[],"coffees":["coffees/main.coffee"],"copies":["assets/scheme.html","package.json","README.md"]} \ No newline at end of file