1
0
Fork 0
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:
Károly Kiripolszky 2018-11-19 22:58:21 +01:00
parent eb4a0d7808
commit eb899ddf21
3 changed files with 14 additions and 0 deletions

View file

@ -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) {