From d1984d89b8f399a838e8009c5777d7fb979a6ad5 Mon Sep 17 00:00:00 2001 From: Dany LE Date: Sat, 7 Jan 2023 14:51:15 +0100 Subject: [PATCH] RemoteDesktop: add toolbar for canvas control --- RemoteDesktop/README.md | 1 + RemoteDesktop/assets/main.css | 1 + RemoteDesktop/assets/scheme.html | 14 ++++++- RemoteDesktop/build/debug/README.md | 1 + RemoteDesktop/build/debug/main.css | 1 + RemoteDesktop/build/debug/main.js | 2 +- RemoteDesktop/build/debug/package.json | 2 +- RemoteDesktop/build/debug/scheme.html | 14 ++++++- RemoteDesktop/build/release/RemoteDesktop.zip | Bin 77778 -> 78100 bytes RemoteDesktop/coffees/main.coffee | 35 ++++++++++++++---- RemoteDesktop/package.json | 2 +- packages.json | 12 +----- 12 files changed, 60 insertions(+), 25 deletions(-) diff --git a/RemoteDesktop/README.md b/RemoteDesktop/README.md index c085aef..bc99cbc 100644 --- a/RemoteDesktop/README.md +++ b/RemoteDesktop/README.md @@ -7,6 +7,7 @@ Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blo ## Change logs +* v0.1.14 - Add toolbar for canvas size control * v0.1.13 - support AntOS v2.0.x * v0.1.12 - improve UI handling * v0.1.11 - Support 16 bits per pixel diff --git a/RemoteDesktop/assets/main.css b/RemoteDesktop/assets/main.css index ecb3e43..4a806e6 100644 --- a/RemoteDesktop/assets/main.css +++ b/RemoteDesktop/assets/main.css @@ -1,6 +1,7 @@ afx-app-window[data-id="RemoteDesktop"] div[data-id="container"] { background-color: #272822; + overflow: hidden; } afx-app-window[data-id="RemoteDesktop"] canvas[data-id="screen"] { diff --git a/RemoteDesktop/assets/scheme.html b/RemoteDesktop/assets/scheme.html index 08bbe4c..d038277 100644 --- a/RemoteDesktop/assets/scheme.html +++ b/RemoteDesktop/assets/scheme.html @@ -1,7 +1,17 @@ - +
-
+ + +
+ +
+ + + + +
+
\ No newline at end of file diff --git a/RemoteDesktop/build/debug/README.md b/RemoteDesktop/build/debug/README.md index c085aef..bc99cbc 100644 --- a/RemoteDesktop/build/debug/README.md +++ b/RemoteDesktop/build/debug/README.md @@ -7,6 +7,7 @@ Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blo ## Change logs +* v0.1.14 - Add toolbar for canvas size control * v0.1.13 - support AntOS v2.0.x * v0.1.12 - improve UI handling * v0.1.11 - Support 16 bits per pixel diff --git a/RemoteDesktop/build/debug/main.css b/RemoteDesktop/build/debug/main.css index ecb3e43..4a806e6 100644 --- a/RemoteDesktop/build/debug/main.css +++ b/RemoteDesktop/build/debug/main.css @@ -1,6 +1,7 @@ afx-app-window[data-id="RemoteDesktop"] div[data-id="container"] { background-color: #272822; + overflow: hidden; } afx-app-window[data-id="RemoteDesktop"] canvas[data-id="screen"] { diff --git a/RemoteDesktop/build/debug/main.js b/RemoteDesktop/build/debug/main.js index 114a526..df412be 100644 --- a/RemoteDesktop/build/debug/main.js +++ b/RemoteDesktop/build/debug/main.js @@ -1 +1 @@ -(function(){var e,t,n,s;(e=class e extends this.OS.GUI.BasicDialog{constructor(){super("ConnectionDialog",e.scheme)}main(){return super.main(),this.find("bbp").data=[{text:"16 bits",value:16,selected:!0},{text:"32 bits",value:32}],this.find("jq").value=40,this.find("bt-ok").onbtclick=e=>{var t;if(this.handle)return t={wvnc:this.find("txtWVNC").value,server:this.find("txtServer").value,bbp:this.find("bbp").selectedItem.data.value,quality:this.find("jq").value},this.handle(t),this.quit()},this.find("bt-cancel").onbtclick=e=>this.quit()}}).scheme='\n \n \n \n
\n \n \n
\n \n \n \n
\n \n \n
\n
\n
\n
\n',(t=class e extends this.OS.GUI.BasicDialog{constructor(){super("CredentialDialog",e.scheme)}main(){return this.find("bt-ok").onbtclick=()=>{var e;return this.handle?(e={username:this.find("txtUser").value,password:this.find("txtPass").value},this.handle(e),this.quit()):this.quit()},this.find("bt-cancel").onbtclick=()=>this.quit()}}).scheme='\n \n \n \n \n
\n \n \n
\n
\n
\n
',n=class extends this.OS.application.BaseApplication{constructor(e){super("RemoteDesktop",e)}main(){return this.canvas=this.find("screen"),this.container=this.find("container"),this.client=new s({element:this.canvas}),this.bindKey("CTRL-SHIFT-V",e=>this.pasteText()),this.client.ondisconnect=()=>this.showConnectionDialog(),this.client.onresize=()=>this.setScale(),this.client.onpassword=()=>new Promise((e,t)=>this.openDialog("PromptDialog",{title:__("VNC password"),label:__("VNC password"),value:"password",type:"password"}).then((function(t){return e(t)}))),this.client.oncopy=e=>this._api.setClipboard(e),this.client.oncredential=()=>new Promise((e,n)=>this.openDialog(new t,{title:__("User credential")}).then((function(t){return e(t.username,t.password)}))),this.on("resize",e=>this.setScale()),this.on("focus",e=>$(this.canvas).focus()),this.client.init().then(()=>this.showConnectionDialog())}pasteText(){var e;if(this.client)return e=e=>{if(e&&""!==e)return this.client.sendTextAsClipboard(e)},this._api.getClipboard().then(t=>e(t)).catch(t=>(this.error(__("Unable to paste"),t),this.openDialog("TextDialog",{title:"Paste text"}).then(t=>e(t)).catch(e=>this.error(e.toString(),e))))}setScale(){var e,t,n,s;if(this.client&&this.client.resolution)return s=$(this.container).width(),e=$(this.container).height(),(t=s/this.client.resolution.w)>(n=e/this.client.resolution.h)?this.client.setScale(n):this.client.setScale(t)}menu(){return[{text:"__(Connection)",nodes:[{text:"__(New Connection)",dataid:this.name+"-new"},{text:"__(Disconnect)",dataid:this.name+"-close"}],onchildselect:e=>{if(this.client)return this.client.disconnect(!1)}}]}showConnectionDialog(){if(this.client)return this.openDialog(new e,{title:__("Connection")}).then(e=>(this.client.ws=e.wvnc,this.client.connect(e.server,e)))}cleanup(){return this.client&&this.client.disconnect(!0),this.client=void 0}},this.OS.register("RemoteDesktop",n),s=class{constructor(e){var t,n;this.socket=void 0,this.ws=void 0,this.canvas=void 0,n="pkg://RemoteDesktop/decoder_asm.js".asFileHandle().getlink(),this.scale=1,e.ws&&(this.ws=e.ws),this.canvas=e.element,"string"==typeof this.canvas&&(this.canvas=document.getElementById(this.canvas)),this.decoder=new Worker(n),this.enableEvent=!1,this.pingto=!1,t=this,this.mouseMask=0,this.decoder.onmessage=function(e){return t.process(e.data)}}init(){var e;return e=this,new Promise((function(t,n){return e.canvas?($(e.canvas).attr("tabindex","1"),$(e.canvas).on("focus",()=>e.resetModifierKeys()),e.initInputEvent(),t()):n("Canvas is not set")}))}initInputEvent(){var e,t,n,s;if(n=this,this.canvas&&(t=function(e){var t;return t=n.canvas.getBoundingClientRect(),{x:Math.floor((e.clientX-t.left)/n.scale),y:Math.floor((e.clientY-t.top)/n.scale)}},s=function(e){var s;if(n.enableEvent)return s=t(e),n.sendPointEvent(s.x,s.y,n.mouseMask)},n.canvas))return n.canvas.oncontextmenu=function(e){return e.preventDefault(),!1},n.canvas.onmousemove=function(e){return s(e)},n.canvas.onmousedown=function(e){var t;return t=1<this.disconnect(!0),window.addEventListener("unload",e),window.addEventListener("beforeunload",e)}initCanvas(e,t,n){return this.canvas.width=e,this.canvas.height=t,this.resolution={w:e,h:t},this.decoder.postMessage(this.resolution),this.setScale(this.scale)}process(e){var t,n,s;if(this.socket)return n=new Uint8Array(e.pixels),(s=(t=this.canvas.getContext("2d",{alpha:!1})).createImageData(e.w,e.h)).data.set(n),t.putImageData(s,e.x,e.y)}setScale(e){if(this.scale=e,this.canvas)return this.canvas.style.transformOrigin="0 0",this.canvas.style.transform="scale("+e+")"}connect(e,t){var n;if(n=this,this.disconnect(!1),this.ws)return this.socket=new WebSocket(this.ws),this.socket.binaryType="arraybuffer",this.socket.onopen=function(){return console.log("socket opened"),n.initConnection(e,t)},this.socket.onmessage=function(e){return n.consume(e)},this.socket.onerror=e=>n.onerror("Websocket error"),this.socket.onclose=function(){return n.socket=null,n.canvas.style.cursor="auto",n.canvas&&n.resolution&&n.canvas.getContext("2d").clearRect(0,0,n.resolution.w,n.resolution.h),n.pingto&&clearTimeout(n.pingto),n.pingto=void 0,n.ondisconnect(),console.log("socket closed")}}disconnect(e){return this.socket&&this.socket.close(),this.socket=void 0,e&&this.decoder.terminate(),this.enableEvent=!1}initConnection(e,t){var n;return(n=new Uint8Array(e.length+2))[0]=16,n[1]=50,t&&(t.bbp&&(n[0]=t.bbp),t.quality&&(n[1]=t.quality)),n.set((new TextEncoder).encode(e),2),this.socket.send(this.buildCommand(1,n))}resetModifierKeys(){if(this.socket&&this.enableEvent)return this.sendKeyEvent(65511,0),this.sendKeyEvent(65512,0),this.sendKeyEvent(65505,0),this.sendKeyEvent(65507,0),this.sendKeyEvent(65513,0)}sendPointEvent(e,t,n){var s;if(this.socket&&this.enableEvent)return(s=new Uint8Array(5))[0]=255&e,s[1]=e>>8,s[2]=255&t,s[3]=t>>8,s[4]=n,this.socket.send(this.buildCommand(5,s))}sendKeyEvent(e,t){var n;if(this.socket&&this.enableEvent)return(n=new Uint8Array(3))[0]=255&e,n[1]=e>>8&255,n[2]=t,this.socket.send(this.buildCommand(6,n))}sendPing(){if(this.socket)return this.socket.send(this.buildCommand(8,"PING WVNC"))}buildCommand(e,t){var n,s;switch(s=void 0,typeof t){case"string":s=(new TextEncoder).encode(t);break;case"number":s=new Uint8Array([t]);break;default:s=t}return(n=new Uint8Array(s.length+3))[0]=e,n[2]=s.length>>8,n[1]=15&s.length,n.set(s,3),n.buffer}oncopy(e){return console.log("Get clipboard text: "+e)}onpassword(){return new Promise((function(e,t){return t("onpassword is not implemented")}))}sendTextAsClipboard(e){var t;if(this.socket)return this.socket.send(this.buildCommand(7,e)),t="v".charCodeAt(0),this.sendKeyEvent(65507,1),this.sendKeyEvent(t,1),this.sendKeyEvent(t,0),this.sendKeyEvent(65507,0)}oncredential(){return new Promise((function(e,t){return t("oncredential is not implemented")}))}onerror(e){return console.log("Error",e)}onresize(){return console.log("resize")}ondisconnect(){return console.log("disconnect")}consume(e){var t,n,s,i,a,o,r;switch(t=(n=new Uint8Array(e.data))[0],o=this,t){case 254:return n=n.subarray(1,n.length-1),s=new TextDecoder("utf-8"),this.onerror(s.decode(n));case 129:return console.log("Request for password"),this.enableEvent=!1,this.onpassword().then((function(e){return o.socket.send(o.buildCommand(2,e)),o.enableEvent=!0}));case 130:return console.log("Request for login"),this.enableEvent=!1,this.oncredential().then((function(e,t){var n;return(n=new Uint8Array(e.length+t.length+1)).set((new TextEncoder).encode(e),0),n.set(["\0"],e.length),n.set((new TextEncoder).encode(t),e.length+1),o.socket.send(o.buildCommand(3,n)),o.enableEvent=!0}));case 131:if(r=n[1]|n[2]<<8,a=n[3]|n[4]<<8,this.initCanvas(r,a),this.socket.send(this.buildCommand(4,1)),this.enableEvent=!0,this.onresize(),this.pingto)return;return i=()=>(this.sendPing(),this.pingto=setTimeout(i,5e3)),this.pingto=setTimeout(i,5e3);case 132:return this.decoder.postMessage(n.buffer,[n.buffer]),this.socket.send(this.buildCommand(4,1));case 133:return n=n.subarray(1),s=new TextDecoder("utf-8"),this.oncopy(s.decode(n)),this.socket.send(this.buildCommand(4,1));default:return console.log(t)}}},window.WVNC=s}).call(this); \ No newline at end of file +(function(){var e,t,n,s;(e=class e extends this.OS.GUI.BasicDialog{constructor(){super("ConnectionDialog",e.scheme)}main(){return super.main(),this.find("bbp").data=[{text:"16 bits",value:16,selected:!0},{text:"32 bits",value:32}],this.find("jq").value=40,this.find("bt-ok").onbtclick=e=>{var t;if(this.handle)return t={wvnc:this.find("txtWVNC").value,server:this.find("txtServer").value,bbp:this.find("bbp").selectedItem.data.value,quality:this.find("jq").value},this.handle(t),this.quit()},this.find("bt-cancel").onbtclick=e=>this.quit()}}).scheme='\n \n \n \n
\n \n \n
\n \n \n \n
\n \n \n
\n
\n
\n
\n',(t=class e extends this.OS.GUI.BasicDialog{constructor(){super("CredentialDialog",e.scheme)}main(){return this.find("bt-ok").onbtclick=()=>{var e;return this.handle?(e={username:this.find("txtUser").value,password:this.find("txtPass").value},this.handle(e),this.quit()):this.quit()},this.find("bt-cancel").onbtclick=()=>this.quit()}}).scheme='\n \n \n \n \n
\n \n \n
\n
\n
\n
',n=class extends this.OS.application.BaseApplication{constructor(e){super("RemoteDesktop",e)}main(){return this.canvas=this.find("screen"),this.container=this.find("container"),this.zoom=this.find("zoom"),this.btreset=this.find("btreset"),this.zoom.max=200,this.zoom.value=100,this.zoom.onvaluechange=e=>this.setScale(),this.find("scroll_down").onbtclick=e=>this.container.scrollTop+=20,this.find("scroll_up").onbtclick=e=>this.container.scrollTop-=20,this.find("scroll_left").onbtclick=e=>this.container.scrollLeft-=20,this.find("scroll_right").onbtclick=e=>this.container.scrollLeft+=20,this.btreset.onbtclick=e=>{var t,n,s,i;return i=$(this.container).width(),t=$(this.container).height(),n=i/this.client.resolution.w,s=t/this.client.resolution.h,this.zoom.value=n>s?100*s:100*n,this.setScale()},this.client=new s({element:this.canvas}),this.bindKey("CTRL-SHIFT-V",e=>this.pasteText()),this.client.ondisconnect=()=>this.showConnectionDialog(),this.client.onresize=()=>this.setScale(),this.client.onpassword=()=>new Promise((e,t)=>this.openDialog("PromptDialog",{title:__("VNC password"),label:__("VNC password"),value:"password",type:"password"}).then((function(t){return e(t)}))),this.client.oncopy=e=>this._api.setClipboard(e),this.client.oncredential=()=>new Promise((e,n)=>this.openDialog(new t,{title:__("User credential")}).then((function(t){return e(t.username,t.password)}))),this.on("focus",e=>$(this.canvas).focus()),this.client.init().then(()=>this.showConnectionDialog())}pasteText(){var e;if(this.client)return e=e=>{if(e&&""!==e)return this.client.sendTextAsClipboard(e)},this._api.getClipboard().then(t=>e(t)).catch(t=>(this.error(__("Unable to paste"),t),this.openDialog("TextDialog",{title:"Paste text"}).then(t=>e(t)).catch(e=>this.error(e.toString(),e))))}setScale(){if(console.log("scale changed"),this.client&&this.client.resolution)return this.client.setScale(this.zoom.value/100),this.container.scrollLeft=0,this.container.scrollTop=0}menu(){return[{text:"__(Connection)",nodes:[{text:"__(New Connection)",dataid:this.name+"-new"},{text:"__(Disconnect)",dataid:this.name+"-close"}],onchildselect:e=>{if(this.client)return this.client.disconnect(!1)}}]}showConnectionDialog(){if(this.client)return this.openDialog(new e,{title:__("Connection")}).then(e=>(this.client.ws=e.wvnc,this.client.connect(e.server,e)))}cleanup(){return this.client&&this.client.disconnect(!0),this.client=void 0}},this.OS.register("RemoteDesktop",n),s=class{constructor(e){var t,n;this.socket=void 0,this.ws=void 0,this.canvas=void 0,n="pkg://RemoteDesktop/decoder_asm.js".asFileHandle().getlink(),this.scale=1,e.ws&&(this.ws=e.ws),this.canvas=e.element,"string"==typeof this.canvas&&(this.canvas=document.getElementById(this.canvas)),this.decoder=new Worker(n),this.enableEvent=!1,this.pingto=!1,t=this,this.mouseMask=0,this.decoder.onmessage=function(e){return t.process(e.data)}}init(){var e;return e=this,new Promise((function(t,n){return e.canvas?($(e.canvas).attr("tabindex","1"),$(e.canvas).on("focus",()=>e.resetModifierKeys()),e.initInputEvent(),t()):n("Canvas is not set")}))}initInputEvent(){var e,t,n,s;if(n=this,this.canvas&&(t=function(e){var t;return t=n.canvas.getBoundingClientRect(),{x:Math.floor((e.clientX-t.left)/n.scale),y:Math.floor((e.clientY-t.top)/n.scale)}},s=function(e){var s;if(n.enableEvent)return s=t(e),n.sendPointEvent(s.x,s.y,n.mouseMask)},n.canvas))return n.canvas.oncontextmenu=function(e){return e.preventDefault(),!1},n.canvas.onmousemove=function(e){return s(e)},n.canvas.onmousedown=function(e){var t;return t=1<this.disconnect(!0),window.addEventListener("unload",e),window.addEventListener("beforeunload",e)}initCanvas(e,t,n){return this.canvas.width=e,this.canvas.height=t,this.resolution={w:e,h:t},this.decoder.postMessage(this.resolution),this.setScale(this.scale)}process(e){var t,n,s;if(this.socket)return n=new Uint8Array(e.pixels),(s=(t=this.canvas.getContext("2d",{alpha:!1})).createImageData(e.w,e.h)).data.set(n),t.putImageData(s,e.x,e.y)}setScale(e){if(this.scale=e,this.canvas)return this.canvas.style.transformOrigin="0 0",this.canvas.style.transform="scale("+e+")"}connect(e,t){var n;if(n=this,this.disconnect(!1),this.ws)return this.socket=new WebSocket(this.ws),this.socket.binaryType="arraybuffer",this.socket.onopen=function(){return console.log("socket opened"),n.initConnection(e,t)},this.socket.onmessage=function(e){return n.consume(e)},this.socket.onerror=e=>n.onerror("Websocket error"),this.socket.onclose=function(){return n.socket=null,n.canvas.style.cursor="auto",n.canvas&&n.resolution&&n.canvas.getContext("2d").clearRect(0,0,n.resolution.w,n.resolution.h),n.pingto&&clearTimeout(n.pingto),n.pingto=void 0,n.ondisconnect(),console.log("socket closed")}}disconnect(e){return this.socket&&this.socket.close(),this.socket=void 0,e&&this.decoder.terminate(),this.enableEvent=!1}initConnection(e,t){var n;return(n=new Uint8Array(e.length+2))[0]=16,n[1]=50,t&&(t.bbp&&(n[0]=t.bbp),t.quality&&(n[1]=t.quality)),n.set((new TextEncoder).encode(e),2),this.socket.send(this.buildCommand(1,n))}resetModifierKeys(){if(this.socket&&this.enableEvent)return this.sendKeyEvent(65511,0),this.sendKeyEvent(65512,0),this.sendKeyEvent(65505,0),this.sendKeyEvent(65507,0),this.sendKeyEvent(65513,0)}sendPointEvent(e,t,n){var s;if(this.socket&&this.enableEvent)return(s=new Uint8Array(5))[0]=255&e,s[1]=e>>8,s[2]=255&t,s[3]=t>>8,s[4]=n,this.socket.send(this.buildCommand(5,s))}sendKeyEvent(e,t){var n;if(this.socket&&this.enableEvent)return(n=new Uint8Array(3))[0]=255&e,n[1]=e>>8&255,n[2]=t,this.socket.send(this.buildCommand(6,n))}sendPing(){if(this.socket)return this.socket.send(this.buildCommand(8,"PING WVNC"))}buildCommand(e,t){var n,s;switch(s=void 0,typeof t){case"string":s=(new TextEncoder).encode(t);break;case"number":s=new Uint8Array([t]);break;default:s=t}return(n=new Uint8Array(s.length+3))[0]=e,n[2]=s.length>>8,n[1]=15&s.length,n.set(s,3),n.buffer}oncopy(e){return console.log("Get clipboard text: "+e)}onpassword(){return new Promise((function(e,t){return t("onpassword is not implemented")}))}sendTextAsClipboard(e){var t;if(this.socket)return this.socket.send(this.buildCommand(7,e)),t="v".charCodeAt(0),this.sendKeyEvent(65507,1),this.sendKeyEvent(t,1),this.sendKeyEvent(t,0),this.sendKeyEvent(65507,0)}oncredential(){return new Promise((function(e,t){return t("oncredential is not implemented")}))}onerror(e){return console.log("Error",e)}onresize(){return console.log("resize")}ondisconnect(){return console.log("disconnect")}consume(e){var t,n,s,i,a,o,r;switch(t=(n=new Uint8Array(e.data))[0],o=this,t){case 254:return n=n.subarray(1,n.length-1),s=new TextDecoder("utf-8"),this.onerror(s.decode(n));case 129:return console.log("Request for password"),this.enableEvent=!1,this.onpassword().then((function(e){return o.socket.send(o.buildCommand(2,e)),o.enableEvent=!0}));case 130:return console.log("Request for login"),this.enableEvent=!1,this.oncredential().then((function(e,t){var n;return(n=new Uint8Array(e.length+t.length+1)).set((new TextEncoder).encode(e),0),n.set(["\0"],e.length),n.set((new TextEncoder).encode(t),e.length+1),o.socket.send(o.buildCommand(3,n)),o.enableEvent=!0}));case 131:if(r=n[1]|n[2]<<8,a=n[3]|n[4]<<8,this.initCanvas(r,a),this.socket.send(this.buildCommand(4,1)),this.enableEvent=!0,this.onresize(),this.pingto)return;return i=()=>(this.sendPing(),this.pingto=setTimeout(i,5e3)),this.pingto=setTimeout(i,5e3);case 132:return this.decoder.postMessage(n.buffer,[n.buffer]),this.socket.send(this.buildCommand(4,1));case 133:return n=n.subarray(1),s=new TextDecoder("utf-8"),this.oncopy(s.decode(n)),this.socket.send(this.buildCommand(4,1));default:return console.log(t)}}},window.WVNC=s}).call(this); \ No newline at end of file diff --git a/RemoteDesktop/build/debug/package.json b/RemoteDesktop/build/debug/package.json index d39faba..1f86f21 100644 --- a/RemoteDesktop/build/debug/package.json +++ b/RemoteDesktop/build/debug/package.json @@ -7,7 +7,7 @@ "author": "Dany LE", "email": "contact@iohub.dev" }, - "version":"0.1.13-b", + "version":"0.1.14-b", "dependencies": [], "category":"Internet", "icon": "icon.png", diff --git a/RemoteDesktop/build/debug/scheme.html b/RemoteDesktop/build/debug/scheme.html index 08bbe4c..d038277 100644 --- a/RemoteDesktop/build/debug/scheme.html +++ b/RemoteDesktop/build/debug/scheme.html @@ -1,7 +1,17 @@ - +
-
+ + +
+ +
+ + + + +
+
\ No newline at end of file diff --git a/RemoteDesktop/build/release/RemoteDesktop.zip b/RemoteDesktop/build/release/RemoteDesktop.zip index 2b913a12d9c147e036715c2b28c80e51ba9c785d..e651d470ebaa77384a1693b719010bd8e6b5cb56 100644 GIT binary patch delta 5452 zcmZu#1yGc4zg?E@P!{P$I+q6NZV+ii8l)ExBwXO7LAp@{1ea90r9(n;3F#16kWK{z zk<0gecdqyEz3uO?R5r9A-JdhTgy;hVr6AauI zM$D#BTWiE1&;>6DgnPT~X6*#$bN2f37~!=bN^!#_T#QVj%3@<3BAwS_^PHIS)!zM# zY@_W@%~zVW(GDTNc(fsk4|HbJ?jSE0pTEs(ZyQLN||v_=K`0&g^Qc%w@G5Dc-K= z>)x;Fk#x5(#MJjEMay_=?DCcm#95L%d69e!#dQ$72b^_+qZhHJd-_ zc^ty-o#imOd#@MPq`&pZXWL`cG<1^gquz6x6`1>x@I*Mu?DERJBfErIuImIRojxHk zd-f=}a6D#putq;-bCEFRr&&6hx-Iqv?|W%&%_t2Z=!4)+)ARmmr_f@K!}$;HCFcJ2 z$F=L|6CX)ao`%e-Hj~G|5Km$4#Zc|I_{GU^R{ox|%G@_H8Owk!$giHpMXeY!m*fJc z$VwZ8>rnku>7Lk_$Nqxy{;t6F4*!a22NIvNXePS3p_gYR<7D3xif>9ImfP^jd|p%G zT@F2Jd@ROP~ zl}U?^z$H?sxpiBbJrO0#NvMK)xg2KVOp?1QI^gNFBi)An6o@9j%!MxOg-shkk`33Ef0jj%QF zLqBrc^xZdJ0Jj6ytIOey))mTI<_S=YCXofJZps9WhJ8nSMX&CHcXgfRDH%#ozOca1 zhb(c;Tq&P&+11nh;c6QNBMQcFS5<%Ijq?Nz4`_5E1RDH(*lWvoI*FnXPyef5Nu;Zi zXMZ|>LV~vsMhYw+wPYMTA^sXkq6M(gsKGju>>m};=K?~|b0ka`+bmrAVK>s8vcTyGgsaC48O>iP)={d^%Q!rtBrf@j^3-BxdFB>hkLk;C0`S0 zktN~pqD}hV8Sgh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8 z;`e>K80jYyQJ<4R$?GaGalNFP(UoJiUYNg z+FfDMFXWetmb=ZmT?Ufude#S-zW<@HXhzbgP~NexZtyy?gy52gOk4=OLaA1wywUN< z3l+zXf+_8KB#Ks$>ew|1%As0BI`7KnXLS=Lm3U767aVS^=}d6 zzsUf(X#bT&{&gq?#EV8J#zF!Bd~kO#Gcs|pe@OkWnEylEzY|M8NrCaAJ^BkyfgRua zC>8*KdNAC-Lms@lCn==7Xw>iig!6Cu{2h48@jqnxcM00>BM%)OSZ9k301*Fu=D`DT rrSR~e(f?J#)fb @quit() @@ -83,6 +82,29 @@ class RemoteDesktop extends this.OS.application.BaseApplication main: () -> @canvas = @find "screen" @container = @find "container" + @zoom = @find "zoom" + @btreset = @find "btreset" + @zoom.max = 200 + @zoom.value = 100 + @zoom.onvaluechange = (e) => @setScale() + @find("scroll_down").onbtclick = (e) => + @container.scrollTop += 20 + @find("scroll_up").onbtclick = (e) => + @container.scrollTop -= 20 + @find("scroll_left").onbtclick = (e) => + @container.scrollLeft -= 20 + @find("scroll_right").onbtclick = (e) => + @container.scrollLeft += 20 + @btreset.onbtclick = (e) => + w = $(@container).width() + h = $(@container).height() + sx = w / @client.resolution.w + sy = h / @client.resolution.h + if sx > sy + @zoom.value = sy*100 + else + @zoom.value = sx*100 + @setScale() @client = new WVNC { element: @canvas } @@ -113,7 +135,7 @@ class RemoteDesktop extends this.OS.application.BaseApplication @openDialog new CredentialDialog, { title: __("User credential") } .then (d) -> r(d.username, d.password) - @on "resize", (e)=> @setScale() + # @on "resize", (e)=> @setScale() @on "focus", (e) => $(@canvas).focus() @client.init().then () => @showConnectionDialog() @@ -136,12 +158,11 @@ class RemoteDesktop extends this.OS.application.BaseApplication .catch (err) => @error err.toString(), err setScale: () -> + console.log "scale changed" return unless @client and @client.resolution - w = $(@container).width() - h = $(@container).height() - sx = w / @client.resolution.w - sy = h / @client.resolution.h - if sx > sy then @client.setScale sy else @client.setScale sx + @client.setScale @zoom.value / 100.0 + @container.scrollLeft = 0 + @container.scrollTop = 0 menu: () -> diff --git a/RemoteDesktop/package.json b/RemoteDesktop/package.json index d39faba..1f86f21 100644 --- a/RemoteDesktop/package.json +++ b/RemoteDesktop/package.json @@ -7,7 +7,7 @@ "author": "Dany LE", "email": "contact@iohub.dev" }, - "version":"0.1.13-b", + "version":"0.1.14-b", "dependencies": [], "category":"Internet", "icon": "icon.png", diff --git a/packages.json b/packages.json index da4cab1..5cd4088 100644 --- a/packages.json +++ b/packages.json @@ -69,16 +69,6 @@ "dependencies": ["Antunnel@0.2.0-b"], "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/AntunnelPlugins/build/release/AntunnelPlugins.zip" }, - { - "pkgname": "AntunnelTestClient", - "name": "AntunnelTestClient", - "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/AntunnelTestClient/README.md", - "category": "Development", - "author": "Dany LE", - "version": "0.1.0-a", - "dependencies": ["Antunnel@0.2.1-b"], - "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/AntunnelTestClient/build/release/AntunnelTestClient.zip" - }, { "pkgname": "Archive", "name": "Archive", @@ -365,7 +355,7 @@ "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/RemoteDesktop/README.md", "category": "Internet", "author": "Dany LE", - "version": "0.1.13-b", + "version": "0.1.14-b", "dependencies": [],"category":"Internet","icon":"icon.png","mimes":["none"], "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/2.0.x/RemoteDesktop/build/release/RemoteDesktop.zip" },