1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

allow user to pick any type of file to load in CLI

This commit is contained in:
Károly Kiripolszky 2019-04-29 10:34:10 +02:00
parent 0458198e9a
commit 6062d76ed3

View file

@ -203,10 +203,14 @@ TABS.cli.initialize = function (callback, nwGui) {
} }
$('.tab-cli .load').click(function() { $('.tab-cli .load').click(function() {
var suffix = 'txt', var accepts = [
accepts = [{ {
description: suffix.toUpperCase() + ' files', extensions: [suffix], description: 'Config files', extensions: ["txt", "config"],
}]; },
{
description: 'All files',
},
];
chrome.fileSystem.chooseEntry({type: 'openFile', accepts: accepts}, function(entry) { chrome.fileSystem.chooseEntry({type: 'openFile', accepts: accepts}, function(entry) {
if (chrome.runtime.lastError) { if (chrome.runtime.lastError) {