re-introduce profile export as file

This commit is contained in:
Stewart Allen 2020-06-13 18:13:47 -04:00
commit a7b3c6d0d0
4 changed files with 18 additions and 7 deletions

View file

@ -467,13 +467,13 @@
}).request("/data/"+ settings().id + "/" + settings().ver, set);
}
function settingsExport() {
let name = WIN.prompt("Download Settings Filename", "kiriconf");
function profileExport() {
let name = WIN.prompt("Export Profile Filename", "kiriconf");
if (!name) return;
let json = API.conf.export(),
blob = new Blob([json], {type: "octet/stream"}),
url = WIN.URL.createObjectURL(blob);
$('help').innerHTML = `<a id="sexport" href="${url}" download="${name}.b64">x</a>`;
$('mod-any').innerHTML = `<a id="sexport" href="${url}" download="${name}.b64">x</a>`;
$('sexport').click();
}
@ -1865,6 +1865,7 @@
$('set-prefs').onclick = (ev) => { ev.stopPropagation(); API.modal.show('prefs') };
$('set-help').onclick = (ev) => { ev.stopPropagation(); API.help.show() };
$('acct-help').onclick = (ev) => { ev.stopPropagation(); API.help.show() };
$('acct-export').onclick = (ev) => { ev.stopPropagation(); profileExport() };
$('file-recent').onclick = () => { API.modal.show('files') };
$('file-import').onclick = () => { API.event.import() };
$('lt-back').onclick = API.platform.layout;

View file

@ -11,9 +11,14 @@
// https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API
let IDB = self.indexedDB || self.mozIndexedDB || self.webkitIndexedDB || self.msIndexedDB,
IRR = self.IDBKeyRange,
local = null;
let IDB, IRR, local = null;
try {
IDB = self.indexedDB || self.mozIndexedDB || self.webkitIndexedDB || self.msIndexedDB;
IRR = self.IDBKeyRange;
} catch (e) {
console.log("in private or restricted browsing mode. database storage blocked. application may not function.");
}
/**
* @param {String} dbname

View file

@ -855,7 +855,9 @@ th, tr, td {
height: 10px;
}
.pop-sep {
height: 1.5px;
border: 0 !important;
padding: 0 !important;
height: 1px;
margin-top: 2px;
background-color: #bbb;
}

View file

@ -51,6 +51,9 @@
<div id="lset-da">danish</div>
</div>
</div>
<div id="acct-export" class="col a-end">
<label>export</label>
</div>
<div id="acct-help" class="col a-end">
<label>help</label>
</div>