diff --git a/LuaPlayground/README.md b/LuaPlayground/README.md index 7346314..6ea5a50 100644 --- a/LuaPlayground/README.md +++ b/LuaPlayground/README.md @@ -5,4 +5,5 @@ Application for serverside code testing and analytics tool. It allows to execute lua code on the server from the browser ## Change logs +* 0.0.6-a: Fix ace path error * 0.0.5-a: Fix worker path error \ No newline at end of file diff --git a/LuaPlayground/build/debug/README.md b/LuaPlayground/build/debug/README.md index 7346314..6ea5a50 100644 --- a/LuaPlayground/build/debug/README.md +++ b/LuaPlayground/build/debug/README.md @@ -5,4 +5,5 @@ Application for serverside code testing and analytics tool. It allows to execute lua code on the server from the browser ## Change logs +* 0.0.6-a: Fix ace path error * 0.0.5-a: Fix worker path error \ No newline at end of file diff --git a/LuaPlayground/build/debug/main.js b/LuaPlayground/build/debug/main.js index 47fc19f..ec44148 100644 --- a/LuaPlayground/build/debug/main.js +++ b/LuaPlayground/build/debug/main.js @@ -1,4 +1,4 @@ -(function(){var e,i,n;e=class{constructor(t){this.target=t,this.el=$("").attr("class","viewer")[0],this.offset=10,this.points=[],this.preprocess(),this.getBound(),this.prepare(),this.render()}canvasPoint(e){return new t.Point(e[0]/this.target.resolution+this.base.x,-e[1]/this.target.resolution+this.base.y)}preprocess(){return this.points=this.target.data}getBound(){var t,e,i,n,r,s,a,o;for(n={x:0,y:0},i={x:0,y:0},t=0,e=(r=this.points).length;ti.x&&(i.x=a),o>i.y&&(i.y=o);return this.bound=[n,i],this.base={x:0-this.bound[0].x+this.offset,y:this.bound[1].y+this.offset},this.width=i.x-n.x+2*this.offset,this.height=i.y-n.y+2*this.offset}drawPoint(e,i,n){return new t.Path.Circle({center:this.canvasPoint(e),radius:n,fillColor:i})}drawGrid(e,i){var n,r,s,a,o,h;for(h=this.target.resolution*e,r=Math.ceil(this.bound[0].x/e);r*ethis.editor.resize()),this.find("log-clear").onbtclick=t=>this.log("clean"),this.find("code-run").onbtclick=t=>this.run(),this.find("code-stop").onbtclick=t=>{if(this.socket)return this.socket.close()},this.socket=null,this.bindKey("CTRL-R",()=>this.run())}menu(){return[{text:"__(Code)",nodes:[{text:"__(Run)",dataid:this.name+"-Run",shortcut:"C-R"}],onchildselect:t=>this.run()}]}log(t,e){var i;return"clean"===t?$(this.output).empty():(i=$("

").attr("class",t.toLowerCase())[0],$(i).html(`${t}: ${e.__()}`),$(this.output).append(i),$(this.output).scrollTop(this.output.scrollHeight))}run(){var t;if((t=this.editor.getValue().trim())&&""!==t)return this.stream().then(e=>(this.socket=e,this.socket.onopen=()=>this.socket.send(JSON.stringify({code:t})),this.socket.onmessage=t=>{var e,i;if(t.data)try{if(i=JSON.parse(t.data),!this.view(i))return this.log("INFO",t.data)}catch(i){return e=i,this.log("INFO",t.data),console.log(e)}},this.socket.onclose=()=>(this.socket=null,console.log("socket closed")))).catch(t=>this.error(__("Unable to get websocket stream")))}view(t){var e,i;return!!(t&&t.type&&this[t.type])&&(e=this[t.type](t).el,i=$("

").attr("class","info")[0],$(i).append(e),$(this.output).append(i),$(this.output).scrollTop(this.output.scrollHeight),!0)}pc(t){return new n(t)}cleanup(t){if(this.socket)return this.socket.close()}}).dependencies=["os://scripts/ace/ace.js"],this.OS.register("LuaPlayground",i)}).call(this); +(function(){var e,i,n;e=class{constructor(t){this.target=t,this.el=$("").attr("class","viewer")[0],this.offset=10,this.points=[],this.preprocess(),this.getBound(),this.prepare(),this.render()}canvasPoint(e){return new t.Point(e[0]/this.target.resolution+this.base.x,-e[1]/this.target.resolution+this.base.y)}preprocess(){return this.points=this.target.data}getBound(){var t,e,i,n,r,s,a,o;for(n={x:0,y:0},i={x:0,y:0},t=0,e=(r=this.points).length;ti.x&&(i.x=a),o>i.y&&(i.y=o);return this.bound=[n,i],this.base={x:0-this.bound[0].x+this.offset,y:this.bound[1].y+this.offset},this.width=i.x-n.x+2*this.offset,this.height=i.y-n.y+2*this.offset}drawPoint(e,i,n){return new t.Path.Circle({center:this.canvasPoint(e),radius:n,fillColor:i})}drawGrid(e,i){var n,r,s,a,o,h;for(h=this.target.resolution*e,r=Math.ceil(this.bound[0].x/e);r*ethis.editor.resize()),this.find("log-clear").onbtclick=t=>this.log("clean"),this.find("code-run").onbtclick=t=>this.run(),this.find("code-stop").onbtclick=t=>{if(this.socket)return this.socket.close()},this.socket=null,this.bindKey("CTRL-R",()=>this.run())}menu(){return[{text:"__(Code)",nodes:[{text:"__(Run)",dataid:this.name+"-Run",shortcut:"C-R"}],onchildselect:t=>this.run()}]}log(t,e){var i;return"clean"===t?$(this.output).empty():(i=$("

").attr("class",t.toLowerCase())[0],$(i).html(`${t}: ${e.__()}`),$(this.output).append(i),$(this.output).scrollTop(this.output.scrollHeight))}run(){var t;if((t=this.editor.getValue().trim())&&""!==t)return this.stream().then(e=>(this.socket=e,this.socket.onopen=()=>this.socket.send(JSON.stringify({code:t})),this.socket.onmessage=t=>{var e,i;if(t.data)try{if(i=JSON.parse(t.data),!this.view(i))return this.log("INFO",t.data)}catch(i){return e=i,this.log("INFO",t.data),console.log(e)}},this.socket.onclose=()=>(this.socket=null,console.log("socket closed")))).catch(t=>this.error(__("Unable to get websocket stream")))}view(t){var e,i;return!!(t&&t.type&&this[t.type])&&(e=this[t.type](t).el,i=$("

").attr("class","info")[0],$(i).append(e),$(this.output).append(i),$(this.output).scrollTop(this.output.scrollHeight),!0)}pc(t){return new n(t)}cleanup(t){if(this.socket)return this.socket.close()}}).dependencies=["os://scripts/ace/ace.js"],this.OS.register("LuaPlayground",i)}).call(this); /*! * Paper.js v0.12.0 - The Swiss Army Knife of Vector Graphics Scripting. * http://paperjs.org/ diff --git a/LuaPlayground/build/debug/package.json b/LuaPlayground/build/debug/package.json index db18b71..ee377c4 100644 --- a/LuaPlayground/build/debug/package.json +++ b/LuaPlayground/build/debug/package.json @@ -6,7 +6,7 @@ "author": "Xuan Sang LEs", "email": "xsang.le@gmail.com" }, - "version":"0.0.5-a", + "version":"0.0.6-a", "category":"System", "iconclass":"fa fa-adn", "mimes":["none"] diff --git a/LuaPlayground/build/release/LuaPlayground.zip b/LuaPlayground/build/release/LuaPlayground.zip index 52c157b..f7539f5 100644 Binary files a/LuaPlayground/build/release/LuaPlayground.zip and b/LuaPlayground/build/release/LuaPlayground.zip differ diff --git a/LuaPlayground/coffees/main.coffee b/LuaPlayground/coffees/main.coffee index b3559de..ad2e621 100644 --- a/LuaPlayground/coffees/main.coffee +++ b/LuaPlayground/coffees/main.coffee @@ -149,7 +149,7 @@ class LuaPlayground extends this.OS.application.BaseApplication main: () -> @datarea = @find "editorea" @output = @find "output" - ace.config.set('basePath', "#{window.location.pathname}/scripts/ace") + ace.config.set('basePath', "scripts/ace") @.editor = ace.edit @datarea @.editor.setOptions { enableBasicAutocompletion: true, diff --git a/LuaPlayground/package.json b/LuaPlayground/package.json index db18b71..ee377c4 100644 --- a/LuaPlayground/package.json +++ b/LuaPlayground/package.json @@ -6,7 +6,7 @@ "author": "Xuan Sang LEs", "email": "xsang.le@gmail.com" }, - "version":"0.0.5-a", + "version":"0.0.6-a", "category":"System", "iconclass":"fa fa-adn", "mimes":["none"] diff --git a/packages.json b/packages.json index a439cf3..636bf36 100644 --- a/packages.json +++ b/packages.json @@ -104,7 +104,7 @@ "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/LuaPlayground/README.md", "category": "System", "author": "Xuan Sang LEs", - "version": "0.0.5-a", + "version": "0.0.6-a", "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/LuaPlayground/build/release/LuaPlayground.zip" }, {