mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 01:35:28 +03:00
add button to copy CLI contents to clipboard
This commit is contained in:
parent
eb4a0d7808
commit
eb899ddf21
3 changed files with 14 additions and 0 deletions
|
@ -107,6 +107,16 @@ TABS.cli.initialize = function (callback) {
|
|||
$('.tab-cli .window .wrapper').empty();
|
||||
});
|
||||
|
||||
$('.tab-cli .copy').click(function() {
|
||||
try {
|
||||
let gui = require('nw.gui'),
|
||||
clipboard = gui.Clipboard.get();
|
||||
clipboard.set(self.outputHistory, "text");
|
||||
} catch (ex) {
|
||||
console.warn(ex);
|
||||
}
|
||||
});
|
||||
|
||||
// Tab key detection must be on keydown,
|
||||
// `keypress`/`keyup` happens too late, as `textarea` will have already lost focus.
|
||||
textarea.keydown(function (event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue