add kiri settings export / import
This commit is contained in:
parent
e9a04969ee
commit
81b6395113
6 changed files with 104 additions and 38 deletions
|
|
@ -10,6 +10,7 @@ var gs_kiri_init = exports;
|
|||
if (self.kiri.init) return;
|
||||
|
||||
let KIRI = self.kiri,
|
||||
MOTO = self.moto,
|
||||
WIN = self.window,
|
||||
DOC = self.document,
|
||||
LOC = self.location,
|
||||
|
|
@ -434,6 +435,15 @@ var gs_kiri_init = exports;
|
|||
}).request("/data/"+ settings().id + "/" + settings().ver, set);
|
||||
}
|
||||
|
||||
function settingsExport() {
|
||||
if (!confirm('Download Kiri:Moto Settings?')) return;
|
||||
let json = API.conf.export();
|
||||
let blob = new Blob([json], {type: "octet/stream"});
|
||||
let url = WIN.URL.createObjectURL(blob);
|
||||
$('help').innerHTML = `<a id="sexport" href="${url}" download="kiriconf.b64">x</a>`;
|
||||
$('sexport').click();
|
||||
}
|
||||
|
||||
function settingsSave() {
|
||||
API.dialog.hide();
|
||||
let mode = API.mode.get(),
|
||||
|
|
@ -1218,6 +1228,9 @@ var gs_kiri_init = exports;
|
|||
],[
|
||||
UI.setupTools =
|
||||
UC.newButton(LANG.su_tool, showTools, {modes:CAM})
|
||||
],[
|
||||
UI.setupExport =
|
||||
UC.newButton(LANG.su_xprt, settingsExport, {modes:ALL})
|
||||
],[
|
||||
UI.localButton =
|
||||
UC.newButton(LANG.su_locl, API.show.local, {modes:FDM_CAM, expert:true})
|
||||
|
|
|
|||
Loading…
Reference in a new issue