mirror of https://github.com/xwiki-labs/cryptpad
support import/export in kanban
This commit is contained in:
parent
1d8943e673
commit
ca409e5eaa
|
@ -326,7 +326,21 @@ define([
|
||||||
|
|
||||||
if (framework.isReadOnly()) {
|
if (framework.isReadOnly()) {
|
||||||
$container.addClass('cp-app-readonly');
|
$container.addClass('cp-app-readonly');
|
||||||
|
} else {
|
||||||
|
framework.setFileImporter({}, function (content, file) {
|
||||||
|
var parsed;
|
||||||
|
try { parsed = JSON.parse(content); }
|
||||||
|
catch (e) { return void console.error(e); }
|
||||||
|
return { content: parsed };
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
framework.setFileExporter('json', function () {
|
||||||
|
return new Blob([JSON.stringify(kanban.getBoardsJSON())], {
|
||||||
|
type: 'application/json',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
framework.onEditableChange(function (unlocked) {
|
framework.onEditableChange(function (unlocked) {
|
||||||
if (framework.isReadOnly()) { return; }
|
if (framework.isReadOnly()) { return; }
|
||||||
if (!kanban) { return; }
|
if (!kanban) { return; }
|
||||||
|
|
Loading…
Reference in New Issue