From a2b38c7136abe796effdc6016528344cb5ab0b71 Mon Sep 17 00:00:00 2001 From: lxsang Date: Tue, 14 Jul 2020 23:27:28 +0200 Subject: [PATCH] update clipper --- Clipper/README.md | 3 ++- Clipper/build/debug/README.md | 3 ++- Clipper/build/debug/chessboard.gif | Bin 8668 -> 0 bytes Clipper/build/debug/main.js | 2 +- Clipper/build/debug/package.json | 2 +- Clipper/build/release/Clipper.zip | Bin 187806 -> 179093 bytes Clipper/coffees/main.coffee | 2 +- Clipper/package.json | 2 +- packages.json | 2 +- 9 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 Clipper/build/debug/chessboard.gif diff --git a/Clipper/README.md b/Clipper/README.md index 6364bfa..e71ce42 100644 --- a/Clipper/README.md +++ b/Clipper/README.md @@ -6,7 +6,8 @@ Clipper use `html2canvas` to capture AntOS desktop or a specific window. It is able to crop the captured image before saving to a file ## Change logs -* v0.1.1-a use ALT-S as global shortcut for screen capture +* v0.1.2-a use ALT-S as global shortcut for screen capture +* v0.1.1-a use CTRL-S as global shortcut for screen capture * v0.1.0-a initial version diff --git a/Clipper/build/debug/README.md b/Clipper/build/debug/README.md index 6364bfa..e71ce42 100644 --- a/Clipper/build/debug/README.md +++ b/Clipper/build/debug/README.md @@ -6,7 +6,8 @@ Clipper use `html2canvas` to capture AntOS desktop or a specific window. It is able to crop the captured image before saving to a file ## Change logs -* v0.1.1-a use ALT-S as global shortcut for screen capture +* v0.1.2-a use ALT-S as global shortcut for screen capture +* v0.1.1-a use CTRL-S as global shortcut for screen capture * v0.1.0-a initial version diff --git a/Clipper/build/debug/chessboard.gif b/Clipper/build/debug/chessboard.gif deleted file mode 100644 index 98711406e9dfcbfd01cc5a9632f395bfd0bab323..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8668 zcmV<2AtT;LNk%w1VW0w_0`~v_000010RaL60s{jB1Ox;H1qB8M1_uWR2nYxX2?+`c z3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ci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(e`?gXKsBmToeNNpY1N`S^{GVF3sRSg z(wfpVtYSTe-bJ%dcti>P`{6Si06V zwQXJPUG>_P(werlhh=P1;kwn+qV~3`oo!+jTh-UXHn@iwEpUIk*WnWPxPMu$aFhF( z;u^QMU)}9ln>(23A~(0vovv(qtJ~^Yx4Uz7Y+1*P+w-Egyl>@bN-;af_PQ6e&wOt{ z>$}nW;&;B0-EU_53*Y>9^uPACY-cgqNl=Cody`~MC8>#ElPQ>z5}q)FQR86iSr{}J z_N0b4OyLG|IKrE>B!oo?;tPxT#2)61idRhH2b;LUFwSuPHA{TW0vp(xQ`~VA2dv*8 z1DUdy&2eZ0Jl5}m_sEYeGJTuO-vi4y#4N^)ix*7e4pSL2R-UnqW6a|l<2cG-{<4q9 zY~~>o`OMR-v6QEblAbiCDWmC4bDA%p&a|jU?ddI(I@PAei>g|P7I*t{;Yw5M(D zE<3x@tfq^r3(ak~j55AV4zhg9jpX&R_sRaf^=AItt>$;bJJ`66HodDo(sQGG+~!R( zcl)i~?fN^suDz~u3%;1_GB>^AT{vsgZQFhGd*HPFx567v@PGrn;?6xdbe}t!gme7j z6n{8%Bi`7FlliCYgt(Okqqa(fEJde81i%#>KCk z+vH1s^^%`F>B|rLyW_p@>R&(I)35i!Gyd9;KR@foFZR)!|NUOCKl$@-|I_H#=K?ey40028fF-4&O diff --git a/Clipper/build/debug/main.js b/Clipper/build/debug/main.js index bd6cfd2..f012d21 100644 --- a/Clipper/build/debug/main.js +++ b/Clipper/build/debug/main.js @@ -2,7 +2,7 @@ * html2canvas 1.0.0-rc.5 * Copyright (c) 2020 Niklas von Hertzen * Released under MIT License - */var A,e;(function(){var A;(A=class extends this.OS.application.BaseApplication{constructor(A){super("Clipper",A)}main(){var A;if(this.scene=this.find("scene"),this.wrapper=this.find("wrapper"),this.cropwin=this.find("cropwin"),this.dirty=!1,this.currfile="Untitled".asFileHandle(),$(this.cropwin).css("position","absolute").hide(),this.find("btnCptScreen").onbtclick=()=>this.capture(document.body,!0),this.find("btnCptWindow").onbtclick=()=>{var A,e,t,r,n,B,s;for(e in s=[],n=OS.PM.processes)for(A=0,t=(B=n[e]).length;A{if(A)return this.capture(A.el)})},A=this.find("btnCrop"),this.cropselect=A=>{var e,t,r;return t=$(this.cropwin).offset(),r=A.clientX-t.left,e=A.clientY-t.top,$(this.cropwin).css("width",r+"px").css("height",e+"px")},this.cropup=e=>($(window).off("mousemove",this.cropselect),$(window).off("mouseup",this.cropup),this.ask({text:__("Crop the selected zone ?")}).then(e=>{var t,r,n,B,s,o,i,a;if(A.enable=!0,A.selected=!1,t=$(this.cropwin).offset(),s=$(this.scene).offset(),i=t.left-s.left,a=t.top-s.top,o=$(this.cropwin).width(),B=$(this.cropwin).height(),$(this.cropwin).hide(),$(this.cropwin).css("width","0px").css("height","0px"),e)return n=(r=this.scene.getContext("2d")).getImageData(i,a,o,B),this.scene.width=o,this.scene.height=B,r.putImageData(n,0,0),this.dirty=!0})),this.cropdown=e=>{var t;return A.enable=!1,t=$(this.scheme).offset(),$(this.cropwin).css("left",e.clientX-t.left+"px").css("top",e.clientY-t.top+"px").show(),$(window).off("mousedown",this.cropdown),$(window).mousemove(this.cropselect),$(window).mouseup(this.cropup)},A.onbtclick=()=>A.selected?$(window).mousedown(this.cropdown):$(window).off("mousedown",this.cropdown),this.bindKey("CTRL-S",()=>this.actionFile(this.name+"-Save")),this.bindKey("ALT-W",()=>this.actionFile(this.name+"-Saveas")),this.notify(__("User ALT-S global shortcut to capture the entire VDE")),this._gui.bindKey("CTRL-S",()=>{if(html2canvas)return html2canvas(document.body).then(A=>this._gui.launch("Clipper",[A]))}),this.args&&1===this.args.length)return this.copycanvas(this.args[0])}copycanvas(A){return this.scene.height=A.height,this.scene.width=A.width,this.scene.getContext("2d").drawImage(A,0,0),this.dirty=!0}capture(A,e){return e&&this.hide(),this.load(new Promise((t,r)=>html2canvas(A).then(A=>(this.copycanvas(A),e&&this.show(),t())).catch((function(A){return r(__e(A))})))).then(()=>this.notify(__("Screen captured"))).catch(A=>this.error(A.toString(),A))}menu(){return[{text:"__(File)",nodes:[{text:"__(Save)",dataid:this.name+"-Save",shortcut:"C-S"},{text:"__(Save as)",dataid:this.name+"-Saveas",shortcut:"A-W"}],onchildselect:A=>this.actionFile(A.data.item.data.dataid)}]}save(){return this.currfile.cache=this.scene.toDataURL("image/png"),this.currfile.write("base64").then(A=>(this.notify(__("File saved")),this.dirty=!1)).catch(A=>this.error(__("Cannot save to file: {0}",A.toString()),A))}actionFile(A){var e;switch(e=()=>this.openDialog("FileDialog",{title:__("Save as"),file:this.currfile}).then(A=>{var e;return e=A.file.path.asFileHandle(),"file"===A.file.type&&(e=e.parent()),this.currfile.setPath(`${e.path}/${A.name}`),this.save(this.currfile)}),A){case this.name+"-Save":return this.currfile.basename?this.save():e();case this.name+"-Saveas":return e()}}cleanup(A){if(this.dirty)return A.preventDefault(),this.ask({title:__("Quit"),text:__("Quit without saving ?")}).then(A=>{if(A)return this.dirty=!1,this.quit()})}}).singleton=!0,this.OS.register("Clipper",A)}).call(this),A=this,e=function(){"use strict"; + */var A,e;(function(){var A;(A=class extends this.OS.application.BaseApplication{constructor(A){super("Clipper",A)}main(){var A;if(this.scene=this.find("scene"),this.wrapper=this.find("wrapper"),this.cropwin=this.find("cropwin"),this.dirty=!1,this.currfile="Untitled".asFileHandle(),$(this.cropwin).css("position","absolute").hide(),this.find("btnCptScreen").onbtclick=()=>this.capture(document.body,!0),this.find("btnCptWindow").onbtclick=()=>{var A,e,t,r,n,B,s;for(e in s=[],n=OS.PM.processes)for(A=0,t=(B=n[e]).length;A{if(A)return this.capture(A.el)})},A=this.find("btnCrop"),this.cropselect=A=>{var e,t,r;return t=$(this.cropwin).offset(),r=A.clientX-t.left,e=A.clientY-t.top,$(this.cropwin).css("width",r+"px").css("height",e+"px")},this.cropup=e=>($(window).off("mousemove",this.cropselect),$(window).off("mouseup",this.cropup),this.ask({text:__("Crop the selected zone ?")}).then(e=>{var t,r,n,B,s,o,i,a;if(A.enable=!0,A.selected=!1,t=$(this.cropwin).offset(),s=$(this.scene).offset(),i=t.left-s.left,a=t.top-s.top,o=$(this.cropwin).width(),B=$(this.cropwin).height(),$(this.cropwin).hide(),$(this.cropwin).css("width","0px").css("height","0px"),e)return n=(r=this.scene.getContext("2d")).getImageData(i,a,o,B),this.scene.width=o,this.scene.height=B,r.putImageData(n,0,0),this.dirty=!0})),this.cropdown=e=>{var t;return A.enable=!1,t=$(this.scheme).offset(),$(this.cropwin).css("left",e.clientX-t.left+"px").css("top",e.clientY-t.top+"px").show(),$(window).off("mousedown",this.cropdown),$(window).mousemove(this.cropselect),$(window).mouseup(this.cropup)},A.onbtclick=()=>A.selected?$(window).mousedown(this.cropdown):$(window).off("mousedown",this.cropdown),this.bindKey("CTRL-S",()=>this.actionFile(this.name+"-Save")),this.bindKey("ALT-W",()=>this.actionFile(this.name+"-Saveas")),this.notify(__("User ALT-S global shortcut to capture the entire VDE")),this._gui.bindKey("ALT-S",()=>{if(html2canvas)return html2canvas(document.body).then(A=>this._gui.launch("Clipper",[A]))}),this.args&&1===this.args.length)return this.copycanvas(this.args[0])}copycanvas(A){return this.scene.height=A.height,this.scene.width=A.width,this.scene.getContext("2d").drawImage(A,0,0),this.dirty=!0}capture(A,e){return e&&this.hide(),this.load(new Promise((t,r)=>html2canvas(A).then(A=>(this.copycanvas(A),e&&this.show(),t())).catch((function(A){return r(__e(A))})))).then(()=>this.notify(__("Screen captured"))).catch(A=>this.error(A.toString(),A))}menu(){return[{text:"__(File)",nodes:[{text:"__(Save)",dataid:this.name+"-Save",shortcut:"C-S"},{text:"__(Save as)",dataid:this.name+"-Saveas",shortcut:"A-W"}],onchildselect:A=>this.actionFile(A.data.item.data.dataid)}]}save(){return this.currfile.cache=this.scene.toDataURL("image/png"),this.currfile.write("base64").then(A=>(this.notify(__("File saved")),this.dirty=!1)).catch(A=>this.error(__("Cannot save to file: {0}",A.toString()),A))}actionFile(A){var e;switch(e=()=>this.openDialog("FileDialog",{title:__("Save as"),file:this.currfile}).then(A=>{var e;return e=A.file.path.asFileHandle(),"file"===A.file.type&&(e=e.parent()),this.currfile.setPath(`${e.path}/${A.name}`),this.save(this.currfile)}),A){case this.name+"-Save":return this.currfile.basename?this.save():e();case this.name+"-Saveas":return e()}}cleanup(A){if(this.dirty)return A.preventDefault(),this.ask({title:__("Quit"),text:__("Quit without saving ?")}).then(A=>{if(A)return this.dirty=!1,this.quit()})}}).singleton=!0,this.OS.register("Clipper",A)}).call(this),A=this,e=function(){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use diff --git a/Clipper/build/debug/package.json b/Clipper/build/debug/package.json index f41d4e4..96a1319 100644 --- a/Clipper/build/debug/package.json +++ b/Clipper/build/debug/package.json @@ -6,7 +6,7 @@ "author": "", "email": "" }, - "version":"0.1.1-a", + "version":"0.1.2-a", "category":"Other", "iconclass":"fa fa-scissors", "mimes":["none"], diff --git a/Clipper/build/release/Clipper.zip b/Clipper/build/release/Clipper.zip index 664e8e87a6d8cc99107ab3175c3a4ac735dc1ad5..07b7abe00c20f270609fbf42cce6bec8973beb06 100644 GIT binary patch delta 385 zcmbQYn|tbaE}j5yW)?065J*|QSwu;TnKyOyy8y0t);GEt85p`Jd#he%G@2~0X2oNu zo2XD)oT}g)667;kQ>~jRb@k?LYKBZ;4bNBp_PsipiQ($zFB;D|m>qpWn(rI7-#293 ze&3LZxtjxI=y&s)6VqSqVcN`SG=1J)rb3_r+XeSA{gY)%Sv}qN4wDQM1H<&}J4}+6 zC{6%6gA?pP7@@<=z!2o>=;G_Dmzxsc&B!Fe0P#WU>gjud##r2AVPMEj%*@kEE-pru ze-{9EDA2L&FcZPFAp3N|yG)`8r|R8h5{u%V&BRcUn4F!Mo~oBsoS%no9`F1oGjGW< lFn}-{ig^}um>81M^|A`m1H4(mQfxpKoDPLM=I5E0P{B8VU&5?v785=7J`B3hJB^s<)dWtHf5*Xn)s-gfog zdtJRmTX(*{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mxh^mW*A}V4Wak}7@_0e43%$_3GvLp|IfMdFN4az zm;dQw`JjA*@D9O$yI%gue4PoABqAap_$Mg-&HS?=eM~^$^cMzO2v~gw+x>6wzk37z zHutwdvj0Io=O7@^l$U+0DlY*3{J%LR-Z>8{LIQ$+;;(T3F%VA)2*9S+_5$WkPXC+w zw@QDNBKZ$Sf`DL#>;GUj{}1(#Y(#&{`zI*>gCZapuZ@>N6F&H>W4u0^@ZqDI^@Idw bmI5|kEk7vVy!FpjlD{+HA9nh0p#=X040Y@> diff --git a/Clipper/coffees/main.coffee b/Clipper/coffees/main.coffee index 54ca201..971f5de 100644 --- a/Clipper/coffees/main.coffee +++ b/Clipper/coffees/main.coffee @@ -90,7 +90,7 @@ class Clipper extends this.OS.application.BaseApplication @bindKey "CTRL-S", () => @actionFile "#{@name}-Save" @bindKey "ALT-W", () => @actionFile "#{@name}-Saveas" @notify __("User ALT-S global shortcut to capture the entire VDE") - @_gui.bindKey "CTRL-S", ()=> + @_gui.bindKey "ALT-S", ()=> return unless html2canvas html2canvas(document.body).then (canvas) => @_gui.launch "Clipper", [canvas] diff --git a/Clipper/package.json b/Clipper/package.json index f41d4e4..96a1319 100644 --- a/Clipper/package.json +++ b/Clipper/package.json @@ -6,7 +6,7 @@ "author": "", "email": "" }, - "version":"0.1.1-a", + "version":"0.1.2-a", "category":"Other", "iconclass":"fa fa-scissors", "mimes":["none"], diff --git a/packages.json b/packages.json index a74b9b0..2c3cd34 100644 --- a/packages.json +++ b/packages.json @@ -50,7 +50,7 @@ "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Clipper/README.md", "category": "Other", "author": "", - "version": "0.1.1-a", + "version": "0.1.2-a", "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Clipper/build/release/Clipper.zip" }, {