mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-07 22:18:29 +01:00
update clipper
This commit is contained in:
parent
9192578205
commit
0e6ba3c41d
@ -6,6 +6,7 @@ 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.0-a initial version
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ 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.0-a initial version
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.1.0-a",
|
||||
"version":"0.1.1-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-scissors",
|
||||
"mimes":["none"],
|
||||
|
Binary file not shown.
@ -89,18 +89,31 @@ 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", ()=>
|
||||
return unless html2canvas
|
||||
html2canvas(document.body).then (canvas) =>
|
||||
@_gui.launch "Clipper", [canvas]
|
||||
|
||||
return unless @args and @args.length is 1
|
||||
@copycanvas @args[0]
|
||||
|
||||
copycanvas: (canvas)->
|
||||
@scene.height = canvas.height
|
||||
@scene.width = canvas.width
|
||||
@scene.getContext('2d').drawImage(canvas, 0, 0)
|
||||
@dirty = true
|
||||
|
||||
capture: (el, windoff) ->
|
||||
@hide() if windoff
|
||||
html2canvas(el).then (canvas) =>
|
||||
@scene.height = canvas.height
|
||||
@scene.width = canvas.width
|
||||
@scene.getContext('2d').drawImage(canvas, 0, 0)
|
||||
@notify __("Screen captured")
|
||||
@show() if windoff
|
||||
@dirty = true
|
||||
@load new Promise (resolve, reject) =>
|
||||
html2canvas(el).then (canvas) =>
|
||||
@copycanvas canvas
|
||||
@show() if windoff
|
||||
resolve()
|
||||
.catch (e) -> reject __e e
|
||||
.then () => @notify __("Screen captured")
|
||||
.catch (e) => @error e.toString(), e
|
||||
|
||||
menu: () ->
|
||||
menu = [{
|
||||
text: "__(File)",
|
||||
@ -152,5 +165,6 @@ class Clipper extends this.OS.application.BaseApplication
|
||||
@dirty = false
|
||||
@quit()
|
||||
|
||||
Clipper.singleton = true
|
||||
|
||||
this.OS.register "Clipper", Clipper
|
@ -6,7 +6,7 @@
|
||||
"author": "",
|
||||
"email": ""
|
||||
},
|
||||
"version":"0.1.0-a",
|
||||
"version":"0.1.1-a",
|
||||
"category":"Other",
|
||||
"iconclass":"fa fa-scissors",
|
||||
"mimes":["none"],
|
||||
|
@ -50,7 +50,7 @@
|
||||
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Clipper/README.md",
|
||||
"category": "Other",
|
||||
"author": "",
|
||||
"version": "0.1.0-a",
|
||||
"version": "0.1.1-a",
|
||||
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Clipper/build/release/Clipper.zip"
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user