Dropbox OAuth implementation and Cloud framework

This commit is contained in:
Mészáros Gergely 2021-09-07 18:42:56 +02:00
parent abace06175
commit 4f020b846d
6 changed files with 259 additions and 57 deletions

View file

@ -695,7 +695,7 @@ function showExportPane() {
});
}
function showLoadPane() {
async function showLoadPane() {
$("#loadMapData").dialog({
title: "Load map",
resizable: false,
@ -707,6 +707,19 @@ function showLoadPane() {
}
}
});
const dpx = document.getElementById("loadFromDropbox");
const dpf = dpx.querySelector("select");
const files = await Cloud.providers.dropbox.list();
dpx.style.display = files? "block" : "none";
if (!files) return;
while(dpf.firstChild) dpf.removeChild(dpf.firstChild);
files.forEach(f => {
const opt = document.createElement('option');
opt.innerText = f.name;
opt.value = f.path;
dpf.appendChild(opt);
});
}
function loadURL() {