-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63deaf1
commit 6b9e3df
Showing
8 changed files
with
205 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
stages: | ||
- test | ||
- deploy | ||
|
||
test: | ||
stage: test | ||
image: node:14.15.4-alpine | ||
script: | ||
- npm install | ||
- npm run test | ||
|
||
pages: | ||
image: node:14.15.4-alpine | ||
stage: deploy | ||
only: | ||
- master | ||
script: | ||
- npm install | ||
- npm run build | ||
- cp -Rp dist/umd/* public/ | ||
artifacts: | ||
paths: | ||
- public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>XMind Embed Viewer (Development)</title> | ||
</head> | ||
<body> | ||
</body> | ||
<script src="xmind-embed-viewer.js"></script> | ||
<script> | ||
const init = async () => { | ||
|
||
const container = document.createElement('div') | ||
document.body.append(container) | ||
const res = await fetch('/test-1.xmind') | ||
const viewer = new XMindEmbedViewer({ | ||
el: container, | ||
file: await res.arrayBuffer(), | ||
styles: { | ||
'height': '500px', | ||
'width': '100%' | ||
} | ||
}) | ||
|
||
const eventLogsElement = document.createElement('div') | ||
eventLogsElement.style.height = '500px' | ||
eventLogsElement.style.overflow = 'scroll' | ||
|
||
const log = (type, message) => eventLogsElement.innerHTML += `<div style="margin-top: 8px">[${type}] ${typeof message === 'object' && message? JSON.stringify(message, null, 2) : message }</div>` | ||
|
||
viewer.addEventListener('sheet-switch', payload => log('event: sheet-switch', payload)) | ||
viewer.addEventListener('zoom-scale-change', payload => log('event: zoom-scale-change', payload)) | ||
viewer.addEventListener('sheets-change', payload => log('event: sheets-change', payload)) | ||
viewer.addEventListener('map-ready', payload => log('event: map-ready', payload)) | ||
|
||
const loadFile1Button = document.createElement('button') | ||
loadFile1Button.textContent = 'Load File 1' | ||
loadFile1Button.addEventListener('click', async () => { | ||
const res = await fetch('/test-1.xmind') | ||
viewer.openFile(await res.arrayBuffer()) | ||
}) | ||
|
||
const loadFile2Button = document.createElement('button') | ||
loadFile2Button.textContent = 'Load File 2' | ||
loadFile2Button.addEventListener('click', async () => { | ||
const res = await fetch('/test-2.xmind') | ||
viewer.openFile(await res.arrayBuffer()) | ||
}) | ||
|
||
document.body.appendChild(loadFile1Button) | ||
document.body.appendChild(loadFile2Button) | ||
document.body.appendChild(eventLogsElement) | ||
|
||
window.viewer = viewer | ||
} | ||
|
||
init() | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>XMind Embed Viewer (Development)</title> | ||
</head> | ||
<body> | ||
</body> | ||
<script src="xmind-embed-viewer.js"></script> | ||
<script> | ||
const init = async () => { | ||
|
||
const container = document.createElement('div') | ||
document.body.append(container) | ||
const res = await fetch('/test-1.xmind') | ||
const viewer = new XMindEmbedViewer({ | ||
el: container, | ||
file: await res.arrayBuffer(), | ||
styles: { | ||
'height': '500px', | ||
'width': '100%' | ||
} | ||
}) | ||
|
||
const eventLogsElement = document.createElement('div') | ||
eventLogsElement.style.height = '500px' | ||
eventLogsElement.style.overflow = 'scroll' | ||
|
||
const log = (type, message) => eventLogsElement.innerHTML += `<div style="margin-top: 8px">[${type}] ${typeof message === 'object' && message? JSON.stringify(message, null, 2) : message }</div>` | ||
|
||
viewer.addEventListener('sheet-switch', payload => log('event: sheet-switch', payload)) | ||
viewer.addEventListener('zoom-scale-change', payload => log('event: zoom-scale-change', payload)) | ||
viewer.addEventListener('sheets-change', payload => log('event: sheets-change', payload)) | ||
viewer.addEventListener('map-ready', payload => log('event: map-ready', payload)) | ||
|
||
const loadFile1Button = document.createElement('button') | ||
loadFile1Button.textContent = 'Load File 1' | ||
loadFile1Button.addEventListener('click', async () => { | ||
const res = await fetch('/test-1.xmind') | ||
viewer.openFile(await res.arrayBuffer()) | ||
}) | ||
|
||
const loadFile2Button = document.createElement('button') | ||
loadFile2Button.textContent = 'Load File 2' | ||
loadFile2Button.addEventListener('click', async () => { | ||
const res = await fetch('/test-2.xmind') | ||
viewer.openFile(await res.arrayBuffer()) | ||
}) | ||
|
||
document.body.appendChild(loadFile1Button) | ||
document.body.appendChild(loadFile2Button) | ||
document.body.appendChild(eventLogsElement) | ||
|
||
window.viewer = viewer | ||
} | ||
|
||
init() | ||
</script> | ||
</html> |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters