Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

浏览器中能否用open打开xmind获取内容 #9

Open
xlzy520 opened this issue Nov 6, 2018 · 4 comments
Open

浏览器中能否用open打开xmind获取内容 #9

xlzy520 opened this issue Nov 6, 2018 · 4 comments

Comments

@xlzy520
Copy link

xlzy520 commented Nov 6, 2018

我用jszip是可以解压出来的,但是你这个插件可能没有更新jszip的用法,导致open方法报错了

@shafdog
Copy link

shafdog commented Dec 13, 2018

After translating this, I have the same issue with XMind.open or Workbook.load not working.

Using it from a browser, it can't find the XML file within the ZIP file. Doesn't seem to be a issue with file processing in browser (vs node) since I get the error invalid xmind file. Looking at @leungwensen code, that means it can't find the XML doc after unpacking the .xmind ZIP contents.

Digging a little deeper, it appear the code assumes the file name is contents.xml, however XMind app uses the actual file name in a "real" XMind file. See

if (filename === CONST.CONTENT_XML) {

The JSZip contents have some XML but not named contents.xml:

xmindZip = Object {
  files: Object {
  Downloads/observable-and-shafdog-generated-2.xmind: Object {
  name: "Downloads/observable-and-shafdog-generated-2.xmind"
  dir: false
  date: 2018-12-13T01:16:08
  comment: null
  unixPermissions: 33188
  dosPermissions: null
  _data: Object {compressedSize: 590, uncompressedSize: 1700, crc32: 491341145, compression: Object, compressedContent: Uint8Array(590)}
  _dataBinary: true
  options: Object {
  compression: null
  compressionOptions: null
}
}
...

@xlzy520
Copy link
Author

xlzy520 commented Dec 14, 2018

@shafdog you can view my project kityminder that forked from baidu nantu, removed the baidu verification,support preview 、edit、online, not support local export xmind file but it is not difficult.

@xlzy520
Copy link
Author

xlzy520 commented Dec 14, 2018

@shafdog in https://github.com/zhibikanmohuakai/kityminder/blob/dev/src/protocol/xmind.js line 97, use the zip.HttpReader,so i can read the xmind from local and remote。 I use the url query and sessionStorage to get the xmind file's url and info.

@xlzy520
Copy link
Author

xlzy520 commented Dec 14, 2018

@shafdog also you can only extract the fearture read the xmind file. 3q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants