From b231e8a664edb740d9631cf6dd9477e2eece227e Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 28 Oct 2026 07:07:57 +0100 Subject: [PATCH] feat(viewer): export FreeMind and XMind maps as KityMinder files FreeMind and XMind maps open read-only, since the app cannot write those formats back. Offer them an export to KityMinder (.km) in the export menu, so edits can be kept in a format the app saves. The entry is only shown for files that cannot be saved in their own format. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Andy Scherzinger (cherry picked from commit b0cec9b7bcb142e1a97a0953ec440d4f2689b1f8) Signed-off-by: Andy Scherzinger --- src/viewer.js | 9 +++++++++ templates/viewer.php | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/viewer.js b/src/viewer.js index 46108aa0..ae003791 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -180,6 +180,9 @@ normalizeMouseWheel(); window.$('#export-text').click(function() { self.exportText() }) + window.$('#export-km').click(function() { + self.exportKm() + }) window.$('#save-button').click(function() { self.save() }) @@ -349,6 +352,7 @@ normalizeMouseWheel(); /* When extension cannot write, hide save checkbox */ if (!window.parent.OCA.FilesMindMap._file.supportedWrite) { window.$('#save-div').hide() + window.$('#export-km-item').prop('hidden', false) } }, function(msg) { self._loadStatus = false @@ -416,6 +420,11 @@ normalizeMouseWheel(); }) }, + exportKm() { + const url = 'data:application/km;base64,' + Base64.encode(JSON.stringify(minder.exportJson())) + this.download(url, 'km') + }, + exportPDF() { const self = this minder.exportData('png').then(function(data) { diff --git a/templates/viewer.php b/templates/viewer.php index 0dd52cc4..4615884a 100644 --- a/templates/viewer.php +++ b/templates/viewer.php @@ -170,6 +170,9 @@ class="btn btn-default export-caption dropdown-toggle"
  • t('Export to Text')); ?>
  • +